:root {
  --forest: #1f3b2d;
  --moss: #4f7d3a;
  --leaf: #7ed957;
  --bark: #6b4a2b;
  --grass: #d9a441;
  --sunset: #ff7a1a;
  --sunset-deep: #d95a00;
  --sky: #7cc6e8;
  --lake: #3d8fc4;
  --paper: #fff6e3;
  --paper-2: #fdecc8;
  --card: #ffffff;
  --ink: #1d2b1f;
  --muted: #5b4a3a;
  --line: #1d2b1f;
  --good: #2f8f46;
  --warn: #c2410c;
  --radius: 18px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --display: 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, #e9d7b0 1px, transparent 0);
  background-size: 22px 22px;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--sunset-deep); font-weight: 800; }
h1, h2, h3, h4 { line-height: 1.1; margin: 0 0 0.4em; }
h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sunset); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.55em 1em; min-height: 44px;
  background: var(--card); border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: var(--shadow-sm); font-weight: 900; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--sunset); color: #fff; text-shadow: 0 1px 0 #0004; }
.btn-green { background: var(--leaf); }
.btn-quiet { background: transparent; box-shadow: none; border-style: dashed; }
.btn-small { min-height: 36px; padding: 0.35em 0.8em; font-size: 0.9em; }
.icon-btn {
  width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: 12px; background: var(--card);
  box-shadow: var(--shadow-sm); font-size: 20px; cursor: pointer; flex: none;
}

/* ---------- Tab bar ---------- */
.tabbar { position: sticky; top: 0; z-index: 3000; background: var(--forest); border-bottom: 3px solid var(--ink); }
.tabbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px var(--gutter) 0; display: flex; align-items: flex-end; gap: 10px; }
.tabs { display: flex; gap: 8px; flex: 1; min-width: 0; }
.tab {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 14px; margin-bottom: -3px;
  font-family: var(--display); font-size: 22px; letter-spacing: 0.03em; line-height: 1.1; color: #d6e6cf;
  background: #2c5240; border: 3px solid var(--ink); border-radius: 16px 16px 0 0; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tab:hover { background: #376a52; color: #fff; }
.tab[aria-selected='true'] { background: var(--paper); color: var(--forest); border-bottom-color: var(--paper); }
.tab[aria-selected='true'] .tab-ico { transform: rotate(-8deg) scale(1.15); }
.tab .tab-ico { display: inline-block; transition: transform 0.15s; }
.tab .short { display: none; }
.sound-btn { background: transparent; border: 2px solid #fff6; border-radius: 999px; color: #fff; width: 42px; height: 42px; cursor: pointer; flex: none; font-size: 18px; margin-bottom: 9px; }
@media (max-width: 640px) {
  .tabbar-inner { gap: 6px; padding-top: 8px; }
  .tabs { gap: 5px; }
  .tab { flex-direction: column; gap: 2px; padding: 8px 4px 9px; font-size: 17px; }
  .tab .tab-ico { font-size: 20px; }
  .tab .long { display: none; }
  .tab .short { display: inline; }
  .sound-btn { width: 38px; height: 38px; }
}
.tab-panel > .section:first-child { padding-top: 34px; }

/* ---------- Hero ---------- */
.hero { position: relative; background: linear-gradient(#ffb36b, #ffd9a0 35%, #cdeefa 75%); overflow: hidden; border-bottom: 3px solid var(--ink); }
.hero-inner { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 44px var(--gutter) 0; }
.kicker {
  display: inline-block; margin: 0 0 12px; padding: 4px 14px;
  background: var(--card); border: 3px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow-sm);
  font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; transform: rotate(-2deg);
}
.hero h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(44px, 9vw, 104px); line-height: 0.95;
  color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink); margin: 0 0 12px; letter-spacing: 0.02em;
}
.hero h1 .sub { display: block; font-size: 0.48em; color: var(--sunset); -webkit-text-stroke: 2px var(--ink); text-shadow: 3px 3px 0 var(--ink); margin-top: 8px; }
.hero-lede { max-width: 640px; font-size: 19px; font-weight: 700; margin: 0 0 18px; }
.trip-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.trip-facts li {
  background: var(--card); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm);
  padding: 8px 14px; font-size: 15px; min-width: 0;
}
.trip-facts b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.trip-facts .tbd { color: var(--muted); font-style: italic; }
.hero-pack { margin: 0 0 18px; }
.hero-art { display: block; width: 100%; height: auto; margin-top: -10px; position: relative; z-index: 1; }
/* Phones see a zoomed-in middle of the scene so the van and kids aren't tiny. */
@media (max-width: 700px) { .hero-art { height: clamp(190px, 56vw, 300px); } }
.hero-pause {
  position: absolute; right: 10px; bottom: 10px; z-index: 3; width: 34px; height: 34px;
  border: 2px solid var(--ink); border-radius: 50%; background: #fffc; font-size: 14px; cursor: pointer;
}

/* ---------- Sections ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 56px 0 8px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(34px, 6vw, 56px); margin: 0; color: var(--forest); text-shadow: 3px 3px 0 #fff, 5px 5px 0 var(--grass); }
.section-head .eyebrow { font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; color: var(--sunset-deep); margin: 0 0 4px; }
.section-head p { margin: 4px 0 0; max-width: 620px; font-weight: 600; color: var(--muted); }
.panel { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff3c4; border: 3px solid var(--ink); border-radius: 14px; padding: 12px 16px; margin: 0 0 18px; box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.notice .n-icon { font-size: 24px; line-height: 1; }
.notice p { margin: 0; }
.notice.green { background: #e2f6d5; }
.notice.red { background: #ffe1d6; }

/* ---------- Map ---------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } }
.map-box { overflow: hidden; position: relative; }
#tripMap { height: 560px; background: #dfe8d0; }
@media (max-width: 900px) { #tripMap { height: 440px; } }
.map-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-top: 3px solid var(--ink); background: var(--paper-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; min-height: 36px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--card); font-weight: 800; font-size: 14px; cursor: pointer;
}
.chip[aria-pressed='true'], .chip.on { background: var(--forest); color: #fff; }
.chip .sw { width: 18px; height: 6px; border-radius: 3px; background: var(--c); display: inline-block; }
.chip .sw.dash { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 9px); }
.map-bar .spacer { flex: 1; }
.poi-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.poi-panel { padding: 0; overflow: hidden auto; position: sticky; top: 80px; max-height: calc(100vh - 96px); }
@media (max-width: 900px) { .poi-panel { position: static; max-height: none; } }
.poi-hero { position: relative; padding: 18px 20px 14px; background: var(--c, var(--moss)); color: #fff; border-bottom: 3px solid var(--ink); }
.poi-hero .poi-emoji { font-size: 44px; line-height: 1; filter: drop-shadow(2px 2px 0 #0005); }
.poi-hero h3 { font-size: 30px; margin: 8px 0 2px; text-shadow: 2px 2px 0 #0006; }
.poi-hero .poi-tag { display: inline-block; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; background: #0003; padding: 2px 10px; border-radius: 999px; }
.poi-body { padding: 16px 20px 20px; }
.poi-body p { margin: 0 0 12px; }
.poi-body h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--sunset-deep); margin: 16px 0 6px; }
.todo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.todo-list li { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.todo-list .ti { font-size: 20px; line-height: 1.2; }
.poi-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.poi-meta span { font-size: 13px; font-weight: 800; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; }
.poi-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.poi-nav { display: flex; justify-content: space-between; gap: 8px; padding: 0 20px 18px; }

.pin {
  width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px;
  background: var(--c, #fff); border: 3px solid var(--ink); border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  box-shadow: 3px 3px 0 #0006; transition: transform 0.15s;
}
.pin > span { transform: rotate(45deg); }
.pin-wrap.active .pin { transform: rotate(-45deg) scale(1.22); box-shadow: 0 0 0 5px #fff, 3px 3px 0 5px #0006; }
.pin-wrap:hover .pin { transform: rotate(-45deg) scale(1.1); }
.pin-label {
  position: absolute; left: 50%; top: 50px; transform: translateX(-50%); white-space: nowrap;
  font-weight: 900; font-size: 12px; background: #fffd; border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px; pointer-events: none;
}
.zoom-lo .pin-label { display: none; }
.leaflet-container { font-family: var(--body); }
.leaflet-control-attribution { font-size: 11px; }
.you-dot { width: 18px; height: 18px; background: #1b73e8; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 6px #1b73e844; }

/* Peak finder */
.peak-finder { margin-top: 10px; background: #102a3a; color: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 12px; }
.peak-finder svg { display: block; width: 100%; max-width: 360px; margin: 0 auto; }
.pf-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.pf-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; background: #ffffff12; border: 1px solid #ffffff33; border-radius: 10px; padding: 6px 10px; }
.peak-finder .pf-note { font-size: 13px; text-align: center; margin: 6px 0 0; opacity: 0.85; }
.peak-finder .pf-row { display: flex; justify-content: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.peak-finder .btn { background: #fff; }

/* ---------- Quest ---------- */
.quest-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 16px 18px; margin-bottom: 16px; align-items: center; }
@media (max-width: 700px) { .quest-top { grid-template-columns: 1fr; } }
.players { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.player-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 40px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper); font-weight: 900; cursor: pointer; }
.player-chip.on { background: var(--sunset); color: #fff; }
.player-chip small { font-weight: 800; opacity: 0.85; }
.name-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.name-form input { height: 40px; width: 170px; border: 3px solid var(--ink); border-radius: 999px; padding: 0 14px; font: inherit; font-weight: 800; background: var(--card); }
.btn.armed { background: #ffd2c2; border-style: solid; }
.score-box { display: flex; align-items: center; gap: 14px; }
.score-big { font-family: var(--display); font-size: 54px; line-height: 0.9; color: var(--sunset); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.score-big small { font-size: 0.4em; -webkit-text-stroke: 1px var(--ink); }
.rank { font-weight: 900; }
.rank .rank-name { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--forest); }
.progress { height: 16px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; margin-top: 10px; grid-column: 1 / -1; }
.progress > i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--leaf) 0 12px, #6cc847 12px 24px); transition: width 0.4s; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.quest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.q-card { position: relative; display: flex; flex-direction: column; padding: 14px 14px 12px; transition: transform 0.15s; }
.q-card.found { background: #eaf8df; }
.q-card .q-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.q-card .q-emoji { font-size: 34px; width: 54px; height: 54px; display: grid; place-items: center; background: var(--paper-2); border: 3px solid var(--ink); border-radius: 14px; flex: none; }
.q-card h3 { font-family: var(--body); font-weight: 900; font-size: 18px; margin: 0; letter-spacing: 0; }
.q-card .q-sci { font-size: 13px; font-style: italic; color: var(--muted); }
.q-card p { margin: 0 0 8px; font-size: 15px; }
.q-card .q-where { font-size: 14px; color: var(--muted); font-weight: 700; }
.q-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.q-tags span { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); }
.q-tags .t-rare { background: #ffe08a; }
.q-tags .t-season-off { background: #e7e1d6; color: var(--muted); border-color: #9b8f7d; }
.q-tags .t-season-on { background: #cdeec0; }
.q-tags .t-protected { background: #ffd2c2; }
.q-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.q-foot .btn { flex: 1; }
.q-found-btn[aria-pressed='true'] { background: var(--good); color: #fff; }
.q-photo { width: 44px; height: 44px; border-radius: 10px; border: 3px solid var(--ink); object-fit: cover; flex: none; }
.q-stamp {
  position: absolute; top: -12px; right: -10px; transform: rotate(12deg); z-index: 1; box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--display); color: var(--good); border: 3px solid var(--good); border-radius: 8px; padding: 0 8px; font-size: 18px; background: #fffc;
}
.plus5 { position: fixed; z-index: 2000; pointer-events: none; font-family: var(--display); font-size: 40px; color: var(--leaf); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; animation: plus5 0.9s ease-out forwards; }
@keyframes plus5 { from { transform: translate(-50%, 0) scale(0.6); opacity: 1; } to { transform: translate(-50%, -70px) scale(1.2); opacity: 0; } }
.quest-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- Workshop window: build and duel in one screen, no scrolling ---------- */
.tab-panel > .ws-section:first-child { padding: 10px 0 0; }
body[data-tab='boffer'] footer { display: none; }
/* Tall enough that the window can always scroll up to sit right under the tab bar. */
#panel-boffer { min-height: calc(100vh - var(--tabbar-h, 70px)); min-height: calc(100dvh - var(--tabbar-h, 70px)); }
.ws-window {
  --slot: 116px;
  display: flex; flex-direction: column;
  height: calc(100vh - var(--tabbar-h, 70px) - 20px);
  height: calc(100dvh - var(--tabbar-h, 70px) - 20px);
  min-height: 300px; max-height: 880px;
  background: #c38b52; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 10px;
}
.ws-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 8px 6px 10px; background: var(--forest); color: #fff; border-bottom: 3px solid var(--ink); }
.ws-steps { list-style: none; display: flex; gap: 5px; padding: 0; margin: 0; flex: 1; min-width: 0; overflow: hidden; }
.ws-steps li { display: flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; background: #ffffff14; color: #cfe3c8; font-weight: 900; font-size: 14px; white-space: nowrap; }
.ws-steps li.now { background: var(--sunset); color: #fff; box-shadow: 0 0 0 2px var(--ink); }
.ws-steps li.done { background: #d6f3c6; color: var(--forest); }
@media (max-width: 640px) {
  .ws-steps li { padding: 4px 8px; }
  .ws-steps li:not(.now) .st-label { display: none; }
}
.ws-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff6; background: transparent; color: #fff; font-size: 20px; font-weight: 900; cursor: pointer; }
.ws-icon.armed { width: auto; padding: 0 12px; border-radius: 999px; background: var(--sunset); border-color: #fff; font-size: 14px; }
.ws-score { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; }
.ws-score .sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32%; }
.ws-score .sb-vs { font-family: var(--display); color: var(--sunset); font-size: 22px; }
.sb-pips { display: flex; gap: 4px; flex: none; }
.sb-pips i { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; }
.sb-pips i.on { background: var(--sunset); }

.ws-stage { position: relative; flex: 1; min-height: 0; }
.bench { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.bench .tool { cursor: grab; }
.bench .tool.grabbed { cursor: grabbing; filter: drop-shadow(6px 10px 4px #0006); }
.bench .part-noodle { cursor: grab; }
.bench .part-noodle.grabbed { cursor: grabbing; filter: drop-shadow(4px 8px 3px #0005); }
.bench.drawing { cursor: crosshair; }
.bench .pop, .arena .burst-word { font-family: var(--display); stroke: var(--ink); stroke-width: 5px; paint-order: stroke fill; stroke-linejoin: round; }
.arena .burst-word { fill: #d7263d; }
.ws-arena { position: absolute; left: 0; right: 0; top: 0; background: #8fb35a; }
.ws-arena .arena { display: block; width: 100%; height: 100%; }

.ws-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: grid; gap: 6px; padding: 8px 10px 0; pointer-events: none; }
.ws-top > * { pointer-events: auto; }
.ws-types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.type-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 46px; padding: 5px 4px; border: 3px solid var(--ink); border-radius: 12px; background: var(--paper);
  font-weight: 900; font-size: 15px; line-height: 1.1; cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
}
.type-chip small { font-weight: 800; font-size: 12px; color: var(--sunset-deep); }
.type-chip.on { background: var(--forest); color: #fff; }
.type-chip.on small { color: #ffd9a8; }
.type-chip .short { display: none; }
@media (max-width: 640px) {
  .type-chip { font-size: 14px; }
  .type-chip .long { display: none; }
  .type-chip .short { display: inline; }
}
.ws-instr { justify-self: start; max-width: 100%; margin: 0; padding: 5px 12px; background: #fffffff0; border: 2px solid var(--ink); border-radius: 12px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.ws-instr:empty { display: none; }
.ws-instr .pct { display: inline-block; margin-left: 4px; padding: 0 9px; border-radius: 999px; background: var(--forest); color: #fff; font-weight: 900; font-size: 13px; }

.ws-tray { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; min-height: 80px; padding: 8px 10px 8px calc(var(--slot) + 2px); pointer-events: none; }
.ws-window[data-mode='duel'] .ws-tray { padding-left: 10px; background: linear-gradient(#8a5a33, #6f4527); border-top: 3px solid var(--ink); }
.ws-controls { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 8px; pointer-events: auto; }
.palette { display: flex; flex-wrap: wrap; gap: 5px; }
.swatch-btn {
  width: 32px; height: 32px; padding: 0; border: 3px solid var(--ink); border-radius: 9px; cursor: pointer;
  background-color: var(--c); background-image: linear-gradient(#fff6, transparent 45%, #0003);
}
.swatch-btn.sw-camo { background-image: radial-gradient(circle at 30% 30%, #3d4a26 0 22%, transparent 23%), radial-gradient(circle at 70% 65%, #8c7a4b 0 24%, transparent 25%), radial-gradient(circle at 75% 20%, #2c3320 0 14%, transparent 15%); background-color: #6b7a43; }
.swatch-btn.sw-galaxy { background-image: radial-gradient(circle at 25% 30%, #fff 0 4%, transparent 5%), radial-gradient(circle at 70% 70%, #fff 0 3%, transparent 4%), radial-gradient(ellipse at 40% 50%, #7a3fd1, transparent 60%); background-color: #24185a; }
.swatch-btn.on { outline: 3px solid #fff; outline-offset: 1px; transform: scale(1.12); }
@media (max-width: 520px) { .swatch-btn { width: 27px; height: 27px; border-width: 2px; border-radius: 7px; } }
.tray-btn { min-height: 38px; padding: 0 12px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper); font-weight: 900; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.tray-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mode-toggle { display: inline-flex; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; box-shadow: 2px 2px 0 var(--ink); }
.mode-toggle button { min-height: 34px; padding: 4px 12px; border: 0; background: var(--paper); font-weight: 900; cursor: pointer; }
.mode-toggle button + button { border-left: 2px solid var(--ink); }
.mode-toggle button[aria-pressed='true'] { background: var(--forest); color: #fff; }
.btn-finish { margin-left: auto; align-self: flex-end; animation: finishPulse 1.1s ease-in-out infinite; }
@keyframes finishPulse {
  0%, 100% { transform: scale(1); box-shadow: 3px 3px 0 var(--ink), 0 0 0 0 #ffd23fdd; }
  50% { transform: scale(1.07); box-shadow: 3px 3px 0 var(--ink), 0 0 0 12px #ffd23f00; }
}
.duel-moves { display: flex; gap: 6px; flex: 1 1 260px; min-width: 0; }
.move-btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0.4em 0.5em; background: #fff3c4; white-space: nowrap; }
@media (max-width: 520px) {
  .duel-moves { flex-basis: 100%; }
  .move-btn { flex-direction: column; gap: 0; padding: 4px 2px; font-size: 14px; line-height: 1.1; }
  .ws-score { gap: 5px; font-size: 14px; }
  .sb-pips i { width: 13px; height: 13px; border-width: 2px; }
}
.ws-window[data-mode='duel'] .ws-controls .btn-primary:first-child { margin-left: auto; }

.ws-dialog { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 12px; background: #1d2b1f66; }
.dlg-card { width: min(420px, 100%); display: grid; gap: 10px; padding: 16px; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); }
.dlg-card h3 { margin: 0; font-size: 26px; color: var(--forest); }
.dlg-sub { margin: 0; font-weight: 800; color: var(--muted); }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.dlg-label { margin: 2px 0 -4px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; color: var(--sunset-deep); }
.dlg-input { height: 44px; padding: 0 12px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font: inherit; font-weight: 800; }

.ws-rack { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: var(--paper); }
.rack { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.rack-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 3px solid var(--ink); background: var(--paper-2); }
.rack-head h3 { margin: 0; font-size: 26px; color: var(--forest); }
.rack-head p { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.rack-close { flex: none; width: 42px; height: 42px; border: 3px solid var(--ink); border-radius: 50%; background: var(--card); font-size: 18px; font-weight: 900; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.rack-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-content: start; }
.rack-empty { grid-column: 1 / -1; text-align: center; font-weight: 800; color: var(--muted); }
.rack-card { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 12px; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); }
.rack-card.current { background: #fff3c4; }
.rack-art { grid-column: 1 / -1; padding: 4px 6px; border: 2px solid var(--ink); border-radius: 10px; background: repeating-linear-gradient(90deg, #f6e7c8 0 30px, #f1dfbb 30px 60px); }
.rack-art svg { display: block; width: 100%; height: auto; }
.rack-info { min-width: 0; }
.rack-info h4 { margin: 0; font-size: 18px; font-weight: 900; overflow-wrap: anywhere; }
.rack-tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--sunset); color: #fff; font-size: 11px; vertical-align: middle; }
.rack-maker { margin: 0; font-size: 14px; }
.rack-meta { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.rack-meta .nowrap { white-space: nowrap; }
.rack-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; justify-content: center; }

.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font: inherit; font-weight: 800; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 14px; height: 10px; border-radius: 3px; border: 2px solid var(--ink); background: var(--card); }
.pips i.on { background: var(--sunset); }
.stat-list > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-list.inline { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ---------- Pack / rules ---------- */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.pack-grid .panel { padding: 16px 18px; }
.pack-grid h3 { font-size: 24px; color: var(--forest); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 700; }
.checklist input { width: 22px; height: 22px; accent-color: var(--good); flex: none; margin-top: 2px; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.rules-list { margin: 0; padding-left: 20px; }
.rules-list li { margin-bottom: 6px; }

/* ---------- Footer ---------- */
footer { margin-top: 60px; background: var(--forest); color: #e8efe2; border-top: 3px solid var(--ink); padding: 26px var(--gutter) 40px; font-size: 14px; }
footer .wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 8px; }
footer a { color: #ffd9a8; }
footer .big { font-family: var(--display); font-size: 22px; color: #fff; letter-spacing: 0.03em; }
