
    :root {
      --ink: #f8fbff;
      --muted: #b7c5d8;
      --line: #274363;
      --paper: #0d1728;
      --wash: #132238;
      --blue: #4f9cff;
      --blue-soft: #102f5b;
      --green: #22c55e;
      --green-soft: #123923;
      --amber: #fbbf24;
      --amber-soft: #3b2b12;
      --rose: #fb7185;
      --rose-soft: #3d1722;
      --teal: #2dd4bf;
      --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
      --radius: 8px;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
      color: var(--ink);
      background:
        radial-gradient(circle at 10% 0%, rgba(79, 156, 255, .18), transparent 28%),
        radial-gradient(circle at 92% 4%, rgba(45, 212, 191, .12), transparent 24%),
        linear-gradient(180deg, #08111f 0%, #0d1728 54%, #050b14 100%);
      min-height: 100vh;
    }

    button, input, select, textarea {
      font: inherit;
    }

    button {
      border: 0;
      border-radius: 7px;
      cursor: pointer;
      min-height: 40px;
      font-weight: 700;
      transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
    }

    button:hover { transform: translateY(-1px); }
    button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

    .app {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      width: min(1280px, calc(100% - 28px));
      margin: 12px auto;
    }

    .sidebar, .main-panel, .section {
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

    .sidebar {
      padding: 7px 10px;
      align-self: start;
      position: static;
      max-height: none;
      overflow: auto;
    }

    .brand {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      padding-bottom: 0;
      border-bottom: 0;
      margin-bottom: 0;
      white-space: nowrap;
      overflow: hidden;
    }

    .brand-mark {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border-radius: 8px;
      background: rgba(79, 156, 255, .12);
      border: 1px solid rgba(79, 156, 255, .28);
      overflow: hidden;
    }

    .brand-mark img {
      width: 32px;
      height: 32px;
      object-fit: contain;
    }

    .title-row {
      display: flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
    }

    .theme-toggle {
      width: 28px;
      height: 28px;
      min-height: 28px;
      padding: 0;
      border-radius: 0;
      border: 0;
      background: transparent;
      color: var(--ink);
      display: grid;
      place-items: center;
    }

    .theme-toggle img,
    .settings-toggle img {
      width: 20px;
      height: 20px;
      object-fit: contain;
      display: block;
    }

    h1, h2, h3, p { margin: 0; }
    h1 { font-size: 20px; line-height: 1.25; }
    h2 { font-size: 17px; margin-bottom: 10px; }
    h3 { font-size: 15px; margin-bottom: 8px; }
    .muted { color: var(--muted); font-size: 13px; line-height: 1.55; }

    .brand .muted {
      line-height: 1.15;
      font-size: 12px;
    }

    .lesson-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 7px;
      margin: 10px 0 14px;
    }

    .lesson-picker {
      display: grid;
      grid-template-columns: 74px minmax(0, 1fr);
      gap: 8px;
      align-items: center;
      margin: 8px 0;
    }

    .lesson-picker input {
      text-align: center;
      font-weight: 900;
      font-size: 18px;
      min-height: 42px;
    }

    .compact-toolbar {
      display: grid;
      grid-template-columns: 52px 72px 44px;
      gap: 5px;
      align-items: center;
      margin: 0;
      justify-self: end;
      white-space: nowrap;
      min-width: max-content;
    }

    .compact-toolbar .toolbar-label {
      min-height: 28px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #f8fbff;
      color: #334155;
      font-weight: 800;
      font-size: 12px;
      white-space: nowrap;
      padding: 2px 7px;
    }

    .compact-toolbar input {
      text-align: center;
      font-weight: 900;
      font-size: 12px;
      min-height: 20px;
      padding: 2px 3px;
      width: 72px;
      min-width: 72px;
      height: 20px;
    }

    .utility-panel {
      position: relative;
      margin-top: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      overflow: visible;
    }

    .settings-toggle {
      cursor: pointer;
      padding: 0;
      font-weight: 900;
      color: #111827;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      min-height: 28px;
      background: transparent;
      border: 0;
      width: 100%;
    }

    .settings-icon {
      position: relative;
      width: 26px;
      height: 20px;
      display: inline-block;
    }

    .settings-icon::before {
      content: "";
      position: absolute;
      left: 0;
      top: 1px;
      width: 19px;
      height: 4px;
      background: currentColor;
      box-shadow: 0 8px 0 currentColor, 0 16px 0 currentColor;
    }

    .settings-icon::after {
      content: "+";
      position: absolute;
      right: 0;
      bottom: -5px;
      font-size: 25px;
      line-height: 1;
      font-weight: 900;
    }

    .utility-body {
      position: fixed;
      left: 50%;
      right: auto;
      top: 82px;
      transform: translateX(-50%);
      z-index: 1000;
      width: min(392px, calc(100vw - 18px));
      padding: 10px;
      display: grid;
      gap: 9px;
      border: 1px solid var(--line);
      border-radius: 24px;
      background: rgba(255,255,255,.98);
      box-shadow: 0 18px 50px rgba(15, 73, 132, .18);
      max-height: none;
      overflow: hidden;
    }

    .utility-panel:not(.open) .utility-body {
      display: none;
    }

    .utility-panel.open .utility-body {
      display: grid;
    }

    .settings-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }

    .settings-actions button {
      min-height: 20px;
      padding: 1px 6px;
      font-size: 10px;
      line-height: 1;
      border-radius: 999px;
    }

    .file-strip {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 7px;
    }

    .mini-file {
      display: grid;
      gap: 5px;
      min-width: 0;
    }

    .mini-file label {
      font-size: 12px;
      color: var(--muted);
    }

    .mini-file input[type="file"] {
      min-width: 0;
      max-width: 100%;
      min-height: 34px;
      padding: 9px 7px;
      font-size: 12px;
      line-height: 1.2;
    }

    .lesson-btn {
      min-height: 36px;
      color: var(--ink);
      background: var(--wash);
      border: 1px solid transparent;
      font-size: 13px;
    }

    .lesson-btn.active {
      color: var(--blue);
      background: var(--blue-soft);
      border-color: #9db8ff;
    }

    .field {
      display: grid;
      gap: 7px;
      margin-top: 12px;
    }

    label {
      font-size: 13px;
      font-weight: 800;
      color: #334155;
    }

    textarea, input[type="file"], input[type="text"], select {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 10px;
      background: #fbfdff;
      color: var(--ink);
    }

    textarea {
      min-height: 86px;
      resize: vertical;
      line-height: 1.65;
    }

    .row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .btn-primary { background: var(--blue); color: #fff; }
    .btn-green { background: var(--green); color: #fff; }
    .btn-teal { background: var(--teal); color: #fff; }
    .btn-soft { background: var(--wash); color: var(--ink); border: 1px solid var(--line); }
    .btn-amber { background: var(--amber-soft); color: var(--amber); }
    .btn-rose { background: var(--rose-soft); color: var(--rose); }

    .main-panel {
      padding: 16px;
      min-width: 0;
    }

    .topbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--line);
      margin-bottom: 8px;
    }

    .topbar > div:first-child {
      display: flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: wrap;
    }

    .stats {
      display: flex;
      gap: 5px;
      flex-wrap: nowrap;
      justify-content: flex-start;
      align-items: center;
      white-space: nowrap;
      min-width: max-content;
    }

    .stat {
      min-width: 44px;
      padding: 2px 6px;
      border-radius: 999px;
      background: linear-gradient(180deg, #fff, var(--wash));
      border: 1px solid var(--line);
      line-height: 1;
    }

    .stat b {
      display: block;
      font-size: 11px;
      display: inline;
    }

    .stat span {
      font-size: 10px;
      color: var(--muted);
      margin-left: 2px;
    }

    #lessonSub,
    #currentMeta {
      display: none;
    }

    .workspace {
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
      gap: 14px;
    }

    .section-title-line {
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: nowrap;
      white-space: nowrap;
    }

    .section-title-line h2 {
      margin-bottom: 0;
    }

    .section {
      padding: 9px;
      box-shadow: none;
      background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,253,255,.96));
    }

    .section + .section { margin-top: 8px; }

    audio {
      width: 100%;
      height: 24px;
      margin: 0;
    }

    .audio-panel {
      padding: 7px;
      background: linear-gradient(135deg, rgba(234,243,255,.96), rgba(255,255,255,.98));
      border-color: #bfd7f1;
    }

    .player-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 76px;
      gap: 6px;
      align-items: center;
    }

    .reference-panel {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .reference-panel details {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255,255,255,.95);
      overflow: hidden;
    }

    .reference-panel summary {
      cursor: pointer;
      padding: 8px 10px;
      font-weight: 900;
      color: var(--blue);
      background: linear-gradient(180deg, #fff, var(--blue-soft));
    }

    .reference-body {
      max-height: 260px;
      overflow: auto;
      padding: 10px;
      white-space: pre-wrap;
      line-height: 1.65;
      color: #334155;
      font-size: 14px;
    }

    .speed-group, .mode-group {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 4px;
    }

    .speed-group {
      grid-template-columns: repeat(2, 1fr);
      width: 76px;
      justify-self: end;
    }

    .speed-btn {
      background: transparent;
      color: #334155;
      border: 0;
      position: relative;
      min-height: 24px;
      padding: 0 2px 0 16px;
      font-size: 12px;
      font-weight: 800;
    }

    .speed-btn::before {
      content: "";
      position: absolute;
      left: 2px;
      top: 50%;
      width: 9px;
      height: 9px;
      border-radius: 50%;
      border: 1.5px solid #7b8aa0;
      transform: translateY(-50%);
    }

    .speed-btn.active::before {
      background: var(--blue);
      border-color: var(--blue);
      box-shadow: inset 0 0 0 2px #fff;
    }

    .mode-btn {
      background: #fff;
      color: #334155;
      border: 1px solid var(--line);
      min-height: 26px;
      padding: 2px 6px;
      font-size: 12px;
    }

    #prevSentenceBtn,
    #nextSentenceBtn,
    #startGameBtn {
      min-height: 18px;
      padding: 1px 5px;
      font-size: 10px;
      line-height: 1;
    }

    .mode-btn.active {
      background: var(--blue-soft);
      color: var(--blue);
      border-color: #9db8ff;
    }

    .mode-group {
      grid-template-columns: repeat(4, 1fr);
    }

    .paragraph-tabs, .sentence-list {
      display: flex;
      gap: 5px;
      flex-wrap: nowrap;
      margin-top: 6px;
      overflow-x: auto;
      padding-bottom: 2px;
      scrollbar-width: thin;
    }

    .pill {
      padding: 3px 8px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--wash);
      color: #334155;
      min-height: 24px;
      font-size: 12px;
      flex: 0 0 auto;
    }

    .pill.active {
      background: var(--green-soft);
      color: var(--green);
      border-color: #9ed7ad;
    }

    .reader {
      min-height: 220px;
      padding: 9px;
      border-radius: 8px;
      border: 1px solid var(--line);
      background:
        linear-gradient(90deg, rgba(234,243,255,.76), transparent 16%),
        #fbfdff;
      line-height: 1.35;
      font-size: 15px;
    }

    .reader.empty-tip {
      min-height: 110px;
      padding: 9px;
      font-size: 15px;
      line-height: 1.35;
    }

    .sentence {
      display: inline;
      border-radius: 6px;
      padding: 2px 3px;
    }

    .sentence.current {
      background: var(--amber-soft);
      box-shadow: inset 0 -2px 0 rgba(180, 83, 9, .28);
    }

    .word {
      display: inline-block;
      min-width: .7em;
      margin: 0 1px;
      padding: 0 4px;
      border-radius: 5px;
      cursor: pointer;
      transition: background .12s ease, color .12s ease;
    }

    .word.hidden {
      color: transparent;
      background: #d9e1ea;
      box-shadow: inset 0 -2px 0 #b7c3cf;
    }

    .word.initial {
      color: var(--blue);
      background: var(--blue-soft);
      letter-spacing: 0;
    }

    .word.revealed {
      color: var(--ink);
      background: transparent;
      box-shadow: none;
    }

    .lrc-box {
      max-height: 158px;
      min-height: 158px;
      display: grid;
      gap: 5px;
      overflow-y: auto;
      padding-right: 4px;
      scrollbar-width: thin;
    }

    .lrc-line {
      padding: 6px 8px;
      border-radius: 7px;
      background: var(--wash);
      border: 1px solid var(--line);
      color: var(--muted);
      cursor: pointer;
      line-height: 1.45;
      min-height: 38px;
    }

    .lrc-line.active {
      background: #eefcf8;
      color: var(--teal);
      border-color: #8ed7c9;
      font-weight: 800;
      box-shadow: inset 3px 0 0 var(--teal);
    }

    .game-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fcfeff;
      padding: 8px;
      display: grid;
      gap: 7px;
    }

    .game-card .muted {
      font-size: 12px;
      line-height: 1.35;
    }

    .focus-current-sentence {
      display: none;
    }

    .game-card #startGameBtn {
      min-height: 26px;
      padding: 2px 6px;
      font-size: 12px;
      line-height: 1.1;
    }

    .game-sentence {
      line-height: 1.35;
      font-size: 15px;
      min-height: 56px;
      padding: 7px;
      border-radius: 7px;
      background: var(--wash);
    }

    .game-word {
      display: inline-block;
      margin: 0 1px 4px 0;
      padding: 0 4px;
      border-radius: 5px;
      background: #fff;
      border: 1px solid var(--line);
    }

    .game-word.pending {
      min-width: 34px;
      color: var(--muted);
      background: #dbe4ee;
      letter-spacing: .08em;
      font-weight: 800;
    }

    .game-word.current {
      outline: 2px solid var(--amber);
      outline-offset: 2px;
    }

    .choice-row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 5px;
    }

    .choice {
      font-size: 12px;
      min-height: 26px;
      padding: 2px 6px;
      background: var(--blue-soft);
      color: var(--blue);
      border: 1px solid #9db8ff;
      border-radius: 999px;
    }

    .choice.wrong {
      background: var(--rose-soft);
      color: var(--rose);
      border-color: #f3a8ba;
    }

    .progress {
      height: 10px;
      background: var(--wash);
      border-radius: 999px;
      overflow: hidden;
      border: 1px solid var(--line);
    }

    .progress span {
      display: block;
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--green), var(--teal));
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%);
      background: #111827;
      color: #fff;
      padding: 10px 14px;
      border-radius: 7px;
      box-shadow: var(--shadow);
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease;
      z-index: 10;
      max-width: min(520px, calc(100% - 24px));
      text-align: center;
    }

    .toast.show { opacity: 1; }

    .compact-toolbar .toolbar-label,
    .utility-body,
    textarea,
    input,
    select,
    .mini-file,
    .stat,
    .pill,
    .mode-btn,
    .lrc-line,
    .reader,
    .game-card,
    .game-sentence,
    .game-word,
    .reference-panel details {
      background: rgba(12, 27, 47, .96);
      color: var(--ink);
      border-color: var(--line);
    }

    .section,
    .audio-panel {
      background: linear-gradient(180deg, rgba(13, 28, 48, .96), rgba(8, 17, 31, .98));
      border-color: var(--line);
    }

    .main-panel,
    .sidebar {
      background: rgba(8, 17, 31, .94);
      border-color: var(--line);
    }

    .settings-toggle,
    .mini-file label,
    .speed-btn,
    .stat span {
      color: var(--muted);
    }

    .btn-soft {
      background: #152941;
      color: var(--ink);
      border-color: var(--line);
    }

    .btn-amber {
      background: var(--amber-soft);
      color: #fde68a;
      border: 1px solid #7c5a1c;
    }

    .btn-rose {
      background: var(--rose-soft);
      color: #fecdd3;
      border: 1px solid #7f1d2d;
    }

    .reference-panel summary,
    .lrc-line.active,
    .sentence.current {
      background: rgba(16, 47, 91, .85);
      color: #eaf6ff;
    }

    .reference-body {
      color: #dbeafe;
    }

    .word.revealed {
      color: var(--ink);
    }

    body.light-mode {
      --ink: #111827;
      --muted: #64748b;
      --line: #cfe0f2;
      --paper: #ffffff;
      --wash: #f4f8fd;
      --blue: #0b63e5;
      --blue-soft: #eaf3ff;
      --green: #15803d;
      --green-soft: #e9f8ef;
      --amber: #b45309;
      --amber-soft: #fff3d7;
      --rose: #be123c;
      --rose-soft: #ffe8ee;
      --teal: #0f766e;
      --shadow: 0 18px 50px rgba(15, 73, 132, 0.12);
      color: var(--ink);
      background:
        radial-gradient(circle at 10% 0%, rgba(11, 99, 229, .16), transparent 28%),
        radial-gradient(circle at 92% 4%, rgba(15, 159, 154, .13), transparent 24%),
        linear-gradient(180deg, #f7fbff 0%, #eef7fb 100%);
    }

    body.light-mode .compact-toolbar .toolbar-label,
    body.light-mode .utility-body,
    body.light-mode textarea,
    body.light-mode input,
    body.light-mode select,
    body.light-mode .mini-file,
    body.light-mode .stat,
    body.light-mode .pill,
    body.light-mode .mode-btn,
    body.light-mode .lrc-line,
    body.light-mode .reader,
    body.light-mode .game-card,
    body.light-mode .game-sentence,
    body.light-mode .game-word,
    body.light-mode .reference-panel details {
      background: #ffffff;
      color: var(--ink);
      border-color: var(--line);
    }

    body.light-mode .section,
    body.light-mode .audio-panel {
      background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,253,255,.96));
      border-color: var(--line);
    }

    body.light-mode .main-panel,
    body.light-mode .sidebar {
      background: var(--paper);
      border-color: var(--line);
    }

    body.light-mode .settings-toggle,
    body.light-mode .mini-file label,
    body.light-mode .speed-btn,
    body.light-mode .stat span {
      color: #334155;
    }

    body.light-mode .btn-soft {
      background: var(--wash);
      color: var(--ink);
      border-color: var(--line);
    }

    body.light-mode .btn-amber {
      background: var(--amber-soft);
      color: var(--amber);
      border-color: #f3d899;
    }

    body.light-mode .btn-rose {
      background: var(--rose-soft);
      color: var(--rose);
      border-color: #f3a8ba;
    }

    body.light-mode .reference-panel summary,
    body.light-mode .lrc-line.active,
    body.light-mode .sentence.current {
      background: var(--blue-soft);
      color: var(--blue);
    }

    body.light-mode .reference-body {
      color: #334155;
    }

    body.light-mode #lessonNumber,
    #lessonNumber {
      background: #ffffff;
      color: #111827;
      caret-color: #111827;
    }

    body:not(.light-mode) #lessonNumber {
      background: #050b14;
      color: #ffffff;
      caret-color: #ffffff;
      border-color: #274363;
    }

    .game-header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      margin-bottom: 8px;
    }

    .game-header h2 {
      margin: 0;
      white-space: nowrap;
    }

    .game-top-actions {
      display: grid;
      grid-template-columns: repeat(4, max-content);
      gap: 7px;
      justify-content: end;
      align-items: center;
    }

    .game-top-actions button {
      min-height: 26px;
      padding: 2px 8px;
      font-size: 12px;
      white-space: nowrap;
    }

    #repeatAudioBtn.listening {
      background: var(--amber);
      color: #111827;
      box-shadow: 0 0 0 2px rgba(251, 191, 36, .28);
    }

    .game-button-strip {
      display: block;
    }

    .game-button-strip > .choice-row {
      display: grid;
    }

    body.focus-game {
      overflow: hidden;
      background: #000;
    }

    body.focus-game .sidebar,
    body.focus-game .topbar,
    body.focus-game .workspace > div:first-child,
    body.focus-game .game-section ~ .section,
    body.focus-game .reference-panel {
      display: none;
    }

    body.focus-game .app,
    body.focus-game .main-panel,
    body.focus-game .workspace,
    body.focus-game .workspace > div,
    body.focus-game .game-section {
      width: 100%;
      max-width: none;
      margin: 0;
      padding: 0;
      display: block;
      border: 0;
      box-shadow: none;
      background: #000;
    }

    body.focus-game .app {
      min-height: 100dvh;
    }

    body.focus-game .game-section {
      height: 100dvh;
      min-height: 0;
      padding: max(12px, env(safe-area-inset-top)) clamp(12px, 3vw, 28px) max(12px, env(safe-area-inset-bottom));
      color: #fff;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      align-content: stretch;
      gap: clamp(8px, 1.6vw, 18px);
      overflow: hidden;
    }

    body.focus-game .game-header {
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px;
      margin-bottom: 0;
      width: min(1040px, 100%);
      margin-left: auto;
      margin-right: auto;
    }

    body.focus-game .game-header h2 {
      font-size: clamp(22px, 4.8vw, 44px);
      color: #fff;
    }

    body.focus-game .game-top-actions {
      grid-template-columns: repeat(4, max-content);
      gap: clamp(8px, 1.8vw, 18px);
      overflow-x: auto;
      padding-bottom: 2px;
    }

    body.focus-game .game-top-actions button {
      min-height: clamp(34px, 5vw, 54px);
      padding: 0 clamp(10px, 2vw, 22px);
      font-size: clamp(14px, 2.1vw, 22px);
      border-radius: 999px;
    }

    body.focus-game .game-card {
      border: 0;
      background: #000;
      padding: 0;
      gap: clamp(8px, 1.6vw, 18px);
      width: min(1040px, 100%);
      margin: 0 auto;
      height: 100%;
      min-height: 0;
      display: grid;
      grid-template-rows: auto auto auto minmax(0, .8fr) auto minmax(1cm, .2fr);
      overflow: hidden;
    }

    body.focus-game .game-card .muted {
      color: #dbeafe;
      font-size: clamp(14px, 2.2vw, 24px);
    }

    body.focus-game .focus-current-sentence {
      display: block;
      width: min(1040px, 100%);
      margin: 0 auto;
      padding: clamp(8px, 1.5vw, 16px) clamp(10px, 2vw, 20px);
      border: 1px solid #374151;
      border-radius: clamp(8px, 1.4vw, 16px);
      background: #0b1220;
      color: #e5e7eb;
      font-size: clamp(13px, 2.1vw, 24px);
      line-height: 1.3;
      max-height: clamp(52px, 12vh, 112px);
      overflow-y: auto;
    }

    body.focus-game .game-card #startGameBtn {
      min-height: clamp(34px, 5vw, 54px);
      padding: 0 clamp(14px, 2vw, 24px);
      font-size: clamp(14px, 2.1vw, 22px);
      border-radius: 999px;
    }

    body.focus-game .game-sentence {
      min-height: 0;
      height: 100%;
      padding: clamp(10px, 2.2vw, 24px);
      font-size: clamp(24px, 4.8vw, 64px);
      line-height: 1.32;
      color: #fff;
      background: #050505;
      border: 1px solid #1f2937;
      overflow: auto;
      overscroll-behavior: contain;
    }

    body.focus-game .game-word {
      margin: 0 .16em .28em 0;
      padding: .02em .2em;
      border-color: #475569;
      background: #111827;
    }

    body.focus-game .game-word.pending {
      min-width: 1.9em;
      background: #1f2937;
    }

    body.focus-game .choice-row {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: clamp(10px, 3vw, 34px);
      max-width: min(980px, 100%);
      margin: 0 auto;
    }

    body.focus-game .choice {
      min-height: clamp(58px, 10vw, 112px);
      font-size: clamp(28px, 6.6vw, 82px);
      border-radius: clamp(12px, 2vw, 24px);
      background: #082f49;
      color: #fff;
      border: 2px solid #38bdf8;
      box-shadow: 0 12px 32px rgba(14, 165, 233, .16);
    }

    body.focus-game .progress {
      height: 12px;
      background: #111827;
      border-color: #374151;
    }

    body.light-mode.focus-game {
      background: #f7fbff;
    }

    body.light-mode.focus-game .app,
    body.light-mode.focus-game .main-panel,
    body.light-mode.focus-game .workspace,
    body.light-mode.focus-game .workspace > div,
    body.light-mode.focus-game .game-section,
    body.light-mode.focus-game .game-card {
      background: #f7fbff;
      color: #111827;
    }

    body.light-mode.focus-game .game-header h2,
    body.light-mode.focus-game .game-card .muted,
    body.light-mode.focus-game .game-section {
      color: #111827;
    }

    body.light-mode.focus-game .focus-current-sentence {
      background: #ffffff;
      color: #111827;
      border-color: #cfe0f2;
    }

    body.light-mode.focus-game .game-sentence {
      background: #ffffff;
      color: #111827;
      border-color: #cfe0f2;
    }

    body.light-mode.focus-game .game-word {
      background: #f8fbff;
      color: #111827;
      border-color: #cfe0f2;
    }

    body.light-mode.focus-game .game-word.pending {
      background: #d9e1ea;
      color: #334155;
      -webkit-text-fill-color: #334155;
      text-shadow: none;
    }

    body.light-mode.focus-game .choice {
      background: #eaf3ff;
      color: #0b63e5;
      border-color: #8bb8ff;
      box-shadow: 0 12px 32px rgba(11, 99, 229, .12);
    }

    body.light-mode.focus-game .progress {
      background: #eaf3ff;
      border-color: #cfe0f2;
    }

    @media (max-width: 980px) {
      .workspace, .topbar {
        grid-template-columns: 1fr;
      }
      .sidebar {
        position: static;
        max-height: none;
      }
      .stats {
        justify-content: flex-start;
      }
    }

    @media (max-width: 640px) {
      .app {
        width: calc(100% - 10px);
        margin: 5px auto;
        gap: 8px;
      }
      .main-panel, .sidebar, .section {
        padding: 10px;
      }
      .sidebar {
        padding-top: 6px;
        padding-bottom: 6px;
      }
      .brand {
        margin-bottom: 0;
        padding-bottom: 0;
      }
      .brand-mark {
        width: 32px;
        height: 32px;
      }
      h1 {
        font-size: 18px;
      }
      .compact-toolbar {
        grid-template-columns: 52px 72px 44px;
      }
      .compact-toolbar .toolbar-label {
        font-size: 12px;
      }
      .file-strip {
        grid-template-columns: 1fr;
      }
      .utility-body {
        top: 96px;
        width: calc(100vw - 12px);
        padding: 8px;
        gap: 7px;
        border-radius: 18px;
      }
      .utility-body textarea {
        min-height: 96px;
        max-height: 142px;
      }
      .mini-file input[type="file"] {
        min-height: 34px;
        padding: 8px 6px;
        font-size: 11px;
        line-height: 1.2;
      }
      .player-row {
        grid-template-columns: minmax(0, 1fr) 76px;
      }
      .speed-group {
        grid-template-columns: repeat(2, 1fr);
      }
      .mode-group { grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .choice-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .topbar {
        gap: 8px;
        margin-bottom: 8px;
        padding-bottom: 8px;
      }
      .stat {
        min-width: 42px;
        padding: 2px 5px;
      }
      .brand {
        grid-template-columns: auto minmax(0, 1fr) auto;
      }
      .compact-toolbar {
        grid-column: auto;
        justify-self: end;
      }
      .reference-panel {
        grid-template-columns: 1fr;
      }
      .section + .section { margin-top: 8px; }
      .reader:not(.empty-tip) {
        font-size: 15px;
      }
      .game-sentence {
        font-size: 15px;
      }
      body.focus-game .game-section {
        padding-top: max(72px, env(safe-area-inset-top));
      }
      body.focus-game .game-header {
        grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
      }
      body.focus-game .game-top-actions {
        overflow-x: auto;
        justify-content: start;
        padding-bottom: 2px;
        scrollbar-width: none;
      }
      body.focus-game .game-top-actions::-webkit-scrollbar {
        display: none;
      }
    }
  

a.sss-gateway-home{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;box-sizing:border-box!important;width:auto!important;min-width:0!important;height:auto!important;margin:0!important;padding:6px 12px!important;border:1px solid #d6c8b7!important;border-radius:999px!important;background:#fffaf2!important;color:#292332!important;font:700 12px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif!important;text-decoration:none!important;text-shadow:none!important;white-space:nowrap!important;box-shadow:0 3px 12px #0002!important;cursor:pointer!important;pointer-events:auto!important}
a.sss-gateway-home:focus-visible{outline:2px solid #7b5fb0!important;outline-offset:3px!important}
a.sss-gateway-home:hover{background:#f1e5d5!important}
a.sss-gateway-home-floating{position:fixed!important;left:max(10px,env(safe-area-inset-left))!important;bottom:max(10px,env(safe-area-inset-bottom))!important;top:auto!important;right:auto!important;z-index:2147483000!important;max-width:calc(100vw - 20px)!important}

.nce-access{position:sticky;top:0;z-index:100;background:#fff5d6;color:#403323;border-bottom:1px solid #dec889;padding:10px 18px;text-align:center;font:600 14px/1.5 system-ui,sans-serif}
.nce-access[hidden]{display:none}.nce-access a{color:#1457a0;margin-left:12px}
