
    :root {
      color-scheme: light;
      --ink: #123047;
      --muted: #607487;
      --sky: #16b8ef;
      --sea: #1186c8;
      --sand: #ffe4ad;
      --panel: #fffaf0;
      --line: #f3bf66;
      --orange: #ff6b23;
      --coral: #ff5f8d;
      --teal: #0c8d91;
      --gold: #f6b21d;
      --shell: #ffe0d8;
      --green: #4cbf70;
      --shadow: 0 18px 44px rgba(18, 48, 71, 0.16);
      --radius: 8px;
    }

    * { box-sizing: border-box; }

    html { scroll-behavior: smooth; }

    body {
      margin: 0;
      color: var(--ink);
      background: linear-gradient(180deg, #16b8ef 0 220px, #fff0c9 220px 100%);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      line-height: 1.55;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 196px 0 auto;
      height: 36px;
      background: radial-gradient(circle at 16px 4px, #fff 0 15px, transparent 16px) 0 0 / 32px 32px repeat-x;
      pointer-events: none;
      z-index: 0;
    }

    h1, h2, h3, p { margin: 0; }
    a { color: inherit; text-decoration: none; }
    button { font: inherit; }
    code { font-size: 0.92em; }

    .page {
      position: relative;
      z-index: 1;
      min-height: 100vh;
    }

    .hero {
      position: relative;
      min-height: 520px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
      gap: clamp(24px, 5vw, 64px);
      align-items: center;
      max-width: 1240px;
      margin: 0 auto;
      padding: 42px clamp(20px, 4vw, 56px) 58px;
    }

    .sun {
      position: absolute;
      z-index: 0;
      top: 24px;
      right: 30px;
      width: 104px;
      aspect-ratio: 1;
      border-radius: 50%;
      background: radial-gradient(circle at 32% 28%, #fff28b 0 16%, #ffd12a 17% 68%, #ffac18 69%);
      box-shadow: 0 0 0 14px rgba(255, 209, 42, 0.18);
    }

    .cloud {
      position: absolute;
      z-index: 0;
      top: 34px;
      left: -74px;
      width: 132px;
      height: 54px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.85);
      box-shadow: 28px -18px 0 12px rgba(255, 255, 255, 0.85), 64px -10px 0 10px rgba(255, 255, 255, 0.85), 18px 12px 0 0 rgba(13, 122, 178, 0.18);
      opacity: 0.78;
      pointer-events: none;
    }

    .hero-copy {
      position: relative;
      z-index: 1;
      display: grid;
      gap: 18px;
      max-width: 720px;
    }

    .eyebrow {
      width: fit-content;
      padding: 7px 12px;
      border: 1px solid rgba(255, 255, 255, 0.6);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.22);
      color: #fff;
      font-size: 13px;
      font-weight: 900;
      text-transform: uppercase;
    }

    h1 {
      color: #fff;
      font-size: clamp(48px, 8vw, 92px);
      line-height: 0.9;
      letter-spacing: 0;
      text-shadow: 0 8px 0 rgba(227, 81, 22, 0.35), 0 18px 30px rgba(18, 48, 71, 0.28);
    }

    .lede {
      max-width: 720px;
      color: #07324d;
      font-size: clamp(18px, 2.4vw, 24px);
      font-weight: 780;
    }

    .hero-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .pill {
      padding: 9px 14px;
      border: 1px solid rgba(255, 159, 44, 0.5);
      border-radius: 999px;
      background: rgba(255, 250, 240, 0.92);
      box-shadow: 0 8px 20px rgba(18, 48, 71, 0.1);
      color: var(--ink);
      font-size: 13px;
      font-weight: 900;
    }

    .hero-actions {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
    }

    .hero-actions a,
    .tool-button {
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 10px 16px;
      border: 1px solid rgba(18, 48, 71, 0.16);
      border-radius: var(--radius);
      background: rgba(255, 250, 240, 0.96);
      color: var(--ink);
      font-weight: 950;
      box-shadow: 0 10px 24px rgba(18, 48, 71, 0.14);
    }

    .hero-actions a:first-child,
    .tool-button.primary {
      border-color: rgba(18, 48, 71, 0.18);
      background: #ff6b23;
      color: white;
      box-shadow: 0 12px 28px rgba(227, 81, 22, 0.26);
    }

    .print-button {
      width: fit-content;
      min-height: 44px;
      padding: 10px 16px;
      border: 0;
      border-radius: var(--radius);
      background: #123047;
      color: white;
      font-weight: 900;
      cursor: pointer;
      box-shadow: 0 10px 24px rgba(18, 48, 71, 0.18);
    }

    .board-stage {
      position: relative;
      z-index: 1;
      display: grid;
      gap: 14px;
      padding: 18px;
      border: 1px solid rgba(255, 159, 44, 0.44);
      border-radius: var(--radius);
      background: rgba(255, 250, 240, 0.86);
      box-shadow: var(--shadow);
    }

    .board-title {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 950;
      text-transform: uppercase;
    }

    .board-preview {
      display: grid;
      grid-template-columns: 86px repeat(5, minmax(58px, 1fr)) 86px;
      grid-template-rows: repeat(2, 86px);
      gap: 10px;
      align-items: stretch;
      min-width: 0;
      padding: 12px;
      border: 3px solid rgba(18, 48, 71, 0.16);
      border-radius: var(--radius);
      background: linear-gradient(180deg, rgba(22, 184, 239, 0.18), transparent 44%), linear-gradient(180deg, #fff4d4, #ffe0a8);
    }

    .cup, .house {
      position: relative;
      display: grid;
      place-items: center;
      min-width: 0;
      border: 2px solid rgba(18, 48, 71, 0.14);
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.72);
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
    }

    .house {
      grid-row: 1 / span 2;
      background: radial-gradient(circle at 50% 52%, rgba(246, 178, 29, 0.32), transparent 36%), rgba(255, 224, 139, 0.88);
    }

    .house.left { grid-column: 1; }
    .house.right { grid-column: 7; }
    .cup:nth-of-type(2) { grid-column: 2; grid-row: 1; }
    .cup:nth-of-type(3) { grid-column: 3; grid-row: 1; }
    .cup:nth-of-type(4) { grid-column: 4; grid-row: 1; }
    .cup:nth-of-type(5) { grid-column: 5; grid-row: 1; }
    .cup:nth-of-type(6) { grid-column: 6; grid-row: 1; }
    .cup:nth-of-type(8) { grid-column: 6; grid-row: 2; }
    .cup:nth-of-type(9) { grid-column: 5; grid-row: 2; }
    .cup:nth-of-type(10) { grid-column: 4; grid-row: 2; }
    .cup:nth-of-type(11) { grid-column: 3; grid-row: 2; }
    .cup:nth-of-type(12) { grid-column: 2; grid-row: 2; }

    .tokens {
      display: grid;
      grid-template-columns: repeat(3, 13px);
      gap: 5px;
    }

    .token {
      width: 13px;
      height: 13px;
      border-radius: 50%;
      background: var(--shell);
      box-shadow: inset 0 -2px rgba(18, 48, 71, 0.14);
    }

    .token.star {
      border-radius: 3px;
      transform: rotate(45deg);
      background: var(--gold);
    }

    .token.snail { background: var(--coral); }

    .arrow {
      position: absolute;
      right: 8px;
      bottom: 5px;
      color: var(--sea);
      font-size: 20px;
      font-weight: 950;
    }

    .caption, .callout {
      padding: 14px;
      border-left: 5px solid var(--orange);
      border-radius: var(--radius);
      background: #fff2df;
      color: #6a341b;
      font-size: 14px;
    }

    .content {
      display: grid;
      grid-template-columns: 230px minmax(0, 1fr);
      gap: 36px;
      max-width: 1240px;
      margin: 0 auto;
      padding: 42px clamp(20px, 4vw, 56px) 76px;
    }

    .toc {
      position: sticky;
      top: 16px;
      align-self: start;
      display: grid;
      gap: 8px;
      padding: 16px;
      border: 1px solid rgba(243, 191, 102, 0.72);
      border-radius: var(--radius);
      background: rgba(255, 250, 240, 0.94);
      box-shadow: 0 12px 30px rgba(18, 48, 71, 0.08);
    }

    .toc strong {
      color: var(--orange);
      font-size: 13px;
      text-transform: uppercase;
    }

    .toc a {
      padding-top: 8px;
      border-top: 1px solid rgba(243, 191, 102, 0.45);
      color: var(--ink);
      font-size: 14px;
      font-weight: 850;
    }

    main { display: grid; gap: 48px; }
    section { display: grid; gap: 18px; }

    .section-head {
      display: grid;
      gap: 8px;
      max-width: 930px;
    }

    h2 {
      color: #10304a;
      font-size: clamp(28px, 4vw, 44px);
      line-height: 1;
    }

    .section-head p {
      color: var(--muted);
      font-size: 17px;
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(12, minmax(0, 1fr));
      gap: 14px;
    }

    .card {
      grid-column: span 4;
      display: grid;
      gap: 10px;
      align-content: start;
      padding: 18px;
      border: 1px solid rgba(243, 191, 102, 0.72);
      border-radius: var(--radius);
      background: rgba(255, 250, 240, 0.94);
      box-shadow: 0 10px 26px rgba(18, 48, 71, 0.06);
    }

    .card.wide { grid-column: span 6; }
    .card.full { grid-column: 1 / -1; }

    .tag {
      width: fit-content;
      padding: 4px 9px;
      border-radius: 999px;
      background: #e4f8ff;
      color: #0872a6;
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
    }

    h3 { font-size: 19px; line-height: 1.16; }
    .card p, .card li, .flow-step p, .mini-step p { color: var(--muted); }

    ul, ol { margin: 0; padding-left: 20px; }
    li + li { margin-top: 7px; }

    .flow {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 10px;
    }

    .flow.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .flow.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .flow-step, .mini-step {
      min-height: 128px;
      padding: 16px;
      border: 1px solid rgba(243, 191, 102, 0.72);
      border-radius: var(--radius);
      background: rgba(255, 250, 240, 0.94);
    }

    .flow-step b, .mini-step b {
      display: block;
      margin-bottom: 8px;
      color: var(--orange);
    }

    .spec-table {
      width: 100%;
      overflow: hidden;
      border: 1px solid rgba(243, 191, 102, 0.72);
      border-radius: var(--radius);
      border-collapse: separate;
      border-spacing: 0;
      background: rgba(255, 250, 240, 0.94);
    }

    .spec-table th, .spec-table td {
      padding: 14px;
      text-align: left;
      vertical-align: top;
      border-bottom: 1px solid rgba(243, 191, 102, 0.45);
    }

    .spec-table th {
      background: #fff1d1;
      color: #10304a;
      font-size: 13px;
      text-transform: uppercase;
    }

    .creature-visual {
      display: grid;
      place-items: center;
      width: 100%;
      min-height: 126px;
      margin: 0;
      border: 1px solid rgba(243, 191, 102, 0.5);
      border-radius: var(--radius);
      background: radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.9), transparent 38%), linear-gradient(180deg, rgba(228, 248, 255, 0.86), rgba(255, 241, 209, 0.76));
    }

    .creature-visual img {
      display: block;
      width: min(112px, 72%);
      height: auto;
      image-rendering: auto;
      filter: drop-shadow(0 8px 12px rgba(18, 48, 71, 0.16));
    }

    .level-map-preview {
      position: relative;
      min-height: 520px;
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      grid-template-rows: repeat(8, 58px);
      gap: 10px;
      padding: 22px;
      border: 1px solid rgba(243, 191, 102, 0.72);
      border-radius: var(--radius);
      background: radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.72), transparent 18%), radial-gradient(circle at 86% 76%, rgba(17, 134, 200, 0.18), transparent 22%), linear-gradient(135deg, #fff2c8 0 54%, #d9f5ff 55% 100%);
      overflow: hidden;
      box-shadow: 0 10px 26px rgba(18, 48, 71, 0.06);
    }

    .level-map-preview::before {
      content: "";
      position: absolute;
      inset: auto -8% 18% -8%;
      height: 90px;
      border-radius: 999px;
      background: rgba(17, 134, 200, 0.22);
      transform: rotate(-8deg);
    }

    .map-node {
      position: relative;
      z-index: 1;
      display: grid;
      place-items: center;
      width: 48px;
      aspect-ratio: 1;
      justify-self: center;
      align-self: center;
      border: 3px solid rgba(18, 48, 71, 0.18);
      border-radius: 50%;
      background: #fffaf0;
      color: var(--ink);
      font-weight: 950;
      box-shadow: 0 8px 18px rgba(18, 48, 71, 0.14);
    }

    .map-node.current { border-color: var(--orange); background: #ffefd6; }
    .map-node.hard { border-color: var(--coral); }
    .map-node.chest, .map-node.gate, .map-node.rescue { border-radius: var(--radius); }
    .map-node.chest { background: #ffe2a1; }
    .map-node.gate { background: #dff7ff; border-color: var(--sea); }
    .map-node.rescue { background: #ffe8ee; border-color: var(--coral); }

    .map-label {
      position: relative;
      z-index: 1;
      align-self: center;
      padding: 8px 10px;
      border-radius: 999px;
      background: rgba(255, 250, 240, 0.86);
      color: var(--muted);
      font-size: 12px;
      font-weight: 900;
      text-align: center;
    }

    .generated-map {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid rgba(243, 191, 102, 0.72);
      border-radius: var(--radius);
      background: rgba(255, 250, 240, 0.94);
      box-shadow: 0 10px 26px rgba(18, 48, 71, 0.06);
    }

    .generated-map img {
      display: block;
      width: 100%;
      max-height: 760px;
      object-fit: contain;
      border-radius: var(--radius);
    }

    .footer {
      padding: 24px;
      background: #10304a;
      color: rgba(255, 255, 255, 0.84);
      text-align: center;
    }

    @media (max-width: 980px) {
      .hero, .content { grid-template-columns: 1fr; }
      .toc { position: static; }
      .card, .card.wide { grid-column: span 6; }
      .flow, .flow.four, .flow.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .level-map-preview { grid-template-rows: repeat(8, 52px); }
    }

    @media (max-width: 720px) {
      .hero { min-height: auto; padding-top: 96px; }
      .sun { width: 72px; }
      .cloud { left: -64px; transform: scale(0.68); transform-origin: top left; }
      .board-stage { overflow-x: auto; }
      .board-preview { min-width: 620px; }
      .hero-actions { align-items: stretch; }
      .hero-actions > * { width: 100%; }
      .grid, .flow, .flow.four, .flow.three { grid-template-columns: 1fr; }
      .level-map-preview { min-width: 620px; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(8, 52px); min-height: 560px; }
      .card, .card.wide { grid-column: 1; }
    }

    @media print {
      body { background: white; }
      .sun, .cloud, .toc, .print-button { display: none; }
      .hero, .content { display: block; padding: 24px; }
      .card, .board-stage, .flow-step, .mini-step, .spec-table { break-inside: avoid; box-shadow: none; }
    }
  

    .toc a[aria-current="page"] {
      border-color: rgba(18, 48, 71, 0.34);
      background: #123047;
      color: white;
    }

    .subhero {
      max-width: 1240px;
      margin: 0 auto;
      padding: 42px clamp(20px, 4vw, 56px) 26px;
    }

    .subhero .hero-copy {
      max-width: 860px;
    }

    .subhero h1 {
      font-size: clamp(42px, 7vw, 76px);
    }

    .subhero .lede {
      max-width: 860px;
    }

    .cover-main {
      display: grid;
      gap: 18px;
    }

    .section-links .card {
      min-height: 160px;
    }

    .section-links a.card {
      display: grid;
      color: inherit;
      transition: transform 0.16s ease, box-shadow 0.16s ease;
    }

    .section-links a.card:hover,
    .section-links a.card:focus-visible {
      transform: translateY(-2px);
      box-shadow: 0 16px 36px rgba(18, 48, 71, 0.16);
      outline: 0;
    }

    .page-switcher {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-top: 22px;
    }

    .page-switcher a {
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 10px 14px;
      border: 1px solid rgba(18, 48, 71, 0.16);
      border-radius: var(--radius);
      background: rgba(255, 250, 240, 0.92);
      color: var(--ink);
      font-weight: 900;
      box-shadow: 0 8px 22px rgba(18, 48, 71, 0.08);
    }

    .page-switcher a:last-child {
      margin-left: auto;
    }

    .editor-embed {
      display: grid;
      gap: 12px;
    }

    .editor-frame {
      width: 100%;
      min-height: 760px;
      border: 1px solid rgba(18, 48, 71, 0.18);
      border-radius: var(--radius);
      background: white;
      box-shadow: var(--shadow);
    }

    .editor-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .editor-actions a {
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 10px 14px;
      border: 1px solid rgba(18, 48, 71, 0.16);
      border-radius: var(--radius);
      background: #123047;
      color: white;
      font-weight: 900;
      box-shadow: 0 8px 22px rgba(18, 48, 71, 0.1);
    }

    @media (max-width: 720px) {
      .subhero { padding-top: 64px; }
      .page-switcher { flex-direction: column; }
      .page-switcher a:last-child { margin-left: 0; }
      .editor-frame { min-height: 680px; }
    }
