:root {
  font-family: Inter, 'Aptos', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
  --paper: #102120;
  --panel: #172c29;
  --field: #101e21;
  --line: #35514b;
  --ink: #f2f2e7;
  --muted: #b0c3b7;
  --lime: #d4ee92;
  --orange: #ffbc90;
  --red: #ffb3ab;
  --sky: #a5d8fc;
  --grid: rgba(166, 203, 188, .105);
  --display: Georgia, 'Times New Roman', serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { min-width: 320px; min-height: 100dvh; margin: 0; display: flex; flex-direction: column; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, input, [tabindex] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
[hidden] { display: none !important; }
#app:focus { outline: none; }
a { color: inherit; text-underline-offset: 4px; }
svg { display: block; }
.wrap { width: min(100% - 96px, 1320px); margin-inline: auto; }
.topbar { min-height: 84px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 740; font-size: 1.25rem; letter-spacing: -.045em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--lime); color: #243720; border-radius: 11px; }
.brand-mark svg { width: 25px; height: 25px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.brand-mark svg path:first-of-type { fill: currentColor; }
.brand-accent { color: var(--lime); }
.top-label, .eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--lime); font-weight: 740; letter-spacing: .15em; font-size: .75rem; }
.top-label { color: var(--muted); }
.top-label > span, .eyebrow > span:first-child { width: 7px; height: 7px; display: inline-block; transform: rotate(45deg); background: var(--lime); margin-inline: 2px; flex: 0 0 auto; }
.plain { border: 0; padding: 8px 0 8px 8px; background: transparent; color: var(--muted); }
.plain:hover { color: var(--lime); }
#app { flex: 1; padding-block: clamp(32px, 4vw, 60px) 48px; }
h1, h2, p { margin: 0; }
.hero { display: grid; grid-template-columns: minmax(285px, .77fr) minmax(0, 1.5fr); align-items: center; gap: clamp(32px, 4.3vw, 70px); }
.intro { padding-block: 20px; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(4rem, 7.2vw, 7.1rem); line-height: .97; letter-spacing: -.083em; margin: 17px 0 23px; }
h1 em { color: var(--lime); font-weight: inherit; }
.intro p, .room-intro p, .result-summary > p:not(.form-status) { color: var(--muted); font-size: clamp(1.02rem, 1.5vw, 1.18rem); line-height: 1.64; max-width: 38ch; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 27px; color: var(--muted); font-size: .875rem; }
.hero-facts span, .cover-head span, .cover-foot span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.hero-facts svg, .cover-head svg { width: 16px; height: 16px; color: var(--lime); }
.cover-map, .play-field {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, rgba(31, 64, 60, .55), transparent 75%), var(--field);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px), radial-gradient(ellipse at 52% 34%, #284744, #12292c 75%, #102427);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  background-position: center;
  border: 1px solid var(--line);
  border-radius: 20px;
}
.cover-map { min-height: 390px; aspect-ratio: 1.8; display: grid; align-items: center; box-shadow: 0 24px 65px -22px #050f0de0; }
.cover-head, .cover-foot { position: absolute; display: flex; justify-content: space-between; align-items: center; gap: 12px; inset-inline: 19px; color: var(--muted); font-size: .875rem; }
.cover-head { top: 18px; }
.cover-head span { color: #edf4d9; background: #132b2b; padding: 7px 10px; border: 1px solid #4c6c64; border-radius: 7px; }
.cover-head strong { color: var(--ink); font-size: .875rem; font-weight: 660; }
.cover-foot { bottom: 18px; color: #bdd0c6; }
.cover-foot span:last-child { letter-spacing: .12em; font-size: .73rem; }
.cover-foot i { width: 20px; height: 1px; background: #b5c489; }
.map-compass { position: absolute; bottom: 42px; right: 21px; color: var(--lime); display: grid; justify-items: center; gap: 2px; font-size: .7rem; font-weight: 700; }
.map-compass svg { width: 35px; fill: none; stroke: var(--lime); stroke-width: 1; }
.map-compass svg path { fill: var(--lime); }
.preview-map { width: calc(100% - 24px); margin-inline: auto; }
.atlas-svg { width: 100%; height: auto; overflow: hidden; }
.province { stroke: #202f27; stroke-width: 1.25px; vector-effect: non-scaling-stroke; stroke-linejoin: round; fill: #9cae7d; transition: fill .16s ease, stroke .16s ease; }
.province.tone-1 { fill: #adbc88; }
.province.tone-2 { fill: #8eaa7d; }
.province.tone-3 { fill: #a0b391; }
.province.preview-target { fill: #d9ee9a; stroke: #f4ffc9; stroke-width: 1.55; }
.interactive .province { cursor: pointer; }
.interactive .province:hover { fill: #c5d69e; }
.province:focus-visible { outline: none; stroke: #fffddc; stroke-width: 2.6; fill: #c5d69e; }
.province.selected, .interactive .province.selected:hover { fill: var(--orange); stroke: #fff0d1; stroke-width: 2; }
.province.locked { fill: var(--sky); stroke: #f2fbff; stroke-width: 2; }
.province.correct { fill: var(--lime); stroke: #f0ffd2; stroke-width: 2; }
.province.own-wrong { fill: #8cc7ec; stroke: #ecf9ff; stroke-width: 1.8; }
.province.other-wrong { fill: var(--orange); stroke: #fff0da; stroke-width: 1.8; }
.sea-label { font-weight: 650; font-size: 14px; fill: #a0bdb8; text-anchor: middle; }
.pin { color: var(--lime); }
.pin-me { color: #76c5ff; }
.pin-other { color: #ffad7c; }
.pin-neutral { color: #e2ecc9; opacity: .75; }
.pin-core { fill: currentColor; stroke: #1c392a; stroke-width: 1.6; }
.pin-halo { fill: none; stroke: currentColor; stroke-width: 1.3; opacity: .83; }
.pin text { fill: #fff9e6; font-size: 14px; font-weight: 750; letter-spacing: .12em; paint-order: stroke; stroke: #1a3029; stroke-width: 3px; }
.pin-leader { stroke: #fff9e6; stroke-width: 1; fill: none; }
.appear .pin { animation: pin-in .28s ease-out both; }
@keyframes pin-in { from { opacity: 0; } to { opacity: 1; } }
.mode-heading { margin-block: 35px 13px; display: flex; align-items: center; gap: 19px; }
.mode-heading h2 { font-size: 1.03rem; font-weight: 650; }
.mode-heading::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode-card { display: flex; align-items: center; min-width: 0; gap: 16px; min-height: 101px; padding: 18px; border-radius: 13px; border: 1px solid var(--line); background: #1a302a; color: var(--ink); text-align: left; transition: background .16s, border-color .16s, transform .16s; }
.mode-card:hover { border-color: #769869; background: #223a30; transform: translateY(-2px); }
.mode-duo { background: #202e2b; }
.mode-duo:hover { border-color: #bb8d70; background: #303934; }
.mode-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--lime); background: #344d32; border-radius: 10px; flex: 0 0 auto; }
.mode-icon svg { width: 24px; height: 24px; }
.mode-duo .mode-icon, .room-card > .mode-icon { color: var(--orange); background: #49392e; }
.mode-copy { display: grid; gap: 5px; flex: 1; }
.mode-copy strong { font-size: 1.16rem; }
.mode-copy > span { color: var(--muted); font-size: .925rem; }
.mode-cta { padding: 8px 12px; background: var(--lime); color: #1b2e20; font-size: .875rem; font-weight: 750; border-radius: 7px; white-space: nowrap; }
.mode-duo .mode-cta { background: var(--orange); color: #382617; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 25px; padding-block: 17px 21px; color: var(--muted); border-top: 1px solid var(--line); font-size: .79rem; line-height: 1.5; }
.footer a:hover { color: var(--ink); }
.footer-divider { margin: 0 5px; color: #789889; }
.button { min-height: 46px; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; display: inline-flex; justify-content: center; gap: 8px; align-items: center; transition: background .16s; }
.button svg { width: 19px; height: 19px; flex: 0 0 auto; }
.button.primary { background: var(--lime); color: #15281b; }
.button.primary:hover:not(:disabled) { background: #e3f9ab; }
.button.secondary { background: #263d34; border-color: #536c59; color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: #344c40; }
.button.full { width: 100%; }
.room-layout, .results-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(26px, 5vw, 86px); max-width: 1100px; margin: 30px auto; }
.room-intro h1, .result-summary h1 { font-size: clamp(3.45rem, 6.9vw, 6rem); }
.room-card, .results-card { padding: clamp(20px, 3vw, 37px); background: var(--panel); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 22px 55px -27px #020c08eb; }
.room-card h2 { margin: 14px 0 21px; font-size: 1.6rem; }
.room-card label { color: var(--muted); font-size: .91rem; font-weight: 650; display: block; margin-bottom: 8px; }
.room-input-row { display: flex; gap: 8px; }
.room-input-row input { background: #101f1d; border: 1px solid #4c655b; border-radius: 8px; color: var(--ink); width: 100%; min-width: 0; padding: 10px 14px; font-variant-numeric: tabular-nums; letter-spacing: .085em; }
.room-input-row input::placeholder { color: #9cb7ac; letter-spacing: normal; }
.room-input-row .button { flex-shrink: 0; }
.room-or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; font-size: .88rem; }
.room-or span { height: 1px; background: var(--line); flex: 1; }
#create-room { width: 100%; }
.form-status, .copy-status, .under-game { color: var(--muted); font-size: .89rem; min-height: 23px; line-height: 1.5; margin-top: 8px; }
.form-status:empty, .copy-status:empty { min-height: 0; margin-top: 0; }
.players { display: grid; gap: 9px; margin-block: 19px; }
.player-row { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: #203631; min-height: 54px; padding: 8px 11px; border-radius: 8px; }
.player-row.waiting { background: transparent; border-style: dashed; }
.player-row > span { color: var(--muted); font-size: .82rem; margin-left: auto; text-align: right; }
.player-symbol { padding: 6px; background: #2a443b; border-radius: 5px; color: var(--muted); }
.player-symbol svg { width: 17px; height: 17px; }
.my-color { color: var(--lime); }
.other-color { color: var(--orange); }
.game-panel { max-width: 1140px; margin: 0 auto; }
.game-head { display: flex; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.question-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 12px; }
.question-line h1 { font-size: clamp(2.5rem, 5.4vw, 4.8rem); margin: 7px 0 0; letter-spacing: -.065em; overflow-wrap: anywhere; }
.question-line > span { color: var(--muted); font-size: 1.02rem; margin-top: 7px; }
.game-indicators { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.score-pill, .time-pill { display: inline-flex; align-items: center; gap: 7px; background: #22372c; color: var(--lime); padding: 8px 12px; border: 1px solid #42604b; border-radius: 8px; min-height: 41px; font-size: .87rem; }
.score-pill.rival { color: var(--orange); background: #352e27; border-color: #685041; }
.score-pill strong, .time-pill strong { font-size: 1.03rem; font-variant-numeric: tabular-nums; }
.time-pill { background: #223437; border-color: #4d6465; color: var(--ink); min-width: 92px; }
.time-pill svg { width: 17px; height: 17px; }
.time-pill.urgent { background: #482c2c; border-color: #97625d; color: #ffd2cc; }
.play-field { min-height: clamp(275px, 39vw, 530px); display: grid; place-items: center; }
.game-map { width: 100%; padding: 32px 42px 32px 16px; }
.game-map .atlas-svg { touch-action: none; user-select: none; min-height: 170px; }
.zoom { position: absolute; top: 12px; right: 12px; display: grid; gap: 5px; }
.zoom button { width: 43px; height: 43px; display: grid; place-items: center; background: #142625; border: 1px solid #5c7970; border-radius: 8px; color: var(--ink); }
.zoom button:hover:not(:disabled) { background: #365149; }
.zoom button svg { width: 20px; height: 20px; }
.game-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; min-height: 58px; }
.game-footer strong { font-size: 1.12rem; }
.game-footer p { color: var(--muted); line-height: 1.4; margin-top: 4px; }
.game-actions { flex: 0 0 auto; }
.under-game { margin-top: 10px; }
.results-layout { align-items: start; }
.result-scores { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 19px 22px; }
.result-score { display: grid; gap: 2px; padding: 12px 19px; min-width: 125px; border: 1px solid #4f6d50; background: #243c2c; border-radius: 10px; color: var(--lime); }
.result-score.rival { color: var(--orange); background: #3d3028; border-color: #715443; }
.result-score strong { font-size: 2.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-score small { font-size: 1.1rem; font-weight: 500; }
.result-score > span { font-size: .89rem; color: var(--ink); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.results-card h2 { margin-bottom: 14px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .93rem; }
td, th { padding: 10px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { color: var(--muted); }
tbody tr:last-child > * { border-bottom: 0; }
.right { color: var(--lime); }
.wrong { color: var(--red); }
.loading, .load-error { min-height: 275px; display: grid; align-content: center; justify-items: center; gap: 16px; color: var(--muted); text-align: center; }
.load-error h1 { font-size: 2.3rem; }
@media (max-width: 975px) {
  .wrap { width: calc(100% - 54px); }
  .hero { grid-template-columns: minmax(245px, .92fr) minmax(0, 1.28fr); gap: 25px; }
  .cover-map { min-height: 325px; }
  .game-map { padding-right: 46px; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 36px); }
  .topbar { min-height: 64px; }
  .brand-mark { width: 33px; height: 33px; }
  .top-label { font-size: .66rem; }
  #app { padding-block: 24px 28px; }
  .hero, .room-layout, .results-layout { grid-template-columns: 1fr; gap: 19px; }
  .room-layout, .results-layout { margin-block: 5px; }
  .intro { padding-block: 0; }
  h1 { font-size: clamp(3.65rem, 13vw, 5.6rem); margin-block: 10px 14px; }
  .intro p { font-size: 1rem; }
  .hero-facts { margin-top: 13px; }
  .cover-map { min-height: clamp(195px, 48vw, 320px); border-radius: 14px; }
  .cover-head, .cover-foot { inset-inline: 11px; }
  .cover-head { top: 10px; }
  .cover-head span { padding: 4px 7px; }
  .cover-foot { bottom: 9px; }
  .cover-head strong, .cover-head span, .cover-foot span { font-size: .73rem; }
  .map-compass { right: 12px; bottom: 30px; }
  .map-compass svg { width: 24px; }
  .mode-heading { margin-top: 23px; }
  .mode-grid { grid-template-columns: 1fr; gap: 9px; }
  .mode-card { min-height: 70px; padding: 11px; gap: 10px; }
  .mode-icon { width: 39px; height: 39px; }
  .mode-icon svg { width: 21px; height: 21px; }
  .mode-copy strong { font-size: 1.01rem; }
  .mode-copy > span { font-size: .8rem; }
  .footer { padding-block: 12px; }
  .game-head { margin-bottom: 12px; }
  .question-line { display: block; }
  .question-line > span { display: inline-block; margin-top: 3px; }
  .play-field { min-height: clamp(220px, 64vw, 380px); border-radius: 13px; }
  .game-map { padding: 45px 2px 3px; }
  .zoom { display: flex; top: 7px; right: 7px; }
  .zoom button { border-radius: 7px; }
  .game-footer { align-items: stretch; flex-direction: column; gap: 9px; }
  .game-actions .button { width: 100%; }
}
@media (max-width: 365px) {
  .wrap { width: calc(100% - 26px); }
  .room-card { padding: 14px; }
  .room-input-row .button { padding-inline: 9px; }
  .room-input-row input { padding-inline: 9px; }
  .mode-cta { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Collection and game boards */
.accent-peach { --accent: #ffbc90; --accent-panel: #3e3430; }
.accent-blue { --accent: #a5d8fc; --accent-panel: #263e48; }
.accent-violet { --accent: #d5c2ff; --accent-panel: #38344b; }
.accent-gold { --accent: #f4d889; --accent-panel: #403929; }
.accent-rose { --accent: #f4adc4; --accent-panel: #45343b; }
.accent-leaf { --accent: var(--lime); --accent-panel: #344d32; }
.catalog { max-width: 1160px; margin-inline: auto; }
.catalog-head {
  display: flex; gap: 32px; justify-content: space-between; align-items: center;
  margin-bottom: 28px; padding: clamp(25px, 5vw, 62px);
  border: 1px solid var(--line); border-radius: 20px;
  background: radial-gradient(ellipse at 90% 10%, #3d5641 0, #203933 52%, #172e29 86%);
}
.catalog-head h1 { font-size: clamp(3.9rem, 7.8vw, 7rem); margin-bottom: 16px; }
.catalog-head p { color: var(--muted); max-width: 35ch; font-size: 1.04rem; line-height: 1.5; }
.catalog-figure { display: grid; grid-template-columns: repeat(2, minmax(65px, 98px)); gap: 8px; transform: rotate(-7deg); }
.catalog-figure b {
  aspect-ratio: 1; display: grid; place-items: center; background: var(--panel); border: 1px solid #577264;
  border-radius: 14px; color: var(--lime); font: 2.8rem var(--display);
}
.catalog-figure b:nth-child(2) { color: var(--orange); transform: translateX(8px); }
.catalog-figure b:nth-child(3) { color: #d5c2ff; }
.catalog-figure b:nth-child(4) { color: var(--sky); transform: translateX(8px); }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.catalog-card {
  min-width: 0; display: flex; align-items: center; gap: 13px; text-align: left; padding: 14px;
  min-height: 85px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: #1a302a;
}
.catalog-card:hover { background: #233a33; border-color: var(--accent); }
.catalog-symbol {
  display: grid; place-items: center; flex: 0 0 auto; width: 51px; height: 51px;
  border-radius: 10px; background: var(--accent-panel, #344d32); color: var(--accent, var(--lime));
  font: 1.85rem var(--display);
}
.catalog-name { display: grid; gap: 5px; flex: 1; }
.catalog-name strong { font-size: 1.06rem; }
.catalog-name small { color: var(--muted); font-size: .875rem; }
.catalog-open { color: var(--accent); font-size: .86rem; font-weight: 750; }
.game-mode-card .button { justify-content: space-between; gap: 10px; margin-top: 8px; }
.game-mode-card .button small { font-weight: 570; font-size: .85rem; }
.level-input {
  width: 100%; min-height: 45px; margin-bottom: 10px; padding: 7px 12px;
  border: 1px solid #527064; border-radius: 8px; color: var(--ink); background: var(--field); font: inherit;
}
.mini-panel { max-width: 1060px; margin-inline: auto; }
.mini-head, .mini-state { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.mini-head { margin-bottom: 16px; flex-wrap: wrap; }
.mini-head h1 { margin: 8px 0 0; font-size: clamp(2.8rem, 7vw, 5.15rem); letter-spacing: -.06em; }
.mini-head .eyebrow { color: var(--accent); }
.mini-state {
  min-height: 53px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); margin-bottom: 16px;
}
#mini-timer { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent); }
#mini-timer.urgent { color: var(--red); }
.mini-board { min-width: 0; }
.mini-side, .quiz-card {
  min-width: 0; align-self: start; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.mini-side h2, .fleet-wrap h2 { font-size: 1.08rem; margin-bottom: 9px; }
.mini-side p, .mini-hint { color: var(--muted); line-height: 1.45; margin-top: 9px; }
.mini-buttons, .mini-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 13px; align-items: center; }
.mini-result-actions span { color: var(--muted); }
.tile-grid, .four-columns, .fleet-grid, .fleet-labels, .territory-grid, .word-grid, .sudoku-grid { display: grid; }
.tile {
  min-width: 0; border: 1px solid #4c695d; background: #203730; color: var(--ink); border-radius: 6px;
  padding: 0; display: grid; place-items: center; aspect-ratio: 1; font-weight: 740;
}
.tile:disabled { opacity: 1; }
.tile:not(:disabled):hover { background: #365448; border-color: var(--accent, var(--lime)); }
.tile.mine { color: var(--lime); }
.tile.theirs { color: var(--orange); }
.tile.winner-cell { background: #425944; border-color: currentColor; }
.line-layout { margin-inline: auto; max-width: 460px; }
.line-layout .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.xox .tile { font: clamp(2rem, 9vw, 5rem)/1 var(--display); }
.line-layout.four { max-width: 540px; }
.four .tile-grid, .four-columns { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.four .tile-grid { padding: 7px; background: #28453f; border-radius: 10px; }
.four .tile-grid .tile { border-radius: 50%; background: #142923; font-size: clamp(1.1rem, 4.5vw, 2.8rem); }
.four .tile-grid .winner-cell { box-shadow: inset 0 0 0 3px currentColor; }
.four-columns { padding-inline: 7px; margin-bottom: 6px; }
.four-columns .tile { aspect-ratio: auto; min-height: 37px; }
.fleet-layout, .quiz-layout, .word-layout, .sudoku-layout, .snake-layout {
  display: grid; gap: clamp(12px, 3vw, 27px); align-items: start;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.fleet-grid, .fleet-labels { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.fleet-labels { text-align: center; color: var(--muted); margin-bottom: 4px; font-size: .8rem; }
.fleet-grid .tile { background: #223e45; border-color: #45636b; font-size: clamp(.7rem, 3vw, 1.35rem); }
.fleet-grid .ship { background: #496b67; color: var(--sky); }
.fleet-grid .hit { background: #67503f; color: var(--orange); }
.fleet-grid .sunk { background: #694241; color: var(--red); }
.fleet-grid .miss { color: #b7d2d9; }
.ship-status { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.ship-status span { padding: 5px 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; font-size: .84rem; }
.ship-status .placed { border-color: var(--sky); color: var(--sky); }
.territory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.territory-grid .tile {
  min-height: 67px; aspect-ratio: auto; display: grid; align-content: center; justify-items: center;
  gap: 4px; padding: 3px; font-size: clamp(.7rem, 1.7vw, .94rem); line-height: 1.1; background: #293c37;
}
.territory-grid small { color: var(--muted); font-size: .73rem; }
.territory-grid .mine { background: #334b34; }
.territory-grid .theirs { background: #4b3a2d; }
.territory-grid .capturable { border: 2px solid var(--accent); }
.territory-grid .target-tile { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-card h2 { font-size: clamp(1.08rem, 2.3vw, 1.4rem); line-height: 1.42; }
.quiz-options { display: grid; gap: 7px; margin: 12px 0; }
.quiz-options .button { justify-content: flex-start; text-align: left; }
.quiz-options b { color: var(--accent); }
.quiz-options .correct-choice:disabled { background: #3c5937; opacity: 1; border-color: var(--lime); }
.solve-note { color: var(--muted); padding: 9px 0; line-height: 1.5; }
.word-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; touch-action: none; user-select: none; }
.word-grid .tile, .sudoku-grid .tile { border-radius: 4px; font-size: clamp(.83rem, 3.6vw, 1.35rem); }
.word-grid .found-word { color: var(--lime); background: #40583b; }
.word-grid .missed-word { color: var(--orange); background: #493c2f; }
.word-grid .word-trace { background: #685330 !important; border-color: var(--accent); }
.word-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.word-list li { font-size: .83rem; font-weight: 730; border: 1px solid var(--line); padding: 6px; border-radius: 5px; }
.word-list .found { color: var(--lime); text-decoration: line-through; }
.sudoku-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 2px; background: #4b655c; }
.sudoku-grid .tile { border: 0; border-radius: 0; color: var(--sky); position: relative; }
.sudoku-grid .box-right { border-right: 3px solid #91a9a0; }
.sudoku-grid .box-bottom { border-bottom: 3px solid #91a9a0; }
.sudoku-grid .given { color: var(--ink); background: #2b4039; }
.sudoku-grid .chosen { background: #493f49; box-shadow: inset 0 0 0 2px var(--accent); }
.sudoku-grid .conflict { color: var(--red); }
.notes { position: absolute; inset: 2px; display: grid; place-content: center; grid-template-columns: repeat(3, 1fr); color: var(--muted); width: auto; font-size: clamp(.43rem, 1.4vw, .68rem); }
.number-pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.number-pad .button { min-height: 39px; }
#snake-field { width: 100%; height: auto; border: 1px solid #56736b; border-radius: 10px; touch-action: none; display: block; }
.snake-controls { display: grid; grid-template-columns: repeat(3, 46px); gap: 5px; margin-top: 12px; }
.snake-controls .button:first-child { grid-column: 2; }
.snake-controls .button:nth-child(2) { grid-column: 1; }
.snake-controls .button { padding: 0; font-size: 1.32rem; }

@media (max-width: 700px) {
  .catalog-head { gap: 4px; margin-bottom: 11px; }
  .catalog-head h1 { font-size: clamp(2.8rem, 10vw, 4.5rem); }
  .catalog-head p { font-size: .95rem; }
  .catalog-figure { display: none; }
  .catalog-grid { grid-template-columns: 1fr; gap: 7px; }
  .catalog-card { min-height: 63px; padding: 8px 10px; gap: 9px; }
  .catalog-symbol { width: 41px; height: 41px; }
  .catalog-name small { font-size: .8rem; }
  .mini-head { margin-bottom: 10px; }
  .mini-state { min-height: 41px; margin-bottom: 10px; }
  .fleet-layout, .quiz-layout, .word-layout, .sudoku-layout, .snake-layout { grid-template-columns: 1fr; }
  .word-layout { gap: 8px; }
  .mini-side, .quiz-card { padding: 10px; }
  .sudoku-actions .number-pad { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
  .number-pad .button { padding-inline: 0; }
  .snake-controls { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
  .snake-controls .button:first-child, .snake-controls .button:nth-child(2) { grid-column: auto; }
}

.duel-card { max-width: 720px; margin-inline: auto; }
.duel-form label { display: block; margin: 12px 0 6px; color: var(--muted); }
.duel-form input { letter-spacing: normal; }
.duel-action { margin-top: 12px; }
.duel-reveal { line-height: 1.65; padding-top: 9px; }
.duel-reveal p, .duel-history { color: var(--muted); }
.duel-history { margin-top: 15px; }
.clue-list { display: grid; gap: 8px; padding-left: 28px; }
.clue-list li { padding: 9px; background: #233c35; border-radius: 6px; }
.memory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 540px; }
.memory-grid .tile { font-size: clamp(1.75rem, 6vw, 4rem); }
.card-closed { color: #8aa99a; }
.card-open { background: #344a41; }
.memory-grid .mine { background: #424e34; }
.memory-grid .theirs { background: #533c31; }
.box-board {
  display: grid; grid-template-columns: repeat(4, 12px minmax(0, 1fr)) 12px;
  grid-template-rows: repeat(4, 12px minmax(0, 1fr)) 12px;
  max-width: 475px; aspect-ratio: 1; margin-inline: auto;
}
.dot { display: grid; place-items: center; }
.dot::after { content: ''; width: 9px; height: 9px; background: #d5e1d5; border-radius: 50%; }
.box-edge { border: 0; padding: 0; background: transparent; display: grid; place-items: center; }
.box-edge::after { content: ''; border-radius: 4px; background: #527067; }
.box-edge.horizontal::after { width: 100%; height: 4px; }
.box-edge.vertical::after { width: 4px; height: 100%; }
.box-edge:not(:disabled):hover::after { background: var(--accent); }
.box-edge:disabled { opacity: 1; }
.box-edge.mine::after { background: var(--lime); }
.box-edge.theirs::after { background: var(--orange); }
.box-space { display: grid; place-items: center; margin: 2px; border-radius: 5px; background: #1d3630; }
.box-space.mine { color: var(--lime); background: #405940; }
.box-space.theirs { color: var(--orange); background: #573e32; }
.mangala-board { display: grid; grid-template-columns: minmax(42px, 1fr) 6fr minmax(42px, 1fr);
  gap: clamp(4px, 1.5vw, 14px); background: #3c3027; padding: clamp(6px, 2vw, 16px); border-radius: 16px; }
.mangala-pits { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(4px, 1vw, 10px); }
.mangala-pits .pit { border-radius: 50%; font-size: clamp(.9rem, 3.1vw, 1.8rem); }
.mangala-bank { display: grid; align-content: center; justify-items: center; gap: 6px; border: 1px solid #99735e;
  background: #32271f; border-radius: 30px; color: var(--lime); padding: 2px; }
.mangala-bank.theirs { color: var(--orange); }
.mangala-bank strong { font-size: clamp(1rem, 4vw, 2rem); }
.mangala-bank small { font-size: clamp(.64rem, 1.8vw, .9rem); }
.mangala-pits .pit-last { box-shadow: inset 0 0 0 2px var(--accent); }

.atlas-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.atlas-choices button { justify-content: space-between; gap: 11px; }
.atlas-choices button span { font-weight: 500; color: var(--muted); font-size: .85rem; }
.atlas-choices button[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); }
.atlas-background { fill: #7a8e70 !important; stroke: #34483c; pointer-events: none; }
.water-target .water-shape { fill: #85d2f1; stroke: #1b546a; stroke-width: 1; pointer-events: none; }
.water-target.rivers .water-shape { fill: none; stroke: #8bdaf6; stroke-width: 2.5; stroke-linecap: round; }
.water-target .water-hit { fill: transparent; stroke: transparent; stroke-width: 12; }
.water-target.rivers .water-hit { fill: none; }
.water-dot { fill: #85d2f1; stroke: #33798a; stroke-width: .8; }
.interactive .water-target { cursor: pointer; }
.interactive .water-target:hover .water-shape, .water-target:focus-visible .water-shape { stroke: #fff; stroke-width: 3; }
.water-target.selected .water-shape, .water-target.selected .water-dot { stroke: var(--orange); stroke-width: 3; }
.water-target.locked .water-shape { stroke: #fff; stroke-width: 3; }
.water-target.correct .water-shape, .water-target.correct .water-dot { stroke: var(--lime); stroke-width: 4; }
.water-target.own-wrong .water-shape { stroke: var(--red); stroke-width: 3; }
.water-target.other-wrong .water-shape { stroke: var(--orange); stroke-width: 3; }

.arcade-split, .tangram-layout, .action-layout { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(225px,1fr); gap: 15px; align-items: start; }
.arcade-surface { background: #18342f; border: 1px solid #4c6e64; border-radius: 14px; overflow: hidden; }
.arcade-surface svg, .action-surface canvas { width: 100%; display: block; }
.tangram-layout .arcade-surface { background-color: #203632; background-image: radial-gradient(#56746a 1px,transparent 1px); background-size: 17px 17px; }
#tangram-area, .tangram-piece, .action-surface canvas, .action-drivers button { touch-action: none; }
.tangram-target { fill: #0d1e20; stroke: #0d1e20; stroke-width: .045; }
.tangram-target.guides { stroke: #7e9a91; stroke-dasharray: .12 .07; }
.tangram-placed { stroke: #1d292d; stroke-width: .03; }
#tangram-ghost { opacity: .85; pointer-events: none; stroke: #fff8db; stroke-width: .035; }
.tangram-tray { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
.tangram-piece { background: #102925; border-color: #4d6c60; padding: 3px; min-width: 0; }
.tangram-piece svg { width: 100%; height: auto; min-width: 24px; max-width: 50px; }
.button.chosen-piece { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.math-target { display: grid; justify-items: center; padding: 8px; border-radius: 12px; background: #36352a; color: var(--gold, #f4d889); }
.math-target strong { font: 3.55rem/1 var(--display); }
.math-target span { color: var(--muted); }
.arithmetic { max-width: 680px; margin-inline: auto; }
.number-tiles, .number-ops, .cipher-buttons { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 12px; }
.number-tile { min-width: 56px; font-size: 1.38rem; background: #282f28; color: #f4d889; border-color: #786f4c; }
.number-ops button { min-width: 47px; font-size: 1.32rem; }
.arcade-detail { color: var(--muted); min-height: 1.4em; margin-top: 10px; }
.route-surface svg { max-height: 480px; }
.route-surface line { stroke: #799990; stroke-width: .7; }
.route-surface line.route-used { stroke: var(--lime); stroke-width: 1.6; }
.route-surface text { fill: #edf4e2; font-size: 3.6px; text-anchor: middle; stroke: #18342f; stroke-width: 1px; paint-order: stroke; }
.route-surface g circle { fill: #304a43; stroke: #92aea2; stroke-width: .7; }
.route-surface g.reachable circle { fill: #587752; stroke: #d5ecaa; stroke-width: 1.05; cursor: pointer; }
.route-surface g.route-visited circle { fill: #4d623c; }
.route-surface g:focus-visible circle { stroke: #fff2b6; stroke-width: 1.5; }
.route-surface g text { font-size: 3.8px; font-weight: 700; pointer-events: none; }
.cipher-history { list-style: none; padding: 0; }
.cipher-history li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-block: 7px; border-bottom: 1px solid #38544e; }
.cipher-index { color: var(--muted); }
.code-tokens { display: inline-flex; gap: 5px; }
.code-tokens span { display: inline-grid; place-items: center; width: 28px; height: 30px; border-radius: 5px; border: 1px solid #625460; background: #3d343a; color: #f4b9cc; }
.code-selected span { width: 42px; height: 45px; font-size: 1.35rem; }
.cipher-buttons button { min-width: 43px; padding-inline: 8px; color: #f4b9cc; font-size: 1.3rem; }
.action-layout { align-items: start; }
.hockey-layout { grid-template-columns: minmax(0,430px) minmax(225px,340px); justify-content: center; }
.action-surface canvas { height: auto; user-select: none; }
.action-drivers { display: grid; grid-template-columns: repeat(3,46px); gap: 5px; margin-top: 13px; }
.action-drivers button { padding: 0; font-size: 1.45rem; }
.action-drivers button:first-child { grid-column: 2; }
.action-drivers button:nth-child(2) { grid-column: 1; }
@media (max-width:700px) {
  .arcade-split, .tangram-layout, .action-layout { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .hockey-layout .action-surface { width: min(100%,340px); justify-self: center; }
  .mini-head:has(+.mini-state + .mini-board .action-layout) { margin-bottom: 6px; }
  .action-drivers { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-top: 8px; }
  .action-drivers button:first-child, .action-drivers button:nth-child(2) { grid-column: auto; }
  .tangram-tray { grid-template-columns: repeat(7,minmax(0,1fr)); }
  .cipher-history small { font-size: .79rem; }
}

.golf-surface svg { touch-action: manipulation; cursor: crosshair; }
.golf-green { fill: #406846; }
.golf-rail { fill: none; stroke: #76a477; stroke-width: 2; }
.golf-wall { fill: #9b7559; stroke: #e0a979; stroke-width: 2; }
.golf-cup { fill: #12271c; stroke: #a5bc9a; stroke-width: 2; }
.golf-flag { fill: #f4b28c; stroke: #efeacb; stroke-width: 2; }
.golf-ball { fill: #f5f4dc; stroke: #334137; stroke-width: 2; }
.golf-aim { stroke: #eeeb9d; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 5 6; }
.golf-trail { fill: none; stroke: #c3dcaa; opacity: .55; stroke-dasharray: 2 8; stroke-width: 2; }
.salon-range { margin-top: 14px; display: grid; grid-template-columns: 1fr auto; color: var(--muted); gap: 3px 10px; }
.salon-range input { grid-column: 1/-1; width: 100%; accent-color: var(--lime); min-height: 30px; }
.salon-range output { color: var(--ink); font-variant-numeric: tabular-nums; }

.repair-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 2px;
  background: #172b2d; border: 1px solid #597570; border-radius: 9px; padding: 7px; }
.repair-tile { width: 100%; padding: 0; aspect-ratio: 1; border: 1px solid #57756b; border-radius: 4px;
  background: #24463c; color: #95ac9e; }
.repair-tile.repair-right { background: #3b3650; border-color: #6b6280; color: #b2a2bf; }
.repair-tile:nth-child(6n+4) { border-left-color: #e1c4f0; border-left-width: 2px; }
.repair-tile:disabled { opacity: .77; }
.repair-tile:hover:not(:disabled) { border-color: #eef8ba; }
.repair-tile svg { width: 100%; height: 100%; }
.repair-tile svg line { stroke: currentColor; stroke-width: 3.6; }
.repair-tile svg circle { fill: currentColor; }
.repair-tile.powered { color: #f4ef8b; }
.repair-tile .power-source { stroke: #f4ef8b; fill: #335855; stroke-width: 2; }

.market-layout { display: grid; gap: 11px; }
.market-hands { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.market-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.market-row.held p { color: var(--muted); }
.market-card { width: clamp(52px,12vw,96px); aspect-ratio: .75; display: grid; grid-template-rows: auto 1fr auto;
  justify-items: center; gap: 4px; border: 1px solid #8d9274; border-radius: 9px; padding: 6px;
  background: #2c4638; color: #d4ee92; text-align: center; }
.market-card b { align-self: center; font-size: clamp(1.2rem,4vw,2.35rem); }
.market-card>span { justify-self: start; font-weight: 750; }
.market-card small { font-size: .67rem; }
.market-card.suit-1 { color: #eecc84; background: #4b4131; }
.market-card.suit-2 { color: #a8d9f7; background: #2e4552; }
.market-card.suit-3 { color: #f5b2ca; background: #4b3640; }
.market-card:hover:not(:disabled)[data-salon] { border-color: #ffedbd; transform: translateY(-2px); }
.market-row.held .market-card { width: clamp(42px,8vw,67px); }
.market-row.held .market-card b { font-size: 1.35rem; }

.rhythm-game { max-width: 760px; margin-inline: auto; }
.rhythm-lane { position: relative; height: 85px; margin-bottom: 10px; border-radius: 9px; border: 1px solid #567681;
  background: repeating-linear-gradient(to right,#213d49 0,#213d49 calc(10% - 1px),#395765 calc(10% - 1px),#395765 10%); overflow: hidden; }
.rhythm-gate { position: absolute; left: 19%; top: 0; width: 6px; height: 100%; background: #afd8e4; transform: translateX(-50%); }
.rhythm-gate.pulse { background: #ffdf9c; box-shadow: 0 0 17px #ffdf9c; }
.rhythm-note { position: absolute; top: 50%; width: 25px; height: 25px; border-radius: 50%;
  transform: translate(-50%,-50%); border: 2px solid #f4f3e1; background: #a5d8fc; }
.rhythm-feedback { min-height: 1.7em; display: block; color: #d7ed95; text-align: center; }
.rhythm-progress { display: grid; grid-template-columns: repeat(20,minmax(0,1fr)); gap: 3px; align-items: center; }
.rhythm-progress span { height: 10px; border-radius: 2px; border: 1px solid #57717a; background: #2b4650; }
.rhythm-progress .hit-3 { background: #d7ed95; }
.rhythm-progress .hit-2 { background: #a5d8fc; }
.rhythm-progress .hit-1 { background: #f6bd9e; }
.rhythm-progress .rhythm-miss { background: #74515a; }
.rhythm-actions [data-salon="beat"] { flex: 1; min-height: 54px; touch-action: manipulation; }

.pixel-grid { display: grid; grid-template-columns: minmax(43px,1fr) repeat(5,minmax(0,1fr)); gap: 3px; align-items: stretch;
  background: #172c2e; border: 1px solid #5a7475; border-radius: 8px; padding: 9px; max-width: 490px; }
.pixel-col-clue, .pixel-line-clue { align-self: stretch; display: grid; place-content: center; text-align: center;
  line-height: 1.2; color: #d9e1d8; font-weight: 650; background: #304848; border-radius: 4px; min-height: 29px; }
.pixel-col-clue { padding: 3px 0; align-content: end; }
.pixel-tile { width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid #668384; border-radius: 4px; background: #243d3e;
  color: #c4c7cf; font-size: 1.4rem; }
.pixel-tile:hover:not(:disabled) { border-color: #f0c7dc; }
.pixel-tile.pixel-filled { background: #e4abc5; border-color: #f5d3dc; }
.pixel-tile.pixel-cross { background: #303b47; }
.pixel-tile:disabled { opacity: 1; }
@media(max-width:700px) {
  .market-row { gap: 5px; }
  .market-hands { grid-template-columns: 1fr; }
  .market-row.held .market-card { width: 45px; }
  .repair-grid { padding: 4px; }
  .rhythm-lane { height: 65px; }
}

.party-stack { display: grid; gap: 16px; }
.party-stack p { color: var(--muted); line-height: 1.5; }
.party-card { display: grid; gap: 10px; padding: clamp(14px, 3vw, 24px); border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.party-card h2, .district-layout h2 { font-size: clamp(1.05rem, 2.25vw, 1.55rem); font-weight: 650; }
.party-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.party-controls input { flex: 1 1 160px; width: min(100%, 230px); }
.party-controls .button { touch-action: manipulation; }
.party-controls [aria-pressed="true"] { border-color: var(--lime); background: #344634; color: #f6ffd6; }
.party-readout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.party-readout > div { padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); }
.party-readout dt { color: var(--muted); font-size: .8rem; }
.party-readout dd { margin: 2px 0 0; font-weight: 700; color: var(--lime); }
.signal-map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.signal-map .button { display: grid; min-width: 0; justify-items: start; gap: 4px; padding: 10px; text-align: left; }
.signal-map .button small { color: var(--muted); font-size: .78rem; line-height: 1.25; }
.signal-map .signal-wrong { background: #583834; border-color: #f5a996; }
.signal-map .button:disabled:not(.signal-wrong) { opacity: .8; }
.platform-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; font-variant-numeric: tabular-nums; color: var(--muted); }
.platform-stats strong, .platform-stats [data-platform="time"] { color: var(--ink); font-weight: 720; }
.platform-field { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: repeating-linear-gradient(0deg, #ffffff09 0 1px, transparent 1px 25px), linear-gradient(#235157, #2f5d50 78%, #142a27 86%); }
.platform-field svg { width: 100%; }
.platform-ground { fill: #799568; stroke: #b7d292; stroke-width: 2; }
.platform-obstacle { fill: #cb795b; stroke: #ffd1a1; stroke-width: 2; }
.platform-flag { fill: #68bcca; stroke: #d7f8ff; stroke-width: 2; }
.platform-flag.finish { fill: #dde995; stroke: #faffc5; }
.platform-runner { stroke: #172b23; stroke-width: 1.4; }
.platform-runner.own-runner { fill: #e6ff9d; }
.platform-runner.rival-runner { fill: #ffafa2; }
.platform-runner.resetting { opacity: .45; }
.platform-count { display: grid; place-items: center; position: absolute; inset: 0; font-size: clamp(2.2rem, 8vw, 5.6rem); font-weight: 800; color: var(--lime); background: #172a2ca1; }
.platform-progress { display: grid; gap: 5px; }
.platform-progress progress { width: 100%; height: 9px; accent-color: var(--lime); }
.platform-progress progress + progress { accent-color: var(--orange); }
.tower-field { width: min(100%, 520px); height: clamp(245px, 47vw, 360px); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(ellipse at 54% 72%, #32535a, #152c34 82%); }
.tower-field svg { width: 100%; height: 100%; }
.tower-ground { stroke: #728a8e; stroke-width: .55; }
.tower-base { fill: #829898; }
.tower-block { stroke: #172a2c; stroke-width: .45; }
.tower-block.own { fill: #a5d8fc; }
.tower-block.rival { fill: #e9ad91; }
#tower-preview { fill: #a5d8fc45; stroke: #d9efff; stroke-width: .5; stroke-dasharray: 1.5 1; }
.tower-fallen { fill: var(--red); opacity: .75; transform-box: fill-box; transform-origin: center; transform: rotate(25deg); }
.tower-collapse { opacity: .42; transform: rotate(12deg); transform-origin: 50px 0; animation: tower-fall .38s ease-out; }
@keyframes tower-fall { from { opacity: 1; transform: rotate(0); } }
.tower-position { display: grid; gap: 8px; max-width: 520px; color: var(--muted); }
.tower-position input { width: 100%; accent-color: var(--sky); }
.district-layout { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
.district-layout section { display: grid; gap: 8px; width: min(100%, 360px); }
.district-board { display: grid; gap: 5px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.district-cell { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: #21362f; color: #d0d6b6; font-size: clamp(1.1rem, 4vw, 1.9rem); }
.district-cell:disabled { opacity: 1; }
.district-cell:not(:disabled):hover { border-color: var(--lime); }
.district-cell.house { background: #694d38; color: #ffd4a7; }
.district-cell.park { background: #3f654c; color: #d4f29c; }
.district-cell.shop { background: #4e486a; color: #eadbff; }
.district-cell.school { background: #2b5c6b; color: #c8edff; }
.cup-stages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.cup-stages li { min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.cup-stages li[aria-current] { border-color: #c7acf1; }
.cup-stages small { color: var(--muted); }
.cup-xox { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 325px); }
.cup-xox .tile { aspect-ratio: 1; min-height: 50px; font-size: clamp(1.8rem, 5vw, 3rem); color: var(--ink); }
.cup-xox .tile:disabled { opacity: .8; }
.cup-map { overflow: hidden; background: #183235; border-radius: 8px; }
.cup-map svg { width: 100%; }
@media (max-width: 480px) {
  .signal-map .button, .cup-stages li { padding: 8px 5px; }
  .signal-map .button strong, .cup-stages strong { font-size: .78rem; }
  .signal-map .button small, .cup-stages small { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .tower-collapse { animation: none; } }

.cargo-map {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: clamp(2px, .55vw, 5px);
  padding: clamp(5px, 1.2vw, 12px);
  width: min(100%, 620px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101e25;
}
.cargo-cell {
  display: grid;
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 1px solid #45605e;
  border-radius: 3px;
  background: #263e43;
  color: #eff5df;
  font-size: clamp(.63rem, 2.3vw, 1.1rem);
  font-weight: 800;
  touch-action: manipulation;
}
.cargo-cell:disabled, .cracked-tile:disabled { opacity: 1; }
.cargo-cell.terrain-wall { background: #111b24; border-color: #26343c; }
.cargo-cell.terrain-a, .cargo-cell.terrain-b { background: #316167; color: #ddffff; border: 1px dashed #a3d4cf; }
.cargo-cell.terrain-A, .cargo-cell.terrain-B { background: #77452d; border-color: #e1a15e; }
.cargo-cell.terrain-A.open, .cargo-cell.terrain-B.open { background: #37493a; border-style: dashed; }
.cargo-cell.terrain-X { background: #655423; border: 2px dashed #efd684; }
.cargo-cell.terrain-Y { background: #574367; border: 2px dashed #dbb8f1; }
.cargo-cell.can-walk { outline: 1px solid #a8d9b4; outline-offset: -2px; }
.cargo-cell.can-walk:hover { background: #40655d; }
.cargo-pawn { display: grid; place-items: center; width: 64%; aspect-ratio: 1; border-radius: 28%; color: #15252a; }
.cargo-pawn.robot-0 { background: #a3d6fa; }
.cargo-pawn.robot-1 { background: #ffb98e; }
.cargo-pawn.focused { outline: 1px solid #fffff2; outline-offset: 1px; }
.cargo-package, .cargo-marker { aspect-ratio: 1; border-radius: 2px; }
.cargo-package { position: absolute; inset: auto 6% 6% auto; display: grid; place-items: center; width: 33%; color: #2a2620; font-size: min(1.3vw, .58rem); line-height: 1; }
.cargo-package.parcel-x, .cargo-marker.parcel-x { background: #ffe28b; }
.cargo-package.parcel-y, .cargo-marker.parcel-y { background: #eca8f9; }
.cargo-marker.plate { background: #67a1a8; }
.cargo-marker.door { background: #cc8860; }
.cargo-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .82rem; }
.cargo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cargo-marker { display: inline-block; width: 10px; }

.cracked-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, 1vw, 7px); width: min(100%, 460px); }
.cracked-tile { display: grid; position: relative; place-items: center; aspect-ratio: 1; border: 1px solid #647358; border-radius: 6px; padding: 0;
  background: #37493d; color: var(--ink); font-size: clamp(1rem, 4vw, 1.8rem); touch-action: manipulation; }
.cracked-tile.legal { background: #506442; border-color: #b9d783; }
.cracked-tile.legal:hover { background: #617750; }
.cracked-tile.hole { background: #111d22; border-color: #2d3f45; }
.cracked-tile.chosen { background: #65543c; border-color: #eab881; }
.cracked-tile.dropped { background: #54332e; border-color: #e79181; }
.cracked-pawn { color: #ffbc90; }
.cracked-pawn.you { color: #c9ef8f; }

#sketch-canvas {
  display: block;
  width: min(100%, 455px);
  height: auto;
  aspect-ratio: 5 / 4;
  border: 1px solid #c7bcaa;
  border-radius: 10px;
  background: #f3ecdc;
}
#sketch-canvas.can-draw { touch-action: none; cursor: crosshair; }
.sketch-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(100%, 570px); }
.sketch-options .button { white-space: normal; }
.sketch-options .answer-right, .timeline-slot .answer-right { background: #33543c; border-color: #b9dc90; color: #ecffd8; opacity: 1; }
.sketch-options .answer-wrong, .timeline-slot .answer-wrong { background: #643f37; border-color: #e9a292; opacity: 1; }

.timeline-question { width: min(100%, 850px); }
.timeline-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; align-items: stretch; list-style: none; margin: 0; padding: 0; }
.timeline-track li { display: grid; min-width: 0; }
.timeline-track .timeline-anchor { align-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--field); }
.timeline-anchor strong { color: #f1d48d; font-size: 1.25rem; }
.timeline-anchor span { color: var(--muted); overflow-wrap: anywhere; }
.timeline-slot .button { height: 100%; min-height: 58px; padding-inline: 7px; white-space: normal; }
.timeline-slot [aria-pressed="true"]:not(.answer-wrong):not(.answer-right) { opacity: 1; border-color: #f1d48d; }
.timeline-reveal { display: grid; gap: 6px; }
.timeline-reveal a { color: var(--sky); width: fit-content; }
@media (max-width: 620px) {
  .timeline-track { grid-template-columns: 1fr; gap: 5px; }
  .timeline-track .timeline-anchor { display: flex; align-items: center; padding: 8px 12px; }
  .timeline-slot .button { min-height: 43px; }
}
