  :root{
    --board: #23392c;
    --board-edge: #1a2b21;
    --chalk: #eee7d8;
    --chalk-dim: #b9baa8;
    --yellow: #e8c15a;
    --coral: #d97a5f;
    --blue: #7fa6b0;
    --wood: #6b4a2f;
    --wood-dark: #4a3220;
  }
  *{box-sizing:border-box;}
  body{
    margin:0;
    font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
    background: var(--wood-dark);
    color: var(--chalk);
    min-height:100vh;
    display:flex;
    justify-content:center;
    padding: 24px 14px 60px;
  }
  .frame{
    width:100%;
    max-width:720px;
  }
  header{
    text-align:center;
    margin-bottom:18px;
  }
  header h1{
    font-size:2.1rem;
    letter-spacing:0.5px;
    margin:0 0 4px;
    color: var(--chalk);
  }
  header p{
    margin:0;
    color: var(--chalk-dim);
    font-size:0.95rem;
  }
  .board{
    background: var(--board);
    border: 10px solid var(--wood);
    border-radius: 6px;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.4);
    padding: 22px 18px 26px;
    position:relative;
    transition: background 0.6s ease, border-color 0.6s ease;
  }
  /* 편의점 — cooler, fluorescent-lit feel */
  .board.theme-store{
    --board: #1b2a38;
    --board-edge: #142029;
    --wood: #3d5a72;
    --wood-dark: #24313c;
    --yellow: #6fe0d0;
  }
  /* 카페 — warm, caramel-toned feel */
  .board.theme-cafe{
    --board: #3b2a22;
    --board-edge: #2a1d17;
    --wood: #7a5232;
    --wood-dark: #4a3220;
    --yellow: #d9a441;
  }
  .resource-row{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(238,231,216,0.25);
  }
  .resource-row .label{ font-size:0.8rem; color:var(--chalk-dim); }
  .resource-row .value{ font-size:1.6rem; font-weight:600; }
  .resource-row .rate{ font-size:0.85rem; color: var(--yellow); }

  .progress-wrap{ margin-bottom:18px; }
  .progress-label{ font-size:0.75rem; color:var(--chalk-dim); margin-bottom:5px; }
  .progress-bar{
    height:10px;
    border-radius:6px;
    background: rgba(238,231,216,0.1);
    border: 1px solid rgba(238,231,216,0.25);
    overflow:hidden;
  }
  .progress-fill{
    height:100%;
    width:0%;
    background: var(--yellow);
    transition: width 0.4s ease;
  }
  .stars-row{
    display:flex;
    flex-wrap:wrap;
    gap:3px;
    margin-top:8px;
    min-height:20px;
  }
  .stars-row .star-icon{ font-size:0.95rem; line-height:1; }

  .growth-wall{
    border: 2px dashed rgba(238,231,216,0.35);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 16px;
    min-height: 46px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 5px;
    background: rgba(0,0,0,0.15);
  }
  .growth-wall .icon{
    font-size: 1.35rem;
    line-height: 1;
    animation: popIn 0.4s ease;
  }
  @keyframes popIn{
    0%{ transform: scale(0); opacity: 0; }
    70%{ transform: scale(1.25); opacity: 1; }
    100%{ transform: scale(1); }
  }

  .boost-banner{
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2a2110;
    background: var(--yellow);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
    animation: boostPulse 1s ease-in-out infinite;
  }
  @keyframes boostPulse{
    0%, 100%{ box-shadow: 0 0 0px rgba(232,193,90,0.6); }
    50%{ box-shadow: 0 0 14px rgba(232,193,90,0.9); }
  }

  .click-zone{
    text-align:center;
    margin: 6px 0 26px;
  }
  .flashcard{
    width:150px;
    height:150px;
    margin: 0 auto 14px;
    border: 3px solid var(--chalk);
    border-radius: 10px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:4.2rem;
    cursor:pointer;
    user-select:none;
    transition: transform 0.08s ease;
    background: rgba(238,231,216,0.04);
  }
  .flashcard:active{ transform: scale(0.94); }
  .flashcard .hint{
    position:absolute;
    font-size: 0.8rem;
    margin-top: 96px;
    color: var(--chalk-dim);
  }
  .click-caption{ font-size:0.85rem; color:var(--chalk-dim); }

  .section-title{
    font-size:0.95rem;
    color: var(--yellow);
    margin: 22px 0 10px;
    letter-spacing: 0.3px;
  }

  .jamo-list{
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
    gap:8px;
  }
  .jamo-card{
    border:1px solid rgba(238,231,216,0.2);
    border-radius:8px;
    padding:10px 8px;
    text-align:center;
    background: rgba(0,0,0,0.15);
  }
  .jamo-card.learned{ border-color: var(--yellow); background: rgba(232,193,90,0.08); }
  .jamo-card.locked{ opacity:0.45; }
  .jamo-card .glyph{ font-size:1.8rem; line-height:1.1; }
  .jamo-card .roman{ font-size:0.7rem; color: var(--chalk-dim); margin-bottom:6px; }
  .jamo-card button{
    font-size:0.75rem;
    padding: 4px 8px;
    border-radius:6px;
    border:none;
    background: var(--yellow);
    color:#2a2110;
    cursor:pointer;
    font-weight:600;
  }
  .jamo-card button:disabled{
    background: rgba(238,231,216,0.15);
    color: var(--chalk-dim);
    cursor:not-allowed;
  }
  .jamo-card .cost{ font-size:0.7rem; color:var(--chalk-dim); margin-top:4px; }

  .combo-list{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
  }
  .combo-chip{
    border:1px dashed rgba(238,231,216,0.3);
    border-radius:20px;
    padding:6px 12px;
    font-size:0.85rem;
    color: var(--chalk-dim);
  }
  .combo-chip.unlocked{
    border:1px solid var(--blue);
    color: var(--chalk);
    background: rgba(127,166,176,0.12);
  }

  .quiz-overlay{
    position:fixed; inset:0;
    background: rgba(0,0,0,0.55);
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    z-index:10;
  }
  .quiz-overlay.show{ display:flex; }
  .quiz-box{
    background: var(--board);
    border: 3px solid var(--yellow);
    border-radius:10px;
    padding:22px;
    max-width:340px;
    width:100%;
    text-align:center;
  }
  .quiz-box h3{ margin-top:0; font-size:1rem; color:var(--chalk-dim); font-weight:normal; }
  .quiz-prompt{ font-size:2.6rem; margin: 10px 0 18px; }
  .quiz-options{ display:flex; flex-direction:column; gap:8px; }
  .quiz-options button{
    padding:10px;
    border-radius:8px;
    border:1px solid rgba(238,231,216,0.3);
    background: rgba(238,231,216,0.06);
    color: var(--chalk);
    font-size:0.95rem;
    cursor:pointer;
  }
  .quiz-feedback{ margin-top:10px; font-size:1.05rem; font-weight:700; min-height:24px; color: var(--yellow); }
  .quiz-feedback.correct{ color: #8fd694; }
  .quiz-feedback.incorrect{ color: var(--coral); }
  .quiz-options button.quiz-correct{ border-color: #8fd694; background: rgba(143,214,148,0.18); }
  .quiz-options button.quiz-wrong{ border-color: var(--coral); background: rgba(217,122,95,0.18); }

  .toast{
    position:fixed;
    bottom:24px; left:50%;
    transform: translateX(-50%);
    background: var(--yellow);
    color:#2a2110;
    padding:10px 18px;
    border-radius:20px;
    font-size:0.85rem;
    font-weight:600;
    opacity:0;
    transition: opacity 0.3s ease;
    pointer-events:none;
  }
  .toast.show{ opacity:1; }

  .complete-banner{
    display:none;
    margin-top:18px;
    text-align:center;
    padding:14px;
    border:1px dashed var(--yellow);
    border-radius:8px;
    color: var(--yellow);
    font-size:0.9rem;
  }
  .complete-banner.show{ display:block; }

  .drill-btn{
    display:block;
    width:100%;
    margin: 4px 0 12px;
    padding: 9px;
    border-radius: 8px;
    border: 1px solid var(--blue);
    background: rgba(127,166,176,0.12);
    color: var(--chalk);
    font-size: 0.85rem;
    cursor: pointer;
  }
  .combo-table{ display:flex; flex-direction:column; gap:6px; }
  .combo-row{ display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
  .combo-row .row-play{
    flex: 0 0 auto;
    width:38px;
    height:30px;
    border-radius:6px;
    border:1px solid var(--yellow);
    background: rgba(232,193,90,0.12);
    color: var(--yellow);
    cursor:pointer;
    font-size:0.85rem;
  }
  .syll-cell{
    flex: 1 1 auto;
    min-width: 30px;
    height:30px;
    border-radius:6px;
    border:1px solid rgba(238,231,216,0.2);
    background: rgba(0,0,0,0.15);
    color: var(--chalk);
    font-size:0.95rem;
    cursor:pointer;
  }
  .syll-cell:hover, .combo-row .row-play:hover{ background: rgba(238,231,216,0.12); }
  .syll-cell.flash{
    background: var(--yellow);
    color: #2a2110;
    animation: syllFlash 0.4s ease;
  }
  @keyframes syllFlash{
    0%{ transform: scale(1); }
    40%{ transform: scale(1.15); }
    100%{ transform: scale(1); }
  }
  .combo-row.played .row-play{
    background: var(--yellow);
    color: #2a2110;
    border-color: var(--yellow);
    font-weight: 600;
  }
  .drill-btn.played{
    border-color: var(--yellow);
    background: rgba(232,193,90,0.18);
  }
