@import url("fonts/fonts.css");
/* Phone controller. --c is the player's color once seated. */
:root {
  --bg: #12131B; --panel: #1C1E2A; --line: #2E3142; --fg: #E9E6F0; --muted: #9A97AC; --accent: #E2714F; --c: #E2714F;
  --display: "Big Shoulders Display", "DIN Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: -apple-system, system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.45 var(--body); -webkit-tap-highlight-color: transparent }
#app { max-width: 520px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); display: grid; gap: 14px }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; margin: 0; line-height: 1 }
h1 { font-size: 42px; color: var(--accent) }
h1 small { display: block; font-size: 16px; color: var(--muted); letter-spacing: .14em }
h2 { font-size: 26px } h3 { font-size: 19px; letter-spacing: .04em; color: var(--muted) }
.center { text-align: center; display: grid; gap: 8px; justify-items: center }
.muted { color: var(--muted) } .small { font-size: 14px }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px }
input { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; width: 100% }
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
button { font: 600 17px var(--body); color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer }
button:disabled { opacity: .4; cursor: default }
button.primary { background: var(--c); border-color: var(--c); color: #12131B }
button.ghost { background: transparent }
button.danger { background: #8E2E1C; border-color: #8E2E1C }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px }
.swatch { display: grid; gap: 6px; justify-items: center; padding: 12px 6px; font-size: 14px }
.swatch i { width: 34px; height: 34px; border-radius: 50%; background: var(--s); box-shadow: 0 0 0 2px rgba(0,0,0,.4) inset }
.swatch.sel { border-color: var(--s); box-shadow: 0 0 0 2px var(--s) }
.seat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px }
.seat i { width: 18px; height: 18px; border-radius: 50%; background: var(--s) }
.seat span { flex: 1 }
.seat button { padding: 6px 10px; font-size: 14px }
.row { display: flex; gap: 10px } .row > * { flex: 1 }
.err { color: #FF9A80; font-size: 15px }
.me { display: flex; align-items: center; justify-content: space-between; border-left: 6px solid var(--c); padding-left: 12px }
.hand { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px }
.res { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; color: var(--muted) }
.res b { font: 700 26px var(--display); color: var(--fg) }
.res::before { content: ""; width: 18px; height: 20px; background: var(--r); clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%) }
.res.ice { --r: #8CC3E6 } .res.regolith { --r: #D08A55 } .res.iron { --r: #8F97AA } .res.silicon { --r: #E3C46E } .res.biomass { --r: #7DB36A }
details summary { color: var(--muted); cursor: pointer; padding: 6px 0 }
.minimap { width: 100%; height: auto; display: block; background: #0D0E14; border-radius: 10px; touch-action: manipulation }
.minimap .spot { cursor: pointer }
.minimap .spot .mark { fill: var(--c); stroke: none; opacity: .75; animation: pulse 1.1s ease-in-out infinite alternate }
.minimap .spot.sel .mark { opacity: 1; animation: none; stroke: #fff; stroke-width: .05 }
.minimap .spot line.mark { stroke: var(--c) }
@keyframes pulse { from { opacity: .35 } to { opacity: .9 } }
@media (prefers-reduced-motion: reduce) { .minimap .spot .mark { animation: none } }
button.big { font-size: 22px; padding: 20px; width: 100% }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px }
.rolled { font: 700 22px var(--display); color: var(--muted) }
.builds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.build { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 12px }
.build small { color: var(--muted); font-weight: 400; font-size: 12px }
.chips { display: flex; gap: 4px; flex-wrap: wrap }
.chip { display: inline-grid; place-items: center; min-width: 20px; height: 22px; padding: 0 4px; font: 700 12px var(--body); color: #12131B; background: var(--r); clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%) }
.chip.ice, .pill.ice { --r: #8CC3E6 } .chip.regolith, .pill.regolith { --r: #D08A55 } .chip.iron, .pill.iron { --r: #8F97AA } .chip.silicon, .pill.silicon { --r: #E3C46E } .chip.biomass, .pill.biomass { --r: #7DB36A }
.bank { display: grid; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line) }
.pills { display: flex; flex-wrap: wrap; gap: 6px }
.pill { --r: var(--c); padding: 8px 12px; font-size: 15px; border-left: 5px solid var(--r) }
.pill.sel { background: var(--r); color: #12131B; border-color: var(--r) }
.steprow { display: flex; justify-content: space-between; align-items: center }
.stepper { display: flex; align-items: center; gap: 12px }
.stepper button { width: 44px; height: 44px; padding: 0; font-size: 22px }
.stepper b { min-width: 24px; text-align: center; font: 700 22px var(--display) }
.minimap .spot polygon.mark { fill: none; stroke: var(--c) }
.minimap .spot.sel polygon.mark { fill: rgba(255,255,255,.18); stroke: #fff }
.energybar { display: flex; align-items: center; gap: 4px }
.energybar i { flex: 1; height: 12px; border-radius: 3px; background: var(--line) }
.energybar i.on { background: #F0A52A }
.energyrow { display: grid; gap: 6px }
.energyrow .muted { font-size: 14px }
.warn { color: #FFB199; font-size: 14px }
.victims { display: grid; gap: 8px }
.trade { display: grid; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line) }
.picker { display: grid; gap: 4px }
.secs { font: 700 24px var(--display); color: var(--accent); font-variant-numeric: tabular-nums }
.chipsline { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle }
.chipsline .pill { padding: 3px 8px; font-size: 14px }
.counter { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px }
.res-name { font-weight: 600 }
.owned { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted) }
.scard { background: #F3EEE3; color: #1E3354; border-radius: 10px; border-top: 5px solid #5E93C2; padding: 10px 12px; display: grid; gap: 6px }
.scard b { font: 700 20px var(--display); text-transform: uppercase } .scard small { color: #5E93C2; font-size: 12px; text-transform: uppercase; letter-spacing: .08em }
.scard p, .ecard p { margin: 0; font-size: 14px } .scard button.primary { --c: #1E3354; color: #F3EEE3 }
.ecard { background: #F4E9DC; color: #3A1E22; border-radius: 10px; border-top: 5px solid #B8552F; padding: 10px 12px; display: grid; gap: 6px }
.ecard b { font: 700 18px var(--display); text-transform: uppercase } .ecard button { padding: 6px 12px; color: #3A1E22; background: transparent; border-color: #B8552F }
.tfbtn { border-color: #5E9A4C } .tfbtn:not(:disabled) { background: #24331F }
.actions { display: grid; gap: 8px }
.rules .card { margin-top: 8px; gap: 8px } .rules h3 { margin-top: 6px } .rules p { margin: 0; font-size: 14px; color: var(--muted) } .rules p b { color: var(--fg) }
.rrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; border-bottom: 1px solid var(--line) }
#offline { position: fixed; left: 0; right: 0; top: 0; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: #8E2E1C; color: #fff; font-weight: 600; text-align: center; z-index: 20 }
.cardart { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: 6px; border: 2px solid currentColor }
.alert { background: #2A1C17; border-color: #8E4A30; gap: 8px; font-size: 15px } .alert h3 { color: #FFB199 }
.dock { position: sticky; top: 0; z-index: 10; display: grid; gap: 8px; margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 0; padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px rgba(0,0,0,.35) }
.dock .hand { gap: 6px } .dock .res { padding: 6px 2px; font-size: 11px } .dock .res b { font-size: 22px } .dock .res::before { width: 14px; height: 16px }
.dock .energybar .enum { flex: none; font: 700 15px var(--display); color: var(--muted); margin-left: 4px }

.solline { font-size: 14px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line) } .solline b { color: var(--fg); font-family: var(--display); font-size: 16px; text-transform: uppercase; letter-spacing: .04em }
/* emote tray, bottom right */
.emotes { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 15; display: grid; justify-items: end; gap: 10px }
.emotebtn { width: 56px; height: 56px; border-radius: 50%; padding: 0; font-size: 28px; background: var(--panel); box-shadow: 0 6px 18px rgba(0,0,0,.5) }
.tray { display: grid; grid-template-columns: repeat(4, 52px); gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.55) }
.tray button { height: 52px; padding: 0; font-size: 26px } .emotes .art, .emotes .art svg { display: block; width: 42px; height: 42px; margin: auto } .emotebtn .art, .emotebtn .art svg { width: 44px; height: 44px }
.tray button.words { grid-column: span 2; font: 700 14px var(--body) }
#app { padding-bottom: 90px }

/* your turn: a bar on the pinned header, and a full-screen flash when it starts */
.dock.myturn { border-bottom: 3px solid var(--c); box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 35%, transparent) }
.turnbar { margin: -2px -16px 0; padding: 6px 16px; background: var(--c); color: #12131B; font: 800 20px var(--display); text-transform: uppercase; letter-spacing: .1em; text-align: center; animation: turnpulse 1.6s ease-in-out infinite }
@keyframes turnpulse { 50% { filter: brightness(1.25) } }
.turnflash { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; text-align: center; gap: 8px; background: color-mix(in srgb, var(--c) 88%, #000); color: #12131B; pointer-events: none;
  animation: flash 2.2s ease forwards }
.turnflash b { font: 800 64px/1 var(--display); text-transform: uppercase; letter-spacing: .04em } .turnflash span { font: 600 20px var(--body) }
@keyframes flash { 0% { opacity: 0; transform: scale(1.1) } 10% { opacity: 1; transform: none } 75% { opacity: 1 } 100% { opacity: 0 } }

/* resources going up: a '+1' that floats up like a 1UP, and a bounce on the tile */
.oneup { position: fixed; z-index: 30; transform: translate(-50%, 0); pointer-events: none; display: grid; justify-items: center; color: var(--r); font: 800 30px/1 var(--display);
  text-shadow: 0 2px 0 #12131B, 0 0 10px color-mix(in srgb, var(--r) 60%, transparent); animation: oneup 1.3s cubic-bezier(.2,.8,.3,1) both }
.oneup small { font: 700 11px var(--body); letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 1px 0 #12131B }
.oneup.ice { --r: #8CC3E6 } .oneup.regolith { --r: #E09A62 } .oneup.iron { --r: #B7BECD } .oneup.silicon { --r: #F0D27A } .oneup.biomass { --r: #8CC77A }
@keyframes oneup { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.6) } 15% { opacity: 1; transform: translate(-50%, -14px) scale(1.25) } 30% { transform: translate(-50%, -22px) scale(1) } 80% { opacity: 1 } 100% { opacity: 0; transform: translate(-50%, -64px) } }
.dock .res.bump { animation: bump .45s cubic-bezier(.3,1.6,.5,1) }
@keyframes bump { 40% { transform: translateY(-5px) scale(1.12); border-color: var(--r) } }

/* folded sections on the turn card, and the Energy flow in the pinned header */
details.fold { border-top: 1px solid var(--line); padding-top: 8px } details.fold > summary { padding: 6px 0; color: var(--fg) } details.fold[open] > summary { margin-bottom: 8px }
details.fold .bank { border-top: none; padding-top: 0 }
.dock .eflow { flex: none; font: 700 15px var(--display); color: var(--green, #7DB36A); margin-left: 6px; white-space: nowrap } .dock .eflow span { color: var(--muted) } .dock .eflow.losing { color: #FF9A80 }
details .bank > h3 { display: none } /* the fold's title already says it */
.solline:last-child { border-bottom: none; padding-bottom: 0 }

/* builds you can't afford yet: one compact line each */
.needlist { display: grid; gap: 4px } .needrow { display: grid; grid-template-columns: 6.5em auto 1fr; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line) }
.needrow b { font-weight: 600; color: var(--muted) } .needrow span { color: var(--muted); text-align: right } .needrow .chips { flex-wrap: nowrap }
.needrow .need { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end } .needrow > span { display: flex; justify-content: flex-end }

/* tap-for-info: a small (i) on builds, tappable resource tiles, and a bottom sheet */
.info { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font: italic 700 11px Georgia, serif; vertical-align: 2px }
.res[role=button], .needrow[role=button] { cursor: pointer }
.sheetwrap { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.55); display: grid; align-items: end }
.sheet { background: var(--panel); border-top: 4px solid var(--r, var(--c)); border-radius: 18px 18px 0 0; padding: 18px 18px max(22px, env(safe-area-inset-bottom)); display: grid; gap: 10px; max-width: 520px; margin: 0 auto; width: 100%; animation: sheetup .25s ease-out }
.sheet p { margin: 0; font-size: 15px; color: var(--fg) } .sheet p b { color: var(--muted); font-weight: 600 }
.sheet.res-ice { --r: #8CC3E6 } .sheet.res-regolith { --r: #D08A55 } .sheet.res-iron { --r: #8F97AA } .sheet.res-silicon { --r: #E3C46E } .sheet.res-biomass { --r: #7DB36A }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0 } }
.needrow b { white-space: nowrap } .needrow { grid-template-columns: 8em auto 1fr }

/* Xenite: wild, iridescent violet */
.res.xenite { --r: #B88CFF } .chip.xenite, .pill.xenite { --r: #B88CFF } .pn.xenite, .res-name.xenite { --r: #B88CFF } .oneup.xenite { --r: #CDA8FF } .sheet.res-xenite { --r: #B88CFF }
.res.xenite b { background: linear-gradient(90deg, #E0C3FF, #9FD8FF); -webkit-background-clip: text; color: transparent }

/* after-game nukes */
.nukecard { display: grid; gap: 10px }
.nukecard .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px } .nukecard h3 { margin: 0; color: #FFB347 }
.launchpad { height: 170px; border-radius: 14px; background: radial-gradient(circle at 50% 120%, #4A1E14, #15161F 70%); border: 2px dashed #7A3E22; display: grid; place-items: end center; padding-bottom: 14px; touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; cursor: grab }
.launchpad .missile { display: grid; justify-items: center; gap: 6px; transition: transform .25s ease-out }
.launchpad .missile i { font-style: normal; font-size: 56px; line-height: 1; width: 78px; height: 78px; display: grid; place-items: center; border-radius: 50%; background: #FFB347; color: #1D1A26; box-shadow: 0 0 24px rgba(255,140,60,.6) }
.launchpad .missile span { font-weight: 700; color: #FFD27A; letter-spacing: .04em }
.launchpad.fired .missile { animation: liftoff .5s ease-in forwards } .launchpad.fired, .launchpad.reload { cursor: default } .launchpad.reload .missile { opacity: .35 }
@keyframes liftoff { to { transform: translateY(-260px) scale(.6); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .launchpad.fired .missile { animation: none; opacity: .4 } }

/* turn actions in the build list */
.echip { display: inline-grid; place-items: center; height: 22px; padding: 0 7px; border-radius: 11px; font: 700 12px var(--body); color: #12131B; background: #F0C23B }
.build.act.tf { border-color: #5E9A4C; background: #24331F }

/* a choice that holds everyone up: the same bold bar and flash as your turn, in warning amber */
.dock.waiting { border-bottom: 3px solid #F0A23B; box-shadow: 0 8px 24px rgba(240,162,59,.35) }
.waitbar { background: #F0A23B; display: grid; gap: 1px; padding: 6px 16px 7px } .waitbar b { font: inherit } .waitbar span { font: 700 14px var(--body); text-transform: none; letter-spacing: 0 }
.waitflash { background: color-mix(in srgb, #F0A23B 92%, #000); animation-duration: 1.6s }

.moregames { color: var(--muted); text-decoration: none; padding: 6px 0 } .moregames:hover { color: var(--fg) }
.vlinks { display: grid; gap: 6px; margin-bottom: 8px } .vlinks a { color: var(--c); font-weight: 600; text-decoration: none; padding: 6px 0 }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 45; max-width: 88vw; padding: 12px 18px; border-radius: 12px; background: #3A2A10; border: 1px solid #F0A23B; color: #FFD27A; font-weight: 700; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.5); transition: opacity .5s }
.toast.gone { opacity: 0 }
.giftask { border: 2px solid var(--c); }

/* Solar Array: both prices, one hexagon per card */
.tiers { display: grid; gap: 6px; width: 100% } .build.solar { grid-column: 1 / -1 } .tier .chips { flex-wrap: nowrap }
.tier { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 6px; font-size: 12px; color: var(--muted) }
.tier .tl { min-width: 7em; white-space: nowrap } .tier small { text-align: right } .tier.ok { color: var(--fg) } .tier.ok small { color: #7DB36A }
.tier .need { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end }
.needrow.solar { grid-template-columns: 8em 1fr }
/* seats: requests, "a bot is playing for you", the hand-over QR code */
.seatnote { border-color: #F0A23B; display: grid; gap: 8px }
.card .qr { width: 220px; margin: 8px auto; background: #fff; padding: 10px; border-radius: 10px } .card .qr svg { display: block; width: 100%; height: auto }
