/* Deep Frontiers: TV stage, boards, phone, splash. Sonar-chart palette:
   cyan line work on deep navy, warm amber for goods, violet for the Ancients. */
:root {
  --bg: #04121f; --bg2: #071c2e; --panel: rgba(6, 26, 43, .86); --line: rgba(127, 232, 255, .22);
  --ink: #dff6f8; --dim: #7ea6b2; --glow: #4fe3d1; --amber: #ffb547; --nod: #a9b6bf;
  --anc: #b57dff; --anc2: #6b3fd1; --danger: #ff5d6c; --ok: #5ad68e;
  --coral: #ff7a5f; --kelp: #5ad68e; --brass: #f2b84b;
  --display: "Chakra Petch", "Oxanium", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.35 var(--body); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: var(--ink); background: #0d2c42; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
button.primary { background: var(--glow); color: #02202a; border-color: var(--glow); font-weight: 800; }
button:disabled { opacity: .45; cursor: default; }
button.ghost { background: transparent; }
input, select { font: inherit; color: var(--ink); background: #061a2b; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.dim, .tagg { color: var(--dim); }
.none { color: var(--dim); font-style: italic; opacity: .8; }

/* ---- kit shell bits (join, lobby, toast, conn) ---- */
#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 220px); max-width: 92vw; background: #ffe2b0; color: #2a1800;
  padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 2000; transition: transform .25s; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#toast.show { transform: translate(-50%, 0); }
#conn { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--danger); color: #fff; padding: 4px 12px; border-radius: 8px; display: none; z-index: 2001; font-size: 14px; }
#conn.show { display: block; }
.join, .lobbyv { max-width: 480px; margin: 0 auto; padding: 28px 18px; display: grid; gap: 14px; }
.join h1, .lobbyv h1 { font-family: var(--display); font-weight: 700; margin: 0; color: var(--glow); }
.join input { font-size: 20px; padding: 14px; }
.join button, .lobbyv button { font-size: 17px; padding: 14px; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; } .btnrow button { flex: 1; }
.seat-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin: 6px 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.hint { color: var(--dim); font-size: 14px; }
.lobby { display: grid; grid-template-columns: 1fr auto; gap: 40px; padding: 40px; }
.lobby .qr svg { width: 340px; height: 340px; }

/* ---- shared glyphs ---- */
.ico { display: inline-block; vertical-align: -2px; margin-right: 3px; }
.ico.cell { width: .62em; height: 1em; border-radius: 3px; background: linear-gradient(#ffd27a, var(--amber)); box-shadow: 0 0 6px rgba(255,181,71,.6); }
.ico.nod { width: .95em; height: .95em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e7eef2, #6f7f8a); }
.gd { display: inline-flex; align-items: center; gap: 2px; margin-right: 10px; white-space: nowrap; }
.die { --d: 3.6cqw; width: var(--d); height: var(--d); border-radius: 22%; display: inline-block; flex: none; position: relative;
  background: #ddd; box-shadow: inset 0 -.12em .2em rgba(0,0,0,.25), 0 .08em .2em rgba(0,0,0,.45); }
.die svg { width: 100%; height: 100%; display: block; fill: #0c1c26; }
.die.c-coral { background: var(--coral); } .die.c-kelp { background: var(--kelp); } .die.c-brass { background: var(--brass); }
.die.c-abyss { background: linear-gradient(150deg, #3a1d63, #170a2b); box-shadow: 0 0 .5em rgba(181,125,255,.75), inset 0 0 0 .1em rgba(205,170,255,.7); }
.die.c-abyss svg { fill: #e6d2ff; }
.die.c-relic { background: linear-gradient(150deg, #f6feff, #a9e6f2); box-shadow: 0 0 .5em rgba(127,232,255,.7), inset 0 0 0 .14em var(--ring, #4fc3d8); }
.die.c-relic.anc { background: linear-gradient(150deg, #e8dcff, #9c7ad8); }
.die.sm { --d: 2.4cqw; }
.die.sel { transform: translateY(-6px); box-shadow: 0 0 0 3px #fff, 0 0 14px 4px var(--glow); }
.port { --d: 3.6cqw; width: var(--d); height: var(--d); border-radius: 22%; display: inline-block; flex: none; border: .2cqw dashed rgba(191,233,239,.32); }
.pod { display: inline-flex; align-items: center; gap: .15em; }
.pod i { width: 1em; height: 1.15em; display: inline-block; border-radius: 45% 45% 30% 30%; background: currentColor; box-shadow: inset 0 -.15em .15em rgba(0,0,0,.3), 0 0 .3em rgba(0,0,0,.4); }
.pod b { font-weight: 800; }
.pod.c-coral { color: var(--coral); } .pod.c-kelp { color: var(--kelp); } .pod.c-brass { color: var(--brass); } .pod.c-abyss { color: var(--anc); }
.pod.c-none { color: rgba(191,233,239,.18); } .pod.empty i { background: transparent; box-shadow: inset 0 0 0 2px rgba(191,233,239,.3); }
.pod b { color: var(--ink); }
.track { display: inline-flex; gap: 3px; align-items: center; }
.track i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(191,233,239,.3); }
.track i.on { background: color-mix(in srgb, var(--pc) 45%, transparent); border-color: var(--pc); }
.track i.pod { background: var(--pc); box-shadow: 0 0 8px var(--pc); }
.track i:last-child { border-radius: 3px; }
img.art { display: block; }

/* ---- boards (sized in container units so the same markup fits the TV and a phone) ---- */
.board { position: relative; container-type: inline-size; width: 100%; overflow: hidden; border-radius: 16px; }
.board-bg { position: absolute; inset: 0; overflow: hidden; }
.board-bg.sonar { background: radial-gradient(circle at 50% 50%, rgba(79,227,209,.18), transparent 46%),
  repeating-radial-gradient(circle at 50% 50%, transparent 0 4.6cqw, rgba(127,232,255,.10) 4.6cqw 4.75cqw),
  linear-gradient(rgba(127,232,255,.05) 1px, transparent 1px) 0 0 / 4cqw 4cqw, linear-gradient(90deg, rgba(127,232,255,.05) 1px, transparent 1px) 0 0 / 4cqw 4cqw, #0a2440; }
.board-bg img.bgimg { position: absolute; max-width: none; }
.crater .board-bg img { filter: saturate(.9) brightness(.92); }
.zone { position: absolute; transform: translate(-50%, -50%); width: 22cqw; padding: .7cqw .8cqw; text-align: center; border-radius: 1.6cqw;
  background: rgba(3, 17, 30, .66); border: .3cqw solid rgba(127,232,255,.28); backdrop-filter: blur(1px); transition: box-shadow .3s, border-color .3s; }
.zone[style*="--ctrl"] { border-color: var(--ctrl); box-shadow: 0 0 1.6cqw color-mix(in srgb, var(--ctrl) 55%, transparent); }
.zone .zn { font: 700 2.55cqw/1.05 var(--display); letter-spacing: .02em; color: #f0feff; }
.zone .zb { font-size: 1.75cqw; color: #9fd3dc; margin-top: .2cqw; }
.zone .zb s { color: #d2b48c; text-decoration: none; }
.zone .zp { display: flex; gap: .9cqw; justify-content: center; flex-wrap: wrap; margin-top: .5cqw; font-size: 2.7cqw; min-height: 3cqw; }
.zone .zp .none { font-size: 1.6cqw; }
.zone .zc { font-size: 1.6cqw; color: var(--ctrl); font-weight: 800; margin-top: .2cqw; }
.zone .zf { display: flex; gap: .5cqw; justify-content: center; margin-top: .4cqw; }
.zone .zpool { display: flex; gap: .4cqw; justify-content: center; margin-top: .5cqw; }
.zone.cd { width: 24cqw; background: rgba(28, 10, 46, .72); border-color: rgba(181,125,255,.45); }
.fld { font-size: 1.45cqw; font-weight: 800; padding: .2cqw .7cqw; border-radius: 99px; }
.fld.silt { background: #6b4f2a; color: #ffe7c2; } .fld.wall { background: #1f5fa8; color: #e4f1ff; }
.zone.silted { background-image: repeating-linear-gradient(135deg, rgba(160,120,60,.22) 0 .8cqw, transparent .8cqw 1.6cqw); }
.zone.walled { outline: .45cqw solid rgba(80,150,255,.8); outline-offset: .2cqw; }
.zone.hot, .plate.hot { animation: hot 1.1s ease-in-out infinite; z-index: 5; }
@keyframes hot { 0%, 100% { box-shadow: 0 0 0 .3cqw #fff, 0 0 3cqw 1cqw var(--glow); } 50% { box-shadow: 0 0 0 .5cqw #fff, 0 0 5cqw 2cqw var(--glow); } }
.stage.ancients .zone.hot, .stage.ancients .plate.hot { animation-name: hotanc; }
@keyframes hotanc { 0%, 100% { box-shadow: 0 0 0 .3cqw #f2e6ff, 0 0 3cqw 1cqw var(--anc); } 50% { box-shadow: 0 0 0 .5cqw #f2e6ff, 0 0 6cqw 2.4cqw var(--anc); } }

.plate { position: absolute; transform: translate(-50%, -50%); padding: .6cqw .8cqw .8cqw; text-align: center; border-radius: 1.3cqw;
  background: rgba(3, 14, 26, .8); border: .22cqw solid rgba(127,232,255,.32); }
.plate.ancient { border-color: rgba(181,125,255,.6); }
.plate .pn { font: 700 1.75cqw/1.05 var(--display); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.plate .pr { font-size: 1.2cqw; color: #8fc2cc; white-space: nowrap; margin: .15cqw 0 .45cqw; }
.plate .pp { display: flex; flex-wrap: wrap; gap: .45cqw; justify-content: center; margin: 0 auto; max-width: calc(var(--cols) * 4.1cqw + 1.4cqw); }
.plate .pp .none { font-size: 1.3cqw; }
.plate .slot { display: inline-flex; gap: .3cqw; padding: .25cqw; border: .15cqw dashed rgba(255,255,255,.22); border-radius: .9cqw; }
.plate .pp.bell { max-width: none; flex-direction: column; gap: .35cqw; }
.plate .bellrow { display: flex; align-items: center; gap: .6cqw; }
.plate .bellrow .track i { width: 1.3cqw; height: 1.3cqw; border-width: .2cqw; }
.plate.p-DIVEBELL { background: rgba(3, 14, 26, .86); }
.plate .pp.bell .die, .plate .pp.bell .port { --d: 3.1cqw; }
.plate.p-DRYDOCK { background: rgba(10, 22, 34, .7); border-style: dashed; }
.plate.p-DRYDOCK .pp { max-width: calc(var(--cols) * 4.1cqw + 1.4cqw); min-width: 10cqw; }

/* ---- the Deep Heart, display, crew, clocks (TV px; the phone sheet reuses them) ---- */
.heart { display: grid; gap: 6px; }
.heart .row2h { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.heart .row2h .track i { width: 13px !important; height: 13px !important; }
.heart .hd { display: flex; gap: 12px; align-items: center; }
.heart .portrait { width: 52px; height: 66px; object-fit: cover; border-radius: 10px; border: 2px solid var(--anc); box-shadow: 0 0 16px rgba(181,125,255,.5); }
.heart .ttl { font: 700 26px/1 var(--display); color: #e8d9ff; }
.heart .sub { color: #a99ccf; font-size: 14px; }
.heart .row { padding: 4px 10px 6px; border-radius: 12px; background: rgba(30, 14, 52, .5); border: 1px solid rgba(181,125,255,.25); transition: box-shadow .3s; }
.heart .row.hot { animation: hotanc2 1.1s ease-in-out infinite; }
@keyframes hotanc2 { 0%, 100% { box-shadow: 0 0 0 2px #f2e6ff, 0 0 18px 4px var(--anc); } 50% { box-shadow: 0 0 0 3px #f2e6ff, 0 0 30px 8px var(--anc); } }
.heart .row.danger { border-color: var(--danger); background: rgba(70, 14, 30, .55); }
.heart .lbl { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.heart .lbl b { font-family: var(--display); letter-spacing: .04em; text-transform: uppercase; color: #d7c4ff; }
.heart .lbl span { font: 700 22px var(--display); } .heart .lbl small { font-size: 14px; color: var(--dim); }
.heart .note { color: #a99ccf; font-size: 12px; margin-top: 2px; }
.trk { display: grid; grid-template-columns: repeat(var(--per), 1fr); gap: 3px; margin-top: 4px; }
.trk i { height: 13px; border-radius: 3px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.trk.pulse i.on { background: linear-gradient(#ffd27a, var(--amber)); border-color: #ffd27a; box-shadow: 0 0 6px rgba(255,181,71,.6); }
.trk.pulse i:nth-child(n+16) { border-color: rgba(255,93,108,.5); }
.trk.spire i { height: 16px; border-radius: 50%; } .trk.spire i.on { background: radial-gradient(circle at 35% 30%, #e7eef2, #6f7f8a); }
.trk.apods i.on { background: var(--anc); border-color: #e2ccff; box-shadow: 0 0 6px var(--anc); }
.stack { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-top: 4px; }
.tech { font-size: 10.5px; text-align: center; padding: 4px 1px; border-radius: 4px; background: #3b2370; color: #efe4ff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tech.empty { background: rgba(255,255,255,.05); border: 1px dashed rgba(181,125,255,.3); }
.heart .pool { display: flex; gap: 5px; align-items: center; margin-top: 4px; --dsz: 26px; }
.heart .pool .die, .zone .zpool .die { --d: var(--dsz, 2.6cqw); }
.heart .row .track i { width: 16px; height: 16px; }

.display .dh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.display .dh b { font: 700 20px var(--display); text-transform: uppercase; letter-spacing: .05em; }
.display .dh span { color: var(--dim); font-size: 13px; }
.display .dcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.display.hot .gcard.first { animation: hotanc2 1.1s ease-in-out infinite; }
.display .dnote { color: var(--dim); font-size: 12.5px; margin-top: 6px; }
.gcard { border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, #183a52, #0b2133); border: 2px solid #c9a36a; box-shadow: 0 4px 12px rgba(0,0,0,.45); }
.gcard .gart { aspect-ratio: 3 / 4; position: relative; background: radial-gradient(circle at 50% 40%, #2c5c74, #0d2233); display: grid; place-items: center; }
.gcard .gart img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gcard .gfb { font: 700 28px var(--display); color: rgba(255,255,255,.5); }
.gcard .gname { font: 700 13px/1.15 var(--display); text-align: center; padding: 5px 4px 6px; background: #0b1d2b; color: #ffe8c2; min-height: 2.5em; display: grid; place-items: center; }
.gcard.k-ARCHIVE, .gcard.k-BEACON { border-color: var(--anc); }

.goal { padding: 4px 4px 10px; }
.goal .gl { display: flex; justify-content: space-between; align-items: baseline; }
.goal .gl b { font: 700 22px var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--glow); }
.goal .gl span { font: 700 36px var(--display); } .goal .gl small { font-size: 20px; color: var(--dim); }
.goal .gpods { display: flex; gap: 8px; font-size: 30px; margin: 4px 0; }
.goal .gt { color: #a8d5dc; font-size: 15px; }
.clocks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.clocks .ch { grid-column: 1 / -1; font: 700 15px var(--display); text-transform: uppercase; letter-spacing: .08em; color: #ffb3bb; }
.clock { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; }
.clock .cl { font-size: 13px; color: var(--dim); }
.clock .cv { font: 700 24px var(--display); } .clock .cv small { font-size: 13px; color: var(--dim); }
.clock .bar { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.clock .bar i { display: block; height: 100%; background: #7fb8c4; }
.clock.danger { border-color: var(--danger); background: rgba(90, 14, 28, .45); } .clock.danger .bar i { background: var(--danger); }
.fields { margin-top: 8px; font-size: 14px; color: #ffd9a8; }

.crewrow { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.crewrow.n1 { grid-template-columns: 1fr 1fr; } .crewrow.n2 { grid-template-columns: 1fr 1fr; }
.crew { border-radius: 12px; padding: 8px 11px; background: rgba(255,255,255,.035); border: 2px solid color-mix(in srgb, var(--pc) 35%, transparent); --d: 30px; }
.crew.turn { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--pc) 40%, transparent); }
.crew.off { opacity: .6; }
.crew .cn { display: flex; align-items: center; gap: 8px; font-size: 21px; } .crew .cn b { font-family: var(--display); }
.crew .cn .pod { font-size: 18px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.1); color: var(--dim); font-weight: 700; }
.tag.now { background: var(--pc); color: #10202b; }
.crew .cg { margin-top: 4px; font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; } .crew .cg .sm { font-size: 14px; color: var(--dim); }
.crew .cb { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--dim); margin-top: 4px; }
.crew .cc { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: 12.5px; padding: 2px 8px; border-radius: 6px; background: #213b50; border: 1px solid #c9a36a; color: #ffe8c2; }
.chip.k-ARCHIVE, .chip.k-BEACON { border-color: var(--anc); }
.crew .ch { display: flex; gap: 5px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--dim); }
.crew .die { --d: 30px; }

/* ---- the TV stage ---- */
body.tv { overflow: hidden; }
.stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden;
  background: radial-gradient(1200px 700px at 30% 30%, #0b2a44, transparent 70%), radial-gradient(900px 600px at 90% 90%, #1a0f35, transparent 70%), var(--bg); }
.stage.ancients { background: radial-gradient(1200px 700px at 30% 30%, #1d1540, transparent 70%), radial-gradient(900px 600px at 90% 90%, #2c1250, transparent 70%), #080a1c; }
.stage > .panel { position: absolute; }
.panel .ph { font: 700 15px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 6px; }
#hdr { position: absolute; left: 0; top: 0; width: 1920px; height: 76px; display: flex; align-items: center; gap: 26px; padding: 0 22px;
  background: linear-gradient(rgba(2,10,18,.9), rgba(2,10,18,.55)); border-bottom: 1px solid var(--line); }
#hdr .brand { font: 600 30px var(--display); letter-spacing: .12em; text-transform: uppercase; color: #9fe9f0; }
#hdr .brand b { color: var(--glow); }
#hdr .round { font: 700 22px var(--display); color: var(--dim); }
#hdr .turn { display: flex; align-items: center; gap: 14px; flex: 1; justify-content: center; min-width: 0; }
#hdr .who { font: 700 34px var(--display); color: var(--pc, var(--ink)); display: inline-flex; align-items: center; gap: 12px; }
#hdr .who .dot, .endcrew .dot { width: 20px; height: 20px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 14px var(--pc); display: inline-block; }
#hdr .who.anc { color: #e2ccff; text-shadow: 0 0 18px var(--anc); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { text-shadow: 0 0 32px var(--anc), 0 0 8px #fff; } }
#hdr .pend { color: var(--amber); font-size: 20px; }
#hdr .joinat { font-size: 18px; color: var(--dim); white-space: nowrap; flex: none; } #hdr .joinat .code { font: 700 30px var(--display); letter-spacing: .18em; color: var(--glow); margin-left: 4px; }
#hdr button { font-size: 18px; padding: 6px 16px; border-color: var(--anc); color: #e2ccff; }
body.desk #hdr .joinatat { display: none; }
#crater { left: 16px; top: 86px; width: 600px; }
#clocks { left: 16px; top: 702px; width: 600px; height: 228px; }
#rig { left: 630px; top: 86px; width: 880px; }
#crew { left: 630px; top: 708px; width: 880px; height: 222px; }
#heart { left: 1524px; top: 86px; width: 380px; }
#display { left: 1524px; top: 640px; width: 380px; }
#caption { position: absolute; left: 16px; top: 940px; width: 1888px; height: 126px; }
.cap { height: 100%; display: flex; align-items: center; gap: 26px; padding: 12px 28px; border-radius: 18px; border: 2px solid rgba(181,125,255,.6);
  background: linear-gradient(90deg, rgba(55, 24, 100, .92), rgba(22, 10, 44, .9)); box-shadow: 0 0 40px rgba(181,125,255,.35); }
.cap.live { animation: capin .35s ease-out; }
@keyframes capin { from { transform: translateY(14px); opacity: .2; } to { transform: none; opacity: 1; } }
.cap.dim { opacity: .72; box-shadow: none; }
.cap.banner { border-color: var(--glow); background: linear-gradient(90deg, rgba(12, 60, 80, .92), rgba(8, 26, 44, .9)); }
.cap .badge { flex: none; font: 700 18px var(--display); text-transform: uppercase; letter-spacing: .08em; color: #1a0b33; background: #d8c0ff; padding: 8px 16px; border-radius: 99px; }
.cap.banner .badge { background: var(--glow); color: #02202a; }
.cap .txt { flex: 1; min-width: 0; }
.cap .cause { font-size: 24px; color: #cdb8f5; } .cap .cause .arw { color: #fff; font-weight: 800; }
.cap .effect { font: 700 36px/1.15 var(--display); color: #fff; }
.cap.banner .effect { font-size: 44px; }
#capbody { height: 100%; }
#capmore { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); font: 700 20px var(--display); color: #d8c0ff; }
#caption .log { height: 100%; padding: 10px 26px; border-radius: 18px; background: rgba(4, 20, 34, .8); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
#caption .log div { font-size: 20px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#caption .log div.new { font-size: 27px; color: var(--ink); font-weight: 700; }
#over { position: absolute; inset: 0; pointer-events: none; z-index: 50; }
.endscreen { position: absolute; inset: 0; pointer-events: auto; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #12425a, #04121f 70%); }
.endscreen.loss { background: radial-gradient(circle at 50% 40%, #3a1044, #090412 70%); }
.endscreen .endart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.endcard { position: relative; width: 980px; padding: 40px 54px; border-radius: 26px; text-align: center; background: rgba(3, 14, 26, .82); border: 2px solid var(--glow); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.endscreen.loss .endcard { border-color: var(--anc); }
.endcard .kicker { font: 700 22px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.endcard h1 { font: 700 72px/1.05 var(--display); margin: 10px 0 14px; color: var(--glow); }
.endscreen.loss .endcard h1 { color: #e2ccff; }
.endcard p { font-size: 26px; margin: 0 0 18px; }
.endstats, .endcrew { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-size: 20px; color: #bfe3ea; margin: 8px 0; }
.endcrew span { display: inline-flex; align-items: center; gap: 8px; }
.endbtns { display: flex; gap: 16px; justify-content: center; margin-top: 22px; } .endbtns button { font-size: 24px; padding: 14px 30px; }
.endnote { color: var(--dim); margin-top: 14px; font-size: 16px; }
.atr .df-note { display: flex; flex-direction: column; align-items: center; gap: .8vh; }
.atr .df-note .opts { display: flex; gap: 1vw; font-size: .95vw; color: #cfeff3; align-items: center; }
.atr .df-note select { font-size: .9vw; padding: .15em .4em; }
.atr .df-note .buttons { display: flex; gap: .7vw; } .atr .df-note .buttons button { font-size: 1vw; padding: .35em 1.1em; }

/* ---- the phone ---- */
body.phone { min-height: 100dvh; background: radial-gradient(500px 400px at 20% 0%, #0d3350, transparent 70%), var(--bg); }
#cs-pill { top: max(8px, env(safe-area-inset-top)) !important; bottom: auto !important; right: 8px !important; padding: 6px 12px !important; font-size: 14px !important; }
.ph-app { max-width: 560px; margin: 0 auto; padding: 8px 10px calc(140px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.ph-top { display: flex; align-items: center; gap: 10px; padding: 6px 4px; padding-right: 86px; }
.ph-top .me { display: flex; align-items: center; gap: 8px; font: 700 19px var(--display); min-width: 0; }
.ph-top .me span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-top .me .pod { font-size: 20px; }
.ph-top .rd { color: var(--dim); font-size: 14px; white-space: nowrap; }
.ph-res { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center; font-size: 19px; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.ph-res .sp { flex: 1; } .ph-res .sm { font-size: 14px; color: var(--dim); }
.ph-status { padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 17px; }
.ph-status.myturn { border-color: var(--pc); box-shadow: 0 0 18px color-mix(in srgb, var(--pc) 35%, transparent); }
.ph-status h2 { margin: 0 0 4px; font: 700 22px var(--display); color: var(--pc, var(--ink)); }
.ph-status .sub { color: var(--dim); font-size: 15px; }
.ph-status.anc { border-color: var(--anc); background: rgba(40, 16, 70, .8); }
.ph-status.anc h2 { color: #e2ccff; }
.ph-status .anccap { margin-top: 6px; font-size: 17px; } .ph-status .anccap .cause { color: #cdb8f5; font-size: 15px; }
.ph-err { padding: 10px 14px; border-radius: 12px; background: rgba(120, 20, 34, .85); border: 1px solid var(--danger); font-weight: 700; font-size: 16px; }
.ph-sec { padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.ph-sec > h3 { margin: 0 0 8px; font: 700 14px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); display: flex; justify-content: space-between; align-items: baseline; }
.ph-sec > h3 small { text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 600; }
.tray { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 6px 0 4px; }
.tray .die { --d: 62px; cursor: pointer; transition: transform .12s; }
.tray .empty { color: var(--dim); padding: 12px; }
.selhint { text-align: center; color: #bfe9ef; font-size: 15px; margin-top: 6px; min-height: 1.3em; }
.stgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.stbtn { text-align: left; padding: 8px 8px 7px; border-radius: 12px; background: #0a2236; border: 1.5px solid var(--line); min-height: 76px; display: flex; flex-direction: column; gap: 3px; --d: 15px; }
.stbtn .n { font: 700 14px/1.1 var(--display); }
.stbtn .r { font-size: 11.5px; color: var(--dim); line-height: 1.15; }
.stbtn .mini { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; }
.stbtn .mini .die, .stbtn .mini .port { --d: 15px; border-width: 1px; }
.stbtn .mini .slot { display: inline-flex; gap: 1px; padding: 1px; border: 1px dashed rgba(255,255,255,.2); border-radius: 4px; }
.stbtn.legal { border-color: var(--glow); background: #0c3446; box-shadow: 0 0 10px rgba(79,227,209,.35); }
.stbtn.legal .n { color: #bffcf4; }
.stbtn.fit { border-color: #fff; background: #11506a; box-shadow: 0 0 14px rgba(79,227,209,.55); }
.stbtn.nope { opacity: .45; }
.stbtn .opts { font-size: 11.5px; color: #9ff0e4; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.acts button { flex: 1 1 45%; padding: 12px 10px; font-weight: 700; font-size: 15px; background: #11344a; border-color: rgba(79,227,209,.5); }
.acts button.primary { background: var(--glow); color: #02202a; border-color: var(--glow); }
.hand { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.hand .gcard { flex: 0 0 104px; scroll-snap-align: start; cursor: pointer; }
.hand .gcard .gname { font-size: 12px; }
.hand .gcard.used { opacity: .5; }
.endbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(2,10,18,.95) 30%); }
.endbar .inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.endbar button { width: 100%; font-size: 20px; padding: 15px; border-radius: 14px; font-weight: 800; }
.endbar button.blocked { background: #2a3440; color: #c9d4dc; border-color: #4a5866; }
.endbar .why { text-align: center; color: #ffd08a; font-size: 14px; }
.others { display: grid; gap: 6px; }
.others .crew { --d: 22px; } .others .crew .cn { font-size: 17px; } .others .crew .cg { font-size: 16px; }
.sheet[hidden] { display: none !important; }
.sheet { position: fixed; inset: 0; z-index: 1500; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; }
.sheet .panel2 { width: 100%; max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  background: #0b1f30; border-top: 2px solid var(--glow); box-shadow: 0 -10px 30px rgba(0,0,0,.5); }
.sheet h2 { margin: 0 0 4px; font: 700 22px var(--display); }
.sheet .q { color: #bfe3ea; margin-bottom: 10px; font-size: 15px; }
.sheet .opts { display: grid; gap: 8px; }
.sheet .opts button { text-align: left; padding: 13px 14px; font-size: 16px; display: flex; align-items: center; gap: 10px; --d: 28px; }
.sheet .opts button .die { --d: 28px; }
.sheet .opts button.on { border-color: #fff; background: #11506a; }
.sheet .opts button small { color: var(--dim); margin-left: auto; text-align: right; }
.sheet .row2 { display: flex; gap: 8px; margin-top: 12px; } .sheet .row2 button { flex: 1; padding: 14px; font-size: 17px; }
.sheet .cardbig { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; margin-bottom: 8px; }
.sheet .cardbig p { margin: 0 0 8px; } .sheet .cardbig b { color: var(--amber); }
.sheet .zlist button .zbon { display: block; font-size: 12.5px; color: var(--dim); }
.sheet .zlist button .pods { display: inline-flex; gap: 6px; margin-left: auto; }
.step { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 15px; }
.step .ctl { display: flex; align-items: center; gap: 8px; } .step .ctl button { width: 44px; height: 40px; padding: 0; font-size: 22px; } .step .ctl b { min-width: 1.5em; text-align: center; font-size: 19px; }
.seg { display: flex; gap: 6px; margin-bottom: 10px; } .seg button { flex: 1; padding: 10px; } .seg button.on { background: var(--glow); color: #02202a; font-weight: 800; }
.ph-end { text-align: center; padding: 18px 12px; border-radius: 16px; background: var(--panel); border: 2px solid var(--glow); }
.ph-end.loss { border-color: var(--anc); }
.ph-end h2 { font: 700 30px var(--display); margin: 6px 0; } .ph-end img.art { width: 100%; border-radius: 12px; margin-bottom: 8px; }
.takeseat { max-width: 480px; margin: 0 auto; padding: 28px 18px; display: grid; gap: 12px; }
.takeseat h1 { font: 700 26px var(--display); color: var(--glow); margin: 0; }
.takeseat button { font-size: 17px; padding: 14px; text-align: left; }
.minib { display: grid; gap: 10px; } .minib .heart .row { padding: 5px 8px; }
#cs-sheet .board { border-radius: 10px; }

/* ---- splash ---- */
body.splash { background: radial-gradient(900px 600px at 20% 0%, #0d3350, transparent 70%), radial-gradient(700px 500px at 100% 100%, #1a0f35, transparent 70%), var(--bg); }
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 64px; }
.hero { position: relative; border-radius: 22px; overflow: hidden; min-height: 300px; display: flex; align-items: flex-end; background: linear-gradient(160deg, #0c3550, #110b2c); border: 1px solid var(--line); }
.hero img.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.hero .in { position: relative; padding: 28px; background: linear-gradient(transparent, rgba(2,10,18,.9) 45%); width: 100%; }
.hero h1 { font: 700 60px/1 var(--display); margin: 0; letter-spacing: .04em; color: #e9fdff; text-shadow: 0 0 30px rgba(79,227,209,.5); }
.hero .tag { font-size: 20px; color: #bfe9ef; margin-top: 6px; }
.cta { display: inline-block; margin: 16px 8px 0 0; background: var(--glow); color: #02202a; font-weight: 900; padding: 13px 22px; border-radius: 12px; text-decoration: none; font-size: 17px; }
.cta.alt { background: #ffffff18; color: var(--ink); }
.wrap section { background: rgba(6, 26, 43, .7); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin-top: 18px; }
.wrap section h2 { font: 700 22px var(--display); margin: 0 0 8px; color: var(--glow); }
.wrap section li { margin: 6px 0; }
.rooms .room { display: flex; justify-content: space-between; align-items: center; background: #0000002a; border-radius: 8px; padding: 10px 14px; margin: 8px 0; gap: 10px; }
.rooms .code { font: 700 22px var(--display); letter-spacing: 3px; color: var(--glow); } .rooms a { color: var(--glow); font-weight: 800; text-decoration: none; }
#rejoin { display: none; background: #0000003a; border-left: 4px solid var(--glow); border-radius: 8px; padding: 12px 16px; margin-top: 18px; }
#rejoin.show { display: block; } #rejoin a { color: var(--glow); }
.gearlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gearlist .g .gcard { margin-bottom: 6px; } .gearlist .g p { font-size: 13px; margin: 0; color: #bfe3ea; }
footer { margin-top: 28px; color: var(--dim); font-size: 13px; }
