@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg0: #0c0a1d;
  --bg1: #15102f;
  --ink: #fff6ea;
  --muted: rgba(255, 246, 234, 0.66);
  --faint: rgba(255, 246, 234, 0.4);
  --line: rgba(255, 255, 255, 0.1);
  --line2: rgba(255, 255, 255, 0.18);
  --card: rgba(255, 255, 255, 0.055);
  --card2: rgba(255, 255, 255, 0.09);
  --red: #ff3d5a;
  --red2: #ff7a45;
  --blue: #3b6cff;
  --cream: #fff1dc;
  --gold: #ffcf4a;
  --silver: #d6deec;
  --bronze: #e8995a;
  --ok: #b7f04a;
  --c-maku: #ff5d73;
  --c-ulkonako: #4fc3ff;
  --c-luovuus: #c38bff;
  --radius: 22px;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg0); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  background: radial-gradient(120% 80% at 50% -10%, #241a55 0%, var(--bg1) 38%, var(--bg0) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- tausta ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: 0.55; will-change: transform; }
.blob-red { background: radial-gradient(circle, rgba(255, 61, 90, 0.55) 0%, rgba(255, 61, 90, 0) 62%); top: -30vmax; left: -28vmax; animation: drift1 26s ease-in-out infinite alternate; }
.blob-blue { background: radial-gradient(circle, rgba(59, 108, 255, 0.55) 0%, rgba(59, 108, 255, 0) 62%); bottom: -34vmax; right: -30vmax; animation: drift2 31s ease-in-out infinite alternate; }
.blob-gold { background: radial-gradient(circle, rgba(255, 170, 60, 0.28) 0%, rgba(255, 170, 60, 0) 60%); top: 30%; left: 40%; width: 50vmax; height: 50vmax; animation: drift3 37s ease-in-out infinite alternate; }
.grain {
  position: absolute; inset: 0; opacity: 0.08;
  background-image: repeating-radial-gradient(circle at 20% 30%, rgba(255,255,255,.5) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
@keyframes drift1 { to { transform: translate(18vmax, 22vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-20vmax, -16vmax) scale(1.15); } }
@keyframes drift3 { to { transform: translate(-30vmax, 10vmax) scale(.9); } }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- runko ---------- */
.app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(120px + var(--safe-b)); }
.boot { min-height: 80vh; display: grid; place-items: center; }
.boot-glass { font-size: 56px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-6deg); } }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: calc(10px + var(--safe-t)) 16px 10px;
  background: linear-gradient(180deg, rgba(12, 10, 29, 0.92) 0%, rgba(12, 10, 29, 0.72) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 19px;
  background: conic-gradient(from 210deg, var(--red), var(--red2), var(--gold), var(--blue), var(--red));
  box-shadow: 0 6px 18px rgba(255, 61, 90, 0.35);
}
.brand-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1; letter-spacing: 0.02em;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-phase { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.voting > .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(183, 240, 74, 0.7); animation: pulse 1.6s infinite; }
.results > .dot { background: var(--gold); }
.phase-pill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 6px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 650;
  background: var(--card2); border: 1px solid var(--line2); white-space: nowrap;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(183, 240, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(183, 240, 74, 0); } }
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--card2); border: 1px solid var(--line2);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.host { background: linear-gradient(135deg, rgba(255, 207, 74, 0.25), rgba(255, 122, 69, 0.18)); border-color: rgba(255, 207, 74, 0.45); }

/* ---------- otsikot ---------- */
.hero { text-align: center; padding: 34px 0 14px; }
.hero-kicker {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); padding: 6px 12px; border: 1px solid rgba(255, 207, 74, 0.35); border-radius: 99px;
  background: rgba(255, 207, 74, 0.08);
}
.mega {
  margin: 16px 0 6px;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  font-size: clamp(58px, 18vw, 132px); line-height: 0.84; letter-spacing: 0.005em;
  color: var(--cream);
  text-shadow: 3px 3px 0 var(--red), 6px 6px 0 var(--blue), 0 0 40px rgba(255, 61, 90, 0.35);
  overflow-wrap: anywhere;
}
.tagline { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--muted); margin: 14px auto 0; max-width: 30ch; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 30px 2px 12px;
  font-family: var(--display); font-weight: 600; font-size: 26px; text-transform: uppercase; letter-spacing: 0.02em;
}
.section-title small { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--faint); text-transform: none; letter-spacing: 0; }

/* ---------- kortit ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.card + .card { margin-top: 14px; }
.step-label { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; margin-bottom: 12px; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 800; color: #1a1030; background: var(--cream);
}

.input {
  width: 100%; height: 56px; padding: 0 18px; border-radius: 16px;
  background: rgba(0, 0, 0, 0.28); border: 1.5px solid var(--line2);
  font-size: 19px; font-weight: 600; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); font-weight: 500; }
.input:focus { border-color: rgba(255, 207, 74, 0.8); box-shadow: 0 0 0 4px rgba(255, 207, 74, 0.15); }
textarea.input { height: 92px; padding: 14px 18px; resize: none; font-size: 16px; font-weight: 500; line-height: 1.4; }
.field + .field { margin-top: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 2px 7px; text-transform: uppercase; letter-spacing: 0.08em; }
.hint { font-size: 13.5px; color: var(--faint); margin: 10px 2px 0; }

/* ---------- drinkkiruudukko ---------- */
.drink-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .drink-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  position: relative; display: block; width: 100%; text-align: left;
  border-radius: 18px; overflow: hidden; aspect-ratio: 1 / 1.08;
  background: #1b1440; border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.tile img, .tile .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(8, 6, 22, 0.92) 100%); }
.tile-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 10px 12px 11px; display: block; }
.tile-name, .tile-makers, .tile.special .big, .tile.special .lbl, .tile.special .sub { display: block; }
.tile-name { font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1; text-transform: uppercase; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.tile-makers { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-makers.none { color: rgba(255, 207, 74, 0.9); }
.tile-no {
  position: absolute; z-index: 2; top: 9px; left: 9px; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 99px;
  display: grid; place-items: center; font-family: var(--display); font-size: 17px; font-weight: 600;
  background: rgba(10, 8, 24, 0.66); border: 1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.tile.selectable:active { transform: scale(0.97); }
.tile.selected { border-color: transparent; box-shadow: 0 0 0 3px var(--gold), 0 14px 34px rgba(255, 207, 74, 0.28); transform: translateY(-2px); }
.tile .check {
  position: absolute; z-index: 3; top: 9px; right: 9px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold); color: #1a1030; font-weight: 900; font-size: 16px;
  transform: scale(0); transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.tile.selected .check { transform: scale(1); }
.tile.special { display: grid; place-items: center; text-align: center; padding: 16px 10px; background: rgba(255,255,255,.035); border: 1.5px dashed var(--line2); }
.tile.special::after { display: none; }
.tile.special .big { font-size: 34px; line-height: 1; }
.tile.special .lbl { font-weight: 750; font-size: 15px; margin-top: 8px; }
.tile.special .sub { font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.tile.special.selected { border-style: solid; background: rgba(255, 207, 74, 0.08); }
.ph { display: grid; place-items: center; font-size: 54px; background: linear-gradient(135deg, #ff3d5a 0%, #7a3cff 55%, #3b6cff 100%); }

/* ---------- napit ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 52px; padding: 0 22px; border-radius: 16px;
  font-weight: 750; font-size: 16.5px; white-space: nowrap;
  background: var(--card2); border: 1px solid var(--line2);
  transition: transform .12s ease, opacity .15s, filter .15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary {
  border: 0; color: #fff;
  background: linear-gradient(120deg, var(--red) 0%, var(--red2) 100%);
  box-shadow: 0 10px 28px rgba(255, 61, 90, 0.42), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn.gold { border: 0; color: #22150a; background: linear-gradient(120deg, #ffe08a, var(--gold) 45%, #ff9f45); box-shadow: 0 10px 28px rgba(255, 180, 60, 0.38); }
.btn.danger { color: #ffd0d6; border-color: rgba(255, 61, 90, 0.45); background: rgba(255, 61, 90, 0.12); }
.btn.small { height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14.5px; }
.btn.block { width: 100%; }
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 14px 16px calc(14px + var(--safe-b));
  background: linear-gradient(180deg, rgba(12, 10, 29, 0) 0%, rgba(12, 10, 29, 0.9) 40%);
}
.cta-bar .inner { max-width: 688px; margin: 0 auto; }
.cta-bar .btn { width: 100%; height: 58px; font-size: 18px; }
.cta-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- aula ---------- */
.me-card { display: flex; gap: 14px; align-items: center; }
.me-thumb { width: 86px; height: 86px; border-radius: 18px; overflow: hidden; flex: none; position: relative; background: #1b1440; }
.me-thumb img, .me-thumb .ph { width: 100%; height: 100%; object-fit: cover; font-size: 38px; }
.me-hello { font-family: var(--display); font-size: 30px; font-weight: 600; text-transform: uppercase; line-height: 1; }
.me-sub { color: var(--muted); font-size: 14.5px; margin-top: 5px; }
.me-sub b { color: var(--ink); }
.me-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.waiting { text-align: center; padding: 26px 18px; }
.shaker { font-size: 54px; display: inline-block; animation: shake 1.1s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes shake { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg) translateY(-4px); } }
.waiting h2 { font-family: var(--display); font-weight: 600; font-size: 30px; text-transform: uppercase; margin: 10px 0 4px; line-height: 1.05; }
.waiting p { color: var(--muted); margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px;
  background: var(--card2); border: 1px solid var(--line); font-size: 14px; font-weight: 650;
}
.chip .av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: #1a1030; }
.chip.me { border-color: rgba(255, 207, 74, 0.5); }

/* ---------- äänestys ---------- */
.progress-wrap {
  position: sticky; top: calc(61px + var(--safe-t)); z-index: 20;
  margin: 0 -16px; padding: 10px 16px 12px;
  background: linear-gradient(180deg, rgba(12, 10, 29, 0.86), rgba(12, 10, 29, 0.6));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.progress-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.progress-top .count { font-family: var(--display); font-size: 21px; letter-spacing: 0.02em; }
.save-state { font-size: 12.5px; color: var(--faint); font-weight: 600; transition: color .2s; }
.save-state.ok { color: var(--ok); }
.save-state.err { color: #ff8a9b; }
.bar { height: 9px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--gold), var(--ok)); transition: width .45s cubic-bezier(.2, .8, .2, 1); }

.intro-note { color: var(--muted); font-size: 14.5px; margin: 16px 2px 4px; }
.intro-note b { color: var(--ink); }

.vote-card { padding: 0; overflow: hidden; margin-top: 18px; scroll-margin-top: 140px; }
.vote-photo { position: relative; aspect-ratio: 16 / 11; background: #1b1440; overflow: hidden; }
.vote-photo img, .vote-photo .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vote-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(8, 6, 22, 0.95) 100%); }
.vote-head { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 14px 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.vote-name { font-family: var(--display); font-size: 36px; line-height: 0.95; font-weight: 600; text-transform: uppercase; overflow-wrap: anywhere; }
.vote-maker { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-top: 5px; }
.vote-desc { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; padding: 14px 16px 0; }
.vote-total {
  flex: none; text-align: center; min-width: 64px; padding: 7px 10px; border-radius: 14px;
  background: rgba(10, 8, 24, 0.66); border: 1px solid rgba(255,255,255,.2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--display); font-size: 25px; line-height: 1; transition: background .3s, border-color .3s, color .3s;
}
.vote-total small { display: block; font-family: var(--body); font-size: 10.5px; font-weight: 700; color: var(--faint); margin-top: 3px; letter-spacing: .06em; }
.vote-card.complete .vote-total { background: rgba(183, 240, 74, 0.18); border-color: rgba(183, 240, 74, 0.6); color: var(--ok); }
.vote-card.complete .vote-total small { color: rgba(183, 240, 74, 0.8); }
.vote-body { padding: 8px 14px 16px; }
.crit { padding-top: 12px; }
.crit-top { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 7px; }
.crit-label { font-weight: 750; font-size: 15px; }
.crit-value { font-family: var(--display); font-size: 22px; line-height: 1; color: var(--faint); min-width: 2ch; text-align: right; }
.crit-value.set { color: var(--cc); }
.scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.score {
  height: 44px; border-radius: 11px; font-weight: 800; font-size: 15.5px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: var(--muted); transition: background .15s, color .15s, transform .15s, box-shadow .15s;
  font-variant-numeric: tabular-nums;
}
.score.lit { background: color-mix(in srgb, var(--cc) 26%, transparent); color: var(--ink); border-color: color-mix(in srgb, var(--cc) 30%, transparent); }
.score.on { background: var(--cc); color: #120c26; border-color: transparent; transform: scale(1.1); box-shadow: 0 6px 18px color-mix(in srgb, var(--cc) 55%, transparent); }
.score:active { transform: scale(0.92); }
.crit[data-c="maku"] { --cc: var(--c-maku); }
.crit[data-c="ulkonako"] { --cc: var(--c-ulkonako); }
.crit[data-c="luovuus"] { --cc: var(--c-luovuus); }

.own-card { display: flex; gap: 14px; align-items: center; margin-top: 18px; opacity: 0.8; border-style: dashed; }
.own-card .me-thumb { width: 64px; height: 64px; filter: grayscale(.6); }
.own-card b { display: block; font-size: 15.5px; }
.own-card span { color: var(--muted); font-size: 14px; }

.done-banner {
  margin-top: 22px; text-align: center; padding: 22px 18px;
  background: linear-gradient(135deg, rgba(183, 240, 74, 0.16), rgba(79, 195, 255, 0.12));
  border-color: rgba(183, 240, 74, 0.4);
}
.done-banner .big { font-size: 40px; }
.done-banner h3 { font-family: var(--display); font-size: 30px; text-transform: uppercase; margin: 6px 0 4px; font-weight: 600; }
.done-banner p { margin: 0; color: var(--muted); font-size: 14.5px; }

.judges { display: grid; gap: 8px; }
.judge { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 650; }
.judge .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #1a1030; }
.judge .bar { height: 7px; }
.judge .nums { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 42px; text-align: right; }
.judge.done .nums { color: var(--ok); }
.judge-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.judge-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- paljastus ---------- */
.stage { padding-top: 18px; }
.reveal-intro { text-align: center; padding: 30px 6px 10px; }
.drum { font-size: 64px; display: inline-block; animation: drum .22s ease-in-out infinite alternate; }
@keyframes drum { from { transform: rotate(-6deg) scale(1); } to { transform: rotate(6deg) scale(1.06); } }
.reveal-intro .mega { font-size: clamp(64px, 21vw, 150px); }
.stats-row { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.stat { flex: 1 1 0; min-width: 0; max-width: 150px; padding: 12px 8px; border-radius: 18px; background: var(--card2); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 34px; line-height: 1; font-weight: 600; }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }

.stage-grid { display: grid; gap: 18px; }
@media (min-width: 980px) {
  .app.wide { max-width: 1320px; }
  .stage-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 34px; }
}
.spot {
  position: relative; border-radius: 28px; overflow: hidden; padding: 0;
  border: 1px solid var(--line2);
  background: #17122f;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: spotIn .8s cubic-bezier(.2, .9, .25, 1.15) both;
}
@keyframes spotIn { from { opacity: 0; transform: translateY(30px) scale(.92) rotateX(12deg); } to { opacity: 1; transform: none; } }
.spot.place-1 { border-color: rgba(255, 207, 74, 0.8); box-shadow: 0 0 0 2px rgba(255, 207, 74, .35), 0 30px 90px rgba(255, 180, 60, .35); }
.spot.place-2 { border-color: rgba(214, 222, 236, 0.7); }
.spot.place-3 { border-color: rgba(232, 153, 90, 0.7); }
.spot-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #1b1440; }
.spot-photo img, .spot-photo .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 18, 47, 0) 38%, rgba(23, 18, 47, .82) 78%, #17122f 100%); }
.spot-place {
  position: absolute; z-index: 2; top: 14px; left: 14px;
  display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 99px;
  background: rgba(10, 8, 24, .72); border: 1px solid rgba(255,255,255,.25);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--display); font-size: 24px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.spot-place .medal { font-size: 26px; line-height: 1; }
.spot-info { position: relative; z-index: 2; margin-top: -92px; padding: 0 20px 20px; }
.spot-name { font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: clamp(42px, 12vw, 84px); line-height: .9; overflow-wrap: anywhere; text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.spot.place-1 .spot-name { color: var(--gold); text-shadow: 0 0 34px rgba(255, 207, 74, .55), 0 4px 30px rgba(0,0,0,.6); }
.spot-makers { font-size: 16px; color: var(--muted); font-weight: 650; margin-top: 8px; }
.spot-score { display: flex; align-items: baseline; gap: 8px; margin-top: 16px; }
.spot-score b { font-family: var(--display); font-size: 64px; line-height: .9; font-weight: 600; }
.spot-score span { color: var(--muted); font-weight: 700; }
.breakdown { display: grid; gap: 9px; margin-top: 16px; }
.bd { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; }
.bd .bar { height: 10px; }
.bd .bar > i { background: var(--cc); }
.bd .val { text-align: right; font-variant-numeric: tabular-nums; }
.bd[data-c="maku"] { --cc: var(--c-maku); }
.bd[data-c="ulkonako"] { --cc: var(--c-ulkonako); }
.bd[data-c="luovuus"] { --cc: var(--c-luovuus); }
.winner-banner {
  text-align: center; margin: 4px 0 16px;
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  font-size: clamp(46px, 14vw, 104px); line-height: .9;
  background: linear-gradient(100deg, #fff3c4 0%, var(--gold) 35%, #ff9f45 65%, #fff3c4 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 3s linear infinite;
  filter: drop-shadow(0 6px 30px rgba(255, 180, 60, .45));
}
@keyframes shine { to { background-position: -200% 0; } }
.winner-wrap { text-align: center; }
.crown { display: inline-block; font-size: 54px; line-height: 1; animation: bob 2s ease-in-out infinite; }

.suspense { text-align: center; padding: 60px 10px; }
.suspense .q {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  font-size: clamp(54px, 17vw, 130px); line-height: .9; color: var(--cream);
  text-shadow: 3px 3px 0 var(--red), 6px 6px 0 var(--blue);
}
.suspense .dots { display: flex; justify-content: center; gap: 14px; margin-top: 30px; }
.suspense .dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--gold); animation: dotty 0.9s ease-in-out infinite; }
.suspense .dots i:nth-child(2) { animation-delay: .15s; }
.suspense .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotty { 50% { transform: translateY(-14px); opacity: .5; } }

.rank-list { display: grid; gap: 10px; }
.rank {
  display: grid; grid-template-columns: 46px 54px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  animation: rankIn .5s ease both;
}
@keyframes rankIn { from { opacity: 0; transform: translateX(-16px); } }
.rank .pl { font-family: var(--display); font-size: 30px; text-align: center; font-weight: 600; }
.rank .th { width: 54px; height: 54px; border-radius: 14px; overflow: hidden; background: #1b1440; }
.rank .th img, .rank .th .ph { width: 100%; height: 100%; object-fit: cover; font-size: 24px; }
.rank .nm { font-weight: 800; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.rank .mk { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .sc { font-family: var(--display); font-size: 28px; font-weight: 600; text-align: right; line-height: 1; }
.rank .sc small { display: block; font-family: var(--body); font-size: 11px; color: var(--faint); font-weight: 700; margin-top: 3px; }
.rank.p1 { background: linear-gradient(110deg, rgba(255, 207, 74, .24), rgba(255, 159, 69, .08)); border-color: rgba(255, 207, 74, .55); }
.rank.p1 .pl, .rank.p1 .sc { color: var(--gold); }
.rank.p2 { background: linear-gradient(110deg, rgba(214, 222, 236, .16), rgba(214, 222, 236, .04)); border-color: rgba(214, 222, 236, .4); }
.rank.p3 { background: linear-gradient(110deg, rgba(232, 153, 90, .18), rgba(232, 153, 90, .04)); border-color: rgba(232, 153, 90, .45); }
.rank-list.full .rank { grid-template-columns: 46px 54px minmax(0, 1fr) auto; }
.rank .minibars { grid-column: 3 / 5; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 2px; }
.rank .minibars div { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.rank .minibars .bar { height: 6px; margin-top: 3px; }
.rank .minibars .bar > i { background: var(--cc); }

.awards { display: grid; gap: 12px; }
@media (min-width: 980px) { .awards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.award {
  position: relative; overflow: hidden; border-radius: 22px; padding: 12px;
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  border: 1px solid color-mix(in srgb, var(--cc) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 20%, transparent), rgba(255,255,255,.03));
  animation: spotIn .7s cubic-bezier(.2, .9, .25, 1.15) both;
}
.award:nth-child(2) { animation-delay: .25s; }
.award:nth-child(3) { animation-delay: .5s; }
.award[data-c="maku"] { --cc: var(--c-maku); }
.award[data-c="ulkonako"] { --cc: var(--c-ulkonako); }
.award[data-c="luovuus"] { --cc: var(--c-luovuus); }
.award .ap { width: 92px; height: 92px; border-radius: 16px; position: relative; overflow: hidden; background: #1b1440; }
.award .ap img, .award .ap .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.award .ab { min-width: 0; }
.award .at { font-size: 12.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cc); }
.award .an { font-family: var(--display); font-size: 30px; font-weight: 600; text-transform: uppercase; line-height: 1; margin-top: 6px; overflow-wrap: anywhere; }
.award .am { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.award .av { font-family: var(--display); font-size: 34px; line-height: 1; text-align: right; color: var(--cc); padding-right: 4px; }
.award .av small { display: block; font-family: var(--body); font-size: 11px; font-weight: 700; color: var(--faint); margin-top: 3px; }
.judge-awards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.judge-awards .card { margin-top: 0; }
.judge-award { padding: 16px 10px; text-align: center; animation: spotIn .7s .75s cubic-bezier(.2, .9, .25, 1.15) both; }
.judge-award .e { font-size: 34px; }
.judge-award .t { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.judge-award .n { font-family: var(--display); font-size: 28px; text-transform: uppercase; font-weight: 600; line-height: 1.05; margin-top: 4px; overflow-wrap: anywhere; }
.judge-award .s { font-size: 13px; color: var(--faint); font-weight: 650; }

.host-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 12px 14px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, rgba(12, 10, 29, 0), rgba(12, 10, 29, .94) 35%);
}
.host-bar .inner { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: 52px 1fr; gap: 10px; }
.host-bar .btn { height: 56px; }
.host-bar .next { font-size: 17px; }
.watch-note { text-align: center; color: var(--faint); font-size: 13.5px; margin-top: 26px; }

/* ---------- arkit ---------- */
.sheet-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(4, 3, 12, .6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0;
  max-width: 720px; margin: 0 auto; max-height: 92vh; max-height: 92dvh; overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #1d1645 0%, #120d2b 100%);
  border: 1px solid var(--line2); border-bottom: 0; border-radius: 28px 28px 0 0;
  padding: 8px 18px calc(24px + var(--safe-b));
  box-shadow: 0 -30px 80px rgba(0,0,0,.5);
  animation: sheetUp .32s cubic-bezier(.2, .9, .25, 1) both;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.sheet-grip { width: 42px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.22); margin: 2px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; position: sticky; top: -8px; z-index: 2; background: #1d1645; padding: 8px 0; margin-top: -8px; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 30px; text-transform: uppercase; line-height: 1; }
.menu-list { display: grid; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.menu-item .mi { font-size: 22px; width: 30px; text-align: center; }
.menu-item small { display: block; font-weight: 550; color: var(--faint); font-size: 13px; margin-top: 1px; }

.qr-box { background: #fff; border-radius: 22px; padding: 16px; width: min(78vw, 340px); margin: 6px auto 0; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-url { text-align: center; font-weight: 700; margin-top: 14px; font-size: 15px; word-break: break-all; color: var(--muted); }
.qr-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.photo-edit { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; background: #1b1440; }
.photo-edit img, .photo-edit .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-edit .ov { position: absolute; inset: auto 12px 12px auto; z-index: 2; }
.photo-edit.busy::after { content: "Ladataan…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 8, 24, .7); font-weight: 800; }

/* isäntä */
.host-section { margin-top: 22px; }
.host-section h3 { font-family: var(--display); font-weight: 600; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 10px; color: var(--gold); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 18px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.seg button { height: 46px; border-radius: 13px; font-weight: 750; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--cream); color: #1a1030; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.warn { margin-top: 10px; padding: 11px 13px; border-radius: 14px; background: rgba(255, 207, 74, .1); border: 1px solid rgba(255, 207, 74, .35); color: #ffe29a; font-size: 14px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.row + .row { margin-top: 8px; }
.row .grow { flex: 1; min-width: 0; }
.row .nm { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--muted); }
.row .th { width: 46px; height: 46px; border-radius: 12px; overflow: hidden; flex: none; background: #1b1440; }
.row .th img, .row .th .ph { width: 100%; height: 100%; object-fit: cover; font-size: 20px; }
.prow { display: block; }
.prow-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prow-top .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #1a1030; flex: none; }
.prow-top .nm { flex: 1; min-width: 0; }
.prow-top .sub { flex: none; }
.prow-ctrl { display: flex; gap: 8px; margin-top: 10px; }
.prow-ctrl .select { flex: 1; min-width: 0; max-width: none; }
.select {
  height: 40px; border-radius: 12px; padding: 0 10px; max-width: 46vw;
  background: rgba(0,0,0,.3); border: 1px solid var(--line2); font-size: 14px; font-weight: 650;
}
.mini-btn { height: 40px; min-width: 40px; padding: 0 10px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line2); font-size: 16px; display: grid; place-items: center; }
.mini-btn.danger { background: rgba(255, 61, 90, .12); border-color: rgba(255, 61, 90, .4); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-weight: 650; }
.switch { position: relative; width: 52px; height: 32px; border-radius: 99px; background: rgba(255,255,255,.18); transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(20px); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 70;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 520px); padding: 13px 18px; border-radius: 16px;
  background: #fff6ea; color: #1a1030; font-weight: 750; font-size: 15px; text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.45); transition: opacity .2s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #ff3d5a; color: #fff; }

.offline { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 80; padding: 7px 14px; border-radius: 99px; background: #ff3d5a; color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

/* ---------- TV ---------- */
.tv { max-width: none; padding: 34px 48px 60px; min-height: 100vh; }
.tv-grid { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.6fr); gap: 48px; align-items: start; }
.tv-left { position: sticky; top: 34px; text-align: center; }
.tv-left .mega { font-size: clamp(56px, 5.4vw, 124px); margin-top: 0; }
.tv-left .qr-box { width: min(100%, 360px); }
.tv-left .qr-url { font-size: 18px; }
.tv-phase { display: inline-flex; margin-top: 18px; }
.tv .drink-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tv .tile-name { font-size: clamp(22px, 2vw, 34px); }
.tv .judges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 26px; }
.tv .judge { font-size: 18px; }
.tv .section-title { font-size: 32px; }
@media (max-width: 900px) {
  .tv { padding: 20px 16px 60px; }
  .tv-grid { grid-template-columns: 1fr; }
  .tv-left { position: static; }
  .tv .drink-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv .judges { grid-template-columns: 1fr; }
}
.tv.app.wide .stage { padding-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- sovitus ---------- */
.fit { overflow-wrap: normal !important; word-break: normal; }
.fit.fit-break { overflow-wrap: anywhere !important; }
.tagline, .waiting h2, .waiting p, .done-banner p, .intro-note, .hint { text-wrap: pretty; }
.tagline, .waiting h2 { text-wrap: balance; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.primary:disabled { opacity: 1; background: #2a2350; color: var(--faint); box-shadow: none; }
.btn-row.center { justify-content: center; }
