:root {
  color-scheme: dark;
  --bg: #171b25;
  --bg-deep: #0d1018;
  --panel: rgba(35, 42, 54, .9);
  --panel-solid: #303848;
  --panel-soft: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .13);
  --line-bright: rgba(255, 255, 255, .28);
  --ink: #f4f5f6;
  --muted: #b6bdc9;
  --pink: #ff4058;
  --pink-bright: #ff6b7d;
  --purple: #7b6cff;
  --violet: #51438f;
  --cyan: #35e0cd;
  --yellow: #ffd166;
  --green: #49dda5;
  --red: #ff4058;
  --seat-1: #ff4058;
  --seat-2: #7b6cff;
  --seat-3: #35e0cd;
  --seat-4: #ffb84a;
  --shadow: 0 24px 80px rgba(0, 0, 0, .5);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--bg); }
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 18% 5%, rgba(123, 108, 255, .24), transparent 34%),
    radial-gradient(circle at 88% 90%, rgba(255, 64, 88, .18), transparent 34%),
    radial-gradient(circle, rgba(255,255,255,.09) 1px, transparent 1.5px);
  background-size: auto, auto, 28px 28px;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .38; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
[hidden] { display: none !important; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(13, 16, 24, .76);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, textarea:focus, select:focus { border-color: rgba(255, 64, 88, .8); background: rgba(30, 36, 48, .96); box-shadow: 0 0 0 4px rgba(255,64,88,.12); }
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: #d3d6da; font-size: .78rem; font-weight: 750; }

.eyebrow { margin: 0 0 7px; color: var(--pink-bright); font-size: .68rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: .96rem; font-weight: 900; letter-spacing: .03em; }
.brand b { color: var(--pink-bright); }
.brand-mark { display: grid; width: 34px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 11px; background: linear-gradient(145deg, var(--pink), var(--purple)); box-shadow: 0 6px 20px rgba(255,64,88,.28); color: white; font-size: .92rem; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 15px;
  color: white;
  font-size: .8rem;
  font-weight: 850;
  text-decoration: none;
  transition: transform .14s, filter .14s, border-color .14s, background .14s;
}
.button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { background: linear-gradient(135deg, #ff6b7d, #d91f40); box-shadow: 0 10px 28px rgba(255,64,88,.25); }
.button-secondary { background: linear-gradient(135deg, #667cff, #7b6cff); box-shadow: 0 10px 28px rgba(93,82,224,.28); }
.button-warn { color: #281404; background: linear-gradient(135deg, #ffe37b, #ffaf47); }
.button-success { color: #041f19; background: linear-gradient(135deg, #65efd0, #38c69e); }
.button-danger { border-color: rgba(255,92,115,.28); color: #ffc8d1; background: rgba(255,92,115,.13); }
.button-ghost, .button-plain { border-color: var(--line); color: #edf0f2; background: rgba(255,255,255,.055); }
.compact-button { min-height: 36px; padding: 8px 11px; font-size: .72rem; }

.status-message { min-height: 1.1rem; margin: 14px 0 0; color: var(--muted); text-align: center; font-size: .78rem; font-weight: 750; }
.status-error { color: #ff91a7; }
.status-ok { color: #75ecd5; }
.floating-status { position: fixed; z-index: 30; right: 22px; top: 82px; max-width: 440px; min-height: 0; margin: 0; border-radius: 10px; padding: 0; background: transparent; }
.floating-status:not(:empty) { border: 1px solid var(--line); padding: 10px 14px; background: rgba(23,27,37,.96); box-shadow: var(--shadow); }

/* Landing */
.landing { overflow-x: hidden; background: #141923; }
.landing-shell { width: min(1260px, calc(100% - 40px)); margin: 0 auto; padding: 25px 0 34px; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.live-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: #c5c9ce; font-size: .64rem; font-weight: 850; letter-spacing: .11em; }
.live-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255,92,115,.13); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .48; transform: scale(.8); } }

.hero { position: relative; display: grid; min-height: 445px; grid-template-columns: .86fr 1.14fr; align-items: center; gap: 48px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 30px; padding: clamp(34px, 5vw, 70px); background: linear-gradient(122deg, rgba(23,27,37,.98), rgba(79,61,119,.96) 48%, rgba(168,62,81,.95)); box-shadow: var(--shadow); }
.hero::after { position: absolute; inset: 0; pointer-events: none; content: ""; opacity: .35; background-image: radial-gradient(circle, rgba(255,255,255,.3) 1px, transparent 1.5px); background-size: 25px 25px; mask-image: linear-gradient(90deg, transparent, black); }
.hero-copy-block { position: relative; z-index: 2; }
.hero h1 { margin: 0 0 19px; font-size: clamp(3rem, 6.4vw, 6.3rem); line-height: .86; letter-spacing: -.075em; }
.hero h1 em { color: #ffb7c4; font-style: normal; }
.hero-copy { max-width: 550px; margin-bottom: 22px; color: #e3e5e8; font-size: clamp(.92rem, 1.25vw, 1.08rem); line-height: 1.65; }
.feature-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.feature-pills span, .tag { border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 7px 10px; color: #f0f1f3; background: rgba(13,16,24,.3); font-size: .66rem; font-weight: 800; }

.hero-demo { position: relative; z-index: 1; min-height: 310px; border: 1px solid rgba(255,255,255,.24); border-radius: 22px; padding: 21px; background: rgba(23,27,37,.48); box-shadow: 0 25px 60px rgba(0,0,0,.34); transform: perspective(1100px) rotateY(-6deg) rotateX(2deg); }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.demo-top span, .demo-top b { border-radius: 999px; padding: 7px 12px; background: rgba(48,56,72,.82); font-size: clamp(.52rem, 1vw, .7rem); }
.demo-rail { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin: 56px 5px 0; }
.demo-rail::before { position: absolute; top: 5px; right: 0; left: 0; height: 2px; content: ""; background: rgba(255,255,255,.68); }
.demo-rail i { position: relative; height: 55px; border-top: 11px solid transparent; }
.demo-rail i::before { position: absolute; top: -12px; left: 50%; width: 2px; height: 9px; content: ""; background: white; }
.demo-rail .filled { border: 1px solid rgba(255,255,255,.3); border-radius: 7px; background: linear-gradient(145deg, #ff4058, #a83e51); box-shadow: 0 5px 18px rgba(0,0,0,.2); }
.demo-candidate { display: grid; width: 48px; aspect-ratio: .8; margin: 19px auto 13px; place-items: center; border: 2px solid #ff9a4f; border-radius: 8px; background: rgba(255,255,255,.12); box-shadow: 0 0 20px rgba(255,137,69,.5); font-size: 1.3rem; font-weight: 950; }
.demo-seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.demo-seats span { height: 42px; border: 2px solid var(--seat-1); border-radius: 7px; background: rgba(13,16,24,.58); }
.demo-seats span:nth-child(2) { border-color: var(--seat-2); }
.demo-seats span:nth-child(3) { border-color: var(--seat-3); }
.demo-seats span:nth-child(4) { border-color: var(--seat-4); }

.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.entry-card { position: relative; min-height: 300px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; padding: 28px; background: rgba(35,42,54,.88); box-shadow: 0 16px 50px rgba(0,0,0,.24); }
.entry-card::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; content: ""; background: linear-gradient(90deg, var(--pink), transparent); }
.player-entry::before { background: linear-gradient(90deg, var(--purple), var(--cyan), transparent); }
.entry-number { position: absolute; right: 22px; top: 12px; color: rgba(255,255,255,.055); font-size: 5.3rem; font-weight: 950; letter-spacing: -.09em; }
.entry-card h2 { position: relative; margin: 0 0 8px; font-size: 1.8rem; letter-spacing: -.045em; }
.entry-card > p:not(.eyebrow) { position: relative; max-width: 540px; min-height: 42px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.entry-card form { position: relative; margin-top: 20px; }
.input-action { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.join-fields { display: grid; grid-template-columns: .55fr 1fr; gap: 8px; }
.player-entry form > .button { width: 100%; margin-top: 10px; }
.code-input { text-transform: uppercase; letter-spacing: .16em; font-weight: 900; }
.landing-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin-top: 25px; color: #858b93; font-size: .66rem; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }

/* Shared app chrome */
.app-shell { width: min(1740px, calc(100% - 28px)); margin: 0 auto; padding: 14px 0 44px; }
.topbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 16px; padding: 10px 13px; background: rgba(35,42,54,.88); box-shadow: 0 12px 40px rgba(0,0,0,.24); backdrop-filter: blur(16px); }
.room-badge { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; background: rgba(13,16,24,.58); }
.room-badge span { color: var(--muted); font-size: .61rem; font-weight: 900; letter-spacing: .13em; }
.room-badge code { color: var(--yellow); font-size: .92rem; font-weight: 950; letter-spacing: .14em; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: 0 18px 60px rgba(0,0,0,.3); backdrop-filter: blur(14px); }
.panel-heading, .preview-toolbar, .workshop-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 17px 18px; }
.panel-heading h2, .preview-toolbar h2, .workshop-header h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.03em; }
.state-badge, .round-pill { border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 9px; color: #eceef0; background: rgba(13,16,24,.5); font-size: .62rem; font-weight: 900; letter-spacing: .09em; }

/* Host */
.director-grid { display: grid; grid-template-columns: 290px minmax(560px, 1fr) 370px; gap: 13px; margin-top: 13px; align-items: stretch; }
.director-controls, .players-panel, .live-preview { min-height: 620px; }
.director-controls { display: flex; flex-direction: column; }
.director-primary { display: grid; gap: 7px; padding: 14px; }
.director-primary .button, .director-secondary .button { margin: 0; }
.director-main-button { min-height: 56px; font-size: .9rem; }
.director-secondary { display: grid; grid-template-columns: 1fr; gap: 7px; border-top: 1px solid var(--line); padding: 14px; }
.metric-row { display: grid; grid-template-columns: repeat(3,1fr); margin-top: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { min-width: 0; padding: 13px 10px; text-align: center; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric span { display: block; overflow: hidden; color: var(--muted); font-size: .57rem; font-weight: 850; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.metric b { display: block; margin-top: 4px; color: white; font-size: 1.12rem; }
.metric b i { color: var(--yellow); font-style: normal; }

.live-preview { position: relative; display: flex; flex-direction: column; }
.preview-toolbar { background: linear-gradient(90deg, rgba(80,68,145,.25), rgba(255,64,88,.18)); }
.question-preview { display: flex; min-height: 0; flex: 1; flex-direction: column; align-items: center; justify-content: flex-start; overflow: auto; padding: 25px; text-align: center; background: linear-gradient(135deg, rgba(72,62,126,.26), rgba(255,64,88,.12)), radial-gradient(circle at center, rgba(53,224,205,.07), transparent 62%); }
.question-preview > h1 { max-width: 940px; margin: 0; font-size: clamp(1.8rem, 3vw, 3.5rem); line-height: 1.04; letter-spacing: -.055em; }
.preview-media { display: grid; max-width: 680px; place-items: center; margin-top: 16px; }
.preview-media img, .preview-media video { max-width: 100%; max-height: 220px; border-radius: 15px; object-fit: contain; box-shadow: 0 16px 45px rgba(0,0,0,.25); }
.preview-media .media-audio-trigger { min-width: 280px; }
.host-camera-preview { position: absolute; z-index: 5; bottom: 15px; left: 15px; width: 170px; overflow: hidden; border: 2px solid var(--cyan); border-radius: 12px; background: #0d1018; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.host-camera-preview video { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; transform: scaleX(-1); }
.host-camera-preview span { position: absolute; bottom: 5px; left: 5px; border-radius: 5px; padding: 4px 6px; background: rgba(13,16,24,.84); font-size: .55rem; font-weight: 900; }

.players-panel { display: flex; flex-direction: column; }
.host-player-controls { display: grid; gap: 8px; padding: 12px; }
.player-control-row { --seat-color: var(--seat-1); display: grid; min-height: 88px; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 7px 8px; border: 1px solid var(--line); border-left: 3px solid var(--seat-color); border-radius: 13px; padding: 9px; background: rgba(255,255,255,.038); }
.player-control-row.seat-2 { --seat-color: var(--seat-2); }
.player-control-row.seat-3 { --seat-color: var(--seat-3); }
.player-control-row.seat-4 { --seat-color: var(--seat-4); }
.player-control-row.active-turn { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,212,90,.1), 0 0 22px rgba(255,190,70,.16); }
.player-control-row.empty { grid-template-rows: 1fr; min-height: 66px; opacity: .48; }
.seat-number { display: grid; grid-row: 1 / 3; width: 26px; aspect-ratio: 1; place-items: center; border-radius: 8px; color: #171b25; background: var(--seat-color); font-size: .7rem; font-weight: 950; }
.empty-seat-label { color: var(--muted); font-size: .72rem; font-weight: 720; }
.player-control-name { display: grid; min-width: 0; }
.player-control-name strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.player-control-name small { color: var(--green); font-size: .47rem; font-weight: 900; letter-spacing: .1em; }
.player-control-row.offline .player-control-name small { color: var(--red); }
.player-score-box { display: grid; justify-items: end; gap: 1px; }
.player-control-score { color: var(--yellow); font-size: .73rem; }
.player-round-score { color: #7bf0d1; font-size: .46rem; font-weight: 950; letter-spacing: .06em; white-space: nowrap; }
.player-round-score.negative { color: #ff91a7; }
.player-control-actions { display: flex; grid-column: 2 / -1; align-items: center; flex-wrap: wrap; gap: 4px; }
.player-control-actions > .heart-row { margin-right: auto; }
.point-button { border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; color: white; background: rgba(255,255,255,.06); font-size: .56rem; font-weight: 850; }
.point-button.negative { color: #ff9aac; }
.point-button.positive, .point-button.life { color: #79e7ca; }
.point-button.focus, .point-button.turn { color: #d7dbe0; }
.leaderboard-block { margin-top: auto; border-top: 1px solid var(--line); padding: 13px; }
.mini-heading { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: .58rem; font-weight: 900; letter-spacing: .11em; }
.mini-heading small { color: var(--green); }

.leader-list { display: grid; gap: 6px; }
.leader-row { display: grid; min-height: 38px; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 7px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; padding: 6px 8px; background: rgba(255,255,255,.035); font-size: .72rem; }
.leader-place { color: var(--yellow); font-weight: 950; }
.leader-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-row strong { color: #fff; font-size: .68rem; }
.muted { color: var(--muted); font-size: .75rem; }

.quiz-workshop { margin-top: 13px; }
.workshop-header > div:first-child > p:last-child { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.quiz-library { display: flex; align-items: center; gap: 7px; }
.quiz-library select { min-width: 230px; padding: 9px 11px; font-size: .72rem; }
.editor-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 18px; background: rgba(13,16,24,.18); }
.editor-toolbar label { grid-template-columns: auto minmax(220px, 430px); align-items: center; }
.editor-toolbar input { padding: 9px 10px; }
.question-editor-list { display: grid; max-height: 760px; gap: 10px; overflow: auto; padding: 14px 18px; }
.edit-question { border: 1px solid var(--line); border-radius: 15px; padding: 14px; background: rgba(23,27,37,.42); }
.edit-question-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.edit-question-head strong { color: var(--pink-bright); font-size: .67rem; letter-spacing: .1em; }
.icon-button { border: 0; border-radius: 7px; padding: 6px 9px; color: #ffc0cc; background: rgba(255,92,115,.1); font-size: .63rem; font-weight: 800; }
.question-fields { display: grid; grid-template-columns: minmax(180px,1fr) 190px 95px 95px; gap: 8px; }
.question-fields .wide { grid-column: 1 / -1; }
.question-fields textarea { min-height: 72px; }
.mini-field { gap: 3px; font-size: .57rem; }
.mini-field input { padding: 9px; }
.manual-round-field { min-height: 37px; align-content: center; border: 1px solid var(--line); border-radius: 11px; padding: 5px 10px; background: rgba(13,16,24,.48); }
.manual-round-field span { color: var(--muted); font-size: .5rem; font-weight: 800; text-transform: uppercase; }
.manual-round-field strong { color: var(--cyan); font-size: .67rem; letter-spacing: .08em; }
.option-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.option-input { display: flex; align-items: center; gap: 7px; }
.option-input input[type="radio"] { width: auto; accent-color: var(--pink); }
.option-input .question-option { min-width: 0; padding: 9px; }
.board-entries-label { grid-column: 1 / -1; }
.board-entries-label textarea { min-height: 185px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; line-height: 1.45; }
.board-entries-label small { color: var(--muted); font-size: .61rem; }
.rank-editor-labels { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(4,1fr); gap: 7px; }
.estimate-editor-note { display: grid; grid-column: 1 / -1; gap: 5px; border: 1px solid rgba(85,230,219,.26); border-radius: 12px; padding: 13px 15px; color: #d9fff9; background: rgba(44,183,162,.07); }
.estimate-editor-note strong { font-size: .7rem; letter-spacing: .05em; }
.estimate-editor-note span { color: #b9bec5; font-size: .64rem; line-height: 1.5; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 13px 18px; background: rgba(13,16,24,.24); }
.editor-save-actions { display: flex; align-items: center; gap: 7px; }
.editor-save-actions input { width: 190px; }

.host-board-controls { display: grid; width: 100%; grid-template-columns: repeat(auto-fit,minmax(74px,1fr)); gap: 7px; margin-top: 18px; }
.host-control-hint { grid-column: 1 / -1; margin: 0 0 3px; color: #c8ccd1; font-size: .68rem; font-weight: 720; line-height: 1.45; }
.host-list-turn { display: flex; grid-column: 1 / -1; min-height: 58px; align-items: center; justify-content: center; gap: 12px; border: 1px solid rgba(255,181,71,.48); border-radius: 13px; padding: 10px 14px; background: rgba(255,157,57,.1); }
.host-list-turn span { color: var(--yellow); font-size: .56rem; font-weight: 950; letter-spacing: .12em; }
.host-list-turn strong { font-size: 1rem; }
.host-list-turn small { color: var(--red); font-size: .9rem; letter-spacing: .06em; }
.host-list-wrong { grid-column: 1 / -1; justify-self: center; width: min(100%,360px); }
.host-list-award-pickers { display: flex; grid-column: 1 / -1; flex-wrap: wrap; justify-content: center; gap: 5px; margin-bottom: 4px; }
.host-list-award-picker { border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; color: #d2d5d9; background: rgba(255,255,255,.045); font-size: .58rem; font-weight: 850; }
.host-list-award-picker:hover, .host-list-award-picker.selected { border-color: var(--yellow); color: var(--yellow); background: rgba(255,212,90,.1); }
.board-tile { display: grid; min-width: 0; max-width: 100%; min-height: 52px; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 6px; color: #f0f1f3; background: rgba(168,62,81,.3); font-size: clamp(.62rem,.72vw,.72rem); font-weight: 850; line-height: 1.18; overflow-wrap: anywhere; hyphens: auto; white-space: normal; word-break: normal; text-align: center; }
.host-board-controls .board-tile:not(.revealed) { border-style: dashed; color: #bdc1c7; background: rgba(255,255,255,.055); }
button.board-tile:hover:not(:disabled) { border-color: var(--cyan); }
.board-tile.revealed { border-color: rgba(85,230,219,.52); color: #a3fff2; background: rgba(35,185,159,.18); }

.host-answer-controls { display: grid; width: 100%; gap: 9px; margin-top: 18px; text-align: left; }
.host-answer-row { --seat-color: var(--seat-1); display: grid; gap: 8px; border: 1px solid var(--line); border-left: 3px solid var(--seat-color); border-radius: 12px; padding: 10px; background: rgba(13,16,24,.34); }
.host-answer-row.seat-2 { --seat-color: var(--seat-2); }
.host-answer-row.seat-3 { --seat-color: var(--seat-3); }
.host-answer-row.seat-4 { --seat-color: var(--seat-4); }
.host-answer-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.host-answer-row-head strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.host-answer-row-head span { color: var(--muted); font-size: .56rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.host-answer-row-head span.is-correct { color: #7bf0d1; }
.host-answer-row-head span.is-wrong { color: #ff91a7; }
.host-choice-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.host-choice-button { display: grid; min-width: 0; min-height: 41px; grid-template-columns: 25px minmax(0,1fr); align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 5px 8px; color: white; background: rgba(69,74,81,.22); text-align: left; }
.host-choice-button b { display: grid; width: 23px; aspect-ratio: 1; place-items: center; border-radius: 6px; color: #d9dde1; background: rgba(127,145,170,.2); font-size: .58rem; }
.host-choice-button span { overflow: hidden; font-size: .65rem; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.host-choice-button:hover, .host-choice-button.selected { border-color: var(--yellow); background: rgba(255,212,90,.1); }
.host-choice-button.correct-answer { box-shadow: inset 0 0 0 1px rgba(67,216,158,.65); }
.host-order-selected, .host-order-available { display: flex; min-height: 42px; align-items: center; flex-wrap: wrap; gap: 5px; border-radius: 9px; padding: 6px; }
.host-order-selected { border: 1px dashed rgba(85,230,219,.38); background: rgba(85,230,219,.045); }
.host-order-available { border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.025); }
.host-order-empty { width: 100%; color: var(--muted); font-size: .61rem; text-align: center; }
.host-order-chip { display: inline-flex; min-height: 30px; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; color: white; background: rgba(69,74,81,.24); font-size: .6rem; font-weight: 800; }
.host-order-chip.selected { border-color: rgba(85,230,219,.35); color: #aefff5; background: rgba(85,230,219,.09); }
.host-order-chip b { display: grid; width: 18px; aspect-ratio: 1; place-items: center; border-radius: 5px; color: #081b18; background: var(--cyan); font-size: .5rem; }
.host-order-actions { display: flex; justify-content: flex-end; gap: 6px; }
.host-order-solution { display: grid; gap: 5px; border: 1px solid rgba(67,216,158,.35); border-radius: 11px; padding: 10px; color: #b9ffee; background: rgba(67,216,158,.07); text-align: center; }
.host-order-solution b { font-size: .56rem; letter-spacing: .11em; }
.host-order-solution span { font-size: .7rem; font-weight: 800; }
.host-estimate-solution { display: grid; gap: 5px; border: 1px solid rgba(85,230,219,.34); border-radius: 11px; padding: 11px 13px; color: #d8fff9; background: rgba(39,184,157,.08); text-align: center; }
.host-estimate-solution b { color: var(--cyan); font-size: .56rem; letter-spacing: .12em; }
.host-estimate-solution span { font-size: .76rem; font-weight: 800; }
.host-estimate-row { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
.host-estimate-row .host-answer-row-head { grid-column: 1 / -1; }
.host-estimate-row.is-awarded { border-color: rgba(85,230,219,.5); background: rgba(39,184,157,.08); box-shadow: 0 0 0 2px rgba(85,230,219,.06); }
.host-estimate-answer { min-width: 0; overflow-wrap: anywhere; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: 10px 12px; color: white; background: rgba(255,255,255,.045); font-size: .82rem; font-weight: 850; }
.host-estimate-answer.is-empty { color: var(--muted); font-weight: 700; }
.host-buzzer-status-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.host-buzzer-status { --seat-color: var(--seat-1); display: grid; gap: 4px; border: 1px solid var(--line); border-top: 3px solid var(--seat-color); border-radius: 11px; padding: 10px; background: rgba(255,255,255,.04); text-align: center; }
.host-buzzer-status.seat-2 { --seat-color: var(--seat-2); }
.host-buzzer-status.seat-3 { --seat-color: var(--seat-3); }
.host-buzzer-status.seat-4 { --seat-color: var(--seat-4); }
.host-buzzer-status strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.host-buzzer-status span { color: var(--cyan); font-size: .52rem; font-weight: 950; letter-spacing: .09em; }
.host-buzzer-status.is-current { border-color: var(--yellow); background: rgba(255,212,90,.12); box-shadow: 0 0 22px rgba(255,181,71,.15); }
.host-buzzer-status.is-current span { color: var(--yellow); }
.host-buzzer-status.is-locked { opacity: .48; filter: saturate(.35); }
.host-buzzer-current { display: grid; min-height: 88px; place-items: center; align-content: center; gap: 5px; border: 1px dashed rgba(255,255,255,.18); border-radius: 15px; background: rgba(255,255,255,.035); text-align: center; }
.host-buzzer-current span { color: var(--muted); font-size: .58rem; font-weight: 950; letter-spacing: .13em; }
.host-buzzer-current strong { font-size: clamp(1.2rem,2.4vw,2.1rem); }
.host-buzzer-current.claimed { border-style: solid; border-color: rgba(255,92,115,.62); background: rgba(255,65,101,.12); box-shadow: 0 0 30px rgba(255,65,101,.12); }
.host-buzzer-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }

/* Rank / Higher-Lower board */
.host-rank-board { width: 100%; }
.rank-board { display: grid; width: 100%; gap: 8px; overflow-x: auto; padding: 3px 2px 5px; scrollbar-width: thin; }
.rank-scale-head, .rank-scale-values { display: flex; width: min(100%,900px); align-items: center; justify-content: space-between; justify-self: center; color: rgba(255,255,255,.7); font-size: .56rem; font-weight: 850; }
.rank-scale-values { color: white; font-size: .62rem; }
.rank-rail { display: flex; width: max-content; min-width: min(100%,280px); max-width: none; min-height: 92px; align-items: center; justify-content: center; justify-self: start; gap: 7px; margin-inline: auto; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; padding: 10px 13px; background: rgba(13,16,24,.28); }
.rank-placed-card { width: clamp(66px,7.4vw,92px); height: 76px; flex: 0 0 auto; }
.rank-placed-card img { height: 49px; }
.rank-direction-arrow { flex: 0 0 auto; color: rgba(255,255,255,.55); font-size: .85rem; font-weight: 950; }
.rank-rail-empty { padding: 12px 22px; color: var(--muted); font-size: .65rem; font-weight: 800; }
.rank-card { position: relative; display: grid; min-width: 0; height: 66px; grid-template-rows: 1fr auto; align-items: center; justify-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.24); border-radius: 7px; padding: 3px; color: white; background: linear-gradient(155deg, rgba(123,108,255,.66), rgba(255,64,88,.4)); box-shadow: 0 5px 15px rgba(0,0,0,.2); }
button.rank-card { width: 100%; font: inherit; }
.rank-card.is-selectable { cursor: pointer; transition: border-color .14s, filter .14s, transform .14s; }
.rank-card.is-selectable:hover, .rank-card.is-selectable:focus-visible { border-color: var(--yellow); filter: brightness(1.18); outline: 2px solid rgba(255,212,90,.42); outline-offset: 1px; transform: translateY(-3px); }
.rank-card img { min-width: 0; width: 100%; height: 42px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.3)); }
.rank-card-fallback { display: grid; width: 29px; aspect-ratio: 1; place-items: center; border-radius: 50%; color: #fff; background: rgba(255,255,255,.13); font-size: .82rem; font-weight: 950; }
.rank-card strong { overflow: hidden; width: 100%; font-size: clamp(.38rem,.65vw,.56rem); line-height: 1; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.rank-card small { position: absolute; right: 2px; bottom: 16px; left: 2px; border-radius: 4px; padding: 2px; color: var(--yellow); background: rgba(13,16,24,.8); font-size: .43rem; font-weight: 900; }
.rank-card.is-correct { border-color: #72f1ce; box-shadow: 0 0 0 2px rgba(72,222,177,.28), 0 0 18px rgba(72,222,177,.45); }
.rank-card.is-wrong { border-color: #ff7489; box-shadow: 0 0 0 2px rgba(255,92,115,.25), 0 0 18px rgba(255,72,105,.4); }
.rank-candidate-zone { display: grid; justify-items: center; gap: 5px; min-width: 0; }
.rank-candidate-zone > span, .rank-pool-zone > span { color: #dfe2e5; font-size: .55rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.rank-candidate-zone .rank-card { width: 70px; height: 84px; border: 2px solid #ffad55; box-shadow: 0 0 24px rgba(255,128,75,.42); }
.rank-candidate-zone .rank-card img { height: 54px; }
.rank-pool-zone { display: grid; justify-items: center; gap: 5px; min-width: 0; }
.rank-pool { display: grid; width: min(100%,560px); grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }
.rank-pool .rank-card.is-candidate { border: 2px solid #ffad55; box-shadow: 0 0 20px rgba(255,128,75,.5); transform: translateY(-2px); }
.rank-feedback { display: flex; min-height: 50px; align-items: center; justify-content: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: rgba(13,16,24,.4); }
.rank-feedback.correct b { color: #7df1d2; }
.rank-feedback.wrong b { color: #ff8ea2; }
.rank-feedback b { font-size: .76rem; letter-spacing: .08em; }
.rank-feedback span { color: #dce0e3; font-size: .7rem; font-weight: 750; text-align: center; }
.rank-gap-choices { display: grid; width: min(100%,900px); grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); justify-self: center; gap: 6px; padding: 4px 2px; }
.rank-gap-button { min-width: 0; border: 1px solid rgba(255,255,255,.19); border-radius: 9px; padding: 8px 10px; color: white; background: rgba(69,74,81,.26); font-size: .6rem; font-weight: 800; }
.rank-gap-button:hover { border-color: var(--yellow); background: rgba(255,190,70,.12); }
.rank-next-button { width: min(100%,260px); justify-self: center; }
.point-button.buzz { color: #ffcf72; }

/* Player */
.player-shell { display: grid; min-height: 100vh; grid-template-rows: auto 1fr; background: linear-gradient(155deg,#171b25,#443866 50%,#a83e51); }
.player-topbar { width: min(1520px,calc(100% - 24px)); margin: 12px auto 0; }
.player-content { display: grid; width: min(1520px,calc(100% - 24px)); margin: 0 auto; align-content: center; padding: 14px 0 max(24px, env(safe-area-inset-bottom)); }
.player-card { overflow: hidden; border: 1px solid rgba(255,255,255,.17); border-radius: 25px; background: rgba(35,42,54,.92); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.player-show-layout { display: grid; min-height: clamp(560px,calc(100vh - 154px),880px); grid-template-columns: minmax(0,1fr) 330px; }
.player-play-surface { display: grid; min-width: 0; }
.player-show-overview { display: flex; min-width: 0; flex-direction: column; gap: 18px; border-left: 1px solid var(--line); padding: 20px 18px; background: linear-gradient(180deg,rgba(89,75,155,.25),rgba(13,16,24,.54)); }
.player-show-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.player-show-live, .player-show-phase { display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 6px 9px; color: #eff1f3; background: rgba(255,255,255,.05); font-size: .55rem; font-weight: 950; letter-spacing: .11em; }
.player-show-live { color: #ff9bad; }
.player-show-live i { width: 7px; aspect-ratio: 1; margin-right: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255,92,115,.12); }
.player-show-live.is-offline { color: var(--muted); }
.player-show-live.is-offline i { background: #858b93; box-shadow: none; }
.player-show-overview[data-phase="reveal"] .player-show-phase { border-color: rgba(85,230,219,.35); color: #9ff7e9; }
.player-show-overview[data-phase="finished"] .player-show-phase { border-color: rgba(255,212,90,.38); color: var(--yellow); }
.player-show-summary .eyebrow { margin: 0 0 7px; }
.player-show-summary h2 { margin: 0; font-size: clamp(1.4rem,1.7vw,1.9rem); line-height: 1.05; letter-spacing: -.04em; }
.player-show-summary > p:last-child { margin: 9px 0 0; color: #c3c7cc; font-size: .78rem; line-height: 1.48; }
.player-show-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 0; }
.player-show-metrics > div { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 8px 6px; background: rgba(255,255,255,.035); }
.player-show-metrics dt { color: var(--muted); font-size: .45rem; font-weight: 900; letter-spacing: .08em; }
.player-show-metrics dd { overflow: hidden; margin: 3px 0 0; color: white; font-size: .67rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.player-show-leaders { display: grid; gap: 7px; margin-top: auto; }
.player-show-leaders > span { color: var(--muted); font-size: .5rem; font-weight: 900; letter-spacing: .1em; }
.player-show-leader-list { gap: 5px; }
.player-show-leader-list .leader-row { min-height: 38px; padding: 6px 7px; font-size: .62rem; background: rgba(255,255,255,.035); }
.leader-row.is-you { border-color: rgba(255,212,90,.52); background: rgba(255,212,90,.08); }
.leader-row.is-you .leader-name::after { margin-left: 5px; color: var(--yellow); content: "DU"; font-size: .45rem; }
.player-state { display: grid; min-height: 480px; place-items: center; align-content: center; padding: 36px 24px; text-align: center; }
.player-state > * { max-width: 650px; }
.state-orb { display: grid; width: 62px; aspect-ratio: 1; margin-bottom: 18px; place-items: center; border-radius: 20px; background: linear-gradient(145deg,var(--pink),var(--purple)); box-shadow: 0 14px 40px rgba(255,64,88,.3); font-size: 1.5rem; font-weight: 950; }
.player-state h1, .player-state h2 { margin: 0 0 8px; font-size: clamp(2.1rem,7vw,4.2rem); letter-spacing: -.06em; }
.player-state p { color: var(--muted); line-height: 1.55; }
.player-ready-grid { display: grid; width: min(100%,650px); grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 20px; }
.player-ready-seat { display: flex; min-width: 0; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; padding: 9px; color: var(--muted); background: rgba(255,255,255,.035); text-align: left; }
.player-ready-seat > span { display: grid; width: 31px; aspect-ratio: 1; flex: 0 0 auto; place-items: center; border-radius: 9px; background: rgba(255,255,255,.08); font-size: .67rem; font-weight: 950; }
.player-ready-seat strong { overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.player-ready-seat.is-ready { border-color: rgba(85,230,219,.26); color: white; }
.player-ready-seat.is-ready > span { color: #171b25; background: var(--cyan); }
.player-ready-seat.is-you { border-color: rgba(255,212,90,.48); }
.player-state-leaderboard { width: min(100%,620px); margin-top: 18px; text-align: left; }
.player-final-podium { display: grid; width: min(100%,650px); grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: 8px; margin: 18px 0 2px; }
.player-final-place { display: grid; min-height: 112px; place-items: center; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 13px; padding: 10px 6px; background: rgba(255,255,255,.05); }
.player-final-place.place-1 { min-height: 138px; border-color: rgba(255,212,90,.55); background: linear-gradient(180deg,rgba(255,212,90,.18),rgba(255,255,255,.04)); }
.player-final-place > span { display: grid; width: 28px; aspect-ratio: 1; place-items: center; border-radius: 50%; color: #252c38; background: var(--yellow); font-size: .65rem; font-weight: 950; }
.player-final-place strong { overflow: hidden; max-width: 100%; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.player-final-place small { color: var(--yellow); font-size: .6rem; font-weight: 850; }
.player-final-place.is-you { box-shadow: 0 0 0 2px rgba(85,230,219,.38); }
.direct-join-form { display: grid; width: min(100%,420px); gap: 8px; margin-top: 18px; }
.player-question { min-height: 100%; padding: clamp(24px,3vw,44px); background: radial-gradient(circle at 34% 0, rgba(123,108,255,.24), transparent 48%), radial-gradient(circle at 76% 5%, rgba(255,64,88,.2), transparent 48%); }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; color: #bec3c9; font-size: .68rem; font-weight: 900; letter-spacing: .08em; }
.timer { border: 1px solid rgba(255,212,90,.34); border-radius: 999px; padding: 7px 11px; color: var(--yellow); background: rgba(255,212,90,.1); font-variant-numeric: tabular-nums; }
.player-question > h1 { max-width: 1050px; margin: 0 auto clamp(20px,3vh,34px); font-size: clamp(2rem,4.4vw,4.5rem); line-height: 1.03; letter-spacing: -.05em; text-align: center; }
.player-media { display: grid; place-items: center; margin: 0 auto 18px; }
.player-media img, .player-media video { width: min(100%,580px); max-height: 270px; border-radius: 15px; object-fit: contain; }
.media-audio { display: grid; width: min(100%,560px); place-items: center; gap: 11px; }
.media-audio audio { display: none; }
.media-audio-wave { position: relative; display: flex; width: min(100%,520px); height: clamp(68px,9vw,104px); align-items: center; justify-content: center; gap: clamp(2px,.32vw,5px); overflow: hidden; border: 1px solid rgba(255,64,88,.32); border-radius: 18px; padding: 11px clamp(12px,2vw,24px); background: radial-gradient(circle at 50% 120%,rgba(111,212,194,.18),transparent 58%),linear-gradient(135deg,rgba(69,74,81,.2),rgba(255,64,88,.11)); box-shadow: inset 0 1px rgba(255,255,255,.08),0 14px 36px rgba(0,0,0,.24); }
.media-audio-wave::before { position: absolute; width: 42%; aspect-ratio: 1; border-radius: 50%; content: ""; background: rgba(85,230,219,.12); filter: blur(24px); opacity: .45; transition: opacity .2s,transform .35s; }
.media-audio-wave span { z-index: 1; width: clamp(3px,.34vw,6px); height: var(--wave-height); flex: 0 1 6px; border-radius: 999px; background: linear-gradient(180deg,#ff6b7d 0%,#7b6cff 48%,#35e0cd 100%); box-shadow: 0 0 9px rgba(123,108,255,.3); opacity: .5; transform: scaleY(.38); transform-origin: center; }
.media-audio.is-playing .media-audio-wave { border-color: rgba(85,230,219,.5); box-shadow: inset 0 1px rgba(255,255,255,.1),0 0 38px rgba(85,230,219,.12); }
.media-audio.is-playing .media-audio-wave::before { opacity: .9; transform: scale(1.28); }
.media-audio.is-playing .media-audio-wave span { animation: media-wave-dance 680ms ease-in-out var(--wave-delay) infinite alternate; }
@keyframes media-wave-dance { from { opacity: .55; transform: scaleY(.3); } to { opacity: 1; transform: scaleY(var(--wave-peak)); } }
.media-audio-trigger { min-width: min(100%,340px); border: 1px solid rgba(85,230,219,.48); border-radius: 12px; padding: 14px 18px; color: #a2fff1; background: rgba(55,204,181,.1); font-weight: 850; transition: border-color .16s,background .16s,box-shadow .16s,transform .16s; }
.media-audio-trigger:hover:not(:disabled) { border-color: rgba(85,230,219,.8); background: rgba(55,204,181,.17); box-shadow: 0 8px 24px rgba(55,204,181,.11); transform: translateY(-1px); }
.media-audio-trigger:focus-visible { outline: 3px solid rgba(255,212,90,.52); outline-offset: 3px; }
.media-audio-trigger:disabled { cursor: not-allowed; opacity: .55; }
.answers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(9px,1.2vw,16px); }
.answer-button { position: relative; min-height: clamp(76px,9vh,104px); overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 15px; padding: 15px 16px 15px 58px; color: white; background: color-mix(in srgb, var(--answer-color,var(--purple)) 64%, #22262b); box-shadow: inset 0 1px rgba(255,255,255,.12); font-size: clamp(.86rem,1.15vw,1.08rem); font-weight: 800; text-align: left; transition: transform .13s, filter .13s; }
.answer-button:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-2px); }
.answer-letter { position: absolute; top: 50%; left: 11px; display: grid; width: 28px; aspect-ratio: 1; place-items: center; border-radius: 8px; background: rgba(0,0,0,.22); font-size: .7rem; transform: translateY(-50%); }
.answer-button.selected { outline: 2px solid white; }
.answer-button.correct { background: #239f7c; }
.answer-button.incorrect { background: #b53b5c; }
.player-scorebar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 13px 18px; background: rgba(13,16,24,.42); }
.player-scorebar > span:last-child { text-align: right; }
.player-scorebar small { display: block; color: var(--muted); font-size: .53rem; font-weight: 900; letter-spacing: .1em; }
.player-scorebar strong { display: block; font-size: .95rem; }
.player-scorebar > span:last-child strong { color: var(--yellow); }
.player-hearts .heart-row { font-size: 1.05rem; }
.heart-row { display: inline-flex; gap: 3px; color: var(--red); font-style: normal; }
.heart-row i { font-style: normal; filter: drop-shadow(0 0 5px rgba(255,75,105,.35)); }
.heart-row .heart-lost { color: rgba(255,255,255,.16); filter: none; }
.buzzer-area { display: grid; justify-items: center; gap: 16px; padding: 12px 0; }
.buzzer-button { display: grid; width: min(58vh,360px); aspect-ratio: 1; place-items: center; border: 9px solid #64162e; border-radius: 50%; color: white; background: radial-gradient(circle at 36% 28%, #ff8d9c, #e72f5b 48%, #9e1739); box-shadow: 0 14px 0 #5d1028, 0 28px 65px rgba(255,52,96,.36); }
.buzzer-button:active:not(:disabled) { transform: translateY(8px); box-shadow: 0 4px 0 #5d1028; }
.buzzer-button:disabled { cursor: not-allowed; filter: saturate(.55) brightness(.72); }
.buzzer-button.is-locked { border-color: #534a61; background: radial-gradient(circle at 36% 28%,#8b8296,#5d536a 52%,#352d40); box-shadow: 0 10px 0 #2a2332,0 22px 46px rgba(0,0,0,.28); }
.buzzer-button strong { font-size: 2rem; letter-spacing: .1em; }
.buzzer-label { color: var(--muted); font-size: .78rem; font-weight: 750; text-align: center; }
.board-answer-area, .rank-answer-area { display: block; }
.board-answer-form { display: grid; width: min(100%,580px); grid-template-columns: 1fr auto; margin: 0 auto 13px; }
.board-answer-form .button { min-height: 42px; }
.board-progress { color: var(--muted); font-size: .7rem; font-weight: 750; text-align: center; }
.player-board { display: grid; grid-template-columns: repeat(auto-fill,minmax(65px,1fr)); gap: 6px; }
.order-answer-area { display: grid; gap: 10px; }
.order-available, .order-selected { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.order-selected { min-height: 48px; border: 1px dashed rgba(85,230,219,.42); border-radius: 12px; padding: 8px; background: rgba(85,230,219,.05); }
.order-item { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; padding: 8px 12px; color: white; background: rgba(69,74,81,.3); font-weight: 800; }
.order-item.selected { border-color: var(--cyan); color: #a4fff3; }
.order-answer-area > .button { width: min(100%,350px); justify-self: center; }
.estimate-answer-area { display: grid; width: min(100%,820px); justify-self: center; gap: 13px; margin-inline: auto; }
.estimate-answer-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
.estimate-answer-form input { min-height: 56px; padding-inline: 17px; font-size: 1rem; font-weight: 800; }
.estimate-answer-form .button { min-height: 56px; padding-inline: 22px; }
.estimate-current { margin: 0; border: 1px solid rgba(255,212,90,.3); border-radius: 10px; padding: 10px 13px; color: #ffe693; background: rgba(255,212,90,.07); font-size: .73rem; font-weight: 800; text-align: center; }
.estimate-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.estimate-result-card { --seat-color: var(--seat-1); display: grid; gap: 5px; border: 1px solid rgba(255,255,255,.14); border-left: 4px solid var(--seat-color); border-radius: 12px; padding: 13px 15px; background: rgba(255,255,255,.045); }
.estimate-result-card.seat-2 { --seat-color: var(--seat-2); }
.estimate-result-card.seat-3 { --seat-color: var(--seat-3); }
.estimate-result-card.seat-4 { --seat-color: var(--seat-4); }
.estimate-result-card strong { font-size: .67rem; letter-spacing: .04em; }
.estimate-result-card span { overflow-wrap: anywhere; font-size: 1rem; font-weight: 900; }
.estimate-result-card.is-awarded { border-color: rgba(85,230,219,.6); background: rgba(39,184,157,.13); box-shadow: 0 0 24px rgba(85,230,219,.1); }
.estimate-result-card.is-awarded strong::after { margin-left: 6px; color: var(--cyan); content: "GEWERTET"; font-size: .52rem; }
.estimate-result-card.is-empty span { color: var(--muted); font-size: .75rem; font-weight: 700; }
.list-answer-locked, .turn-notice { margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 11px; padding: 11px; color: #d2d6da; background: rgba(255,255,255,.04); font-size: .7rem; font-weight: 850; text-align: center; }
.turn-notice.your-turn { border-color: rgba(255,212,90,.5); color: var(--yellow); background: rgba(255,188,64,.09); }
.rank-answer-area .rank-board { margin-top: 4px; }
.display-answer-reveal { margin: 14px 0 0; border: 1px solid rgba(85,230,219,.3); border-radius: 11px; padding: 11px; color: #9ff7e9; background: rgba(39,184,157,.09); font-size: .74rem; font-weight: 800; text-align: center; }
.player-live-strip { display: flex; gap: 6px; overflow-x: auto; border-top: 1px solid var(--line); padding: 10px; background: rgba(13,16,24,.28); }
.player-strip-tile { --seat-color: var(--seat-1); display: grid; min-width: 135px; grid-template-columns: 28px minmax(0,1fr); grid-template-rows: auto auto auto; gap: 1px 7px; border: 1px solid var(--line); border-bottom: 2px solid var(--seat-color); border-radius: 9px; padding: 7px; background: rgba(255,255,255,.04); }
.player-strip-tile.seat-2 { --seat-color: var(--seat-2); }
.player-strip-tile.seat-3 { --seat-color: var(--seat-3); }
.player-strip-tile.seat-4 { --seat-color: var(--seat-4); }
.player-strip-tile.current-player, .player-strip-tile.is-you { border-color: var(--cyan); background: rgba(85,230,219,.1); box-shadow: inset 0 0 0 1px rgba(85,230,219,.18); }
.player-strip-tile.is-active { border-color: #ff9a50; background: rgba(255,137,69,.13); box-shadow: 0 0 0 2px rgba(255,137,69,.16),0 0 20px rgba(255,137,69,.14); animation: active-player-pulse 1.45s ease-in-out infinite; }
.player-strip-tile.is-you.is-active { border-color: #ff9a50; background: linear-gradient(110deg,rgba(85,230,219,.13),rgba(255,137,69,.15)); box-shadow: inset 0 0 0 1px rgba(85,230,219,.42),0 0 0 2px rgba(255,137,69,.17),0 0 22px rgba(255,137,69,.17); }
.player-strip-tile > span:first-child { display: grid; width: 28px; aspect-ratio: 1; grid-row: 1 / 5; place-items: center; align-self: center; border-radius: 9px; color: #171b25; background: var(--seat-color); font-size: .7rem; font-weight: 950; }
.player-strip-tile strong { overflow: hidden; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.player-strip-tile small { color: var(--yellow); font-size: .56rem; font-weight: 850; }
.player-strip-tile .heart-row { font-size: .55rem; }
.player-strip-badges { display: flex; min-height: 15px; grid-column: 2; align-items: center; gap: 4px; }
.strip-badge { display: inline-flex; align-items: center; border: 1px solid currentColor; border-radius: 999px; padding: 2px 5px; font-size: .43rem; font-weight: 950; letter-spacing: .08em; line-height: 1; }
.strip-badge.is-you { color: var(--cyan); background: rgba(85,230,219,.08); }
.strip-badge.is-active { color: #ffb175; background: rgba(255,137,69,.1); }
@keyframes active-player-pulse { 50% { box-shadow: 0 0 0 3px rgba(255,137,69,.24),0 0 26px rgba(255,137,69,.2); } }
.player-camera-preview { position: relative; width: min(100%,260px); margin: 12px auto; overflow: hidden; border: 2px solid var(--cyan); border-radius: 12px; }
.player-camera-preview video { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; transform: scaleX(-1); }
.player-camera-preview span { position: absolute; right: 5px; bottom: 5px; border-radius: 5px; padding: 4px 6px; background: rgba(13,16,24,.84); font-size: .5rem; font-weight: 900; }

@media (max-width: 1250px) {
  .director-grid { grid-template-columns: 260px minmax(500px,1fr); }
  .players-panel { grid-column: 1 / -1; min-height: auto; }
  .host-player-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .leaderboard-block { display: none; }
}

@media (max-width: 880px) {
  .landing-shell { width: min(100% - 24px,1260px); padding-top: 12px; }
  .hero { min-height: 0; grid-template-columns: 1fr; gap: 30px; padding: 35px 24px; }
  .hero-demo { min-height: 275px; transform: none; }
  .entry-grid { grid-template-columns: 1fr; }
  .director-grid { grid-template-columns: 1fr; }
  .director-controls, .players-panel, .live-preview { min-height: auto; }
  .live-preview { min-height: 560px; grid-row: 1; }
  .director-controls { grid-row: 2; }
  .players-panel { grid-column: auto; }
  .host-player-controls { grid-template-columns: 1fr; }
  .question-fields { grid-template-columns: 1fr 1fr; }
  .question-fields .wide { grid-column: 1 / -1; }
  .rank-editor-labels { grid-template-columns: repeat(2,1fr); }
  .editor-footer { align-items: stretch; flex-direction: column; }
  .editor-save-actions { flex-wrap: wrap; }
  .editor-save-actions input { flex: 1 1 180px; width: auto; }
  .player-show-layout { min-height: 0; grid-template-columns: 1fr; }
  .player-play-surface { grid-row: 2; }
  .player-show-overview { display: grid; grid-row: 1; grid-template-columns: minmax(0,1fr) 260px; gap: 12px 18px; border-right: 0; border-bottom: 1px solid var(--line); border-left: 0; padding: 16px 18px; }
  .player-show-overview-head { grid-column: 1 / -1; }
  .player-show-summary, .player-show-metrics { grid-column: 1; }
  .player-show-leaders { grid-row: 2 / 4; grid-column: 2; margin-top: 0; }
}

@media (max-width: 620px) {
  .landing-nav .live-chip { display: none; }
  .hero h1 { font-size: 3.35rem; }
  .hero-demo { min-height: 230px; padding: 14px; }
  .demo-rail { margin-top: 44px; }
  .demo-rail i { height: 43px; }
  .entry-card { padding: 23px 19px; }
  .input-action, .join-fields { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .topbar > .room-badge { order: 3; }
  .top-actions { max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .host-page .topbar .brand { display: none; }
  .question-preview { padding: 18px 12px; }
  .question-preview > h1 { font-size: 2rem; }
  .quiz-library { width: 100%; flex-wrap: wrap; }
  .quiz-library select { min-width: 0; flex: 1 1 190px; }
  .workshop-header { align-items: flex-start; flex-direction: column; }
  .editor-toolbar { align-items: stretch; flex-direction: column; }
  .editor-toolbar label { grid-template-columns: 1fr; }
  .question-editor-list { padding: 10px; }
  .question-fields { grid-template-columns: 1fr; }
  .question-fields .wide { grid-column: auto; }
  .option-grid, .rank-editor-labels { grid-template-columns: 1fr; }
  .editor-save-actions { display: grid; grid-template-columns: 1fr; }
  .player-topbar { align-items: center; flex-wrap: nowrap; }
  .player-topbar .brand span:last-child { display: none; }
  .player-show-overview { display: flex; gap: 11px; padding: 13px; }
  .player-show-summary h2 { font-size: 1.08rem; }
  .player-show-summary > p:last-child { margin-top: 6px; font-size: .65rem; }
  .player-show-metrics > div { padding: 7px 5px; }
  .player-show-leaders { display: none; }
  .player-state { min-height: 390px; padding: 28px 14px; }
  .player-ready-grid { grid-template-columns: 1fr; }
  .player-final-podium { gap: 5px; }
  .player-final-place { min-height: 96px; padding: 7px 4px; }
  .player-final-place.place-1 { min-height: 116px; }
  .player-question { padding: 18px 13px 22px; }
  .answers { grid-template-columns: 1fr; }
  .answer-button { min-height: 61px; }
  .board-answer-form { grid-template-columns: 1fr; gap: 7px; }
  .player-scorebar { padding: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .media-audio.is-playing .media-audio-wave span { animation: none !important; opacity: .9; transform: scaleY(.78); }
}
