/* ============================================
   MEMORAID — SHARED STYLES
   Used by both index.html (marketing) and app.html (app)
   ============================================ */

  :root {
    --bg:          #f0f6ff;
    --surface:     #ffffff;
    --surface2:    #e8f0fb;
    --blue:        #3b82f6;
    --blue-light:  #60a5fa;
    --blue-dark:   #1d4ed8;
    --blue-dim:    #93c5fd;
    --blue-subtle: #dbeafe;
    --text:        #1e293b;
    --text-mid:    #475569;
    --text-dim:    #94a3b8;
    --border:      #bfdbfe;
    --border-mid:  #93c5fd;
    --green:       #22c55e;
    --green-bg:    rgba(34,197,94,0.12);
    --red:         #ef4444;
    --red-bg:      rgba(239,68,68,0.12);
    --shadow:      0 2px 12px rgba(59,130,246,0.10);
    --shadow-lg:   0 8px 32px rgba(59,130,246,0.15);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    min-height: 100vh;
    overflow-x: hidden;
  }
  body::before {
    content: ''; position: fixed; inset: 0;
    background: radial-gradient(ellipse 90% 50% at 50% -5%, rgba(59,130,246,0.10) 0%, transparent 65%);
    pointer-events: none; z-index: 0;
  }
  #app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

  /* HEADER */
  header {
    text-align: center; padding: 2rem 1rem 1.4rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface); box-shadow: var(--shadow);
    position: relative;
  }
  .logo-row { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
  .logo-icon { width: 44px; height: 44px; flex-shrink: 0; }
  header h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; color: var(--blue-dark); }
  header h1 span { color: var(--blue); }
  header p { color: var(--text-dim); margin-top: 0.25rem; font-size: 0.9rem; }
  .header-nav { margin-top: 1rem; display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
  .hamburger-btn {
    display: none; background: none; border: 1.5px solid var(--border);
    color: var(--text-mid); width: 36px; height: 36px; border-radius: 8px;
    cursor: pointer; font-size: 1.1rem; line-height: 1;
  }
  .hamburger-menu {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
    background: var(--surface); border-bottom: 1.5px solid var(--border);
    box-shadow: var(--shadow-lg); padding: 0.5rem 1rem;
    display: flex; flex-direction: column; gap: 0.25rem;
  }
  .hamburger-menu button {
    background: none; border: none; text-align: left; padding: 0.65rem 0.5rem;
    font-family: 'Nunito', sans-serif; font-size: 0.95rem; font-weight: 700;
    color: var(--text); cursor: pointer; border-bottom: 1px solid var(--border);
  }
  .hamburger-menu button:last-child { border-bottom: none; }
  .hamburger-menu button:hover { color: var(--blue); }
  @media (max-width: 540px) {
    .nav-btn, .group-badge { display: none !important; }
    .hamburger-btn { display: flex !important; align-items: center; justify-content: center; }
  }
  .nav-btn {
    background: none; border: 1.5px solid var(--border); color: var(--text-mid);
    padding: 0.35rem 1.1rem; border-radius: 2rem; cursor: pointer;
    font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 600; transition: all 0.18s;
  }
  .nav-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-subtle); }
  .nav-btn.active { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-subtle); }
  .group-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--blue-subtle); border: 1.5px solid var(--border);
    color: var(--blue-dark); padding: 0.3rem 0.9rem; border-radius: 2rem;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  }
  .group-badge button {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    font-size: 0.85rem; padding: 0; line-height: 1; font-weight: 700;
  }
  .group-badge button:hover { color: var(--red); }

  /* SCREENS */
  .screen { display: none; padding: 2rem 1rem; max-width: 820px; margin: 0 auto; width: 100%; }
  .screen.active { display: block; }

  /* LANDING */
  .landing-wrap {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 4rem 1rem; text-align: center;
    flex: 1;
  }
  .landing-logo { width: 80px; height: 80px; margin-bottom: 1.5rem; }
  .landing-wrap h2 { font-size: 1.8rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 0.5rem; }
  .landing-wrap p { color: var(--text-dim); margin-bottom: 2rem; font-size: 0.95rem; }
  .code-input-wrap { display: flex; gap: 0.5rem; max-width: 340px; width: 100%; }
  .code-input {
    flex: 1; background: var(--surface); border: 2px solid var(--border);
    color: var(--text); padding: 0.75rem 1rem; border-radius: 8px;
    font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 700;
    outline: none; transition: border-color 0.18s; text-transform: uppercase;
    letter-spacing: 0.1em; box-shadow: var(--shadow);
  }
  .code-input:focus { border-color: var(--blue); }
  .code-input::placeholder { text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--text-dim); }
  .code-error { color: var(--red); font-size: 0.85rem; margin-top: 0.75rem; font-weight: 600; min-height: 1.2em; }

  /* SONG LIST */
  .song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
  .song-card {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px;
    padding: 1.2rem; cursor: pointer; transition: all 0.18s; box-shadow: var(--shadow);
  }
  .song-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .song-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--blue-dark); }
  .song-card p { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem; }
  .parts-list { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
  .part-tag {
    font-size: 0.68rem; font-weight: 600; background: var(--blue-subtle);
    border: 1px solid var(--border-mid); color: var(--blue-dark);
    padding: 0.15rem 0.55rem; border-radius: 1rem;
  }
  .empty-state { text-align: center; padding: 3rem; color: var(--text-dim); }

  /* DRILL HEADER */
  .drill-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
  .back-btn {
    background: var(--surface); border: 1.5px solid var(--border); color: var(--text-mid);
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem;
    transition: all 0.18s; flex-shrink: 0; box-shadow: var(--shadow);
  }
  .back-btn:hover { border-color: var(--blue); color: var(--blue); }
  .drill-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--blue-dark); flex: 1; }

  /* MODE TABS */
  .mode-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
  .mode-tab {
    background: var(--surface); border: 1.5px solid var(--border); color: var(--text-mid);
    padding: 0.35rem 0.85rem; border-radius: 2rem; cursor: pointer;
    font-family: 'Nunito', sans-serif; font-size: 0.8rem; font-weight: 600;
    transition: all 0.18s; box-shadow: var(--shadow);
  }
  .mode-tab:hover { border-color: var(--blue-dim); color: var(--blue-dark); }
  .mode-tab.active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
  .mode-tab.has-missed { position: relative; }
  .mode-tab.has-missed::after {
    content: ''; position: absolute; top: -3px; right: -3px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  }

  /* CONTROLS ROW */
  .controls-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
  .controls-row label { color: var(--text-mid); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
  .ctrl-select {
    background: var(--surface); border: 1.5px solid var(--border); color: var(--text);
    padding: 0.35rem 0.7rem; border-radius: 8px;
    font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; box-shadow: var(--shadow);
  }
  .ctrl-divider { width: 1px; height: 24px; background: var(--border); margin: 0 0.25rem; flex-shrink: 0; }

  /* MODE DESC */
  .mode-desc {
    font-size: 0.8rem; color: var(--text-dim); font-style: italic;
    margin-bottom: 1.2rem; padding: 0.6rem 0.9rem;
    border-left: 3px solid var(--blue-dim);
    background: var(--blue-subtle); border-radius: 0 6px 6px 0;
  }

  /* PROGRESS */
  .progress-bar-outer { background: var(--surface2); border-radius: 4px; height: 5px; margin-bottom: 0.6rem; overflow: hidden; }
  .progress-bar-inner { height: 100%; background: var(--blue); border-radius: 4px; transition: width 0.4s ease; }
  .card-counter { text-align: right; font-size: 0.78rem; color: var(--text-dim); font-weight: 600; margin-bottom: 1rem; }

  /* CARD */
  .card {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
    padding: 2rem; min-height: 130px; display: flex; flex-direction: column;
    justify-content: center; transition: border-color 0.2s; box-shadow: var(--shadow);
    animation: cardIn 0.22s ease;
  }
  .card.is-answer { border-color: var(--blue-dim); border-width: 2px; }
  @keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .card-label { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; margin-bottom: 0.7rem; }
  .card-line { font-size: clamp(1rem, 2.5vw, 1.2rem); line-height: 1.7; color: var(--text); font-weight: 600; }

  .prev-context {
    font-size: 0.82rem; color: var(--text-mid); margin-bottom: 0.75rem;
    padding: 0.5rem 0.85rem; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface2);
  }
  .prev-context .ctx-label { display: block; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-dim); font-weight: 700; margin-bottom: 0.2rem; }

  /* CLOZE */
  .cloze-line { font-size: clamp(1rem, 2.5vw, 1.15rem); line-height: 2.4; font-weight: 600; }
  .blank-word {
    display: inline-flex; align-items: center; justify-content: center;
    border-bottom: 2.5px solid var(--blue-dim); min-width: 70px;
    color: transparent; user-select: none; transition: all 0.3s; vertical-align: bottom; text-align: center;
  }
  .blank-word.revealed { color: var(--green); border-color: var(--green); font-weight: 700; }

  /* FIRST LETTER */
  .fl-prev-context {
    font-size: 0.8rem; color: var(--text-mid); margin-bottom: 0.75rem;
    padding: 0.5rem 0.85rem; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface2);
  }
  .fl-prev-context .ctx-label { display: block; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-dim); font-weight: 700; margin-bottom: 0.25rem; }
  .first-letter-display { font-size: clamp(1rem, 2.5vw, 1.15rem); line-height: 1.9; font-weight: 600; }
  .fl-word { display: inline-block; margin-right: 0.35em; color: var(--text-dim); }
  .fl-first { color: var(--text); font-weight: 700; }

  /* PROGRESSIVE */
  .prog-scroll-box {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 12px; padding: 1.2rem; box-shadow: var(--shadow);
    max-height: 60vh; overflow-y: auto;
  }
  .prog-line { display: flex; align-items: flex-start; gap: 0.6rem; border-bottom: 1px solid var(--border); padding: 0.55rem 0; }
  .prog-line:last-child { border-bottom: none; }
  .prog-line-num { font-size: 0.7rem; color: var(--text-dim); min-width: 1.5rem; padding-top: 0.3rem; flex-shrink: 0; font-weight: 700; }
  .prog-line-speaker { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); min-width: 4.5rem; flex-shrink: 0; padding-top: 0.3rem; }
  .prog-line-speaker-focus { color: var(--blue); }
  .prog-line-focus { background: var(--blue-subtle); margin: 0 -0.5rem; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border-mid); border-left: 3px solid var(--blue); }
  .prog-line-text { flex: 1; font-size: clamp(0.9rem, 2vw, 1.05rem); line-height: 1.6; font-weight: 600; color: var(--text); }
  .prog-focus { color: var(--blue-dark); font-weight: 700; }
  .prog-context { color: var(--text-dim); font-weight: 400; font-style: italic; font-size: 0.9rem; }
  .prog-hidden { color: var(--text-dim); font-weight: 400; font-style: italic; }
  .prog-flag-btn {
    background: none; border: 1.5px solid var(--border); color: var(--text-dim);
    border-radius: 6px; padding: 0.2rem 0.6rem; font-size: 0.72rem; font-weight: 700;
    cursor: pointer; transition: all 0.18s; white-space: nowrap; flex-shrink: 0; margin-top: 0.15rem;
    font-family: 'Nunito', sans-serif;
  }
  .prog-flag-btn:hover { border-color: var(--red); color: var(--red); }
  .prog-flag-btn.flagged { border-color: var(--red); color: var(--red); background: var(--red-bg); }
  .prog-controls { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }

  /* REVIEW */
  .review-card-pair {
    background: var(--surface); border: 2px solid var(--blue-dim); border-radius: 14px;
    overflow: hidden; animation: cardIn 0.22s ease; box-shadow: var(--shadow);
  }
  .review-cue { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); font-size: clamp(0.9rem, 2vw, 1.05rem); color: var(--text-mid); font-weight: 600; }
  .review-cue .ctx-label { display: block; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-dim); font-weight: 700; margin-bottom: 0.3rem; }
  .review-answer { padding: 1.4rem 1.5rem; font-size: clamp(1rem, 2.5vw, 1.2rem); color: var(--blue-dark); line-height: 1.7; font-weight: 700; }
  .review-answer .ctx-label { display: block; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-dim); font-weight: 700; margin-bottom: 0.3rem; }

  /* BUTTONS */
  .btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; margin-top: 1.2rem; }
  .btn { padding: 0.65rem 1.5rem; border-radius: 8px; border: none; cursor: pointer; font-family: 'Nunito', sans-serif; font-size: 0.9rem; font-weight: 700; transition: all 0.18s; }
  .btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
  .btn-primary:hover { background: var(--blue-dark); }
  .btn-reveal { background: var(--blue); color: #fff; padding: 0.75rem 2.5rem; font-size: 1rem; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
  .btn-reveal:hover { background: var(--blue-dark); }
  .btn-next { background: var(--blue); color: #fff; padding: 0.72rem 2rem; font-size: 0.95rem; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
  .btn-next:hover { background: var(--blue-dark); }
  .btn-gotit { background: var(--green-bg); color: #16a34a; border: 1.5px solid rgba(34,197,94,0.4); }
  .btn-gotit:hover { background: rgba(34,197,94,0.22); }
  .btn-missed { background: var(--red-bg); color: var(--red); border: 1.5px solid rgba(239,68,68,0.35); }
  .btn-missed:hover { background: rgba(239,68,68,0.22); }
  .btn-secondary { background: var(--surface); color: var(--text-mid); border: 1.5px solid var(--border); }
  .btn-secondary:hover { border-color: var(--blue-dim); color: var(--blue-dark); }
  .btn-danger { background: var(--red-bg); color: var(--red); border: 1.5px solid rgba(239,68,68,0.35); padding: 0.35rem 0.8rem; font-size: 0.8rem; }
  .btn-danger:hover { background: rgba(239,68,68,0.22); }
  button:disabled { opacity: 0.35; cursor: not-allowed; }

  /* SESSION COMPLETE */
  .session-complete { text-align: center; padding: 2rem 1rem; animation: cardIn 0.35s ease; }
  .session-complete h2 { font-size: 2rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 1rem; }
  .stat-row { display: flex; justify-content: center; gap: 2.5rem; margin: 1.5rem 0; flex-wrap: wrap; }
  .stat { text-align: center; }
  .stat-num { font-size: 2.5rem; font-weight: 800; color: var(--blue); }
  .stat-label { font-size: 0.78rem; color: var(--text-dim); font-weight: 600; }
  .missed-section { margin-top: 1.5rem; text-align: left; }
  .missed-section h3 { font-size: 1.05rem; font-weight: 800; color: var(--red); margin-bottom: 0.8rem; text-align: center; }
  .missed-item { background: var(--red-bg); border: 1.5px solid rgba(239,68,68,0.2); border-radius: 8px; padding: 0.6rem 1rem; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; }
  .missed-item .ctx { display: block; font-size: 0.75rem; color: var(--text-dim); margin-top: 0.2rem; font-weight: 400; }

  /* ADMIN */
  .admin-gate { max-width: 360px; margin: 3rem auto; text-align: center; }
  .admin-gate h2 { font-size: 1.6rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 1.5rem; }
  .admin-panel { max-width: 700px; margin: 0 auto; }
  .admin-panel > h2 { font-size: 1.6rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 1.5rem; }
  .field { margin-bottom: 1rem; text-align: left; }
  .field label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--text-mid); margin-bottom: 0.3rem; }
  .field input, .field textarea {
    width: 100%; background: var(--surface); border: 1.5px solid var(--border);
    color: var(--text); padding: 0.6rem 0.8rem; border-radius: 8px;
    font-family: 'Nunito', sans-serif; font-size: 0.9rem; font-weight: 600;
    outline: none; transition: border-color 0.18s; box-shadow: var(--shadow);
  }
  .field input:focus, .field textarea:focus { border-color: var(--blue); }
  .field textarea { min-height: 180px; resize: vertical; line-height: 1.6; font-weight: 400; }
  .hint-text { font-size: 0.76rem; color: var(--text-dim); margin-top: 0.3rem; }
  .song-admin-card {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 10px;
    padding: 1rem 1.2rem; margin-bottom: 0.75rem;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    box-shadow: var(--shadow);
  }
  .song-admin-card h4 { font-weight: 800; color: var(--blue-dark); }
  .song-admin-card p { font-size: 0.8rem; color: var(--text-dim); }
  .add-song-form { background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; padding: 1.5rem; margin-top: 2rem; box-shadow: var(--shadow); }
  .add-song-form h3 { font-size: 1.15rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 1.2rem; }
  .part-entry { background: var(--surface2); border: 1.5px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 0.8rem; }
  .part-entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
  .part-entry-header span { font-size: 0.85rem; font-weight: 700; color: var(--blue-dark); }
  .remove-part-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.1rem; }
  .remove-part-btn:hover { color: var(--red); }
  .add-part-btn {
    background: none; border: 1.5px dashed var(--border-mid); color: var(--blue-dim);
    width: 100%; padding: 0.6rem; border-radius: 8px; cursor: pointer;
    font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 700;
    margin-bottom: 1rem; transition: all 0.18s;
  }
  .add-part-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-subtle); }

  /* SCRIPT CONTEXT */
  .script-context {
    margin-bottom: 0.5rem; border: 1.5px solid var(--border); border-radius: 8px;
    background: var(--surface2); overflow: hidden;
  }
  .script-context-line {
    padding: 0.35rem 0.85rem; font-size: 0.8rem; color: var(--text-dim); font-weight: 600;
    border-bottom: 1px solid var(--border); display: flex; gap: 0.5rem; align-items: baseline;
  }
  .script-context-line:last-child { border-bottom: none; }
  .script-cue-block {
    margin-bottom: 0.75rem; border: 2px solid var(--blue-dim); border-radius: 10px;
    background: var(--blue-subtle); overflow: hidden;
  }
  .script-cue-label {
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--blue-dark); padding: 0.3rem 0.85rem 0; opacity: 0.75;
  }
  .script-cue-line {
    padding: 0.4rem 0.85rem 0.6rem; font-size: 0.95rem; color: var(--text); font-weight: 700;
    display: flex; gap: 0.5rem; align-items: baseline;
  }
  .script-context-line:last-child { border-bottom: none; }
  .script-speaker {
    font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--blue-dim); font-weight: 700; flex-shrink: 0; min-width: 4.5rem;
  }
  /* TYPE TOGGLE */
  .type-toggle {
    display: flex; gap: 0; margin-bottom: 1rem; border: 1.5px solid var(--border);
    border-radius: 8px; overflow: hidden;
  }
  .type-toggle-btn {
    flex: 1; padding: 0.5rem 1rem; background: var(--surface); border: none;
    font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 700;
    color: var(--text-mid); cursor: pointer; transition: all 0.15s;
  }
  .type-toggle-btn.active { background: var(--blue-subtle); color: var(--blue-dark); }
  .type-toggle-btn:first-child { border-right: 1.5px solid var(--border); }
  /* SCRIPT PARTS PREVIEW */
  .script-parts-preview {
    margin-top: 0.5rem; padding: 0.6rem 0.85rem; background: var(--blue-subtle);
    border: 1.5px solid var(--border); border-radius: 6px; font-size: 0.8rem;
    color: var(--blue-dark); font-weight: 600;
  }
  .script-parts-preview span { opacity: 0.7; font-weight: 400; }

  /* FOOTER */
  footer { text-align: center; padding: 1.5rem 1rem; margin-top: auto; border-top: 1px solid var(--border); background: var(--surface); }
  footer p { font-size: 0.72rem; color: var(--text-dim); line-height: 1.8; }

  /* NOTIFICATION */
  .notification {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    background: var(--blue-dark); color: #fff; padding: 0.65rem 1.5rem;
    border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    z-index: 999; pointer-events: none; white-space: nowrap;
    box-shadow: var(--shadow-lg); animation: notifIn 0.25s ease;
  }
  @keyframes notifIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
  }

  /* TYPE-IT-OUT */
  .typeit-pills {
    display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; margin-bottom: 0.25rem;
  }
  .typeit-pill {
    min-width: 2.4rem; height: 2rem; border-radius: 6px; padding: 0 0.5rem;
    background: var(--surface2); border: 1.5px solid var(--border);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 700;
    color: var(--text); transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
  }
  .typeit-pill.filled {
    background: var(--blue-subtle); border-color: var(--blue-dim); color: var(--blue-dark);
  }
  .typeit-pill.empty {
    background: var(--surface2); border-color: var(--border); color: transparent;
  }
  .typeit-input {
    width:100%; background:var(--surface); border:2px solid var(--border);
    color:var(--text); padding:0.75rem 1rem; border-radius:8px;
    font-family:'Nunito',sans-serif; font-size:1rem; font-weight:600;
    outline:none; transition:border-color 0.2s; margin-top:1rem; box-shadow:var(--shadow);
  }
  .typeit-input:focus { border-color:var(--blue); }
  .typeit-result { margin-top:1rem; font-size:1rem; line-height:2.2; font-weight:600; }
  .word-correct { color:var(--green); }
  .word-wrong   { color:var(--red); text-decoration:underline; }
  .word-missing { color:var(--red); opacity:0.5; font-style:italic; }
  .score-badge { display:inline-block; padding:0.3rem 0.9rem; border-radius:2rem; font-size:0.85rem; font-weight:700; margin-bottom:0.8rem; }
  .score-badge.good { background:var(--green-bg); border:1.5px solid rgba(34,197,94,0.4); color:#16a34a; }
  .score-badge.bad  { background:var(--red-bg); border:1.5px solid rgba(239,68,68,0.35); color:var(--red); }
  /* STATS */
  .stat-card { background:var(--surface); border:1.5px solid var(--border); border-radius:12px; padding:1.2rem 1.5rem; box-shadow:var(--shadow); margin-bottom:1rem; }
  .stat-card h4 { font-size:0.75rem; font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-dim); margin-bottom:0.8rem; }
  .stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:0.75rem; }
  .stat-tile { background:var(--surface2); border-radius:8px; padding:0.8rem 1rem; text-align:center; }
  .stat-tile .val { font-size:1.8rem; font-weight:800; color:var(--blue); }
  .stat-tile .lbl { font-size:0.72rem; color:var(--text-dim); font-weight:600; }
  .heat-row { display:flex; align-items:center; gap:0.5rem; padding:0.35rem 0; border-bottom:1px solid var(--border); font-size:0.85rem; }
  .heat-row .line-text { flex:1; color:var(--text); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .heat-bar-wrap { width:80px; background:var(--surface2); border-radius:4px; height:8px; flex-shrink:0; }
  .heat-bar { height:8px; border-radius:4px; background:var(--red); }
  .heat-pct { font-size:0.75rem; font-weight:700; color:var(--red); min-width:2.5rem; text-align:right; }
  /* MULTIPLE CHOICE */
  .mc-option { display:block; width:100%; text-align:left; background:var(--surface); border:1.5px solid var(--border); border-radius:10px; padding:0.8rem 1.1rem; margin-bottom:0.6rem; font-size:0.92rem; font-weight:600; color:var(--text); transition:background 0.15s, border-color 0.15s; white-space:normal; word-break:break-word; }
  .mc-option:hover:not(:disabled) { border-color:var(--blue); color:var(--blue-dark); background:var(--blue-subtle); }
  .mc-option:disabled { cursor:default; opacity:0.7; }
  .mc-option.mc-correct { background:#dcfce7; border-color:#16a34a; border-width:2.5px; color:#14532d; font-weight:800; opacity:1; }
  .mc-option.mc-wrong   { background:#fee2e2; border-color:#dc2626; border-width:2.5px; color:#7f1d1d; font-weight:800; opacity:1; text-decoration:line-through; }
  .mc-result-banner { border-radius:10px; padding:0.75rem 1.1rem; font-size:1rem; font-weight:800; margin-bottom:0.75rem; text-align:center; }
  .mc-result-correct { background:#dcfce7; border:2px solid #16a34a; color:#14532d; }
  .mc-result-wrong   { background:#fee2e2; border:2px solid #dc2626; color:#7f1d1d; }

  /* SCENE PARTNER */
  .sp-ready-card { background:var(--surface); border:1.5px solid var(--border); border-radius:14px; padding:2rem 1.5rem; text-align:center; box-shadow:var(--shadow); margin-top:1rem; }
  .sp-ready-icon { font-size:2.5rem; margin-bottom:0.75rem; }
  .sp-ready-card h3 { font-size:1.2rem; font-weight:800; color:var(--blue-dark); margin-bottom:0.75rem; }
  .sp-ready-card p { font-size:0.9rem; color:var(--text-mid); line-height:1.6; }
  .sp-play-btn { font-size:1rem; padding:0.7rem 2rem; }
  .sp-your-turn { background:var(--blue-subtle); border:2px solid var(--blue); border-radius:14px; padding:1.5rem; margin:1rem 0; }
  .sp-your-label { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.12em; color:var(--blue-dark); margin-bottom:0.6rem; }
  .sp-your-line { font-size:1.2rem; font-weight:700; color:var(--blue-dark); line-height:1.5; margin-bottom:1.2rem; }
  .sp-countdown-wrap { display:flex; align-items:center; gap:0.75rem; }
  .sp-countdown-bar-outer { flex:1; height:10px; background:var(--border); border-radius:6px; overflow:hidden; }
  .sp-countdown-bar-inner { height:100%; background:var(--blue); border-radius:6px; transition:width 0.1s linear; }
  .sp-countdown-label { font-size:0.85rem; font-weight:700; color:var(--blue-dark); min-width:3rem; text-align:right; }
  .sp-other-turn { background:var(--surface); border:1.5px solid var(--border); border-radius:14px; padding:1.5rem; margin:1rem 0; }
  .sp-speaker-label { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.12em; color:var(--text-dim); margin-bottom:0.5rem; }
  .sp-other-line { font-size:1.1rem; font-weight:600; color:var(--text); line-height:1.5; margin-bottom:1rem; }
  .sp-speaking-indicator { display:flex; gap:5px; align-items:center; }
  .sp-dot { width:8px; height:8px; border-radius:50%; background:var(--blue-dim); animation:sp-bounce 1.2s infinite ease-in-out; }
  .sp-dot:nth-child(2) { animation-delay:0.2s; }
  .sp-dot:nth-child(3) { animation-delay:0.4s; }
  @keyframes sp-bounce { 0%,80%,100%{transform:scale(0.8);opacity:0.5} 40%{transform:scale(1.2);opacity:1} }
  .sp-controls { display:flex; gap:0.5rem; justify-content:center; align-items:center; margin-top:1rem; flex-wrap:wrap; }
  .sp-ctrl-btn { font-size:1.1rem; padding:0.5rem 0.9rem; min-width:2.8rem; }
