/* SETI table. Layout: the solar system is the centre of the table; everything
   else (card row, players, tech, log) sits around it, stacking on a phone. */
:root {
  color-scheme: dark;
  --space: #070b14;
  --panel: #0f1626;
  --panel-2: #151e33;
  --line: #24304d;
  --ink: #e6ecf8;
  --muted: #8d9bb8;
  --signal: #7aa2f7;
  --sun: #ffd166;
  --ok: #5ad39a;
  --warn: #f4a259;
  --p-red: #ef5d60;
  --p-blue: #4ea1ff;
  --p-green: #4fc97f;
  --p-yellow: #f2c94c;
  --p-purple: #a78bfa;
  --p-orange: #ff8a3d;
  --p-white: #eef2f8;
  --p-pink: #ff7ac3;
  --s-red: #e5484d;
  --s-yellow: #e9c341;
  --s-blue: #3e8ef7;
  --s-black: #8a93a6;
  --font-display: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--space);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
@media (hover: none) and (pointer: coarse) { input, select { font-size: 16px; } }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: 0.01em; }
a { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.wrap { max-width: 1280px; margin-inline: auto; padding-inline: 16px; padding-block: 20px 48px; display: flex; flex-direction: column; gap: 18px; }
.narrow { max-width: 560px; }

.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand h1 { font-size: 1.7rem; font-weight: 700; }
.brand .tag { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel h2 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--font-mono); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field span, .field > label { font-size: 0.8rem; color: var(--muted); }
.seat { display: flex; gap: 12px; align-items: center; }
.seat input[type="text"] { flex: 1; min-width: 0; }
.ai { background: var(--space); color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 0.9rem; cursor: pointer; }
.ai-tag { margin-left: 6px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); vertical-align: middle; }
input[type="text"] { background: var(--space); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%; }
input[type="text"]:focus { border-color: var(--signal); outline: none; }
.btn { background: var(--signal); color: #071022; border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.sm { padding: 5px 10px; font-size: 0.82rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 4px; }
.err { color: var(--warn); font-size: 0.9rem; }

.links { display: flex; flex-direction: column; gap: 8px; }
.link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.link code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.c-red { background: var(--p-red); } .c-blue { background: var(--p-blue); } .c-green { background: var(--p-green); } .c-yellow { background: var(--p-yellow); } .c-purple { background: var(--p-purple); } .c-orange { background: var(--p-orange); } .c-white { background: var(--p-white); } .c-pink { background: var(--p-pink); } .c-none { background: var(--muted); }

.notice { border: 1px solid var(--warn); background: rgba(244, 162, 89, 0.08); color: var(--warn); border-radius: 8px; padding: 9px 12px; font-size: 0.88rem; }

/* ---- table ---- */
.table { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .table { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.solar { width: 100%; height: auto; display: block; }
.status { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.status b { color: var(--ink); font-weight: 500; }

.players { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.player { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--pc); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.player.me { box-shadow: 0 0 0 1px var(--pc) inset; }
.player .who { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.player .who strong { font-family: var(--font-display); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .score { font-family: var(--font-mono); font-size: 1.1rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.stats b { color: var(--ink); font-weight: 500; }
.turn { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ok); font-family: var(--font-mono); }

.cards { display: flex; gap: 10px; flex-wrap: wrap; }
.card { width: 124px; aspect-ratio: 150 / 209; border-radius: 7px; background-color: #1b2540; background-repeat: no-repeat; border: 1px solid var(--line); flex: none; position: relative; overflow: hidden; }
.card.plain { padding: 8px; font-size: 0.72rem; display: flex; flex-direction: column; gap: 4px; }
.card.plain b { font-family: var(--font-display); font-size: 0.8rem; line-height: 1.15; }
.card.sm { width: 92px; }

.tech { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tech div { border: 1px solid var(--line); border-radius: 6px; padding: 6px; font-family: var(--font-mono); font-size: 0.72rem; text-align: center; background: var(--panel-2); }
.tech .probe { border-top: 3px solid var(--warn); } .tech .scan { border-top: 3px solid var(--signal); } .tech .comp { border-top: 3px solid var(--ok); }

.log { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); display: flex; flex-direction: column; gap: 3px; max-height: 180px; overflow: auto; }

/* ---- play ---- */
.opts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select { background: var(--space); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.ask { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal) inset; }
.decision { display: flex; flex-direction: column; gap: 8px; }
.decision p { margin: 0; font-weight: 500; }
.cardbtn { background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; width: 96px; }
.cardbtn span { font-size: 0.72rem; color: var(--muted); text-align: center; line-height: 1.2; }
.cardbtn:hover .card { border-color: var(--signal); }
.stack { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.card.click { cursor: pointer; }
.card.sel { outline: 3px solid var(--signal); outline-offset: 1px; }
.solar .go { cursor: pointer; }
.solar .go:hover path { fill: #24365f; }
.turn.off { color: var(--muted); }
.computer { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.col2 { display: flex; flex-direction: column; gap: 5px; }
.slot { height: 34px; border-radius: 6px; border: 1px dashed var(--line); background: var(--panel-2); font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); cursor: pointer; padding: 0 2px; }
.slot:disabled { cursor: default; }
.slot.full { background: var(--signal); color: #071022; border-style: solid; border-color: var(--signal); }
.slot.low { border-color: var(--ok); }
.slot.none { border: 0; background: none; }
.planets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.planet { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.pip { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.aliens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.alien { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.trace { width: 26px; height: 26px; border-radius: 50%; border: 2px solid; display: inline-grid; place-items: center; }
.trace .pip { margin: 0; }
.t-red { border-color: var(--s-red); } .t-yellow { border-color: var(--s-yellow); } .t-blue { border-color: var(--s-blue); }
.gold { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.goldtile { border: 1px solid #a8862b; background: rgba(233, 195, 65, 0.07); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.goldtile b { color: var(--s-yellow); font-family: var(--font-display); }
.tech button { border: 1px solid var(--line); border-radius: 6px; padding: 6px; font-family: var(--font-mono); font-size: 0.68rem; text-align: center; background: var(--panel-2); line-height: 1.3; cursor: pointer; }
.tech button:disabled { cursor: default; opacity: 0.75; }
.tech button:not(:disabled) { border-color: var(--signal); }
.tech button.have { opacity: 1; box-shadow: 0 0 0 1px var(--ok) inset; }
@media (max-width: 520px) { .tech { grid-template-columns: repeat(2, 1fr); } .card { width: 104px; } }

/* ---- board artwork ---- */
.solar .disc { transform-origin: 400px 400px; transition: transform 0.9s cubic-bezier(0.3, 0.1, 0.2, 1); }
.planet-art { width: 100%; height: 150px; object-fit: contain; border-radius: 6px; background: #05070f; }
.gold-art { width: 100%; max-width: 190px; align-self: center; filter: drop-shadow(0 3px 5px #0009); }
.tech-art { display: block; width: 100%; max-width: 74px; margin: 0 auto 4px; border-radius: 5px; box-shadow: 0 2px 5px #0008; }

/* ---- depth and motion ---- */
.btn, .tech button, .cardbtn, .card, .chip, .planet, .goldtile { transition: transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease, background-color 0.18s ease; }
.btn { box-shadow: 0 2px 0 #0006, 0 4px 10px #0004; }
.btn:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 3px 0 #0006, 0 8px 16px #0005; }
.btn:not(:disabled):active { transform: translateY(2px) scale(0.98); box-shadow: 0 0 0 #0006, 0 1px 3px #0005; filter: brightness(0.95); }
.btn.ghost { box-shadow: none; }
.btn.ghost:not(:disabled):hover { border-color: var(--signal); box-shadow: 0 4px 12px #0005; }
.card { box-shadow: 0 2px 6px #0007; }
.card.click:hover, .cardbtn:hover .card { transform: translateY(-5px) rotate(-0.6deg); box-shadow: 0 12px 22px #000a; }
.card.click:active, .cardbtn:active .card { transform: translateY(-1px) scale(0.97); box-shadow: 0 3px 8px #0009; }
.card.sel { transform: translateY(-9px); box-shadow: 0 16px 26px #000b, 0 0 0 3px var(--signal); outline: none; }
.tech button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 14px #0007; }
.tech button:not(:disabled):active { transform: translateY(1px) scale(0.98); }
.panel { animation: rise 0.35s ease both; }
.panel.ask { animation: rise 0.35s ease both, glow 1.6s ease-in-out 0.35s 2; }
.solar .go { animation: pulse 1.4s ease-in-out infinite; }
.solar circle, .solar rect { transition: fill 0.3s ease; }
.pip { animation: pop 0.3s ease both; }
.log span:first-child { animation: rise 0.4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 55%, transparent); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- compact view: text and symbols, tighter spacing ---- */
.compact, .compact .col { gap: 8px; }
.compact .panel { padding: 10px; gap: 8px; border-radius: 8px; }
.compact .cards { gap: 6px; }
.compact .planets { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 5px; }
.compact .planet { padding: 5px 7px; gap: 2px; }
.compact .gold { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 5px; }
.compact .goldtile { padding: 5px 8px; }
.compact .tech button { padding: 4px; }
.compact .cardbtn { width: auto; max-width: 170px; align-items: stretch; }
.compact .stack { max-width: 170px; }
.chip { width: 164px; flex: none; display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); font-size: 0.7rem; line-height: 1.25; text-align: left; box-shadow: 0 1px 3px #0006; }
.chip.click { cursor: pointer; }
.chip.click:hover { transform: translateY(-2px); border-color: var(--signal); box-shadow: 0 6px 14px #0008; }
.chip.click:active { transform: scale(0.98); }
.chip.sel { border-color: var(--signal); box-shadow: 0 0 0 2px var(--signal); }
.chip-top { display: flex; gap: 5px; align-items: center; }
.chip-cost { font-family: var(--font-mono); background: #e9c34122; color: var(--s-yellow); border-radius: 4px; padding: 0 5px; }
.chip-name { font-family: var(--font-display); font-size: 0.78rem; line-height: 1.1; }
.chip-text { color: var(--ink); opacity: 0.85; }
.chip-foot { color: var(--muted); font-family: var(--font-mono); font-size: 0.66rem; }
@media (max-width: 520px) { .chip { width: calc(50% - 3px); } .compact .cardbtn, .compact .stack { max-width: calc(50% - 3px); } .compact .cardbtn .chip, .compact .stack .chip { width: 100%; } }

/* ---- colour choice, rotation indicator, species boards ---- */
.swatches { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #0008; padding: 0; cursor: pointer; transition: transform 0.14s ease, box-shadow 0.14s ease; }
.swatch:not(:disabled):hover { transform: scale(1.25); box-shadow: 0 0 0 2px #fff8; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.swatch:disabled { opacity: 0.25; cursor: not-allowed; }
.rot { display: inline-flex; align-items: center; gap: 6px; }
.rot svg { width: 30px; height: 30px; }
.rot .turns { animation: pulse 1.6s ease-in-out infinite; }
.species-art { width: 100%; max-width: 250px; align-self: center; border-radius: 10px; filter: drop-shadow(0 4px 8px #000a); }
.solar .ringline { fill: none; stroke: #ffffff; stroke-opacity: 0.55; stroke-width: 1.4; pointer-events: none; }
.solar .spoke { stroke: #ffffff; stroke-opacity: 0.22; stroke-width: 1; pointer-events: none; }

/* ---- game page: resource bar on top, turn box first, hand tray at the bottom ---- */
.game { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hud { position: sticky; top: 0; z-index: 30; display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; padding: 8px 12px; background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line); border-left: 4px solid var(--pc); border-radius: 10px; box-shadow: 0 6px 18px #000a; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.hud b { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.hud-turn { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); }
.hud-turn.on { color: #071022; background: var(--ok); border-color: var(--ok); font-weight: 600; }
@media (min-width: 1000px) {
  .table { grid-template-rows: auto 1fr; }
  .turnbox { grid-column: 2; grid-row: 1; }
  .boardcol { grid-column: 1; grid-row: 1 / span 2; }
  .sidecol { grid-column: 2; grid-row: 2; }
}
.turnbox:empty { display: none; }
.mains { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mains .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 9px 12px; line-height: 1.2; }
.mains .btn small { font-weight: 400; font-size: 0.7rem; opacity: 0.8; }
.mains .btn:disabled { background: var(--panel-2); color: var(--muted); box-shadow: none; opacity: 0.6; border: 1px solid var(--line); }
.facedown { display: inline-flex; gap: 4px; }
.facedown i { width: 26px; height: 36px; border-radius: 4px; border: 1px solid var(--line); background: repeating-linear-gradient(135deg, #1b2540 0 5px, #24304d 5px 10px); box-shadow: 0 2px 4px #0008; }
.tech-bonus { display: block; color: var(--sun); }

.tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--panel); border-top: 1px solid var(--signal); box-shadow: 0 -8px 24px #000b; }
.tray-bar { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: none; border: 0; cursor: pointer; font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
.tray-bar b { font-family: var(--font-mono); margin-left: 6px; }
.tray-body { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; max-width: 1280px; margin-inline: auto; }
.tray-body p { margin: 0; }
.tray-cards { display: flex; gap: 10px; overflow-x: auto; padding: 12px 4px 6px; scrollbar-width: thin; }
.tray-space { height: 52px; flex: none; }
.tray-space.open { height: 300px; }

/* Gold scoring tiles: reference information, kept small. */
.gold { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 6px; }
.goldtile { padding: 6px 8px; gap: 2px; font-size: 0.78rem; line-height: 1.3; }
.goldtile .small { font-size: 0.72rem; }
.gold-art { max-width: 84px; }

/* ---- resource icons, VP box ---- */
.ico { display: inline-block; width: 1.25em; height: 1.25em; border-radius: 4px; background-image: url(seti-assets/seti-icons.webp); background-size: 500% 700%; background-repeat: no-repeat; vertical-align: -0.28em; flex: none; }
.hud .ico { width: 20px; height: 20px; margin-right: 5px; vertical-align: -5px; }
.hud-income .ico { width: 15px; height: 15px; margin: 0 1px; vertical-align: -3px; }
.stats .ico { width: 14px; height: 14px; vertical-align: -3px; }
.vp { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink); background: color-mix(in srgb, var(--ok) 16%, transparent); border: 1px solid var(--ok); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.vp b { font-size: 1.05rem; font-weight: 600; }
.tech-bonus { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin: 3px 0; color: var(--ink); }
.gain { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px; border-radius: 4px; background: #ffffff14; }
.gain.first { background: color-mix(in srgb, var(--sun) 22%, transparent); color: var(--sun); }
.gain .ico { width: 14px; height: 14px; vertical-align: 0; }

/* ---- the computer strip from the player board ---- */
.cboard { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); line-height: 0; }
.cboard img { width: 100%; height: auto; display: block; }
.cspace { position: absolute; top: 37.5%; width: 5.6%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 0; background: transparent; padding: 0; cursor: default; }
.cspace.next { cursor: pointer; box-shadow: 0 0 0 3px var(--sun), 0 0 14px 4px color-mix(in srgb, var(--sun) 70%, transparent); animation: pulse 1.4s ease-in-out infinite; }
.cspace.full { background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--pc) 13% 62%, #0009 63% 70%, transparent 71%); }
.ctoken { position: absolute; width: 3.6%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 14%, var(--pc) 15% 70%, #000a 71%); box-shadow: 0 2px 4px #000a; }
.clow { position: absolute; top: 76%; transform: translate(-50%, -50%); min-width: 7%; padding: 1px 4px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; border-radius: 6px; border: 1px solid var(--ok); background: #0b1220d9; color: var(--ink); font-family: var(--font-mono); font-size: 0.68rem; line-height: 1.4; cursor: default; }
.clow .ico { width: 13px; height: 13px; vertical-align: 0; }
.clow.next { cursor: pointer; box-shadow: 0 0 0 2px var(--sun); animation: pulse 1.4s ease-in-out infinite; }
.clow.full { background: var(--pc); color: #071022; border-color: #fff; }

/* ---- undo, pop-ups ---- */
.panel.undo { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 10px 16px; }
.toasts { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; }
.toast { max-width: min(92vw, 520px); padding: 18px 28px; border-radius: 14px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 2px solid var(--signal); box-shadow: 0 18px 50px #000d; font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; text-align: center; animation: toast 1.3s ease both; }
.toast.rotate { border-color: var(--sun); color: var(--sun); }
.toast.mine { border-color: var(--ok); color: var(--ok); }
.toast.round { border-color: var(--ink); }
@keyframes toast { 0% { opacity: 0; transform: scale(0.85); } 12% { opacity: 1; transform: scale(1.04); } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(0.98); } }

/* ---- one icon size everywhere in the top bar and on the tech board ---- */
.hud-income .ico { width: 20px; height: 20px; margin: 0 2px 0 1px; vertical-align: -5px; }
.hud-income { display: inline-flex; align-items: center; gap: 4px; }
.gain .ico { width: 20px; height: 20px; }
.gain { font-size: 0.8rem; padding: 2px 5px; }
.soundbtn { margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 0.72rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.soundbtn[aria-pressed="true"] { color: var(--ink); }

/* ---- cards named in the log ---- */
.logcard { color: var(--ink); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.logcard:hover, .logcard:focus { color: var(--signal); outline: none; }
.logpop { position: fixed; z-index: 70; pointer-events: none; filter: drop-shadow(0 12px 24px #000d); }
.logpop .card { width: 190px; }

/* ---- figures on the planets, face-down species boards ---- */
.planet-pic { position: relative; height: 150px; max-width: 100%; margin: 0 auto; border-radius: 6px; overflow: hidden; background: #05070f; }
.planet-pic img { width: 100%; height: 100%; display: block; }
.figure { position: absolute; width: 15px; height: 15px; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #000c, 0 2px 5px #000c; animation: pop 0.3s ease both; }
.species-art.back { max-width: 150px; }
.tracevalues { display: flex; gap: 6px; flex-wrap: wrap; }
.tv { display: inline-flex; align-items: center; gap: 5px; padding: 2px 6px; border-width: 2px; border-style: solid; border-radius: 8px; font-size: 0.75rem; }
.tv b { text-transform: capitalize; font-weight: 500; }
.tv .gain { background: none; padding: 0; }
.tv .gain .ico { width: 16px; height: 16px; }

/* "Highlight what turns next": the layers that stay put fade, the discs about to turn stay solid. */
.solar .fadeable, .solar .disc { transition: transform 0.9s cubic-bezier(0.3, 0.1, 0.2, 1), opacity 0.25s ease; }
.btn[aria-pressed="true"] { border-color: var(--sun); color: var(--sun); }

/* ---- markers on the species boards; figures large enough to cover a printed bonus ---- */
.species-pic { position: relative; width: 100%; max-width: 250px; align-self: center; line-height: 0; filter: drop-shadow(0 4px 8px #000a); }
.species-pic img { width: 100%; height: auto; display: block; border-radius: 10px; }
.tracemark { position: absolute; width: 15%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #000c, 0 2px 6px #000c; animation: pop 0.3s ease both; }
.figure { width: 19px; height: 19px; }
/* Markers placed by their centre keep that placement while they pop in. */
.figure, .tracemark { animation: drop 0.3s ease both; }
@keyframes drop { from { transform: translate(-50%, -50%) scale(0); } 70% { transform: translate(-50%, -50%) scale(1.25); } to { transform: translate(-50%, -50%) scale(1); } }

.discpick { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }

/* A Mascamite sample token lying on the species board. */
.sampletoken { position: absolute; transform: translate(-50%, -50%); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 17%; aspect-ratio: 1; border-radius: 50%; background: #f4e9c8; color: #1b1405; border: 2px solid #b8891d; box-shadow: 0 2px 6px #000c; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; line-height: 1; }
.sampletoken span { display: inline-flex; align-items: center; gap: 1px; }
.sampletoken .ico { width: 12px; height: 12px; vertical-align: 0; }

/* ---- first player, planning view, data tokens as tinted data icons, gains in the log ---- */
.first { align-self: flex-start; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: #071022; background: var(--sun); border-radius: 999px; padding: 1px 8px; }
.mains.waiting .btn { cursor: default; }
/* The game's data icon, recoloured to the player's colour: the icon keeps its light and dark, the colour comes from --pc. */
.ctoken, .cspace.full { background: var(--pc) url(seti-assets/seti-icons.webp) 0% 16.667% / 500% 700% no-repeat; background-blend-mode: luminosity; border: 2px solid #fff; box-shadow: 0 0 0 1px #000a, 0 2px 4px #000a; }
.ctoken { width: 4%; }
.log .gainline { padding-left: 14px; color: color-mix(in srgb, var(--ok) 75%, var(--muted)); }

/* ---- passed players, clickable spaces, gold tile markers ---- */
.passed { align-self: flex-start; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); background: #3a4560; border-radius: 999px; padding: 1px 8px; }
.player.out { opacity: 0.62; }
.hotspot { position: absolute; width: 22px; height: 22px; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid var(--sun); background: color-mix(in srgb, var(--sun) 28%, transparent); box-shadow: 0 0 10px 3px color-mix(in srgb, var(--sun) 70%, transparent); cursor: pointer; padding: 0; z-index: 3; animation: beacon 1.2s ease-in-out infinite; }
.hotspot.big { width: 16%; height: auto; aspect-ratio: 1; }
.hotspot:hover { background: color-mix(in srgb, var(--sun) 65%, transparent); }
@keyframes beacon { 0%, 100% { box-shadow: 0 0 6px 1px color-mix(in srgb, var(--sun) 60%, transparent); } 50% { box-shadow: 0 0 14px 6px color-mix(in srgb, var(--sun) 85%, transparent); } }
button.trace { background: none; padding: 0; cursor: pointer; }
.trace.pickable { box-shadow: 0 0 10px 3px color-mix(in srgb, var(--sun) 75%, transparent); animation: beacon 1.2s ease-in-out infinite; }
.gold-pic { position: relative; width: 100%; max-width: 84px; align-self: center; line-height: 0; filter: drop-shadow(0 3px 5px #0009); }
.gold-pic img { width: 100%; height: auto; display: block; }
.gold-pic .tracemark { width: 20%; border-width: 1.5px; }

/* ---- final scores ---- */
.panel.final { border-color: var(--sun); gap: 14px; }
.winner { margin: 0; font-family: var(--font-display); font-size: 1.5rem; }
.winner b { color: var(--sun); }
.finalgrid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .finalgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.scoretable-wrap { overflow-x: auto; }
.scoretable { border-collapse: collapse; width: 100%; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.scoretable th, .scoretable td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.scoretable tbody th, .scoretable tfoot th { text-align: left; font-weight: 400; color: var(--muted); }
.scoretable thead th { font-family: var(--font-display); font-weight: 600; border-bottom: 3px solid var(--pc, var(--line)); }
.scoretable td.top { color: var(--sun); font-weight: 600; }
.scoretable tfoot td, .scoretable tfoot th { font-size: 1.05rem; font-weight: 700; color: var(--ink); border-bottom: 0; border-top: 2px solid var(--line); }
.place { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 6px; border-radius: 50%; background: var(--pc); color: #071022; font-family: var(--font-mono); font-size: 0.75rem; }
.scorechart { margin: 0; }
.scorechart svg { width: 100%; height: auto; display: block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.scorechart text { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.scorechart .gridline { stroke: var(--line); stroke-width: 1; }
.scorechart figcaption { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 8px; font-size: 0.82rem; }
/* The score table gets the full width; the chart sits beneath it. */
.finalgrid { grid-template-columns: minmax(0, 1fr) !important; }
.scorechart { max-width: 820px; }

/* ---- resources: one tile each, the icon and income on top, the amount underneath ---- */
.res { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 4px 8px 3px; min-width: 50px; line-height: 1; background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--line); border-radius: 8px; font-family: var(--font-mono); white-space: nowrap; }
.res-top { display: flex; align-items: center; gap: 4px; min-height: 20px; }
.res .ico, .hud .res .ico { width: 20px; height: 20px; margin: 0; vertical-align: 0; }
.res-inc { font-size: 0.8rem; color: var(--muted); }
.res b, .hud .res b { font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.res small { font-size: 0.7rem; font-weight: 400; color: var(--muted); }
.resrow { display: flex; gap: 3px; margin-bottom: 4px; }
.resrow .res { flex: 1 1 0; min-width: 0; padding: 3px 4px 2px; }
.resrow .res-top { gap: 2px; }
.resrow .res-inc { font-size: 0.72rem; }
.resrow .res .ico { width: 16px; height: 16px; }
.resrow .res b { font-size: 0.95rem; }
.resrow .res-top { min-height: 16px; }
.hud { gap: 6px 8px; }
@media (max-width: 520px) { .hud { padding: 6px 8px; gap: 5px 5px; } .hud .res { min-width: 42px; padding: 3px 5px 2px; } .hud .res b { font-size: 1.05rem; } }
.res-label { font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); line-height: 20px; }
.resrow .res-label { font-size: 0.55rem; line-height: 16px; }

/* Completed missions: a stamp across the card. */
.stamped { position: relative; display: inline-block; align-self: flex-start; max-width: 100%; }
.stamped.done > .card, .stamped.done > .chip { filter: grayscale(0.55) brightness(0.72); }
.stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-18deg); padding: 3px 8px; border: 2px solid #7fe0a6; border-radius: 6px; color: #7fe0a6; background: rgba(8, 18, 30, 0.82); font-weight: 800; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
/* A player's name opens the cards they have played. */
.namebtn { all: unset; cursor: pointer; font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 4px; }
.namebtn:hover, .namebtn:focus-visible { text-decoration-style: solid; }
.namebtn:focus-visible { outline: 2px solid var(--pc, #9bb4ff); outline-offset: 3px; border-radius: 4px; }
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(4, 8, 16, 0.72); display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.overlay .sheet { width: min(760px, 100%); border-left: 4px solid var(--pc, #9bb4ff); margin: 0; }
.overlay .sheet h3 { margin: 14px 0 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }

/* Techs that upgrade a main action, on its button. */
.mains .btn .ups { display: flex; flex-wrap: wrap; gap: 3px 4px; margin-top: 4px; }
.mains .btn .up { font-size: 0.62rem; font-weight: 500; line-height: 1.2; padding: 1px 5px; border-radius: 999px; border: 1px dashed currentColor; opacity: 0.5; white-space: nowrap; }
.mains .btn .up.on { border-style: solid; opacity: 1; font-weight: 700; background: rgba(127, 224, 166, 0.22); }
.mains .btn:disabled .up.on { color: #7fe0a6; opacity: 1; }
/* Tucked income cards on a player's card. */
.tucked { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; grid-column: 1 / -1; flex-basis: 100%; white-space: nowrap; }
.tucked .tk { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.tucked .tk .ico, .tucked .tk svg, .tucked .tk img { width: 14px; height: 14px; }

/* Amoeba organelles on the ring and Glyphid tokens on the board. */
.sampletoken.organelle { width: 15%; background: #fffdf4; border-color: #6b7280; font-size: 0.7rem; }
.glyphtoken { position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; justify-content: center; width: 12%; aspect-ratio: 1; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); color: #10151f; font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700; line-height: 1; text-transform: uppercase; }

.glyphtoken.inline { position: static; transform: none; width: 22px; flex: none; vertical-align: middle; }
.planet-pic .glyphtoken { width: 15%; filter: drop-shadow(0 1px 3px #000c); }
.strips { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0; }
.strip { display: flex; gap: 4px; justify-content: center; }
.strip-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 46px; padding: 4px 5px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; }
.strip-cell.known { border-color: #7fe0a6; }
.strip-cell.locked { opacity: 0.45; border-style: dashed; }
.strip-gives { display: inline-flex; align-items: center; gap: 2px; min-height: 16px; }
.strip-gives .ico { width: 14px; height: 14px; }
.strip-gives small { font-size: 0.58rem; font-weight: 500; text-align: center; line-height: 1; }
.strip-empty { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px dashed currentColor; opacity: 0.6; }

/* Probes are small satellites: hovering your own must not repaint the dish like a board cell. */
.solar g.go:hover path { fill: #eef3fb; }

/* Phone layout (up to 700 px wide): the table in tabs, one group of panels at a time. On wider screens a section is invisible to the layout. */
.tabsec { display: contents; }
.game.tabbed { --tabh: calc(54px + env(safe-area-inset-bottom, 0px)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; gap: 2px; overflow-x: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--panel); border-top: 1px solid var(--signal); box-shadow: 0 -8px 24px #000b; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbtn { flex: 1 0 auto; min-height: 42px; padding: 6px 7px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; cursor: pointer; white-space: nowrap; }
.tabbtn.on { background: var(--panel-2); border-color: var(--line); color: var(--ink); font-weight: 600; }
.tabbtn.asking { color: var(--ink); }
.tabbtn:focus-visible { outline: 2px solid var(--sun); outline-offset: 1px; }
/* The hand opens from the button in the status bar and sits above the tabs; there is no bar while it is closed. */
.game.tabbed .tray { bottom: var(--tabh); z-index: 44; }
.game .tray:not(.open) { display: none; }
.game.tabbed .tray-space, .game.tabbed .tray-space.open { height: calc(var(--tabh) + 12px); }
.handbtn { white-space: nowrap; }
.game.tabbed .handbtn { margin-left: auto; }
.game:not(.tabbed) .tray-space:not(.open) { height: 0; }
.handbtn.on { box-shadow: inset 0 0 0 2px var(--sun); }
.game.tabbed .table { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin-inline: auto; }
.game.tabbed .table > .col { display: contents; }
.game.tabbed .table .tabsec { display: flex; flex-direction: column; gap: 12px; }
.game.tabbed .table[data-active="turn"] .tabsec:not([data-tab="turn"]) { display: none; }
.game.tabbed .table[data-active="board"] .tabsec:not([data-tab="board"]) { display: none; }
.game.tabbed .table[data-active="planets"] .tabsec:not([data-tab="planets"]) { display: none; }
.game.tabbed .table[data-active="species"] .tabsec:not([data-tab="species"]) { display: none; }
.game.tabbed .table[data-active="players"] .tabsec:not([data-tab="players"]) { display: none; }
.game.tabbed .table[data-active="cards"] .tabsec:not([data-tab="cards"]) { display: none; }
.game.tabbed .table[data-active="you"] .tabsec:not([data-tab="you"]) { display: none; }
.game.tabbed .table[data-active="tech"] .tabsec:not([data-tab="tech"]) { display: none; }
.game.tabbed .table[data-active="log"] .tabsec:not([data-tab="log"]) { display: none; }

/* The title is the way back to the New game page. */
.brand h1 a.home { color: inherit; text-decoration: none; }
.brand h1 a.home:hover { text-decoration: underline; text-underline-offset: 6px; }
.brand h1 a.home:focus-visible { outline: 2px solid var(--sun); outline-offset: 4px; border-radius: 4px; }

/* A question that is answered by tapping the board. */
.boardask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--sun); border-radius: 8px; background: color-mix(in srgb, var(--sun) 12%, transparent); font-size: 0.85rem; }

/* Phone layout: the hand opens and closes from the button in the status bar, so its own bar is only a heading. */
.game .tray-bar { pointer-events: none; cursor: default; }
.game .tray-bar .muted { display: none; }

/* Wide screens: three columns (board | your turn and your own things | players, cards, tech, log) using the full width. */
@media (min-width: 1500px) {
  .wrap:has(.game) { max-width: 1880px; }
  .table { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 0.9fr); grid-template-rows: auto; }
  .turnbox { grid-column: 2; grid-row: 1; }
  .boardcol { grid-column: 1; grid-row: 1; }
  .sidecol { grid-column: 3; grid-row: 1; }
  .tray-body { max-width: 1880px; }
}

/* "1/2" beside a question that is one of several identical choices in a row */
.step-pill { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent, #e8b84a); color: #111; font-size: 12px; font-weight: 700; vertical-align: middle; }

/* Scanning: the card row shown under the scan buttons, and sectors that can be tapped for a signal */
.scanrow { flex-basis: 100%; margin-top: 8px; }
.sectorpick { cursor: pointer; }
.sectorpick .slice { fill: var(--sun); fill-opacity: 0.1; stroke: var(--sun); stroke-opacity: 0.5; stroke-width: 1.5; }
.sectorpick .rim { fill: var(--sun); fill-opacity: 0.28; stroke: var(--sun); stroke-width: 3; animation: sectorglow 1.2s ease-in-out infinite alternate; }
.sectorpick:hover .slice { fill-opacity: 0.22; }
@keyframes sectorglow { from { fill-opacity: 0.12; } to { fill-opacity: 0.4; } }

/* Triggered missions: a circle over each space already filled (on the card art), or dots under the card */
.slotdone { position: absolute; width: 25%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #7fe0a6; background: rgba(8, 18, 30, 0.72); box-shadow: 0 0 6px rgba(127, 224, 166, 0.8); pointer-events: none; }
.slotdone::after { content: "\2713"; position: absolute; inset: 0; display: grid; place-items: center; color: #7fe0a6; font-weight: 800; font-size: 13px; line-height: 1; }
.slotdots { display: inline-flex; gap: 3px; margin-right: 5px; vertical-align: middle; }
.slotdots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #7fe0a6; }
.slotdots i.on { background: #7fe0a6; }

/* Reminder that a mission can be completed, and the question asked before ending the turn without it */
.readynote { color: var(--sun); margin-top: 8px; }
.leaveask { margin-top: 10px; margin-bottom: 0; }

/* Under each gold tile: what it pays each player who marked it, as things stand */
.goldworth { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; padding-top: 4px; border-top: 1px dashed #a8862b88; font-size: 0.76rem; }
.goldworth .pip { margin: 0 5px 0 0; vertical-align: middle; }
.goldworth b { color: var(--s-yellow); font-family: inherit; }

/* Previewing coming rotations: a quicker turn, and a dashed frame so it is not mistaken for the real board */
.solar .probefig { transition: transform 0.9s cubic-bezier(0.3, 0.1, 0.2, 1); }
.solar.previewing .disc, .solar.previewing .fadeable, .solar.previewing .probefig { transition: transform 1.3s cubic-bezier(0.45, 0, 0.3, 1); }
.solar.previewing { outline: 2px dashed var(--sun); outline-offset: 4px; border-radius: 50%; }

/* Account forms and public score tables fit the phone lobby. */
.field label input { display: block; width: 100%; margin-top: 6px; }
.panel table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.panel th, .panel td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line, #26334b); }

@media (max-width: 700px) {
  .discpick { gap: 4px; }
  .discpick .btn.sm { padding-inline: 7px; }
}

/* The schedule controls may wrap together with their step label on a phone. */
.schedule-preview { flex-wrap: wrap; white-space: normal; }
.preview-step { font-size: 0.8rem; }

/* Each marker stands alone over the track; no grey strip or slot panel. */
.sector-token, .sector-marker circle { filter: drop-shadow(0 1px 1px #000a); }
.sector-token image { filter: grayscale(1) brightness(1.35); }
.species-pic { margin-bottom: 32px; }
.species-pic.back { max-width: 150px; margin-bottom: 24px; }
.discovery-traces.on-art { position: absolute; inset: 0; pointer-events: none; }
.discovery-traces.on-art .trace { position: absolute; width: 18%; height: auto; aspect-ratio: 1; transform: translate(-50%, -50%); background: var(--panel-2); box-shadow: 0 1px 3px #000b; pointer-events: auto; }
.discovery-traces.on-art .pip { width: 72%; height: 72%; border: 1px solid #fff8; }
