/* Koko Love — Stage view for synced lyrics (stage.js). The classic lyrics styles in player.css are untouched. */

/* Button in the player bar */
.bar .row.with-stage { grid-template-columns: 26px 36px 26px 1fr auto 32px; }
.stage-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 0; color: var(--ink); cursor: pointer; padding: 0;
}
.stage-btn[hidden] { display: none; }
.stage-btn:hover, .stage-btn:focus-visible, .stage-open .stage-btn { color: var(--accent); }
.stage-btn svg, .st-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* The stage itself — sits over the page and the classic lyrics, under the player bar */
.stage {
  --serif: "EB Garamond", "Times New Roman", Times, serif;
  --sans: "Inter Tight", "Gill Sans", "Helvetica Neue", Arial, sans-serif;
  position: fixed; inset: 0; z-index: 35; overflow: hidden;
  background: var(--bg); color: var(--ink);
  opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.stage.on { opacity: 1; visibility: visible; transition: opacity .5s ease; }
body.stage-open { overflow: hidden; }
body.stage-open .follow { display: none; }

/* The cover, dissolved into a slow-moving haze behind the words */
.st-bg {
  position: absolute; inset: -15%;
  background: center / cover no-repeat;
  filter: blur(70px) saturate(.8);
  opacity: .28;
  animation: st-drift 48s ease-in-out infinite alternate;
  will-change: transform;                                /* blurred once, then just moved by the graphics card */
}
:root[data-mode="light"] .st-bg { opacity: .2; }
.stage::after {                                          /* vignette, so the edges stay calm */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 40%, var(--bg) 100%);
}
@keyframes st-drift { from { transform: scale(1.05) translate(-2%, -1%); } to { transform: scale(1.18) translate(2%, 2%); } }

.st-top {
  position: absolute; z-index: 2; top: max(22px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.st-top .cap { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.st-song { color: var(--ink); max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 10px !important; }
.st-close {
  position: absolute; z-index: 3; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; color: var(--ink); cursor: pointer;
}
.st-close:hover, .st-close:focus-visible { color: var(--accent); }

/* The lines: one column, the sung line held a little above centre, the rest falling away */
.st-view {
  position: absolute; z-index: 1; inset: 70px 0 92px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 78%, transparent);
          mask-image: linear-gradient(transparent, #000 18%, #000 78%, transparent);
}
.st-track {
  max-width: 860px; margin: 0 auto; padding: 0 clamp(28px, 7vw, 72px);
  transition: transform .9s cubic-bezier(.22, .8, .2, 1);
  will-change: transform;
}
.st-line, .st-mark {
  display: block; width: 100%;
  opacity: var(--o, .5); filter: blur(var(--b, 0px));
  transform: scale(.94); transform-origin: 0 50%;
  transition: opacity .7s ease, filter .7s ease, transform .7s cubic-bezier(.22, .8, .2, 1);
}
.st-line {
  position: relative;
  background: none; border: 0; padding: .16em 0; margin: 0; cursor: pointer; text-align: left;
  font-family: var(--serif); font-weight: 400; color: inherit;
  --fs: clamp(30px, 5.6vw, 64px);
  font-size: var(--fs); line-height: 1.12; letter-spacing: -.01em;
  text-wrap: balance;
}
.st-line.verse { margin-top: .7em; }
.st-line.now, .st-mark.now { transform: none; }
.st-line:hover { --o: 1 !important; }
.st-line:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 6px; }

/* Words light up from left to right as they're sung */
.st-line .w {
  --p: 0%;
  background: linear-gradient(90deg, var(--ink) calc(var(--p) - 4%), var(--ghost) calc(var(--p) + 4%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.st-line.past .w { --p: 100%; }

/* Line numbers in the margin, as on the lyrics sheet — orange for the line being sung */
.st-line .n {
  position: absolute; right: calc(100% + clamp(10px, 2vw, 22px)); top: calc(var(--fs) * .16); height: calc(var(--fs) * 1.12);
  display: flex; align-items: center;
  font-family: var(--sans); font-weight: 600; font-size: clamp(9px, 1vw, 11px); letter-spacing: .06em; font-variant-numeric: tabular-nums;
  color: var(--muted); transition: color .5s ease;
}
.st-line.now .n { color: var(--accent); }

/* Intro (before the first line) and breaths (long instrumental passages): three dots fill in orange */
.st-mark { padding: .5em 0; font-size: clamp(30px, 5.6vw, 64px); line-height: 1.12; }
.st-intro .st-title { display: block; font-family: var(--serif); color: var(--ghost); margin-bottom: .35em; }
.st-intro.now .st-title { color: var(--muted); }
.st-dots { display: flex; gap: 10px; height: 8px; align-items: center; }
.st-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  opacity: clamp(.15, calc(var(--p, 0) * 3), 1);
}
.st-dots i:nth-child(2) { opacity: clamp(.15, calc(var(--p, 0) * 3 - 1), 1); }
.st-dots i:nth-child(3) { opacity: clamp(.15, calc(var(--p, 0) * 3 - 2), 1); }
.st-mark.now .st-dots { animation: st-breathe 3.2s ease-in-out infinite; transform-origin: 0 50%; }
@keyframes st-breathe { 50% { transform: scale(1.25); } }

@media (max-width: 520px) {
  .st-view { inset: 64px 0 96px; }
  .st-line .n { right: calc(100% + 8px); }
}
@media (prefers-reduced-motion: reduce) {
  .stage, .stage.on, .st-track, .st-line, .st-mark, .st-line .n { transition: none; }
  .st-bg, .st-mark.now .st-dots { animation: none; }
}

/* Share a lyric: hold a line (or right-click it) — no text-selection callout on phones */
.st-line { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.st-toast {
  position: absolute; z-index: 4; left: 50%; bottom: 112px; transform: translate(-50%, 8px);
  max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--ink); color: var(--bg); padding: 8px 14px;
  font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.st-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .st-toast { transition: none; } }

/* Scrolling back and forth through the lines (drag, wheel, arrow keys) */
.st-view { touch-action: none; cursor: ns-resize; }
.stage.browsing .st-track { transition: transform .25s ease-out; }
.stage.dragging .st-track { transition: none; }
.stage.browsing .st-line:not(.now), .stage.browsing .st-mark:not(.now) { --o: .62 !important; --b: 0px !important; }
.st-follow {
  position: absolute; z-index: 4; left: 50%; bottom: 112px; transform: translate(-50%, 8px);
  background: var(--bg); color: var(--ink); border: 1.5px solid var(--ink); padding: 7px 13px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.st-follow.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.st-follow:hover, .st-follow:focus-visible { color: var(--accent); border-color: var(--accent); }
.st-toast { bottom: 160px; }
@media (prefers-reduced-motion: reduce) { .stage.browsing .st-track, .st-follow { transition: none; } }

/* Speed: lines that have faded out completely aren't drawn (they fade back in before they're needed) */
.st-line.far, .st-mark.far { visibility: hidden; transition: opacity .7s ease, filter .7s ease, transform .7s cubic-bezier(.22, .8, .2, 1), visibility 0s linear .7s; }
.stage.browsing .st-line.far, .stage.browsing .st-mark.far { visibility: visible; transition-delay: 0s; }

/* When the player is tucked away, karaoke mode uses the extra room */
body.bar-min .st-view { bottom: 56px; }
body.bar-min .st-follow, body.bar-min .st-toast { bottom: 70px; }
body.bar-min .st-toast { bottom: 118px; }

/* =====================================================================================================
   CLASSIC KARAOKE LOOK — a 90s / early-2000s karaoke machine screen. Everything above still applies
   (layout, timing, scrolling, sharing); this part only changes how it looks.
   The earlier, minimal look is saved in versions/2026-11-23 karaoke-minimal-stage.
   ===================================================================================================== */
.stage {
  --k-font: "Arial Black", "Arial Rounded MT Bold", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --k-edge: #0b0b40;                                  /* the thick dark outline around every letter */
  /* the karaoke screen is always the deep-blue machine screen, whatever the site's colour mode */
  --bg: #07114f; --ink: #fff; --muted: rgba(255, 255, 255, .72); --ghost: rgba(255, 255, 255, .45);
  background: #07114f; color: #fff;
}

/* The "video": deep blue screen with soft coloured lights drifting slowly, like a karaoke machine's backdrop */
.stage .st-bg {
  inset: 0; filter: none; opacity: 1; will-change: background-position;
  background-image:
    radial-gradient(38vmax 38vmax at 18% 22%, rgba(255, 63, 180, .38), transparent 62%),
    radial-gradient(44vmax 44vmax at 82% 78%, rgba(0, 229, 255, .30), transparent 62%),
    radial-gradient(30vmax 30vmax at 72% 16%, rgba(255, 230, 0, .20), transparent 62%),
    radial-gradient(34vmax 34vmax at 26% 86%, rgba(108, 255, 79, .14), transparent 62%),
    linear-gradient(180deg, #0a1878 0%, #160b5c 55%, #36095a 100%) !important;
  background-size: 160% 160%;
  animation: k-lights 26s ease-in-out infinite alternate;
}
@keyframes k-lights { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
/* Old-TV scanlines and a dark rim, laid over everything like a CRT screen */
.stage::after {
  z-index: 2;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 20, .22) 0 1px, transparent 1px 3px),
    radial-gradient(130% 100% at 50% 50%, transparent 58%, rgba(0, 0, 12, .7) 100%);
}

/* Song title at the top, in classic yellow */
.stage .st-top .cap { font-family: var(--k-font); letter-spacing: .06em; }
.stage .st-song { color: #FFE600; font-size: 13px; text-shadow: 0 0 0 transparent, 2px 2px 0 var(--k-edge), -1px -1px 0 var(--k-edge), 1px -1px 0 var(--k-edge), -1px 1px 0 var(--k-edge); }
.stage .st-song::before { content: "♪ "; }
.stage .st-count { color: rgba(255, 255, 255, .7); }
.stage .st-close { color: #fff; z-index: 4; }

/* The lyrics: big, bold, centred, no blur */
.stage .st-track { max-width: 1040px; text-align: center; }
.stage .st-line, .stage .st-mark { filter: none; transform: scale(.8); transform-origin: 50% 50%; }
.stage .st-line.now, .stage .st-mark.now { transform: none; }
.stage .st-line {
  text-align: center; font-family: var(--k-font); font-weight: 900;
  --fs: clamp(26px, 5.4vw, 60px); line-height: 1.16; letter-spacing: 0; padding: .14em 0;
}
.stage .st-line.verse { margin-top: .55em; }

/* Each line wipes from white to its colour as it's sung — a hard edge, like the real machines */
.stage .st-line .w {
  position: relative; display: inline-block; max-width: 100%;
  background: linear-gradient(90deg, var(--sung, #00E5FF) var(--p), #fff var(--p));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* ...with a thick dark outline and drop shadow drawn underneath (a copy of the same words) */
.stage .st-line .w::before {
  content: attr(data-text); position: absolute; inset: 0; z-index: -1;
  color: var(--k-edge); -webkit-text-stroke: .16em var(--k-edge);
  text-shadow: 0 .09em 0 var(--k-edge), 0 .14em .18em rgba(0, 0, 0, .45);
}
.stage .st-line.past .w { --p: 100%; }

/* Line numbers: real karaoke screens don't show them, so here the counter at the top ("26 / 79") does that job.
   (The tag styles below are kept in case they're wanted back: remove the display:none line.) */
.stage .st-line .n { display: none !important; }
.stage .st-line .n {
  position: static; flex: none; height: auto; transform: none;
  display: inline-block;
  font-family: var(--sans); font-size: clamp(9px, 1vw, 11px); font-weight: 600; letter-spacing: .04em;
  color: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .45); border-radius: 3px; padding: 2px 4px 1px;
}
.stage .st-line.now .n { color: var(--k-edge); background: #FFE600; border-color: #FFE600; }

/* Count-in: four big dots that disappear one by one before the singing starts (and in long instrumentals) */
.stage .st-mark { text-align: center; }
.stage .st-dots { display: inline-flex; gap: clamp(10px, 2vw, 16px); height: auto; }
.stage .st-dots i {
  width: clamp(12px, 2.2vw, 20px); height: clamp(12px, 2.2vw, 20px); border-radius: 50%;
  background: #FF3FB4; box-shadow: 0 0 0 3px var(--k-edge), 0 4px 0 3px rgba(0, 0, 0, .35);
}
.stage .st-dots i:nth-child(1) { opacity: clamp(0, calc((.25 - var(--p, 0)) * 1000), 1); }
.stage .st-dots i:nth-child(2) { opacity: clamp(0, calc((.50 - var(--p, 0)) * 1000), 1); background: #FFE600; }
.stage .st-dots i:nth-child(3) { opacity: clamp(0, calc((.75 - var(--p, 0)) * 1000), 1); background: #00E5FF; }
.stage .st-dots i:nth-child(4) { opacity: clamp(0, calc((1 - var(--p, 0)) * 1000), 1); background: #6CFF4F; }
.stage .st-mark.now .st-dots { animation: none; }

/* Scrolling back: every line readable */
.stage.browsing .st-line:not(.now), .stage.browsing .st-mark:not(.now) { --o: .7 !important; }

@media (prefers-reduced-motion: reduce) { .stage .st-bg { animation: none; } }

/* =====================================================================================================
   KARAOKE AS ITS OWN LITTLE EXPERIENCE — full screen, an old-TV switch-on / switch-off, a badge,
   a one-time hint so people find it, and a player that matches the karaoke screen.
   (The regular player outside karaoke is untouched.)
   ===================================================================================================== */

/* Full-screen toggle, next to the close button */
.st-full {
  position: absolute; z-index: 4; top: max(12px, env(safe-area-inset-top)); right: calc(max(12px, env(safe-area-inset-right)) + 44px);
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; color: #fff; cursor: pointer;
}
.st-full[hidden] { display: none; }
.st-full svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.st-full:hover, .st-full:focus-visible, .stage .st-close:hover, .stage .st-close:focus-visible { color: #FF3FB4; }

/* "★ Karaoke ★" badge above the song title */
.stage .st-badge {
  font-family: var(--k-font); font-size: 10px !important; letter-spacing: .22em; color: #FF3FB4;
  text-shadow: 1px 1px 0 var(--k-edge); animation: k-twinkle 2.4s ease-in-out infinite;
}
@keyframes k-twinkle { 50% { opacity: .55; } }

/* Switching on like an old TV: a bright line opens up into the picture */
.stage.on { animation: k-power-on .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes k-power-on {
  0%   { transform: scale(.9, .004); filter: brightness(4); }
  45%  { transform: scale(1, .02);   filter: brightness(3); }
  75%  { transform: scale(1, 1.015); filter: brightness(1.3); }
  100% { transform: none;            filter: none; }
}
/* ...and switching off: the picture collapses to a line and a dot, then it's gone */
.stage.powering-off { animation: k-power-off .32s ease-in forwards; }
@keyframes k-power-off {
  0%   { transform: none;              filter: none; }
  55%  { transform: scale(1, .006);    filter: brightness(3); }
  100% { transform: scale(0, .006);    filter: brightness(5); opacity: 0; }
}

/* Full screen: use every pixel */
body.is-fullscreen .stage .st-view { inset: 62px 0 96px; }

/* The one-time nudge: the karaoke button shimmers through the karaoke colours and a small tag pops up */
.stage-btn.hint { animation: k-shimmer 1.6s linear infinite; }
@keyframes k-shimmer { 0% { color: #FF3FB4; } 25% { color: #FFE600; } 50% { color: #00E5FF; } 75% { color: #6CFF4F; } 100% { color: #FF3FB4; } }
.stage-hint {
  position: absolute; bottom: calc(100% + 10px); right: max(10px, calc(50% - 232px)); z-index: 2;
  padding: 6px 10px 5px; border-radius: 4px; cursor: pointer; white-space: nowrap;
  background: #07114f; color: #FFE600; border: 1.5px solid #FF3FB4;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif; font-size: 11px; letter-spacing: .06em;
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .3s ease, transform .3s ease;
}
.stage-hint::after { content: ""; position: absolute; top: 100%; right: 14px; border: 6px solid transparent; border-top-color: #FF3FB4; }
.stage-hint.on { opacity: 1; transform: none; pointer-events: auto; }
body.stage-open .stage-hint { display: none; }

/* ---------- The player, only while karaoke is open ---------- */
body.stage-open .bar {
  --ink: #fff; --muted: rgba(255, 255, 255, .75); --ghost: rgba(255, 255, 255, .5);
  --rule: rgba(255, 255, 255, .14); --track: rgba(255, 255, 255, .22);
  background: linear-gradient(180deg, rgba(10, 20, 100, .55), rgba(7, 17, 79, .92));
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border-top: 1px solid rgba(255, 255, 255, .14); color: #fff;
}
body.stage-open.has-frame .bar { left: 0; right: 0; bottom: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
body.stage-open .bar .t { font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #FFE600; text-shadow: 1px 1px 0 #0b0b40; }
body.stage-open .bar .time { color: rgba(255, 255, 255, .78); }
body.stage-open .bar .pp { border-color: #fff; color: #fff; }
body.stage-open .bar .pp:hover, body.stage-open .bar .prev:hover, body.stage-open .bar .next:hover { color: #FF3FB4; border-color: #FF3FB4; }
body.stage-open .stage-btn { color: #FF3FB4; }
body.stage-open .bar-grab::before { background: rgba(255, 255, 255, .45); }
body.stage-open .bar input[type=range]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, #FF3FB4, #FFE600 50%, #00E5FF) 0 / var(--p) 100% no-repeat, rgba(255, 255, 255, .22); }
body.stage-open .bar input[type=range]::-moz-range-track { height: 3px; background: rgba(255, 255, 255, .22); }
body.stage-open .bar input[type=range]::-moz-range-progress { height: 3px; background: linear-gradient(90deg, #FF3FB4, #FFE600 50%, #00E5FF); }
body.stage-open .bar input[type=range]::-webkit-slider-thumb { background: #fff; box-shadow: 0 0 0 3px #FF3FB4; margin-top: -3.5px; }
body.stage-open .bar input[type=range]::-moz-range-thumb { background: #fff; box-shadow: 0 0 0 3px #FF3FB4; }
body.stage-open .bar-tab { background: rgba(7, 17, 79, .78); }
body.stage-open .bar-tab button { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .stage.on, .stage.powering-off, .stage .st-badge, .stage-btn.hint { animation: none; }
  .stage-hint { transition: none; }
}

/* The colour-mode button isn't needed in karaoke (the karaoke screen is always the blue one), so it steps aside */
body.stage-open .theme-toggle { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s ease, visibility 0s linear .3s; }

/* =====================================================================================================
   KARAOKE TOYS (karaoke-fx.js): a row of four effect buttons above the player, and the layers they draw on.
   Everything is drawn BEHIND the lyrics.
   ===================================================================================================== */
.k-fx, .k-disco { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.k-fx { width: 100%; height: 100%; }   /* a canvas does not stretch with inset alone: without this it draws at twice the size on retina screens */

/* Make room for the toy row: lyrics stop a little higher, the "Back to current line" button moves up */
.stage .st-view { bottom: 148px; }
body.bar-min .stage .st-view { bottom: 104px; }
.stage .st-follow { bottom: 160px; }
body.bar-min .stage .st-follow { bottom: 118px; }
.stage .st-toast { bottom: 208px; }

.k-tray {
  position: absolute; z-index: 3; left: 50%; bottom: 104px; transform: translateX(-50%);
  display: flex; gap: 10px; padding: 6px 8px; border-radius: 999px;
  background: rgba(7, 17, 79, .55); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
body.bar-min .k-tray { bottom: 60px; }
.k-toy {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: none; border: 1.5px solid rgba(255, 255, 255, .45); color: #fff;
  font: 900 17px/1 "Arial Black", "Helvetica Neue", Arial, sans-serif;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.k-toy:active { transform: scale(.9); }
.k-toy[aria-pressed="true"] { color: #07114f; border-color: transparent; }
.k-toy[data-fx="sparkles"][aria-pressed="true"] { background: #FFE600; }
.k-toy[data-fx="hearts"][aria-pressed="true"]   { background: #FF3FB4; }
.k-toy[data-fx="disco"][aria-pressed="true"]    { background: #00E5FF; }
.k-toy[data-fx="rainbow"][aria-pressed="true"]  { background: linear-gradient(135deg, #FF3FB4, #FFE600, #6CFF4F, #00E5FF); }
@media (hover: hover) { .k-toy:hover { border-color: #fff; transform: translateY(-2px); } }
.k-toy:focus-visible { outline: 2px solid #FFE600; outline-offset: 2px; }

/* ◎ Disco: soft mirror-ball spots wheeling slowly around the screen */
.k-disco { opacity: 0; transition: opacity .6s ease; overflow: hidden; mix-blend-mode: screen; }
.stage.fx-disco .k-disco { opacity: 1; }
.k-disco i {
  position: absolute; left: 50%; top: 46%; width: 34vmax; height: 34vmax; margin: -17vmax 0 0 -17vmax; border-radius: 50%;
  background: radial-gradient(closest-side, var(--c) 0, transparent 70%); opacity: .5;
  animation: k-disco var(--d) linear infinite; transform-origin: var(--ox) var(--oy);
}
.k-disco i:nth-child(1) { --c: rgba(255, 63, 180, .9);  --d: 14s; --ox: 120%; --oy: 40%; }
.k-disco i:nth-child(2) { --c: rgba(0, 229, 255, .85);  --d: 18s; --ox: -30%; --oy: 70%; animation-direction: reverse; }
.k-disco i:nth-child(3) { --c: rgba(255, 230, 0, .7);   --d: 22s; --ox: 60%;  --oy: -40%; }
.k-disco i:nth-child(4) { --c: rgba(108, 255, 79, .6);  --d: 16s; --ox: 30%;  --oy: 140%; animation-direction: reverse; }
.k-disco i:nth-child(5) { --c: rgba(254, 85, 58, .7);   --d: 20s; --ox: -60%; --oy: -20%; }
.k-disco i:nth-child(6) { --c: rgba(255, 255, 255, .5); --d: 11s; --ox: 90%;  --oy: 110%; width: 14vmax; height: 14vmax; margin: -7vmax 0 0 -7vmax; }
.k-disco i:nth-child(7) { --c: rgba(255, 255, 255, .45); --d: 13s; --ox: -80%; --oy: 50%;  width: 10vmax; height: 10vmax; margin: -5vmax 0 0 -5vmax; animation-direction: reverse; }
@keyframes k-disco { to { transform: rotate(360deg); } }
.stage:not(.fx-disco) .k-disco i { animation-play-state: paused; }

/* ≋ Rainbow: the colour the lyrics light up in drifts through the rainbow (the highlight colour itself is animated,
   so the dark outline underneath stays where it belongs) */
@property --sung { syntax: "<color>"; inherits: true; initial-value: #00E5FF; }
.stage.fx-rainbow .st-line { animation: k-rainbow 4s linear infinite; }
@keyframes k-rainbow { 0%, 100% { --sung: #FF3FB4; } 20% { --sung: #FE553A; } 40% { --sung: #FFE600; } 60% { --sung: #6CFF4F; } 80% { --sung: #00E5FF; } }

@media (max-width: 520px) {
  .k-tray { gap: 8px; padding: 5px 7px; }
  .k-toy { width: 34px; height: 34px; font-size: 15px; }
  .stage .st-view { bottom: 146px; }
}
@media (prefers-reduced-motion: reduce) {
  .k-disco i, .stage.fx-rainbow .st-line { animation: none; }
  .k-toy { transition: none; }
}

/* ---------- Sound effects row (karaoke-sound.js): labelled buttons like a karaoke machine's panel ---------- */
.k-tray { flex-direction: column; align-items: center; gap: 8px; border-radius: 22px; padding: 8px 10px; }
.k-row { display: flex; gap: 10px; justify-content: center; }
.k-sound { gap: 6px; }
.k-sfx {
  min-width: 48px; height: 28px; padding: 0 8px; border-radius: 6px; cursor: pointer;
  background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(255, 255, 255, .4); color: #fff;
  font: 900 10px/1 "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: .08em;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.k-sfx:active { transform: scale(.94); }
.k-sfx[aria-pressed="true"] { background: #FE553A; border-color: #FE553A; color: #fff; box-shadow: 0 0 12px rgba(254, 85, 58, .7); }
.k-sfx:disabled { opacity: .35; cursor: not-allowed; }
@media (hover: hover) { .k-sfx:not(:disabled):hover { border-color: #fff; transform: translateY(-1px); } }
.k-sfx:focus-visible { outline: 2px solid #FFE600; outline-offset: 2px; }

/* the taller tray: lyrics and "Back to current line" sit a bit higher */
.stage .st-view { bottom: 196px; }
body.bar-min .stage .st-view { bottom: 152px; }
.stage .st-follow { bottom: 206px; }
body.bar-min .stage .st-follow { bottom: 164px; }
.stage .st-toast { bottom: 250px; }
@media (max-width: 520px) {
  .k-sound { gap: 5px; }
  .k-sfx { min-width: 44px; padding: 0 6px; font-size: 9px; }
  .stage .st-view { bottom: 190px; }
}
@media (prefers-reduced-motion: reduce) { .k-sfx { transition: none; } }

/* Visual effects run on their own now: their buttons are hidden and the panel holds only the sound effects */
.k-visual { display: none; }
.stage .st-view { bottom: 158px; }
body.bar-min .stage .st-view { bottom: 114px; }
.stage .st-follow { bottom: 168px; }
body.bar-min .stage .st-follow { bottom: 126px; }
.stage .st-toast { bottom: 214px; }
@media (max-width: 520px) { .stage .st-view { bottom: 156px; } }
/* Sound effects are the main toy now: a bit bigger on tablets and computers */
@media (min-width: 521px) {
  .k-sound { gap: 8px; }
  .k-sfx { min-width: 68px; height: 36px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
  .stage .st-view { bottom: 166px; }
  .stage .st-follow { bottom: 176px; }
}

/* ---------- Varispeed (karaoke-sound.js): one thin fader in the little pill, like a turntable's pitch control ---------- */
.k-speed {
  display: inline-flex; align-items: center; gap: 10px; height: 30px; padding: 0 6px; cursor: pointer; color: #fff;
  font: 900 10px/1 "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: .1em;
  --from: 50%; --to: 50%;
}
.k-speed-label { text-transform: uppercase; opacity: .55; }
.k-speed-val { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 4.6em; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.k-speed-val b { font-weight: 900; opacity: .75; transition: color .2s ease, opacity .2s ease; }
.k-speed-val i { font-style: normal; font-size: 8px; opacity: .55; }
.k-speed-val i:empty { display: none; }
.k-speed.active .k-speed-val b { color: #FFE600; opacity: 1; }
.k-speed input[type=range] {
  -webkit-appearance: none; appearance: none; width: 150px; height: 22px; margin: 0; background: transparent; cursor: pointer;
}
/* a hairline track, a tick at the centre (the record as it is), and an orange fill from the centre out to the thumb */
.k-speed input[type=range]::-webkit-slider-runnable-track {
  height: 2px; border-radius: 1px;
  background:
    linear-gradient(rgba(255, 255, 255, .7), rgba(255, 255, 255, .7)) 50% 50% / 1px 8px no-repeat,
    linear-gradient(90deg, transparent var(--from), #FE553A var(--from), #FE553A var(--to), transparent var(--to)),
    rgba(255, 255, 255, .22);
}
.k-speed input[type=range]::-moz-range-track {
  height: 2px; border-radius: 1px;
  background:
    linear-gradient(90deg, transparent var(--from), #FE553A var(--from), #FE553A var(--to), transparent var(--to)),
    rgba(255, 255, 255, .22);
}
.k-speed input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 #FE553A; transition: box-shadow .2s ease, transform .15s ease;
}
.k-speed input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.k-speed.active input[type=range]::-webkit-slider-thumb { box-shadow: 0 0 0 3px #FE553A; }
.k-speed.active input[type=range]::-moz-range-thumb { box-shadow: 0 0 0 3px #FE553A; }
.k-speed input[type=range]:active::-webkit-slider-thumb { transform: scale(1.2); }
.k-speed input:focus-visible { outline: 2px solid #FFE600; outline-offset: 4px; border-radius: 4px; }
.k-tray:has(.k-speed) { padding: 4px 12px; border-radius: 999px; }
@media (max-width: 520px) {
  .k-speed { gap: 8px; }
  .k-speed input[type=range] { width: 120px; }
}
@media (prefers-reduced-motion: reduce) { .k-speed-val b, .k-speed input[type=range]::-webkit-slider-thumb { transition: none; } }
