:root {
    --ground: #F1F3F0;
    --surface: #FFFFFF;
    --ink: #151B22;
    --muted: #5F6A66;
    --line: #D6DBD6;
    --accent: #0B7A5E;
    --accent-ink: #FFFFFF;
    --accent-soft: #DCEFE7;
    --brass: #C9A227;   /* gold */
    --pro: #1E6E8C; --pro-soft: #DFEEF4; --pro-ink: #FFFFFF;
    --brass-soft: #FBF3D5;
    --panel: #10231D;
    --panel-ink: #E9F2EE;
    --panel-muted: #8FB0A3;
    --danger: #B23A3A;
    --danger-soft: #F6E1E1;
    --ok: #0B7A5E;
    --ok-soft: #DCEFE7;
    --code-bg: #E7EBE7;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --ground: #0F1412; --surface: #171D1A; --ink: #E8ECE8; --muted: #98A39D; --line: #2A322D;
      --accent: #3FBF97; --accent-ink: #0F1412; --accent-soft: #163A2F;
      --brass: #F2C94C; --brass-soft: #3D3210; --pro: #4FA3C4; --pro-soft: #14333F; --pro-ink: #08181F;
      --panel: #0B1A15; --panel-ink: #E9F2EE; --panel-muted: #8FB0A3;
      --danger: #E07A7A; --danger-soft: #3A1C1C; --ok: #3FBF97; --ok-soft: #163A2F; --code-bg: #232B27;
    }
  }
  :root[data-theme="dark"] {
    --ground: #0F1412; --surface: #171D1A; --ink: #E8ECE8; --muted: #98A39D; --line: #2A322D;
    --accent: #3FBF97; --accent-ink: #0F1412; --accent-soft: #163A2F;
    --brass: #F2C94C; --brass-soft: #3D3210; --pro: #4FA3C4; --pro-soft: #14333F; --pro-ink: #08181F;
    --panel: #0B1A15; --panel-ink: #E9F2EE; --panel-muted: #8FB0A3;
    --danger: #E07A7A; --danger-soft: #3A1C1C; --ok: #3FBF97; --ok-soft: #163A2F; --code-bg: #232B27;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
  body {
    margin: 0; background: var(--ground); color: var(--ink);
    font-family: "Figtree", "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px; line-height: 1.55;
    padding-inline: 20px; padding-block: 0;
  }
  h1, h2, h3, .display { font-family: "Bricolage Grotesque", "Segoe UI", Helvetica, Arial, sans-serif; font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; text-wrap: balance; margin: 0; }
  .mono { font-family: "JetBrains Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
  p { margin: 0 0 14px; max-width: 62ch; }
  a { color: var(--accent); }
  button { font: inherit; cursor: pointer; }
  :focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
  [hidden] { display: none !important; }
  .wrap { max-width: 1120px; margin: 0 auto; }
  .eyebrow { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }

  /* nav */
  nav.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding-block: 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  nav.top ul { justify-content: center; }
  .navright { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
  @media (max-width: 860px) { nav.top { grid-template-columns: 1fr auto; } nav.top ul { grid-column: 1 / -1; justify-content: flex-start; } }
  .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
  .logo svg { width: 30px; height: 30px; }
  nav.top ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; font-size: 15px; font-weight: 500; flex-wrap: wrap; }
  nav.top ul a { color: var(--ink); text-decoration: none; }
  nav.top ul a:hover { color: var(--accent); }
  .lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
  .lang button { border: 0; background: transparent; color: var(--muted); padding: 5px 12px; font-size: 13px; font-weight: 600; }
  .lang button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

  .btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; padding: 12px 20px; font-weight: 600; font-size: 15px; border: 1px solid transparent; text-decoration: none; transition: transform .12s ease, background .12s ease; }
  .btn:active { transform: translateY(1px); }
  .btn.primary { background: var(--accent); color: var(--accent-ink); }
  .btn.primary:hover { filter: brightness(1.07); }
  .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
  .btn.ghost:hover { border-color: var(--ink); }
  .btn.brass { background: var(--brass); color: #1A1406; }
  .btn.dark { background: var(--panel); color: var(--panel-ink); border-color: var(--panel); }
  .btn.dark:hover { background: var(--ink); }
  .btn.sm { padding: 8px 14px; font-size: 14px; }
  .btn[disabled] { opacity: .5; cursor: not-allowed; }

  /* hero */
  .hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: center; padding-block: 48px 64px; }
  @media (max-width: 860px) { .hero { grid-template-columns: minmax(0,1fr); gap: 32px; padding-block: 24px 48px; } }
  .hero h1 { font-size: clamp(38px, 6vw, 68px); font-weight: 800; max-width: 14ch; }
  .hero h1 em { font-style: normal; color: var(--accent); }
  .hero p.lede { font-size: 19px; color: var(--muted); max-width: 48ch; margin: 22px 0 28px; }
  .hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
  .facts { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 34px; }
  .facts div { display: grid; gap: 2px; }
  .facts b { font-family: "Bricolage Grotesque", sans-serif; font-size: 22px; font-weight: 700; }
  .facts span { font-size: 13px; color: var(--muted); }

  .lockpanel { background: var(--panel); color: var(--panel-ink); border-radius: 18px; padding: 26px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); position: relative; overflow: hidden; }
  .lockpanel::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%; border: 24px solid var(--brass); opacity: .12; }
  .lockpanel .lp-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--panel-muted); }
  .lockpanel .lp-time { font-family: "JetBrains Mono", monospace; font-size: 46px; font-weight: 700; margin: 14px 0 6px; color: var(--brass); letter-spacing: .02em; }
  .lockpanel .lp-q { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 20px; line-height: 1.25; margin: 14px 0 16px; }
  .lockpanel .lp-opts { display: grid; gap: 8px; }
  .lockpanel .lp-opt { border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 10px 12px; font-size: 14px; display: flex; justify-content: space-between; }
  .lockpanel .lp-opt.sel { border-color: var(--brass); background: rgba(184,137,31,.14); }
  .lockpanel .lp-rank { margin-top: 18px; border-top: 1px dashed rgba(255,255,255,.14); padding-top: 12px; display: grid; gap: 6px; font-size: 13px; }
  .lockpanel .lp-rank div { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; }
  .lockpanel .lp-rank .mono { color: var(--panel-muted); }

  /* sections */
  section.block { padding-block: 56px; border-top: 1px solid var(--line); }
  section.block h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 14px; }
  section.block p.intro { color: var(--muted); font-size: 17px; margin-bottom: 30px; }
  .steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
  @media (max-width: 760px) { .steps { grid-template-columns: minmax(0,1fr); } }
  .step { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
  .step .k { font-family: "JetBrains Mono", monospace; color: var(--brass); font-weight: 700; font-size: 13px; }
  .step h3 { font-size: 20px; margin: 10px 0 8px; }
  .step p { font-size: 15px; color: var(--muted); margin: 0; }

  .games { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
  @media (max-width: 860px) { .games { grid-template-columns: minmax(0,1fr); } }
  .game { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
  .game .art { height: 96px; display: flex; align-items: flex-end; padding: 14px 16px; background: var(--panel); color: var(--panel-ink); position: relative; }
  .game .art .cat { position: absolute; top: 0; left: 0; background: var(--brass); color: #1A1406; font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 7px 14px; border-radius: 0 0 10px 0; }
  .game .art .badge { position: absolute; top: 0; right: 0; border-radius: 0 0 0 10px; padding: 7px 14px; font-size: 12px; letter-spacing: .06em; background: var(--accent); color: var(--accent-ink); }
  .game .art .num { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .1em; color: var(--panel-muted); }
  .game .body { padding: 18px; display: grid; gap: 10px; flex: 1; align-content: start; }
  .game h3 { font-size: 20px; }
  .game p { font-size: 14.5px; color: var(--muted); margin: 0; }
  .game .meta { display: flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); margin: 0; }
  .game .foot { padding: 0 18px 18px; margin-top: auto; }
  .badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 4px; }
  .badge.free { background: var(--accent-soft); color: var(--accent); }
  .badge.pro { background: var(--brass-soft); color: var(--brass); }
  .badge.soon { background: var(--code-bg); color: var(--muted); }

  .plans { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; max-width: 820px; }
  @media (max-width: 700px) { .plans { grid-template-columns: minmax(0,1fr); } }
  .plan { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 14px; align-content: start; }
  .plan.free { border-color: var(--accent); }
  .plan.pro { border-color: var(--pro); }
  .plan.pro h3 .badge, .badge.proplan { background: var(--pro-soft); color: var(--pro); }
  .btn.pro { background: var(--pro); color: var(--pro-ink); border-color: var(--pro); } .btn.pro:hover { filter: brightness(1.08); }
  .plan.premium { border-color: var(--brass); }
  .plan h3 { font-size: 22px; display: flex; justify-content: space-between; align-items: baseline; }
  .plan .price { font-family: "Bricolage Grotesque", sans-serif; font-size: 34px; font-weight: 800; }
  .plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); font-family: "Figtree", sans-serif; }
  .plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
  .plan li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
  .plan li svg { width: 16px; height: 16px; margin-top: 4px; }
  .plan li.no { color: var(--muted); }
  .billing { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); margin-bottom: 18px; }
  .billing button { border: 0; background: transparent; padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
  .billing button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

  .teacher { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 40px; align-items: end; }
  @media (max-width: 800px) { .teacher { grid-template-columns: minmax(0,1fr); } }
  form.reg { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 12px; }
  .field { display: grid; gap: 4px; }
  .field label { font-size: 13px; font-weight: 600; color: var(--muted); }
  .field input, .field select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); color: var(--ink); width: 100%; }
  .field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  @media (max-width: 480px) { .two { grid-template-columns: 1fr; } }
  .note { font-size: 13px; color: var(--muted); background: var(--code-bg); border-radius: 8px; padding: 10px 12px; }

  footer.site { border-top: 1px solid var(--line); padding-block: 28px 40px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  footer.site a { color: var(--muted); }

  /* ===== GAME ===== */
  div#game { min-height: 100vh; padding-block: 16px 60px; }
  .gtop { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
  .gtop .logo { font-size: 17px; }
  .gcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; max-width: 680px; margin: 0 auto; }
  @media (max-width: 480px) { .gcard { padding: 20px; } }
  .gcard h2 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 8px; }
  .gcard .sub { color: var(--muted); margin-bottom: 22px; }
  .rules { display: grid; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
  .rules li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; font-size: 15px; }
  .rules li svg { width: 22px; height: 22px; color: var(--accent); }
  .members { display: grid; gap: 8px; }

  .hud { background: var(--panel); color: var(--panel-ink); border-radius: 14px; padding: 16px 20px; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; max-width: 680px; margin: 0 auto 14px; }
  @media (max-width: 480px) { .hud { grid-template-columns: 1fr auto; } .hud .hud-mid { grid-column: 1 / -1; } }
  .hud .t { font-family: "JetBrains Mono", monospace; font-size: 32px; font-weight: 700; color: var(--brass); line-height: 1; }
  .hud .t.warn { color: #F0A0A0; }
  .hud .lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--panel-muted); }
  .hud .hud-mid { display: grid; gap: 6px; }
  .bar { height: 6px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
  .bar i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
  .hud .pts { font-family: "JetBrains Mono", monospace; font-size: 22px; font-weight: 700; text-align: right; }

  .ptype { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); font-weight: 700; margin-bottom: 8px; }
  .q { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 22px; line-height: 1.25; margin-bottom: 18px; text-wrap: balance; }
  .qsub { color: var(--muted); font-size: 15px; margin: -8px 0 18px; }
  .opts { display: grid; gap: 8px; margin-bottom: 18px; }
  .opt { text-align: left; border: 1px solid var(--line); background: var(--ground); color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: 15.5px; display: flex; gap: 12px; align-items: center; }
  .opt .box { width: 20px; height: 20px; border: 2px solid var(--line); border-radius: 50%; flex: none; display: grid; place-items: center; }
  .opt.multi .box { border-radius: 5px; }
  .opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .opt[aria-pressed="true"] .box { border-color: var(--accent); background: var(--accent); }
  .opt.correct { border-color: var(--ok); background: var(--ok-soft); }
  .opt[aria-pressed="true"] .box::after { content: ""; width: 8px; height: 8px; background: var(--accent-ink); border-radius: inherit; }
  .matchrows { display: grid; gap: 10px; margin-bottom: 18px; }
  .matchrow { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; align-items: center; font-size: 15px; }
  @media (max-width: 480px) { .matchrow { grid-template-columns: 1fr; gap: 4px; } }
  .matchrow select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); color: var(--ink); width: 100%; }
  .textin { font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; width: 100%; background: var(--ground); color: var(--ink); margin-bottom: 18px; }
  .textin.code { font-family: "JetBrains Mono", monospace; font-size: 28px; letter-spacing: .4em; text-align: center; font-weight: 700; }
  .codetable { display: grid; gap: 6px; margin-bottom: 18px; }
  .codetable div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 15px; background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
  .codetable .mono { color: var(--brass); font-weight: 700; text-align: center; }
  .attempts { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
  .attempts i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; }
  .attempts i.bad { background: var(--danger); }
  .actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  .hint { border-left: 3px solid var(--brass); background: var(--brass-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 15px; margin-bottom: 10px; }
  .hint b { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin-bottom: 2px; }
  .fb { border-radius: 10px; padding: 12px 14px; font-size: 15px; margin-bottom: 14px; display: none; }
  .fb.show { display: block; }
  .fb.bad { background: var(--danger-soft); color: var(--danger); }
  .fb.good { background: var(--ok-soft); color: var(--ok); }
  .table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
  .table th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .table td.num { font-family: "JetBrains Mono", monospace; text-align: right; font-variant-numeric: tabular-nums; }
  .tblwrap { overflow-x: auto; margin-bottom: 20px; }
  .bigscore { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 18px 0 22px; }
  @media (max-width: 480px) { .bigscore { grid-template-columns: 1fr; } }
  .bigscore div { background: var(--ground); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
  .bigscore b { font-family: "JetBrains Mono", monospace; font-size: 28px; font-weight: 700; display: block; }
  .bigscore span { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
  .board { display: grid; gap: 6px; margin-bottom: 20px; }
  .board div { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 12px; padding: 9px 12px; background: var(--ground); border: 1px solid var(--line); border-radius: 8px; font-size: 15px; align-items: center; }
  .board div.me { border-color: var(--accent); }
  .board .r { font-family: "JetBrains Mono", monospace; color: var(--brass); font-weight: 700; }
  .board .mono { font-size: 14px; color: var(--muted); }
  .svgfig { width: 100%; max-width: 440px; display: block; margin: 0 auto 18px; }
  .story { display: grid; grid-template-columns: 26px 1fr; gap: 10px; background: var(--ground); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; font-size: 15px; font-style: italic; color: var(--muted); margin-bottom: 16px; }
  .story svg { width: 20px; height: 20px; color: var(--brass); margin-top: 2px; }
  .notes { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin: 6px 0 20px; }
  @media (max-width: 480px) { .notes { grid-template-columns: 1fr; } }
  .notes .note { position: relative; padding: 22px 14px 14px; font-size: 14.5px; line-height: 1.4; min-height: 96px; box-shadow: 0 6px 14px -8px rgba(0,0,0,.45); color: #1E1A0C; font-family: "Bricolage Grotesque", sans-serif; font-weight: 500; }
  .notes .note::before { content: ""; position: absolute; top: -8px; left: 50%; width: 54px; height: 16px; margin-left: -27px; background: rgba(255,255,255,.55); transform: rotate(-3deg); }
  .notes .note:nth-child(1) { background: #F6E27A; transform: rotate(-1.5deg); }
  .notes .note:nth-child(2) { background: #BFE3F2; transform: rotate(1deg); }
  .notes .note:nth-child(3) { background: #F7C4C4; transform: rotate(1.5deg); }
  .notes .note:nth-child(4) { background: #CDEBC9; transform: rotate(-1deg); }
  .notes .note .tag { position: absolute; top: 6px; right: 10px; font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 700; color: #6B5C1E; }
  .countries { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 6px 0 20px; }
  @media (max-width: 480px) { .countries { grid-template-columns: 1fr; } }
  .country { border: 2px solid var(--line); border-radius: 10px; padding: 12px; background: var(--ground); display: grid; gap: 6px; font-size: 13.5px; }
  .country .hd { display: flex; align-items: center; gap: 10px; font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 16px; }
  .country .hd svg { width: 34px; height: 24px; border: 1px solid rgba(0,0,0,.15); border-radius: 3px; flex: none; }
  .country ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; color: var(--muted); }
  .cipher { font-family: "JetBrains Mono", monospace; font-size: clamp(22px, 5vw, 34px); font-weight: 700; letter-spacing: .25em; text-align: center; padding: 18px 10px; background: var(--panel); color: var(--brass); border-radius: 10px; margin: 6px 0 12px; }
  .cipherkey { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
  .cipherkey span { background: var(--code-bg); border-radius: 4px; padding: 3px 6px; }
  .scramble { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 18px; }
  .scramble span { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 22px; width: 40px; height: 46px; display: grid; place-items: center; background: var(--brass-soft); color: var(--ink); border: 1px solid var(--brass); border-radius: 6px; }
  .scramble span.gap { background: transparent; border: 0; width: 14px; }

  /* ---- platform additions */
  .page { max-width: 1120px; margin: 0 auto; padding-block: 24px 64px; }
  .page.narrow { max-width: 560px; }
  .page h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; }
  .page p.intro { color: var(--muted); font-size: 17px; margin-bottom: 26px; }
  .flash { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-size: 15px; }
  .flash.ok { background: var(--ok-soft); color: var(--ok); }
  .flash.warn { background: var(--danger-soft); color: var(--danger); }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
  .stack { display: grid; gap: 14px; }
  .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
  .grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; align-items: start; }
  @media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0,1fr); } }
  .badge.muted { background: var(--code-bg); color: var(--muted); }
  .codebox { font-family: "JetBrains Mono", monospace; font-size: clamp(34px, 7vw, 56px); font-weight: 700; letter-spacing: .18em; text-align: center; padding: 14px; background: var(--panel); color: var(--brass); border-radius: 12px; }
  #qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 12px; width: fit-content; margin: 0 auto; }
  #qr canvas, #qr img { display: block; }
  .rank { display: grid; gap: 6px; }
  .rank > div { display: grid; grid-template-columns: 30px 1fr auto auto auto; gap: 12px; padding: 10px 12px; background: var(--ground); border: 1px solid var(--line); border-radius: 8px; font-size: 15px; align-items: center; }
  .rank .r { font-family: "JetBrains Mono", monospace; color: var(--brass); font-weight: 700; }
  .rank .mono { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
  .rank .st { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; background: var(--code-bg); color: var(--muted); }
  .rank .st.playing { background: var(--brass-soft); color: var(--brass); }
  .rank .st.finished { background: var(--ok-soft); color: var(--ok); }
  .eval { width: 100%; border-collapse: collapse; font-size: 13.5px; }
  .eval th, .eval td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; white-space: nowrap; }
  .eval th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .eval td.c { text-align: center; font-family: "JetBrains Mono", monospace; }
  .eval .ok1 { color: var(--ok); font-weight: 700; } .eval .fail { color: var(--danger); font-weight: 700; } .eval .na { color: var(--muted); }
  .eval small { display: block; color: var(--muted); font-size: 11px; }
  .members-small { color: var(--muted); font-size: 12.5px; white-space: normal; }
  .btn.danger { background: transparent; color: var(--danger); border-color: var(--danger-soft); }
  .btn.danger:hover { background: var(--danger-soft); }
  form.inline { display: inline; }
  .kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14.5px; }
  .kv dt { color: var(--muted); } .kv dd { margin: 0; }
  .hud .t.warn { color: #F0A0A0; }
  .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: pulse 1.6s infinite; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
  .listtable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
  .listtable th, .listtable td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
  .listtable th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---- form cards never stretch their rows to fill the column height (fix for the oversized game select) */
.stack { align-content: start; }
.field { align-content: start; }
.field select, .field input { height: 44px; align-self: start; box-sizing: border-box; }

  /* --- puzzle types: order / hotspot / cloze */
  .help { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
  .seq { display: grid; gap: 8px; margin-bottom: 18px; }
  .seqitem { text-align: left; border: 1px solid var(--line); background: var(--ground); color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: 15.5px; display: flex; gap: 12px; align-items: center; cursor: pointer; }
  .seqitem .pos { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 14px; }
  .seqitem.on { border-color: var(--accent); background: var(--accent-soft); }
  .seqitem.on .pos { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
  .seqitem.correct { border-color: var(--ok); background: var(--ok-soft); }
  .seqitem:disabled { cursor: default; }
  .post { max-width: 440px; margin: 6px auto 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--ground); overflow: hidden; }
  .post-hd { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
  .post-hd .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brass); color: #1A1406; display: grid; place-items: center; font-weight: 800; flex: none; }
  .post-hd b { display: block; font-size: 14px; } .post-hd small { color: var(--muted); font-size: 12px; }
  .post-ft { display: flex; gap: 16px; padding: 8px 12px 12px; font-size: 13px; color: var(--muted); }
  .spot { display: block; width: 100%; text-align: left; border: 2px solid transparent; background: transparent; color: var(--ink); font: inherit; padding: 8px 12px; cursor: pointer; border-radius: 8px; }
  .spot:hover:not(:disabled) { border-color: var(--line); }
  .spot[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .spot.correct { border-color: var(--ok); background: var(--ok-soft); }
  .spot:disabled { cursor: default; }
  .spot-image { padding: 0; border-radius: 0; } .spot-image[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: -3px; }
  .postimg { display: block; width: 100%; height: auto; }
  .spot-caption { font-size: 15px; line-height: 1.45; } .spot-tags { color: var(--accent); font-size: 14px; } .spot-cta { font-weight: 700; } .spot-comment { font-size: 14px; color: var(--muted); border-top: 1px dashed var(--line); border-radius: 0; }
  .spot-comment b { color: var(--ink); }
  .cloze { font-size: 16.5px; line-height: 2.1; margin-bottom: 18px; }
  .cloze .gap { font: inherit; font-size: 15px; padding: 4px 8px; border: 0; border-bottom: 2px solid var(--accent); background: var(--accent-soft); color: var(--ink); border-radius: 6px 6px 0 0; width: 11em; max-width: 100%; margin: 0 2px; }
  .cloze .gap:focus { outline: 2px solid var(--accent); }

  .search { font: inherit; font-size: 15px; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--ground) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='6'/%3E%3Cpath d='M15 15l5 5'/%3E%3C/svg%3E") 11px center / 16px no-repeat; color: var(--ink); min-width: 240px; }
  .search:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

  .suggest-wrap { position: relative; }
  .suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px; background: var(--surface, var(--ground)); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px -12px rgba(0,0,0,.35); overflow: hidden; max-height: 260px; overflow-y: auto; }
  .sg-item { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
  .sg-item + .sg-item { border-top: 1px solid var(--line); }
  .sg-item:hover, .sg-item:focus { background: var(--accent-soft); outline: none; }
  .sg-item small { color: var(--muted); white-space: nowrap; }
  .sg-item.off { opacity: .55; cursor: default; }
  .sg-none { padding: 10px 12px; color: var(--muted); font-size: 14px; }

  /* --- crossword */
  .cw-wrap { overflow-x: auto; margin: 6px 0 14px; }
  .cw { border-collapse: separate; border-spacing: 2px; margin: 0 auto; }
  .cw td { width: 30px; height: 30px; padding: 0; position: relative; }
  @media (max-width: 480px) { .cw td { width: 26px; height: 26px; } }
  .cw-void { background: transparent; }
  .cw-cell { background: var(--ground); border: 1px solid var(--line); border-radius: 4px; }
  .cw-cell.key { background: var(--brass-soft); border-color: var(--brass); }
  .cw-cell input { width: 100%; height: 100%; border: 0; background: transparent; text-align: center; font: 700 16px/1 "JetBrains Mono", monospace; color: var(--ink); text-transform: uppercase; padding: 0; caret-color: var(--accent); }
  .cw-cell input:focus { outline: 2px solid var(--accent); border-radius: 3px; }
  .cw-cell input:disabled { color: var(--muted); }
  .cw-cell .n { position: absolute; top: 1px; left: 3px; font-size: 8.5px; font-style: normal; color: var(--muted); font-weight: 700; pointer-events: none; }
  .cw-cell .k { position: absolute; bottom: 0; right: 2px; font-size: 8.5px; font-style: normal; color: var(--brass); font-weight: 800; pointer-events: none; }
  .cw-cluegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; font-size: 14px; margin-bottom: 8px; }
  @media (max-width: 560px) { .cw-cluegrid { grid-template-columns: 1fr; } }
  .cw-clues ol { margin: 6px 0 0; padding-left: 22px; } .cw-clues li { margin-bottom: 4px; line-height: 1.35; } .cw-clues small { color: var(--muted); }
  .cw-cell.wrong { background: var(--danger-soft); border-color: var(--danger); }
  .cw-cell.missing { background: var(--brass-soft); border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
  .cw-detail { margin-top: 6px; font-size: 13.5px; font-weight: 600; }

  /* --- plans (3 columns), discount, folders, game card extras */
  .plans.three { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; margin-top: 22px; }
  @media (max-width: 900px) { .plans.three { grid-template-columns: 1fr; } }
  .price .was { font-size: 60%; color: var(--muted); text-decoration: line-through; margin-right: 6px; font-weight: 500; }
  .plan .addon { font-size: 13.5px; color: var(--muted); margin: -6px 0 12px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; }
  .discount { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 22px; }
  .discount label { font-weight: 600; font-size: 14px; }
  .discount input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); color: var(--ink); text-transform: uppercase; width: 180px; }
  .discount .ok { color: var(--ok); font-size: 14px; font-weight: 600; }
  .game details.contents { margin: 0 0 10px; font-size: 14px; }
  .game details.contents summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
  .game details.contents summary::-webkit-details-marker { display: none; }
  .game details.contents summary::before { content: "▸"; font-size: 12px; transition: transform .15s; }
  .game details.contents[open] summary::before { transform: rotate(90deg); }
  .game details.contents ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); } .game details.contents li { margin-bottom: 3px; }
  .game .materials { display: flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); margin: 0; }
  .game .contents { font-size: 14px; margin-top: 4px; } .game .contents b { display: block; margin-bottom: 4px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
  .game .contents ul { margin: 0; padding-left: 18px; color: var(--muted); } .game .contents li { margin-bottom: 3px; }
  .folders { display: flex; flex-wrap: wrap; gap: 6px; }
  .chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); text-decoration: none; font-size: 13.5px; }
  .chip small { color: var(--muted); } .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .chip.on small { color: inherit; opacity: .8; }
  .fo-manage summary { list-style: none; cursor: pointer; } .fo-manage summary::-webkit-details-marker { display: none; }
  .fo-panel { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); min-width: 260px; }
  .fo-panel input[name=name] { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); width: 170px; }
  .listtable select.sm { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--ground); color: var(--ink); }
  .order-sum { display: grid; gap: 6px; font-size: 15px; } .order-sum div { display: flex; justify-content: space-between; gap: 12px; } .order-sum .total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; font-size: 18px; }

  /* --- accessibility */
  .skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--ground); padding: 10px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; }
  .skip:focus { top: 12px; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  main:focus { outline: none; }
  .field input:focus, .field select:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
  .opt:focus-visible, .seqitem:focus-visible, .spot:focus-visible, .chip:focus-visible, .sg-item:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
  .a11y-page h2 { font-size: 20px; margin: 22px 0 8px; } .a11y-page p, .a11y-page li { line-height: 1.55; }

  /* --- editorial tabs */
  .tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
  .tabs .tab { padding: 9px 14px; border-radius: 10px 10px 0 0; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; border: 1px solid transparent; border-bottom: 0; }
  .tabs .tab .cnt { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--code-bg); color: var(--muted); font-size: 12px; text-align: center; margin-left: 4px; }
  .tabs .tab[aria-selected="true"] { color: var(--ink); background: var(--surface); border-color: var(--line); margin-bottom: -1px; }
  .tabs .tab[aria-selected="true"] .cnt { background: var(--accent); color: var(--accent-ink); }
  .listtable.compact td, .listtable.compact th { padding: 8px 10px; font-size: 13.5px; vertical-align: top; }
  details.act summary { list-style: none; cursor: pointer; } details.act summary::-webkit-details-marker { display: none; }
  .act-panel { margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); display: grid; gap: 6px; min-width: 300px; }

  /* --- hero variants */
  .hero-pure { grid-template-columns: minmax(0, 1fr); text-align: center; position: relative; padding-block: 64px 72px; }
  .hero-pure .hero-text { max-width: 780px; margin: 0 auto; position: relative; z-index: 1; }
  .hero-pure h1 { max-width: none; margin-inline: auto; font-size: clamp(42px, 7vw, 80px); }
  .hero-pure p.lede { margin-inline: auto; } .hero-pure .cta { justify-content: center; } .hero-pure .facts { justify-content: center; }
  .hero-ring { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
  .hero-ring::before, .hero-ring::after { content: ""; position: absolute; border-radius: 50%; border: 28px solid var(--brass); opacity: .10; }
  .hero-ring::before { width: 520px; height: 520px; right: -180px; top: -160px; } .hero-ring::after { width: 320px; height: 320px; left: -140px; bottom: -120px; border-color: var(--accent); }
  .flowpanel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 14px; box-shadow: 0 30px 60px -36px rgba(0,0,0,.4); position: relative; }
  .fp-step { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: center; position: relative; }
  .fp-step + .fp-step::before { content: ""; position: absolute; left: 22px; top: -14px; height: 14px; border-left: 2px dashed var(--line); }
  .fp-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--panel); color: var(--brass); display: grid; place-items: center; } .fp-ico svg { width: 24px; height: 24px; }
  .fp-step b { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 17px; } .fp-step span:not(.fp-ico) { font-size: 14px; color: var(--muted); }
  .fp-rank { margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 12px; display: grid; gap: 6px; font-size: 13.5px; }
  .fp-rank div { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; } .fp-rank .mono { color: var(--muted); }
  .cardfan { position: relative; height: 400px; }
  .fan-card { position: absolute; width: min(250px, 58%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 50px -30px rgba(0,0,0,.45); transform-origin: bottom center; }
  .fan-card .art { height: 92px; background: var(--panel); color: var(--panel-ink); padding: 12px 14px; display: flex; justify-content: space-between; align-items: flex-end; }
  .fan-card .art .num { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .12em; color: var(--brass); }
  .fan-card .body { padding: 12px 14px 14px; } .fan-card .fan-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 18px; margin-bottom: 6px; } .fan-card p { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.4; } .fan-card small { font-size: 12px; color: var(--muted); }
  .fan-card.c0 { left: 0; top: 70px; transform: rotate(-7deg); } .fan-card.c1 { left: 50%; margin-left: -125px; top: 0; transform: rotate(1deg); z-index: 1; } .fan-card.c2 { right: 0; top: 90px; transform: rotate(7deg); z-index: 2; }
  @media (max-width: 860px) { .cardfan { height: 360px; } .fan-card { width: 56%; } .fan-card.c1 { margin-left: -28%; } }

  .tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tiles li { display: flex; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 600; font-size: 15px; }
  .tiles svg { width: 34px; height: 34px; flex: none; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 6px; }
  @media (max-width: 480px) { .tiles { grid-template-columns: 1fr; } }

  .dash { display: grid; gap: 24px; }
  .dash form.card .two3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .dash form.card .two4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  @media (max-width: 760px) { .dash form.card .two3, .dash form.card .two4 { grid-template-columns: 1fr; } }
