:root { --steel: #6f7472; --steel-d: #2c2e2c; --ink: #141311; --cream: #efe6cf; --rust: #a4532a; --hazard: #e4b12c; --red: #c8352b; --teal: #2f8f8a; --sq-gold: #ffc53d;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #1b1a17; color: var(--cream); font: 500 16px/1.35 "Chakra Petch", system-ui, sans-serif; overflow: hidden; overscroll-behavior: none; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.screen { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; overflow-y: auto; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  background: radial-gradient(120% 80% at 50% 0%, #34322c 0%, #1b1a17 70%); }
.screen.on { display: flex; }
#game { padding: 0; overflow: hidden; background: transparent; pointer-events: none; }
.plate { width: 100%; max-width: 440px; margin-top: 12px; padding: 22px 18px; position: relative; border-radius: 10px;
  background: linear-gradient(160deg, #7d8280, #555a58 60%, #4a4e4c); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,.25); }
.plate::before, .plate::after { content: ""; position: absolute; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d8dad8, #6b6f6d 60%, #2a2b2a); box-shadow: 0 0 0 2px var(--ink); }
.plate::before { left: 10px; } .plate::after { right: 10px; }
.logo { font: 400 56px/0.9 "Black Ops One", sans-serif; letter-spacing: 2px; margin: 6px 0 4px; color: var(--cream); text-shadow: 3px 3px 0 var(--ink); text-align: center; }
.logo span { color: var(--hazard); }
.tag { text-align: center; margin: 0 0 18px; color: #e8e2cf; }
.field { display: block; margin: 10px 0; font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: 1px; }
input { width: 100%; margin-top: 4px; padding: 12px 14px; font: 700 20px "Chakra Petch", sans-serif; color: var(--ink); background: var(--cream); border: 3px solid var(--ink); border-radius: 6px; outline: none; }
input:focus { box-shadow: 0 0 0 3px var(--hazard); }
button { font: 400 20px "Black Ops One", sans-serif; letter-spacing: 1px; cursor: pointer; border: 3px solid var(--ink); border-radius: 8px; color: var(--ink); background: var(--cream); padding: 12px 16px; box-shadow: 0 5px 0 var(--ink); }
button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
button.big { width: 100%; margin: 10px 0; padding: 16px; font-size: 24px; background: var(--hazard); }
button.hazard { background: repeating-linear-gradient(-45deg, var(--hazard) 0 18px, var(--ink) 18px 36px); color: var(--cream); text-shadow: 2px 2px 0 var(--ink); }
button.link { background: none; border: 0; box-shadow: none; color: var(--cream); text-decoration: underline; font: 500 15px "Chakra Petch"; width: 100%; }
.join { display: flex; gap: 8px; margin-top: 6px; } .join input { text-transform: uppercase; letter-spacing: 6px; text-align: center; margin: 0; } .join button { flex: none; }
.err { color: #ffb3a8; min-height: 1.2em; font-weight: 700; } .note { color: #e8e2cf; text-align: center; }
.codecard { display: flex; gap: 14px; align-items: center; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 8px; padding: 10px; transform: rotate(-1deg); }
#qr { width: 132px; height: 132px; flex: none; } #qr svg { width: 100%; height: 100%; display: block; }
.codetext small { display: block; font-size: 12px; text-transform: uppercase; } .codetext { min-width: 0; } .codetext b { display: block; font: 400 clamp(34px, 11vw, 48px)/1 "Black Ops One"; letter-spacing: 3px; }
.roster { list-style: none; padding: 0; margin: 12px 0; } .roster li { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; margin: 6px 0; background: rgba(0,0,0,.35); border-radius: 6px; border-left: 6px solid var(--steel); }
.roster li.ready { border-left-color: var(--teal); } .roster li.off { opacity: .45; } .roster .sense { font-size: 13px; opacity: .8; }
.sq-v { color: var(--sq-gold); }
.board { width: 100%; max-width: 440px; margin: 16px 0; } .board h3 { font: 400 20px "Black Ops One"; margin: 12px 0 6px; } .board table { width: 100%; border-collapse: collapse; font-size: 14px; }
.board td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.08); } .board td.n { text-align: right; font-weight: 700; } .board .tabs { display: flex; gap: 6px; } .board .tabs button { flex: 1; font-size: 14px; padding: 6px; box-shadow: 0 3px 0 var(--ink); }
.board .tabs button.on { background: var(--hazard); }
/* ---- game HUD ---- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; inset: 0; pointer-events: none; }
.bars { position: absolute; top: calc(6px + var(--safe-t)); left: 8px; right: 8px; display: flex; gap: 6px; align-items: center; }
.bar { position: relative; flex: 1; height: 24px; border: 2px solid var(--ink); border-radius: 4px; background: #2a2a28; overflow: hidden; }
.bar i { position: absolute; inset: 0; transform-origin: left; background: var(--teal); transition: transform .3s; } .bar.hull i { background: linear-gradient(90deg, var(--red), var(--hazard) 40%, #7fbf4c); }
.bar span { position: relative; font: 700 12px "Chakra Petch"; padding-left: 6px; line-height: 20px; text-shadow: 1px 1px 0 var(--ink); } .bar em { position: absolute; right: 4px; top: 1px; font-style: normal; font-size: 13px; }
.score { font: 400 20px "Black Ops One"; min-width: 64px; text-align: right; text-shadow: 2px 2px 0 var(--ink); }
.cmd { position: absolute; left: 8px; right: 8px; top: calc(30vh - 6px); transform: translateY(-100%); padding: 10px 12px 8px; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 6px; box-shadow: 0 4px 0 var(--ink); }
.cmd p { margin: 0 0 6px; font: 700 clamp(18px, 5.4vw, 28px)/1.15 "Chakra Petch"; } .cmd.flip p { transform: rotate(180deg); } .cmd.linked { background: var(--hazard); }
.cmd.idle p { opacity: .5; } .cmd.ok { animation: ok .4s; } .cmd.miss { animation: miss .4s; }
.timer { height: 8px; background: rgba(0,0,0,.2); border-radius: 4px; overflow: hidden; } .timer i { display: block; height: 100%; background: var(--red); transform-origin: left; }
.banner { position: absolute; left: 8px; right: 8px; top: 34vh; padding: 14px; text-align: center; color: var(--cream); background: repeating-linear-gradient(-45deg, #2a2a28 0 16px, #1a1a18 16px 32px); border: 3px solid var(--hazard); border-radius: 8px; pointer-events: auto; }
.banner p { font: 400 26px/1.1 "Black Ops One"; margin: 0 0 8px; } #banner-act button { margin-top: 10px; pointer-events: auto; }
.alert { position: absolute; left: 8px; right: 8px; bottom: calc(10px + var(--safe-b)); padding: 10px; text-align: center; font: 400 20px "Black Ops One"; background: var(--red); border: 3px solid var(--ink); border-radius: 8px; animation: blink 1s infinite; }
.gremlin { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: auto; background: url(art/gremlin.webp) center/contain no-repeat, radial-gradient(circle, rgba(40,200,90,.5), transparent 70%); opacity: .38; animation: wiggle .6s infinite alternate; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(10,10,9,.82); pointer-events: auto; padding: 16px; text-align: center; }
.overlay h2 { font: 400 40px "Black Ops One"; margin: 0; color: var(--hazard); } .cards { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; margin: 12px 0; }
.card { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px; font: 500 15px "Chakra Petch"; background: var(--cream); } .card img { width: 64px; height: 64px; object-fit: cover; border: 2px solid var(--ink); border-radius: 4px; flex: none; background: var(--steel); }
.card b { display: block; font: 400 18px "Black Ops One"; } .card.cursed { background: #d9c2e6; } .card.mine { outline: 4px solid var(--teal); } .card .votes { margin-left: auto; font: 400 22px "Black Ops One"; }
.phase { position: absolute; left: 0; right: 0; top: 40vh; text-align: center; font: 400 48px "Black Ops One"; color: var(--hazard); text-shadow: 4px 4px 0 var(--ink); }
.big-num { text-align: center; } .big-num b { display: block; font: 400 64px "Black Ops One"; color: var(--hazard); }
@keyframes ok { 50% { background: #9fdc7a; } } @keyframes miss { 25%, 75% { transform: translate(-100%, 0) translateX(-6px); } 50% { transform: translateY(-100%) translateX(6px); } }
@keyframes blink { 50% { filter: brightness(1.4); } } @keyframes wiggle { to { transform: rotate(8deg) scale(1.06); } }
@media (orientation: landscape) and (max-height: 520px) { .cmd { top: calc(32vh - 6px); } .banner { top: 20vh; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- label-maker sheet: the only place you type ---- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(5,5,4,.55); padding: 16px 16px calc(16px + var(--safe-b)); }
.maker { width: 100%; max-width: 440px; padding: 18px 16px 14px; border-radius: 18px 18px 10px 10px; border: 3px solid var(--ink); box-shadow: 0 8px 0 var(--ink), inset 0 3px 0 rgba(255,255,255,.35);
  background: linear-gradient(160deg, #d8402f, #a92a1f); animation: rise .18s ease-out; }
.maker p { margin: 0 0 10px; font: 400 18px "Black Ops One"; color: var(--cream); letter-spacing: 2px; text-shadow: 2px 2px 0 var(--ink); }
.maker input { font: 400 30px "Black Ops One"; letter-spacing: 3px; background: #f3ecd6; border-radius: 4px; box-shadow: inset 0 3px 0 rgba(0,0,0,.15); }
.maker-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; } .maker-row button:not(.link) { background: var(--hazard); }
.maker-row .link { width: auto; color: var(--cream); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.toast { position: fixed; left: 16px; right: 16px; top: calc(12px + var(--safe-t)); z-index: 15; text-align: center; padding: 10px; font: 400 18px "Black Ops One"; background: var(--red); border: 3px solid var(--ink); border-radius: 8px; }
.card i.noart { width: 64px; height: 64px; flex: none; border: 2px solid var(--ink); border-radius: 4px; background: repeating-linear-gradient(-45deg, #e4b12c 0 8px, #141311 8px 16px); }
