
    :root {
      color-scheme: dark;
      font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
      font-synthesis: none;
      text-rendering: optimizeLegibility;
      --bg: #101a22;
      --panel: #18262f;
      --panel-soft: #1d2e37;
      --line: rgba(224, 242, 235, .09);
      --text: #edf5f1;
      --muted: #91a59e;
      --green: #a8ef70;
      --green-dark: #75c94c;
      --orange: #ffb36b;
    }

    * { box-sizing: border-box; }

    body {
      min-width: 320px;
      min-height: 100vh;
      margin: 0;
      color: var(--text);
      background:
        radial-gradient(ellipse at 50% -18%, rgba(119, 190, 130, .13), transparent 50%),
        var(--bg);
    }

    button { font: inherit; }

    .page {
      width: min(100% - 40px, 1040px);
      margin: 0 auto;
      padding: 34px 0 28px;
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 32px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      color: var(--text);
      text-decoration: none;
    }

    .brand-mark {
      display: grid;
      width: 40px;
      height: 40px;
      place-items: center;
      border: 1px solid rgba(168, 239, 112, .25);
      border-radius: 13px;
      color: var(--green);
      background: rgba(168, 239, 112, .09);
    }

    .brand-name { font-size: 15px; font-weight: 750; letter-spacing: .02em; }
    .brand-caption { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .14em; }

    .best-badge {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 9px 13px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--muted);
      background: rgba(255, 255, 255, .025);
      font-size: 12px;
    }

    .best-badge strong { color: var(--orange); font-size: 14px; }

    .topbar-right { display: flex; align-items: center; gap: 10px; }
    .back-link {
      padding: 9px 13px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--muted);
      background: rgba(255,255,255,.025);
      font-size: 12px;
      font-weight: 700;
      text-decoration: none;
      white-space: nowrap;
      transition: color .15s ease, border-color .15s ease;
    }
    .back-link:hover { color: var(--green); border-color: rgba(168,239,112,.35); }
    .back-link:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

    main { max-width: 900px; margin: 0 auto; }

    .intro { margin-bottom: 22px; text-align: center; }
    .eyebrow {
      margin: 0 0 8px;
      color: var(--green);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .22em;
      text-transform: uppercase;
    }

    h1 { margin: 0; font-size: clamp(29px, 5vw, 42px); letter-spacing: -.045em; }
    .subtitle { margin: 9px 0 0; color: var(--muted); font-size: 14px; }

    .game-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 236px;
      gap: 18px;
      align-items: start;
    }

    .game-card, .side-card {
      border: 1px solid var(--line);
      border-radius: 20px;
      background: linear-gradient(145deg, rgba(255,255,255,.035), transparent 58%), var(--panel);
      box-shadow: 0 18px 55px rgba(0, 0, 0, .18);
    }

    .game-card { padding: 16px; }

    .scorebar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 51px;
      padding: 0 4px 14px;
    }

    .score-label { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
    .score-value { margin-top: 2px; font-size: 25px; font-weight: 750; font-variant-numeric: tabular-nums; }
    .level-pill {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 7px 10px;
      border: 1px solid var(--line);
      border-radius: 9px;
      color: #c1d0ca;
      font-size: 12px;
    }

    .level-pill span { color: var(--green); font-weight: 700; }

    .board-wrap {
      position: relative;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, .065);
      border-radius: 13px;
      background: #111d23;
      touch-action: none;
    }

    canvas { display: block; width: 100%; aspect-ratio: 1; }

    .game-overlay {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 20px;
      background: rgba(12, 22, 27, .73);
      backdrop-filter: blur(5px);
      transition: opacity .18s ease, visibility .18s ease;
    }

    .game-overlay[hidden] { display: none; }
    .overlay-content { max-width: 260px; text-align: center; }
    .overlay-icon { margin-bottom: 10px; font-size: 35px; }
    .overlay-title { margin: 0; font-size: 24px; }
    .overlay-copy { margin: 8px 0 18px; color: #afc0b9; font-size: 13px; line-height: 1.7; }

    .actions { display: flex; gap: 9px; margin-top: 14px; }

    .button {
      display: inline-flex;
      min-height: 42px;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 0 16px;
      border: 1px solid transparent;
      border-radius: 10px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 700;
      transition: transform .15s ease, background .15s ease, border-color .15s ease;
    }

    .button:hover { transform: translateY(-1px); }
    .button:active { transform: translateY(0); }
    .button:focus-visible, .direction:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
    .button-primary { flex: 1; color: #17231b; background: var(--green); }
    .button-primary:hover { background: #b8f58a; }
    .button-secondary { color: #d7e2dc; border-color: var(--line); background: rgba(255,255,255,.035); }
    .button-secondary:hover { border-color: rgba(168,239,112,.3); background: rgba(168,239,112,.07); }

    .side-column { display: grid; gap: 14px; }
    .side-card { padding: 17px; }
    .side-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; }
    .side-title svg { color: var(--green); }
    .control-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; color: #b3c2bc; font-size: 12px; }
    .key-group { display: flex; gap: 4px; }
    kbd {
      display: inline-grid;
      min-width: 25px;
      height: 24px;
      place-items: center;
      padding: 0 5px;
      border: 1px solid rgba(255,255,255,.11);
      border-radius: 6px;
      color: #e4ede8;
      background: rgba(255,255,255,.045);
      font-family: inherit;
      font-size: 10px;
    }

    .divider { height: 1px; margin: 15px 0; background: var(--line); }
    .tip { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
    .tip strong { color: #dfe9e3; font-weight: 600; }

    .touch-controls { display: none; width: 150px; margin: 15px auto 0; grid-template: repeat(2, 42px) / repeat(3, 42px); gap: 5px; }
    .direction {
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 10px;
      color: #dce8e1;
      background: var(--panel-soft);
      cursor: pointer;
      font-size: 17px;
      -webkit-tap-highlight-color: transparent;
    }

    .direction[data-direction="up"] { grid-area: 1 / 2; }
    .direction[data-direction="left"] { grid-area: 2 / 1; }
    .direction[data-direction="down"] { grid-area: 2 / 2; }
    .direction[data-direction="right"] { grid-area: 2 / 3; }
    .footer { margin-top: 22px; color: #70837c; font-size: 11px; line-height: 2; text-align: center; }
    .footer a { color: #91a59e; text-decoration: none; margin: 0 3px; }
    .footer a:hover { color: var(--green); }

    @media (max-width: 720px) {
      .page { width: min(100% - 28px, 520px); padding-top: 22px; }
      .topbar { margin-bottom: 23px; }
      .game-layout { grid-template-columns: 1fr; }
      .side-column { grid-template-columns: 1fr 1fr; }
      .side-card { padding: 15px; }
    }

    @media (max-width: 480px) {
      .page { width: min(100% - 20px, 420px); padding-top: 17px; }
      .topbar { flex-wrap: wrap; gap: 10px; }
      .brand-mark { width: 36px; height: 36px; }
      .game-card { padding: 11px; border-radius: 16px; }
      .subtitle { font-size: 12px; }
      .side-column { grid-template-columns: 1fr; }
      .touch-controls { display: grid; }
      .actions { margin-top: 11px; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
    }
  