:root { --ink: #0E1926; --sky: #51C9FC; --grass: #17C168; --yellow: #FCC318; --red: #FA4344; --blue: #3080FC; --panel: #E6ECEF; --cream: #FFF4D6; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--sky); color: var(--ink); font: 800 16px/1.4 ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", system-ui, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
#stage, #hud { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { pointer-events: none; z-index: 1; }
.sr { position: absolute; left: -9999px; }
.landing { position: fixed; inset: 0; z-index: 5; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px 40px; text-align: center; background: rgba(14, 25, 38, .22); }
.landing[hidden] { display: none; }
.logo svg { width: min(88vw, 760px); height: auto; display: block; margin: 0 auto; }
.tag { margin: 10px 0 2px; font-size: clamp(15px, 2.2vw, 22px); color: #fff; text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); letter-spacing: .08em; }
.card { background: var(--panel); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); padding: 16px 20px; margin: 14px auto 0; width: min(92vw, 540px); text-align: left; }
.card h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: .05em; text-transform: uppercase; }
.card p { margin: 6px 0; font-weight: 700; }
.btn { appearance: none; font: inherit; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: var(--yellow); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); padding: 12px 20px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.06); } .btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn:focus-visible, input:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }
.btn:disabled { filter: grayscale(.6); cursor: default; }
.btn.big { font-size: clamp(22px, 3.4vw, 32px); padding: 16px 34px; width: 100%; }
.btn.dark { background: var(--ink); color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
input[type=text] { font: inherit; font-weight: 900; font-size: 22px; letter-spacing: .3em; text-transform: uppercase; width: 7.2em; padding: 9px 10px; border: 4px solid var(--ink); background: #fff; color: var(--ink); text-align: center; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--grass); vertical-align: -1px; margin-right: 6px; }
.small { font-size: 13px; font-weight: 700; color: #33414f; }
.foot { margin-top: 16px; font-size: 13px; color: #fff; text-shadow: 0 1px 0 var(--ink); }
.foot a { color: #fff; }
#msg { color: var(--red); min-height: 1.4em; margin: 4px 0 0; }

/* The join card: always on screen once a room is open. Press it to make it big enough for the back of the room. */

#caption { position: fixed; left: 50%; bottom: 15vh; z-index: 4; transform: translateX(-50%); max-width: min(92vw, 900px); background: var(--cream); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); padding: 7px 16px 7px 44px; font-size: clamp(15px, 1.8vw, 22px); font-weight: 800; pointer-events: none; }
#caption[hidden] { display: none; }
#caption::before { content: ""; position: absolute; left: 12px; top: 50%; width: 22px; height: 18px; margin-top: -9px; background: var(--red); clip-path: polygon(0 30%, 40% 30%, 100% 0, 100% 100%, 40% 70%, 0 70%); }
#gear { position: fixed; right: 10px; bottom: 10px; padding: 6px 10px; font-size: 13px; opacity: .85; z-index: 3; }
#gear[hidden] { display: none; }
#mixer { position: fixed; right: 10px; bottom: 54px; width: min(92vw, 340px); background: var(--panel); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); padding: 14px 16px; z-index: 6; }
#mixer[hidden] { display: none; }
#mixer h2 { margin: 0 0 8px; font-size: 16px; text-transform: uppercase; letter-spacing: .05em; }
#mixer label { display: grid; grid-template-columns: 70px 1fr 34px; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }
#mixer input[type=range] { width: 100%; accent-color: var(--red); }
#mixer .row .btn { font-size: 12px; padding: 7px 10px; box-shadow: 0 3px 0 var(--ink); border-width: 3px; }
#pause { position: fixed; inset: 0; z-index: 8; background: rgba(14, 25, 38, .72); display: flex; align-items: center; justify-content: center; }
#pause[hidden] { display: none; }
.pausebox { background: var(--panel); border: 4px solid var(--ink); box-shadow: 0 8px 0 var(--ink); padding: 18px 22px; width: min(92vw, 420px); }
.pausebox h2 { margin: 0; font-size: 28px; letter-spacing: .06em; text-transform: uppercase; }
#pauselist { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
#pauselist .btn { text-align: left; font-size: 16px; padding: 9px 14px; box-shadow: 0 3px 0 var(--ink); }
#pauselist .btn.sel { background: var(--yellow); color: var(--ink); transform: translateX(8px); }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.mode { font: inherit; text-align: left; background: #fff; color: var(--ink); border: 3px solid var(--ink); padding: 6px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.mode b { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; } .mode span { font-size: 11.5px; font-weight: 700; color: #33414f; line-height: 1.25; }
.mode.sel { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.mode:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }
@media (max-width: 520px) { .modes { grid-template-columns: 1fr; } }

/* Versus: two forts, side by side, each in its own half of the screen. */
#stageB, #hudB { position: fixed; top: 0; left: 50%; width: 50%; height: 100%; display: none; touch-action: none; }
#hudB { pointer-events: none; z-index: 1; }
body.versus #stage, body.versus #hud { width: 50%; }
body.versus #stageB, body.versus #hudB { display: block; }
body.versus::after { content: ""; position: fixed; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: var(--ink); z-index: 2; }
#vs { position: fixed; inset: 0; z-index: 7; background: rgba(14, 25, 38, .6); display: flex; align-items: center; justify-content: center; }
#vs[hidden] { display: none; }
#vs .pausebox { width: min(92vw, 640px); }
#vs h2 { color: var(--red); }
.modes { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }

/* After the playtest: the picture gets the whole screen. The join card is a corner badge; press it for the big one. */
#gear { right: 6px; bottom: 6px; padding: 3px 8px; font-size: 11px; opacity: .6; border-width: 3px; box-shadow: 0 3px 0 var(--ink); }
#caption { bottom: 9vh; font-size: clamp(13px, 1.5vw, 19px); padding: 5px 12px 5px 38px; border-width: 3px; box-shadow: 0 3px 0 var(--ink); }
