/* Perjantairadio – kuulijasivu. Tumma teema, oranssi–violetti, mobiili ensin. */

:root {
    color-scheme: dark;
    --bg: #0e0d12;
    --surface: rgba(255, 255, 255, .04);
    --surface-solid: #17151e;
    --border: rgba(255, 255, 255, .09);
    --text: #ece8f2;
    --muted: #a39db0;
    --accent: #ff8a3d;
    --accent-2: #a855f7;
    --ok: #86efac;
    --error: #fca5a5;
    --radius: 18px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(88, 36, 140, .55) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(120, 50, 16, .35) 0%, transparent 70%);
    background-attachment: fixed;
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* Otsikko neonkylttinä (3.10.2026): "Perjantai" hehkuvalla kaunokirjoituksella, alla harvennettu RADIO.
   Kirjasin Pacifico omalta palvelimelta (CSP sallii vain oman palvelimen kirjasimet), lisenssi fonts/LISENSSI.txt */
@font-face {
    font-family: "Pacifico";
    src: url("fonts/pacifico-latin.woff2") format("woff2");
    font-display: swap;
}
.logo {
    --logo-size: clamp(3rem, 12vw, 5rem);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.logo-script {
    padding: 0 .15em;
    font-family: "Pacifico", "Brush Script MT", cursive;
    font-size: var(--logo-size);
    font-weight: 400;
    color: #fff4ec;
    text-shadow:
        0 0 2px #fff,
        0 0 10px rgba(255, 138, 61, .9),
        0 0 22px rgba(240, 96, 154, .8),
        0 0 44px rgba(168, 85, 247, .7),
        0 0 80px rgba(168, 85, 247, .45);
    transform: rotate(-4deg);
    animation: neon-on 2.2s ease-out both, neon-hum 6s ease-in-out 2.2s infinite;
}
.logo-sub {
    display: flex;
    align-items: center;
    gap: .9em;
    margin-top: .2em;
    /* Oikealle, jottei j-kirjaimen alakaari peitä RADIO-sanaa. Siirto seuraa otsikon kokoa. */
    transform: translateX(calc(var(--logo-size) * .55));
    font-size: clamp(.8rem, 2.6vw, 1rem);
    font-weight: 800;
    letter-spacing: .7em;
    text-indent: .7em; /* tasapainottaa viimeisen kirjaimen jälkeisen harvennuksen */
    text-transform: uppercase;
    color: #ffd2b5;
    text-shadow: 0 0 8px rgba(255, 138, 61, .7);
}
.logo-sub::before, .logo-sub::after {
    content: "";
    width: clamp(28px, 8vw, 56px);
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--accent));
    box-shadow: 0 0 8px rgba(255, 138, 61, .8);
}
.logo-sub::after { background: linear-gradient(90deg, var(--accent-2), transparent); box-shadow: 0 0 8px rgba(168, 85, 247, .8); }
/* Neonvalo syttyy välähdellen ja hehkuu sen jälkeen hiljalleen */
@keyframes neon-on {
    0% { opacity: .15; }
    8% { opacity: 1; }
    12% { opacity: .3; }
    18% { opacity: 1; }
    22% { opacity: .5; }
    30%, 100% { opacity: 1; }
}
@keyframes neon-hum {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}
@media (prefers-reduced-motion: reduce) { .logo-script { animation: none; } }

/* Keskitetyt sivut: tulossa pian, kunniajäsen */
.centered { display: grid; place-items: center; padding: 24px 16px; }
.hero { max-width: 34rem; text-align: center; }
.hero .logo { margin-bottom: 18px; }
.hero-title { font-size: 1.5rem; margin: 0 0 10px; }

/* Kuulijasivu */
.preview-bar {
    padding: 8px 16px;
    background: linear-gradient(90deg, rgba(255, 138, 61, .25), rgba(168, 85, 247, .25));
    font-size: .88rem;
    text-align: center;
}
.page {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 28px 16px 12px;
    display: grid;
    gap: 18px;
}
.site-header { text-align: center; padding: 18px 0 6px; }

/* Palstat: puhelimella allekkain, leveällä näytöllä chat oikealla (vain kun chat on auki) */
.page-columns, .page-main, .page-side { display: grid; gap: 18px; align-content: start; min-width: 0; }
.page-side:not(:has(.chat:not([hidden]))) { display: none; }

@media (min-width: 1100px) {
    .page:has(.page-side .chat:not([hidden])) { max-width: 1240px; }
    .page:has(.page-side .chat:not([hidden])) .page-columns {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }
    .page-side { position: sticky; top: 16px; }
    /* Madallettu noin kolmanneksella 25.9.2026: viestikenttä ja ylimmät viestit mahtuvat yhtä aikaa näkyviin */
    .page-side .chat-log { height: calc((100vh - 290px) * .66); min-height: 260px; }
}
.tagline { margin: 8px 0 0; color: var(--muted); }

.block {
    padding: 22px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: blur(6px);
}
.block h2 { margin: 0 0 14px; font-size: 1.25rem; letter-spacing: -.01em; }
.block p { margin: 0 0 10px; }
.block p:last-child { margin-bottom: 0; }

.broadcast .eyebrow { margin: 0 0 4px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); }
.broadcast.is-live .eyebrow { color: var(--accent); }
.broadcast h2 { margin-bottom: 4px; }
.broadcast .when { font-weight: 600; }

.broadcast .later {
    margin: 14px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
    list-style: none;
    display: grid;
    gap: 4px;
    font-size: .92rem;
    color: var(--muted);
}
.later-when { color: var(--text); font-weight: 600; margin-right: 6px; }

/* Ohjelma näkyy vain, kun toiveet ja chat ovat kiinni (Kimmon päätös) – silloin suurena */
body:not(.is-idle) .broadcast { display: none; }
/* Sää näkyy vain lähetysten välillä, ei lähetyksen aikana (Kimmon päätös 25.9.2026) */
body:not(.is-idle) .weather { display: none; }
/* Kuuntelulinkit näkyvät vain lähetyksen aikana, eli kun toiveet tai chat on auki (Kimmon päätös 25.9.2026) */
body.is-idle .listen { display: none; }
body.is-idle .page { max-width: 900px; }
body.is-idle .broadcast {
    order: -1;
    padding: clamp(32px, 6vw, 56px) clamp(20px, 5vw, 48px);
    text-align: center;
    border-color: rgba(255, 138, 61, .35);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 138, 61, .18), transparent 70%),
        radial-gradient(ellipse at 50% 100%, rgba(168, 85, 247, .2), transparent 70%),
        var(--surface);
}
body.is-idle .broadcast .eyebrow { font-size: 1rem; margin-bottom: 10px; }
body.is-idle .broadcast h2 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.1; margin-bottom: 12px; }
body.is-idle .broadcast .when { font-size: clamp(1.15rem, 3.5vw, 1.5rem); color: var(--text); }
body.is-idle .broadcast p { font-size: 1.05rem; }
body.is-idle .broadcast .later { max-width: 520px; margin: 24px auto 0; font-size: 1rem; text-align: left; }

/* Kuuntelulinkit */
.listen-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.listen-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 14px;
    border-radius: 99px;
    background: linear-gradient(95deg, var(--accent), #f0609a 60%, var(--accent-2));
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.listen-link:hover { filter: brightness(1.1); }
.listen-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    font-size: .8rem;
}

/* Sää */
.weather-places { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.weather-place { padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); }
.weather-now { display: flex; align-items: center; gap: 14px; }
.weather-icon { font-size: 2.6rem; line-height: 1; }
.weather-name { font-weight: 700; }
.weather-temp { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.weather-forecast {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 12px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
    list-style: none;
    text-align: center;
}
.weather-forecast li { display: grid; gap: 2px; }
.weather-small-icon { font-size: 1.3rem; }
.weather-source { margin-top: 10px !important; text-align: right; }

.closed-note { color: var(--muted); }

/* Lomakkeet */
.form { display: grid; gap: 14px; }
.form label { display: block; font-size: .9rem; color: var(--muted); }
.form .optional { font-size: .8rem; opacity: .8; }
.form .row { display: grid; gap: 14px; }
@media (min-width: 520px) { .form .row { grid-template-columns: 1fr 1fr; } }

input, textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, .35);
    color: var(--text);
    font: inherit;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; border-color: transparent; }

.btn {
    display: inline-block;
    padding: 13px 22px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(95deg, var(--accent), #f0609a 60%, var(--accent-2));
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.form .btn { width: 100%; }

.form-status { margin: 0; min-height: 1.5em; font-size: .95rem; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--error); }

.honorary-note {
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 138, 61, .12);
    border: 1px solid rgba(255, 138, 61, .35);
    font-size: .92rem;
}

/* Toivebiisi / viesti -valinta */
.studio-forms { display: grid; gap: 16px; }
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(0, 0, 0, .3);
}
.segmented label { position: relative; margin: 0; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
    display: block;
    padding: 10px 8px;
    border-radius: 10px;
    text-align: center;
    color: var(--muted);
    font-weight: 600;
    font-size: .95rem;
}
.segmented input:checked + span {
    background: linear-gradient(95deg, rgba(255, 138, 61, .9), rgba(168, 85, 247, .9));
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.segmented input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Kuvan liittäminen viestiin */
.file-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.file-button { position: relative; margin: 0; }
.file-button input { position: absolute; inset: 0; opacity: 0; margin: 0; padding: 0; cursor: pointer; }
.file-button span {
    display: inline-block;
    padding: 9px 14px;
    border: 1px dashed rgba(255, 255, 255, .25);
    border-radius: 12px;
    color: var(--text);
    font-size: .95rem;
}
.file-button:hover span,
.file-button:focus-within span { border-color: var(--accent-2); background: rgba(168, 85, 247, .1); }
.file-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-clear {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* Chat */
.chat-log {
    height: min(340px, 50vh);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, .3);
    overscroll-behavior: contain;
}
.chat-empty { margin: 8px 0; text-align: center; }
.chat-msg {
    padding: 5px 8px;
    border-radius: 8px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.chat-msg + .chat-msg { margin-top: 2px; }
.chat-msg.is-own { background: rgba(168, 85, 247, .12); }
.chat-msg.is-staff { background: rgba(255, 138, 61, .14); }
.chat-time { color: var(--muted); font-size: .78rem; margin-right: 6px; font-variant-numeric: tabular-nums; }
.chat-nick-name { font-weight: 700; color: #d8b4fe; margin-right: 6px; }
.chat-nick-name::after { content: ":"; }
.is-staff .chat-nick-name { color: var(--accent); }
.honorary-badge { color: var(--accent); margin-left: 4px; font-weight: 400; }
.dj-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 0 5px;
    border-radius: 5px;
    background: var(--accent);
    color: #1a0f06;
    font-size: .68rem;
    font-weight: 800;
    vertical-align: 2px;
}
/* Hymiöt samankokoisina, ettei rivi hypi */
.chat-text { font-size: 1rem; }
.chat-forwarded { display: block; font-size: .8rem; color: var(--muted); }
.chat-image img {
    display: block;
    max-width: 220px;
    max-height: 220px;
    margin-top: 6px;
    border-radius: 8px;
}
.chat-frozen {
    margin: 10px 0 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(242, 95, 92, .12);
    color: #fca5a5;
    text-align: center;
}

.chat-form { display: grid; gap: 8px; margin-top: 12px; }
.chat-form input { margin-top: 0; }
.chat-nick { max-width: 220px; padding: 9px 12px; font-size: .92rem; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; min-width: 0; }
.chat-emoji-toggle {
    flex: none;
    width: 46px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, .35);
    font-size: 1.2rem;
    cursor: pointer;
}
.chat-send { flex: none; padding: 12px 18px; }
.emoji-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-solid);
}
.emoji-picker button {
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 1.3rem;
    cursor: pointer;
}
.emoji-picker button:hover { background: rgba(255, 255, 255, .08); }
.chat-form .form-status { min-height: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Tietosuojaseloste */
.privacy h1 { margin: 0 0 6px; font-size: 1.6rem; }
.privacy h2 { margin: 22px 0 8px; font-size: 1.1rem; }
.privacy ul { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.logo-link { text-decoration: none; }
.footer a { color: var(--muted); }

.footer {
    padding: 20px 16px calc(28px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
}

/* Nimimerkin lukitus ja merkkilaskuri (25.9.2026) */
input.is-locked { opacity: .7; cursor: not-allowed; }
.char-count { display: block; margin-top: 4px; text-align: right; font-size: .8rem; font-weight: 400; }

/* Yksityisviestit chatissa: lähetetty sininen, saapunut vihreä ja 🔒-merkki rivin alussa (Kimmon pyyntö 25.9.2026) */
.chat-msg.is-private-out { background: rgba(125, 211, 252, .12); border-left: 3px solid #7dd3fc; }
.chat-msg.is-private-in { background: rgba(134, 239, 172, .14); border-left: 3px solid #86efac; }
.chat-private { color: #7dd3fc; font-weight: 400; font-size: .85rem; }
.chat-private-in { color: #86efac; font-weight: 700; font-size: .85rem; margin-right: 6px; }
.pm-enabled .chat-nick-name.is-clickable { cursor: pointer; }
.pm-enabled .chat-nick-name.is-clickable:hover { text-decoration: underline; }
.chat-hint { margin: 0; font-size: .8rem; }

/* ===== Etusivun uudistus 3.10.2026: taustan diaesitys, yläpalkin soitin, Katso-lohkon video ja paneelit ===== */

/* Taustan diaesitys (DJ-paneelin Kuvagalleria). Lähetysten välillä kuvat vaihtuvat, lähetyksen aikana yksi satunnainen kuva. */
.page-bg { position: fixed; inset: 0; z-index: -2; background: var(--bg); }
.page-bg-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 3s ease-in-out;
    will-change: transform, opacity;
}
.page-bg-slide.is-active { opacity: 1; }
/* Hidas liike (3.10.2026, Kimmon toive): zoomaus sisään tai ulos, vähän panorointia ja kallistusta, vuorotellen.
   Liike jatkuu myös häivytyksen ajan (is-leaving), ettei poistuva kuva nykäise alkuasentoonsa.
   Kesto 14 s = kuva näkyy 10 s (site.js) + 3 s häivytys. Mittakaava on aina yli 1.06, jottei reuna paljastu.
   Lähetyksen aikana (ei is-idle) liike pysähtyy paikalleen. */
.page-bg-slide.is-active, .page-bg-slide.is-leaving { animation: kb-in 14s ease-in-out both; }
.page-bg-slide:nth-child(4n+2).is-active, .page-bg-slide:nth-child(4n+2).is-leaving { animation-name: kb-out; }
.page-bg-slide:nth-child(4n+3).is-active, .page-bg-slide:nth-child(4n+3).is-leaving { animation-name: kb-pan; }
.page-bg-slide:nth-child(4n+4).is-active, .page-bg-slide:nth-child(4n+4).is-leaving { animation-name: kb-tilt; }
body:not(.is-idle) .page-bg-slide { animation-play-state: paused; }
@keyframes kb-in   { from { transform: scale(1.06) translate(0, 0); }         to { transform: scale(1.16) translate(-1.5%, -1%); } }
@keyframes kb-out  { from { transform: scale(1.16) translate(1.5%, 1%); }     to { transform: scale(1.06) translate(0, 0); } }
@keyframes kb-pan  { from { transform: scale(1.12) translate(-2.5%, .5%); }   to { transform: scale(1.12) translate(2.5%, -.5%); } }
@keyframes kb-tilt { from { transform: scale(1.14) rotate(-1deg); }           to { transform: scale(1.08) rotate(.8deg); } }
/* Pop-up-soittimen tausta (yksi kuva) */
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.07); } }
/* Tummennus: lähetysten välillä kevyempi, jotta kuvat pääsevät esiin */
.page-bg-shade {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(14, 13, 18, .62) 0%, rgba(14, 13, 18, .82) 55%, rgba(14, 13, 18, .95) 100%),
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(88, 36, 140, .35), transparent 70%);
    transition: background 1s ease;
}
body.is-idle .page-bg-shade {
    background:
        linear-gradient(180deg, rgba(14, 13, 18, .25) 0%, rgba(14, 13, 18, .45) 50%, rgba(14, 13, 18, .85) 100%);
}
body.has-bg .block { background: rgba(20, 18, 27, .68); backdrop-filter: blur(14px) saturate(1.2); }

/* Yläpalkki: aina näkyvissä sivun yläreunassa */
.status-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(14, 13, 18, .72);
    backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}
.status-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* ONLINE (vihreä) / OFFLINE (punainen) -merkki */
.on-air {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 4px 11px 4px 7px;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 4px 14px rgba(239, 68, 68, .3);
}
.on-air-icon { width: 20px; height: 20px; flex: none; }
.on-air .wave { opacity: .35; }
.on-air.is-online {
    background: linear-gradient(135deg, #22c55e, #15803d);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 4px 16px rgba(34, 197, 94, .4);
}
.on-air.is-online .wave { opacity: 1; animation: wave 1.8s ease-in-out infinite; }
.on-air.is-online .wave-2 { animation-delay: .3s; }
@keyframes wave { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* Yläpalkin soitin: play, äänenvoimakkuus ja pop-up */
.status-player { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.status-play {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f0609a 55%, var(--accent-2));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(240, 96, 154, .35);
}
.status-play svg { width: 18px; height: 18px; }
.status-play:disabled { background: #2a2733; color: #6b6575; box-shadow: none; cursor: not-allowed; }
body.is-playing .status-play { animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px rgba(255, 138, 61, .25), 0 4px 14px rgba(240, 96, 154, .35); } }
.status-volume { width: 90px; }
.status-popout {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.status-popout svg { width: 15px; height: 15px; }
.status-popout:hover { color: var(--text); border-color: var(--accent-2); }
.status-note { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.cast-btn.is-active { color: #fff; border-color: var(--accent); background: rgba(255, 138, 61, .25); }

/* Play- ja pause-kuvake vaihtuvat painikkeen tilan mukaan */
[data-play-toggle] .icon-pause { display: none; }
[data-play-toggle][aria-pressed="true"] .icon-play { display: none; }
[data-play-toggle][aria-pressed="true"] .icon-pause { display: block; }
[data-play-toggle].is-connecting { animation: connecting 1s ease-in-out infinite; }
@keyframes connecting { 50% { opacity: .55; } }

/* Äänenvoimakkuuden liukusäädin */
input[type="range"][data-volume] {
    margin: 0;
    padding: 0;
    height: 24px;
    border: 0;
    background: transparent;
    accent-color: var(--accent);
    cursor: pointer;
}
input[type="range"][data-volume]:focus { outline-offset: 3px; }

@media (max-width: 640px) {
    .status-volume, .status-note { display: none; }
}
@media (max-width: 380px) {
    .status-popout { display: none; }
}

/* Katso-lohko: upotettu Kick-video. Video latautuu vasta, kun kuulija painaa sitä. */
.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 14px;
    background: #000;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(83, 252, 24, .14), transparent 65%),
        linear-gradient(135deg, #15131c, #0b0a0f);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
.video-start-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #53fc18;
    color: #0b0a0f;
    box-shadow: 0 10px 30px rgba(83, 252, 24, .3);
    transition: transform .15s ease;
}
.video-start-icon svg { width: 30px; height: 30px; margin-left: 4px; }
.video-start:hover .video-start-icon { transform: scale(1.06); }
.video-start-text { font-weight: 700; }
/* Videon alla oikealla, ei kuvan päällä (3.10.2026) */
.video-close {
    display: block;
    margin: -2px 0 12px auto;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, .45);
    color: var(--text);
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
}

.video-popout {
    position: absolute;
    top: 8px;
    left: 8px; /* vasen yläkulma: oikealla on Sulje video, alhaalla Kickin omat säätimet */
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 99px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
}
.video-popout svg { width: 14px; height: 14px; }
.video-popout:hover { border-color: #53fc18; }

/* Pera-Tv irrotettuna omaan ikkunaan: lohko piiloon, toiveet nousevat chatin rinnalle */
body.tv-detached .listen { display: none; }
.tv-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 5px 10px;
    border: 1px solid rgba(83, 252, 24, .45);
    border-radius: 99px;
    background: rgba(83, 252, 24, .12);
    color: #c6ffb0;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}
.tv-chip svg { width: 16px; height: 16px; }
.tv-chip:hover { background: rgba(83, 252, 24, .22); }
@media (max-width: 640px) { .tv-chip-text { display: none; } }

/* Pera-Tv:n oma ikkuna (/tv/): video täyttää koko ikkunan */
body.tv-page { margin: 0; min-height: 0; height: 100vh; overflow: hidden; background: #000; }
.tv-page iframe { display: block; width: 100vw; height: 100vh; border: 0; }
.tv-empty { margin: 0; padding: 40vh 16px 0; text-align: center; color: var(--muted); }

/* Toiveet ja chat avautuvat omiksi paneeleikseen, kun DJ avaa ne */
@keyframes panel-in { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
.page-main > .block, .page-side > .block { animation: panel-in .5s ease-out both; }
.studio, .chat {
    border-color: rgba(255, 138, 61, .32);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.studio h2::before, .chat h2::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 9px;
    border-radius: 50%;
    background: #22c55e;
    vertical-align: 2px;
    box-shadow: 0 0 10px rgba(34, 197, 94, .8);
}

/* Pop-up-soitin (/soitin/) */
body.popup { min-height: 100vh; display: grid; place-items: center; padding: 14px; }
.popup-player { width: 100%; max-width: 420px; display: grid; gap: 14px; }
.popup-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.popup-top .logo { --logo-size: 2rem; }
.popup-top .logo-sub { font-size: .62rem; letter-spacing: .5em; text-indent: .5em; }
.popup-top .logo-sub::before, .popup-top .logo-sub::after { width: 18px; }
.popup-controls { display: flex; align-items: center; gap: 18px; }
.player-button {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f0609a 55%, var(--accent-2));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(240, 96, 154, .35);
}
.player-button svg { width: 34px; height: 34px; }
.player-button:disabled { background: #2a2733; color: #6b6575; box-shadow: none; cursor: not-allowed; }
.popup-side { flex: 1; min-width: 0; display: grid; gap: 6px; }
.player-hint { margin: 0; }
.player-hint:empty { display: none; }
.player-volume { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.player-volume svg { width: 20px; height: 20px; flex: none; }
/* Taajuuspalkit liikkuvat vain, kun radio soi */
.player-eq { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.player-eq span {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(var(--accent), var(--accent-2));
    opacity: .45;
}
body.is-playing .player-eq span { opacity: 1; animation: bar 1.1s ease-in-out infinite; }
body.is-playing .player-eq span:nth-child(3n) { animation-duration: .8s; animation-delay: -.2s; }
body.is-playing .player-eq span:nth-child(3n+1) { animation-duration: 1.3s; animation-delay: -.5s; }
body.is-playing .player-eq span:nth-child(4n) { animation-duration: .95s; animation-delay: -.7s; }
body.is-playing .player-eq span:nth-child(5n+2) { animation-duration: 1.5s; animation-delay: -.35s; }
@keyframes bar { 0%, 100% { height: 4px; } 50% { height: 100%; } }

/* Soitin puhelimessa ja asennettuna sovelluksena (3.10.2026): korkeassa ikkunassa iso keskitetty soitin.
   Tietokoneen pieni pop-up-ikkuna (300 px korkea) pysyy ennallaan, eikä siinä näytetä taustakuvaa eikä linkkejä. */
.app-links { display: none; }
body.popup .page-bg, body.popup .page-bg-shade { display: none; }
@media (min-height: 480px) {
    body.popup {
        padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
        overscroll-behavior: none;
    }
    body.popup .page-bg, body.popup .page-bg-shade { display: block; }
    body.popup .page-bg-shade {
        background: linear-gradient(180deg, rgba(14, 13, 18, .55) 0%, rgba(14, 13, 18, .7) 50%, rgba(14, 13, 18, .92) 100%);
    }
    body.popup.is-playing .page-bg-slide.is-active { animation: kenburns 30s ease-in-out infinite alternate; }
    .popup-player { max-width: 380px; gap: 30px; text-align: center; }
    .popup-top { flex-direction: column; gap: 22px; }
    .popup-top .logo { --logo-size: clamp(3rem, 17vw, 4.5rem); }
    .popup-top .logo-sub { font-size: .9rem; letter-spacing: .7em; text-indent: .7em; }
    .popup-top .logo-sub::before, .popup-top .logo-sub::after { width: 40px; }
    .popup-controls { flex-direction: column; gap: 14px; }
    .popup-controls .player-button { width: 128px; height: 128px; }
    .popup-controls .player-button svg { width: 56px; height: 56px; }
    .popup-side { justify-items: center; }
    .player-volume { width: min(260px, 100%); }
    .player-volume input { flex: 1; }
    .player-eq { height: 40px; }
    .app-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
}
/* Puhelimen äänenvoimakkuus säädetään puhelimen omista näppäimistä (iPhonessa liukusäädin ei edes toimi) */
@media (min-height: 480px) and (pointer: coarse) { .player-volume { display: none; } }
.app-site-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border: 1px solid rgba(255, 138, 61, .45);
    border-radius: 99px;
    background: rgba(20, 18, 27, .6);
    color: #ffd2b5;
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(10px);
}
.app-site-link:hover { background: rgba(255, 138, 61, .15); }

/* Asenna puhelimeen -painike (app.js näyttää sen vain kosketusnäytöllä) */
.install-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 5px 11px;
    border: 1px solid rgba(168, 85, 247, .5);
    border-radius: 99px;
    background: rgba(168, 85, 247, .16);
    color: #e9d5ff;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}
.install-chip svg { width: 16px; height: 16px; }
.install-chip:hover { background: rgba(168, 85, 247, .28); }
.status-inner .install-chip { margin-left: auto; }
.status-inner .install-chip:not([hidden]) + .status-player { margin-left: 0; }
.app-links .install-chip { padding: 10px 18px; font-size: .95rem; }
/* iPhonen asennusohje: alareunaan, lähelle Safarin Jaa-painiketta */
.install-help {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 60;
    max-width: 420px;
    margin: 0 auto;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-solid);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    text-align: left;
}
.install-help p { margin: 0 0 8px; }
.install-help ol { margin: 0 0 10px; padding-left: 1.3em; }
.install-help li { margin-bottom: 4px; }
.install-help li svg { width: 18px; height: 18px; vertical-align: -3px; color: #60a5fa; }
.install-help .btn { padding: 9px 20px; margin-top: 4px; }

/* Alatunniste (Tietosuoja) aina sivun alareunaan, vaikka sisältöä olisi vähän (Kimmon pyyntö 3.10.2026) */
body:has(> main.page) { display: flex; flex-direction: column; }
body:has(> main.page) > main.page { flex: 1 0 auto; align-content: start; }

/* Mobiilisivu /m/ (3.10.2026): otsikko, soitin, Pera-Tv, chat ja toiveet allekkain */
.m-page { max-width: 560px; padding-top: max(16px, env(safe-area-inset-top)); gap: 14px; }
body.is-idle .m-page { max-width: 560px; }
.m-page .site-header { padding-top: 10px; }
.m-page .broadcast { order: 0; } /* etusivulla ohjelma nousee lähetysten välillä ylimmäksi, täällä soittimen alle */
.mobile-page.is-idle .listen { display: block; } /* Pera-Tv näkyy mobiilisivulla aina, myös lähetysten välillä */
.m-player { display: grid; gap: 14px; padding: 18px; }
.m-player-row { display: flex; align-items: center; gap: 16px; }
.m-player .player-button { width: 84px; height: 84px; }
.m-player .player-button svg { width: 38px; height: 38px; }
.m-player-info { flex: 1; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.m-player-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.m-player .player-eq { height: 28px; }
.m-install { display: flex; justify-content: center; }
.m-install:not(:has(.install-chip:not([hidden]))) { display: none; }
.m-install .install-chip { padding: 9px 16px; font-size: .9rem; }
.m-page .chat-log { height: min(360px, 55vh); }
/* Etusivun Pera-Tv:n "Avaa omaan ikkunaan" ei sovi puhelimeen (ikkunoita ei ole) */
@media (pointer: coarse) { .video-popout { display: none; } }

@media (prefers-reduced-motion: reduce) {
    body.popup.is-playing .page-bg-slide.is-active,
    .on-air.is-online .wave, body.is-playing .status-play, body.is-playing .player-eq span,
    .page-bg-slide.is-active, .page-bg-slide.is-leaving, .page-main > .block, .page-side > .block { animation: none; }
    body.is-playing .player-eq span { height: 60%; }
}
