* { box-sizing: border-box; margin: 0; }
body { font-family: system-ui, "Segoe UI", sans-serif; background: #17122b; color: #fff; min-height: 100vh; text-align: center; padding: 20px; }
main { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); color: #ffd23f; }
h2 { font-size: clamp(1.4rem, 4vw, 2.6rem); }
.code { font-size: clamp(4rem, 15vw, 9rem); font-weight: 900; letter-spacing: .12em; }
input, button { font: inherit; font-size: 1.3rem; font-weight: 700; border: 0; border-radius: 14px; padding: 16px; }
input { background: #fff; color: #17122b; text-align: center; }
button { background: #ffd23f; color: #17122b; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, input:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid > * { min-height: 110px; border-radius: 14px; padding: 12px; font-size: 1.4rem; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
.grid > :nth-child(1) { background: #c8303f; }
.grid > :nth-child(2) { background: #2463c9; }
.grid > :nth-child(3) { background: #1d7a45; }
.grid > :nth-child(4) { background: #7a3fb8; }
.grid .picked { outline: 5px solid #fff; opacity: 1; }
.grid .wrong { opacity: .2; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; list-style: none; padding: 0; }
.chips li { background: #2e2650; border-radius: 99px; padding: 10px 18px; font-size: 1.3rem; }
.chips li.done { background: #1d7a45; }
.chips li.off { opacity: .4; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.error { color: #ff9a9a; min-height: 1.4em; }
[hidden] { display: none !important; }
#join, #pad, #stage, #menu, form { display: flex; flex-direction: column; gap: 12px; }
#pad canvas { width: min(100%, 500px); aspect-ratio: 1; align-self: center; background: #fff; border-radius: 14px; touch-action: none; }
.grid > button { overflow-wrap: anywhere; }
.grid > :nth-child(5) { background: #a35a00; }
.grid > :nth-child(6) { background: #007a80; }
.grid > :nth-child(7) { background: #a3306f; }
.grid > :nth-child(8) { background: #4d5a75; }
.grid > button:disabled { opacity: .75; }
.grid > .picked:disabled { opacity: 1; }
.grid > .wrong:disabled { opacity: .2; }
.blank > button:disabled { opacity: .75; }
.plain { background: #2e2650; color: #fff; }
.title { color: #ffd23f; font-weight: 700; }
.note { font-size: 1.2rem; }
.line { font-size: 1.3rem; font-weight: 700; overflow-wrap: anywhere; }
.drink { font-size: 1.5rem; font-weight: 900; color: #ffd23f; }
.toggle { font-size: 1.2rem; display: flex; gap: 10px; justify-content: center; align-items: center; }
.toggle input { width: 24px; height: 24px; }
.clock { font-size: 1.5rem; font-weight: 900; }

/* 2005 comfy playroom look */
body { --bg: url(/art/bg-menu); background: #17122b; position: relative; isolation: isolate; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(#17122b55, #17122baa), var(--bg) center / cover no-repeat; }
body.playing::before { background: linear-gradient(#17122bcc, #17122bdd), var(--bg) center / cover no-repeat; }
#logo { width: min(100%, 460px); height: auto; filter: drop-shadow(0 6px 8px #0008); }
body.playing #logo { width: 170px; }
p, h2, .toggle { text-shadow: 0 2px 4px #000c; }
.big { font-size: 2.2rem; padding: 20px 70px; align-self: center; margin-top: 30vh; border-radius: 99px; box-shadow: 0 7px 0 #a87c00; }
#hostTools { display: flex; flex-direction: column; gap: 12px; }
body:has(#menu:not([hidden])) #logo { width: 220px; }
body:has(#menu:not([hidden])) .code { font-size: 3.5rem; }

/* Start screen: the whole painting, with PLAY as the hot spot */
#splash { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; background: #1b1542; }
#art { position: relative; width: min(100vw, 100vh * 1376 / 768); aspect-ratio: 1376 / 768; }
#art img { width: 100%; height: 100%; display: block; }
#glow, #play { position: absolute; left: 36.12%; top: 67.97%; width: 28.2%; height: 22.66%; }
#glow { opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; }
#play { background: transparent; padding: 0; border-radius: 20px; z-index: 1; }
#art:has(#play:hover) #glow, #art:has(#play:focus-visible) #glow, .pressed #glow { opacity: 1; filter: drop-shadow(0 0 8px #4dff7c) drop-shadow(0 0 18px #4dff7c); transform: scale(1.04); }
#art:has(#play:active) #glow, .pressed #glow { transform: scale(.96); }

/* Game picker: one animated room per game, arrows on both sides */
#rooms { position: relative; width: min(100%, 900px, 85vh * 16 / 9); aspect-ratio: 16 / 9; align-self: center; border: 4px solid #ffd23f; border-radius: 18px; overflow: hidden; }
#room { width: 100%; height: 100%; object-fit: cover; display: block; }
#roomName { position: absolute; top: 4%; left: 0; right: 0; font-size: clamp(1.3rem, 5vw, 2.8rem); pointer-events: none; filter: drop-shadow(0 3px 4px #000c); }
.arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; padding: 0; border-radius: 50%; font-family: system-ui, sans-serif; border: 3px dashed #17122b; }
#prev { left: 8px; }
#next { right: 8px; }
#playRoom { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 10px 26px; box-shadow: 0 5px 0 #a87c00; }
.signal { font-size: 2.6rem; font-weight: 900; color: #ffd23f; }

.chips li { display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 16px; min-width: 104px; padding: 10px 14px; font-size: 1rem; border: 2px solid #ffd23f55; overflow-wrap: anywhere; }
.chips li strong { font-size: 1.15rem; }
.chips li em { color: #ffd23f; font-size: .9rem; }
.tv main { max-width: 1200px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.gallery figure { font-weight: 800; }
#pad .gallery canvas { width: 100%; }
select { font: inherit; font-size: 1.3rem; font-weight: 700; border-radius: 14px; padding: 14px; width: 100%; }

/* Lettering: Chewy for text, the patchwork picture letters for big short moments */
@font-face { font-family: Chewy; src: url(/art/chewy) format("truetype"); font-display: swap; }
body, button { font-family: Chewy, system-ui, sans-serif; font-synthesis: none; letter-spacing: .02em; }
/* What people type stays in a plain font so it is easy to read. */
input, select, .chips li strong { font-family: system-ui, "Segoe UI", sans-serif; letter-spacing: 0; }
.bubble { display: flex; flex-wrap: wrap; justify-content: center; gap: .1em .4em; line-height: 1; }
.bubble span { display: flex; align-items: flex-end; }
.bubble img { height: 1em; width: auto; }
.code.bubble { letter-spacing: 0; }
.title.bubble { font-size: 2.2rem; }
h2.bubble { font-size: clamp(2rem, 6vw, 3.2rem); }
.clock.bubble { font-size: 3rem; }
.score { display: flex; align-items: center; gap: 4px; }
b.bubble { font-size: 1.4rem; }
