:root {
  color-scheme: dark;
  --ink: #f8f5ff;
  --muted: #bcb3cb;
  --base: #100e16;
  --panel: #1a1723;
  --line: #393245;
  --accent: #d0b7ff;
  --accent-ink: #211331;
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(ellipse at 17% 0%, #281b36 0, transparent 48rem), var(--base);
}
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 44px;
  padding: .52rem .78rem;
  border: 1px solid var(--line);
  border-radius: .72rem;
  background: #292335;
  color: var(--ink);
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: #7e669a; background: #372b49; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.shell { width: min(100% - 3rem, 1340px); margin-inline: auto; }
.masthead { border-bottom: 1px solid #372e41; background: #15111ddd; }
.masthead .shell { min-height: 75px; display: flex; align-items: center; gap: .8rem; }
.mark {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  width: 40px; height: 40px; flex: none; border-radius: 13px;
  color: #2c174a; background: linear-gradient(145deg, #ead5ff, #a77cf1);
}
.mark i { width: 3px; height: 11px; background: currentColor; border-radius: 1rem; }
.mark i:nth-child(2), .mark i:nth-child(4) { height: 15px; }
.mark i:nth-child(3) { height: 23px; }
.brand { font-size: clamp(1.15rem, 2.5vw, 1.48rem); font-weight: 800; line-height: 1.25; }
.header-actions { margin-left:auto; display:flex; align-items:center; gap:.45rem; }
#room-open, #queue-play { background:var(--accent); color:var(--accent-ink); font-weight:750; white-space:nowrap; }
#room-open:hover, #queue-play:hover { background:#e8d6ff; }
.queue-actions { display:flex; flex-wrap:wrap; gap:.38rem; margin:.2rem 0 .75rem; }
.admin-link {
  margin-left: auto; display: inline-flex; align-items: center; min-height: 44px;
  padding: .55rem .85rem; border: 1px solid var(--line); border-radius: .72rem;
  color: var(--ink); text-decoration: none; font-size: .9rem; white-space: nowrap;
}
.admin-link:hover { border-color: #7e669a; background: #2b2338; }
main { padding: 1.55rem 0 2.5rem; }
.columns { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(345px, 1fr); gap: 1.15rem; align-items: start; }
.card { overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 1.15rem; box-shadow: 0 12px 32px #07050c55; }
.stage { padding: 1rem; }
.now-playing { display: flex; align-items: center; gap: .78rem; padding: .14rem .2rem .95rem; }
.now-icon {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  border: 1px solid #624e7b; border-radius: .85rem;
  color: #e5d1ff; background: #30233f; font-size: 1.24rem;
}
.now-label, .artist, .muted, .feedback { color: var(--muted); }
.now-label { display: block; font-size: .78rem; line-height: 1.2; }
.now-playing h2 { margin-top: .2rem; font-size: clamp(1.18rem, 2.7vw, 1.52rem); line-height: 1.35; overflow-wrap: anywhere; }
.stream-format { margin-left: auto; border: 1px solid var(--line); border-radius: .5rem; padding: .22rem .46rem; color: var(--muted); font-size: .75rem; }
#current-artist { margin-top: .12rem; font-size: .88rem; }
.screen {
  position: relative; display: grid; isolation: isolate; place-items: center;
  aspect-ratio: 16 / 9; overflow: hidden; background: #0a080d;
  border: 1px solid #332843; border-radius: .95rem;
}
.screen.youtube-active { min-height: 200px; }
.youtube-mount, .youtube-mount iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.source-buttons { display: flex; gap: .42rem; margin-bottom: .65rem; }
.source-buttons button[aria-pressed="true"] { background: #d0b7ff; color: #211331; font-weight: 750; }
.room-panel { margin: .7rem 0; padding: .8rem; border: 1px solid var(--line); border-radius: .7rem; }
.room-panel label, .room-panel small { display: block; margin: .4rem 0; }
.room-panel input { width: 100%; padding: .55rem; margin-bottom: .45rem; color: var(--ink); background: var(--base); border: 1px solid var(--line); border-radius: .5rem; }
.room-panel canvas { display: block; max-width: 100%; height: auto; margin: .55rem auto; }
.room-panel a { display: block; overflow-wrap: anywhere; color: var(--accent); margin-bottom: .5rem; }
.queue-source { display: block; margin-top: .2rem; color: var(--muted); font-size: .76rem; }
video { width: 100%; height: 100%; position: absolute; inset: 0; display: block; }
.start {
  position: absolute; z-index: 1; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 44%, #65448a 0, #3c275c 32%, transparent 68%),
    linear-gradient(140deg, #291d3e, #141021 65%, #251c37);
}
.start::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background:
    repeating-radial-gradient(ellipse at 50% 46%, transparent 0 2.55rem, #d9bdff22 2.58rem 2.63rem, transparent 2.68rem 3.55rem),
    linear-gradient(132deg, transparent 23%, #b38bef23 42%, transparent 58%);
}
.start button {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: .65rem;
  min-height: 44px; padding: .4rem .8rem; border: 0; background: transparent;
  color: #fbf4ff; font-size: 1.02rem; font-weight: 750;
}
.start button:hover:not(:disabled) { background: transparent; }
.play-icon {
  display: grid; place-items: center; width: clamp(58px, 9vw, 92px); aspect-ratio: 1;
  border-radius: 50%; border: 1px solid #ead9ff; background: linear-gradient(145deg, #f0ddff, #bd95fb);
  box-shadow: 0 0 0 .65rem #e1bdff26, 0 0 0 1.3rem #dab7ff12, 0 10px 30px #10072070;
}
.play-icon::after { content: ""; border-block: .58rem solid transparent; border-left: .9rem solid #2b1944; margin-left: .18rem; }
.start button:hover .play-icon { background: #f3e5ff; }
.player-bar { display: flex; align-items: center; gap: .75rem; padding: .92rem .08rem 0; flex-wrap: wrap; }
.player-bar strong { color: var(--muted); font-size: .85rem; }
.audio-buttons { display: flex; flex-wrap: wrap; gap: .38rem; }
.audio-buttons button { border-radius: 999px; padding-inline: .86rem; font-size: .85rem; }
.audio-buttons button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 750; }
.audio-buttons button[aria-pressed="true"]:hover { background: #e8d6ff; }
.feedback { margin: .6rem .2rem 0; font-size: .88rem; }
.feedback:empty { display: none; }
.side { display: grid; gap: 1.05rem; }
.panel { padding: 1rem; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: .88rem; }
.panel-top h2 { font-size: 1.16rem; }
.panel-top .muted { white-space: nowrap; font-size: .84rem; }
.search { display: flex; align-items: center; gap: .48rem; }
.search-field { flex: 1; min-width: 0; position: relative; }
.search-field::before {
  content: ""; position: absolute; pointer-events: none; left: .85rem; top: 14px;
  width: 10px; height: 10px; border: 2px solid #b7a5ce; border-radius: 50%;
}
.search-field::after {
  content: ""; position: absolute; pointer-events: none; left: 24px; top: 25px;
  width: 7px; height: 2px; background: #b7a5ce; transform: rotate(45deg);
}
.search input {
  color: var(--ink); background: #100e18; border: 1px solid var(--line); border-radius: .7rem;
}
.search input { width: 100%; min-height: 46px; padding: .58rem .65rem .58rem 2.3rem; font-size: .9rem; }
.search input::placeholder { color: #b6acc4; }
.search button { min-height: 46px; background: #d0b7ff; color: var(--accent-ink); border-color: #d0b7ff; font-weight: 750; }
.search button:hover:not(:disabled) { background: #ebdbff; }
.song-list, .queue { list-style: none; margin: .7rem 0 0; padding: 0; }
.song-row, .queue-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.song-row { margin-top: .37rem; padding: .42rem .45rem .42rem .65rem; border: 1px solid #373044; border-radius: .72rem; background: #211c2b; }
.song-row[aria-current="true"] { border-color: #9876c4; background: #332544; }
.song-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .94rem; font-weight: 750; line-height: 1.35; }
.artist { display: block; margin-top: .23rem; font-size: .78rem; font-weight: 400; }
.row-actions { display: flex; gap: .28rem; flex-shrink: 0; flex-wrap:wrap; justify-content:flex-end; max-width:53%; }
.row-actions button { min-height: 44px; font-size: .82rem; padding-inline: .52rem; background: #30263e; }
.row-actions button:first-child { color: #e8d8ff; }
.queue-row { padding: .4rem 0; border-top: 1px solid var(--line); }
.queue-row > span { min-width: 0; overflow-wrap: anywhere; }
.queue-row button, #next-song { font-size: .84rem; }
.empty { padding: .85rem .7rem; color: var(--muted); background: #13101a; border: 1px dashed #443950; border-radius: .7rem; text-align: center; font-size: .9rem; }
#no-results { margin-top: .65rem; }
.pagination { display: flex; align-items: center; gap: .45rem; margin-top: .65rem; flex-wrap: wrap; font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 875px) {
  .shell { width: min(100% - 1.4rem, 660px); }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .masthead .shell { min-height: 65px; }
  main { padding-top: .9rem; }
  .stage, .panel { padding: .75rem; }
}
@media (max-width: 420px) {
  .masthead .shell { flex-wrap:wrap; padding:.6rem 0; }
  .header-actions { width:100%; }
  .song-row { padding-left: .44rem; }
  .row-actions button { padding-inline: .38rem; }
  .player-bar { gap: .4rem; }
  .audio-buttons button { padding-inline: .58rem; }
}
.playlist-panel { padding:.9rem; border:1px solid #423551; border-radius:.85rem; background:#1a1723; margin:0 0 .85rem; }
.playlist-panel summary { cursor:pointer; font-weight:750; }
.playlist-body { margin-top:.75rem; }
.playlist-body label, .playlist-body select { display:block; width:100%; }
.playlist-body select, .playlist-form input { padding:.45rem; border:1px solid #4e4160; border-radius:.6rem; background:#110e17; color:#f8f5ff; min-height:44px; }
.playlist-form, .playlist-actions { display:flex; flex-wrap:wrap; gap:.35rem; margin:.55rem 0; }
.playlist-form input { width:auto; min-width:0; flex:1 1 9rem; }
.playlist-play { background:#d0b7ff; color:#211331; font-weight:750; }
.playlist-status:empty { display:none; }
.playlist-tracks { margin:.45rem 0 0; padding:0; list-style:none; }
.playlist-tracks li { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.4rem 0; border-top:1px solid #423551; }
.playlist-tracks span { min-width:0; overflow-wrap:anywhere; }
.playlist-song-actions { display:flex; gap:.35rem; flex-wrap:wrap; justify-content:flex-end; }
.tv-mode { font-size: 1.15rem; }
.tv-mode .shell { max-width: 1680px; }
.tv-mode button, .tv-mode input, .tv-mode summary, .tv-mode .admin-link { min-height: 46px; }
.tv-mode :focus { outline: 3px solid #fff; outline-offset: 3px; }
.song-summary {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  gap: .65rem;
}
.song-thumbnail {
  display: block;
  flex: none;
  width: clamp(56px, 18vw, 92px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: .5rem;
  background: #211c2b;
}
.queue-toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 1rem;
  bottom: max(1rem, calc(env(safe-area-inset-bottom) + .65rem));
  transform: translateX(-50%);
  width: min(27rem, calc(100% - 1.5rem));
  padding: .85rem 1rem .85rem 3.55rem;
  border: 1px solid #64d6ad;
  border-radius: .95rem;
  background: #d0fae8;
  color: #103c31;
  box-shadow: 0 .5rem 1.5rem #08090cb0;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.queue-toast:empty { display: none; }
.queue-toast::before {
  content: '✓';
  position: absolute;
  top: .85rem;
  left: .85rem;
  display: grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 50%;
  background: #08745a;
  color: #fff;
  font-weight: 800;
}
.queue-toast strong, .queue-toast span { display: block; }
.queue-toast span { margin-top: .2rem; font-size: .93rem; line-height: 1.4; }

.web-stage-controls { display: none; }
.web-stage-full { overflow: hidden; }
.web-stage-full .masthead, .web-stage-full .side { visibility: hidden; }
.web-stage-full .stage {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
}
.web-stage-full .stage > :not(.screen):not(.web-stage-controls):not(.feedback) { display: none; }
.web-stage-full .stage .screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #000;
}
.web-stage-full .stage video { object-fit: contain; }
.web-stage-full .web-stage-controls {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 5;
  display: flex;
  gap: .35rem;
}
.web-stage-controls button { background: #191521e8; }
.web-stage-full .stage .feedback:not(:empty) {
  position: absolute;
  z-index: 6;
  left: 1rem;
  right: 1rem;
  bottom: 3.5rem;
  max-width: 32rem;
  margin: 0 auto;
  padding: .6rem .8rem;
  border-radius: .6rem;
  background: #191521ec;
  text-align: center;
}
.web-stage-full #audio-message:not(:empty) { bottom: 6.5rem; }
.web-stage-full #room-panel:not([hidden]) {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 2rem), 30rem);
  max-height: calc(100% - 2rem);
  margin: 0;
  overflow: auto;
  background: #191521;
  box-shadow: 0 0 0 100vmax #0009;
}
.web-stage-full #room-panel canvas { width: auto; max-width: 100%; max-height: 50vh; }

/* Karaoke TV layout for WebViews without CSS Grid. */
@supports not (display: grid) {
  .tv-mode .shell { width: 90%; max-width: 1680px; margin: 0 auto; }
  .tv-mode .masthead .shell, .tv-mode .header-actions { flex-wrap: wrap; }
  .tv-mode .header-actions > * { margin: 4px; }
  .tv-mode .columns { display: flex; align-items: flex-start; }
  .tv-mode .columns > .stage { flex: 0 0 62%; min-width: 0; }
  .tv-mode .side { display: flex; flex: 1 1 0%; flex-direction: column; min-width: 0; margin-left: 1rem; }
  .tv-mode .side > section:nth-of-type(2) { order: -1; }
  .tv-mode .side .queue { max-height: 28vh; overflow-y: auto; }
  .tv-mode .brand { font-size: 1.25rem; }
  .tv-mode .masthead .shell { min-height: 64px; }
  .tv-mode .search-field { min-width: 0; }
  .tv-mode .search-field input { width: 100%; }
  @media (max-width: 700px) {
    .tv-mode .columns { display: block; }
    .tv-mode .side { margin: 1rem 0 0; }
  }
  .tv-mode .side > * { margin-bottom: 1rem; }
  .tv-mode .screen { display: block; height: 0; padding-top: 56.25%; }
  .tv-mode .screen video, .tv-mode .screen .youtube-mount,
  .tv-mode .screen .youtube-mount iframe, .tv-mode .screen .start,
  .tv-mode .screen .start::before { top: 0; right: 0; bottom: 0; left: 0; }
  .tv-mode .screen .start { display: flex; align-items: center; justify-content: center; }
  .tv-mode .play-icon { display: flex; width: 64px; height: 64px; align-items: center; justify-content: center; }
  .tv-mode .play-icon::after { border-top: .58rem solid transparent; border-bottom: .58rem solid transparent; }
  .tv-mode.web-stage-full .stage, .tv-mode.karaoke-box-full .stage { top: 0; right: 0; bottom: 0; left: 0; }
  .tv-mode.web-stage-full .stage .screen, .tv-mode.karaoke-box-full .stage .screen {
    width: 100%; height: 100%; padding-top: 0; min-height: 0;
  }
  .tv-mode.web-stage-full .web-stage-controls, .tv-mode.karaoke-box-full .karaoke-box-controls {
    top: 5%; right: 5%;
  }
  .tv-mode.web-stage-full #room-panel:not([hidden]), .tv-mode.karaoke-box-full #room-panel:not([hidden]) {
    width: 85%; max-width: 30rem;
  }
}

.tv-mode .tv-audio-switch { visibility: hidden; }
.tv-mode .tv-audio-switch-frame {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a080d;
  pointer-events: none;
  z-index: 2;
}
.tv-mode .masthead .shell { padding-top: .45rem; padding-bottom: .45rem; }
.tv-mode.karaoke-box-full .stage .screen,
.tv-mode.web-stage-full .stage .screen {
  position: absolute;
  top: 2.5%;
  right: 3%;
  bottom: 2.5%;
  left: 3%;
  width: auto;
  height: auto;
  padding-top: 0;
}
.tv-mode .youtube-mount, .tv-mode .youtube-mount iframe { background: #0a080d; }
.tv-mode.tv-full-controls-hidden .karaoke-box-controls,
.tv-mode.tv-full-controls-hidden .web-stage-controls { opacity: 0; pointer-events: none; }
.tv-mode .tv-menu-wake { display: none; }
.tv-mode.tv-full-controls-hidden .tv-menu-wake {
  position: fixed;
  display: block;
  top: 0;
  right: 0;
  width: 3%;
  height: 3rem;
  z-index: 91;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.tv-mode.legacy-tv { padding-top: 5vh; padding-bottom: 4vh; }
.tv-mode.legacy-tv .shell { width: 88%; }
.tv-mode.legacy-tv .masthead { background: #15111d; }
.tv-mode.legacy-tv .card, .tv-mode.legacy-tv .queue-toast { box-shadow: none; }
.tv-mode.legacy-tv .song-thumbnail { width: 72px; height: 40px; margin-right: .6rem; }
.tv-mode.legacy-tv .screen.youtube-active { border-radius: 0; }

.tv-mode.legacy-tv .tv-search-dock {
  display: flex;
  align-items: center;
  padding-bottom: 8px;
}
.tv-mode.legacy-tv .tv-search-dock .source-buttons { margin: 0 12px 0 0; }
.tv-mode.legacy-tv .tv-search-dock .source-buttons button + button { margin-left: 4px; }
.tv-mode.legacy-tv .tv-search-dock .search { flex: 1; min-width: 0; }
.tv-mode.legacy-tv .tv-search-dock .search button { margin-left: 6px; }
.tv-mode.legacy-tv.karaoke-box-full .tv-search-dock,
.tv-mode.legacy-tv.web-stage-full .tv-search-dock { display: none; }

@media (max-width: 520px) {
  .tv-mode.legacy-tv .tv-search-dock { flex-wrap: wrap; }
  .tv-mode.legacy-tv .tv-search-dock .search { flex: 0 0 100%; margin-top: 4px; }
}

.tv-mode.legacy-tv.karaoke-box-full .masthead, .tv-mode.legacy-tv.karaoke-box-full .side,
.tv-mode.legacy-tv.web-stage-full .masthead, .tv-mode.legacy-tv.web-stage-full .side { display: none; }
.tv-mode.tv-full-controls-hidden .karaoke-box-controls :focus,
.tv-mode.tv-full-controls-hidden .web-stage-controls :focus { outline: none; }

.tv-mode.legacy-tv.karaoke-box-full .stage .screen,
.tv-mode.legacy-tv.web-stage-full .stage .screen { bottom: calc(3vh + 40px); }
.tv-mode.legacy-tv .tv-seek {
  display: flex;
  align-items: center;
  padding: 0 .65rem;
  margin-top: .3rem;
  color: #e5d9f3;
  font-size: .84rem;
}
.tv-mode.legacy-tv .tv-seek input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 32px;
  margin: 0 .8rem 0 0;
  cursor: pointer;
}
.tv-mode.legacy-tv .tv-seek span { flex: none; white-space: nowrap; }
.tv-mode.legacy-tv.karaoke-box-full .stage > .tv-seek:not([hidden]),
.tv-mode.legacy-tv.web-stage-full .stage > .tv-seek:not([hidden]) {
  position: absolute;
  z-index: 5;
  display: flex !important;
  right: 5%;
  bottom: 3vh;
  left: 5%;
  margin: 0;
  background: #191521;
  border-radius: .5rem;
}

.tv-mode.legacy-tv.tv-full-controls-hidden.karaoke-box-full .stage .screen,
.tv-mode.legacy-tv.tv-full-controls-hidden.web-stage-full .stage .screen {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 0;
  border-radius: 0;
}

/* The YouTube frame keeps the same bounds as the controls appear and hide. */
.tv-mode.legacy-tv.legacy-tv-youtube.karaoke-box-full .stage .screen,
.tv-mode.legacy-tv.legacy-tv-youtube.web-stage-full .stage .screen {
  top: 0;
  right: 0;
  bottom: 56px;
  left: 0;
  border: 0;
  border-radius: 0;
  min-height: 0;
}
.tv-mode.legacy-tv.legacy-tv-youtube.karaoke-box-full .karaoke-box-controls,
.tv-mode.legacy-tv.legacy-tv-youtube.web-stage-full .web-stage-controls {
  top: auto;
  right: 3%;
  bottom: 8px;
  max-width: 58%;
  flex-wrap: nowrap;
}
.legacy-tv.legacy-tv-youtube .karaoke-box-controls > *,
.legacy-tv.legacy-tv-youtube .web-stage-controls > * {
  min-height: 36px;
  margin-left: 4px;
  padding: 4px 8px;
  font-size: .8rem;
  white-space: nowrap;
  background: #292335;
}
.tv-mode.legacy-tv.legacy-tv-youtube.karaoke-box-full .stage > .tv-seek:not([hidden]),
.tv-mode.legacy-tv.legacy-tv-youtube.web-stage-full .stage > .tv-seek:not([hidden]),
.tv-mode.legacy-tv.legacy-tv-youtube.karaoke-box-full .stage > #playback-message:not(:empty),
.tv-mode.legacy-tv.legacy-tv-youtube.web-stage-full .stage > #playback-message:not(:empty) {
  right: 62%;
  bottom: 8px;
  left: 3%;
  max-width: none;
  margin: 0;
  background: #191521;
}
.legacy-tv.legacy-tv-youtube.karaoke-box-full .stage > #playback-message:not(:empty),
.legacy-tv.legacy-tv-youtube.web-stage-full .stage > #playback-message:not(:empty) {
  box-sizing: border-box;
  max-height: 40px;
  overflow: auto;
  padding: 4px 8px;
  font-size: .85rem;
}
.tv-mode.legacy-tv.legacy-tv-youtube.tv-full-controls-hidden .tv-menu-wake {
  top: auto;
  bottom: 0;
  width: 100%;
  height: 56px;
  padding: 0 3%;
  border-radius: 0;
  opacity: 1;
  background: #191521;
  color: #fff;
  text-align: right;
  font-size: .8rem;
}

@media (max-width: 760px) {
  .tv-mode.legacy-tv.legacy-tv-youtube.karaoke-box-full .stage .screen,
  .tv-mode.legacy-tv.legacy-tv-youtube.web-stage-full .stage .screen { bottom: 88px; }
  .tv-mode.legacy-tv.legacy-tv-youtube.karaoke-box-full .karaoke-box-controls,
  .tv-mode.legacy-tv.legacy-tv-youtube.web-stage-full .web-stage-controls { max-width: 94%; }
  .tv-mode.legacy-tv.legacy-tv-youtube.karaoke-box-full .stage > .tv-seek:not([hidden]),
  .tv-mode.legacy-tv.legacy-tv-youtube.web-stage-full .stage > .tv-seek:not([hidden]),
  .tv-mode.legacy-tv.legacy-tv-youtube.karaoke-box-full .stage > #playback-message:not(:empty),
  .tv-mode.legacy-tv.legacy-tv-youtube.web-stage-full .stage > #playback-message:not(:empty) {
    right: 3%;
    bottom: 46px;
  }
  .tv-mode.legacy-tv.legacy-tv-youtube.tv-full-controls-hidden .tv-menu-wake { height: 88px; }
}

.tv-mode.legacy-tv.tv-qr-open #room-panel:not([hidden]) {
  position: fixed;
  z-index: 90;
  top: 70px;
  left: auto;
  right: 5%;
  width: 158px;
  max-height: calc(100vh - 90px);
  overflow: auto;
  margin: 0;
  padding: 6px;
  transform: none !important;
  box-shadow: none !important;
  background: #191521;
  font-size: .82rem;
}
.tv-mode.legacy-tv #room-panel #room-qr {
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0 auto .3rem;
  image-rendering: pixelated;
}
.tv-mode.legacy-tv #room-invite small { display: none; }
.tv-mode.legacy-tv #room-link {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .25rem;
}
.tv-mode.legacy-tv #room-panel button {
  min-height: 30px;
  padding: .22rem .34rem;
  font-size: .76rem;
}

/* Keep the timeline reachable if Android leaves its navigation strip visible. */
.tv-mode.legacy-tv.tv-nav-clearance.karaoke-box-full .stage .screen,
.tv-mode.legacy-tv.tv-nav-clearance.web-stage-full .stage .screen { bottom: calc(3vh + 92px); }
.tv-mode.legacy-tv.tv-nav-clearance.tv-full-controls-hidden.karaoke-box-full .stage .screen,
.tv-mode.legacy-tv.tv-nav-clearance.tv-full-controls-hidden.web-stage-full .stage .screen { bottom: 52px; }
.tv-mode.legacy-tv.tv-nav-clearance.karaoke-box-full .stage > .tv-seek:not([hidden]),
.tv-mode.legacy-tv.tv-nav-clearance.web-stage-full .stage > .tv-seek:not([hidden]) { bottom: calc(3vh + 52px); }

.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.karaoke-box-full .stage .screen,
.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.web-stage-full .stage .screen { bottom: 108px; }
.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.karaoke-box-full .karaoke-box-controls,
.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.web-stage-full .web-stage-controls,
.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.karaoke-box-full .stage > .tv-seek:not([hidden]),
.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.web-stage-full .stage > .tv-seek:not([hidden]),
.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.karaoke-box-full .stage > #playback-message:not(:empty),
.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.web-stage-full .stage > #playback-message:not(:empty) { bottom: 60px; }
.tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube .tv-menu-wake {
  bottom: 52px;
  width: 120px;
  height: 48px;
}

@media (max-width: 760px) {
  .tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.karaoke-box-full .stage .screen,
  .tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.web-stage-full .stage .screen { bottom: 140px; }
  .tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.karaoke-box-full .stage > .tv-seek:not([hidden]),
  .tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.web-stage-full .stage > .tv-seek:not([hidden]),
  .tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.karaoke-box-full .stage > #playback-message:not(:empty),
  .tv-mode.legacy-tv.tv-nav-clearance.legacy-tv-youtube.web-stage-full .stage > #playback-message:not(:empty) { bottom: 98px; }
}

