/* 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; }
.figure.lander { border-radius: 4px; }
.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: wrap; }

/* 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.sq { border-radius: 5px; }
.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; }
