/* Pixlaria's website, in the game's own carved interface kit (client/css/kit.css): an ink outline, corners
   cut at 45 degrees, a lit and a shaded inner edge and a hard ledge underneath; parchment for what you
   read, evergreen and honey for what you press; headings in Pixlaria Blocks, the logo's letters, at sizes
   where every cell lands on whole pixels. The sections are the places of a day in the game: meadow,
   parchment, sunshine, night, and a sky with a grass edge at the end. */
@font-face { font-family: 'Pixlaria Blocks'; src: url('../fonts/pixlaria-blocks.woff2') format('woff2'); font-display: swap; }

:root {
  --ink: #2b1d0e;
  --honey: #f6c531; --honey-hi: #ffe27a; --honey-deep: #d29c1c; --honey-depth: #a9771a;
  --leaf: #3f8a4e; --leaf-hi: #64ae6b; --leaf-deep: #2c6a3c; --leaf-dark: #1f4f2c;
  --logo-leaf: #8fb23c; --logo-leaf-hi: #bbd862; --logo-leaf-deep: #6c8d2c;
  --sky: #3b93e8; --sky-hi: #84c3ff; --sky-deep: #256bbc;
  --berry: #ea4f3b; --plum: #8a6cff;
  --paper: #fff6de; --paper-2: #f6e5bc; --line: #e2c88e; --brown: #7a5424; --text: #3d2c17;
  --night: #1b2456; --night-2: #111a46; --tray: #1d3426; --tray-2: #15271c;
  --blocks: 'Pixlaria Blocks', 'Trebuchet MS', sans-serif;
  --read: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
  --parchment: linear-gradient(#fffaee, #f6e5bc);
  --raised: linear-gradient(#fffaee, #f1dcae);
  --evergreen: linear-gradient(#64ae6b 0 3px, #3f8a4e 3px calc(100% - 4px), #2c6a3c calc(100% - 4px));
  --honeyband: linear-gradient(#ffe27a 0 4px, #f6c531 4px calc(100% - 5px), #d29c1c calc(100% - 5px));
  --bevel: inset 2px 2px 0 rgba(255, 255, 255, 0.8), inset -2px -2px 0 rgba(201, 150, 62, 0.32);
  --ledge: 0 5px 0 rgba(43, 29, 14, 0.42);
  --gutter: 16px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 600 16px/1.6 var(--read); overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
.wrap { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }
@media (min-width: 700px) { :root { --gutter: 28px; } }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; background: var(--paper); border: 3px solid var(--ink); border-radius: 8px; font-weight: 800; }
.skip:focus { top: 12px; }

/* ---- Pieces of the kit ------------------------------------------------------------------------------ */
.card { background: var(--parchment); border: 3px solid var(--ink); border-radius: 14px; corner-shape: bevel; box-shadow: var(--bevel), var(--ledge); color: var(--text); }
.blocks { font-family: var(--blocks); font-weight: 400; letter-spacing: 0.04em; line-height: 1.15; text-transform: uppercase; text-wrap: balance; }
h3, .tam-words, .section-lead, .hero-lead { text-wrap: pretty; }
/* A heading in the logo's manner: letters with a darker step below and right, and an ink line round both. */
.section-head h2, .hero-title, .finale h2 {
  --face: var(--honey); --depth: var(--honey-depth); --o: 0.05em; --d: 0.085em;
  color: var(--face);
  text-shadow:
    var(--d) var(--d) 0 var(--depth),
    var(--o) 0 0 var(--ink), calc(-1 * var(--o)) 0 0 var(--ink), 0 var(--o) 0 var(--ink), 0 calc(-1 * var(--o)) 0 var(--ink),
    var(--o) var(--o) 0 var(--ink), calc(-1 * var(--o)) calc(-1 * var(--o)) 0 var(--ink), var(--o) calc(-1 * var(--o)) 0 var(--ink), calc(-1 * var(--o)) var(--o) 0 var(--ink),
    calc(var(--d) + var(--o)) var(--d) 0 var(--ink), var(--d) calc(var(--d) + var(--o)) 0 var(--ink), calc(var(--d) + var(--o)) calc(var(--d) + var(--o)) 0 var(--ink),
    0 0.16em 0 rgba(43, 29, 14, 0.25);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px 2px;
  border: 3px solid var(--ink); border-radius: 10px; corner-shape: bevel; text-decoration: none; cursor: pointer; white-space: nowrap;
  font: 16px/1 var(--blocks); letter-spacing: 0.05em; text-transform: uppercase;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(2px); }
.btn-leaf { background: var(--evergreen); color: var(--paper); text-shadow: 0 2px 0 var(--ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 4px 0 rgba(43, 29, 14, 0.45); }
.btn-leaf:hover { background: linear-gradient(#78c07e 0 3px, #4f9d5c 3px calc(100% - 4px), #347a45 calc(100% - 4px)); }
.btn-honey { background: var(--honeyband); color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); box-shadow: inset 0 -3px 0 rgba(150, 90, 10, 0.25), 0 4px 0 rgba(43, 29, 14, 0.45); }
.btn-big { min-height: 60px; padding: 0 26px 2px; font-size: 16px; border-radius: 12px; }
.btn-small { min-height: 40px; padding: 0 14px 2px; font-size: 16px; }
.btn-spark { width: 18px; height: 18px; flex: none; background: var(--honey-hi); -webkit-mask: url('img/sparkle.svg') center / contain no-repeat; mask: url('img/sparkle.svg') center / contain no-repeat; filter: drop-shadow(0 2px 0 var(--ink)); }
@media (min-width: 700px) { .btn-big { font-size: 24px; min-height: 68px; } .btn-spark { width: 22px; height: 22px; } }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: var(--raised); border: 3px solid var(--ink); border-radius: 9px; corner-shape: bevel;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(160, 110, 40, 0.3), 0 3px 0 rgba(43, 29, 14, 0.4);
}
.icon-btn:hover { background: linear-gradient(#fff0a8, var(--honey)); }
.icon-btn:active { transform: translateY(2px); }
.arrow { width: 12px; height: 16px; background: var(--ink); }
.arrow-left { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.arrow-right { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.pause-glyph { width: 14px; height: 16px; background: linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 9px, var(--ink) 9px); }
[aria-pressed="true"] > .pause-glyph { width: 13px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 16px/1 var(--blocks); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brown); }
.eyebrow::before { content: ''; width: 16px; height: 16px; background: var(--honey); -webkit-mask: url('img/sparkle.svg') center / contain no-repeat; mask: url('img/sparkle.svg') center / contain no-repeat; filter: drop-shadow(1px 1px 0 var(--ink)); }
.word { font-style: normal; font-weight: 800; color: #6b4fc9; }
kbd { display: inline-block; min-width: 24px; padding: 1px 6px 0; margin: 0 2px; background: #fffdf5; border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 5px; corner-shape: bevel; font: 800 13px/18px var(--read); color: var(--ink); text-align: center; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px 0; margin-right: 6px; vertical-align: 1px; background: var(--honeyband); border: 2px solid var(--ink); border-radius: 6px; corner-shape: bevel; font: 16px/1 var(--blocks); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.tag-leaf { background: var(--evergreen); color: var(--paper); text-shadow: 0 2px 0 var(--ink); }
.tag-sky { background: linear-gradient(#84c3ff 0 3px, #3b93e8 3px calc(100% - 4px), #256bbc calc(100% - 4px)); color: #fff; text-shadow: 0 2px 0 var(--ink); }
.tag-berry { background: linear-gradient(#ff9a86 0 3px, #ea4f3b 3px calc(100% - 4px), #b32f1e calc(100% - 4px)); color: #fff; text-shadow: 0 2px 0 var(--ink); }
.tag-night { background: linear-gradient(#8a94d0 0 3px, #46508a 3px calc(100% - 4px), #2b3570 calc(100% - 4px)); color: #fff; text-shadow: 0 2px 0 var(--ink); }

/* ---- The top bar ------------------------------------------------------------------------------------ */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 30; padding: 10px var(--gutter); pointer-events: none; transition: transform 0.25s ease; }
.topbar-inner {
  display: flex; align-items: center; gap: 12px; max-width: 1240px; margin: 0 auto; padding: 6px 8px 6px 14px; pointer-events: auto;
  background: var(--parchment); border: 3px solid var(--ink); border-radius: 14px; corner-shape: bevel; box-shadow: var(--bevel), 0 4px 0 rgba(43, 29, 14, 0.4), 0 10px 24px rgba(20, 30, 20, 0.18);
}
.brand { display: block; flex: none; line-height: 0; }
.brand img { width: 122px; height: auto; }
.nav { display: none; flex: 1; justify-content: center; gap: 4px; }
.nav a { padding: 9px 10px 7px; border-radius: 7px; corner-shape: bevel; font: 16px/1 var(--blocks); letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: var(--brown); }
.nav a:hover { background: rgba(246, 197, 49, 0.35); color: var(--ink); }
.topbar .btn { margin-left: auto; }
@media (min-width: 1100px) { .nav { display: flex; } .topbar .btn { margin-left: 0; } .brand img { width: 140px; } }

/* ---- The hero: the town in the morning, and the game's front door card -------------------------------- */
.hero { position: relative; min-height: max(640px, 100svh); display: flex; align-items: flex-end; padding: 96px var(--gutter) 64px; background: #7fc4ea; overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media .clip-stage { position: absolute; inset: 0; border: 0; border-radius: 0; }
.hero-media::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(43, 29, 14, 0.45), rgba(43, 29, 14, 0) 45%), linear-gradient(90deg, rgba(43, 29, 14, 0.28), rgba(43, 29, 14, 0) 55%); }
.hero-card { position: relative; width: 100%; max-width: 480px; padding: 16px 18px 16px; text-align: center; box-shadow: var(--bevel), 0 6px 0 rgba(43, 29, 14, 0.45), 0 22px 44px rgba(20, 30, 20, 0.35); }
.hero-logo { width: min(100%, 360px); height: auto; margin: 0 auto 4px; filter: drop-shadow(0 3px 0 rgba(90, 60, 20, 0.16)); animation: float 4.5s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.hero-title { margin: 8px 0 10px; font-size: 24px; line-height: 1.25; --face: var(--leaf-hi); --depth: var(--leaf-deep); }
.hero-lead { margin: 0 auto 16px; max-width: 400px; font: 700 16px/1.55 var(--read); color: #5a4122; }
.hero-actions { display: grid; gap: 10px; }
.hero-note { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin-top: 12px; font: 700 13px/1.3 var(--read); color: #8a6a40; }
.hero-note i { width: 9px; height: 9px; background: var(--honey-deep); -webkit-mask: url('img/sparkle.svg') center / contain no-repeat; mask: url('img/sparkle.svg') center / contain no-repeat; }
/* The Pioneers (server/pioneers.js): a honey ribbon under the card's note; site.js swaps in how many are left, or that
   all are taken. */
.hero-pioneers { margin: 12px auto 0; max-width: 400px; padding: 7px 12px; border-radius: 8px; background: var(--honeyband); box-shadow: var(--bevel), 0 3px 0 rgba(43, 29, 14, 0.3); font: 700 13px/1.4 var(--read); color: #4a3410; }
.hero-pioneers b { font-weight: 900; }
.hero-pioneers b::before { content: '\2605  '; }
.hero-pioneers[hidden] { display: none; }
@media (max-width: 699px) {
  /* On a phone the town gets the top of the screen, and the card sits under it, overlapping a little. */
  .hero { display: block; min-height: 0; padding: 0 0 60px; }
  .hero-media { position: relative; inset: auto; height: min(62svh, 500px); z-index: 0; }
  .hero-media::after { background: linear-gradient(0deg, rgba(43, 29, 14, 0.35), rgba(43, 29, 14, 0) 40%); }
  .hero-card { margin: -84px var(--gutter) 0; width: auto; }
}
@media (min-width: 700px) {
  .hero { align-items: center; padding: 110px 5vw 90px; }
  .hero-card { padding: 22px 28px 20px; }
  .hero-title { font-size: 32px; }
  .hero-lead { font-size: 17px; }
}
@media (min-width: 1100px) { .hero-card { max-width: 500px; } .hero-title { font-size: 40px; } }

.motion-toggle {
  position: absolute; right: var(--gutter); bottom: 44px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 10px; cursor: pointer;
  background: rgba(29, 52, 38, 0.86); color: var(--paper); border: 2px solid var(--ink); border-radius: 8px; corner-shape: bevel;
  font: 700 13px/1 var(--read); box-shadow: inset 2px 2px 0 rgba(140, 204, 146, 0.22), 0 3px 0 rgba(43, 29, 14, 0.4);
}
.motion-toggle:hover { background: rgba(44, 106, 60, 0.95); }
.motion-icon { width: 12px; height: 14px; background: linear-gradient(90deg, var(--honey) 0 4px, transparent 4px 8px, var(--honey) 8px); }
.motion-toggle[aria-pressed="true"] .motion-icon { background: var(--honey); clip-path: polygon(0 0, 100% 50%, 0 100%); }
@media (max-width: 699px) { .motion-toggle { top: 76px; bottom: auto; } }

/* ---- Films ---------------------------------------------------------------------------------------------- */
.clip-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tray); }
.clip-stage > img, .clip-stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip-stage > video { opacity: 0; transition: opacity 0.5s ease; }
.clip-stage.is-playing > video { opacity: 1; }
.hero .clip-stage { aspect-ratio: auto; }
.clip-play {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  background: rgba(29, 52, 38, 0.82); border: 2px solid var(--ink); border-radius: 8px; corner-shape: bevel; box-shadow: 0 3px 0 rgba(43, 29, 14, 0.4);
  opacity: 0; transition: opacity 0.2s ease;
}
.clip-play::before { content: ''; width: 12px; height: 14px; background: linear-gradient(90deg, var(--honey) 0 4px, transparent 4px 8px, var(--honey) 8px); }
.clip-play[aria-pressed="true"]::before { background: var(--honey); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.clip-stage:hover .clip-play, .clip-play:focus-visible, .clip-play[aria-pressed="true"], .no-hover .clip-play { opacity: 1; }
.clip-big {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; cursor: pointer;
  background: rgba(29, 52, 38, 0.82); color: var(--paper); border: 2px solid var(--ink); border-radius: 8px; corner-shape: bevel; box-shadow: 0 3px 0 rgba(43, 29, 14, 0.4);
  font: 700 13px/1 var(--read); opacity: 0; transition: opacity 0.2s ease;
}
.clip-big::before { content: ''; width: 14px; height: 14px; background: conic-gradient(from 90deg at 5px 5px, transparent 0 25%, var(--honey) 0) 0 0 / 50% 50%; }
.clip-stage:hover .clip-big, .clip-big:focus-visible, .no-hover .clip-big { opacity: 1; }
@media (max-width: 699px) { .clip-big { display: none; } }

.clip { min-width: 0; }
.clip-frame { padding: 7px; background: var(--parchment); border: 3px solid var(--ink); border-radius: 16px; corner-shape: bevel; box-shadow: var(--bevel), 0 5px 0 rgba(43, 29, 14, 0.45), 0 16px 30px rgba(20, 30, 20, 0.22); }
.clip-frame .clip-stage { border: 3px solid var(--ink); border-radius: 9px; corner-shape: bevel; }
.clip figcaption { margin-top: 12px; padding: 0 4px; font: 700 15px/1.5 var(--read); }

/* ---- Sections ------------------------------------------------------------------------------------------ */
.band { position: relative; padding: 64px 0 88px; }
.band > .wrap { position: relative; }   /* over the night's stars (positioned layers paint over plain blocks) */
.section-head { max-width: 760px; margin-bottom: 28px; }
.section-head h2 { margin: 10px 0 14px; font-size: 32px; }
.session-info { margin-top: 20px; padding-top: 16px; border-top: 2px solid var(--line); font-size: 16px; line-height: 1.6; }
.section-lead { font: 700 17px/1.6 var(--read); }
@media (min-width: 700px) { .band { padding: 84px 0 110px; } .section-head h2 { font-size: 40px; } .section-lead { font-size: 18px; } }
@media (min-width: 1100px) { .section-head h2 { font-size: 48px; } }

.edge { position: absolute; left: 0; right: 0; bottom: -1px; height: 24px; pointer-events: none; background: var(--to, var(--leaf)); -webkit-mask: url('img/edge-grass.svg') left bottom / 128px 24px repeat-x; mask: url('img/edge-grass.svg') left bottom / 128px 24px repeat-x; }
.edge-steps { height: 24px; -webkit-mask-image: url('img/edge-steps.svg'); mask-image: url('img/edge-steps.svg'); -webkit-mask-size: 192px 24px; mask-size: 192px 24px; }
.edge-grass { --to: #3a8549; }
.edge-to-paper { --to: #fff6de; }
.edge-to-honey { --to: #ffe59a; }
.edge-to-night { --to: var(--night); }
.edge-to-tray { --to: var(--tray); }
.edge-to-sky { --to: #6cb4ea; }

/* Meadow: the world */
.band-meadow { background: linear-gradient(#3a8549, #347a45 45%, #2f7040); color: var(--paper); }
.band-meadow .eyebrow { color: #fff; }
.band-meadow .section-lead { color: #fff; text-shadow: 0 1px 0 rgba(20, 50, 25, 0.5); }
.band-meadow .clip figcaption { color: #fffdf3; text-shadow: 0 1px 0 rgba(20, 50, 25, 0.6); }
.clips { display: grid; gap: 28px 24px; }
.clips-feature { grid-template-columns: 1fr; }
.clips-pair { grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .clips-feature { grid-template-columns: 1fr 1fr; }
  .clips-feature .clip-wide { grid-column: 1 / -1; }
  .clips-pair { grid-template-columns: 1fr 1fr; }
}
.facts { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; padding: 16px; }
.fact img, .step img, .skill-list img, .safe img, .spell-list img { image-rendering: pixelated; }
.fact img { width: 48px; height: 48px; }
.fact h3, .step h3, .build-extras h3, .start-step h3, .controls h3, .adventure-notes h3 { font: 16px/1.3 var(--blocks); letter-spacing: 0.04em; text-transform: uppercase; color: var(--leaf-deep); margin-bottom: 6px; }
.fact p, .step p { font: 600 15px/1.5 var(--read); }

/* Parchment: skills and the start */
.band-paper { background: linear-gradient(#fff6de, #f8e8c2); }
.band-paper .section-head h2 { --face: var(--logo-leaf); --depth: var(--logo-leaf-deep); }
.skill-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.skill-list li { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px 4px 6px; background: #fffaf0; border: 2px solid var(--ink); border-radius: 9px; corner-shape: bevel; box-shadow: 0 3px 0 rgba(43, 29, 14, 0.25); font: 800 15px/1 var(--read); color: #5a3a10; }
.skill-list img { width: 36px; height: 36px; }

/* Sunshine: building */
.band-honey { background: linear-gradient(#ffe59a, #ffd873 60%, #f9ca55); }
.band-honey .section-head h2 { --face: var(--sky-hi); --depth: var(--sky-deep); }
.band-honey .eyebrow { color: #7a4f10; }
.build-grid { display: grid; gap: 28px; }
.build-grid .section-head { margin-bottom: 0; }
.clip-build figcaption { color: #4a3413; }
.steps { display: grid; gap: 22px 14px; padding-top: 8px; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) {
  .build-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); grid-template-areas: 'head clip' 'steps steps' 'extras extras'; column-gap: 40px; row-gap: 36px; align-items: center; }
  .build-grid .section-head { grid-area: head; }
  .build-grid .clip-build { grid-area: clip; }
  .build-grid .steps { grid-area: steps; }
  .build-grid .build-extras { grid-area: extras; }
}
.step { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 18px 14px 14px; }
.step img { width: 36px; height: 36px; margin-top: 2px; }
.step-num { position: absolute; left: -10px; top: -14px; display: grid; place-items: center; width: 34px; height: 34px; padding-top: 3px; background: var(--honeyband); border: 3px solid var(--ink); border-radius: 8px; corner-shape: bevel; font-size: 16px; color: var(--ink); box-shadow: 0 3px 0 rgba(43, 29, 14, 0.35); }
.build-extras { display: grid; gap: 16px; }
@media (min-width: 860px) { .build-extras { grid-template-columns: 1.2fr 1fr; } }
.build-extras .card { padding: 18px 20px; }
.build-extras p { font: 600 15px/1.55 var(--read); }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.swatches li { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 800 13px/1 var(--read); color: #5a3a10; }
.swatches li::before { content: ''; width: 100%; max-width: 64px; aspect-ratio: 1; background: var(--sw); border: 3px solid var(--ink); border-radius: 8px; corner-shape: bevel; box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.35), inset -3px -4px 0 rgba(0, 0, 0, 0.2), 0 3px 0 rgba(43, 29, 14, 0.3); }
@media (min-width: 480px) { .swatches { grid-template-columns: repeat(8, 1fr); } }

/* Night: adventure */
.band-night { background: linear-gradient(#1e2a60, #16205a 45%, #111a46); color: #e9ecff; overflow: hidden; }
.band-night .eyebrow { color: #ffe27a; }
.band-night .section-lead { color: #d8def8; }
.band-night .clip figcaption { color: #e9ecff; }
.band-night .clip-frame { background: linear-gradient(#3b4a8a, #26306a); box-shadow: inset 2px 2px 0 rgba(170, 190, 255, 0.35), inset -2px -2px 0 rgba(0, 0, 0, 0.25), 0 5px 0 rgba(0, 0, 0, 0.45), 0 16px 34px rgba(0, 0, 0, 0.35); }
.band-night .word { color: #cbbcff; }
.stars { position: absolute; inset: 0; pointer-events: none; opacity: 0.9;
  background:
    radial-gradient(2px 2px at 10% 12%, #fff6c8 50%, transparent 51%), radial-gradient(2px 2px at 24% 30%, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 38% 8%, #ffe27a 50%, transparent 51%), radial-gradient(2px 2px at 52% 22%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 66% 10%, #fff6c8 50%, transparent 51%), radial-gradient(3px 3px at 80% 26%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 92% 14%, #ffe27a 50%, transparent 51%), radial-gradient(2px 2px at 6% 48%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 94% 52%, #fff6c8 50%, transparent 51%), radial-gradient(2px 2px at 18% 70%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 84% 78%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 46% 62%, #ffe27a 50%, transparent 51%);
  background-size: 1200px 900px; }
.tam { display: grid; gap: 20px; align-items: center; margin-bottom: 36px; }
@media (min-width: 900px) { .tam { grid-template-columns: 1.35fr 1fr; gap: 32px; } }
.tam-quote { position: relative; padding: 22px 22px 18px; }
.tam-quote::before { content: ''; position: absolute; left: 40px; top: -17px; width: 26px; height: 17px; background: var(--ink); clip-path: polygon(0 100%, 50% 0, 100% 100%); }
.tam-quote::after { content: ''; position: absolute; left: 44px; top: -10px; width: 18px; height: 12px; background: #fffaee; clip-path: polygon(0 100%, 50% 0, 100% 100%); }
@media (min-width: 900px) {
  .tam-quote::before { left: -17px; top: 34px; width: 17px; height: 26px; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
  .tam-quote::after { left: -10px; top: 38px; width: 12px; height: 18px; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
}
.tam-words { font: 24px/1.3 var(--blocks); letter-spacing: 0.02em; text-transform: uppercase; color: #b32f1e; }
.tam-quote footer { margin-top: 12px; font: 700 15px/1.5 var(--read); color: #6a5030; }
@media (min-width: 700px) { .tam-words { font-size: 32px; } }
.adventure-notes { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 860px) { .adventure-notes { grid-template-columns: 1.15fr 1fr; } }
.card-tray { background: #1d3426; color: #eef3e2; box-shadow: inset 2px 2px 0 rgba(140, 204, 146, 0.22), inset -2px -2px 0 rgba(0, 0, 0, 0.25), 0 5px 0 rgba(0, 0, 0, 0.45); padding: 18px 20px; }
.card-tray h3 { color: var(--honey-hi) !important; }
.card-tray p { font: 600 15px/1.55 var(--read); }
.card-tray .word { color: #d6c9ff; }
.spell-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; margin-top: 14px; }
@media (min-width: 520px) { .spell-list { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 860px) { .spell-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .spell-list { grid-template-columns: repeat(4, 1fr); } }
.spell-list li { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px; background: rgba(6, 18, 11, 0.45); border: 2px solid rgba(0, 0, 0, 0.45); border-radius: 8px; corner-shape: bevel; }
.spell-list img { grid-row: 1 / 3; width: 40px; height: 40px; }
.spell-list b { font: 800 15px/1.1 var(--read); }
.spell-list span { font: 600 12px/1.2 var(--read); color: #b9c8b0; }
.safe { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.safe img { width: 36px; height: 36px; flex: none; }

/* Tray: the pictures */
.band-tray { background: linear-gradient(var(--tray), var(--tray-2)); color: var(--paper); }
.band-tray .eyebrow { color: var(--honey-hi); }
.slideshow { display: grid; gap: 16px; }
.slide-stage { position: relative; padding: 8px 8px 12px; }
.slide-open { display: block; width: 100%; padding: 0; border: 3px solid var(--ink); border-radius: 9px; corner-shape: bevel; overflow: hidden; background: var(--tray); cursor: zoom-in; aspect-ratio: 16 / 9; }
.slide-img { width: 100%; height: 100%; object-fit: contain; transition: opacity 0.35s ease; }
.slide-img.is-fading { opacity: 0.15; }
.slide-caption { min-height: 3em; margin: 12px 118px 0 6px; font: 700 15px/1.45 var(--read); color: var(--text); }
.slide-controls { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }
@media (max-width: 559px) { .slide-caption { margin-right: 6px; } .slide-controls { position: static; justify-content: flex-end; margin: 8px 4px 0; } }
.thumbs { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(132px, 1fr); gap: 10px; overflow-x: auto; padding: 4px 4px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #c9a25a transparent; }
.thumbs button { display: block; width: 100%; padding: 0; border: 3px solid var(--ink); border-radius: 8px; corner-shape: bevel; overflow: hidden; cursor: pointer; background: var(--tray); scroll-snap-align: start; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45); opacity: 0.72; transition: opacity 0.2s ease, transform 0.2s ease; }
.thumbs button:hover { opacity: 1; transform: translateY(-2px); }
.thumbs button[aria-current="true"] { opacity: 1; outline: 3px solid var(--honey); outline-offset: 0; }
.thumbs img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
@media (min-width: 1100px) {
  .slideshow { grid-template-columns: minmax(0, 3.1fr) minmax(0, 1fr); align-items: start; gap: 20px; }
  .thumbs { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); grid-auto-columns: auto; overflow: visible; padding: 0; gap: 10px; }
}

/* The start */
.start-steps { display: grid; gap: 22px 16px; }
.discover { padding: 70px 0; background: #f7f2df; }
.discovery-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.discovery-grid h3 { margin-bottom:12px; }
.discovery-grid a { display:inline-block; margin-top:16px; color:var(--leaf-dark); font-weight:700; }
.discover details { padding:16px 0; border-top:1px solid #d9ceb6; }
.discover details:first-of-type { margin-top:16px; }
.discover summary { cursor:pointer; font-weight:700; }
.discover details p { margin-top:12px; max-width:75ch; line-height:1.65; }
@media(max-width:760px){.discovery-grid{grid-template-columns:1fr}.discover{padding:45px 0}}
@media (min-width: 640px) { .start-steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .start-steps { grid-template-columns: repeat(4, 1fr); } }
.start-step { position: relative; padding: 24px 18px 16px; }
.start-step p { font: 600 15px/1.55 var(--read); }
.controls { margin-top: 28px; padding: 18px 20px; }
.keys { display: grid; gap: 10px 22px; margin-top: 6px; }
@media (min-width: 700px) { .keys { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .keys { grid-template-columns: repeat(3, 1fr); } }
.keys div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 10px; background: #fffaf0; border: 2px solid var(--line); border-radius: 8px; corner-shape: bevel; }
.keys dt { font: 800 14px/1.6 var(--read); color: var(--ink); }
.keys dd { margin: 0; font: 600 14px/1.4 var(--read); color: #6a5030; text-align: right; }

/* The finale: sky and meadow, like the logo's banner */
.finale { position: relative; padding: 72px 0 120px; background: linear-gradient(#3f97e0, #6cb4ea 30%, #8fd0f5 60%, #c9ecfb); text-align: center; overflow: hidden; }
.finale::before, .finale::after { content: ''; position: absolute; top: 18%; width: 132px; height: 40px; background: #fff; opacity: 0.9;
  clip-path: polygon(0 60%, 12% 60%, 12% 30%, 30% 30%, 30% 0, 62% 0, 62% 30%, 82% 30%, 82% 55%, 100% 55%, 100% 100%, 0 100%); animation: drift 26s linear infinite alternate; }
.finale::before { left: 6%; }
.finale::after { right: 8%; top: 34%; transform: scale(0.75); animation-duration: 34s; }
@keyframes drift { from { translate: -20px 0; } to { translate: 40px 0; } }
.finale-inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: 22px; }
.finale h2 { max-width: 760px; font-size: 32px; --face: var(--honey); --depth: var(--honey-depth); }
@media (min-width: 700px) { .finale h2 { font-size: 48px; } }
.finale-note { padding: 6px 14px; background: rgba(255, 246, 222, 0.9); border: 2px solid var(--ink); border-radius: 8px; corner-shape: bevel; box-shadow: 0 3px 0 rgba(43, 29, 14, 0.3); font: 800 15px/1.4 var(--read); color: var(--text); }
.finale-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background: linear-gradient(#6aad4f 0 12px, #58a04b 12px 30px, #4f8f45 30px); }
.finale-ground::before { content: ''; position: absolute; left: 0; right: 0; top: -20px; height: 24px; background: #6aad4f; -webkit-mask: url('img/edge-grass.svg') left bottom / 128px 24px repeat-x; mask: url('img/edge-grass.svg') left bottom / 128px 24px repeat-x; }

/* ---- Footer ---------------------------------------------------------------------------------------------- */
.footer { background: var(--leaf-dark); color: #d9e6cf; padding: 28px 0 34px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 40px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 56px; height: 56px; image-rendering: pixelated; }
.footer-brand p { font: 700 15px/1.4 var(--read); }
.press { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.press h2 { font-size: 16px; color: var(--honey-hi); }
.press ul { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.press a { font: 700 14px/1.4 var(--read); color: #fff2b8; text-underline-offset: 4px; }

/* ---- The lightbox ----------------------------------------------------------------------------------------- */
.lightbox { width: min(1280px, 100vw - 24px); max-width: none; max-height: calc(100vh - 24px); padding: 0; border: 0; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(10, 18, 12, 0.78); }
.lightbox-card { padding: 8px 8px 10px; }
.lightbox-media { border: 3px solid var(--ink); border-radius: 9px; corner-shape: bevel; overflow: hidden; background: var(--tray); line-height: 0; }
.lightbox-media img, .lightbox-media video { width: 100%; height: auto; max-height: calc(100vh - 150px); object-fit: contain; background: var(--tray); }
.lightbox-caption { margin: 10px 6px 0; font: 700 15px/1.45 var(--read); color: var(--text); }
.lightbox-controls { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 8px 4px 0; }
.lightbox-controls [hidden] { display: none; }

/* ---- Less motion ---------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-logo, .finale::before, .finale::after { animation: none; }
  .btn, .thumbs button, .slide-img, .clip-stage > video { transition: none; }
}

/* The same parchment and carved lettering, with quiet tables for public progression. */
.rankings-invite { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px; }
.rankings-invite div { max-width: 760px; }
.rankings-invite h2 { margin-bottom: 12px; font-size: 28px; }
.rankings-invite .btn { flex: none; max-width: 100%; white-space: normal; text-align: center; }
.rankings-page { min-height: 100vh; background: linear-gradient(#d9edcf, var(--paper) 480px); }
.rankings-main { padding-top: 125px; padding-bottom: 40px; }
.rankings-main h1 { color: var(--leaf-dark); font-size: clamp(28px, 5vw, 48px); margin-bottom: 18px; }
.rankings-back { margin-left: auto; font-weight: 800; }
.rankings-board, .ranking-rules { padding: 24px; }
.ranking-filters { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; margin-bottom: 20px; }
.ranking-filters div { flex: 1 1 210px; min-width: 0; }
.ranking-filters label { display: block; font-weight: 800; margin-bottom: 6px; }
.ranking-filters select, .ranking-filters input { width: 100%; min-height: 46px; font: inherit; color: var(--text); background: #fffaf0; border: 2px solid var(--ink); border-radius: 6px; padding: 8px 10px; }
.ranking-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0; }
#ranking-status, #ranking-explanation { font-size: 15px; }
.ranking-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ranking-table th, .ranking-table td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.ranking-table th:first-child, .ranking-table td:first-child { width: 60px; text-align: center; }
.ranking-table th:nth-child(2) { text-align: left; overflow-wrap: anywhere; }
.ranking-table thead { background: var(--leaf-dark); color: var(--paper); font-size: 14px; }
.ranking-table tbody tr:nth-child(even) { background: rgba(246,197,49,.08); }
.ranking-table small { display: block; font-weight: 600; color: #6a5030; }
.ranking-podium { color: #805210; font-weight: 900; background: rgba(246,197,49,.2); }
.ranking-pioneer { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--honeyband); box-shadow: inset 0 0 0 1px var(--honey-depth); color: #4a3410; font: 800 12px/1.6 var(--read); vertical-align: 1px; white-space: nowrap; }   /* a Pioneer (server/pioneers.js) */
.ranking-pages { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.ranking-pages button:disabled { opacity: .45; cursor: default; }
#ranking-empty { padding: 24px 0; }
.ranking-rules { margin-top: 28px; }
.ranking-rules h2 { color: var(--leaf-dark); font-size: 22px; }
.ranking-rules p { margin-top: 14px; }
.ranking-footer { margin-top: 30px; text-align: center; }
@media (max-width: 699px) {
  .rankings-invite { align-items: flex-start; flex-direction: column; }
  .rankings-back { display: none; }
  .rankings-board, .ranking-rules { padding: 14px; }
  .ranking-table { font-size: 12px; }
  .ranking-table th, .ranking-table td { padding: 12px 4px; }
  .ranking-table thead { font-size: 11px; }
  .ranking-table th:first-child, .ranking-table td:first-child { width: auto; }
  .ranking-table th:nth-child(2) { max-width: 90px; }
  .ranking-table small { font-size: 10px; }
  .ranking-pages { font-size: 13px; gap: 8px; }
}
