/* Katiska FM – paikallisradiota vuodelta ei-koskaan.
   Puusyykuvioitu kotelo, kermanväriset etupaneelit, LCD-näyttö ja ON AIR -valokyltti. */

:root {
  --wood-1: #4b2c19;
  --wood-2: #3a2214;
  --wood-3: #5c3721;
  --cream: #f6ead0;
  --cream-2: #ecdcb6;
  --cream-3: #dcc597;
  --ink: #2b1a10;
  --ink-soft: #6e5038;
  --ink-faint: #9b7d61;
  --red: #e2381b;
  --red-dark: #8f1d0a;
  --orange: #f2871c;
  --mustard: #f4b72a;
  --mustard-dark: #a4740c;
  --teal: #1d8a78;
  --teal-dark: #0d5248;
  --lcd-bg: #141d0c;
  --lcd: #ffb21f;
  --lcd-dim: rgba(255, 178, 31, 0.28);
  --ok: #2fa463;
  --danger: #c9301a;
  --radius: 22px;
  --radius-sm: 14px;
  --hard: 0 6px 0 #1c0f07;
  --soft: 0 24px 40px -18px rgba(0, 0, 0, 0.6);
  --display: "Bungee", "Rubik", system-ui, sans-serif;
  --shade: "Bungee Shade", "Bungee", system-ui, sans-serif;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lcd-font: "VT323", ui-monospace, monospace;
  --viz-a: #ff6a1a;
  --viz-b: #ffd84a;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  background-color: var(--wood-2);
  background-image:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 190, 110, 0.18), transparent 60%),
    repeating-linear-gradient(91deg, rgba(0, 0, 0, 0.0) 0 7px, rgba(0, 0, 0, 0.09) 7px 9px, rgba(0, 0, 0, 0) 9px 19px),
    repeating-linear-gradient(89.3deg, rgba(255, 220, 170, 0.04) 0 3px, transparent 3px 41px),
    linear-gradient(180deg, var(--wood-3), var(--wood-1) 40%, var(--wood-2));
  background-attachment: fixed;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
h3, h4 { font-family: var(--font); font-weight: 800; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
code { font-family: var(--lcd-font); font-size: 1.15em; }
.muted { color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: 13px; }
.error { color: var(--danger); font-size: 13px; min-height: 1.2em; font-weight: 600; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- Yläpalkki ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  background: linear-gradient(180deg, #2a170c, #1f1109);
  border-bottom: 4px solid var(--mustard-dark);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); }
.brand-mark {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; font-size: 22px;
  border-radius: 12px; background: var(--red); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.brand-antenna {
  position: absolute; left: 26px; top: -14px; width: 3px; height: 18px; background: #c9c9c9;
  transform: rotate(28deg); transform-origin: bottom; border-radius: 2px;
}
.brand-antenna::after { content: ""; position: absolute; top: -4px; left: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(2) infinite; }
.brand-name { font-family: var(--display); font-size: 22px; letter-spacing: 0.02em; display: flex; align-items: center; gap: 6px; }
.brand-fm {
  font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--mustard); color: var(--ink);
  transform: rotate(-8deg); border: 2px solid var(--ink);
}
.nick-chip {
  display: flex; align-items: center; gap: 8px; max-width: 60vw;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 3px 0 #000;
  font-weight: 700; transition: transform .1s, box-shadow .1s;
}
.nick-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.nick-chip #nickLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

.avatar {
  --c: var(--red);
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c); color: #fff; border: 2.5px solid var(--ink);
  font-weight: 800; font-size: 12px; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(0,0,0,.35);
}
.avatar-lg { width: 58px; height: 58px; font-size: 18px; border-width: 3px; box-shadow: 0 4px 0 var(--ink); }

.app { width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.footer { text-align: center; padding: 18px 16px 28px; color: rgba(246, 234, 208, 0.55); font-size: 13px; }

/* ---------- Painikkeet ---------- */
.btn {
  --sh: #1c0f07;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 14px;
  border: 3px solid var(--ink); font-weight: 800; white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; font-size: 14px;
  box-shadow: 0 4px 0 var(--sh);
  transition: transform .08s, box-shadow .08s, background .15s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--sh); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn-secondary { background: var(--cream-2); color: var(--ink); }
.btn-secondary[aria-pressed="true"] { background: var(--mustard); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: none; border-width: 2px; }
.btn-ghost:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn-danger { background: #f0c8b8; color: var(--red-dark); }
.btn-phone { background: var(--mustard); color: var(--ink); }
.btn-phone[aria-pressed="true"] { background: var(--teal); color: #fff; animation: ring .5s ease-in-out infinite alternate; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 12px; border-width: 2px; box-shadow: 0 3px 0 var(--sh); }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 16px; font-family: var(--display); font-weight: 400; }
.btn-xl { min-height: 64px; padding: 0 28px; font-size: 19px; font-family: var(--display); font-weight: 400; }
.btn-block { width: 100%; }
.btn .dot { width: 11px; height: 11px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px rgba(0,0,0,.2); }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--cream-2); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.icon-btn-lg { width: 54px; height: 54px; background: var(--red); color: #fff; }
.icon-btn-accent { background: var(--red); color: #fff; }

@keyframes ring { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- Paneelit ---------- */
.card {
  position: relative;
  background:
    radial-gradient(140% 90% at 0% 0%, rgba(255, 255, 255, 0.55), transparent 50%),
    var(--cream);
  border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--hard), var(--soft);
}
.screws i {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #b7a98d 55%, #6d5f48);
  border: 1.5px solid rgba(43, 26, 16, .5);
}
.screws i::after { content: ""; position: absolute; inset: 4.5px 1px; background: rgba(43, 26, 16, .55); transform: rotate(35deg); border-radius: 1px; }
.screws i:nth-child(1) { top: 10px; left: 10px; } .screws i:nth-child(2) { top: 10px; right: 10px; }
.screws i:nth-child(3) { bottom: 10px; left: 10px; } .screws i:nth-child(4) { bottom: 10px; right: 10px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select, .code-form input, .chat-form input {
  width: 100%; min-height: 48px; padding: 0 14px;
  background: #fffaf0; color: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius-sm);
  box-shadow: inset 0 3px 0 rgba(43, 26, 16, .08); outline: none; transition: box-shadow .15s;
}
.field input:focus, .field select:focus, .code-form input:focus, .chat-form input:focus { box-shadow: 0 0 0 4px var(--mustard); }
.field-sm select { min-height: 40px; font-size: 14px; }
input::placeholder { color: var(--ink-faint); }

/* Liukusäätimet = mikseripöydän faderit */
.slider { display: grid; gap: 2px; font-size: 12px; color: var(--ink-soft); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; cursor: pointer; --p: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 6px; border: 2px solid var(--ink);
  background: linear-gradient(90deg, var(--orange) var(--p), #3a2a1e var(--p));
}
input[type="range"]::-moz-range-track { height: 8px; border-radius: 6px; border: 2px solid var(--ink); background: #3a2a1e; }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 6px; background: var(--orange); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 28px; margin-top: -11px; border-radius: 4px;
  background: linear-gradient(180deg, #fafafa, #bdbdbd 45%, #222 46%, #222 54%, #bdbdbd 55%, #8d8d8d);
  border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink);
}
input[type="range"]::-moz-range-thumb { width: 14px; height: 26px; border-radius: 4px; background: linear-gradient(180deg, #fafafa, #bdbdbd 45%, #222 46%, #222 54%, #bdbdbd 55%, #8d8d8d); border: 2px solid var(--ink); }

/* LED-mittari */
.meter {
  position: relative; width: 100px; height: 14px; border-radius: 4px; overflow: hidden;
  background: var(--lcd-bg); border: 2px solid var(--ink);
}
.meter span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #36d06f 0 60%, #f4d02a 60% 82%, #ff3b1f 82%);
  background-size: 96px 100%;
  transition: width .06s linear;
}
.meter::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 6px, var(--lcd-bg) 6px 8px);
}

.pill { min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; text-align: center; border: 2px solid var(--ink); animation: ring .4s ease-in-out infinite alternate; }

/* ON AIR -valokyltti */
.onair, .lightbox {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 8px;
  font-family: var(--display); font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
  background: #4a1a12; color: #8e5248; border: 3px solid var(--ink);
  box-shadow: inset 0 0 8px rgba(0,0,0,.6), 0 3px 0 var(--ink);
}
.onair.is-on, .lightbox {
  background: radial-gradient(circle at 50% 40%, #ff6a4a, var(--red));
  color: #fff6ea; text-shadow: 0 0 6px #fff, 0 0 14px #ffb199;
  box-shadow: 0 0 18px rgba(255, 70, 40, .75), 0 0 40px rgba(255, 70, 40, .35), 0 3px 0 var(--ink);
  animation: flicker 5s infinite;
}
@keyframes flicker { 0%, 92%, 96%, 100% { opacity: 1 } 94% { opacity: .55 } 95% { opacity: .9 } }

.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(226, 56, 27, .7); animation: pulse 1.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(226, 56, 27, 0); } 100% { box-shadow: 0 0 0 0 rgba(226, 56, 27, 0); } }

/* TV-lumisade/kohina */
.static {
  display: block; width: 72px; height: 48px; border-radius: 8px; flex: none;
  border: 3px solid var(--ink);
  background-color: #777;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: snow .25s steps(4) infinite;
}
@keyframes snow { 0% { background-position: 0 0 } 25% { background-position: -30px 20px } 50% { background-position: 25px -35px } 75% { background-position: -15px -10px } 100% { background-position: 10px 30px } }

/* ---------- Etusivu ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; padding: 24px 0 48px; color: var(--cream); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px;
  background: rgba(0,0,0,.35); border: 2px solid rgba(246, 234, 208, .25);
  font-weight: 800; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mustard);
}
.hero h1 { margin: 22px 0 10px; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.h1-top {
  font-family: var(--shade); font-size: clamp(52px, 9vw, 116px); line-height: .95; color: var(--mustard);
  text-shadow: 0 6px 0 var(--red-dark);
}
.h1-fm {
  font-family: var(--display); font-size: clamp(26px, 3.6vw, 44px); padding: 4px 14px; margin-top: 8px;
  background: var(--red); color: #fff; border: 4px solid var(--ink); border-radius: 12px; box-shadow: 0 5px 0 var(--ink);
  transform: rotate(-9deg);
}
.slogan { font-size: clamp(18px, 2.2vw, 23px); font-weight: 800; font-style: italic; color: var(--orange); margin-bottom: 14px; }
.lead { font-size: 17px; color: rgba(246, 234, 208, .88); max-width: 34em; }

.dial {
  position: relative; margin-top: 28px; max-width: 520px; height: 64px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #1d2714, var(--lcd-bg)); border: 4px solid var(--ink); box-shadow: 0 5px 0 #000, inset 0 0 20px rgba(0,0,0,.7);
}
.dial::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 8px; height: 18px;
  background: repeating-linear-gradient(90deg, var(--lcd) 0 2px, transparent 2px 10px);
  -webkit-mask: linear-gradient(180deg, #000 55%, transparent 56%), repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 50px);
  mask-composite: add; opacity: .8;
}
.dial-scale { position: absolute; left: 14px; right: 14px; bottom: 6px; display: flex; justify-content: space-between; font-family: var(--lcd-font); font-size: 20px; color: var(--lcd); text-shadow: 0 0 6px var(--lcd); }
.dial-needle {
  position: absolute; top: 0; bottom: 0; width: 4px; background: var(--red); box-shadow: 0 0 10px var(--red);
  left: 20%; animation: tune 7s ease-in-out infinite;
}
@keyframes tune { 0% { left: 12% } 30% { left: 62% } 38% { left: 58% } 60% { left: 81% } 80% { left: 34% } 100% { left: 12% } }

.create-card { padding: 32px 28px 28px; display: grid; gap: 18px; transform: rotate(1deg); color: var(--ink); }
.create-head { display: grid; gap: 14px; justify-items: start; }
.create-head h2 { font-size: 30px; }

.section { padding: 26px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; color: var(--cream); }
.section-head h2 { font-size: 30px; margin-bottom: 4px; color: var(--mustard); text-shadow: 0 3px 0 var(--red-dark); }
.section-head .muted { color: rgba(246, 234, 208, .7); }
.code-form { display: flex; gap: 8px; }
.code-form input { width: 140px; font-family: var(--lcd-font); font-size: 26px; text-transform: uppercase; letter-spacing: .2em; text-align: center; background: var(--lcd-bg); color: var(--lcd); }
.code-form input::placeholder { color: var(--lcd-dim); }

.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.live-card {
  display: grid; gap: 12px; padding: 20px; text-decoration: none; color: var(--ink);
  background: var(--cream); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--hard);
  transition: transform .15s;
}
.live-card:nth-child(odd) { transform: rotate(-.8deg); }
.live-card:nth-child(even) { transform: rotate(.8deg); }
.live-card:hover { transform: rotate(0) translateY(-4px); }
.live-card h3 { font-family: var(--display); font-weight: 400; font-size: 21px; overflow-wrap: anywhere; }
.live-card .freq { font-size: 26px; }
.live-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.live-card .host { display: flex; align-items: center; gap: 8px; color: var(--ink); min-width: 0; }
.live-card .host span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.mini-bars i { width: 6px; background: linear-gradient(var(--red), var(--orange)); border: 1.5px solid var(--ink); animation: bars 1s ease-in-out infinite; }
.mini-bars i:nth-child(2) { animation-delay: -.3s } .mini-bars i:nth-child(3) { animation-delay: -.6s }
.mini-bars i:nth-child(4) { animation-delay: -.15s } .mini-bars i:nth-child(5) { animation-delay: -.45s }
@keyframes bars { 0%,100% { height: 25% } 50% { height: 100% } }

.empty {
  display: flex; align-items: center; gap: 18px; padding: 22px; border-radius: var(--radius);
  background: rgba(0, 0, 0, .3); border: 3px dashed rgba(246, 234, 208, .35); color: rgba(246, 234, 208, .8);
}
.empty strong { color: var(--mustard); font-size: 17px; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature { padding: 22px; border-radius: var(--radius); background: var(--cream); border: 3px solid var(--ink); box-shadow: var(--hard); }
.feature:nth-child(1) { transform: rotate(-1.2deg); } .feature:nth-child(2) { transform: rotate(.8deg); }
.feature:nth-child(3) { transform: rotate(-.5deg); } .feature:nth-child(4) { transform: rotate(1.3deg); }
.feature h3 { font-size: 18px; margin: 12px 0 6px; }
.feature p { color: var(--ink-soft); font-size: 14px; }
.feature-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; font-size: 26px; background: var(--mustard); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }

/* ---------- Uutisnauha ---------- */
.ticker {
  overflow: hidden; margin: -8px 0 18px; border-radius: 10px; border: 3px solid var(--ink);
  background: var(--lcd-bg); box-shadow: 0 4px 0 #000, inset 0 0 14px rgba(0,0,0,.8);
}
.ticker-track {
  display: inline-block; white-space: nowrap; padding: 4px 0 2px; padding-left: 100%;
  font-family: var(--lcd-font); font-size: 22px; color: var(--lcd); text-shadow: 0 0 6px rgba(255, 178, 31, .7);
  animation: ticker var(--ticker-time, 60s) linear infinite;
}
.ticker-track span { margin-right: 56px; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- Kanavasivu ---------- */
.show-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.show-main { display: grid; gap: 22px; min-width: 0; }
.show-side { position: sticky; top: 84px; min-width: 0; }
.show-layout:not([data-role="host"]) [data-only="host"],
.show-layout:not([data-role="guest"]) [data-only="guest"] { display: none !important; }

.stage { padding: 26px 24px 22px; display: grid; gap: 18px; }
.stage-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lcd-mini { font-family: var(--lcd-font); font-size: 22px; font-weight: 400; color: var(--lcd); background: var(--lcd-bg); padding: 0 10px; border-radius: 6px; border: 2px solid var(--ink); text-shadow: 0 0 5px var(--lcd); }
.share-btn { margin-left: auto; }
.freq {
  display: inline-block; font-family: var(--lcd-font); font-size: 30px; line-height: 1; padding: 4px 12px 2px; margin-bottom: 10px;
  color: var(--lcd); background: var(--lcd-bg); border: 3px solid var(--ink); border-radius: 8px; text-shadow: 0 0 8px var(--lcd);
}
.stage-title h1 { font-size: clamp(28px, 4.2vw, 48px); overflow-wrap: anywhere; color: var(--ink); text-shadow: 0 3px 0 var(--mustard); }
.host-line { margin-top: 8px; color: var(--ink-soft); font-weight: 600; }
.host-line strong { color: var(--ink); }
.host-line code { color: var(--red); letter-spacing: .14em; font-size: 1.3em; }
.sep { opacity: .5; margin: 0 4px; }

.radio-face { display: grid; grid-template-columns: 90px minmax(0, 1fr) 90px; gap: 16px; align-items: stretch; }
.grille {
  border-radius: 16px; border: 3px solid var(--ink);
  background: radial-gradient(circle, var(--ink) 2.4px, transparent 2.9px) 0 0 / 11px 11px, #8a6a4c;
  box-shadow: inset 0 0 18px rgba(0,0,0,.45);
}
.viz-wrap {
  position: relative; height: 220px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 100%, rgba(255, 150, 30, .12), transparent 60%), var(--lcd-bg);
  border: 4px solid var(--ink); box-shadow: inset 0 0 28px rgba(0,0,0,.9);
}
.viz-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,.22) 0 2px, transparent 2px 4px);
}
.viz-wrap canvas { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); }
.listen-overlay, .waiting {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 16px;
  background: rgba(10, 14, 6, 0.6);
}
.listen-overlay p, .waiting p { color: var(--lcd); font-family: var(--lcd-font); font-size: 22px; line-height: 1.1; max-width: 26em; text-shadow: 0 0 6px rgba(255,178,31,.6); }
.listen-btn { animation: wiggle 2.2s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0) } 84% { transform: rotate(-3deg) scale(1.04) } 88% { transform: rotate(3deg) scale(1.04) } 92% { transform: rotate(-2deg) } }

.reactions-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.floater { position: absolute; bottom: -10px; font-size: 34px; animation: float 2.8s ease-out forwards; }
@keyframes float {
  0% { transform: translateY(0) scale(.6) rotate(0); opacity: 0; }
  12% { opacity: 1; transform: translateY(-20px) scale(1.2) rotate(-10deg); }
  100% { transform: translateY(-240px) translateX(var(--dx, 0)) scale(1) rotate(20deg); opacity: 0; }
}

.now-playing {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--cream-2); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.np-art { display: grid; place-items: center; width: 48px; height: 48px; flex: none; }
.vinyl {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink);
  background: radial-gradient(circle, var(--red) 0 8px, var(--ink) 8.5px 10px, #222 10.5px), repeating-radial-gradient(circle, #111 0 2px, #2a2a2a 2px 3px);
  animation: spin 1.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.np-text { display: grid; min-width: 0; }
.np-text small { color: var(--ink-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.np-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }

.stage-people h3, .stage-columns h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); margin-bottom: 10px; }
.stage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.stage-list li { display: grid; justify-items: center; gap: 6px; width: 82px; text-align: center; }
.stage-list .name { font-size: 13px; font-weight: 800; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-list .role { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 1px 7px; border-radius: 999px; background: var(--ink); color: var(--mustard); }
.stage-list .avatar { transition: box-shadow .12s, transform .12s; }
.stage-list .avatar.talking { transform: scale(1.08); box-shadow: 0 0 0 4px var(--cream), 0 0 0 7px var(--ok), 0 4px 0 7px var(--ink); }
.stage-list .avatar.muted-av { filter: grayscale(1); opacity: .6; }

.reaction-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reaction-label { font-family: var(--display); font-size: 13px; color: var(--ink-soft); }
.reaction-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.reaction-bar button {
  width: 48px; height: 44px; border-radius: 12px; font-size: 22px;
  background: var(--cream-2); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.reaction-bar button:hover { transform: translateY(-2px) rotate(-6deg); }
.reaction-bar button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.panel { padding: 20px; display: grid; gap: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3 { font-family: var(--display); font-weight: 400; font-size: 19px; }
.panel-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.vol-control { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; max-width: 340px; }
.knob-label { font-family: var(--display); font-size: 13px; color: var(--ink-soft); }
.guest-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.console { display: grid; gap: 22px; }
.console-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.golive { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.golive h2 { font-size: 24px; margin-bottom: 6px; }
.golive .muted { font-size: 14px; max-width: 36em; }
.golive-panel { background: repeating-linear-gradient(-45deg, var(--mustard) 0 18px, var(--ink) 18px 36px); padding: 10px; }
.golive-panel .golive { background: var(--cream); border-radius: 14px; border: 3px solid var(--ink); padding: 16px 18px; }
.golive-panel.is-live { background: repeating-linear-gradient(-45deg, var(--red) 0 18px, var(--ink) 18px 36px); animation: hazard 1s linear infinite; background-size: 51px 51px; }
@keyframes hazard { to { background-position: 51px 0; } }

.mic-controls { display: grid; gap: 14px; }
.mic-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border-radius: 14px;
  font-family: var(--display); font-size: 17px; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  background: #3fc276; color: var(--ink); transition: transform .08s, box-shadow .08s;
}
.mic-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.mic-btn[aria-pressed="false"] { background: #f0a493; color: var(--red-dark); }
.mic-btn:disabled { opacity: .5; cursor: not-allowed; background: var(--cream-3); }
.toggle-row { padding-top: 4px; }
.toggle-row .btn { white-space: normal; text-transform: none; font-size: 14px; }

.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: var(--ink); overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; flex: 1 0 auto; justify-content: center;
  min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: transparent; color: var(--cream-3); font-weight: 800; font-size: 14px; white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--mustard); color: var(--ink); }
.tab-panel { display: grid; gap: 14px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 14px; }
.tab-capture { display: flex; gap: 10px; flex-wrap: wrap; }

.dropzone {
  display: grid; justify-items: center; gap: 6px; padding: 24px 16px; text-align: center; cursor: pointer;
  border: 3px dashed var(--ink-soft); border-radius: var(--radius-sm); color: var(--ink-soft); transition: background .15s, border-color .15s;
}
.dropzone strong { color: var(--ink); font-size: 16px; }
.dz-icon { font-size: 34px; }
.dropzone:hover, .dropzone.drag { border-color: var(--red); background: rgba(242, 135, 28, .12); }
.dropzone.compact { grid-auto-flow: column; padding: 10px; gap: 10px; align-items: center; }
.dropzone.compact > span:not(.dz-icon) { display: none; }
.dropzone.compact .dz-icon { font-size: 22px; }

.player { display: grid; gap: 12px; }
.player-controls { display: flex; align-items: center; gap: 10px; }
.progress-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-family: var(--lcd-font); font-size: 20px; color: var(--ink-soft); }
.playlist { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; background: #fffaf0; border: 3px solid var(--ink); border-radius: 12px; }
.playlist li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; }
.playlist li:hover { background: var(--cream-2); }
.playlist li.current { background: var(--mustard); }
.playlist .num { width: 22px; color: var(--ink-faint); font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; }
.playlist li.current .num { color: var(--ink); }
.playlist .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist .rm { opacity: 0; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; }
.playlist li:hover .rm { opacity: 1; }

.stage-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--cream-2); border: 2px solid var(--ink); min-width: 0; }
.people-list .who { flex: 1; min-width: 0; display: grid; }
.people-list .who strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-list .who small { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.people-list .actions { display: flex; gap: 6px; }
.people-list .actions .icon-btn { width: 36px; height: 36px; border-width: 2px; }
.people-list .actions .ok { background: #3fc276; }
.people-list .actions .no { background: #f0a493; }
#requestList li { animation: ring .35s ease-in-out infinite alternate; }
.people-all li { background: transparent; border-color: transparent; }
.people-all li:hover { background: var(--cream-2); border-color: var(--ink); }
.tag { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; border: 1.5px solid var(--ink); white-space: nowrap; }
.tag-host { background: var(--red); color: #fff; }
.tag-speaker { background: var(--teal); color: #fff; }
.tag-hand { background: var(--mustard); }
.tag-me { background: var(--cream-3); }
.empty-sm { color: var(--ink-faint); font-size: 13px; font-weight: 600; }

/* ---------- Chat = terveiset studioon ---------- */
.chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100dvh - 120px); min-height: 440px; overflow: hidden; }
.chat-head { padding: 12px; border-bottom: 3px solid var(--ink); background: var(--cream-2); border-radius: 19px 19px 0 0; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ink); }
.seg-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--cream-3); font-weight: 800; font-size: 14px; }
.seg-btn[aria-selected="true"] { background: var(--mustard); color: var(--ink); }
.chat-body {
  position: relative; overflow-y: auto; padding: 12px; overscroll-behavior: contain;
  background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(43, 26, 16, .07) 27px 28px);
}
.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.msg { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 6px; border-radius: 10px; }
.msg.cont { padding-top: 0; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.msg-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.msg-head strong { font-size: 14px; color: var(--ink) !important; }
.msg-head time { color: var(--ink-faint); font-size: 11px; font-weight: 600; }
.msg-text { overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14.5px; }
.msg.mine .msg-text { background: #fff3c4; border: 2px solid var(--ink); border-radius: 4px 12px 12px 12px; padding: 4px 10px; justify-self: start; }
.sys { text-align: center; color: var(--ink-soft); font-size: 12px; font-weight: 700; padding: 6px 0; font-style: italic; }
.new-msgs { position: sticky; bottom: 6px; display: block; margin: 0 auto; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--ink); background: var(--red); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 3px 0 var(--ink); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 3px solid var(--ink); background: var(--cream-2); border-radius: 0 0 19px 19px; }
.chat-form input { border-radius: 999px; min-height: 46px; }
.chat-form .icon-btn { width: 46px; height: 46px; }

.mobile-tabs { display: none; }

/* ---------- Dialogi & ilmoitukset ---------- */
.dialog {
  width: min(430px, calc(100vw - 32px)); padding: 0; border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--cream); color: var(--ink); box-shadow: 0 8px 0 var(--ink), 0 40px 80px -20px rgba(0,0,0,.8);
}
.dialog::backdrop { background: rgba(30, 16, 8, 0.7); }
.dialog-body { padding: 24px; display: grid; gap: 14px; }
.dialog-body h2 { font-size: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  padding: 12px 16px; border-radius: 14px; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  font-size: 14px; font-weight: 700; opacity: 0; transform: translateY(14px) rotate(-1deg); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: #f6c3b4; }
.toast-ok { background: #c8efcf; }

/* ---------- Responsiivisuus ---------- */
@media (max-width: 1100px) {
  .show-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .console-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .radio-face { grid-template-columns: 50px minmax(0, 1fr) 50px; }
}

@media (max-width: 900px) {
  .app { padding: 18px 16px 36px; }
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 8px 0 28px; }
  .create-card { transform: none; }
  .show-layout { grid-template-columns: 1fr; padding-bottom: 80px; }
  .show-side { position: static; }
  .show-layout[data-tab="stage"] .show-side,
  .show-layout[data-tab="side"] .show-main { display: none; }
  .chat { height: calc(100dvh - 64px - 70px - 96px); min-height: 360px; }
  .footer { padding-bottom: 96px; }

  .mobile-tabs {
    display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 10px;
    background: linear-gradient(180deg, #2a170c, #1f1109); border-top: 4px solid var(--mustard-dark);
  }
  .mobile-tabs button {
    position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px; border-radius: 14px; border: 3px solid var(--ink); background: var(--cream-3); color: var(--ink);
    font-family: var(--display); font-size: 15px; box-shadow: 0 3px 0 #000;
  }
  .mobile-tabs button[aria-current="true"] { background: var(--mustard); }
  .unread { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); animation: pulse 1.4s infinite; }
  .toasts { bottom: 100px; }
}

@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
  .stage { padding: 22px 16px 18px; }
  .panel { padding: 16px; }
  .create-card { padding: 28px 20px 22px; }
  .radio-face { grid-template-columns: 1fr; }
  .grille { display: none; }
  .viz-wrap { height: 170px; }
  .stage-columns { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .code-form input { flex: 1; width: auto; }
  .tab { font-size: 13px; padding: 0 10px; }
  .guest-actions, .guest-actions .btn { width: 100%; }
  .vol-control { max-width: none; }
  .golive .btn { width: 100%; }
  .nick-chip #nickLabel { max-width: 110px; }
  .brand-name { font-size: 18px; }
  .empty { flex-direction: column; text-align: center; }
  .listen-btn { font-size: 16px; padding: 0 18px; }
  .ticker-track { font-size: 19px; }
}

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