@font-face { font-family: Fredoka; font-weight: 400 500; font-display: swap; src: url(../a/fonts/fredoka-500.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 600 800; font-display: swap; src: url(../a/fonts/fredoka-700.woff2) format('woff2'); }
:root {
	color-scheme: dark;
	--bg: #1b1628;
	--panel: #251e36;
	--panel-2: #31284a;
	--line: #4d4170;
	--ink: #17121f;
	--cream: #fff4dc;
	--muted: #cbbfe0;
	--banana: #ffd66b;
	--banana-deep: #f0a93a;
	--stink: #a6d65a;
	--tidy: #ff9fb2;
	--round: Fredoka, ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
	font-family: var(--round);
	font-weight: 500;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; background: var(--bg); color: var(--cream); }
body.game { overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; overscroll-behavior: none; }
button, select, input { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button, select {
	min-height: 48px; padding: 0 var(--space-3); border: 2px solid var(--ink);
	border-radius: 14px; background: var(--panel-2); cursor: pointer; font-weight: 600;
	box-shadow: 0 3px 0 var(--ink), inset 0 1px 0 #ffffff1a;
	transition: transform .08s, box-shadow .08s, filter .12s;
}
button svg { width: 18px; height: 18px; flex-shrink: 0; }
button:disabled { opacity: .45; cursor: default; }
button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
@media (hover: hover) { button:not(:disabled):hover { filter: brightness(1.1); } }
select { appearance: none; padding-right: 34px; background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff4dc' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
:focus-visible { outline: 3px solid var(--banana); outline-offset: 2px; }
a { color: var(--banana); }
p, h1, h2 { margin: 0; }
h1, h2 { font-family: var(--round); font-weight: 700; letter-spacing: -.01em; }

/* Masthead */
.masthead {
	display: flex; align-items: center; min-height: 56px; gap: var(--space-1);
	padding: env(safe-area-inset-top) max(var(--space-2), env(safe-area-inset-right)) 0 max(var(--space-2), env(safe-area-inset-left));
	background: var(--ink); border-bottom: 2px solid #000; z-index: 3;
}
.brand { display: flex; min-width: 0; align-items: center; gap: var(--space-2); font-size: clamp(1rem, 4.4vw, 1.3rem); font-weight: 700; text-decoration: none; color: var(--cream); letter-spacing: .01em; }
.brand img { border-radius: 11px; width: 38px; height: 38px; box-shadow: 0 0 0 2px #ffffff14; }
.brand strong { color: var(--banana); font-weight: 700; }
.install-slot { flex: 0 0 48px; height: 48px; margin-right: auto; }
.icon-button { width: 48px; height: 48px; min-height: 48px; padding: 0; display: grid; place-items: center; color: var(--cream); border: 2px solid transparent; border-radius: 12px; background: transparent; box-shadow: none; position: relative; text-decoration: none; }
.icon-button svg { width: 22px; height: 22px; }
.icon-button:focus-visible, .icon-button:hover { background: var(--panel-2); }
.icon-button:not(:disabled):active { transform: none; box-shadow: none; }
.icon-button::after { display: none; }
@media (hover: hover) {
	.icon-button:hover::after, .icon-button:focus-visible::after { display: block; content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; width: max-content; max-width: 200px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 10px; font-size: .78rem; font-weight: 600; color: var(--ink); background: var(--cream); z-index: 6; pointer-events: none; box-shadow: 0 3px 0 var(--ink); }
}

/* Battlefield and HUD */
.arena { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.battlefield { min-height: 0; position: relative; overflow: hidden; background: #6f8fb0; isolation: isolate; }
#field { position: absolute; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.hud { position: absolute; top: var(--space-2); left: var(--space-2); right: var(--space-2); display: flex; align-items: stretch; gap: 6px; pointer-events: none; }
.hud > div { background: #1b1628e8; border: 2px solid var(--ink); border-radius: 16px; padding: 6px 10px; box-shadow: 0 3px 0 #17121f99; }
.hud small { display: flex; align-items: center; gap: 3px; letter-spacing: .08em; color: var(--muted); font: 600 .62rem/1.2 var(--round); }
.hud small svg { width: 11px; height: 11px; }
.hud strong { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 2px; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.turn-pill { margin-right: auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding-left: 5px !important; }
.turn-pill > div { min-width: 0; }
.turn-pill span { display: block; color: var(--muted); font: 600 .62rem/1.2 var(--round); letter-spacing: .08em; white-space: nowrap; }
.turn-pill strong { justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.92rem, 3.8vw, 1.1rem); }
.face { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; }
.wind-pill, .clock-pill { min-width: 64px; text-align: center; display: grid; justify-items: center; align-content: center; }
.wind-pill small, .clock-pill small { justify-content: center; }
.wind-arrow { display: inline-grid; transition: transform .3s; }
.wind-arrow svg { width: 15px; height: 15px; }
.wind-arrow.left { transform: scaleX(-1); }
.wind-arrow.calm { opacity: .3; }
.wind-meter { position: relative; display: block; width: 46px; height: 5px; margin-top: 3px; border-radius: 3px; background: #ffffff1f; overflow: hidden; }
.wind-meter i { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; background: linear-gradient(90deg, #9fd9ff, #fff4dc); border-radius: 3px; transition: width .3s, left .3s; }
.wind-meter::after { content: ''; position: absolute; left: calc(50% - 1px); top: -1px; bottom: -1px; width: 2px; background: #ffffff66; }
.clock-pill { --left: 1; background: conic-gradient(var(--banana) calc(var(--left) * 360deg), transparent 0) border-box !important; position: relative; }
.clock-pill::before { content: ''; position: absolute; inset: 2px; border-radius: 12px; background: #1b1628f2; z-index: -1; }
.clock-pill { z-index: 0; border-color: transparent !important; outline: 2px solid var(--ink); outline-offset: -2px; }
.clock-pill strong { font-variant-numeric: tabular-nums; }
.clock-pill.urgent { --banana: #ff8a7a; }
.clock-icon { display: inline-grid; }
.clock-pill .bot-icon, .clock-pill[data-state=cpu] .timer-icon { display: none; }
.clock-pill[data-state=cpu] .bot-icon { display: inline-grid; }
.clock-pill[data-state=paused] { --banana: #6d6284; }
.clock-pill[data-state=paused] strong { color: var(--muted); }
.clock-pill[data-state=cpu] { --banana: transparent; }
.clock-pill[data-state=cpu] strong { color: #f89a94; font-size: .95rem; }
.wind-pill strong { font-variant-numeric: tabular-nums; }
.clock-pill.urgent strong { color: #ffb0a4; animation: tick 1s steps(1) infinite; }
@keyframes tick { 50% { transform: scale(1.12); } }
#map { position: absolute; right: var(--space-2); top: 74px; width: 140px; height: 46px; border: 2px solid var(--ink); border-radius: 11px; box-shadow: 0 3px 0 #17121f99; touch-action: none; cursor: ew-resize; }
.ticker { position: absolute; bottom: var(--space-2); left: var(--space-2); right: var(--space-2); height: 48px; border: 2px solid var(--ink); border-radius: 14px; background: #1b1628e8; display: flex; align-items: center; gap: var(--space-2); padding: 4px 12px 4px 6px; pointer-events: none; box-shadow: 0 3px 0 #17121f99; }
.ticker small { font: 700 .58rem/1.05 var(--round); color: var(--ink); background: var(--banana); border-radius: 8px; padding: 5px 6px; flex-shrink: 0; letter-spacing: .06em; text-align: center; }
.ticker span { color: var(--cream); font-size: .84rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Overlays and menus */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-3); background: linear-gradient(#1b162800, #1b162866); overflow: auto; }
.shade { z-index: 2; background: #17121fb8; }
.menu-card {
	position: relative; width: min(100%, 420px); border-radius: 26px; border: 3px solid var(--ink);
	background: linear-gradient(170deg, #2f2745f7, #221b33f4);
	box-shadow: 0 6px 0 var(--ink), 0 24px 60px #0b081499, inset 0 2px 0 #ffffff14;
	padding: var(--space-5); align-self: center; text-align: center;
}
.kicker { color: var(--stink); font: 700 .7rem/1.25 var(--round); letter-spacing: .14em; display: flex; align-items: center; justify-content: center; gap: 6px; }
.kicker svg { width: 14px; height: 14px; }
.hero { display: block; width: 230px; height: 112px; margin: calc(var(--space-5) * -1 - 56px) auto 4px; }
.setup-card { margin-top: 48px; }
.setup-card h1 { font-size: clamp(2.5rem, 11vw, 3.6rem); line-height: .9; margin: var(--space-2) 0 var(--space-3); color: var(--cream); text-shadow: 0 4px 0 var(--ink); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.setup-card h1 em { display: block; color: var(--banana); font-style: normal; }
.tagline { color: var(--muted); font-size: 1.05rem; font-weight: 600; }
#setup-form { display: grid; gap: var(--space-2); margin: var(--space-4) 0 var(--space-2); }
.segmented { display: flex; padding: 3px; gap: 3px; border-radius: 16px; background: var(--ink); border: 2px solid var(--ink); }
.segmented button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border-color: transparent; box-shadow: none; min-height: 46px; border-radius: 12px; color: var(--muted); font-size: .9rem; line-height: 1.05; }
.segmented button:not(:disabled):active { transform: none; box-shadow: none; }
.segmented button[aria-pressed=true] { background: var(--panel-2); border-color: #ffffff22; color: var(--cream); box-shadow: inset 0 1px 0 #ffffff22; }
.segmented button[aria-pressed=true] svg { color: var(--banana); }
#grime-tab[aria-pressed=true] svg { color: var(--stink); }
.setting { display: flex; align-items: center; gap: var(--space-2); padding-left: var(--space-2); justify-content: space-between; font-size: .92rem; font-weight: 600; color: var(--muted); }
.setting select { min-width: 50%; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); background: linear-gradient(#ffe48f, var(--banana) 55%, var(--banana-deep)); color: var(--ink); font-weight: 700; }
.primary.big { min-height: 54px; font-size: 1.1rem; }
.primary svg { width: 20px; height: 20px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; border-color: transparent; box-shadow: none; color: var(--banana); background: none; font-size: .9rem; }
.text-button:not(:disabled):active { transform: none; box-shadow: none; }
.how { font-size: .8rem; line-height: 1.4; color: var(--muted); }
.small-card { display: grid; gap: var(--space-3); justify-items: center; }
.small-card > * { width: 100%; }
.small-card .face.big-face { width: 112px; height: 112px; margin: -76px auto 0; filter: drop-shadow(0 5px 0 var(--ink)); }
.small-card h2 { font-size: clamp(1.8rem, 8vw, 2.6rem); line-height: 1; text-shadow: 0 3px 0 var(--ink); }
.small-card > p:not([class]) { color: var(--muted); font-size: .92rem; }
#handoff .menu-card, #finish .menu-card { margin-top: 56px; }
.final-score { display: inline-block; width: auto !important; justify-self: center; color: var(--ink); background: var(--stink); border: 2px solid var(--ink); border-radius: 14px; padding: 4px 16px; font: 700 1.6rem var(--round); box-shadow: 0 3px 0 var(--ink); }
.breakdown { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.breakdown span { padding: 3px 9px; border-radius: 999px; background: #ffffff14; border: 1px solid #ffffff22; font-size: .78rem; color: var(--muted); }
.breakdown b { color: var(--cream); font-weight: 700; }
#score-form { display: grid; gap: var(--space-1); text-align: left; font-size: .9rem; color: var(--muted); }
.submit-row, .finish-actions { display: flex; gap: var(--space-2); }
.submit-row input { min-width: 0; flex: 1; min-height: 48px; padding: var(--space-2); border: 2px solid var(--ink); border-radius: 12px; background: var(--ink); font-size: 1rem; }
.finish-actions button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.score-notice { min-height: 1.2em; font-size: .82rem; color: var(--stink); }

/* Control deck */
.control-deck {
	padding: var(--space-2) max(var(--space-2), env(safe-area-inset-right)) max(var(--space-2), env(safe-area-inset-bottom)) max(var(--space-2), env(safe-area-inset-left));
	background: var(--panel); border-top: 3px solid var(--ink); display: grid; gap: var(--space-2);
	box-shadow: inset 0 2px 0 #ffffff10;
}
.deck-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, .48fr); gap: var(--space-2); align-items: center; }
.deck-top .segmented button { padding-inline: var(--space-1); }
.deck-top > button { height: 54px; font-size: 1.02rem; padding-inline: var(--space-1); }
.inventory { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior-x: contain; touch-action: pan-x; }
.item { position: relative; flex: 0 0 62px; min-height: 66px; border-radius: 14px; padding: 4px 2px 3px; display: grid; grid-template-rows: 38px auto; justify-items: center; align-content: center; gap: 0; background: var(--panel-2); }
.item canvas { width: 38px; height: 38px; display: block; }
.item[aria-pressed=true] { background: #4a3d6b; border-color: var(--banana); box-shadow: 0 3px 0 var(--ink), 0 0 0 2px var(--ink), 0 0 14px #ffd66b55; color: var(--banana); }
.item:disabled { opacity: 1; }
.item:disabled canvas, .item:disabled .item-name { opacity: .35; filter: grayscale(1); }
.item-name { font-size: .66rem; font-weight: 600; line-height: 1.05; white-space: nowrap; }
.item small { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--ink); background: var(--cream); color: var(--ink); font: 700 .66rem/1 var(--round); }
.item:disabled small { background: #6d6284; color: var(--cream); }
/* Not your turn (CPU turn, flight, handoff): the whole deck reads as asleep */
.control-deck.locked .deck-top, .control-deck.locked .inventory { filter: saturate(.25); opacity: .55; }
.control-deck.locked .inventory { pointer-events: none; }
.control-deck.locked .item[aria-pressed=true] { background: var(--panel-2); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); color: inherit; }
.control-deck.locked #action { background: var(--panel-2); color: var(--muted); }
.control-deck[data-state=cpu] .item-help strong { color: #f89a94; }
.item-help { height: 2.6em; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; font-size: .8rem; color: var(--muted); }
.item-help strong { margin-right: .4em; }
.item-help strong { color: var(--banana); font-weight: 700; }

/* Hall of Fame */
dialog { width: min(calc(100% - 24px), 460px); max-height: min(78dvh, 680px); padding: var(--space-4); overflow: auto; color: var(--cream); background: var(--panel); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink), 0 20px 50px #0b0814bb; }
dialog::backdrop { background: #0f0b18c4; }
dialog h2 { font-size: 1.7rem; color: var(--banana); display: flex; align-items: center; gap: 8px; }
dialog h2 svg { width: 26px; height: 26px; }
dialog p { margin: var(--space-2) 0; }
dialog form button:not(.icon-button) { min-width: 120px; }
.score-head { display: flex; justify-content: space-between; align-items: center; }
.score-head .kicker { justify-content: flex-start; }
.score-head p { margin: 0; }
#offline-hint { color: var(--stink); font-size: .82rem; line-height: 1.3; min-height: 2.6em; margin: var(--space-2) 0 0; }
#offline-hint.quiet { visibility: hidden; }
/* Fixed size: loading, skeleton, and any number of rows never resize the dialog; the list scrolls */
#scores[open] { display: flex; flex-direction: column; height: min(78dvh, 640px); overflow: hidden; }
#score-list { margin: var(--space-2) 0 0; padding: 0 2px 2px 0; list-style: none; counter-reset: rank; display: grid; gap: 6px; align-content: start; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
#score-list li { min-height: 62px; }
#score-list li.skeleton::before { color: transparent; }
#score-list li.skeleton span, #score-list li.skeleton small, #score-list li.skeleton strong { display: block; border-radius: 6px; background: linear-gradient(90deg, #ffffff12, #ffffff26, #ffffff12) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
#score-list li.skeleton span { height: 1.05em; width: 62%; margin-bottom: 4px; }
#score-list li.skeleton small { height: .8em; width: 38%; margin-left: 0; }
#score-list li.skeleton strong { height: 1.3em; width: 40px; }
@keyframes shimmer { to { background-position: -200% 0; } }
#score-list li { counter-increment: rank; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: 'rank name score' 'rank mode score'; column-gap: var(--space-2); align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--ink); }
#score-list li::before { content: counter(rank); grid-area: rank; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #ffffff14; font-weight: 700; color: var(--muted); }
#score-list li:nth-child(1)::before { background: var(--banana); color: var(--ink); }
#score-list li:nth-child(2)::before { background: #d9d6e8; color: var(--ink); }
#score-list li:nth-child(3)::before { background: #e0a070; color: var(--ink); }
#score-list span { grid-area: name; font-weight: 700; overflow-wrap: anywhere; }
#score-list small { grid-area: mode; color: var(--muted); font-size: .76rem; }
#score-list strong { grid-area: score; color: var(--stink); font-size: 1.2rem; font-weight: 700; }
#score-list .empty { display: block; padding: var(--space-4); text-align: center; color: var(--muted); }
#score-list .empty::before { display: none; }
#install-hint h2 { font-size: 1.4rem; }
#install-hint button { margin-top: var(--space-2); }

.toast { z-index: 12; position: fixed; right: var(--space-3); bottom: max(var(--space-3), env(safe-area-inset-bottom)); display: flex; align-items: center; gap: var(--space-3); border: 2px solid var(--ink); border-radius: 14px; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); background: var(--panel-2); box-shadow: 0 4px 0 var(--ink); font-size: .9rem; }
.about-body { width: min(100%, 660px); margin: auto; padding: var(--space-6) var(--space-5); display: grid; gap: var(--space-4); line-height: 1.55; }
.about-body .kicker { justify-content: flex-start; }
.about-body h1 { font-size: 3rem; color: var(--banana); text-shadow: 0 4px 0 var(--ink); }
.about-body h2 { color: var(--cream); }
.about-body code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; }

@media (min-width: 760px) and (min-height: 505px) {
	.control-deck { grid-template-columns: minmax(250px, 320px) minmax(0, 620px); justify-content: center; align-items: center; }
	.item-help { grid-column: 1 / -1; text-align: center; }
	.hud { top: var(--space-3); left: var(--space-4); right: var(--space-4); }
	#map { right: var(--space-4); top: 84px; width: 200px; height: 56px; }
	.zoom-controls { right: var(--space-4); top: 152px; }
	.ticker { left: var(--space-4); right: var(--space-4); max-width: 760px; margin: 0 auto; }
}
@media (orientation: landscape) and (max-height: 505px) {
	.masthead { min-height: 46px; }
	.brand img { width: 32px; height: 32px; }
	.icon-button { width: 44px; height: 44px; min-height: 44px; }
	.install-slot { flex-basis: 44px; height: 44px; }
	.arena:has(.control-deck:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(210px, 30vw); grid-template-rows: 1fr; }
	.control-deck { min-height: 0; overflow: auto; border-top: 0; border-left: 3px solid var(--ink); gap: 6px; align-content: start; padding-top: 6px; }
	.deck-top { grid-template-columns: 1fr; gap: 6px; }
	.deck-top > button { height: 46px; }
	.segmented button { min-height: 40px; }
	.inventory { flex-wrap: wrap; overflow: visible; padding-top: 5px; }
	.item { flex-basis: 54px; min-height: 56px; grid-template-rows: 32px auto; }
	.item canvas { width: 32px; height: 32px; }
	.item-name { font-size: .6rem; }
	.item-help { height: 1.3em; display: block; white-space: nowrap; text-overflow: ellipsis; font-size: .74rem; }
	.hud > div { padding: 4px 8px; }
	.face { width: 36px; height: 36px; }
	#map { right: auto; left: var(--space-2); top: 66px; }
	.overlay { padding: var(--space-2); }
	.hero { display: none; }
	.setup-card { width: min(600px, 100%); padding: var(--space-3) var(--space-4); margin-top: 0; }
	.setup-card h1 { font-size: clamp(2rem, 7vw, 2.8rem); margin: var(--space-1) 0; }
	.setup-card h1 em { display: inline; }
	#setup-form { grid-template-columns: 1.2fr 1fr; margin: var(--space-2) 0 0; }
	#start { grid-column: 1 / -1; min-height: 48px; }
	.small-card { padding: var(--space-3); gap: var(--space-2); }
	.small-card .face.big-face { width: 72px; height: 72px; margin-top: 0; }
	#handoff .menu-card, #finish .menu-card { margin-top: 0; }
	.finish-card { width: min(520px, 100%); }
	#finish-line { display: none; }
	.small-card .face.big-face { width: 60px; height: 60px; }
	.final-score { font-size: 1.3rem; padding: 2px 14px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 430px) {
	.brand { font-size: .92rem; gap: 6px; white-space: nowrap; }
	.brand img { width: 34px; height: 34px; }
	.icon-button { width: 44px; height: 44px; min-height: 44px; }
	.install-slot { flex-basis: 44px; height: 44px; }
}

/* Online play */
.mode-pick button { flex-direction: column; gap: 2px; min-height: 58px; font-size: .78rem; padding: 4px 6px; }
.mode-pick button svg { width: 18px; height: 18px; }
.online-setting { display: grid; gap: var(--space-2); }
.online-setting input, .join-row input { min-width: 0; min-height: 48px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--ink); font-size: 1rem; }
.online-setting .setting input { width: 58%; }
#create-room:not(.primary) { min-height: 48px; font-size: 1rem; }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); }
.join-row input { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; text-align: center; }
.online-status { min-height: 1.3em; font-size: .82rem; color: var(--tidy); }
.online-status.ok { color: var(--stink); }
.lobby-card { gap: var(--space-2); }
.room-code { font: 700 clamp(2.3rem, 12vw, 3.2rem)/1 var(--round); letter-spacing: .14em; white-space: nowrap; color: var(--banana); text-shadow: 0 4px 0 var(--ink); margin: 0; padding-left: .18em; }
#share-room { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seats { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.seats li { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px 0 6px; border-radius: 14px; border: 2px solid var(--ink); background: var(--panel-2); text-align: left; }
.seats li.open { background: transparent; border-style: dashed; border-color: #ffffff24; color: var(--muted); }
.seats canvas { width: 40px; height: 40px; flex-shrink: 0; }
.seats .seat-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seats .tag { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #ffffff1a; color: var(--muted); }
.seats .tag.you { background: var(--banana); color: var(--ink); }
.seats .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--stink); flex-shrink: 0; }
.seats .dot.away { background: #6d6284; }
.control-deck[data-state=remote] .item-help strong { color: var(--banana); }
@media (orientation: landscape) and (max-height: 505px) {
	.lobby-card { width: min(640px, 100%); grid-template-columns: 1fr 1fr; align-items: start; text-align: center; }
	.lobby-card > * { grid-column: 1; }
	.lobby-card .seats, .lobby-card #lobby-status, .lobby-card .finish-actions { grid-column: 2; }
	.lobby-card .seats { grid-row: 1 / span 3; }
	.lobby-card .seats li { height: 44px; }
	.room-code { font-size: 1.9rem; }
	.mode-pick button { min-height: 44px; flex-direction: row; }
	.online-setting { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
	#setup-form:has(#online-setting:not([hidden])) .mode-pick { grid-column: 1 / -1; }
	.online-setting .setting, .online-setting .online-status { grid-column: 1 / -1; }
}

/* Sound settings popover: fixed, so opening it never moves anything */
.sound-panel { position: fixed; z-index: 20; top: calc(env(safe-area-inset-top) + 58px); right: max(var(--space-2), env(safe-area-inset-right)); width: 230px; padding: 6px; display: grid; gap: 4px; border: 2px solid var(--ink); border-radius: 16px; background: var(--panel); box-shadow: 0 4px 0 var(--ink), 0 14px 30px #0b081499; }
.sound-panel button { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 10px 0 12px; border: 0; box-shadow: none; background: transparent; font-weight: 600; border-radius: 10px; }
.sound-panel button:not(:disabled):active { transform: none; box-shadow: none; }
.sound-panel button:focus-visible, .sound-panel button:hover { background: var(--panel-2); }
.sound-panel button:disabled { opacity: .4; }
.sound-panel i { position: relative; width: 40px; height: 24px; border-radius: 12px; background: #6d6284; border: 2px solid var(--ink); flex-shrink: 0; transition: background .15s; }
.sound-panel i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--cream); transition: transform .15s; }
.sound-panel [aria-checked=true] i { background: var(--stink); }
.sound-panel [aria-checked=true] i::after { transform: translateX(16px); }
#sound-all { border-bottom: 1px solid #ffffff1a; border-radius: 10px 10px 4px 4px; }
/* Now playing and Next track: fixed height, one line, so the popover never changes size */
.now-playing { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 44px; padding: 2px 4px 2px 12px; border-top: 1px solid #ffffff1a; }
.now-playing small { color: var(--muted); font-size: .72rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sound-panel #next-track { min-height: 40px; padding: 0 10px; gap: 4px; justify-content: center; background: var(--panel-2); }
.sound-panel #next-track svg { width: 16px; height: 16px; }

/* Feedback */
.menu-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px var(--space-2); }
#feedback form { display: grid; gap: var(--space-2); }
#feedback .field { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; color: var(--muted); }
#feedback .field small { font-weight: 500; }
#feedback textarea, #feedback input, #feedback select { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--ink); color: var(--cream); font: inherit; }
#feedback textarea { resize: vertical; min-height: 104px; }
.owner-note { margin: 0; padding: 8px 10px; border-radius: 10px; background: #a6d65a22; color: var(--stink); font-size: .82rem; }
.feedback-error { min-height: 1.3em; margin: 0 !important; font-size: .82rem; color: var(--tidy); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.feedback-toast { position: fixed; z-index: 30; left: 50%; bottom: max(var(--space-4), env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(92vw, 420px); padding: 10px 16px; border: 2px solid var(--ink); border-radius: 14px; background: var(--cream); color: var(--ink); font-weight: 600; font-size: .9rem; box-shadow: 0 4px 0 var(--ink); text-align: center; pointer-events: none; }
.about-feedback { padding-left: 0; }

/* Profile chip and picker */
.profile-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--space-2); min-height: 44px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--ink); border-color: #ffffff22; font-size: .9rem; max-width: 100%; }
.profile-chip .face { width: 34px; height: 34px; }
.profile-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip svg { width: 14px; height: 14px; color: var(--muted); }
#profile form { display: grid; gap: var(--space-2); }
#profile input { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--ink); color: var(--cream); font: inherit; }
.field-label { margin: 0 !important; font-size: .88rem; font-weight: 600; color: var(--muted); }
.look-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.look-grid button { display: grid; justify-items: center; gap: 2px; min-height: 92px; padding: 6px 4px; border-radius: 14px; font-size: .74rem; }
/* Three looks per row fit any phone: the generic dialog button min-width (120px) made the grid overflow the dialog */
dialog .look-grid button:not(.icon-button) { min-width: 0; }
.look-grid button span { text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.look-grid canvas { width: 58px; height: 58px; }
.look-grid [aria-checked=true] { border-color: var(--banana); background: #4a3d6b; box-shadow: 0 3px 0 var(--ink), 0 0 0 2px var(--ink), 0 0 12px #ffd66b55; }
/* Zoom */
.zoom-controls { position: absolute; right: var(--space-2); top: 132px; display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: 14px; background: #1b1628c0; border: 2px solid var(--ink); }
.zoom-controls .icon-button { width: 40px; height: 40px; min-height: 40px; }
.zoom-controls .icon-button svg { width: 20px; height: 20px; }
.zoom-controls .icon-button::after { top: 50%; right: calc(100% + 8px); transform: translateY(-50%); }
/* Move panel sits in the tray's exact slot */
.move-panel { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 6px; min-height: 72px; }
.move-panel > button { min-height: 60px; display: grid; place-items: center; padding: 0; }
.move-panel svg { width: 26px; height: 26px; }
.move-readout { display: grid; justify-items: center; text-align: center; line-height: 1.2; }
.move-readout strong { color: var(--banana); }
.move-readout small { color: var(--muted); font-size: .76rem; }
.deck-top .segmented button { font-size: .8rem; }
.bot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); }
.bot-row button { display: inline-flex; align-items: center; gap: 6px; }
.seats .remove-bot { width: 32px; height: 32px; min-height: 32px; padding: 0; display: grid; place-items: center; border-radius: 8px; box-shadow: none; }
.seats .remove-bot svg { width: 16px; height: 16px; }
@media (orientation: landscape) and (max-height: 505px) {
	.move-panel { min-height: 56px; }
	.zoom-controls { top: 114px; }
	.zoom-controls .icon-button { width: 38px; height: 38px; min-height: 38px; }
	.profile-chip { margin-top: 2px; min-height: 38px; }
}

/* Compact item picker: two rows, every tile and count visible */
.inventory { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 60px); grid-auto-columns: 54px; gap: 5px; padding: 7px 4px 4px; overflow-x: auto; overflow-y: hidden; }
.inventory .item { flex: none; min-height: 60px; height: 60px; grid-template-rows: 34px auto; padding: 3px 1px 2px; }
.inventory .item canvas { width: 34px; height: 34px; }
.inventory .item-name { font-size: .6rem; }
.inventory .item small { top: -6px; right: -4px; min-width: 18px; height: 18px; font-size: .62rem; }
.inventory .item.special { border-color: #8fd0ff; background: #2c3a5e; }
.inventory .item.special[aria-pressed=true] { border-color: #bfe9ff; background: #39507e; box-shadow: 0 3px 0 var(--ink), 0 0 0 2px var(--ink), 0 0 14px #8fd0ff66; color: #e8fbff; }
.inventory .item.special small { background: #bfe9ff; }
@media (min-width: 760px) and (min-height: 505px) {
	.inventory { grid-auto-columns: 60px; }
}
@media (orientation: landscape) and (max-height: 505px) {
	.inventory { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); grid-auto-rows: 54px; overflow: visible; }
	.inventory .item { height: 54px; min-height: 54px; grid-template-rows: 30px auto; }
	.inventory .item canvas { width: 30px; height: 30px; }
}

/* Until the Last Point */
.setting-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 6px 12px; text-align: left; background: var(--ink); border-color: #ffffff1f; box-shadow: none; }
.setting-switch:not(:disabled):active { transform: none; box-shadow: none; }
.setting-switch span { display: grid; gap: 1px; }
.setting-switch strong { font-size: .92rem; }
.setting-switch small { font-size: .72rem; color: var(--muted); font-weight: 500; }
.setting-switch i { position: relative; width: 44px; height: 26px; border-radius: 13px; background: #6d6284; border: 2px solid var(--ink); flex-shrink: 0; transition: background .15s; }
.setting-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--cream); transition: transform .15s; }
.setting-switch[aria-checked=true] i { background: var(--stink); }
.setting-switch[aria-checked=true] i::after { transform: translateX(18px); }
.setting-switch:disabled { opacity: .7; }
.materials { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 3px 8px; border-radius: 999px; background: #f0a93a26; border: 1px solid #f0a93a66; color: var(--banana); font: 700 .85rem var(--round); flex-shrink: 0; }
.materials svg { width: 14px; height: 14px; }
.materials.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.25); } }
.inventory .item.buy small { background: var(--banana); }
#forage-tab[aria-pressed=true] svg { color: #8fd0ff; }
@media (orientation: landscape) and (max-height: 505px) {
	#setup-form .setting-switch { grid-column: 1 / -1; min-height: 46px; }
}

/* Turn tabs: icon over label so four fit anywhere */
.deck-top .segmented button { flex-direction: column; gap: 1px; min-height: 50px; padding: 3px 2px; font-size: .7rem; line-height: 1.05; }
.deck-top .segmented button svg { width: 18px; height: 18px; }
.deck-top .segmented button span { white-space: nowrap; }
.control-deck { min-width: 0; }
.deck-top { min-width: 0; }
@media (orientation: landscape) and (max-height: 505px) {
	.deck-top .segmented { display: grid; grid-template-columns: 1fr 1fr; }
	.deck-top .segmented button { min-height: 40px; flex-direction: row; gap: 5px; font-size: .74rem; }
	.deck-top .segmented button svg { width: 16px; height: 16px; }
	.arena:has(.control-deck:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(210px, 31vw); }
	.control-deck { overflow-x: hidden; }
}
/* Materials ride on the turn chip's corner, so they never push the name around */
.turn-pill { position: relative; }
.turn-pill .materials { position: absolute; right: -6px; bottom: -11px; margin: 0; padding: 2px 7px; background: #2a2030; border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); font-size: .78rem; }

/* Room talk: chat (and calls) for the seated players of one private room only */
.talk { position: absolute; right: var(--space-2); bottom: 64px; top: var(--space-2); z-index: 4; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; gap: 6px; pointer-events: none; }
.talk[hidden] { display: none; }
.talk > * { pointer-events: auto; }
.talk-toggle { position: relative; width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 16px; display: grid; place-items: center; background: #1b1628e8; }
.talk-toggle svg { width: 22px; height: 22px; }
.talk-toggle[aria-expanded=true] { background: var(--banana); color: var(--ink); }
.talk-badge { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; border: 2px solid var(--ink); background: var(--tidy); color: var(--ink); font: 700 .74rem/18px var(--round); }
.talk-panel { order: -1; width: min(340px, calc(100vw - 2 * var(--space-2))); max-height: 440px; min-height: 0; flex: 0 1 auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid var(--ink); border-radius: 18px; background: var(--panel); box-shadow: 0 4px 0 var(--ink); overflow: hidden; }
.talk-panel[hidden] { display: none; }
.talk-head { display: flex; align-items: center; gap: 6px; }
.talk-head > div { flex: 1; min-width: 0; display: grid; text-align: left; }
.talk-head strong { font-size: 1rem; }
.talk-head small { font-size: .7rem; color: var(--muted); }
.talk-head .icon-button { width: 40px; height: 40px; min-height: 40px; }
.talk-switch { min-height: 48px; }
.talk-people { display: flex; flex-wrap: wrap; gap: 4px; }
.talk-people:empty { display: none; }
.talk-person { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--panel-2); border: 2px solid var(--ink); box-shadow: none; }
.talk-person svg { width: 15px; height: 15px; }
.talk-person[aria-pressed=true] { opacity: .6; text-decoration: line-through; }
.talk-log { flex: 1 1 auto; list-style: none; margin: 0; padding: 4px 2px; overflow-y: auto; display: grid; align-content: start; gap: 4px; min-height: 60px; text-align: left; overscroll-behavior: contain; }
.talk-log li { font-size: .86rem; line-height: 1.25; overflow-wrap: anywhere; }
.talk-log li b { font-weight: 700; margin-right: 4px; }
.talk-log li.mine { color: var(--cream); }
.talk-log li.system { color: var(--muted); font-style: italic; font-size: .78rem; }
.talk-off { margin: 0; font-size: .82rem; color: var(--muted); text-align: left; }
.talk-quick { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.talk-quick button { flex-shrink: 0; min-height: 34px; padding: 0 10px; border-radius: 999px; font-size: .78rem; box-shadow: none; }
.talk-form { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 6px; }
.talk-form input { min-width: 0; min-height: 44px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--ink); font-size: 1rem; }
.talk-form button { min-height: 44px; padding: 0; display: grid; place-items: center; }
.talk-form button svg { width: 20px; height: 20px; }
.talk-error { margin: 0; min-height: 0; font-size: .74rem; color: var(--tidy); text-align: left; }
.talk-error:empty { display: none; }
.talk-panel > * { flex-shrink: 0; }
.talk-panel > .talk-log { flex-shrink: 1; }
.talk-panel.chat-off .talk-log, .talk-panel.chat-off .talk-quick, .talk-panel.chat-off .talk-form { display: none; }
@media (min-width: 760px) and (min-height: 505px) { .talk { right: var(--space-4); bottom: 70px; } }
@media (orientation: landscape) and (max-height: 505px) {
	.talk { bottom: 60px; }
	.talk-panel { width: min(320px, calc(100vw - 260px)); }
	.talk-toggle { width: 44px; height: 44px; min-height: 44px; }
}
.call-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.call-bar:not(:has(> :not([hidden]))) { display: none; }
.call-bar button { flex: 1 1 auto; min-height: 42px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .84rem; box-shadow: none; }
.call-bar svg, .call-quick svg { width: 18px; height: 18px; }
#call-leave, #quick-leave { background: #7a2f3c; }
#call-mic[aria-pressed=true], #quick-mic[aria-pressed=true] { background: var(--stink); color: var(--ink); }
[aria-pressed=true] > .when-off, [aria-pressed=false] > .when-on { display: none; }
.when-on, .when-off { display: inline-grid; }
.call-note { margin: 0; font-size: .74rem; color: var(--muted); text-align: left; }
.call-note:empty { display: none; }
.call-quick { display: flex; gap: 6px; }
.call-quick[hidden] { display: none; }
.call-quick button { width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; border-radius: 14px; background: #1b1628e8; }
.talk-toggle.in-call { box-shadow: 0 0 0 3px var(--stink), 0 3px 0 var(--ink); }
.talk-person .call-state { display: inline-grid; color: var(--muted); }
.talk-person .call-state.live { color: var(--stink); }
.talk-person .call-state.connecting { opacity: .5; }
.talk { flex-direction: column; }
.call-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.call-tiles:empty { display: none; }
.call-tiles figure { position: relative; margin: 0; aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: #0e0b14; }
.call-tiles video { width: 100%; height: 100%; object-fit: cover; display: block; }
.call-tiles .mirror video { transform: scaleX(-1); }
.call-tiles figcaption { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 8px; background: #17121fcc; font-size: .7rem; font-weight: 700; }
#call-cam[aria-pressed=true] { background: var(--stink); color: var(--ink); }
.talk-panel { overflow-y: auto; }
.talk-host { display: grid; gap: 4px; padding-top: 6px; border-top: 2px solid #ffffff14; }
.talk-host[hidden] { display: none; }
.talk-host .field-label { margin: 0; font-size: .7rem; color: var(--muted); text-align: left; letter-spacing: .04em; }
.talk-host .setting-switch { min-height: 44px; padding: 4px 10px; }
.talk-host .setting-switch small { display: none; }

/* Game menu: pauses a local turn and keeps feedback, About, and New game one tap away without losing the match */
.game-menu { display: grid; gap: var(--space-2); }
.game-menu .menu-note { margin: 0; color: var(--muted); font-size: .86rem; }
.menu-list { display: grid; gap: 8px; }
.menu-list > button, .menu-link { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; width: 100%; }
.menu-list svg { width: 20px; height: 20px; }
.menu-link { padding: 0 var(--space-3); border: 2px solid var(--ink); border-radius: 14px; background: var(--panel-2); color: var(--cream); font-weight: 600; text-decoration: none; box-shadow: 0 3px 0 var(--ink); }
.menu-confirm { display: grid; gap: var(--space-2); text-align: center; }
.menu-confirm[hidden], .menu-list[hidden] { display: none; }
#menu-new { color: var(--tidy); }

/* Pause: a button atop the zoom column, a vote banner over the field, and a paused overlay (no layout shift) */
.zoom-controls .pause-button { border-bottom: 2px solid #ffffff1a; border-radius: 12px 12px 6px 6px; }
.zoom-controls .pause-button[aria-pressed=true] { color: var(--banana); }
.pause-vote { position: absolute; z-index: 3; top: 70px; left: var(--space-2); right: 64px; max-width: 360px; padding: 10px 12px; display: grid; gap: 6px; border: 2px solid var(--ink); border-radius: 16px; background: #1b1628f2; box-shadow: 0 4px 0 var(--ink); text-align: left; }
.pause-vote[hidden], .pause-overlay[hidden] { display: none; }
.pause-vote p { margin: 0; font-size: .86rem; font-weight: 600; }
.pause-voters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.pause-vote .pause-voters { justify-content: flex-start; }
.pause-voters li { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 9px; border-radius: 999px; background: var(--panel-2); border: 2px solid var(--ink); font-size: .76rem; font-weight: 700; }
.pause-voters li.yes { background: var(--stink); color: var(--ink); }
.pause-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pause-actions[hidden] { display: none; }
.pause-actions button { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pause-card { width: min(380px, 100%); }
.pause-card .pause-actions { justify-content: center; flex-wrap: wrap; }
.pause-card .pause-actions .big { flex: 1 1 auto; }
.pause-card #pause-note { color: var(--muted); font-size: .92rem; }
.pause-overlay { z-index: 3; }
@media (orientation: landscape) and (max-height: 505px) { .pause-vote { top: 56px; } }
@media (min-width: 760px) and (min-height: 505px) { .pause-vote { left: 50%; right: auto; width: 360px; transform: translateX(-50%); top: 84px; } }

/* The camera gallery floating (Picture-in-Picture) or popped out into its own window */
body.call-away { margin: 0; min-height: 100vh; display: grid; grid-template-rows: 1fr auto; background: #17121f; color: var(--cream, #fff4dc); }
body.call-away .call-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-content: center; gap: 8px; padding: 8px; }
body.call-away .call-tiles:empty { display: grid; place-items: center; }
body.call-away .call-tiles:empty::before { content: 'Cameras show up here when players turn them on.'; color: #cbbfe0; font: 600 .9rem system-ui, sans-serif; }
body.call-away .call-tiles figure { aspect-ratio: 4 / 3; }
body.call-away .call-tiles figcaption { font-size: .9rem; }
.call-away-note { margin: 0; padding: 4px 10px 8px; font: 600 .72rem system-ui, sans-serif; color: #cbbfe0; text-align: center; }

/* Up to ten seats: two compact columns once there are more than four */
.seats.many { grid-template-columns: minmax(0, 1fr); gap: 4px; }
/* Two columns only where names still fit; narrow phones get one compact column */
@media (min-width: 480px) { .seats.many { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; } }
.seats.many li { height: 40px; gap: 6px; padding: 0 6px 0 4px; border-radius: 12px; }
.seats.many canvas { width: 32px; height: 32px; }
.seats.many .seat-name { font-size: .84rem; }
.seats.many .tag { font-size: .58rem; padding: 1px 5px; }
.seats.many li.open { font-size: .78rem; justify-content: center; }
.seats.many .remove-bot { width: 30px; height: 30px; min-height: 30px; }
@media (orientation: landscape) and (max-height: 505px) { .seats.many li { height: 38px; } .seats.many canvas { width: 28px; height: 28px; } }

/* Voice and video need everyone signed in to Kody */
.call-gate { display: grid; gap: 6px; padding: 8px 10px; border: 2px dashed #ffffff24; border-radius: 12px; text-align: left; }
.call-gate[hidden] { display: none; }
.call-gate p { margin: 0; font-size: .82rem; color: var(--muted); }
.call-gate .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 14px; font-weight: 700; text-decoration: none; color: var(--ink); background: linear-gradient(var(--banana), var(--banana-deep)); box-shadow: 0 3px 0 var(--ink); }
.call-gate .button[hidden] { display: none; }
.call-gate .button svg { width: 18px; height: 18px; }
