/* Party-visan TV-näkymä (static/js/party-host.js). Mitoitus vmin/clamp-yksiköillä: luettava sohvalta. */
body.party-host .top-chrome,
body.party-host .guessbar,
body.party-host .revealbar,
body.party-host footer,
body.party-host #labyrinthPlayerTop,
body.party-host .version-indicator,
body.party-host .gesture-strip,
body.party-host #miniKeyboard { display: none !important; }

.pv-top, .pv-bottom {
  flex: none;
  display: none;
  align-items: center;
  gap: clamp(12px, 2vmin, 28px);
  padding: clamp(10px, 1.8vmin, 24px) clamp(16px, 3vmin, 40px);
  background: rgba(8, 11, 24, 0.82);
  color: #eef1fb;
  z-index: 3;
}
.pv-top.on, .pv-bottom.on { display: flex; }
.pv-round { font-size: clamp(20px, 3.4vmin, 44px); font-weight: 800; white-space: nowrap; }
.pv-timerwrap { flex: 1; display: flex; align-items: center; gap: clamp(10px, 1.6vmin, 22px); min-width: 0; }
.pv-timer { flex: 1; height: clamp(12px, 2vmin, 26px); border-radius: 999px; background: #20284a; overflow: hidden; }
.pv-timer > i { display: block; height: 100%; width: 100%; background: #6ea8ff; transform-origin: left; }
.pv-timer.low > i { background: #e5484d; }
.pv-secs { font: 800 clamp(22px, 3.6vmin, 48px) ui-monospace, "Cascadia Mono", Consolas, monospace; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.pv-count { font-size: clamp(16px, 2.6vmin, 32px); font-weight: 700; white-space: nowrap; }
.pv-code { font: 700 clamp(16px, 2.6vmin, 32px) ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.14em; color: #9aa4c7; white-space: nowrap; }

.pv-bottom { flex-wrap: wrap; justify-content: center; }
.pv-chip {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.25em 0.8em; border-radius: 999px;
  background: #20284a;
  font-size: clamp(16px, 2.6vmin, 32px); font-weight: 650;
}
.pv-chip i { width: 0.7em; height: 0.7em; border-radius: 50%; flex: none; }
.pv-chip.done { background: #1f5a3a; }
.pv-chip.off { opacity: 0.45; }
.pv-chip .ok { font-weight: 800; color: #7de3a7; }

#partyOverlay {
  position: fixed; inset: 0; z-index: 5000;
  display: none;
  align-items: center; justify-content: center;
  padding: clamp(16px, 4vmin, 56px);
  background: radial-gradient(1100px 700px at 20% -10%, #1b2552 0%, #0b0f20 65%);
  color: #eef1fb;
  overflow: auto;
}
#partyOverlay.on { display: flex; }
#partyOverlay.dim { background: rgba(8, 11, 24, 0.9); }

.pv-card { width: 100%; max-width: 1500px; display: flex; flex-direction: column; gap: clamp(14px, 2.6vmin, 36px); }
.pv-card h1 { margin: 0; font-size: clamp(30px, 6vmin, 78px); line-height: 1.1; }
.pv-card h2 { margin: 0; font-size: clamp(22px, 3.6vmin, 46px); }
.pv-muted { color: #9aa4c7; }
.pv-lead { font-size: clamp(18px, 2.8vmin, 34px); color: #9aa4c7; margin: 0; }
.pv-err { color: #ff8f93; font-weight: 700; min-height: 1.4em; font-size: clamp(16px, 2.4vmin, 28px); }

.pv-btn {
  font: inherit; font-size: clamp(20px, 3.2vmin, 40px); font-weight: 800;
  padding: 0.6em 1.4em; border: 3px solid transparent; border-radius: 0.5em;
  background: #6ea8ff; color: #0a1226; cursor: pointer;
}
.pv-btn:focus-visible, .pv-step button:focus-visible, .pv-link:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.pv-btn:disabled { opacity: 0.45; cursor: default; }
.pv-btn.secondary { background: transparent; color: #eef1fb; border-color: #3a4575; }
.pv-link { color: #9aa4c7; font-size: clamp(16px, 2.4vmin, 28px); text-decoration: none; padding: 0.3em 0; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(10px, 1.6vmin, 22px) 0; border-bottom: 1px solid #2a3354; font-size: clamp(20px, 3vmin, 38px); }
.pv-step { display: inline-flex; align-items: center; gap: clamp(10px, 1.6vmin, 22px); }
.pv-step button { font: inherit; font-weight: 800; width: 2em; height: 2em; border-radius: 50%; border: 3px solid #3a4575; background: transparent; color: #eef1fb; cursor: pointer; }
.pv-step output { min-width: 3.2em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.pv-check { display: inline-flex; align-items: center; gap: 0.6em; cursor: pointer; }
.pv-check input { width: 1.3em; height: 1.3em; }

/* Odotushuone */
.pv-lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vmin, 60px); align-items: start; }
@media (max-width: 900px) { .pv-lobby { grid-template-columns: 1fr; } }
.pv-codebig { font: 800 clamp(64px, 17vmin, 220px) ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.12em; line-height: 1; }
.pv-joinurl { font: 650 clamp(18px, 3vmin, 38px) ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.pv-qr { width: clamp(150px, 26vmin, 340px); height: clamp(150px, 26vmin, 340px); border-radius: 12px; background: #fff; }
.pv-players { display: flex; flex-wrap: wrap; gap: 12px; min-height: 3em; }
.pv-players .pv-chip { font-size: clamp(20px, 3.2vmin, 40px); }

/* Paljastus */
.pv-reveal-title { font-size: clamp(34px, 7vmin, 92px); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.pv-opts { display: flex; flex-direction: column; gap: clamp(8px, 1.4vmin, 18px); }
.pv-opt { position: relative; display: flex; align-items: center; gap: 0.7em; padding: 0.5em 0.9em; border-radius: 0.6em; background: #171d33; border: 3px solid transparent; font-size: clamp(20px, 3.2vmin, 40px); font-weight: 650; overflow: hidden; }
.pv-opt .bar { position: absolute; inset: 0 auto 0 0; background: rgba(110, 168, 255, 0.22); z-index: 0; }
.pv-opt > * { position: relative; z-index: 1; }
.pv-opt .letter { width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; color: #fff; }
.pv-opt .txt { flex: 1; overflow-wrap: anywhere; }
.pv-opt .n { font-variant-numeric: tabular-nums; font-weight: 800; }
.pv-opt.correct { border-color: #2fbf6b; background: rgba(47, 191, 107, 0.2); }
.pv-opt.correct .bar { background: rgba(47, 191, 107, 0.35); }

/* Tulokset */
.pv-results { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(20px, 4vmin, 56px); align-items: start; }
@media (max-width: 1000px) { .pv-results { grid-template-columns: 1fr; } }
.pv-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(8px, 1.4vmin, 16px); }
.pv-board li { display: grid; grid-template-columns: 1.6em 1fr auto; align-items: center; gap: 0.7em; padding: 0.4em 0.9em; border-radius: 0.6em; background: #171d33; font-size: clamp(20px, 3.4vmin, 44px); font-weight: 650; }
.pv-board li.top1 { background: linear-gradient(90deg, #5b4a0c, #171d33); font-size: clamp(26px, 4.6vmin, 60px); }
.pv-board li.top2, .pv-board li.top3 { font-size: clamp(22px, 3.8vmin, 50px); }
.pv-board .pos { font-weight: 800; color: #9aa4c7; text-align: center; }
.pv-board .who { display: flex; align-items: center; gap: 0.5em; min-width: 0; }
.pv-board .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-board .who i { width: 0.6em; height: 0.6em; border-radius: 50%; flex: none; }
.pv-board .pts { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.pv-board .pts small { display: block; font-size: 0.5em; font-weight: 500; color: #9aa4c7; }
.pv-songs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5em; font-size: clamp(16px, 2.4vmin, 30px); }
.pv-songs li { display: grid; grid-template-columns: 1.6em 1fr auto; gap: 0.5em; align-items: baseline; }
.pv-songs .no { color: #9aa4c7; text-align: right; }
.pv-songs .c { color: #9aa4c7; font-variant-numeric: tabular-nums; }

/* Asetukset: musiikkityylit */
.pv-genres { display: flex; flex-wrap: wrap; gap: clamp(8px, 1.2vmin, 14px); }
.pv-gchip {
  font: inherit; font-size: clamp(16px, 2.6vmin, 32px); font-weight: 650; color: #eef1fb;
  display: inline-flex; align-items: baseline; gap: 0.5em;
  padding: 0.3em 0.9em; border-radius: 999px; background: transparent;
  border: 3px solid #3a4575; cursor: pointer;
}
.pv-gchip small { font-size: 0.7em; font-weight: 500; color: #9aa4c7; }
.pv-gchip[aria-pressed="true"] { background: #6ea8ff; border-color: #6ea8ff; color: #0a1226; }
.pv-gchip[aria-pressed="true"] small { color: #1b2c55; }
.pv-gchip:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

/* Piste-erittely */
.pv-tablewrap { overflow: auto; max-height: 52vh; border: 1px solid #2a3354; border-radius: 12px; }
.pv-table { border-collapse: collapse; width: 100%; font-size: clamp(14px, 2.2vmin, 26px); }
.pv-table th, .pv-table td { padding: 0.45em 0.7em; border-bottom: 1px solid #232b4a; white-space: nowrap; text-align: center; }
.pv-table thead th { position: sticky; top: 0; background: #111733; color: #9aa4c7; font-weight: 700; z-index: 1; }
.pv-table th.who { text-align: left; font-weight: 700; display: table-cell; }
.pv-table th.who i { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; margin-right: 0.5em; }
.pv-table td small { display: block; font-size: 0.65em; color: #7d88ad; font-weight: 400; }
.pv-table td.ok { color: #7de3a7; font-weight: 700; }
.pv-table td.bad { color: #ff9a9d; font-weight: 700; }
.pv-table td.none { color: #5b6590; }
.pv-table td.total { font-weight: 800; font-size: 1.1em; }
.pv-songtitles { margin: 0; padding-left: 2em; columns: 2 380px; font-size: clamp(14px, 2.1vmin, 24px); color: #b5bedf; }

/* Voittajan säihke */
#partyFx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 6000; }
.pv-board li.winner { box-shadow: 0 0 0 2px #ffc93c, 0 0 28px rgba(255, 201, 60, 0.45); }
@media (prefers-reduced-motion: no-preference) {
  .pv-board li.winner {
    background: linear-gradient(100deg, #5b4a0c 0%, #a9830f 25%, #5b4a0c 50%, #a9830f 75%, #5b4a0c 100%);
    background-size: 250% 100%;
    animation: pv-shimmer 3.2s linear infinite, pv-glow 1.8s ease-in-out infinite;
  }
}
@keyframes pv-shimmer { from { background-position: 0 0; } to { background-position: -250% 0; } }
@keyframes pv-glow { 0%, 100% { box-shadow: 0 0 0 2px #ffc93c, 0 0 14px rgba(255, 201, 60, 0.3); } 50% { box-shadow: 0 0 0 2px #ffe27a, 0 0 40px rgba(255, 201, 60, 0.7); } }

.pv-hint { position: fixed; right: clamp(12px, 2vmin, 28px); bottom: clamp(8px, 1.4vmin, 20px); z-index: 4; font-size: clamp(12px, 1.8vmin, 20px); color: #7d88ad; }
body.party-host .pv-bottom.on ~ .pv-hint { bottom: clamp(60px, 9vmin, 110px); }

@media (prefers-reduced-motion: no-preference) {
  .pv-timer > i { transition: transform 0.25s linear; }
}

/* Segment Duel ja Audio Labyrinth */
.pv-center { align-items: center; text-align: center; }
.pv-bigsecs { font: 800 clamp(56px, 14vmin, 200px)/1 ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }
.pv-timer.big { width: 100%; max-width: 1100px; height: clamp(16px, 3vmin, 36px); }
.pv-labwho { display: flex; align-items: center; gap: 0.5em; font-size: clamp(30px, 6vmin, 80px); font-weight: 800; line-height: 1.1; }
.pv-labwho i { width: 0.55em; height: 0.55em; border-radius: 50%; flex: none; }
.pv-labwho.big { font-size: clamp(36px, 8vmin, 110px); }
.pv-resultgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 2vmin, 28px); }
.pv-resultgrid > div { background: #171d33; border: 1px solid #2a3354; border-radius: 16px; padding: clamp(10px, 1.8vmin, 24px); display: flex; flex-direction: column; align-items: center; }
.pv-resultgrid b { font-size: clamp(28px, 6vmin, 80px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.pv-resultgrid small { font-size: clamp(14px, 2.2vmin, 26px); color: #9aa4c7; }

/* Valikko: keskeytys ja koko näyttö (M-näppäin tai kulman painike) */
.pv-menubtn {
  position: fixed; top: clamp(8px, 1.4vmin, 20px); right: clamp(8px, 1.4vmin, 20px); z-index: 6000;
  width: clamp(40px, 6vmin, 72px); height: clamp(40px, 6vmin, 72px);
  border: 0; border-radius: 12px; background: rgba(32, 40, 74, 0.7); color: #eef1fb;
  font-size: clamp(20px, 3.4vmin, 40px); line-height: 1; cursor: pointer; opacity: 0.35; transition: opacity 0.15s;
}
.pv-menubtn:hover, .pv-menubtn:focus-visible { opacity: 1; outline: 3px solid #fff; }
body:not(.party-host) .pv-menubtn { display: none; }
.pv-menu { position: fixed; inset: 0; z-index: 7000; display: flex; align-items: center; justify-content: center; background: rgba(8, 11, 24, 0.82); }
.pv-menucard { background: #171d33; border: 1px solid #2a3354; border-radius: 22px; padding: clamp(20px, 4vmin, 56px); min-width: min(90vw, 560px);
  display: flex; flex-direction: column; gap: clamp(12px, 2vmin, 26px); color: #eef1fb; }
.pv-menucard h2 { margin: 0; font-size: clamp(26px, 4.4vmin, 56px); }

/* Kaikki mahtuu yhdelle näytölle: asetukset kahdessa sarakkeessa, tiiviimmät rivit */
#partyOverlay { padding: clamp(10px, 2.4vmin, 40px); }
.pv-setup { gap: clamp(8px, 1.6vmin, 22px); }
.pv-setup h1 { font-size: clamp(26px, 5vmin, 64px); }
.pv-setup .pv-lead { font-size: clamp(15px, 2.3vmin, 28px); }
.pv-setup .pv-row { padding: clamp(5px, 1vmin, 14px) 0; font-size: clamp(16px, 2.5vmin, 32px); }
.pv-setup .pv-row > span:first-child { min-width: 0; }
.pv-setupgrid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(16px, 3.4vmin, 56px); align-items: start; }
@media (max-width: 900px) { .pv-setupgrid { grid-template-columns: 1fr; } }
.pv-genrebox { display: flex; flex-direction: column; gap: clamp(8px, 1.4vmin, 18px); }
.pv-genrebox h2 { font-size: clamp(18px, 2.8vmin, 36px); color: #c9d2f2; }
.pv-setup .pv-gchip { font-size: clamp(14px, 2.2vmin, 28px); padding: 0.25em 0.8em; }
.pv-setup .pv-btn { font-size: clamp(18px, 2.8vmin, 36px); padding: 0.5em 1.2em; }
.pv-setup .pv-step button { width: 1.8em; height: 1.8em; }

/* Tulokset ja paljastus mahtuvat näytölle myös monella pelaajalla: rivikoko skaalautuu pelaajamäärän mukaan */
.pv-board { max-height: 64vh; overflow: auto; }
.pv-board li { font-size: clamp(13px, min(3.4vmin, calc(52vh / var(--n, 6) / 1.75)), 44px); padding: 0.3em 0.8em; }
.pv-board li.top1 { font-size: clamp(14px, min(4.2vmin, calc(60vh / var(--n, 6) / 1.75)), 56px); }
.pv-board li.top2, .pv-board li.top3 { font-size: clamp(13px, min(3.7vmin, calc(55vh / var(--n, 6) / 1.75)), 48px); }
.pv-songs { max-height: 60vh; overflow: auto; }
.pv-results { align-items: start; }
.pv-card h1 { font-size: clamp(26px, 5.2vmin, 68px); }
.pv-reveal-title { font-size: clamp(28px, 6vmin, 80px); }
.pv-opt { font-size: clamp(16px, 2.8vmin, 36px); padding: 0.4em 0.8em; }
.pv-resultgrid b { font-size: clamp(24px, 5vmin, 64px); }


/* Party-tilassa ei siksak-yhdysviivoja eikä muita avusteita; segmentin merkit ja labyrintin reittiviiva ovat pelin omaa näkymää */
body.party-host .melody-strip svg.connectors,
body.party-host .sp-summary-backdrop,
body.party-host #spTip, body.party-host .sp-tip, body.party-host .sp-result { display: none !important; }

.pv-warn { position: fixed; left: 0; right: 0; top: 0; z-index: 9000; display: none; padding: 12px 18px; text-align: center;
  background: #8a1f24; color: #fff; font-weight: 700; font-size: clamp(14px, 2.2vmin, 26px); }
.pv-warn.on { display: block; }
.pv-audiowarn { position: fixed; left: 50%; bottom: clamp(10px, 2vmin, 28px); transform: translateX(-50%); z-index: 8000; display: none;
  padding: 0.5em 1em; border: 0; border-radius: 999px; background: #f2a20c; color: #1b1203; font: 800 clamp(14px, 2.2vmin, 26px) system-ui, sans-serif; cursor: pointer; }
.pv-audiowarn.on { display: block; }

.pv-songname { font-size: clamp(14px, 2.4vmin, 30px); color: #c9d2f2; max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-top { padding-right: clamp(56px, 8vmin, 96px); }   /* valikkopainike (☰) ei peitä koodia */

/* Labyrintti: pelin oma kappaleen nimi -laatikko näkyy (muu yläkromi on piilossa), ensimmäisen ja viimeisen laatan rengas, väärän laatan välähdys */
body.party-host #labyrinthInfo:not(.hidden) { display: block !important; }
.tile.party-ring { outline: 3px solid rgba(255, 255, 255, 0.95); outline-offset: 2px; box-shadow: 0 0 14px 3px rgba(255, 255, 255, 0.7); z-index: 10; position: relative; }
.tile.party-wrong { outline: 3px solid #ff4d52; outline-offset: 2px; box-shadow: 0 0 18px 4px rgba(255, 77, 82, 0.85); z-index: 11; position: relative; }


/* Mubik-tunnus ruudun yläreunassa: värilaatat ja Mubik-teksti (koti- ja tulosnäkymät) */
#partyOverlay.has-brand { padding-top: calc(clamp(34px, 6.4vmin, 78px) + clamp(12px, 2.4vmin, 32px)); }
.pv-brand { position: absolute; top: clamp(8px, 1.6vmin, 22px); left: 0; right: 0; display: flex; align-items: center; justify-content: center;
  gap: clamp(10px, 2.2vmin, 30px); pointer-events: none; padding: 0 clamp(60px, 9vmin, 110px); }   /* symmetriset reunat: teksti tarkasti keskellä, ☰-painikkeelle jää tilaa */
.pv-brandtiles { display: flex; gap: clamp(4px, 0.9vmin, 12px); flex: 1 1 0; min-width: 0; overflow: hidden; }
.pv-brandtiles.left { justify-content: flex-end; }
.pv-brandtiles.right { justify-content: flex-start; }
.pv-bt { flex: none; width: clamp(22px, 4.6vmin, 56px); aspect-ratio: 1 / 1; border-radius: 24%; border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.28), inset 0 -4px 8px rgba(0, 0, 0, 0.3), 0 3px 10px rgba(0, 0, 0, 0.45); }
.pv-wordmark { flex: none; font: 900 clamp(26px, 5.6vmin, 70px)/1 system-ui, "Segoe UI", Roboto, sans-serif; letter-spacing: 0.04em;
  background: linear-gradient(100deg, #ffffff 0%, #cfe0ff 45%, #ffffff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 8px rgba(110, 168, 255, 0.45)); }

/* Piste-erittely: tiivis taulukko vasemmalla, numeroidut kappaleet allekkain oikeassa laidassa */
.pv-detailsgrid { display: flex; align-items: flex-start; justify-content: space-between; gap: clamp(14px, 3vmin, 44px); min-height: 0; }
.pv-detailsgrid .pv-tablewrap { flex: 0 1 auto; width: auto; max-width: 68%; max-height: 56vh; }
.pv-detailsgrid .pv-table { width: auto; font-size: clamp(12px, 1.9vmin, 22px); }
.pv-detailsgrid .pv-table th, .pv-detailsgrid .pv-table td { padding: 0.3em 0.55em; }
.pv-songside { flex: 1 1 0; min-width: min(200px, 30%); max-width: 36%; display: flex; flex-direction: column; gap: 0.5em; margin-left: auto; }
.pv-songside h2 { font-size: clamp(16px, 2.6vmin, 32px); color: #c9d2f2; }
.pv-songlist { margin: 0; padding: 0 0 0 1.9em; max-height: 56vh; overflow: auto; font-size: clamp(12px, 1.9vmin, 22px); color: #b5bedf; line-height: 1.35; }
.pv-songlist li { margin: 0 0 0.35em; overflow-wrap: anywhere; }
@media (max-width: 800px) { .pv-detailsgrid { flex-direction: column; } .pv-detailsgrid .pv-tablewrap, .pv-songside { max-width: 100%; } }


/* Labyrintti: väärien äänien laskuri (ratkaisee tuloksen) isona ja punaisena, ajastimen tilat selkeinä */
.pv-wrongbig { display: flex; align-items: baseline; gap: 0.35em; padding: 0.12em 0.7em; border-radius: 999px; white-space: nowrap;
  background: #1f2a22; border: 3px solid #2fbf6b; color: #7de3a7; font-weight: 800; font-size: clamp(16px, 2.6vmin, 32px); }
.pv-wrongbig b { font-size: clamp(28px, 5.4vmin, 68px); line-height: 1; font-variant-numeric: tabular-nums; }
.pv-wrongbig.has { background: #4a1418; border-color: #ff4d52; color: #ffd0d2; box-shadow: 0 0 18px rgba(255, 77, 82, 0.55); }
.pv-wrongbig.has b { color: #fff; }
.pv-wrongbig.pulse { animation: pv-wrongpulse 0.45s ease-out; }
@keyframes pv-wrongpulse { 0% { transform: scale(1); } 35% { transform: scale(1.35); box-shadow: 0 0 40px rgba(255, 77, 82, 0.95); } 100% { transform: scale(1); } }
body.party-host.pv-wrongflash .melody-strip { box-shadow: 0 0 0 6px rgba(255, 77, 82, 0.9), 0 0 46px rgba(255, 77, 82, 0.6); border-radius: 18px; }
@media (prefers-reduced-motion: reduce) { .pv-wrongbig.pulse { animation: none; } }
.pv-timerlabel { font-size: clamp(13px, 2vmin, 24px); color: #9aa4c7; white-space: nowrap; }
.pv-timer.wait > i { background: #f2a20c; }
.pv-donetime { font-size: clamp(18px, 3vmin, 38px); font-weight: 800; color: #c9d2f2; white-space: nowrap; }
.pv-donetime.ok { color: #7de3a7; }
.pv-resultgrid > div.bad { border-color: #ff4d52; background: #3a1216; }
.pv-resultgrid > div.bad b { color: #ff8f93; }
.pv-resultgrid > div.good { border-color: #2fbf6b; }
.pv-resultgrid > div.good b { color: #7de3a7; }
.pv-board .pts small.bad { color: #ff8f93; font-weight: 700; }
.pv-board .pts small.good { color: #7de3a7; font-weight: 700; }
.pv-songs .c.bad { color: #ff8f93; }
.pv-table td.lab .wr { display: block; font-size: 1.05em; }
.pv-table .wr.bad { color: #ff8f93; }
.pv-table .wr.good { color: #7de3a7; }

/* Isännän näyttösäädöt valikossa ja lyhyt ilmoitus näppäinkomennosta */
.pv-aidrow { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(8px, 1.6vmin, 20px); }
.pv-btn.small { font-size: clamp(15px, 2.3vmin, 28px); padding: 0.45em 0.9em; }
.pv-step.small { font-size: clamp(15px, 2.3vmin, 28px); gap: 0.5em; }
.pv-step.small button { width: 1.9em; height: 1.9em; }
.pv-step.small output { min-width: 2.4em; }
.pv-toast { position: fixed; left: 50%; top: clamp(70px, 12vmin, 140px); transform: translateX(-50%); z-index: 8500; display: none;
  padding: 0.5em 1.1em; border-radius: 999px; background: rgba(23, 29, 51, 0.96); border: 2px solid #6ea8ff; color: #eef1fb;
  font: 700 clamp(16px, 2.6vmin, 32px) system-ui, sans-serif; white-space: nowrap; }
.pv-toast.on { display: block; }


/* Labyrintin erittely kappaleittain: kapeat solut (✗ väärät äänet isolla, pisteet ja aika pienellä allekkain) */
.pv-table td.lab { line-height: 1.2; min-width: 3.6em; }
.pv-table td.lab .wr { display: block; font-size: 1.25em; font-weight: 800; }
.pv-table td.lab small { display: block; }
.pv-table td.lab.none .wr { color: #5b6590; }
.pv-detailsgrid .pv-table { font-size: clamp(11px, min(1.9vmin, calc(62vw / (var(--cols, 8) + 3) / 4.6)), 22px); }
.pv-songs li.lab { grid-template-columns: 1.6em 1fr; }
.pv-songs .turns { display: flex; flex-wrap: wrap; gap: 0.2em 0.9em; font-size: 0.82em; margin-top: 0.15em; }
.pv-songs .turn.bad { color: #ff8f93; font-weight: 700; }
.pv-songs .turn.good { color: #7de3a7; font-weight: 700; }
.pv-songs .turn.none { color: #7d88ad; }

/* Yläpalkin A/W-painikkeet: näyttösäädöt pelin aikana ilman valikkoa (lauta pysyy näkyvissä, toimii kaukosäätimen osoittimella) */
.pv-hudaids { display: flex; gap: clamp(6px, 1vmin, 14px); flex: none; }
.pv-hudbtn {
  display: inline-flex; align-items: center; gap: 0.45em; white-space: nowrap; cursor: pointer;
  font: 700 clamp(13px, 1.9vmin, 24px) system-ui, sans-serif; color: #c9d2f2;
  background: rgba(32, 40, 74, 0.8); border: 2px solid #2f3a66; border-radius: 10px; padding: 0.3em 0.7em;
}
.pv-hudbtn b { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; border-radius: 6px; background: #2a3354; color: #fff; font-size: 0.9em; }
.pv-hudbtn[aria-pressed="true"] { color: #fff; border-color: #6ea8ff; background: rgba(46, 74, 140, 0.85); }
.pv-hudbtn[aria-pressed="true"] b { background: #6ea8ff; color: #0e1220; }
.pv-hudbtn:hover, .pv-hudbtn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Piste-erittely koko leveydellä: taulukko ulottuu kappalelistaan asti ja fontti kasvaa niin isoksi kuin mahtuu
   (party-host.js fitDetails asettaa fonttikoon). Kappalelista pysyy oikeassa laidassa omalla leveydellään. */
.pv-card.pv-detailscard { max-width: none; }
.pv-detailscard .pv-detailsgrid .pv-tablewrap { flex: 1 1 0; min-width: 0; max-width: none; }
.pv-detailscard .pv-detailsgrid .pv-table { width: 100%; }
.pv-detailscard .pv-songside { flex: 0 0 auto; width: clamp(200px, 22vw, 440px); min-width: 0; max-width: 30%; margin-left: 0; }
@media (max-width: 800px) { .pv-detailscard .pv-songside { width: auto; max-width: 100%; } }
