/* Kuka sen sano? – ulkoasu */

:root {
  --bg: #0B0614;
  --violet: #9146FF;
  --violet-light: #BF94FF;
  --violet-dark: #5A1FBF;
  --gold: #FFB800;
  --right: #00C46A;
  --wrong: #D7263D;
  --wrong-text: #FF4D6A;
  --text: #F4EEFF;
  --muted: #8C7AA8;
  --panel: #050208;
  --panel-border: #3B2366;
  --face: #160B2B;
  --dim-face: #100820;
  --dim-text: #6B5A88;

  --font-display: 'Anton', 'Impact', sans-serif;
  --font-body: 'Rubik', system-ui, sans-serif;
  --font-led: 'DotGothic16', monospace;

  --cut: 32px;        /* vastauspalkin kuusikulmion kärki */
  --cut-big: 44px;    /* kysymyspaneelin kärki */
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
}
button:disabled { cursor: not-allowed; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

[hidden] { display: none !important; }

/* ---------- Tausta: valokeilat ja hehku ---------- */

.stage-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.beam {
  position: absolute;
  top: -40px;
  height: 980px;
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
  animation: sway 7s ease-in-out infinite alternate;
}
.beam-left {
  --r: -24deg;
  left: 12%;
  width: 340px;
  margin-left: -170px;
  background: linear-gradient(to bottom, rgba(191,148,255,0.32), rgba(191,148,255,0));
}
.beam-center {
  --r: 0deg;
  left: 50%;
  width: 420px;
  margin-left: -210px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(255,255,255,0));
  animation-duration: 9s;
}
.beam-right {
  --r: 24deg;
  left: 88%;
  width: 340px;
  margin-left: -170px;
  background: linear-gradient(to bottom, rgba(145,70,255,0.40), rgba(145,70,255,0));
  animation-duration: 8s;
}
.glow {
  position: absolute;
  left: 50%;
  bottom: -260px;
  width: 1400px;
  height: 520px;
  margin-left: -700px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(145,70,255,0.45), rgba(145,70,255,0));
}
@keyframes sway {
  from { transform: rotate(calc(var(--r) - 7deg)); }
  to   { transform: rotate(calc(var(--r) + 7deg)); }
}

/* ---------- Sivun runko ---------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.top-btn {
  min-height: 44px;
  padding: 0 18px;
  background: var(--panel);
  border: 2px solid var(--panel-border);
  box-shadow: 4px 4px 0 var(--violet-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-light);
  transition: transform .1s, box-shadow .1s;
}
.top-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--violet-dark); }
.top-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--violet-dark); }
.top-btn-twitch { background: var(--violet); border-color: var(--violet-light); color: #fff; }

/* Musiikin säätimet */
.sound-ctrl { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.icon-btn { width: 44px; padding: 0; display: grid; place-items: center; }
.icon-btn .icon-off { display: none; }
.icon-btn.is-muted { color: var(--wrong-text); }
.icon-btn.is-muted .icon-on { display: none; }
.icon-btn.is-muted .icon-off { display: block; }
.volume {
  width: 120px;
  height: 44px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
  background: transparent;
}
.volume:disabled { opacity: 0.4; }

/* ---------- Otsikko ja LED-paneelit ---------- */

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header-title { display: flex; flex-direction: column; gap: 6px; }
.logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    1px 1px 0 var(--violet), 2px 2px 0 var(--violet), 3px 3px 0 var(--violet), 4px 4px 0 var(--violet),
    5px 5px 0 var(--violet-dark), 6px 6px 0 var(--violet-dark), 7px 7px 0 var(--violet-dark);
}
.subtitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--violet-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.led-panels { display: flex; gap: 16px; flex-wrap: wrap; }
.led-panel {
  background: var(--panel);
  border: 3px solid var(--panel-border);
  padding: 10px 18px;
  box-shadow: 6px 6px 0 var(--violet-dark);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}
.led-panel-wide { min-width: 150px; }
.led-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.led {
  font-family: var(--font-led);
  font-size: 34px;
  line-height: 1;
  text-shadow: 0 0 6px currentColor, 0 0 14px currentColor;
}
.led-gold { color: var(--gold); }
.led-violet { color: var(--violet-light); }

/* ---------- Näkymät ---------- */

.view { display: flex; flex-direction: column; gap: 30px; }

/* ---------- Aloitus ---------- */

.card {
  background: linear-gradient(180deg, #1B0D31 0%, #0F071D 100%);
  border: 3px solid var(--violet-light);
  box-shadow: 7px 7px 0 var(--violet-dark);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet-light);
  padding: 0;
}
.text-input {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  background: var(--panel);
  border: 3px solid var(--panel-border);
  color: #fff;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
}
.text-input::placeholder { color: var(--dim-text); font-weight: 500; }
.text-input:focus { outline: none; border-color: var(--gold); }
.field-error { min-height: 20px; color: var(--wrong-text); font-weight: 700; font-size: 15px; }

.modes {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.modes legend { margin-bottom: 12px; }
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 20px;
  background: var(--face);
  border: 3px solid var(--panel-border);
  box-shadow: 5px 5px 0 #24123F;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.mode-card:hover { border-color: var(--violet-light); }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card:has(input:checked) {
  border-color: var(--gold);
  background: #22123F;
  box-shadow: 5px 5px 0 var(--violet-dark);
}
.mode-card:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 4px; }
.mode-name {
  font-family: var(--font-display);
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
}
.mode-card:has(input:checked) .mode-name { color: var(--gold); }
.mode-desc { font-size: 15px; line-height: 1.4; color: #C9BEDD; }

.big-btn {
  align-self: center;
  margin-top: 10px;
  min-height: 56px;
  padding: 0 36px;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 6px 6px 0 var(--violet-dark);
  transition: transform .1s, box-shadow .1s, filter .1s;
}
.big-btn:hover { filter: brightness(1.1); transform: translate(-1px, -1px); box-shadow: 7px 7px 0 var(--violet-dark); }
.big-btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--violet-dark); }
.big-btn-violet { background: var(--violet); color: #fff; box-shadow: 6px 6px 0 #2E0D66; }
.big-btn-violet:hover { box-shadow: 7px 7px 0 #2E0D66; }

.ghost-btn {
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-light);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.ghost-btn:hover { color: #E2D1FF; }

.note {
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.note-test { color: var(--gold); text-transform: none; letter-spacing: 0.02em; font-weight: 500; }

/* ---------- Ajastin ---------- */

.timer-row { display: flex; align-items: center; gap: 18px; }
.timer-num {
  font-size: 44px;
  color: var(--gold);
  min-width: 64px;
  text-align: right;
}
.timer-num.is-low { color: var(--wrong-text); }
.timer-bar {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 5px;
  background: var(--panel);
  border: 3px solid var(--panel-border);
  padding: 6px;
}
.seg { display: block; height: 14px; background: #1A1030; }
.seg.on { background: var(--seg); box-shadow: 0 0 8px var(--seg); }

/* ---------- Kysymyspaneeli ---------- */

.question { position: relative; padding-top: 18px; }
.question-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--violet-light);
  opacity: 0.6;
}
.question-label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  white-space: nowrap;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.14em;
  padding: 7px 24px;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--violet-dark);
}
.question-hex { position: relative; margin: 0 28px; }
.question-shadow,
.question-border,
.question-face {
  clip-path: polygon(var(--cut-big) 0, calc(100% - var(--cut-big)) 0, 100% 50%, calc(100% - var(--cut-big)) 100%, var(--cut-big) 100%, 0 50%);
}
.question-shadow {
  position: absolute;
  inset: 0;
  transform: translate(7px, 7px);
  background: var(--violet-dark);
}
.question-border { position: relative; background: var(--violet-light); padding: 3px; }
.question-face {
  background: linear-gradient(180deg, #24123F 0%, #120822 100%);
  padding: 44px 80px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  min-height: 170px;
  justify-content: center;
}
.question-text {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.25;
  max-width: 780px;
  color: #fff;
  overflow-wrap: anywhere;
}
.question-text.is-long { font-size: 28px; }
.question-text.is-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 64px;
  line-height: 1.05;
  text-shadow:
    1px 1px 0 var(--c1), 2px 2px 0 var(--c1), 3px 3px 0 var(--c1),
    4px 4px 0 var(--c2), 5px 5px 0 var(--c2), 6px 6px 0 var(--c2);
}
.question-meta {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Kolme vihjettä: vihjeet allekkain, uusi ponnahtaa esiin */
.question-text.is-clues {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 24px;
}
.clue { animation: pop .45s cubic-bezier(.2, 1.7, .4, 1) both; }
.clue + .clue { padding-top: 14px; border-top: 2px dashed rgba(191,148,255,0.3); }
.clue-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.clue-meta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Totta vai tarua?: väitteen kirjoittaja */
.question-claim {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
.claim-name { color: var(--violet-light); }

/* ---------- Emotet ---------- */

.emote {
  display: inline-block;
  height: 1.4em;
  width: auto;
  max-width: 4.5em;
  margin: -0.25em 0.06em;
  vertical-align: middle;
  object-fit: contain;
}

/* ---------- Vastauspalkit ---------- */

.options { display: flex; flex-direction: column; gap: 18px; }

.opt-row {
  position: relative;
  --line: rgba(191,148,255,0.6);
}
.opt-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  margin-top: -1px;
  background: var(--line);
}
.opt {
  --face-c: var(--face);
  --border-c: var(--violet-light);
  --shadow-c: var(--violet-dark);
  --letter-c: var(--gold);
  --tag-c: var(--muted);
  position: relative;
  display: block;
  width: calc(100% - 120px);
  margin: 0 60px;
  min-height: 76px;
  text-align: left;
}
.opt-shadow, .opt-border, .opt-face { position: absolute; }
.opt-shadow {
  inset: 0;
  transform: translate(6px, 6px);
  background: var(--shadow-c);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
}
.opt-border {
  inset: 0;
  background: var(--border-c);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
}
.opt-face {
  inset: 3px;
  background: var(--face-c);
  clip-path: polygon(calc(var(--cut) - 2px) 0, calc(100% - var(--cut) + 2px) 0, 100% 50%, calc(100% - var(--cut) + 2px) 100%, calc(var(--cut) - 2px) 100%, 0 50%);
  transition: background .12s;
}
.opt-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 10px 56px;
}
.opt-letter {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--letter-c);
  flex: none;
}
.opt-name {
  flex: 1;
  min-width: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--name-c, var(--chatter-c, #fff));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt-text {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--name-c, var(--chatter-c, #fff));
  overflow-wrap: anywhere;
}
.opt-tag {
  flex: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tag-c);
  text-align: right;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opt:not(:disabled):hover { --face-c: #24123F; }
.opt:not(:disabled):active { transform: translate(3px, 3px); }
.opt:disabled { cursor: default; }

/* Tilat */
.opt-row.is-locked { --line: var(--gold); }
.is-locked .opt {
  --face-c: var(--gold);
  --border-c: #FFE08A;
  --letter-c: var(--bg);
  --name-c: var(--bg);
  --tag-c: var(--bg);
  animation: pulse .45s ease-in-out infinite alternate;
}
.opt-row.is-correct { --line: var(--right); }
.is-correct .opt {
  --face-c: var(--right);
  --border-c: #9CFFCB;
  --shadow-c: #00703C;
  --letter-c: var(--bg);
  --name-c: var(--bg);
  --tag-c: var(--bg);
  animation: flash .22s steps(2, end) 5;
}
.opt-row.is-wrong { --line: var(--wrong); }
.is-wrong .opt {
  --face-c: var(--wrong);
  --border-c: #FF9AA8;
  --shadow-c: #7A0F1E;
  --letter-c: #fff;
  --name-c: #fff;
  --tag-c: #fff;
  animation: shake .4s ease-in-out;
}
.opt-row.is-dim { --line: rgba(59,35,102,0.8); }
.is-dim .opt {
  --face-c: var(--dim-face);
  --border-c: var(--panel-border);
  --shadow-c: #24123F;
  --letter-c: var(--dim-text);
  --name-c: var(--dim-text);
  --tag-c: var(--dim-text);
}

@keyframes pulse { to { filter: brightness(1.25); } }
@keyframes flash { 50% { filter: brightness(1.9); } }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ---------- Paljastus ---------- */

.reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
  text-align: center;
  animation: pop .55s cubic-bezier(.2, 1.7, .4, 1) both;
}
@keyframes pop {
  0%   { transform: scale(.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.verdict {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.verdict-right { color: var(--right); }
.verdict-wrong { color: var(--wrong-text); }
.verdict-points {
  font-family: var(--font-led);
  font-size: 20px;
  color: var(--gold);
  text-shadow: 0 0 6px currentColor;
}
.said-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-light);
}
.said-name {
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(40px, 9vw, 72px);
  line-height: 1.05;
  color: #fff;
  overflow-wrap: anywhere;
  text-shadow:
    1px 1px 0 var(--c1), 2px 2px 0 var(--c1), 3px 3px 0 var(--c1), 4px 4px 0 var(--c1),
    5px 5px 0 var(--c2), 6px 6px 0 var(--c2), 7px 7px 0 var(--c2), 8px 8px 0 var(--c2);
}
.said-stats { font-size: 15px; color: #C9BEDD; }

/* ---------- Pelin alaosa ---------- */

.game-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.hint {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.lifeline {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  padding: 8px 24px;
  background: var(--panel);
  border: 3px solid var(--violet);
  box-shadow: 5px 5px 0 var(--violet-dark);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}
.lifeline-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.lifeline:disabled { opacity: 0.55; box-shadow: 5px 5px 0 #24123F; border-color: var(--panel-border); }

/* ---------- Kello pysäytetty (Kysy chatilta) ---------- */

.timer-paused {
  display: none;
  flex: none;
  padding: 6px 12px;
  background: var(--violet);
  border: 2px solid var(--violet-light);
  box-shadow: 4px 4px 0 var(--violet-dark);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  animation: blink 1.2s steps(2, end) infinite;
}
.timer-row.is-paused .timer-paused { display: block; }
.timer-row.is-paused .timer-num { color: var(--muted); }
.timer-row.is-paused .timer-bar { opacity: .5; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- Kysy chatilta -äänestys ---------- */

.poll {
  position: relative;
  align-self: center;
  width: min(620px, 100%);
  background: var(--panel);
  border: 3px solid var(--violet-light);
  box-shadow: 7px 7px 0 var(--violet-dark);
  padding: 18px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: pop .45s cubic-bezier(.2, 1.7, .4, 1) both;
}
.poll-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.poll-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}
.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--wrong-text);
  box-shadow: 0 0 10px var(--wrong-text);
  animation: blink 1s steps(2, end) infinite;
}
.poll.is-closed .live-dot { animation: none; background: var(--dim-text); box-shadow: none; }
.poll-count { font-family: var(--font-led); font-size: 22px; color: var(--gold); text-shadow: 0 0 6px currentColor; }
.poll-time { display: flex; align-items: baseline; gap: 6px; }
.poll-time-num { font-family: var(--font-led); font-size: 34px; line-height: 1; color: var(--gold); text-shadow: 0 0 6px currentColor, 0 0 14px currentColor; }
.poll-time-label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.poll-time.is-low .poll-time-num { color: var(--wrong-text); animation: blink .5s steps(2, end) infinite; }
.poll.is-closed .poll-time { visibility: hidden; }
.poll-meter { height: 10px; background: #1A1030; border: 2px solid var(--panel-border); }
.poll-meter-fill { height: 100%; width: 100%; background: var(--gold); box-shadow: 0 0 8px var(--gold); transition: width .25s linear, background .2s; }
.poll-meter.is-low .poll-meter-fill { background: var(--wrong-text); box-shadow: 0 0 8px var(--wrong-text); }
.poll-bars {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: 22px;
  align-items: end;
  padding: 0 8px;
  border-bottom: 3px solid var(--panel-border);
}
.poll-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.poll-pct { font-family: var(--font-led); font-size: 26px; color: var(--violet-light); text-shadow: 0 0 6px currentColor; }
.poll-bar {
  width: 100%;
  max-width: 110px;
  height: 0%;
  min-height: 4px;
  background: var(--violet);
  box-shadow: 5px 5px 0 var(--violet-dark);
  transition: height .45s cubic-bezier(.3, 1.4, .5, 1), background .2s;
}
.poll-col.is-top .poll-bar { background: var(--gold); }
.poll-col.is-top .poll-pct { color: var(--gold); }
.poll-letters { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 22px; padding: 0 8px; text-align: center; }
.poll-letter { font-family: var(--font-display); font-size: 30px; color: var(--gold); line-height: 1; }
.poll-help { text-align: center; font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.poll-help b { color: #fff; }
.poll-feed { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 28px; }
.vote-chip {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  background: #1A1030;
  border: 2px solid var(--panel-border);
  animation: pop .3s cubic-bezier(.2, 1.7, .4, 1) both;
}
.vote-chip b { color: var(--gold); }
.poll-note { text-align: center; font-size: 13px; color: var(--wrong-text); font-weight: 700; letter-spacing: .04em; }

/* ---------- Loppunäkymä ---------- */

.end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
  animation: pop .55s cubic-bezier(.2, 1.7, .4, 1) both;
}
.end-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 10vw, 80px);
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    1px 1px 0 var(--violet), 2px 2px 0 var(--violet), 3px 3px 0 var(--violet), 4px 4px 0 var(--violet),
    5px 5px 0 var(--violet-dark), 6px 6px 0 var(--violet-dark), 7px 7px 0 var(--violet-dark), 8px 8px 0 var(--violet-dark);
}
.end-score-panel { align-items: center; padding: 14px 32px; }
.end-score { font-size: 64px; }
.end-correct {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-light);
}
.end-squares { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sq {
  width: 34px;
  height: 34px;
  box-shadow: 3px 3px 0 var(--violet-dark);
}
.sq-right { background: var(--right); }
.sq-wrong { background: var(--wrong); }
.end-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px;
}
.end-buttons .big-btn { margin-top: 0; }
.end-buttons .ghost-btn { flex-basis: 100%; }

/* ---------- Muut ---------- */

.site-footer {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--dim-text);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  background: var(--panel);
  border: 3px solid var(--gold);
  box-shadow: 5px 5px 0 var(--violet-dark);
  font-weight: 700;
  color: #fff;
  animation: pop .35s cubic-bezier(.2, 1.7, .4, 1) both;
}

/* ---------- Asetukset-paneeli ---------- */

.settings {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  background: linear-gradient(180deg, #1B0D31 0%, #0F071D 100%);
  border: 3px solid var(--violet-light);
  box-shadow: 7px 7px 0 var(--violet-dark);
  color: var(--text);
  font-family: var(--font-body);
}
.settings::backdrop { background: rgba(5, 2, 8, 0.78); }
.settings[open] { animation: pop .35s cubic-bezier(.2, 1.7, .4, 1) both; }
.settings-inner { display: flex; flex-direction: column; padding: 24px 26px 26px; }
.settings-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 1px 1px 0 var(--violet), 2px 2px 0 var(--violet), 3px 3px 0 var(--violet-dark), 4px 4px 0 var(--violet-dark);
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 2px solid var(--panel-border);
}
.set-fieldset { margin: 0; border: none; border-bottom: 2px solid var(--panel-border); flex-wrap: wrap; }
.set-fieldset legend { float: left; padding: 0; }
.set-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet-light);
}
.set-desc { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #C9BEDD; }
.set-control { display: flex; align-items: center; gap: 12px; }
.set-volume { width: 150px; }
.set-value { min-width: 48px; text-align: right; font-family: var(--font-led); font-size: 20px; color: var(--gold); }
.settings .big-btn { margin-top: 22px; }

/* Oma kanava */
.set-section { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 6px; }
.set-section .set-label { margin: 0; }
.set-section .set-desc { margin: 0; }
.bot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bot-list:empty::before { content: 'Lista on tyhjä.'; color: var(--dim-text); font-size: 14px; }
.bot-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 12px;
  background: #1A1030;
  border: 2px solid var(--panel-border);
  font-weight: 700;
  font-size: 15px;
}
.bot-remove {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.bot-remove:hover { color: var(--wrong-text); }
.bot-add { display: flex; gap: 10px; }
.bot-input { min-height: 44px; font-size: 18px; }
.bot-add .top-btn { flex: none; }
.channel-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Valintalista (Pelin koko) */
.set-select {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  background: var(--panel);
  border: 3px solid var(--panel-border);
  color: #fff;
  font-family: var(--font-led);
  font-size: 20px;
  cursor: pointer;
}
.set-select:focus { outline: none; border-color: var(--gold); }
.set-select option { background: var(--panel); color: #fff; }

/* Päällä/pois-kytkin */
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 64px;
  height: 34px;
  margin: 0;
  background: #1A1030;
  border: 3px solid var(--panel-border);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--dim-text);
  transition: transform .15s, background .15s;
}
.switch:checked { background: var(--violet); border-color: var(--violet-light); }
.switch:checked::after { transform: translateX(30px); background: var(--gold); }

/* Kolmen vaihtoehdon valitsin */
.seg-group { display: flex; border: 3px solid var(--panel-border); }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
  display: block;
  min-height: 38px;
  line-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.seg-opt + .seg-opt span { border-left: 2px solid var(--panel-border); }
.seg-opt input:checked + span { background: var(--gold); color: var(--bg); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Animaatiot (asetus) ---------- */

/* Vähennetty: ei heiluvia valokeiloja eikä vilkkumista, paljastukset häivytetään. */
body[data-anim="reduced"] .beam,
body[data-anim="reduced"] .timer-paused,
body[data-anim="reduced"] .live-dot,
body[data-anim="reduced"] .poll-time.is-low .poll-time-num,
body[data-anim="reduced"] .is-locked .opt,
body[data-anim="reduced"] .is-correct .opt,
body[data-anim="reduced"] .is-wrong .opt { animation: none; }
body[data-anim="reduced"] .reveal,
body[data-anim="reduced"] .clue,
body[data-anim="reduced"] .end,
body[data-anim="reduced"] .toast,
body[data-anim="reduced"] .settings[open] { animation: fade .3s ease-out both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Pois: ei animaatioita eikä siirtymiä. */
body[data-anim="off"] *,
body[data-anim="off"] *::before,
body[data-anim="off"] *::after { animation: none !important; transition: none !important; }

/* ---------- Puhelin ---------- */

@media (max-width: 720px) {
  :root { --cut: 20px; --cut-big: 24px; }
  .page { padding: 16px 16px 32px; gap: 22px; }
  .topbar { gap: 10px; }
  .top-btn { padding: 0 10px; font-size: 12px; letter-spacing: 0.08em; }
  .icon-btn { padding: 0; }
  .volume { width: 80px; }
  .logo { font-size: 38px; }
  .subtitle { font-size: 13px; }
  .led-panels { width: 100%; }
  .led-panel { flex: 1; min-width: 0; padding: 8px 12px; }
  .led { font-size: 28px; }
  .card { padding: 22px 18px; }
  .modes { grid-template-columns: 1fr; }
  .text-input { font-size: 18px; }
  .timer-row { gap: 10px; }
  .timer-num { font-size: 32px; min-width: 44px; }
  .timer-bar { gap: 3px; padding: 4px; }
  .seg { height: 12px; }
  .question-label { font-size: 15px; padding: 6px 16px; }
  .question-hex { margin: 0; }
  .question-face { padding: 40px 36px 26px; min-height: 140px; }
  .question-text { font-size: 24px; }
  .question-text.is-long { font-size: 20px; }
  .question-text.is-name { font-size: 40px; }
  .question-text.is-clues { font-size: 18px; gap: 10px; }
  .question-claim { font-size: 18px; }
  .opt { width: calc(100% - 16px); margin: 0 8px; min-height: 64px; }
  .opt-content { min-height: 64px; padding: 8px 30px; gap: 12px; }
  .opt-letter { font-size: 24px; }
  .opt-name { font-size: 20px; }
  .opt-text { font-size: 16px; }
  .opt-content { flex-wrap: wrap; row-gap: 2px; }
  .opt-tag { font-size: 11px; max-width: none; flex-basis: 100%; text-align: left; padding-left: 36px; }
  .opt-tag:empty { display: none; }
  .end-score { font-size: 48px; }
  .settings-inner { padding: 18px 16px 20px; }
  .set-volume { width: 110px; }
  .seg-opt span { padding: 0 9px; font-size: 12px; }
  .timer-paused { font-size: 12px; padding: 4px 8px; }
  .poll { padding: 14px 14px 16px; }
  .poll-bars { height: 170px; gap: 12px; }
  .poll-letters { gap: 12px; }
  .poll-pct { font-size: 20px; }
}
