/* Keno Live — chuyển từ bản mẫu keno-linh-vat-demo. Nạp trong shadow root của #kenoLive (assets/js/keno-live.js). */

:host {
  --ink: #29362e;
  --accent: #bc663a;
  --bg: #f4eee1;
  --soft: #e8dcc7;
  --deep: #544a36;
}
* {
  box-sizing: border-box;
}
.kl-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 Arial,
    sans-serif;
  transition: background 0.6s;
}
button,
select {
  font: inherit;
  cursor: pointer;
}
button {
  border: 1px solid #28362b22;
  background: #fff9;
  border-radius: 12px;
  padding: 10px 16px;
  color: inherit;
}
button:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}
button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #28362b22;
  padding: 18px 3vw;
}
.brand {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -1px;
}
.brand span {
  color: var(--accent);
}
.tag {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.toplinks {
  display: flex;
  gap: 24px;
  align-items: center;
}
.pill {
  padding: 7px 12px;
  background: #fff8;
  border-radius: 30px;
  font-size: 12px;
}
main {
  max-width: 1550px;
  margin: auto;
  padding: 22px 3vw;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
h1 {
  font-family: Georgia, serif;
  font-size: 38px;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 8px 0;
}
p {
  margin: 7px 0;
  color: #586257;
}
.clock {
  display: flex;
  align-items: center;
  gap: 22px;
}
.clock strong {
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}
.themes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.theme {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 10px 14px;
  background: #fff6;
}
.theme.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.theme small {
  display: block;
  opacity: 0.65;
  font-size: 11px;
}
.mini {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.layout {
  display: grid;
  grid-template-columns: 1.05fr 1.35fr 0.7fr;
  gap: 18px;
  align-items: stretch;
}
.card {
  border: 1px solid #28362b22;
  border-radius: 22px;
  background: #fff9;
  overflow: hidden;
}
.scene {
  position: relative;
  min-height: 510px;
  background: var(--soft);
  display: flex;
  flex-direction: column;
}
.scene:before {
  content: '';
  position: absolute;
  inset: 65px 25px 125px;
  border: 1px solid #fff7;
  border-radius: 50% 50% 42% 42%;
}
.scenehead {
  padding: 24px 24px 0;
  z-index: 1;
}
.scenehead h2 {
  font:
    30px Georgia,
    serif;
  margin: 5px 0;
}
.mascot {
  position: relative;
  width: 100%;
  height: 270px;
  display: block;
  border: 0;
  background: none;
  padding: 0;
  z-index: 2;
}
.mascot:hover {
  filter: none;
  transform: none;
}
.mascot svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.speech {
  margin: 0 22px 12px;
  background: #fff9;
  border-radius: 14px;
  padding: 12px;
  font-size: 13px;
  z-index: 3;
  min-height: 62px;
}
.scenefoot {
  padding: 0 22px 20px;
  z-index: 3;
  margin-top: auto;
}
.primary {
  background: var(--accent);
  border: 0;
  color: white;
  font-weight: 700;
  width: 100%;
  padding: 14px;
}
.board {
  padding: 23px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.row h2 {
  font-size: 21px;
  margin: 0;
}
.muted {
  font-size: 12px;
  color: #687169;
}
select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  color: inherit;
}
.grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 7px;
  margin: 20px 0;
}
.num {
  border-radius: 50%;
  aspect-ratio: 1;
  padding: 0;
  min-width: 0;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  position: relative;
}
.num.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.num.locked:after {
  content: '•';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  font-size: 15px;
}
.selection {
  border-top: 1px solid #28362b22;
  padding-top: 17px;
  min-height: 85px;
}
.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.chip {
  background: var(--soft);
  padding: 6px 10px;
  font-size: 13px;
}
.chip.locked {
  border-color: var(--accent);
  font-weight: bold;
}
.actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.actions button {
  flex: 1;
  font-size: 13px;
  padding: 10px;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.side .card {
  padding: 20px;
}
.side h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.story {
  font:
    19px/1.45 Georgia,
    serif;
  color: var(--deep);
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 15px;
}
.step {
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.step b {
  display: flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--soft);
  flex-shrink: 0;
}
.bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 15px 20px;
  border: 1px solid #28362b22;
  border-radius: 15px;
}
.toggles {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
}
.toggles label {
  display: flex;
  align-items: center;
  gap: 6px;
}
input {
  accent-color: var(--accent);
}
footer {
  padding: 20px 0;
  font-size: 11px;
  color: #687169;
  display: flex;
  justify-content: space-between;
}
.fly {
  position: fixed;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-weight: bold;
  pointer-events: none;
  box-shadow: 0 6px 15px #0002;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  z-index: 60;
  display: none;
}
.ground {
  fill: var(--accent);
  opacity: 0.1;
}
.mascot.idle {
  animation: breathe 4s ease-in-out infinite;
}
.mascot.cat.acting .paw {
  animation: paw 0.5s 2;
  transform-origin: 170px 155px;
}
.mascot.fish.acting {
  animation: jump 1s ease-in-out;
}
.mascot.buffalo.acting {
  animation: nod 0.65s 2;
}
.mascot.bird.acting .wing {
  animation: flap 0.35s 3;
  transform-origin: 150px 130px;
}
.mascot.tai.acting {
  animation: nod 0.65s 2;
}
@keyframes breathe {
  50% {
    transform: translateY(-4px);
  }
}
@keyframes paw {
  50% {
    transform: rotate(-30deg);
  }
}
@keyframes jump {
  0% {
    transform: translate(60px, 50px) rotate(15deg);
    opacity: 0.3;
  }
  50% {
    transform: translate(-35px, -70px) rotate(-20deg);
  }
  100% {
    transform: translate(0, 0);
  }
}
@keyframes nod {
  50% {
    transform: translateY(8px) rotate(-3deg);
  }
}
@keyframes flap {
  50% {
    transform: scaleY(0.6) rotate(-10deg);
  }
}
.reduced * {
  animation: none !important;
  transition: none !important;
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr 1.3fr;
  }
  .side {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .scene {
    min-height: 480px;
  }
  .toplinks {
    display: none;
  }
}
@media (max-width: 700px) {
  main {
    padding: 16px;
  }
  .heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 28px;
  }
  .clock {
    display: block;
    text-align: right;
  }
  .clock strong {
    font-size: 24px;
  }
  .themes {
    display: flex;
    overflow: auto;
  }
  .theme {
    min-width: 160px;
  }
  .layout {
    display: flex;
    flex-direction: column;
  }
  .scene {
    min-height: 0;
  }
  .mascot {
    height: 205px;
  }
  .scenehead {
    padding-top: 16px;
  }
  .scenehead h2 {
    font-size: 25px;
  }
  .side {
    display: flex;
  }
  .grid {
    gap: 5px;
  }
  .board {
    padding: 18px;
  }
  .bottom {
    align-items: flex-start;
    flex-direction: column;
  }
  footer {
    display: block;
  }
  .tag {
    font-size: 9px;
  }
  .heading p {
    font-size: 12px;
  }
}

.kl-body {
  background: #07182b;
  color: #edf3ff;
}
.brand {
  color: white;
}
.brand span {
  color: #ff4961;
}
.toplinks .pill {
  background: #132a42;
}
.heading p,
.heading .muted,
footer {
  color: #9cb1ca;
}
header {
  border-color: #ffffff13;
}
.pill {
  background: #152b44;
  color: #e7f0ff;
}
.heading h1 {
  font-family: Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -1.5px;
}
.clock {
  padding: 10px 20px;
  background: #0d223b;
  border: 1px solid #315574;
  border-radius: 15px;
}
.clock strong {
  color: #fff;
}
.themes .theme {
  background: #0d2239;
  border-color: #27415c;
  color: #c8d7eb;
}
.themes .theme.active {
  background: #20344b;
  border-color: #ff4d64;
  color: white;
  box-shadow: inset 0 -3px #ff4d64;
}
.layout {
  grid-template-columns: 0.78fr 1.3fr 1fr;
}
.scene {
  color: #303d34;
}
.board {
  color: #152238;
  background: #fffdf9;
}
.board .num.selected {
  background: #f63754;
  border-color: #f63754;
}
.board .chip {
  background: #f7e7e8;
}
.side .card {
  background: #0c233b;
  border-color: #24415f;
}
.side h3 {
  color: #f4f7ff;
}
.side .muted {
  color: #acbfd6;
}
.primary {
  background: #f63754;
}
.scene {
  min-height: 505px;
}
.scenehead h2 {
  font-size: 27px;
}
.mascot {
  height: 240px;
}
.bottom {
  background: #0c233b;
  border-color: #24415f;
}
.bottom button {
  background: #162e48;
  color: #ecf4ff;
  border-color: #31506f;
}
.data {
  padding: 20px !important;
}
.seg {
  display: flex;
  gap: 4px;
  background: #07182b;
  padding: 4px;
  border-radius: 11px;
}
.seg button {
  padding: 6px 9px;
  border: 0;
  background: none;
  color: #a8bed7;
  font-size: 12px;
}
.seg button.on {
  background: #fa3c57;
  color: white;
}
.tabs {
  display: flex;
  border-bottom: 1px solid #284059;
  margin: 14px 0 12px;
}
.tabs button {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 10px 6px;
  color: #9fb4d1;
  font-size: 12px;
  flex: 1;
}
.tabs button.on {
  color: #ff5970;
  border-bottom: 2px solid #ff5970;
}
.metric {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #102b46;
  border: 1px solid #244965;
  border-radius: 13px;
  padding: 10px 15px;
  margin-bottom: 12px;
}
.metric strong {
  font-size: 44px;
  color: #ff4964;
  letter-spacing: -2px;
}
.metric p {
  color: #c7d6e8;
  font-size: 12px;
}
.metric b {
  color: #fff;
  font-size: 19px;
}
.bars {
  display: grid;
  gap: 8px;
  margin: 12px 0 18px;
}
.barrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  background: none;
  border: 0;
  color: #e3edfb;
  width: 100%;
  padding: 0;
}
.track {
  height: 8px;
  flex: 1;
  background: #19354e;
  border-radius: 20px;
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff294d, #ff8b92);
  border-radius: 20px;
}
.heat {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-top: 12px;
}
.heat button {
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10px;
  aspect-ratio: 1;
  color: white;
  min-width: 0;
}
.heat button.focus {
  outline: 2px solid #ff4e6b;
  outline-offset: 1px;
}
.heatlegend {
  display: flex;
  justify-content: space-between;
  color: #9db4ce;
  font-size: 10px;
  margin-top: 8px;
}
.heatlegend i {
  display: inline-block;
  background: linear-gradient(90deg, #16334f, #619bec);
  width: 70px;
  height: 6px;
  border-radius: 9px;
}
.subgrid {
  display: grid;
  grid-template-columns: 1.1fr 0.75fr 1.4fr;
  gap: 18px;
  margin-top: 18px;
}
.subgrid .card {
  background: #0c233b;
  border-color: #24415f;
  padding: 20px;
}
.subgrid h3 {
  margin: 0 0 10px;
  font-size: 17px;
}
.resultballs {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 7px;
  margin: 14px 0;
}
.resultballs span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #f5f7ff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  color: #122339;
}
.resultballs span.hit {
  background: #ff3b59;
  color: white;
}
.rhythm {
  display: flex;
  gap: 6px;
  height: 65px;
  align-items: flex-end;
  margin: 12px 0;
}
.rhythm button {
  border: 0;
  background: none;
  padding: 0;
  border-radius: 3px;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rhythm i {
  display: block;
  width: 100%;
  background: #ff546e;
}
.rhythm em {
  display: block;
  width: 100%;
  background: #6cacff;
}
.legend {
  color: #aec2da;
  font-size: 11px;
}
.legend b {
  color: #ff6279;
}
.legend strong {
  color: #74b5ff;
}
.detail {
  background: #112e49;
  border-radius: 9px;
  padding: 9px 12px;
  color: #cad9e9;
  font-size: 12px;
  margin-top: 10px;
  min-height: 48px;
}
.storystrip {
  margin-top: 13px;
  font-size: 12px;
  color: #a5bbd2;
}
.storystrip b {
  color: #fff;
}
.mini svg {
  width: 100%;
  height: 100%;
}
#saved button {
  background: #152e48;
  border-color: #35506c;
  color: #e6f0ff;
}
#deleteSaved {
  background: #18324d;
  border-color: #35506c;
  color: white;
}
.toast {
  background: #f1f6ff;
  color: #142238;
}
.fly {
  background: #ff3b59;
}
.tag {
  letter-spacing: 1.3px;
}
.theme small {
  font-size: 10px;
}
#scopeNote {
  font-size: 10px;
  color: #8ea6c3;
  margin-top: 12px;
}
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 0.8fr 1.25fr;
  }
  .side {
    grid-column: 1/-1;
    display: block;
  }
  .data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
  .data > .row,
  .data > .tabs {
    grid-column: 1/-1;
  }
  .data .heatblock {
    grid-column: 2;
    grid-row: 3/6;
  }
  .subgrid {
    grid-template-columns: 1fr 1fr;
  }
  .subgrid > :last-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 700px) {
  .data {
    display: block;
  }
  .subgrid {
    display: flex;
    flex-direction: column;
  }
  .clock {
    padding: 8px 10px;
  }
  .heading h1 {
    font-size: 26px;
    letter-spacing: -0.7px;
  }
  .theme {
    min-width: 165px;
  }
  .resultballs {
    gap: 6px;
  }
  .scene {
    min-height: 0;
  }
  .mascot {
    height: 210px;
  }
}

.themes {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.theme {
  padding: 8px;
  gap: 5px;
  min-width: 0;
}
.theme b {
  font-size: 12px;
}
.theme small {
  font-size: 8px;
}
.mini {
  width: 38px;
  height: 42px;
}
.themeLabel {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #e5edfb;
  letter-spacing: 1px;
  margin: 0 0 10px;
}
.themeLabel span {
  letter-spacing: 0;
  color: #94adc7;
}
.sceneEffect {
  position: absolute;
  top: 49%;
  left: 44%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffe3a0;
  border: 3px solid #d3a34b;
  color: #573c20;
  font-weight: 900;
  font-size: 25px;
  display: none;
  place-items: center;
  z-index: 4;
  pointer-events: none;
}
.sceneEffect.show {
  display: grid;
  animation: reveal 1.1s both;
}
.sceneEffect.toad {
  animation: coin 1.1s both;
}
.sceneEffect.elephant {
  animation: trunk 1.1s both;
}
.sceneEffect.pig {
  animation: pop 1.1s both;
}
.sceneEffect.turtle {
  animation: spiral 1.1s both;
  border: 5px double #789977;
}
.sceneEffect.dia {
  animation: wind 1.1s both;
}
.sceneEffect.buddha {
  animation: lotus 1.1s both;
  border-radius: 55% 55% 35% 35%;
  background: #f6deca;
}
.sceneEffect.nghe {
  animation: stamp 1.1s both;
  border-radius: 12px;
  border: 5px double #8a5b3a;
}
.sceneEffect.horse {
  animation: ribbon 1.1s both;
}
.sceneEffect.tai {
  border-radius: 6px;
  background: #b13d32;
  color: #ffe7a9;
  animation: cardflip 1.1s both;
}
.mascot.toad.acting {
  animation: nod 0.4s 2;
}
.mascot.elephant.acting {
  animation: sway 0.8s;
}
.mascot.pig.acting {
  animation: shake 0.3s 3;
}
.mascot.turtle.acting {
  animation: breathe 0.5s 2;
}
.mascot.dia.acting {
  animation: sway 0.5s 2;
}
.mascot.buddha.acting {
  animation: breathe 1s;
}
.mascot.nghe.acting {
  animation: nod 0.4s 2;
}
.mascot.horse.acting {
  animation: gallop 0.4s 2;
}
@keyframes reveal {
  0% {
    opacity: 0;
    transform: translateY(25px) scale(0.3);
  }
  60% {
    opacity: 1;
    transform: translateY(-50px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-65px);
  }
}
@keyframes coin {
  0% {
    transform: rotateY(0) scale(0.2);
  }
  60% {
    transform: translateY(-70px) rotateY(540deg) scale(1);
  }
  100% {
    transform: translateY(-80px) rotateY(720deg);
    opacity: 0;
  }
}
@keyframes trunk {
  0% {
    transform: translate(40px, 20px) scale(0.2);
  }
  50% {
    transform: translate(70px, -80px) rotate(20deg);
  }
  100% {
    transform: translate(-10px, -100px);
    opacity: 0;
  }
}
@keyframes pop {
  0% {
    transform: translateY(20px) scale(0.1);
  }
  50% {
    transform: translateY(-100px) scale(1.2);
  }
  100% {
    transform: translateY(-65px);
    opacity: 0;
  }
}
@keyframes spiral {
  0% {
    transform: scale(0.1) rotate(-180deg);
    box-shadow: 0 0 0 0 #a4c8a7;
  }
  70% {
    transform: translateY(-50px) scale(1);
    box-shadow: 0 0 0 30px #a4c8a700;
  }
  100% {
    opacity: 0;
  }
}
@keyframes wind {
  0% {
    transform: translate(-70px, 10px) rotate(-30deg);
    opacity: 0;
  }
  60% {
    transform: translate(40px, -60px) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: translate(90px, -90px);
    opacity: 0;
  }
}
@keyframes lotus {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  70% {
    opacity: 1;
    transform: translateY(-40px);
    box-shadow: 0 0 0 15px #efceb844;
  }
  100% {
    opacity: 0;
    transform: translateY(-50px);
  }
}
@keyframes stamp {
  0% {
    transform: translateY(-70px) scale(1.4);
    opacity: 0;
  }
  40% {
    transform: translateY(0) scale(0.9);
    opacity: 1;
  }
  75% {
    transform: translateY(-30px);
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ribbon {
  0% {
    transform: translate(-110px, 0) rotate(-15deg);
    opacity: 0;
  }
  55% {
    transform: translate(0, -70px);
    opacity: 1;
  }
  100% {
    transform: translate(100px, -60px) rotate(15deg);
    opacity: 0;
  }
}
@keyframes cardflip {
  0% {
    transform: rotateY(90deg);
    opacity: 0;
  }
  50% {
    transform: translateY(-40px) rotateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-70px);
    opacity: 0;
  }
}
@keyframes sway {
  50% {
    transform: rotate(8deg);
  }
}
@keyframes shake {
  25% {
    transform: rotate(-4deg);
  }
  75% {
    transform: rotate(4deg);
  }
}
@keyframes gallop {
  50% {
    transform: translate(18px, -12px) rotate(-4deg);
  }
}
@media (max-width: 1100px) {
  .themes {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 700px) {
  .themes {
    display: flex;
  }
  .theme {
    min-width: 150px;
  }
  .themeLabel {
    display: block;
  }
  .themeLabel span {
    display: block;
    margin-top: 3px;
  }
}

.art {
  display: block;
  width: 100%;
  height: 100%;
  background-size: 400% 400%;
  background-position: var(--ax) var(--ay);
  background-repeat: no-repeat;
}
.scene {
  background: radial-gradient(ellipse at 50% 45%, #bc344b 0%, #65152b 48%, #2e1125 100%);
  color: #fff1d6;
  border-color: #c7904b66;
  min-height: 530px;
  isolation: isolate;
  box-shadow: 0 15px 40px #0003;
}
.scene:before {
  inset: 70px -30px 80px;
  border-radius: 50%;
  border: 1px solid #f4bc6a33;
  background: repeating-conic-gradient(from 12deg, #ffc17000 0deg 17deg, #ffd27b12 18deg 21deg, #ffc17000 22deg 35deg);
  z-index: -1;
  animation: haloTurn 40s linear infinite;
}
.scene:after {
  content: '';
  position: absolute;
  width: 65%;
  height: 35px;
  border-radius: 50%;
  left: 17%;
  top: 67%;
  background: #f1af6244;
  filter: blur(15px);
  z-index: -1;
}
.scenehead {
  padding: 20px 22px 0;
}
.scenehead .tag {
  color: #ebc98d;
  font-size: 9px;
}
.scenehead h2 {
  font-family: Arial, sans-serif;
  font-size: 24px;
  letter-spacing: -0.5px;
  font-weight: 800;
  color: #fff4d6;
}
.mascot {
  height: 300px;
  width: 300px;
  max-width: 100%;
  align-self: center;
  filter: drop-shadow(0 15px 12px #23030a77);
  transform-origin: 50% 80%;
}
.mascot:hover {
  filter: drop-shadow(0 10px 18px #ffd89455);
}
.mascot .art {
  transition: filter 0.2s;
  pointer-events: none;
}
.speech {
  background: #270c2099;
  color: #f6dfc0;
  border: 1px solid #dba55440;
  font-size: 12px;
  min-height: 58px;
  margin-top: 4px;
}
.scenefoot {
  padding: 0 20px 20px;
}
.scenefoot .primary {
  background: linear-gradient(110deg, #ffe8ad, #dfac52);
  border: 1px solid #ffe2a2;
  color: #552219;
  box-shadow: 0 5px 16px #16020b66;
  font-size: 14px;
}
.scene-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  color: #cead88;
  font-size: 8px;
  letter-spacing: 1px;
}
.scene-tools button {
  padding: 4px 8px;
  font-size: 10px;
  background: #ffffff09;
  color: #f7dcac;
  border-color: #ffffff22;
}
.themes {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}
.theme {
  background: linear-gradient(145deg, #10263e, #0b1c31) !important;
  min-height: 75px;
  padding: 5px 8px;
  gap: 7px;
  border: 1px solid #ffffff13 !important;
  border-radius: 14px;
}
.theme.active {
  border-color: #e7b768 !important;
  background: linear-gradient(120deg, #392337, #152b40) !important;
  box-shadow:
    0 0 0 1px #e7b76830,
    inset 0 -2px #e7b768;
}
.theme .mini {
  width: 58px;
  height: 58px;
}
.theme b {
  font-size: 11px;
}
.theme small {
  font-size: 8px;
  color: #b2c2d6;
}
.board {
  box-shadow: 0 15px 40px #0002;
  border-radius: 22px;
}
.board .num {
  box-shadow: 0 2px 3px #00000006;
  border-color: #d5ddea;
}
.board .num.selected {
  background: radial-gradient(circle at 30% 20%, #ff7287, #ef1e42 70%);
  box-shadow: 0 4px 9px #f5325033;
}
.clock {
  background: linear-gradient(120deg, #0d263e, #10203a);
  border-color: #345675;
  box-shadow: inset 0 0 20px #83bbff06;
}
.clock strong {
  text-shadow: 0 0 25px #80b4ff44;
}
.fly {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 30% 20%, #ff8391, #f91c46 65%, #af1738);
  border: 1px solid #ffb0b4;
  box-shadow:
    0 0 0 5px #ff63881a,
    0 12px 25px #04112655;
  font-size: 20px;
  text-shadow: 0 1px 1px #a20725;
}
.fly:after {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid #fff5;
  border-radius: 50%;
}
.spark {
  position: fixed;
  pointer-events: none;
  z-index: 55;
  width: 6px;
  height: 6px;
  background: #ffdc8b;
  border-radius: 2px;
  box-shadow: 0 0 8px #ffc35e;
}
.sceneEffect {
  top: 48%;
  left: calc(50% - 29px);
  background: radial-gradient(circle at 35% 25%, #fff4c7, #efc369 55%, #bb761f);
  box-shadow:
    0 0 30px #f8c75c88,
    0 0 0 8px #ffd47711;
  color: #5e2e12;
  border-color: #f6d990;
  z-index: 5;
}
.sceneEffect.cat {
  animation: catPick 1.7s both;
}
.sceneEffect.fish {
  animation: fishBall 1.7s both;
}
.sceneEffect.bird {
  animation: birdCarry 1.7s both;
}
.sceneEffect.buffalo {
  animation: buffaloRoll 1.7s both;
}
.sceneEffect.show {
  animation-duration: 1.7s !important;
}
.mascot.cat.acting {
  animation: catWave 1.7s ease-in-out;
}
.mascot.fish.acting {
  animation: carpLeap 1.7s ease-in-out;
}
.mascot.bird.acting {
  animation: birdFlight 1.7s ease-in-out;
}
.mascot.tai.acting {
  animation: godReveal 1.7s ease-in-out;
}
.mascot.buffalo.acting {
  animation: nod 0.55s 2;
}
.scene[data-character='fish'] {
  background: radial-gradient(ellipse at 50% 50%, #27697a, #122b46 70%);
}
.scene[data-character='turtle'],
.scene[data-character='nghe'] {
  background: radial-gradient(ellipse at 50% 50%, #356651, #102d2d 70%);
}
.scene[data-character='buddha'] {
  background: radial-gradient(ellipse at 50% 50%, #9a713d, #3d292b 70%);
}
dialog {
  width: min(1100px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: #0a1c30;
  border: 1px solid #466079;
  border-radius: 24px;
  color: #fff;
  padding: 26px;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(8px);
}
.gallery-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery-top button {
  background: #1c344f;
  color: white;
}
.gallery-top h2 {
  margin: 7px 0 22px;
}
#galleryGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.galleryItem {
  background: radial-gradient(ellipse at 50% 40%, #4a2c39, #101f32 70%);
  border: 1px solid #ffffff18;
  border-radius: 18px;
  color: #f2d9af;
  padding: 12px;
}
.galleryItem .art {
  aspect-ratio: 1;
}
.galleryItem b {
  display: block;
  margin: 8px;
}
.galleryItem small {
  display: block;
  color: #adbdcd;
  font-size: 10px;
  line-height: 1.5;
  min-height: 30px;
}
.reduced .spark {
  display: none;
}
@keyframes haloTurn {
  to {
    transform: rotate(360deg);
  }
}
@keyframes catWave {
  25% {
    transform: rotate(-5deg) translateY(-5px);
  }
  50% {
    transform: rotate(4deg);
  }
  75% {
    transform: rotate(-3deg);
  }
}
@keyframes carpLeap {
  0% {
    transform: translate(45px, 55px) rotate(15deg);
    opacity: 0.4;
  }
  45% {
    transform: translate(-15px, -65px) rotate(-18deg);
    opacity: 1;
  }
  70% {
    transform: translate(-25px, -30px) rotate(-8deg);
  }
  100% {
    transform: translate(0, 0);
  }
}
@keyframes birdFlight {
  40% {
    transform: translate(15px, -35px) rotate(-6deg);
  }
  70% {
    transform: translate(-10px, -15px) rotate(3deg);
  }
}
@keyframes godReveal {
  35% {
    transform: translateY(-7px) scale(1.035);
  }
  65% {
    transform: scale(1.01);
  }
}
@keyframes catPick {
  0%,
  15% {
    opacity: 0;
    transform: translate(45px, 20px) scale(0.1);
  }
  55% {
    opacity: 1;
    transform: translate(65px, -65px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(20px, -90px);
  }
}
@keyframes fishBall {
  0% {
    opacity: 0;
    transform: translate(80px, 70px);
  }
  55% {
    opacity: 1;
    transform: translate(-15px, -85px);
  }
  100% {
    opacity: 0;
    transform: translate(-50px, -30px);
  }
}
@keyframes birdCarry {
  0% {
    opacity: 0;
    transform: translate(-50px, 15px);
  }
  60% {
    opacity: 1;
    transform: translate(40px, -65px);
  }
  100% {
    opacity: 0;
    transform: translate(80px, -80px);
  }
}
@keyframes buffaloRoll {
  0% {
    opacity: 0;
    transform: translate(-60px, 30px) rotate(-180deg);
  }
  65% {
    opacity: 1;
    transform: translate(35px, -30px) rotate(0);
  }
  100% {
    opacity: 0;
    transform: translate(70px, -60px);
  }
}
@media (max-width: 1200px) {
  .themes {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (max-width: 700px) {
  .themes {
    display: flex;
  }
  .theme {
    min-width: 160px;
  }
  .mascot {
    height: 285px;
    width: 285px;
  }
  .scene {
    min-height: 0;
  }
  #galleryGrid {
    grid-template-columns: repeat(2, 1fr);
  }
  .themeLabel span {
    font-size: 10px;
  }
  .scenehead h2 {
    font-size: 26px;
  }
  .bottom {
    align-items: stretch;
  }
}

.scene[data-character='clover3'],
.scene[data-character='clover4'] {
  background: radial-gradient(ellipse at 50% 45%, #32895f, #0b2d2c 75%);
}
.mascot.clover3.acting {
  animation: leafSpin 1.7s ease-in-out;
}
.mascot.clover4.acting {
  animation: leafBloom 1.7s ease-in-out;
}
.mascot.pouch.acting {
  animation: shake 0.3s 3;
}
.mascot.ingot.acting {
  animation: ingotTurn 1.7s ease-in-out;
}
.mascot.knot.acting {
  animation: sway 0.8s 2;
}
.mascot.horseshoe.acting {
  animation: shoeGlow 1.7s ease-in-out;
}
.sceneEffect.clover3 {
  animation: spiral 1.7s both;
  background: #d2f4bd;
  border-color: #98cd85;
}
.sceneEffect.clover4 {
  animation: lotus 1.7s both;
  background: #d2f4bd;
  border-color: #98cd85;
}
.sceneEffect.pouch {
  animation: pop 1.7s both;
  border-radius: 8px;
}
.sceneEffect.ingot {
  animation: coin 1.7s both;
}
.sceneEffect.knot {
  animation: ribbon 1.7s both;
}
.sceneEffect.horseshoe {
  animation: spiral 1.7s both;
}
.themes {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.art.object {
  filter: drop-shadow(0 8px 12px #0002);
}
@keyframes leafSpin {
  50% {
    transform: rotate(18deg) translateY(-15px);
  }
}
@keyframes leafBloom {
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 20px #b5ffa988);
  }
}
@keyframes ingotTurn {
  50% {
    transform: rotateY(35deg) rotate(-5deg) translateY(-15px);
  }
}
@keyframes shoeGlow {
  50% {
    transform: translateY(-12px);
    filter: drop-shadow(0 0 22px #ffe2aabb);
  }
}
@media (max-width: 1200px) {
  .themes {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (max-width: 700px) {
  .themes {
    display: flex;
  }
}

.mascot.envelope.acting {
  animation: envelopeOpen 1.7s ease-in-out;
}
.mascot.gourd.acting {
  animation: gourdTilt 1.7s ease-in-out;
}
.mascot.khanh.acting {
  animation: khanhSwing 1.7s ease-in-out;
  transform-origin: 50% 8%;
}
.sceneEffect.envelope {
  animation: envelopeCard 1.7s both;
  border-radius: 8px;
  background: linear-gradient(140deg, #fff2c8, #e3b752);
}
.sceneEffect.gourd {
  animation: gourdPour 1.7s both;
}
.sceneEffect.khanh {
  animation: khanhLight 1.7s both;
  box-shadow:
    0 0 25px #ffdf91,
    0 0 0 12px #ffc36e22;
}
.scene[data-character='khanh'] {
  background: radial-gradient(ellipse at 50% 45%, #934429, #351424 75%);
}
@keyframes envelopeOpen {
  35% {
    transform: translateY(-8px) rotateY(-12deg);
  }
  65% {
    transform: translateY(-3px) rotateY(8deg);
  }
}
@keyframes gourdTilt {
  25% {
    transform: rotate(-8deg);
  }
  55% {
    transform: rotate(24deg) translateX(10px);
  }
  85% {
    transform: rotate(-3deg);
  }
}
@keyframes khanhSwing {
  20% {
    transform: rotate(9deg);
  }
  45% {
    transform: rotate(-7deg);
  }
  70% {
    transform: rotate(4deg);
  }
  90% {
    transform: rotate(-2deg);
  }
}
@keyframes envelopeCard {
  0%,
  20% {
    opacity: 0;
    transform: translateY(30px) scale(0.6);
  }
  65% {
    opacity: 1;
    transform: translateY(-80px) rotate(-5deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-110px);
  }
}
@keyframes gourdPour {
  0%,
  15% {
    opacity: 0;
    transform: translate(40px, -70px) scale(0.2);
  }
  60% {
    opacity: 1;
    transform: translate(80px, -40px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(100px, 0);
  }
}
@keyframes khanhLight {
  0%,
  20% {
    opacity: 0;
    transform: scale(0.1);
  }
  65% {
    opacity: 1;
    transform: translateY(-15px) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translateY(-65px) scale(0.8);
  }
}

.stage-shell {
  position: relative;
  min-width: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid #d6b77966;
  box-shadow: 0 20px 60px #0005;
  background: #071426;
  isolation: isolate;
}
.stage-shell:before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--stage-image, linear-gradient(120deg, #461828, #07182b 30%, #07182b 70%, #461828)) center/cover;
  z-index: -2;
}
.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 19px;
  border-bottom: 1px solid #e2bb702a;
  background: #08142788;
}
.stage-title {
  font-size: 12px;
  color: #f1cf93;
  font-weight: 800;
  letter-spacing: 2px;
}
.stage-title small {
  display: block;
  letter-spacing: 0.3px;
  color: #a9bbd0;
  font-size: 10px;
  font-weight: 400;
  margin-top: 3px;
}
.stage-controls {
  display: flex;
  gap: 6px;
}
.stage-controls button {
  color: #f9dfb1;
  border: 1px solid #d3b07055;
  background: #111d2dc9;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
}
.stage-timing {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 23px;
  color: #a5b5c9;
  font-size: 11px;
}
.stage-timing strong {
  font-size: 25px;
  color: #ffe3ae;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}
.stage-body {
  min-width: 0;
}
.stage-shell .board {
  background: #07162899;
  border: 0;
  border-radius: 0;
  color: #f4f6fc;
  box-shadow: none;
  padding: 8px 23px 24px;
}
.stage-shell .board p,
.stage-shell .board .muted {
  color: #aebed1;
}
.stage-shell .num {
  background: radial-gradient(circle at 33% 24%, #fff, #e3eafa 80%);
  color: #112039;
  border: 1px solid #c5d1e7;
  box-shadow: 0 3px 5px #0005;
  font-size: 14px;
}
.stage-shell .num.selected {
  color: #fff;
  border-color: #ff9eae;
  box-shadow:
    0 0 0 3px #f83e5422,
    0 5px 10px #0005;
}
.stage-shell .selection {
  border-color: #cba25533;
}
.stage-shell .chip {
  background: #2a2931;
  border-color: #9b804f44;
  color: #fee6b4;
}
.stage-shell .chip.locked {
  border-color: #e7bf71;
}
.stage-shell .actions button {
  background: #132940;
  color: #dbe8f8;
  border-color: #55748d66;
}
.stage-shell .actions #fill {
  background: linear-gradient(100deg, #f5d991, #d9a84f);
  color: #462b18;
  font-weight: 700;
}
.stage-shell select {
  background: #152a41;
  color: #f2dbb0;
  border-color: #536177;
}
.stage-shell .board .row h2 {
  font-size: 19px;
}
.stage-status {
  color: #b6c6d8;
  font-size: 10px;
  text-align: center;
  padding: 0 10px 12px;
}
.curtain-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.2%;
  pointer-events: none;
  z-index: 20;
  background-image: var(--stage-image);
  background-size: 200% 100%;
  display: none;
  box-shadow: 0 0 45px #0008;
}
.curtain-panel.left {
  left: 0;
  background-position: left center;
}
.curtain-panel.right {
  right: 0;
  background-position: right center;
}
.opening .curtain-panel {
  display: block;
}
.opening .curtain-panel.left {
  animation: curtainL 1.5s cubic-bezier(0.25, 0.7, 0.25, 1) both;
}
.opening .curtain-panel.right {
  animation: curtainR 1.5s cubic-bezier(0.25, 0.7, 0.25, 1) both;
}
.stage-shell .num.just-landed {
  animation: landing 0.5s ease-out;
}
.stage-shell:fullscreen,
.stage-shell.theater-fallback {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  border: 0;
  border-radius: 0;
  overflow: auto;
  background: #061326;
}
.stage-shell.theater-fallback {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.stage-shell.is-theater .stage-top {
  padding: 18px 3vw;
}
.stage-shell.is-theater .stage-title {
  font-size: 20px;
}
.stage-shell.is-theater .stage-title small {
  font-size: 12px;
}
.stage-shell.is-theater .stage-controls button {
  font-size: 15px;
  padding: 11px 15px;
}
.stage-shell.is-theater .stage-timing {
  padding: 10px 4vw;
  font-size: 14px;
}
.stage-shell.is-theater .stage-timing strong {
  font-size: 38px;
}
.stage-shell.is-theater .stage-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.7fr);
  gap: 2vw;
  padding: 0 4vw 18px;
  max-width: 1900px;
  margin: auto;
  align-items: center;
}
.stage-shell.is-theater .scene {
  background: radial-gradient(ellipse at 50% 50%, #d4944422, transparent 70%);
  border: 0;
  box-shadow: none;
  min-height: 0;
  overflow: visible;
  align-self: stretch;
  justify-content: center;
}
.stage-shell.is-theater .scene:before,
.stage-shell.is-theater .scene:after {
  display: none;
}
.stage-shell.is-theater .scenehead {
  text-align: center;
}
.stage-shell.is-theater .scenehead h2 {
  font-size: clamp(24px, 2.3vw, 42px);
}
.stage-shell.is-theater .mascot {
  width: clamp(240px, 27vw, 440px);
  height: clamp(240px, 27vw, 440px);
}
.stage-shell.is-theater .speech {
  font-size: 14px;
  min-height: 0;
  text-align: center;
}
.stage-shell.is-theater .scene-tools {
  display: none;
}
.stage-shell.is-theater .board {
  border: 1px solid #be9a5144;
  background: #06182ab5;
  border-radius: 22px;
  padding: 18px 25px;
}
.stage-shell.is-theater .grid {
  gap: clamp(7px, 1vw, 16px);
  margin: 16px 0;
}
.stage-shell.is-theater .num {
  font-size: clamp(16px, 1.8vw, 30px);
  max-height: 8vh;
  aspect-ratio: 1;
}
.stage-shell.is-theater .boardnote {
  display: none;
}
.stage-shell.is-theater .board .row h2 {
  font-size: clamp(20px, 2vw, 32px);
}
.stage-shell.is-theater .actions button {
  font-size: 15px;
}
.stage-shell.is-theater .stage-status {
  font-size: 12px;
}
.stage-shell.is-theater .sceneEffect {
  top: 45%;
}
.theater-on {
  overflow: hidden;
}
.fly {
  z-index: 1200;
}
.spark {
  z-index: 1201;
}
.toast {
  z-index: 2000;
}
@keyframes curtainL {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-105%);
  }
}
@keyframes curtainR {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(105%);
  }
}
@keyframes landing {
  50% {
    transform: scale(1.13);
    box-shadow:
      0 0 0 7px #ffe0a144,
      0 0 25px #ffd28488;
  }
}
@media (max-width: 700px) {
  .stage-shell.is-theater .stage-body {
    display: block;
    padding: 0 12px 20px;
  }
  .stage-shell.is-theater .scene {
    display: none;
  }
  .stage-shell.is-theater .stage-title {
    font-size: 14px;
  }
  .stage-shell.is-theater .stage-controls button {
    font-size: 11px;
    padding: 7px;
  }
  .stage-shell.is-theater .board {
    padding: 12px;
  }
  .stage-shell.is-theater .num {
    font-size: 14px;
    max-height: none;
  }
  .stage-top {
    padding: 12px;
  }
  .stage-title {
    letter-spacing: 1px;
  }
  .stage-controls button {
    font-size: 11px;
    padding: 7px;
  }
  .stage-shell .board {
    padding: 8px 16px 20px;
  }
  .stage-shell.is-theater .grid {
    gap: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .curtain-panel {
    display: none !important;
  }
}
:host {
  --stage-image: url('../img/keno-live/stage.png');
}
.stage-shell:before {
  background-size: 100% 100%;
}
[hidden] {
  display: none !important;
}
.themes {
  display: flex;
  overflow: auto;
  padding-bottom: 8px;
  scrollbar-color: #6f6454 transparent;
}
.theme {
  min-width: 158px;
}
.layout {
  grid-template-columns: 0.7fr 1.6fr 0.9fr;
  align-items: start;
}
.scene {
  position: sticky;
  top: 15px;
  min-height: 480px;
}
.stage-shell {
  min-height: 650px;
}
.keno-tabs {
  display: flex;
  gap: 3px;
  margin: 0 15px 12px;
  padding: 5px;
  background: #051121a8;
  border: 1px solid #b89a4c33;
  border-radius: 13px;
  overflow: auto;
}
.keno-tabs button {
  padding: 9px 10px;
  font-size: 12px;
  border: 0;
  color: #a8bbd1;
  white-space: nowrap;
  background: none;
  flex: 1;
}
.keno-tabs button.active {
  background: linear-gradient(120deg, #f6dda6, #d9b574);
  color: #332718;
  font-weight: 700;
}
.keno-pane {
  padding: 0 20px 20px;
  color: #edf4ff;
  min-width: 0;
}
.draw-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.draw-head b {
  font-size: 15px;
  display: inline-block;
}
.draw-head small {
  display: block;
  color: #9bb0c9;
  font-size: 11px;
  margin-top: 5px;
}
.demo-label {
  background: #182d46;
  color: #b6cae5;
  border: 1px solid #48607d;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 8px;
  letter-spacing: 1px;
  margin-right: 7px;
}
.draw-progress {
  text-align: right;
  white-space: nowrap;
}
.draw-progress b {
  font-size: 29px;
  color: #ffd78e;
}
.draw-progress span {
  display: block;
  font-size: 10px;
  color: #a8bfd6;
}
.hero-draw {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  align-items: center;
  gap: 8px;
  min-height: 140px;
  margin: 5px 0 8px;
}
.watch-mascot {
  height: 130px;
  width: 130px;
  max-width: 100%;
  justify-self: center;
  filter: drop-shadow(0 7px 16px #ffc15422);
}
.orb-area {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 6px;
}
.orb-area small {
  color: #ceb378;
  letter-spacing: 1px;
  font-size: 8px;
}
.orb-area > span {
  color: #a7bed6;
  font-size: 10px;
}
.draw-orb {
  height: 88px;
  width: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 39px;
  color: white;
  background: radial-gradient(circle at 27% 23%, #ffbec0, #fa4163 30%, #c41133 75%, #760b24);
  border: 2px solid #ffaabd;
  box-shadow:
    inset -7px -8px 18px #6d00193b,
    0 0 0 6px #ff395111,
    0 8px 30px #ff385722;
  text-shadow: 0 3px 2px #9a1632;
}
.draw-orb.arrive {
  animation: ballEnter 0.5s ease-out;
}
.draw-metrics > div {
  border-bottom: 1px solid #ac98632b;
  padding: 10px 3px;
  font-size: 9px;
  color: #9eb1c9;
}
.draw-metrics strong {
  display: block;
  font-size: 22px;
  color: #f3dfb7;
}
.draw-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  color: #a9bdd4;
  margin-bottom: 8px;
}
.draw-toolbar label {
  display: flex;
  align-items: center;
  gap: 4px;
}
.twenty-balls {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin-bottom: 13px;
}
.result-slot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff07;
  border: 1px dashed #ffffff24;
  color: #8497af;
  font-size: 12px;
}
.result-slot.shown {
  background: linear-gradient(#4f8ac3, #1e4f7c);
  border: 1px solid #73abda;
  color: white;
  box-shadow: 0 3px 6px #0004;
}
.result-slot.match {
  background: linear-gradient(#f9df9a, #c8933f);
  color: #412a14;
  border-color: #ffdea0;
}
.draw-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  padding: 9px;
  background: #061526bb;
  border: 1px solid #365473;
  border-radius: 12px;
}
.draw-cell {
  display: grid;
  place-items: center;
  border-radius: 6px;
  height: 24px;
  color: #607b98;
  font-size: 10px;
  border: 1px solid #1b324d;
}
.draw-cell.out {
  color: #e7f3ff;
  background: #224e7d;
  border-color: #487eab;
}
.draw-cell.tracked {
  outline: 1px solid #f9d482;
  outline-offset: -2px;
  color: #e3c488;
}
.draw-cell.matched {
  color: #342215;
  background: #edbd64;
  border-color: #ffdf9d;
  font-weight: bold;
}
.draw-legend {
  display: flex;
  gap: 13px;
  font-size: 9px;
  color: #a2b8d4;
  margin: 8px 0 12px;
}
.draw-legend span:last-child {
  color: #f5d081;
}
.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.balance-label {
  display: flex;
  justify-content: space-between;
  color: #cedbec;
  font-size: 11px;
}
.balance-label b {
  margin-left: 6px;
  color: #fff;
}
.balance-bar {
  height: 6px;
  background: #6cabe9;
  border-radius: 6px;
  overflow: hidden;
  margin: 7px 0;
}
.balance-bar i {
  height: 100%;
  display: block;
  width: 50%;
  background: #ff526d;
  transition: width 0.3s;
}
.balance-grid small {
  color: #9eafc7;
  font-size: 9px;
}
.compare-summary {
  font-size: 11px;
  line-height: 1.6;
  color: #dec79b;
  border: 1px solid #b392522f;
  background: #8e64270d;
  padding: 9px 10px;
  margin-top: 10px;
  border-radius: 9px;
}
.draw-actions {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}
.draw-actions button,
.draw-options button {
  padding: 8px 9px;
  background: #162e48;
  color: #c5d8ee;
  border-color: #42617f;
  font-size: 11px;
}
.draw-actions .gold-button {
  background: linear-gradient(120deg, #ffe2a3, #cd9a47);
  color: #382617;
  border: 0;
  font-weight: bold;
  flex: 1;
}
.draw-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px;
  margin-top: 11px;
  color: #a4bad4;
  font-size: 10px;
}
.draw-options select {
  background: #10273f;
  color: #c9d9e8;
  padding: 3px;
  border-color: #3b5470;
  font-size: 11px;
}
.draw-options button {
  font-size: 10px;
  padding: 5px 8px;
}
.keno-pane p {
  font-size: 12px;
  color: #adbed1;
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.history-head input {
  width: 150px;
  padding: 9px;
  border: 1px solid #3e5a78;
  background: #0e243b;
  border-radius: 8px;
  color: white;
}
.history-item {
  display: block;
  text-align: left;
  width: 100%;
  margin: 9px 0;
  padding: 12px;
  background: #112941;
  color: #f2d59b;
  border-color: #355170;
  font-size: 12px;
}
.history-item span {
  display: block;
  color: #dbe7f8;
  font-size: 11px;
  margin: 7px 0;
}
.history-item small {
  color: #9cb8d4;
}
.rule-cards {
  display: grid;
  gap: 8px;
}
.rule-cards p {
  padding: 12px;
  background: #0e263e;
  border: 1px solid #314a67;
  border-radius: 10px;
  margin: 0;
  font-size: 12px;
}
.rule-cards b {
  display: block;
  color: #f6d495;
  margin-bottom: 5px;
}
.prize-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 11px;
}
.prize-table th,
.prize-table td {
  padding: 9px 6px;
  border-bottom: 1px solid #3e5671;
  text-align: left;
}
.prize-table th {
  color: #f1d598;
}
.keno-pane details {
  font-size: 12px;
  background: #0c243a;
  padding: 13px;
  border-radius: 10px;
}
.keno-pane a {
  color: #88c3ff;
}
.supplement {
  margin-top: 20px;
  border-top: 1px solid #b99b5233;
  padding-top: 12px;
}
.supplement h3 {
  font-size: 15px;
  margin: 0;
}
.supplement p {
  font-size: 11px;
}
.choice-row {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}
.choice-row button {
  flex: 1;
  font-size: 11px;
  padding: 9px 4px;
  background: #16334e;
  color: #e1edfc;
  border-color: #385470;
}
.choice-row small {
  display: block;
  font-size: 8px;
  color: #afc3d9;
}
.choice-row button.active {
  background: #eac885;
  color: #332512;
  border-color: #fff0b7;
}
.choice-row button.active small {
  color: #604721;
}
.stage-shell.is-theater .stage-body {
  display: block;
  max-width: 1300px;
  padding: 0 3vw 12px;
}
.stage-shell.is-theater .stage-body > .scene {
  display: none !important;
}
.stage-shell.is-theater.watch-mode .stage-body {
  max-width: 1600px;
}
.stage-shell.is-theater .hero-draw {
  position: relative;
  min-height: 135px;
  margin: 0;
}
.stage-shell.is-theater .watch-mascot {
  width: 150px;
  height: 150px;
}
.stage-shell.is-theater .draw-orb {
  width: 95px;
  height: 95px;
  font-size: 46px;
}
.stage-shell.is-theater .draw-head b {
  font-size: 20px;
}
.stage-shell.is-theater .draw-metrics {
  display: flex;
  justify-content: center;
  gap: 25px;
}
.stage-shell.is-theater .draw-metrics strong {
  font-size: 30px;
}
.stage-shell.is-theater .draw-metrics > div {
  font-size: 12px;
}
.stage-shell.is-theater .twenty-balls {
  grid-template-columns: repeat(20, 1fr);
}
.stage-shell.is-theater .draw-grid {
  grid-template-columns: repeat(20, 1fr);
  padding: 10px;
}
.stage-shell.is-theater .draw-cell {
  height: clamp(26px, 3.7vh, 48px);
  font-size: clamp(12px, 1.1vw, 20px);
}
.stage-shell.is-theater .result-slot {
  font-size: 18px;
}
.stage-shell.is-theater .stage-top {
  padding: 12px 3vw;
}
.stage-shell.is-theater .stage-timing {
  padding: 4px 3vw;
}
.stage-shell.is-theater .stage-timing strong {
  font-size: 28px;
}
.stage-shell.is-theater .keno-tabs {
  max-width: 800px;
  margin: 5px auto 12px;
}
.stage-shell.is-theater .draw-actions {
  justify-content: center;
}
.stage-shell.is-theater .draw-actions .gold-button {
  flex: 0 1 300px;
}
.stage-shell.is-theater .balance-label {
  font-size: 14px;
}
.stage-shell.is-theater .balance-grid small,
.stage-shell.is-theater .draw-legend,
.stage-shell.is-theater .draw-toolbar {
  font-size: 12px;
}
.stage-shell.is-theater .compare-summary {
  font-size: 14px;
}
.stage-shell.is-theater .draw-options {
  justify-content: center;
  gap: 25px;
}
.stage-shell.is-theater .keno-pane {
  padding-bottom: 5px;
}
.stage-shell.is-theater .stage-status {
  display: none;
}
@keyframes ballEnter {
  0% {
    transform: translateY(-12px) scale(0.65);
    opacity: 0.3;
  }
  60% {
    transform: scale(1.07);
  }
  100% {
    transform: scale(1);
  }
}
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 0.65fr 1.35fr;
  }
  .side {
    grid-column: 1/-1;
  }
  .data {
    display: block;
  }
}
@media (max-width: 700px) {
  .layout {
    display: flex;
  }
  .scene {
    position: relative;
    top: auto;
  }
  .stage-shell {
    width: 100%;
  }
  .stage-shell.is-theater .twenty-balls {
    grid-template-columns: repeat(10, 1fr);
  }
  .stage-shell.is-theater .draw-grid {
    grid-template-columns: repeat(10, 1fr);
  }
  .stage-shell.is-theater .watch-mascot {
    width: 110px;
    height: 110px;
  }
  .stage-shell.is-theater .draw-metrics {
    display: block;
  }
  .stage-shell.is-theater .draw-metrics > div {
    font-size: 9px;
    padding: 4px;
  }
  .stage-shell.is-theater .draw-metrics strong {
    font-size: 20px;
  }
  .stage-shell.is-theater .draw-head b {
    font-size: 14px;
  }
  .stage-shell.is-theater .draw-orb {
    width: 80px;
    height: 80px;
    font-size: 34px;
  }
  .stage-shell.is-theater .result-slot {
    font-size: 12px;
  }
  .keno-pane {
    padding: 0 13px 16px;
  }
  .stage-shell.is-theater .draw-cell {
    height: 24px;
    font-size: 10px;
  }
  .stage-shell.is-theater .compare-summary {
    font-size: 11px;
  }
  .stage-shell.is-theater .hero-draw {
    min-height: 120px;
  }
}
.stage-stats {
  color: #f1f6ff;
  margin: 0 20px 20px;
  border-radius: 15px;
  background: #0a2037d9;
  padding: 20px !important;
}
.stage-stats .heat {
  gap: 6px;
}
.stage-stats .heat button {
  font-size: 12px;
}
.stage-shell.is-theater .stage-stats {
  max-width: 950px;
  margin: auto;
}
.stage-shell.is-theater .stage-stats .heat button {
  aspect-ratio: auto;
  min-height: 32px;
}
.stage-shell.is-theater .stage-stats .heat {
  grid-template-columns: repeat(20, 1fr);
}
@media (max-width: 700px) {
  .stage-shell.is-theater .stage-stats .heat {
    grid-template-columns: repeat(10, 1fr);
  }
}

header {
  background: #fff;
  color: #1e2942;
  padding: 12px max(3vw, 20px);
  gap: 24px;
  min-height: 76px;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  gap: 3px;
}
.brand img {
  width: 137px;
  height: 35px;
  object-fit: contain;
}
.brand span {
  color: #16366b;
  font: 700 10px Arial;
  letter-spacing: 6px;
  padding-left: 6px;
}
.webnav {
  display: flex;
  gap: 8px;
  margin-right: auto;
  margin-left: 30px;
}
.webnav button {
  background: transparent;
  border: 0;
  font-weight: 600;
  color: #677386;
}
.webnav button.active {
  background: #fff0f1;
  color: #d71a39;
}
.demoBadge {
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid #dedfe5;
  padding: 7px 10px;
  border-radius: 7px;
  color: #748091;
}
main {
  max-width: 1760px;
  padding: 18px 3vw;
}
.heading {
  margin-bottom: 16px;
  gap: 16px;
}
.heading h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  margin: 3px 0;
}
.heading .tag {
  display: none;
}
.heading p {
  font-size: 12px;
}
.themeLabel,
.themes {
  display: none !important;
}
.layout {
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}
.layout > .scene {
  display: none;
}
.layout > .stage-shell {
  min-width: 0;
}
.layout > .side {
  grid-column: auto;
  display: flex;
  min-width: 0;
}
.layout.choosing {
  grid-template-columns: 260px minmax(0, 1fr) 310px;
}
.layout.choosing > .scene {
  display: flex;
}
.themeQuick {
  padding: 9px 13px;
  font-size: 12px;
  background: #152b44;
  color: #fff;
  border-color: #ffffff24;
  margin-left: 12px;
}
.heading > div:first-child {
  flex: 1;
}
.clock {
  padding: 8px 15px;
}
.clock strong {
  font-size: 30px;
}
.subgrid {
  margin-top: 18px;
}
.watch-main {
  min-width: 0;
}
.stage-shell {
  align-self: start;
}
@media (max-width: 1250px) {
  .layout.choosing {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .layout.choosing > .side {
    grid-column: 1/-1;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
  .side .card {
    padding: 15px;
  }
}
@media (max-width: 950px) {
  .layout,
  .layout.choosing {
    grid-template-columns: 1fr;
  }
  .layout > .side {
    display: grid;
    grid-template-columns: 1fr;
  }
  .layout.choosing > .scene {
    display: none;
  }
  .webnav {
    margin-left: 0;
    gap: 0;
  }
  .webnav button {
    padding: 8px;
  }
  .heading h1 {
    font-size: 24px;
  }
}
@media (max-width: 600px) {
  header {
    padding: 10px 16px;
    gap: 12px;
    min-height: 64px;
  }
  .brand img {
    width: 110px;
    height: 28px;
  }
  .brand span {
    font-size: 8px;
    letter-spacing: 5px;
  }
  .webnav {
    margin-left: auto;
  }
  .webnav button {
    display: none;
  }
  .webnav button:first-child {
    display: block;
  }
  .demoBadge {
    font-size: 8px;
    padding: 5px;
  }
  .heading {
    flex-wrap: wrap;
    gap: 10px;
  }
  .heading h1 {
    font-size: 22px;
  }
  .heading p {
    display: none;
  }
  .clock {
    padding: 7px 10px;
    gap: 10px;
  }
  .clock strong {
    font-size: 24px;
  }
  .clock .muted {
    font-size: 9px;
  }
  .themeQuick {
    margin: 5px 0 0;
    padding: 6px 10px;
    font-size: 11px;
  }
  main {
    padding: 14px 10px;
  }
  .layout {
    display: grid;
  }
  .stage-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .stage-tabs button {
    white-space: nowrap;
  }
  .subgrid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 951px) {
  .stage-shell:not(.is-theater) .twenty-balls {
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 5px;
  }
  .stage-shell:not(.is-theater) .result-slot {
    font-size: 13px;
    max-height: 44px;
  }
  .stage-shell:not(.is-theater) .draw-grid {
    grid-template-columns: repeat(20, minmax(0, 1fr));
  }
  .stage-shell:not(.is-theater) .hero-draw {
    min-height: 112px;
  }
  .stage-shell:not(.is-theater) .watch-mascot {
    height: 112px;
    width: 112px;
  }
  .stage-shell:not(.is-theater) .stage-timing {
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .stage-shell:not(.is-theater) .stage-top {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}
@media (max-width: 600px) {
  .result-slot {
    font-size: 11px;
  }
  .watch-mascot {
    height: 100px;
    width: 100px;
  }
  .hero-draw {
    min-height: 112px;
  }
  .draw-orb {
    width: 70px;
    height: 70px;
    font-size: 32px;
  }
  .draw-head b {
    font-size: 13px;
  }
  .keno-pane {
    padding: 0 10px 12px;
  }
  .stage-shell .stage-timing {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .draw-grid {
    gap: 3px;
    padding: 6px;
  }
  .draw-cell {
    height: 23px;
  }
  .stage-shell {
    min-height: 0;
  }
}

/* theater.css */
:host {
  --show-bg: #260509;
  --show-panel: #5d0b16;
  --show-accent: #f0c572;
  --show-bright: #fff0be;
  --show-hue: 0deg;
}
.kl-body {
  background: linear-gradient(140deg, var(--show-bg), #090d17) !important;
}
.card,
.clock,
.bottom {
  background: color-mix(in srgb, var(--show-panel) 65%, #111b29) !important;
  border-color: color-mix(in srgb, var(--show-accent) 25%, transparent) !important;
}
.stage-shell:before {
  filter: hue-rotate(var(--show-hue));
}
.keno-tabs button.active,
.draw-actions .gold-button {
  background: linear-gradient(120deg, var(--show-bright), var(--show-accent)) !important;
}
.result-slot.shown,
.draw-cell.out {
  background: var(--show-panel);
  border-color: var(--show-accent);
  color: var(--show-bright);
}
.webnav button.active {
  color: #bf1230;
  background: #fff0f1;
}
.tv-show {
  display: none;
}
.stage-shell.is-theater > .stage-top,
.stage-shell.is-theater > .stage-timing,
.stage-shell.is-theater > .keno-tabs,
.stage-shell.is-theater > .stage-body,
.stage-shell.is-theater > .stage-status {
  display: none !important;
}
.stage-shell.is-theater {
  padding: 0 !important;
  overflow: hidden !important;
  background: var(--show-bg) !important;
}
.stage-shell.is-theater:before,
.stage-shell.is-theater:after {
  display: none;
}
.is-theater .tv-show {
  display: flex;
  position: absolute;
  inset: 0;
  flex-direction: column;
  color: #fff5dc;
  font-family: Arial, sans-serif;
  background: radial-gradient(ellipse at 55% 30%, var(--show-panel), var(--show-bg) 75%);
  isolation: isolate;
}
.tv-backdrop {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: url('../img/keno-live/stage.png') center/100% 100%;
  opacity: 0.4;
  filter: hue-rotate(var(--show-hue));
  transition: filter 1s;
}
.tv-show:before {
  content: '';
  position: absolute;
  z-index: -2;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, transparent 30%, var(--show-bg) 95%);
}
.tv-glow {
  position: absolute;
  width: 48vw;
  height: 80vh;
  left: 26%;
  top: -30%;
  background: conic-gradient(from 170deg, transparent 0deg, var(--show-accent) 15deg, transparent 30deg);
  opacity: 0.13;
  filter: blur(20px);
  transform-origin: 50% 0;
  animation: tvLight 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}
.tv-top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 3vw;
  border-bottom: 1px solid #f6cf772e;
  background: #08071144;
  height: 80px;
  flex-shrink: 0;
}
.tv-brand {
  background: white;
  border-radius: 7px;
  padding: 5px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tv-brand img {
  width: 100px;
  height: 26px;
}
.tv-brand small {
  font-size: 8px;
  letter-spacing: 4px;
  color: #142847;
}
.tv-series {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--show-accent);
}
.tv-series strong {
  display: block;
  letter-spacing: 0;
  font-size: 16px;
  color: #fff3d6;
  margin-top: 4px;
}
.tv-round {
  margin-left: auto;
  text-align: right;
  font-size: 12px;
  color: #ddc5a4;
}
.tv-round b {
  display: block;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  color: var(--show-bright);
}
.tv-top button,
.tv-controls button {
  color: #ffefd2;
  background: #ffffff0b;
  border: 1px solid #ffffff25;
  padding: 9px 13px;
  font-size: 13px;
  border-radius: 9px;
}
.tv-main {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 3vw;
  overflow: hidden;
}
.tv-scene {
  position: absolute;
  inset: 0;
  display: none;
  padding: 22px 0;
}
.tv-scene.active {
  display: flex;
  animation: tvScene 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tv-intro {
  align-items: center;
  justify-content: center;
  gap: 4vw;
}
.tv-intro-art {
  width: min(34vw, 470px);
  height: min(65vh, 530px);
  filter: drop-shadow(0 25px 30px #0007);
  animation: tvFloat 6s ease-in-out infinite;
}
.tv-intro-copy {
  max-width: 54%;
  position: relative;
}
.tv-eyebrow {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--show-accent);
  text-transform: uppercase;
}
.tv-intro h2 {
  font-size: clamp(65px, 10vw, 160px);
  line-height: 0.92;
  letter-spacing: -7px;
  margin: 22px 0;
  color: var(--show-bright);
  font-style: italic;
  text-shadow:
    0 5px 0 #0003,
    0 0 60px #ffc65b22;
}
.tv-intro h3 {
  font-size: clamp(22px, 3vw, 42px);
  margin: 0 0 14px;
  font-weight: 500;
}
.tv-intro p {
  color: #e4cbbb;
  font-size: 16px;
  max-width: 460px;
  line-height: 1.65;
}
.tv-facts {
  display: flex;
  gap: 35px;
  margin-top: 30px;
}
.tv-facts b {
  display: block;
  color: var(--show-accent);
  font-size: 32px;
}
.tv-facts span {
  font-size: 12px;
  color: #cfbba9;
}
.tv-draw {
  display: none;
  gap: 3vw;
}
.tv-host {
  width: 25%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.tv-host-art {
  width: 90%;
  height: 28vh;
  animation: tvFloat 5s ease-in-out infinite;
}
.tv-host-name {
  font-size: 15px;
  color: var(--show-accent);
  text-align: center;
  margin-top: 0;
}
.tv-ball {
  width: clamp(90px, 12vw, 190px);
  height: clamp(90px, 12vw, 190px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #fffef1, var(--show-bright) 18%, var(--show-accent) 57%, #a96524);
  color: #52290e;
  display: grid;
  place-items: center;
  font-size: clamp(44px, 6vw, 90px);
  font-weight: 800;
  box-shadow:
    inset -9px -14px 25px #8f4a1255,
    0 20px 36px #0007,
    0 0 60px #edbb4c22;
  border: 2px solid #fff0aa;
  margin: 10px 0;
  position: relative;
}
.tv-ball.bounce {
  animation: tvBounce 0.85s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.tv-host-count {
  font-size: 13px;
  color: #d5bd9f;
  letter-spacing: 2px;
}
.tv-board-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.tv-board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tv-board-title h3 {
  font-size: 24px;
  margin: 0;
}
.tv-board-title span {
  font-size: 13px;
  color: var(--show-accent);
}
.tv-number-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(5px, 0.8vw, 13px);
}
.tv-number {
  height: clamp(24px, 5.6vh, 70px);
  display: grid;
  place-items: center;
  border: 1px solid #ffce6b30;
  border-radius: 12px;
  background: #ffffff06;
  font-size: clamp(13px, 1.65vw, 27px);
  font-weight: 600;
  color: #b99782;
  transition:
    background 0.3s,
    color 0.3s;
}
.tv-number.out {
  background: linear-gradient(145deg, var(--show-bright), var(--show-accent));
  color: #482718;
  border-color: #fff0bc;
  box-shadow: 0 3px 12px #0002;
}
.tv-number.latest {
  animation: tvLand 0.7s ease-out;
  box-shadow:
    0 0 0 3px #fff5,
    0 0 22px var(--show-accent);
}
.tv-number.matched {
  outline: 3px solid white;
  outline-offset: 2px;
}
.tv-ribbon {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  min-height: 32px;
}
.tv-ribbon span {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1;
  max-height: 40px;
  border-radius: 50%;
  background: #ffffff12;
  color: var(--show-bright);
  display: grid;
  place-items: center;
  font-size: clamp(10px, 1vw, 18px);
}
.tv-ribbon span.lit {
  background: var(--show-panel);
  border: 1px solid var(--show-accent);
}
.tv-splits {
  display: flex;
  gap: 16px;
  font-size: 14px;
  border-top: 1px solid #ffffff1c;
  padding-top: 12px;
}
.tv-splits b {
  color: var(--show-accent);
  margin-left: 7px;
}
.tv-splits small {
  margin-left: auto;
  font-size: 12px;
  color: #cab8a5;
}
.tv-stats,
.tv-trends {
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.tv-scene-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.tv-scene-title h2 {
  font-size: clamp(23px, 3vw, 43px);
  margin: 6px 0;
}
.tv-scene-title p {
  font-size: 13px;
  color: #cebca4;
}
.tv-stat-row {
  display: grid;
  grid-template-columns: 170px repeat(10, minmax(0, 1fr));
  align-items: center;
  gap: 14px;
  border-top: 1px solid #ffffff18;
  padding: 15px 0;
}
.tv-stat-row > div:first-child {
  font-size: 16px;
  color: var(--show-bright);
}
.tv-stat-row small {
  display: block;
  color: #c5af98;
  font-size: 12px;
  margin-top: 6px;
}
.tv-stat-item {
  text-align: center;
}
.tv-stat-item b {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: clamp(30px, 4.3vw, 68px);
  aspect-ratio: 1;
  margin: auto;
  background: linear-gradient(135deg, var(--show-bright), var(--show-accent));
  color: #4b2a13;
  font-size: clamp(15px, 1.7vw, 26px);
  box-shadow: 0 8px 20px #0003;
  animation: tvStatIn 0.6s both;
  animation-delay: calc(var(--i) * 0.06s);
}
.tv-stat-item small {
  font-size: 13px;
}
.tv-stat-row.cool .tv-stat-item b {
  background: linear-gradient(#fffaf0, #b9a998);
  color: #37281a;
}
.tv-trend-card {
  border: 1px solid #e7c06d26;
  border-radius: 18px;
  background: #10060e44;
  padding: 15px 24px;
  flex: 1;
  min-height: 0;
}
.tv-trend-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
}
.tv-trend-label small {
  font-size: 12px;
  color: #c9b4a1;
}
.tv-trend-card svg {
  width: 100%;
  height: calc(100% - 28px);
  min-height: 90px;
  overflow: visible;
}
.tv-trend-card text {
  font-family: Arial;
  font-size: 13px;
}
.tv-trend-card polyline {
  stroke-dasharray: 1800;
  animation: tvLine 2s ease-out;
}
.tv-notice {
  font-size: 12px;
  color: #cab6a0;
  text-align: center;
}
.tv-controls {
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 3vw;
  border-top: 1px solid #edc76d30;
  background: #0c070c99;
}
.tv-controls .tv-dots {
  display: flex;
  gap: 5px;
  margin: auto;
}
.tv-dots button {
  padding: 8px 14px;
  opacity: 0.65;
}
.tv-dots button.active {
  background: var(--show-accent);
  color: #382014;
  opacity: 1;
  border-color: var(--show-accent);
}
.tv-music-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}
.tv-music-wrap input {
  width: 65px;
  accent-color: var(--show-accent);
}
.tv-progress {
  position: absolute;
  bottom: 70px;
  left: 0;
  height: 2px;
  background: var(--show-accent);
  transition: width 0.5s linear;
}
.tv-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}
.tv-particles i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--show-accent);
  bottom: -5%;
  left: var(--x);
  animation: tvParticle var(--d) linear infinite;
  animation-delay: var(--delay);
  box-shadow: 0 0 10px var(--show-accent);
}
.tv-status {
  font-size: 11px;
  color: #cbb49c;
}
.tv-flight {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, white, var(--show-accent) 65%, #a16124);
  color: #4b2b10;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 0 26px var(--show-accent);
}
.tv-curtain {
  position: absolute;
  inset: 80px 0 70px;
  z-index: 20;
  pointer-events: none;
  display: flex;
  overflow: hidden;
}
.tv-curtain i {
  width: 50%;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--show-bg), var(--show-panel) 7%, var(--show-bg) 13%);
  border-bottom: 3px solid var(--show-accent);
  transform: translateX(-102%);
}
.tv-curtain i:last-child {
  transform: translateX(102%);
}
.tv-curtain.opening i {
  animation: tvCurtainLeft 1.6s ease-in-out;
}
.tv-curtain.opening i:last-child {
  animation-name: tvCurtainRight;
}
.tv-show.paused-motion * {
  animation-play-state: paused !important;
}
@keyframes tvFloat {
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}
@keyframes tvLight {
  to {
    transform: rotate(35deg);
  }
}
@keyframes tvScene {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes tvBounce {
  0% {
    transform: translateY(-100px) scale(0.65);
    opacity: 0;
  }
  45% {
    transform: translateY(10px) scale(1.04, 0.92);
    opacity: 1;
  }
  70% {
    transform: translateY(-14px) scale(0.98, 1.04);
  }
  100% {
    transform: none;
  }
}
@keyframes tvLand {
  0% {
    transform: scale(0.65);
  }
  65% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes tvStatIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes tvLine {
  from {
    stroke-dashoffset: 1800;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes tvParticle {
  to {
    transform: translate(70px, -100vh);
    opacity: 0;
  }
}
@keyframes tvCurtainLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-102%);
  }
}
@keyframes tvCurtainRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(102%);
  }
}
@media (max-height: 700px) {
  .tv-top {
    height: 62px;
    padding: 10px 3vw;
  }
  .tv-controls {
    height: 55px;
    padding: 7px 3vw;
  }
  .tv-progress {
    bottom: 55px;
  }
  .tv-scene {
    padding: 12px 0;
  }
  .tv-stat-row {
    padding: 9px 0;
  }
  .tv-stat-item b {
    width: 40px;
  }
  .tv-host-art {
    height: 23vh;
  }
  .tv-number {
    height: 5.2vh;
  }
  .tv-curtain {
    inset: 62px 0 55px;
  }
  .tv-intro-art {
    height: 65vh;
  }
  .tv-intro h2 {
    font-size: 100px;
  }
  .tv-facts {
    margin-top: 12px;
  }
  .tv-trend-card {
    padding: 8px 20px;
  }
  .tv-trends {
    gap: 10px;
  }
  .tv-scene-title h2 {
    font-size: 26px;
  }
}
@media (max-width: 700px) and (orientation: portrait) {
  .tv-top {
    gap: 10px;
    height: 70px;
    padding: 10px;
  }
  .tv-brand img {
    width: 70px;
    height: 20px;
  }
  .tv-brand small {
    font-size: 6px;
  }
  .tv-series {
    display: none;
  }
  .tv-round b {
    font-size: 23px;
  }
  .tv-top button {
    padding: 8px;
    font-size: 11px;
  }
  .tv-intro {
    flex-direction: column;
    gap: 0;
  }
  .tv-intro-art {
    width: 65vw;
    height: 32vh;
  }
  .tv-intro-copy {
    max-width: 95%;
    text-align: center;
  }
  .tv-intro h2 {
    font-size: 80px;
    letter-spacing: -4px;
    margin: 12px 0;
  }
  .tv-intro h3 {
    font-size: 23px;
  }
  .tv-intro p {
    font-size: 13px;
  }
  .tv-facts {
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
  }
  .tv-facts b {
    font-size: 25px;
  }
  .tv-draw {
    flex-direction: column;
    gap: 8px;
  }
  .tv-host {
    width: 100%;
    height: 100px;
    flex-direction: row;
    gap: 15px;
  }
  .tv-host-art {
    width: 85px;
    height: 100px;
  }
  .tv-host-name {
    display: none;
  }
  .tv-ball {
    width: 75px;
    height: 75px;
    font-size: 36px;
  }
  .tv-host-count {
    font-size: 11px;
  }
  .tv-number-grid {
    gap: 5px;
  }
  .tv-number {
    height: 4vh;
    border-radius: 7px;
    font-size: 13px;
  }
  .tv-board-title h3 {
    font-size: 19px;
  }
  .tv-board-title span {
    font-size: 10px;
  }
  .tv-ribbon {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    margin-top: 0;
  }
  .tv-splits {
    gap: 10px;
    font-size: 11px;
    flex-wrap: wrap;
  }
  .tv-splits small {
    width: 100%;
  }
  .tv-controls {
    height: 106px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 8px;
  }
  .tv-controls .tv-dots {
    order: -1;
    width: 100%;
    justify-content: center;
  }
  .tv-dots button {
    font-size: 11px;
    padding: 6px 9px;
  }
  .tv-controls button {
    font-size: 11px;
    padding: 7px;
  }
  .tv-music-wrap input {
    width: 45px;
  }
  .tv-progress {
    bottom: 106px;
  }
  .tv-status {
    display: none;
  }
  .tv-curtain {
    inset: 70px 0 106px;
  }
  .tv-stat-row {
    grid-template-columns: repeat(5, 1fr);
    gap: 9px;
    padding: 9px 0;
  }
  .tv-stat-row > div:first-child {
    grid-column: 1/-1;
    font-size: 13px;
  }
  .tv-stat-row > div:first-child small {
    display: inline;
    margin-left: 10px;
  }
  .tv-stat-row:nth-last-child(1) {
    display: none;
  }
  .tv-stat-item b {
    width: 32px;
    font-size: 14px;
  }
  .tv-stat-item small {
    font-size: 10px;
    margin-top: 3px;
  }
  .tv-scene-title h2 {
    font-size: 24px;
  }
  .tv-scene-title p {
    display: none;
  }
  .tv-trend-card {
    padding: 12px 8px;
  }
  .tv-trend-label {
    font-size: 13px;
  }
  .tv-trend-label small {
    font-size: 10px;
  }
  .tv-notice {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tv-show * {
    animation: none !important;
    transition: none !important;
  }
}
.tv-summary {
  align-items: center;
  gap: 4vw;
}
.tv-summary-host {
  width: 27%;
  height: 55vh;
}
.tv-summary-content {
  flex: 1;
  min-width: 0;
}
.tv-summary h2 {
  font-size: clamp(24px, 3.4vw, 54px);
  margin: 8px 0 25px;
}
.tv-summary-balls {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 14px;
}
.tv-summary-balls b {
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 25% 20%, #fffce4, var(--show-bright) 20%, var(--show-accent) 70%, #b57937);
  color: #442716;
  font-size: clamp(15px, 2vw, 32px);
  box-shadow: 0 8px 16px #0004;
  animation: tvLand 0.7s both;
  animation-delay: calc(var(--i) * 0.045s);
}
.tv-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 30px 0 18px;
}
.tv-summary-metrics > div {
  padding: 15px;
  background: #ffffff08;
  border: 1px solid #ffffff17;
  border-radius: 12px;
  color: #cab79c;
  font-size: 14px;
}
.tv-summary-metrics b {
  display: block;
  color: var(--show-bright);
  font-size: 32px;
  margin-top: 8px;
}
.tv-segment {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  border: 1px solid #ffffff0c;
  border-radius: 50%;
  aspect-ratio: 1;
  pointer-events: none;
}
.tv-host.perform .tv-host-art {
  animation: tvHostPerform 0.8s ease-in-out;
}
.tv-show[data-motion='leap'] .tv-host.perform .tv-host-art {
  animation: tvHostLeap 0.8s ease-in-out;
}
.tv-show[data-motion='flutter'] .tv-host.perform .tv-host-art {
  animation: tvHostFlutter 0.8s ease-in-out;
}
.tv-show[data-motion='bloom'] .tv-host.perform .tv-host-art {
  animation: tvHostBloom 0.8s ease-in-out;
}
.tv-show[data-motion='roll'] .tv-host.perform .tv-host-art {
  animation: tvHostRoll 0.8s ease-in-out;
}
.tv-spot {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  border: 1px solid var(--show-accent);
  border-radius: 50%;
  z-index: 12;
  box-shadow: 0 0 20px var(--show-accent);
}
.tv-audio-dialog {
  background: var(--show-bg);
  color: #fff0d1;
  border: 1px solid var(--show-accent);
  border-radius: 20px;
  max-width: 430px;
  width: 90%;
  padding: 25px;
}
.tv-audio-dialog::backdrop {
  background: #000a;
}
.tv-audio-dialog h3 {
  margin-top: 0;
}
.tv-audio-dialog p {
  font-size: 13px;
  color: #cbb69e;
}
.tv-audio-dialog button {
  display: block;
  width: 100%;
  margin: 12px 0;
  background: var(--show-panel);
  color: var(--show-bright);
  border-color: #ffffff27;
}
.tv-audio-dialog small {
  display: block;
  font-size: 11px;
  opacity: 0.7;
}
.tv-dots button {
  font-size: 12px;
  padding: 8px 10px;
}
.tv-top,
.tv-controls {
  transition: opacity 0.5s;
}
.tv-show.cinema-idle .tv-controls {
  opacity: 0.15;
}
.tv-show.cinema-idle .tv-controls:hover,
.tv-show.cinema-idle .tv-controls:focus-within {
  opacity: 1;
}
.tv-show.cinema-idle #tvTheme,
.tv-show.cinema-idle #tvExit {
  opacity: 0.3;
}
.tv-show.cinema-idle .tv-top:hover button {
  opacity: 1;
}
.tv-host .art {
  transform-origin: center 85%;
}
@keyframes tvHostPerform {
  40% {
    transform: translateY(9px) rotate(-4deg);
  }
  70% {
    transform: translateY(-7px) rotate(3deg);
  }
}
@keyframes tvHostLeap {
  45% {
    transform: translateY(-45px) rotate(-14deg);
  }
  80% {
    transform: translateY(5px) rotate(4deg);
  }
}
@keyframes tvHostFlutter {
  25%,
  65% {
    transform: translateY(-15px) rotate(-5deg);
  }
  45%,
  85% {
    transform: translateY(-8px) rotate(5deg);
  }
}
@keyframes tvHostBloom {
  50% {
    transform: scale(1.12) rotate(10deg);
    filter: drop-shadow(0 0 25px var(--show-accent));
  }
}
@keyframes tvHostRoll {
  45% {
    transform: translateX(16px) rotate(8deg);
  }
  75% {
    transform: translateX(-5px) rotate(-3deg);
  }
}
@media (max-width: 700px) and (orientation: portrait) {
  .tv-summary {
    flex-direction: column;
    gap: 5px;
    justify-content: center;
  }
  .tv-summary-host {
    height: 22vh;
    width: 45vw;
  }
  .tv-summary-content {
    flex: 0;
    width: 100%;
  }
  .tv-summary h2 {
    font-size: 24px;
    margin: 8px 0 15px;
  }
  .tv-summary-balls {
    gap: 7px;
    grid-template-columns: repeat(5, 1fr);
    max-width: 330px;
    margin: auto;
  }
  .tv-summary-balls b {
    max-height: 45px;
  }
  .tv-summary-metrics {
    gap: 5px;
    margin: 15px 0;
  }
  .tv-summary-metrics > div {
    padding: 8px;
    font-size: 11px;
  }
  .tv-summary-metrics b {
    font-size: 22px;
  }
  .tv-dots button {
    padding: 6px;
    font-size: 10px;
  }
  .tv-controls {
    height: 110px;
  }
  .tv-progress {
    bottom: 110px;
  }
}

/* single-screen.css */
/* One stable, high contrast Keno viewing surface. */
.heading,
.layout > .scene,
.layout > .side,
.subgrid,
.storystrip,
.bottom,
main > footer {
  display: none !important;
}
.layout,
.layout.choosing {
  display: block !important;
}
main {
  max-width: 1800px;
  padding: 18px 24px;
}
.stage-shell {
  height: calc(100vh - 112px);
  min-height: 580px;
  max-height: 1000px;
  border-radius: 16px;
  border: 1px solid #b75058;
  position: relative;
  padding: 0 !important;
  overflow: hidden !important;
}
.stage-shell > .stage-top,
.stage-shell > .stage-timing,
.stage-shell > .keno-tabs,
.stage-shell > .stage-body,
.stage-shell > .stage-status {
  display: none !important;
}
.stage-shell:before,
.stage-shell:after {
  display: none !important;
}
.stage-shell .tv-show {
  display: flex;
  position: absolute;
  inset: 0;
  flex-direction: column;
  color: #fff;
  font-family: Arial, sans-serif;
  background: var(--show-bg);
  isolation: isolate;
}
.tv-show:before {
  display: none;
}
.tv-backdrop {
  opacity: 0.07;
  background-size: cover;
}
.tv-glow,
.tv-particles,
.tv-curtain,
.tv-segment,
.tv-progress {
  display: none !important;
}
.tv-top {
  height: 72px;
  background: var(--show-panel);
  padding: 10px 24px;
  border-bottom: 1px solid #ffffff25;
  gap: 20px;
}
.tv-series {
  color: #ffe4a0;
  letter-spacing: 1px;
  font-size: 12px;
}
.tv-series strong {
  font-size: 18px;
}
.tv-round {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: right;
}
.tv-round b {
  font-size: 34px;
  color: #fff3c2;
}
.tv-round > span {
  max-width: 170px;
  font-size: 12px;
  line-height: 1.5;
}
.tv-top button {
  background: #ffffff10;
  border-color: #ffffff40;
  font-size: 14px;
}
.tv-main {
  margin: 0;
  overflow: hidden;
}
.tv-scene {
  display: none !important;
}
.tv-scene.tv-draw {
  display: grid !important;
  grid-template-columns: 23% minmax(0, 1fr);
  gap: 24px;
  padding: 22px 26px 12px;
  animation: none !important;
}
.tv-host {
  width: 100%;
  justify-content: flex-start;
  padding: 15px 10px;
  background: #ffffff05;
  border: 1px solid #ffffff20;
  border-radius: 15px;
  overflow: hidden;
}
.tv-host-art {
  height: clamp(90px, 19vh, 240px);
  width: 80%;
  flex-shrink: 0;
  animation: none;
}
.tv-host-name {
  font-size: 16px;
  color: var(--show-bright);
  margin: 4px 0 8px;
}
.tv-ball {
  width: clamp(95px, 12vh, 170px);
  height: clamp(95px, 12vh, 170px);
  font-size: clamp(46px, 6vh, 75px);
  margin: 8px 0;
  flex-shrink: 0;
  box-shadow:
    inset -8px -10px 22px #8f4a1233,
    0 8px 20px #0003;
}
.tv-host-count {
  font-size: 13px;
  color: #ebd2b8;
  letter-spacing: 1px;
  margin-top: 8px;
}
.tv-board-area {
  justify-content: flex-start;
  gap: 12px;
}
.tv-board-title h3 {
  font-size: 23px;
  color: white;
}
.tv-board-title span {
  font-size: 14px;
  color: #f4dfb1;
}
.tv-number-grid {
  flex: 1;
  min-height: 0;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 7px;
}
.tv-number {
  height: auto;
  min-height: 28px;
  border-radius: 8px;
  background: #ffffff0b;
  color: #eee1d8;
  font-size: clamp(17px, 2.15vh, 30px);
  border: 1px solid #ffffff26;
  box-shadow: none;
}
.tv-number.out {
  background: var(--show-bright);
  border-color: var(--show-bright);
  color: #442510;
  box-shadow: none;
}
.tv-number.latest {
  outline: 3px solid white;
  outline-offset: 1px;
  background: var(--show-accent);
  box-shadow: none;
}
.tv-ribbon {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  min-height: 34px;
  gap: 5px;
  margin: 0;
}
.tv-ribbon span {
  aspect-ratio: 1;
  border-radius: 6px;
  max-height: 38px;
  font-size: 14px;
  background: #ffffff09;
  border: 1px solid #ffffff22;
  color: #ddd;
}
.tv-ribbon span.lit {
  background: var(--show-panel);
  color: #fff4d2;
  border-color: #c9985a;
}
.tv-splits {
  font-size: 14px;
  padding-top: 8px;
  gap: 22px;
  border-color: #ffffff25;
}
.tv-splits b {
  font-size: 18px;
  color: #ffe5a0;
}
.tv-splits small {
  font-size: 11px;
  align-self: center;
}
.tv-controls {
  height: 56px;
  padding: 8px 24px;
  background: #100a0ddd;
  border-top: 1px solid #ffffff22;
  gap: 12px;
  opacity: 1 !important;
}
.tv-controls .tv-dots {
  display: none !important;
}
.tv-controls button {
  font-size: 13px;
  background: #ffffff0d;
  border-color: #ffffff35;
  padding: 7px 12px;
}
.tv-music-wrap {
  margin-right: auto;
}
.tv-status {
  font-size: 11px;
  color: #dcc5b3;
}
.tv-show.cinema-idle #tvTheme,
.tv-show.cinema-idle #tvExit {
  opacity: 1;
}
.single-insights {
  margin-top: auto;
  width: 100%;
  border-top: 1px solid #ffffff26;
  padding-top: 12px;
}
.single-insights h4 {
  font-size: 13px;
  margin: 0 0 10px;
  color: #edd4b6;
  font-weight: 500;
}
.single-hot {
  display: flex;
  gap: 6px;
}
.single-hot > div {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.single-hot b {
  display: block;
  background: #ffffff10;
  border: 1px solid #ffffff30;
  padding: 7px 0;
  border-radius: 7px;
  font-size: 16px;
  color: #fff3c7;
}
.single-hot small {
  display: block;
  color: #dcc8b5;
  font-size: 10px;
  margin-top: 5px;
}
.single-footnote {
  font-size: 10px;
  color: #cdbbab;
  line-height: 1.4;
  margin-top: 10px;
}
.webnav {
  display: none;
}
.tv-brand {
  display: none;
}
.tv-series {
  margin-right: auto;
}
.is-theater .tv-brand {
  display: flex;
}
.is-theater {
  max-height: none !important;
  height: 100vh !important;
  min-height: 0 !important;
  border-radius: 0 !important;
}
.is-theater .tv-host-art {
  height: 24vh;
}
.is-theater .tv-ball {
  width: 16vh;
  height: 16vh;
  font-size: 8vh;
}
.is-theater .tv-number {
  font-size: clamp(18px, 3vh, 42px);
}
.is-theater .tv-ribbon span {
  font-size: 17px;
  max-height: 46px;
}
.is-theater .tv-host-name {
  font-size: 19px;
}
.is-theater .tv-splits {
  font-size: 18px;
}
.is-theater .tv-host-count {
  font-size: 16px;
}
.is-theater .single-hot b {
  font-size: 22px;
}
.is-theater .single-insights h4 {
  font-size: 15px;
}
.is-theater .single-hot small {
  font-size: 12px;
}
@media (max-width: 1000px) {
  main {
    padding: 12px;
  }
  .stage-shell {
    height: calc(100vh - 100px);
    min-height: 520px;
  }
  .tv-scene.tv-draw {
    gap: 14px;
    padding: 16px;
  }
  .tv-top {
    padding: 10px 16px;
    gap: 10px;
  }
  .tv-series {
    font-size: 10px;
  }
  .tv-series strong {
    font-size: 15px;
  }
  .tv-top button {
    font-size: 12px;
    padding: 8px;
  }
  .tv-round b {
    font-size: 28px;
  }
  .tv-round > span {
    font-size: 10px;
  }
  .tv-host {
    padding: 10px 6px;
  }
  .tv-host-name {
    font-size: 12px;
  }
  .tv-ribbon {
    gap: 3px;
  }
  .tv-ribbon span {
    font-size: 11px;
  }
  .tv-number-grid {
    gap: 5px;
  }
  .single-hot {
    gap: 3px;
  }
  .single-hot b {
    font-size: 13px;
  }
  .tv-splits {
    gap: 10px;
    font-size: 12px;
  }
  .tv-splits small {
    display: none;
  }
  .tv-status {
    display: none;
  }
  .tv-controls {
    padding: 8px 16px;
  }
  .tv-board-title h3 {
    font-size: 19px;
  }
  .tv-board-title span {
    font-size: 12px;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  main {
    padding: 8px;
  }
  .stage-shell {
    min-height: 620px;
    height: calc(100svh - 90px);
    overflow: auto !important;
  }
  .tv-top {
    height: 62px;
    flex-wrap: nowrap;
    padding: 8px;
    gap: 6px;
  }
  .tv-series {
    display: none;
  }
  .tv-round {
    margin-left: 0;
    margin-right: auto;
    gap: 6px;
  }
  .tv-round > span {
    max-width: 100px;
  }
  .tv-top button {
    padding: 7px;
    font-size: 10px;
  }
  .tv-scene.tv-draw {
    grid-template-columns: 1fr;
    grid-template-rows: 95px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
  .tv-host {
    height: 95px;
    flex-direction: row;
    justify-content: space-around;
    padding: 4px;
    gap: 5px;
    overflow: visible;
  }
  .tv-host-art,
  .is-theater .tv-host-art {
    width: 75px;
    height: 85px;
  }
  .tv-host-name {
    display: none;
  }
  .tv-ball,
  .is-theater .tv-ball {
    width: 72px;
    height: 72px;
    font-size: 35px;
    margin: 0;
  }
  .tv-host-count,
  .is-theater .tv-host-count {
    font-size: 10px;
    letter-spacing: 0;
    max-width: 60px;
    line-height: 1.5;
  }
  .single-insights {
    display: none;
  }
  .tv-number-grid {
    gap: 4px;
  }
  .tv-number,
  .is-theater .tv-number {
    font-size: 14px;
    min-height: 22px;
  }
  .tv-board-title h3 {
    font-size: 16px;
  }
  .tv-board-title span {
    font-size: 11px;
  }
  .tv-ribbon {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    min-height: 45px;
    gap: 3px;
  }
  .tv-ribbon span,
  .is-theater .tv-ribbon span {
    aspect-ratio: auto;
    height: 23px;
    font-size: 11px;
  }
  .tv-splits,
  .is-theater .tv-splits {
    font-size: 11px;
    gap: 14px;
    padding-top: 3px;
  }
  .tv-splits b {
    font-size: 13px;
  }
  .tv-controls {
    height: 48px;
    flex-wrap: nowrap;
    padding: 6px;
    gap: 5px;
  }
  .tv-controls button {
    font-size: 10px;
    padding: 6px;
  }
  .tv-music-wrap {
    gap: 4px;
  }
  .tv-music-wrap input {
    width: 40px;
  }
  .tv-board-area {
    gap: 7px;
  }
  .tv-main {
    min-height: 490px;
  }
  .is-theater .tv-brand {
    display: none;
  }
}
@media (max-height: 650px) and (orientation: landscape) {
  .tv-top {
    height: 52px;
  }
  .tv-controls {
    height: 44px;
  }
  .tv-scene.tv-draw {
    padding: 10px 18px;
    gap: 16px;
  }
  .tv-host-art,
  .is-theater .tv-host-art {
    height: 18vh;
  }
  .tv-ball,
  .is-theater .tv-ball {
    width: 17vh;
    height: 17vh;
    font-size: 8vh;
  }
  .tv-number {
    min-height: 20px;
  }
  .tv-number-grid {
    gap: 4px;
  }
  .tv-ribbon {
    min-height: 25px;
  }
  .tv-ribbon span {
    height: 25px;
    aspect-ratio: auto;
  }
  .tv-board-title h3 {
    font-size: 18px;
  }
  .tv-board-area {
    gap: 6px;
  }
  .single-insights {
    padding-top: 6px;
  }
  .single-insights h4 {
    font-size: 11px;
    margin-bottom: 5px;
  }
  .single-hot b {
    font-size: 13px;
    padding: 4px;
  }
  .single-footnote {
    display: none;
  }
}
.tv-host-art {
  width: clamp(90px, 19vh, 240px);
}
.is-theater .tv-host-art {
  width: 24vh;
}
.single-rhythm {
  width: 100%;
  margin: auto 0 12px;
}
.single-rhythm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
}
.single-rhythm-row > span {
  font-size: 10px;
  color: #ddc9b1;
  min-width: 42px;
}
.single-rhythm-row > div {
  display: flex;
  gap: 4px;
  flex: 1;
  height: 34px;
  align-items: stretch;
}
.single-rhythm-row i {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 3px;
  overflow: hidden;
  background: #ffffff20;
}
.single-rhythm-row b {
  display: block;
  background: var(--show-accent);
}
.single-rhythm-label {
  font-size: 10px;
  color: #cfbca9;
  margin-top: 8px;
}
.single-insights {
  margin-top: 0;
}
.single-footnote {
  margin-bottom: 4px;
}
@media (max-height: 700px) {
  .single-rhythm {
    display: none;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .single-rhythm {
    display: none;
  }
  .tv-host-art,
  .is-theater .tv-host-art {
    width: 75px;
  }
}

/* analysis-restore.css */
main {
  max-width: 1900px;
}
.layout,
.layout.choosing {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.layout > .side {
  display: block !important;
  grid-column: auto;
}
.layout > .side .data {
  display: block;
  padding: 20px;
  background: #151922 !important;
  border-color: #353b45 !important;
  color: #f7f4ed;
}
.stage-shell {
  height: 760px;
  min-height: 640px;
  max-height: none;
}
.side .metric {
  background: #212630;
  border-color: #41434a;
}
.side .muted,
.side .legend {
  color: #b8b9bc;
}
.side .data h3 {
  font-size: 19px;
}
.analysis-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
.analysis-workspace > .scene {
  display: flex !important;
  position: relative;
  top: 0;
  min-height: 490px;
}
.analysis-workspace > .board {
  display: block !important;
  padding: 22px;
}
.analysis-workspace > .keno-pane {
  display: block !important;
  padding: 20px;
  border: 1px solid #ffffff24;
  border-radius: 20px;
  background: #141922;
  max-height: 650px;
  overflow: auto;
}
.analysis-workspace .grid {
  margin: 15px 0;
  gap: 6px;
}
.analysis-workspace .num {
  background: #ffffff0c;
  color: #f9f2e5;
  border-color: #ffffff35;
}
.analysis-workspace .num.selected {
  background: var(--show-bright);
  color: #35240d;
}
.analysis-workspace .mascot {
  height: 220px;
}
.analysis-workspace .scenehead h2 {
  font-family: Arial;
  font-size: 22px;
}
.analysis-workspace .speech {
  background: #0003;
  color: #ecdfca;
}
.analysis-workspace .scenefoot {
  padding: 0 16px 16px;
}
.analysis-workspace .primary {
  background: var(--show-accent);
  color: #3d2512;
}
.analysis-workspace .history-head {
  flex-wrap: wrap;
}
.analysis-workspace .history-head h3 {
  margin: 0;
}
.analysis-workspace .history-item {
  background: #202631;
  color: #fff0cc;
  border-color: #414751;
}
.analysis-workspace .history-item span {
  line-height: 1.7;
  font-size: 12px;
}
.analysis-title {
  font-size: 20px;
  margin: 25px 0 0;
  color: #fff0dc;
}
.subgrid {
  display: grid !important;
  grid-template-columns: 1fr 0.8fr 1.3fr;
  margin-top: 18px;
}
.subgrid .card {
  background: #151922 !important;
  color: white;
  border-color: #353b45 !important;
}
.bottom {
  display: flex !important;
}
.storystrip {
  display: block !important;
}
.rules-restored {
  margin: 18px 0;
}
.rules-restored > summary {
  cursor: pointer;
  background: #151922;
  color: #f6e5ce;
  border: 1px solid #ffffff22;
  padding: 15px 20px;
  border-radius: 12px;
  font-weight: 600;
}
.rules-restored .keno-pane {
  display: block !important;
  padding: 20px;
}
.heading {
  display: flex !important;
  margin: 0 0 16px;
}
.heading .clock {
  display: none;
}
.heading h1 {
  font-size: 25px;
}
.heading p {
  color: #bcaeaa;
}
.heading .themeQuick {
  display: none;
}
.webnav {
  display: flex;
}
.webnav button {
  font-size: 13px;
}
.tv-host-name {
  font-size: 14px;
}
.tv-scene.tv-draw {
  grid-template-columns: 23% minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
}
.tv-number {
  font-size: 20px;
}
.tv-ribbon span {
  font-size: 11px;
}
.tv-top {
  gap: 10px;
  padding: 10px 18px;
}
.tv-top button {
  font-size: 12px;
  padding: 8px;
}
.tv-series strong {
  font-size: 16px;
}
.tv-round > span {
  font-size: 10px;
}
.tv-round b {
  font-size: 29px;
}
.tv-host-art {
  height: 160px;
  width: 160px;
  max-width: 100%;
  flex-shrink: 0;
}
.tv-host {
  padding: 12px 6px;
}
.single-rhythm-row > div {
  gap: 3px;
}
.single-hot b {
  font-size: 13px;
}
.tv-status {
  display: none;
}
.emission-number {
  position: fixed;
  pointer-events: none;
  z-index: 2147483646;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: bold 22px Arial;
  color: #432c13;
  background: radial-gradient(circle at 25% 20%, #fff, #fff2bb 20%, var(--show-accent) 70%, #a36c31);
  box-shadow:
    0 0 24px #e5bc6466,
    inset -3px -5px 9px #85522733;
}
.emission-number.pearl {
  background: radial-gradient(circle at 25% 20%, white, #f0ffff 25%, #b3ece8 65%, #61b5bc);
  color: #124e58;
  box-shadow: 0 0 25px #aefaff88;
}
.emission-number.jade {
  background: radial-gradient(circle at 25% 20%, #efffe9, #a7e8b1 35%, #4f9f79);
  color: #194c32;
}
.emission-ring {
  position: fixed;
  pointer-events: none;
  z-index: 2147483645;
  width: 22px;
  height: 22px;
  border: 2px solid var(--show-accent);
  border-radius: 50%;
}
.emission-caption {
  font-size: 11px;
  color: #e9d3b1;
  line-height: 1.5;
  text-align: center;
  min-height: 34px;
  margin: 6px 0;
  width: 95%;
}
.is-theater .tv-host-art {
  width: 24vh;
  height: 24vh;
}
.is-theater .tv-ribbon span {
  font-size: 17px;
}
.is-theater .tv-number {
  font-size: clamp(22px, 3vh, 42px);
}
.is-theater .emission-caption {
  font-size: 14px;
}
.data #scopeNote {
  font-size: 11px;
  line-height: 1.5;
}
.data .heat button {
  font-size: 11px;
}
.data .barrow {
  font-size: 12px;
}
@media (max-width: 1350px) {
  .layout,
  .layout.choosing {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
  }
  .stage-shell {
    height: 720px;
  }
  .tv-host-name {
    font-size: 12px;
  }
  .tv-series {
    display: none;
  }
  .tv-board-title h3 {
    font-size: 18px;
  }
  .tv-round {
    margin-left: 0;
    margin-right: auto;
  }
  .tv-splits {
    gap: 10px;
    font-size: 12px;
  }
  .tv-splits small {
    display: none;
  }
  .analysis-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .analysis-workspace > #historyPane {
    grid-column: 1/-1;
    max-height: 390px;
  }
  .tv-number {
    font-size: 17px;
  }
  .single-rhythm {
    display: none;
  }
  .tv-host-art {
    height: 125px;
    width: 125px;
  }
  .tv-ball {
    width: 90px;
    height: 90px;
    font-size: 44px;
  }
  .tv-controls {
    padding: 8px 12px;
    gap: 7px;
  }
  .tv-controls button {
    font-size: 11px;
  }
  .tv-music-wrap input {
    width: 45px;
  }
}
@media (max-width: 1000px) {
  .layout,
  .layout.choosing {
    grid-template-columns: 1fr;
  }
  .layout > .side {
    display: block !important;
  }
  .side .data {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .side .data > .row,
  .side .data > #scopeNote {
    grid-column: 1/-1;
  }
  .side .heatblock {
    grid-column: 2;
    grid-row: 2/5;
  }
  .stage-shell {
    height: 700px;
  }
  .subgrid {
    grid-template-columns: 1fr 1fr;
  }
  .subgrid > .card:last-child {
    grid-column: 1/-1;
  }
  .webnav {
    display: none;
  }
}
@media (max-width: 600px) {
  .heading {
    display: none !important;
  }
  .analysis-workspace {
    grid-template-columns: 1fr;
  }
  .analysis-workspace > .scene {
    min-height: 0;
  }
  .analysis-workspace .mascot {
    height: 200px;
  }
  .analysis-workspace > .scene .scenehead {
    padding-top: 15px;
  }
  .side .data {
    display: block !important;
  }
  .subgrid {
    grid-template-columns: 1fr;
  }
  .stage-shell {
    height: 670px;
    min-height: 620px;
  }
  .tv-scene.tv-draw {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }
  .tv-host-art,
  .is-theater .tv-host-art {
    width: 75px;
    height: 85px;
  }
  .emission-caption {
    display: none;
  }
  .tv-ball {
    width: 72px;
    height: 72px;
    font-size: 35px;
  }
  .tv-number {
    font-size: 14px;
  }
  .tv-controls button {
    font-size: 10px;
  }
  .tv-ribbon span {
    font-size: 11px;
  }
  .tv-series {
    display: none;
  }
  .tv-round b {
    font-size: 23px;
  }
  .tv-top {
    padding: 8px;
  }
  .tv-top button {
    font-size: 10px;
  }
  .tv-main {
    min-height: 490px;
  }
  .analysis-workspace > #historyPane {
    grid-column: auto;
  }
}
.analysis-workspace > .board {
  background: linear-gradient(140deg, var(--show-panel), var(--show-bg)) !important;
  border: 1px solid #d2ab6b88;
  box-shadow: 0 15px 40px #0002;
}
.selection-art-head {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #ffffff20;
  margin-bottom: 18px;
  padding-bottom: 15px;
}
.selection-art-head .selection-emblem {
  width: 65px;
  height: 65px;
  flex-shrink: 0;
}
.selection-art-head strong {
  display: block;
  color: #fff2c9;
  font-size: 19px;
}
.selection-art-head p {
  font-size: 12px;
  color: #dbc7ad;
  margin: 5px 0;
}
.analysis-workspace .num {
  position: relative;
  overflow: visible;
  border-radius: 12px;
  transition:
    background 0.3s,
    border-color 0.3s;
  isolation: isolate;
  min-height: 42px;
}
.analysis-workspace .num > b {
  position: relative;
  z-index: 2;
  font-size: 16px;
}
.cell-emblem {
  position: absolute;
  width: 30px;
  height: 30px;
  right: -6px;
  top: -10px;
  z-index: 3;
  filter: drop-shadow(0 2px 3px #0004);
  pointer-events: none;
}
.cell-emblem .art {
  height: 100%;
  width: 100%;
}
.analysis-workspace .num.selected {
  background: linear-gradient(135deg, #fffbe5, var(--show-bright) 60%, var(--show-accent));
  color: #432a15;
  border: 1px solid #ffe7a6;
  box-shadow:
    0 4px 0 #92663388,
    0 0 14px #e3be5422;
}
.analysis-workspace .num.selected:before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 15px;
  border: 1px solid #ffeab533;
  pointer-events: none;
}
.selected-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(130deg, #ffffff15, #ffffff05) !important;
  border: 1px solid #efd19b77 !important;
  border-radius: 13px;
  padding: 7px 11px !important;
  color: #fff2cf;
  min-width: 76px;
}
.selected-tile .tile-mascot {
  width: 32px;
  height: 38px;
  display: block;
}
.selected-tile .tile-number {
  font-weight: 800;
  font-size: 23px;
  line-height: 1;
}
.selected-tile .tile-number small {
  display: block;
  font-weight: 400;
  font-size: 9px;
  margin-top: 4px;
  color: #d3b996;
}
.selected-tile.locked {
  border-color: #fff3bf !important;
  box-shadow: inset 0 0 0 1px #fff2c455;
}
.selection .chips {
  gap: 9px;
  min-height: 60px;
}
.pick-accent {
  border: 0 !important;
  background: linear-gradient(130deg, #fff1b9, var(--show-accent)) !important;
  color: #422609 !important;
  font-weight: 700 !important;
}
.tv-number {
  position: relative;
}
.tv-cell-emblem {
  position: absolute;
  right: -4px;
  top: -6px;
  width: 21px;
  height: 21px;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px #0005);
}
.is-theater .tv-cell-emblem {
  width: 30px;
  height: 30px;
  right: -6px;
  top: -8px;
}
.impact-halo {
  position: fixed;
  z-index: 2147483645;
  pointer-events: none;
  border: 2px solid var(--show-accent);
  border-radius: 14px;
  box-shadow: 0 0 20px var(--show-accent);
}
.impact-emblem {
  position: fixed;
  width: 65px;
  height: 65px;
  z-index: 2147483646;
  pointer-events: none;
  filter: drop-shadow(0 0 14px #ffd47d99);
}
.pick-flash {
  animation: pickFlash 0.8s ease-out;
}
@keyframes pickFlash {
  0% {
    box-shadow: 0 0 35px #fff2c6;
    transform: scale(0.8);
  }
  45% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}
@media (max-width: 600px) {
  .analysis-workspace .num {
    min-height: 30px;
    border-radius: 8px;
  }
  .analysis-workspace .num > b {
    font-size: 13px;
  }
  .cell-emblem {
    width: 22px;
    height: 22px;
    right: -5px;
    top: -8px;
  }
  .analysis-workspace .grid {
    gap: 7px 5px;
  }
  .tv-cell-emblem {
    width: 16px;
    height: 16px;
  }
  .selected-tile {
    min-width: 67px;
    padding: 5px 8px !important;
  }
  .selection-art-head strong {
    font-size: 17px;
  }
}
.analysis-workspace > .board,
.analysis-workspace > .board h2,
.analysis-workspace > .board h3,
.analysis-workspace #count {
  color: #fff2d8;
}
.analysis-workspace > .board .muted,
.analysis-workspace > .board p,
.analysis-workspace > .board .legend {
  color: #d4bda5;
}
.analysis-workspace .mascot:disabled {
  opacity: 1;
}
.analysis-workspace .num:disabled {
  opacity: 0.8;
}
.analysis-workspace .num.selected:disabled {
  opacity: 1;
}
.analysis-workspace .supplement {
  border-color: #ffffff25;
}
.analysis-workspace .choice-row button {
  background: #ffffff0b;
  color: #ffedd0;
  border-color: #ffffff30;
}
.analysis-workspace .choice-row button.active {
  background: var(--show-bright);
  color: #452b12;
}
.analysis-workspace > .board .selection {
  border-color: #ffffff25;
}

/* compact.css */
header {
  height: 60px;
  min-height: 60px;
  padding: 7px 20px;
}
.brand img {
  width: 110px;
  height: 28px;
}
.brand span {
  font-size: 8px;
}
.heading,
.analysis-title,
.analysis-workspace,
.layout > .side,
.subgrid,
.storystrip,
.bottom,
.rules-restored,
main > footer {
  display: none !important;
}
.layout,
.layout.choosing {
  display: block !important;
}
main {
  padding: 10px 14px;
  max-width: none;
  height: calc(100dvh - 60px);
}
.stage-shell {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 13px;
}
.tv-top {
  height: 56px;
  padding: 8px 16px;
}
.tv-series {
  display: block !important;
}
.tv-series strong {
  font-size: 14px;
}
.tv-series {
  font-size: 10px;
}
.tv-round b {
  font-size: 28px;
}
.tv-main {
  min-height: 0 !important;
}
.tv-scene.tv-draw {
  grid-template-columns: 155px minmax(0, 1fr) 290px;
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  align-items: stretch;
}
.tv-host {
  padding: 10px 8px;
  gap: 3px;
  justify-content: flex-start;
}
.tv-host-art,
.is-theater .tv-host-art {
  width: 135px;
  height: 135px;
  max-width: 100%;
}
.tv-host-name,
.is-theater .tv-host-name {
  font-size: 13px;
  margin: 0;
}
.emission-caption,
.is-theater .emission-caption {
  font-size: 10px;
  margin: 3px 0;
  min-height: 32px;
}
.tv-ball,
.is-theater .tv-ball {
  width: 88px;
  height: 88px;
  font-size: 44px;
  margin: 8px 0;
}
.tv-host-count,
.is-theater .tv-host-count {
  font-size: 11px;
  margin: 3px 0;
}
.single-rhythm,
.single-insights {
  display: none !important;
}
.tv-board-area {
  gap: 7px;
  min-height: 0;
}
.tv-board-title h3 {
  font-size: 18px;
}
.tv-board-title span {
  font-size: 11px;
}
.tv-number-grid {
  gap: 5px;
  min-height: 0;
}
.tv-number,
.is-theater .tv-number {
  min-height: 0;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.tv-number > small {
  font-size: 9px;
  color: #c3aaa0;
  font-weight: 400;
}
.tv-number.out > small {
  color: #6c573d;
}
.tv-number.user-pick {
  outline: 2px solid #82e7e4;
  outline-offset: -3px;
}
.tv-number.user-pick:after {
  content: '✓';
  position: absolute;
  left: 4px;
  top: 1px;
  color: #8efaf0;
  font-size: 10px;
}
.tv-number.user-pick.out:after {
  color: #136463;
}
.tv-cell-emblem,
.is-theater .tv-cell-emblem {
  width: 17px;
  height: 17px;
  right: -3px;
  top: -4px;
}
.tv-ribbon {
  min-height: 27px;
  gap: 3px;
}
.tv-ribbon span,
.is-theater .tv-ribbon span {
  font-size: 11px;
  height: 25px;
  aspect-ratio: auto;
}
.tv-splits,
.is-theater .tv-splits {
  font-size: 12px;
  gap: 15px;
  padding-top: 6px;
}
.tv-splits b {
  font-size: 16px;
}
.tv-splits small {
  display: none;
}
.tv-controls {
  height: 43px;
  min-height: 43px;
  padding: 6px 14px;
}
.tv-controls button {
  font-size: 11px;
  padding: 5px 9px;
}
.compact-analysis {
  background: #141821;
  border: 1px solid #ffffff26;
  border-radius: 12px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  color: #e8e9ef;
}
.ca-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
}
.ca-head select {
  background: #282c37;
  color: #fff;
  font-size: 11px;
  padding: 5px;
  border-color: #414653;
}
.ca-rank-title {
  font-size: 11px;
  color: #acb4c6;
  margin-bottom: 5px;
}
.ca-rank {
  display: flex;
  gap: 5px;
}
.ca-rank button {
  flex: 1;
  min-width: 0;
  padding: 5px 0;
  border-radius: 7px;
  background: #262d3a;
  color: #ffe3a2;
  border: 1px solid #414958;
  font-size: 15px;
  font-weight: bold;
}
.ca-rank button small {
  display: block;
  font-size: 9px;
  color: #bdc5d2;
  font-weight: 400;
  margin-top: 2px;
}
.ca-focus {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 9px;
  align-items: center;
  padding: 9px;
  background: #292e39;
  border-radius: 9px;
}
.ca-focus > strong {
  font-size: 29px;
  color: var(--show-accent);
}
.ca-focus span {
  font-size: 11px;
  color: #dce0e8;
  line-height: 1.7;
}
.ca-focus b {
  color: #fff;
}
.ca-chart-title {
  font-size: 11px;
  color: #c9cfda;
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.ca-chart {
  width: 100%;
  height: 46px;
  display: block;
  overflow: visible;
}
.ca-history {
  margin-top: auto;
}
.ca-history button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  font-size: 10px;
  padding: 5px 0;
  border: 0;
  border-top: 1px solid #ffffff15;
  background: none;
  border-radius: 0;
  color: #c3c9d4;
}
.ca-history button b {
  color: #ffdfa4;
  font-size: 10px;
}
.ca-note {
  font-size: 9px;
  line-height: 1.4;
  color: #989fad;
}
.compact-picker {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.compact-picker label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #dccab1;
}
.compact-picker select {
  padding: 5px;
  font-size: 12px;
}
.compact-picker button {
  padding: 9px 5px;
  font-size: 12px;
  color: #442c15;
  background: var(--show-bright);
  border: 0;
  border-radius: 8px;
  font-weight: bold;
}
.compact-picker .ghost {
  background: #ffffff0d;
  color: #e6d4bd;
  border: 1px solid #ffffff2b;
  font-weight: 400;
  padding: 6px;
}
.compact-selected {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid #ffffff25;
  padding-top: 7px;
  min-height: 43px;
}
.compact-selected-label {
  font-size: 10px;
  flex-shrink: 0;
  color: #d8c8b4;
  line-height: 1.5;
}
.compact-selected-slots {
  display: flex;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.compact-selected-slots button {
  padding: 0;
  position: relative;
  min-width: 0;
  flex: 1;
  height: 32px;
  max-width: 42px;
  border-radius: 7px;
  font-size: 15px;
  background: #183d3c;
  color: #b4ffef;
  border-color: #71b7ae;
}
.compact-selected-slots .empty {
  opacity: 0.3;
  background: #ffffff08;
}
.compact-selected-slots button small {
  position: absolute;
  right: 1px;
  top: -5px;
  font-size: 10px;
}
.compact-legend {
  font-size: 10px;
  color: #ccbba7;
  display: flex;
  gap: 10px;
  margin-bottom: 1px;
}
.compact-legend b {
  color: #ffdf91;
}
.compact-legend em {
  font-style: normal;
  color: #8bede5;
}
.compact-countdown-note {
  font-size: 10px;
  color: #c6b69f;
}
.is-theater .tv-brand {
  display: none;
}
.is-theater .tv-number {
  font-size: 24px;
}
.is-theater .tv-number > small {
  font-size: 11px;
}
.is-theater .tv-scene.tv-draw {
  grid-template-columns: 190px minmax(0, 1fr) 320px;
  gap: 20px;
  padding: 20px;
}
.is-theater .tv-host-art {
  width: 170px;
  height: 170px;
}
.is-theater .tv-ball {
  width: 115px;
  height: 115px;
  font-size: 56px;
}
.is-theater .compact-analysis {
  gap: 15px;
  padding: 16px;
}
.is-theater .ca-chart {
  height: 65px;
}
.is-theater .ca-focus span {
  font-size: 13px;
}
.is-theater .ca-rank button {
  font-size: 19px;
}
.is-theater .ca-rank-title {
  font-size: 13px;
}
.is-theater .ca-history button {
  font-size: 12px;
}
@media (max-height: 760px) and (min-width: 1050px) {
  .tv-host-art,
  .is-theater .tv-host-art {
    width: 110px;
    height: 110px;
  }
  .tv-ball,
  .is-theater .tv-ball {
    width: 76px;
    height: 76px;
    font-size: 39px;
  }
  .compact-analysis {
    gap: 7px;
    padding: 10px;
  }
  .ca-chart {
    height: 35px;
  }
  .ca-focus {
    padding: 6px;
  }
  .tv-scene.tv-draw {
    padding: 10px;
    gap: 10px;
  }
  .tv-number {
    font-size: 17px;
  }
  .compact-picker {
    gap: 5px;
  }
  .compact-picker button {
    padding: 7px 4px;
  }
  .ca-rank button {
    padding: 4px 0;
  }
}
@media (max-width: 1100px) {
  .tv-scene.tv-draw,
  .is-theater .tv-scene.tv-draw {
    grid-template-columns: 125px minmax(0, 1fr) 255px;
    gap: 10px;
    padding: 10px;
  }
  .tv-host-art,
  .is-theater .tv-host-art {
    width: 100px;
    height: 100px;
  }
  .tv-host-name {
    font-size: 11px;
  }
  .tv-number,
  .is-theater .tv-number {
    font-size: 16px;
  }
  .tv-top .tv-series {
    display: none !important;
  }
  .compact-analysis {
    padding: 9px;
    gap: 7px;
  }
  .ca-chart {
    height: 35px;
  }
  .tv-number > small {
    font-size: 8px;
  }
  .compact-legend {
    font-size: 9px;
  }
}
@media (max-width: 760px) {
  .kl-body {
    overflow: auto;
  }
  main {
    height: auto;
    min-height: calc(100dvh - 60px);
  }
  .stage-shell {
    height: 1000px !important;
  }
  .tv-scene.tv-draw,
  .is-theater .tv-scene.tv-draw {
    grid-template-columns: 100px minmax(0, 1fr);
    grid-template-rows: 500px minmax(0, 1fr);
  }
  .compact-analysis {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .ca-head,
  .ca-focus,
  .ca-note {
    grid-column: 1/-1;
  }
  .ca-history {
    display: none;
  }
  .tv-host {
    height: auto;
    flex-direction: column;
  }
  .tv-main {
    min-height: 0 !important;
  }
  .tv-host-art {
    width: 80px;
    height: 100px;
  }
  .tv-host-count {
    max-width: none;
  }
  .emission-caption {
    display: block;
    font-size: 9px;
  }
  .tv-board-title h3 {
    font-size: 13px;
  }
  .tv-board-title span {
    font-size: 9px;
  }
  .tv-number-grid {
    gap: 3px;
  }
  .tv-number {
    font-size: 13px;
  }
  .tv-ribbon {
    grid-template-columns: repeat(10, 1fr);
  }
  .tv-number > small {
    display: none;
  }
  .compact-legend {
    flex-wrap: wrap;
    font-size: 8px;
    gap: 3px;
  }
  .compact-selected-slots {
    flex-wrap: wrap;
  }
  .compact-selected-slots button {
    flex: 0 0 22px;
    height: 24px;
    font-size: 11px;
  }
  .tv-splits {
    gap: 7px;
  }
  .tv-splits b {
    font-size: 12px;
  }
  .compact-picker button {
    font-size: 10px;
  }
  .compact-picker label {
    font-size: 10px;
  }
  .tv-host .tv-ball {
    width: 66px;
    height: 66px;
    font-size: 33px;
  }
  .tv-top {
    padding: 8px;
  }
  .tv-top button {
    font-size: 10px;
  }
  .tv-top .tv-round {
    gap: 5px;
  }
  .tv-round > span {
    font-size: 9px;
  }
  .tv-round b {
    font-size: 22px;
  }
  .tv-controls {
    padding: 6px;
  }
  .is-theater {
    overflow: auto !important;
  }
}
.tv-board-area {
  position: relative;
}
.live-scene {
  position: absolute;
  z-index: 8;
  inset: 34px 0 102px;
  border: 1px solid #d8bb762e;
  border-radius: 13px;
  background: radial-gradient(ellipse at 50% 25%, var(--show-panel), var(--show-bg) 85%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  pointer-events: none;
}
.live-scene[hidden] {
  display: none !important;
}
.live-scene.enter {
  animation: liveEnter 0.7s ease-out;
}
.live-scene:before,
.live-scene:after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12%;
  background: repeating-linear-gradient(90deg, var(--show-panel), var(--show-bg) 40%, var(--show-panel) 80%);
  border-bottom: 2px solid var(--show-accent);
  opacity: 0.8;
  z-index: -1;
}
.live-scene:before {
  left: 0;
  transform: skewX(-7deg) translateX(-35%);
}
.live-scene:after {
  right: 0;
  transform: skewX(7deg) translateX(35%);
}
.live-scene .live-eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--show-accent);
}
.live-scene h2 {
  font-size: clamp(55px, 7vw, 110px);
  letter-spacing: -4px;
  line-height: 1;
  margin: 15px 0;
  color: var(--show-bright);
  font-style: italic;
}
.live-scene h3 {
  font-size: 22px;
  color: #fff0cd;
  margin: 10px 0;
}
.live-scene p {
  font-size: 14px;
  color: #d8c4ac;
  text-align: center;
}
.live-scene .live-clock {
  font-size: 48px;
  color: #fff2c5;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  margin: 12px 0;
}
.live-scene .live-results {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.live-results b {
  aspect-ratio: 1;
  background: radial-gradient(circle at 30% 20%, #fffce9, var(--show-bright) 25%, var(--show-accent));
  border-radius: 50%;
  color: #412913;
  display: grid;
  place-items: center;
  font-size: clamp(16px, 2vw, 28px);
  box-shadow: 0 7px 15px #0003;
  animation: tvLand 0.65s both;
  animation-delay: calc(var(--i) * 0.04s);
}
.live-scene .live-summary {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #f4e4c9;
}
.live-summary b {
  color: var(--show-accent);
  margin-left: 5px;
}
.live-scene .live-orbit {
  border: 1px solid #ffda8330;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  position: absolute;
  z-index: -1;
  animation: orbitPulse 5s ease-in-out infinite;
}
.live-scene.countdown .live-clock {
  font-size: 110px;
  animation: tvLand 1s infinite;
}
.live-scene.result h3 {
  font-size: 25px;
}
.live-scene.result .live-eyebrow {
  font-size: 11px;
}
@keyframes liveEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes orbitPulse {
  50% {
    transform: scale(1.12);
    opacity: 0.4;
  }
}
@media (max-width: 1100px) {
  .live-scene {
    padding: 15px;
  }
  .live-scene h3 {
    font-size: 18px;
  }
  .live-scene .live-results {
    gap: 6px;
  }
  .live-summary {
    gap: 10px !important;
    font-size: 12px !important;
  }
}
@media (max-width: 760px) {
  .live-scene {
    inset: 25px 0 132px;
    padding: 8px;
  }
  .live-scene .live-eyebrow {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .live-scene h2 {
    font-size: 52px;
  }
  .live-scene h3 {
    font-size: 15px;
    text-align: center;
  }
  .live-scene p {
    font-size: 11px;
  }
  .live-scene .live-clock {
    font-size: 30px;
  }
  .live-scene .live-results {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .live-results b {
    font-size: 14px;
  }
  .live-scene .live-summary {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px !important;
    font-size: 10px !important;
  }
  .live-scene.result h3 {
    font-size: 17px;
  }
}
.layout,
.layout.choosing {
  height: 100%;
}
.webnav {
  display: none !important;
}
@media (max-width: 760px) {
  .layout,
  .layout.choosing {
    height: auto;
  }
}

/* view-modes.css */
/* Dashboard and television presentation are intentionally separate view modes. */
.ca-heat-section {
  min-height: 0;
}
.ca-heat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #c9cfda;
  margin-bottom: 5px;
}
.ca-heat-title small {
  font-size: 9px;
  color: #969fb2;
}
.ca-heat-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
}
.ca-heat-grid button {
  padding: 0;
  min-width: 0;
  height: 19px;
  border-radius: 4px;
  font-size: 10px;
  border: 1px solid #ffffff13;
  color: #f9faff;
  background: var(--heat);
  font-weight: 600;
}
.ca-heat-grid button.focus {
  outline: 2px solid #ffe0a0;
  outline-offset: -2px;
}
.ca-heat-legend {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #9da7bc;
  font-size: 9px;
  margin-top: 5px;
}
.ca-heat-legend i {
  height: 4px;
  flex: 1;
  border-radius: 3px;
  background: linear-gradient(90deg, #162843, #67b7f0);
}
.compact-analysis {
  gap: 8px;
}
.ca-history {
  margin-top: 0;
}
.ca-chart {
  height: 37px;
}
.ca-rank button {
  padding: 4px 0;
}
.ca-focus {
  padding: 7px;
}
.ca-focus span {
  font-size: 10px;
}
.ca-chart-title {
  font-size: 10px;
}
.ca-note {
  margin-top: auto;
}
.is-theater .compact-analysis,
.is-theater .compact-picker,
.is-theater .compact-selected,
.is-theater .compact-legend,
.is-theater .cell-frequency,
.is-theater .tv-number.user-pick:after {
  display: none !important;
}
.is-theater .tv-scene.tv-draw {
  grid-template-columns: 24% minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 3vw;
  padding: 3vh 3vw;
}
.is-theater .tv-host {
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
}
.is-theater .tv-host-art {
  height: 32vh;
  width: 32vh;
  max-width: 100%;
}
.is-theater .tv-host-name {
  font-size: 22px;
  margin: 5px 0;
}
.is-theater .emission-caption {
  font-size: 14px;
  max-width: 270px;
  min-height: 0;
  margin: 10px 0 16px;
}
.is-theater .tv-ball {
  height: 18vh;
  width: 18vh;
  font-size: 9vh;
  margin: 12px 0;
}
.is-theater .tv-host-count {
  font-size: 16px;
  margin: 10px 0;
}
.is-theater .tv-number {
  font-size: clamp(22px, 3vh, 42px);
  cursor: default;
  gap: 0;
}
.is-theater .tv-number.user-pick {
  outline: 0;
}
.is-theater .tv-number.latest {
  outline: 3px solid #fff4ca;
}
.is-theater .tv-board-area {
  gap: 14px;
}
.is-theater .tv-board-title h3 {
  font-size: 26px;
}
.is-theater .tv-board-title span {
  font-size: 15px;
}
.is-theater .tv-number-grid {
  gap: 10px;
}
.is-theater .tv-ribbon {
  min-height: 44px;
  gap: 6px;
}
.is-theater .tv-ribbon span {
  font-size: 19px;
  height: 40px;
  border-radius: 50%;
  aspect-ratio: 1;
}
.is-theater .tv-splits {
  font-size: 18px;
  padding-top: 12px;
  gap: 28px;
}
.is-theater .tv-splits b {
  font-size: 24px;
}
.is-theater .tv-splits small {
  display: block;
  font-size: 12px;
}
.is-theater .live-scene {
  inset: 45px 0 100px;
}
.is-theater .live-scene h2 {
  font-size: clamp(90px, 12vw, 190px);
}
.is-theater .live-scene h3 {
  font-size: 32px;
}
.is-theater .live-scene .live-eyebrow {
  font-size: 16px;
}
.is-theater .live-scene p {
  font-size: 17px;
}
.is-theater .live-scene .live-results {
  gap: 18px;
}
.is-theater .live-results b {
  font-size: clamp(24px, 3vw, 45px);
}
.is-theater .live-scene .live-summary {
  font-size: 22px;
  gap: 30px;
}
.is-theater .live-scene .live-clock {
  font-size: 65px;
}
.is-theater .live-scene.countdown .live-clock {
  font-size: 130px;
}
.is-theater .tv-brand {
  display: flex !important;
}
.is-theater .tv-top {
  height: 76px;
  padding: 12px 3vw;
}
.is-theater .tv-series {
  font-size: 12px;
}
.is-theater .tv-series strong {
  font-size: 20px;
}
.is-theater .tv-round b {
  font-size: 38px;
}
.is-theater .tv-top button {
  font-size: 14px;
}
.is-theater .tv-controls {
  height: 54px;
  padding: 9px 3vw;
}
.is-theater .tv-controls button {
  font-size: 13px;
}
.is-theater .tv-backdrop {
  opacity: 0.24;
}
.is-theater .tv-controls {
  transition: opacity 0.3s;
}
.is-theater .tv-show.cinema-idle .tv-controls {
  opacity: 0.2 !important;
}
.is-theater .tv-show.cinema-idle .tv-controls:hover,
.is-theater .tv-show.cinema-idle .tv-controls:focus-within {
  opacity: 1 !important;
}
.is-theater .tv-top #tvExit {
  opacity: 1 !important;
}
@media (max-height: 800px) and (min-width: 1050px) {
  .compact-analysis {
    gap: 5px;
    padding: 9px;
  }
  .ca-head {
    font-size: 13px;
  }
  .ca-focus {
    padding: 5px;
  }
  .ca-focus > strong {
    font-size: 25px;
  }
  .ca-rank-title {
    margin-bottom: 3px;
    font-size: 10px;
  }
  .ca-rank button {
    padding: 3px 0;
    font-size: 13px;
  }
  .ca-rank button small {
    font-size: 8px;
    margin-top: 1px;
  }
  .ca-heat-grid {
    gap: 2px;
  }
  .ca-heat-grid button {
    height: 15px;
    font-size: 9px;
  }
  .ca-heat-title {
    font-size: 10px;
    margin-bottom: 3px;
  }
  .ca-heat-legend {
    margin-top: 3px;
    font-size: 8px;
  }
  .ca-chart {
    height: 29px;
  }
  .ca-chart-title {
    font-size: 9px;
    margin-bottom: 1px;
  }
  .ca-history button {
    padding: 3px 0;
    font-size: 9px;
  }
  .ca-note {
    font-size: 8px;
  }
  .is-theater .tv-top {
    height: 60px;
  }
  .is-theater .tv-controls {
    height: 42px;
  }
  .is-theater .tv-number-grid {
    gap: 6px;
  }
  .is-theater .tv-ribbon span {
    height: 30px;
    font-size: 15px;
  }
  .is-theater .tv-host-art {
    height: 26vh;
    width: 26vh;
  }
  .is-theater .tv-host-name {
    font-size: 17px;
  }
  .is-theater .emission-caption {
    font-size: 11px;
    margin: 6px 0;
  }
  .is-theater .tv-splits {
    font-size: 14px;
    gap: 15px;
  }
  .is-theater .tv-splits b {
    font-size: 18px;
  }
}
@media (max-width: 760px) {
  .ca-heat-section {
    grid-column: 1/-1;
  }
  .ca-heat-grid {
    grid-template-columns: repeat(20, 1fr);
  }
  .ca-heat-grid button {
    height: 16px;
    font-size: 8px;
  }
  .stage-shell {
    height: 1120px !important;
  }
  .is-theater .tv-scene.tv-draw {
    grid-template-columns: 1fr !important;
    grid-template-rows: 100px minmax(0, 1fr) !important;
    padding: 12px;
    gap: 10px;
  }
  .is-theater .tv-host {
    flex-direction: row;
    gap: 15px;
  }
  .is-theater .tv-host-art {
    width: 80px;
    height: 90px;
  }
  .is-theater .tv-host-name,
  .is-theater .emission-caption {
    display: none;
  }
  .is-theater .tv-ball {
    height: 70px;
    width: 70px;
    font-size: 35px;
  }
  .is-theater .tv-host-count {
    font-size: 10px;
  }
  .is-theater .tv-top {
    height: 62px;
    padding: 8px;
  }
  .is-theater .tv-brand {
    display: none !important;
  }
  .is-theater .tv-number-grid {
    gap: 4px;
  }
  .is-theater .tv-number {
    font-size: 16px;
  }
  .is-theater .tv-ribbon span {
    font-size: 11px;
    height: 25px;
  }
  .is-theater .tv-splits {
    font-size: 11px;
    gap: 13px;
  }
  .is-theater .tv-splits b {
    font-size: 14px;
  }
  .is-theater .tv-splits small {
    display: none;
  }
  .is-theater .live-scene h2 {
    font-size: 65px;
  }
  .is-theater .live-scene h3 {
    font-size: 18px;
  }
  .is-theater .live-scene p {
    font-size: 12px;
  }
  .is-theater .live-scene .live-eyebrow {
    font-size: 10px;
  }
  .is-theater .live-scene .live-results {
    gap: 8px;
  }
  .is-theater .live-results b {
    font-size: 18px;
  }
  .is-theater .live-scene .live-summary {
    font-size: 12px;
    gap: 10px;
  }
  .is-theater .live-scene .live-clock {
    font-size: 42px;
  }
  .is-theater .tv-top button {
    font-size: 10px;
  }
  .is-theater .tv-round b {
    font-size: 24px;
  }
  .is-theater .tv-board-title h3 {
    font-size: 17px;
  }
  .is-theater .tv-board-title span {
    font-size: 11px;
  }
}
@media (min-width: 761px) {
  .compact-analysis {
    display: grid;
    grid-template-rows: 26px 58px 56px 56px minmax(120px, 1fr) 49px 49px 77px 24px;
    gap: 6px;
  }
  .ca-heat-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .ca-heat-grid {
    flex: 1;
    min-height: 0;
    grid-template-rows: repeat(8, minmax(0, 1fr));
  }
  .ca-heat-grid button {
    height: 100%;
    min-height: 0;
  }
  .ca-note {
    margin: 0;
  }
  .ca-history {
    min-height: 0;
  }
  .ca-heat-title,
  .ca-heat-legend {
    flex-shrink: 0;
  }
  .ca-focus {
    height: 100%;
  }
  .ca-chart {
    height: 32px;
  }
}
@media (max-height: 800px) and (min-width: 761px) {
  .compact-analysis {
    grid-template-rows: 22px 43px 43px 43px minmax(105px, 1fr) 36px 36px 58px 20px;
    gap: 4px;
    padding: 8px;
  }
  .ca-heat-title {
    font-size: 9px;
    margin-bottom: 3px;
  }
  .ca-heat-legend {
    font-size: 8px;
    margin-top: 3px;
  }
  .ca-heat-grid {
    gap: 2px;
  }
  .ca-heat-grid button {
    font-size: 8px;
  }
  .ca-chart {
    height: 25px;
  }
  .ca-rank button {
    font-size: 12px;
    padding: 2px 0;
  }
  .ca-rank button small {
    font-size: 8px;
  }
  .ca-history button {
    padding: 2px 0;
    font-size: 9px;
  }
  .ca-focus span {
    font-size: 9px;
  }
  .ca-focus > strong {
    font-size: 24px;
  }
  .tv-host-art {
    width: 105px;
    height: 105px;
  }
  .tv-ball {
    height: 68px;
    width: 68px;
    font-size: 35px;
  }
  .tv-host-name {
    font-size: 11px;
  }
  .emission-caption {
    font-size: 9px;
    min-height: 25px;
  }
  .tv-host-count {
    font-size: 10px;
  }
  .compact-picker {
    gap: 4px;
  }
  .compact-picker button {
    padding: 6px 4px;
    font-size: 11px;
  }
  .compact-picker .ghost {
    padding: 4px;
  }
  .compact-picker select {
    padding: 3px;
    font-size: 10px;
  }
  .tv-host {
    padding: 8px 6px;
  }
}
@media (max-height: 800px) and (min-width: 761px) {
  .compact-analysis {
    grid-template-rows: 22px 43px 48px 48px minmax(95px, 1fr) 36px 36px 70px 20px;
  }
  .ca-rank-title {
    line-height: 12px;
    margin-bottom: 3px;
  }
  .ca-rank button {
    line-height: 15px;
    height: 30px;
    padding: 2px 0;
  }
  .ca-rank button small {
    line-height: 10px;
  }
  .ca-history button {
    height: 17px;
    line-height: 12px;
    padding: 2px 0;
  }
  .ca-history button b {
    font-size: 9px;
    line-height: 12px;
  }
  .ca-note {
    font-size: 8px;
    line-height: 10px;
  }
}

/* result-fix.css */
/* Result sizing follows its own frame, including zoomed and embedded views. */
.live-scene.result,
.is-theater .live-scene.result {
  container-type: size;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  gap: clamp(5px, 1vh, 12px);
  padding: clamp(12px, 2vw, 28px) !important;
  min-width: 0;
  min-height: 0;
}
.live-scene.result > .live-eyebrow {
  margin: 0;
  text-align: center;
  letter-spacing: 2px;
  line-height: 1.3;
  font-size: clamp(9px, 1.1vw, 14px);
}
.live-scene.result > h3,
.is-theater .live-scene.result > h3 {
  margin: 0;
  line-height: 1.15;
  font-size: clamp(18px, 2.5vw, 34px);
  text-align: center;
}
.live-scene.result > .live-results,
.is-theater .live-scene.result > .live-results {
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  gap: clamp(4px, 1vw, 12px) !important;
  margin: 0 !important;
  align-items: center;
  justify-items: center;
}
.live-scene.result .live-results b,
.is-theater .live-scene.result .live-results b {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: min(100%, 76px);
  height: auto;
  aspect-ratio: 1;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  line-height: 1;
  font-size: clamp(13px, 2.1vw, 29px);
  border: 1px solid #fff2b8;
  box-shadow:
    inset -3px -5px 9px #8d57142b,
    0 5px 10px #0003;
  animation: resultSettle 0.6s both;
  animation-delay: calc(var(--i) * 0.025s);
}
@supports (width: 1cqw) {
  .live-scene.result .live-results b,
  .is-theater .live-scene.result .live-results b {
    width: min(8cqw, 23cqh, 100px);
    height: min(8cqw, 23cqh, 100px);
    font-size: clamp(12px, min(3cqw, 9cqh), 38px);
  }
}
.live-scene.result > .live-summary,
.is-theater .live-scene.result > .live-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px !important;
  width: 100%;
  max-width: 650px;
  font-size: clamp(11px, 1.4vw, 18px) !important;
  line-height: 1.2;
}
.live-scene.result .live-summary > span {
  background: #ffffff09;
  border: 1px solid #ffffff20;
  padding: clamp(6px, 1vh, 12px) 4px;
  text-align: center;
  border-radius: 9px;
}
.live-scene.result .live-summary b {
  display: block;
  margin: 5px 0 0;
  font-size: 1.35em;
}
.live-scene.result > p,
.is-theater .live-scene.result > p {
  font-size: clamp(10px, 1.2vw, 15px);
  line-height: 1.3;
  margin: 0;
  text-align: center;
  max-width: 100%;
}
.live-scene.result:before,
.live-scene.result:after {
  opacity: 0.4;
}
@keyframes resultSettle {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 760px) and (orientation: portrait) {
  .live-scene.result > .live-results,
  .is-theater .live-scene.result > .live-results {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
  }
  .live-scene.result .live-results b,
  .is-theater .live-scene.result .live-results b {
    width: min(14cqw, 12cqh);
    height: min(14cqw, 12cqh);
    font-size: clamp(11px, 6cqh, 20px);
  }
  .live-scene.result > .live-summary {
    gap: 3px !important;
    font-size: 9px !important;
  }
  .live-scene.result .live-summary > span {
    padding: 4px 1px;
    border-radius: 5px;
  }
  .live-scene.result {
    gap: 5px;
    padding: 10px !important;
  }
  .live-scene.result > h3 {
    font-size: 17px !important;
  }
}

/* reference-layout.css */
.kl-body {
  background: #06182b !important;
  color: #eff4ff;
}
header {
  background: #091f36;
  border-bottom: 1px solid #224462;
  height: 58px;
  min-height: 58px;
}
.brand {
  background: #fff;
  border-radius: 5px;
  padding: 4px 10px;
}
.brand img {
  height: 24px;
}
.brand span {
  font-size: 7px;
}
.demoBadge {
  color: #afc0d5;
  border-color: #365069;
}
main {
  height: calc(100dvh - 58px);
  padding: 8px 20px 12px;
}
.stage-shell:not(.is-theater) {
  border: 0;
  border-radius: 0;
  background: transparent !important;
}
.stage-shell:not(.is-theater) .tv-show {
  background: transparent;
}
.stage-shell:not(.is-theater) .tv-backdrop {
  display: none;
}
.stage-shell:not(.is-theater) .tv-top {
  height: 56px;
  padding: 0 0 9px;
  border: 0;
  background: transparent;
}
.stage-shell:not(.is-theater) .tv-series {
  font-size: 11px;
  color: #b0c3d7;
  border-left: 3px solid #ff3755;
  padding-left: 14px;
  position: relative;
  margin-left: 120px;
}
.stage-shell:not(.is-theater) .tv-series:before {
  content: 'KENO';
  position: absolute;
  left: -122px;
  top: -7px;
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -2px;
}
.stage-shell:not(.is-theater) .tv-series strong {
  font-size: 17px;
}
.stage-shell:not(.is-theater) .tv-round {
  border: 1px solid #284967;
  border-radius: 9px;
  padding: 5px 12px;
  margin-left: auto;
  margin-right: 10px;
}
.stage-shell:not(.is-theater) .tv-round b {
  color: white;
  font-size: 28px;
}
.stage-shell:not(.is-theater) .tv-top button {
  background: #102b43;
  color: #d9e6f5;
  border-color: #33516c;
}
.stage-shell:not(.is-theater) .tv-scene.tv-draw {
  grid-template-columns: 155px minmax(0, 1fr) 31%;
  grid-template-rows: minmax(0, 1fr) 96px 66px;
  gap: 10px 0;
  padding: 0;
  overflow: hidden;
}
.stage-shell:not(.is-theater) .tv-host {
  grid-column: 1;
  grid-row: 1;
  background: #fbfbfa;
  color: #162b42;
  border: 0;
  border-right: 1px solid #e1e3e5;
  border-radius: 12px 0 0 12px;
  padding: 10px;
}
.stage-shell:not(.is-theater) .tv-host-name {
  color: #273849;
  font-size: 12px;
}
.stage-shell:not(.is-theater) .emission-caption {
  color: #687787;
  font-size: 9px;
  margin: 2px 0;
  min-height: 20px;
}
.stage-shell:not(.is-theater) .tv-host-art {
  height: 88px;
  width: 88px;
}
.stage-shell:not(.is-theater) .tv-ball {
  width: 66px;
  height: 66px;
  font-size: 32px;
  background: radial-gradient(circle at 25% 20%, #ffb2ba, #ff405e 40%, #cd173b);
  color: white;
  border-color: #ff9daa;
  box-shadow: 0 5px 14px #ed365329;
}
.stage-shell:not(.is-theater) .tv-host-count {
  color: #8a5e67;
  font-size: 9px;
  margin: 2px 0;
}
.stage-shell:not(.is-theater) .compact-picker {
  gap: 4px;
}
.stage-shell:not(.is-theater) .compact-picker label {
  color: #344351;
  font-size: 11px;
}
.stage-shell:not(.is-theater) .compact-picker button {
  background: #ff3957;
  color: white;
  padding: 6px 4px;
  font-size: 10px;
}
.stage-shell:not(.is-theater) .compact-picker .ghost {
  color: #314050;
  background: #f4f6f7;
  border: 1px solid #dce0e5;
  padding: 4px;
}
.stage-shell:not(.is-theater) .compact-picker select {
  background: white;
  color: #24364a;
  border: 1px solid #d5dce4;
  font-size: 10px;
  padding: 3px;
}
.stage-shell:not(.is-theater) .tv-board-area {
  grid-column: 2;
  grid-row: 1;
  background: #fbfbfa;
  border-radius: 0 12px 12px 0;
  padding: 12px 14px 8px;
  gap: 5px;
  color: #142638;
}
.stage-shell:not(.is-theater) .tv-board-title h3 {
  color: #11243b;
  font-size: 19px;
}
.stage-shell:not(.is-theater) .tv-board-title span {
  color: #718193;
}
.stage-shell:not(.is-theater) .compact-legend {
  font-size: 9px;
  color: #7b8590;
  gap: 8px;
}
.stage-shell:not(.is-theater) .compact-legend b {
  color: #a66335;
}
.stage-shell:not(.is-theater) .compact-legend em {
  color: #e93551;
}
.stage-shell:not(.is-theater) .tv-number-grid {
  gap: 4px 7px;
}
.stage-shell:not(.is-theater) .tv-number {
  border: 1px solid #d9dfe5;
  color: #293b4f;
  background: #f1f3f5;
  border-radius: 40%;
  font-size: 16px;
  line-height: 1.1;
  box-shadow: inset 0 1px 2px #ffffff;
}
.stage-shell:not(.is-theater) .tv-number > small {
  color: #8c95a0;
  font-size: 8px;
}
.stage-shell:not(.is-theater) .tv-number.out {
  background: #fff0de;
  border-color: #eac78e;
  color: #6c4822;
}
.stage-shell:not(.is-theater) .tv-number.user-pick {
  background: #ff3c58;
  color: white;
  border-color: #ff3c58;
  outline: none;
  box-shadow: 0 2px 7px #ff395530;
}
.stage-shell:not(.is-theater) .tv-number.user-pick > small {
  color: #ffe6ed;
}
.stage-shell:not(.is-theater) .tv-number.user-pick:after {
  color: #e73451;
  background: white;
  border: 1px solid #f4ccd2;
  border-radius: 50%;
  left: auto;
  right: -2px;
  top: -4px;
  font-size: 10px;
  width: 13px;
  height: 13px;
  text-align: center;
}
.stage-shell:not(.is-theater) .tv-cell-emblem {
  width: 14px;
  height: 14px;
  right: -1px;
  top: -3px;
}
.stage-shell:not(.is-theater) .tv-number.user-pick .tv-cell-emblem {
  display: none;
}
.stage-shell:not(.is-theater) .tv-ribbon {
  display: none;
}
.stage-shell:not(.is-theater) .tv-splits {
  color: #607288;
  border: 0;
  padding: 3px 0;
  font-size: 10px;
  gap: 15px;
}
.stage-shell:not(.is-theater) .tv-splits b {
  color: #d53452;
  font-size: 13px;
}
.stage-shell:not(.is-theater) .compact-selected {
  background: #09223b;
  border: 0;
  border-radius: 8px;
  padding: 6px 9px;
  min-height: 36px;
  margin-top: 1px;
}
.stage-shell:not(.is-theater) .compact-selected-label {
  color: #e0eaf7;
  font-size: 9px;
}
.stage-shell:not(.is-theater) .compact-selected-slots button {
  background: #ff3b57;
  border-color: #ff7185;
  color: white;
  border-radius: 18px;
  height: 25px;
  font-size: 12px;
}
.stage-shell:not(.is-theater) .compact-selected-slots .empty {
  background: #173750;
  border-color: #3c5368;
}
.stage-shell:not(.is-theater) .compact-analysis {
  grid-column: 3;
  grid-row: 1/3;
  margin-left: 14px;
  display: grid;
  grid-template-rows: 27px 55px 112px 49px minmax(115px, 1fr) 23px;
  gap: 8px;
  padding: 13px;
  background: #081e34;
  border: 1px solid #25445f;
  border-radius: 12px;
}
.stage-shell:not(.is-theater) .ca-chart-title,
.stage-shell:not(.is-theater) .ca-chart,
.stage-shell:not(.is-theater) .ca-history {
  display: none;
}
.stage-shell:not(.is-theater) .compact-analysis > div:has(.ca-chart) {
  display: none;
}
.stage-shell:not(.is-theater) .ca-head {
  font-size: 17px;
}
.stage-shell:not(.is-theater) .ca-head select {
  background: #132e47;
  border-color: #2f4b66;
  border-radius: 20px;
  font-size: 11px;
}
.stage-shell:not(.is-theater) .ca-focus {
  background: #0d263f;
  border: 1px solid #274159;
  padding: 8px;
  grid-template-columns: 46px 1fr;
}
.stage-shell:not(.is-theater) .ca-focus > strong {
  color: #ff4161;
  font-size: 31px;
}
.stage-shell:not(.is-theater) .ca-focus span {
  font-size: 11px;
}
.stage-shell:not(.is-theater) .ca-rank-title {
  color: #a9bbce;
  font-size: 11px;
  line-height: 13px;
}
.stage-shell:not(.is-theater) #caHot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stage-shell:not(.is-theater) #caHot button {
  display: grid;
  grid-template-columns: 24px 1fr 25px;
  align-items: center;
  gap: 8px;
  height: 15px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 12px;
  color: #eef2f8;
  text-align: left;
  line-height: 15px;
  border-radius: 0;
}
.stage-shell:not(.is-theater) #caHot button small {
  font-size: 10px;
  margin: 0;
  line-height: 15px;
}
.hot-bar {
  height: 7px;
  border-radius: 3px;
  background: #173149;
  overflow: hidden;
}
.hot-bar i {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #ff3152, #ff667a);
  border-radius: 3px;
}
.stage-shell:not(.is-theater) #caGap button {
  background: #0e2a43;
  border-color: #30516b;
  color: #c9e8fa;
  height: 28px;
  font-size: 12px;
  line-height: 13px;
  padding: 2px 0;
}
.stage-shell:not(.is-theater) #caGap button small {
  font-size: 8px;
  line-height: 10px;
}
.stage-shell:not(.is-theater) .ca-heat-title {
  font-size: 12px;
  color: #f5f7fc;
}
.stage-shell:not(.is-theater) .ca-heat-grid {
  gap: 2px;
}
.stage-shell:not(.is-theater) .ca-heat-grid button {
  border-radius: 2px;
  font-size: 9px;
}
.stage-shell:not(.is-theater) .ca-heat-grid button.focus {
  outline-color: #ff4763;
  background: #ff3657 !important;
}
.stage-shell:not(.is-theater) .ca-note {
  font-size: 9px;
  color: #8fa4bc;
}
.reference-bottom {
  grid-column: 1/3;
  grid-row: 2;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 10px;
}
.reference-card {
  min-width: 0;
  border: 1px solid #24435e;
  border-radius: 10px;
  background: #091e33;
  padding: 10px 14px;
  overflow: hidden;
}
.reference-card h3 {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #f1f5fc;
  margin: 0 0 7px;
}
.reference-card h3 small {
  font-size: 9px;
  color: #8fa6bd;
  font-weight: 400;
}
.reference-balls {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  max-width: 410px;
}
.reference-balls b {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 23px;
  height: 23px;
  background: #f1f5f9;
  color: #23394f;
  font-size: 10px;
}
.reference-balls b.hit {
  background: #ff3b57;
  color: white;
}
.reference-saved button {
  display: block;
  background: none;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #24435e;
  color: #e2ebf7;
  font-size: 11px;
  width: 100%;
  text-align: left;
  padding: 5px 0;
}
.reference-saved button span {
  color: #ff5671;
  font-weight: bold;
  margin-right: 8px;
}
.reference-saved p {
  color: #91a5bc;
  font-size: 11px;
  margin: 5px 0;
}
.reference-rhythm {
  grid-column: 1/-1;
  grid-row: 3;
  background: #091e33;
  border: 1px solid #24435e;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.reference-rhythm > strong {
  font-size: 15px;
  white-space: nowrap;
  color: #f1f5fc;
}
.reference-rhythm-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.reference-rhythm-label {
  font-size: 10px;
  color: #a6b9d0;
  line-height: 1.6;
  min-width: 60px;
}
.reference-rhythm-label b {
  color: #eaf1fb;
}
.reference-bars {
  display: flex;
  gap: 6px;
  flex: 1;
  height: 38px;
}
.reference-bars button {
  padding: 0;
  flex: 1;
  min-width: 0;
  border-radius: 3px;
  border: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #68b5eb;
}
.reference-bars i {
  display: block;
  background: #ff4664;
  width: 100%;
}
.stage-shell:not(.is-theater) .tv-controls {
  background: transparent;
  border: 0;
  height: 32px;
  padding: 6px 0 0;
}
.stage-shell:not(.is-theater) .tv-controls button {
  border-color: #294860;
  background: #0c263e;
  color: #bed0e4;
  padding: 4px 9px;
  font-size: 10px;
}
.is-theater .reference-bottom,
.is-theater .reference-rhythm {
  display: none !important;
}
.stage-shell:not(.is-theater) .live-scene {
  inset: 35px 14px 72px;
}
.stage-shell:not(.is-theater) .live-scene.result {
  inset: 35px 14px 72px;
}
@media (max-height: 800px) and (min-width: 1000px) {
  .stage-shell:not(.is-theater) .tv-top {
    height: 49px;
  }
  .stage-shell:not(.is-theater) .tv-scene.tv-draw {
    grid-template-columns: 137px minmax(0, 1fr) 31%;
    grid-template-rows: minmax(0, 1fr) 86px 58px;
    row-gap: 8px;
  }
  .stage-shell:not(.is-theater) .compact-analysis {
    grid-template-rows: 23px 48px 102px 44px minmax(95px, 1fr) 20px;
    gap: 5px;
    padding: 10px;
  }
  .stage-shell:not(.is-theater) .tv-host-art {
    width: 63px;
    height: 63px;
  }
  .stage-shell:not(.is-theater) .tv-ball {
    width: 43px;
    height: 43px;
    font-size: 24px;
    margin: 4px 0;
  }
  .stage-shell:not(.is-theater) .tv-host-name {
    font-size: 10px;
  }
  .stage-shell:not(.is-theater) .emission-caption {
    font-size: 8px;
    min-height: 15px;
    line-height: 1.3;
  }
  .stage-shell:not(.is-theater) .tv-host-count {
    font-size: 8px;
  }
  .stage-shell:not(.is-theater) .compact-picker button {
    padding: 4px;
    font-size: 9px;
  }
  .stage-shell:not(.is-theater) .compact-picker {
    gap: 3px;
  }
  .stage-shell:not(.is-theater) .compact-picker .ghost {
    padding: 3px;
  }
  .stage-shell:not(.is-theater) .tv-number {
    font-size: 14px;
  }
  .stage-shell:not(.is-theater) .tv-number > small {
    font-size: 7px;
  }
  .stage-shell:not(.is-theater) .tv-number-grid {
    gap: 3px 5px;
  }
  .stage-shell:not(.is-theater) .tv-board-area {
    padding: 9px 12px 6px;
    gap: 4px;
  }
  .stage-shell:not(.is-theater) .tv-board-title h3 {
    font-size: 17px;
  }
  .stage-shell:not(.is-theater) #caHot button {
    height: 13px;
    line-height: 13px;
  }
  .stage-shell:not(.is-theater) .ca-focus span {
    font-size: 10px;
  }
  .reference-card {
    padding: 8px 10px;
  }
  .reference-card h3 {
    font-size: 12px;
    margin-bottom: 5px;
  }
  .reference-balls b {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }
  .reference-rhythm {
    padding: 8px 10px;
  }
  .reference-bars {
    height: 32px;
  }
  .reference-rhythm > strong {
    font-size: 13px;
  }
}
@media (max-width: 1000px) {
  .stage-shell:not(.is-theater) .tv-scene.tv-draw {
    grid-template-columns: 120px minmax(0, 1fr) 30%;
  }
  .stage-shell:not(.is-theater) .tv-series {
    margin-left: 100px;
  }
  .stage-shell:not(.is-theater) .tv-series:before {
    font-size: 34px;
    left: -103px;
  }
  .stage-shell:not(.is-theater) .tv-series strong {
    font-size: 13px;
  }
  .stage-shell:not(.is-theater) .compact-analysis {
    margin-left: 10px;
    padding: 8px;
  }
  .reference-rhythm {
    gap: 10px;
  }
  .reference-rhythm > strong {
    display: none;
  }
  .reference-bars {
    gap: 3px;
  }
  .reference-balls b {
    width: 18px;
    height: 18px;
  }
  .reference-rhythm-label {
    font-size: 9px;
    min-width: 45px;
  }
}
@media (max-width: 760px) {
  main {
    height: auto;
    padding: 8px;
  }
  .stage-shell:not(.is-theater) {
    height: 1300px !important;
  }
  .stage-shell:not(.is-theater) .tv-top {
    height: 55px;
    gap: 5px;
  }
  .stage-shell:not(.is-theater) .tv-series {
    display: none !important;
  }
  .stage-shell:not(.is-theater) .tv-round {
    margin-left: 0;
    padding: 4px 6px;
    margin-right: auto;
  }
  .stage-shell:not(.is-theater) .tv-top button {
    font-size: 9px;
    padding: 6px;
  }
  .stage-shell:not(.is-theater) .tv-scene.tv-draw {
    grid-template-columns: 90px minmax(0, 1fr);
    grid-template-rows: 490px 95px minmax(0, 1fr) 100px;
  }
  .stage-shell:not(.is-theater) .compact-analysis {
    grid-column: 1/-1;
    grid-row: 3;
    margin: 0;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 25px 48px 100px minmax(0, 1fr) 20px;
  }
  .stage-shell:not(.is-theater) .ca-head,
  .stage-shell:not(.is-theater) .ca-focus,
  .stage-shell:not(.is-theater) .ca-heat-section,
  .stage-shell:not(.is-theater) .ca-note {
    grid-column: 1/-1;
  }
  .reference-bottom {
    grid-row: 2;
    grid-column: 1/-1;
  }
  .reference-rhythm {
    grid-row: 4;
    grid-column: 1/-1;
    flex-direction: column;
    align-items: stretch;
  }
  .stage-shell:not(.is-theater) .tv-host {
    padding: 7px 4px;
  }
  .stage-shell:not(.is-theater) .tv-board-area {
    padding: 8px 6px;
  }
  .stage-shell:not(.is-theater) .tv-number {
    font-size: 12px;
  }
  .stage-shell:not(.is-theater) .tv-number > small {
    display: none;
  }
  .stage-shell:not(.is-theater) .tv-host-art {
    width: 78px;
    height: 78px;
  }
  .stage-shell:not(.is-theater) .compact-picker button {
    font-size: 9px;
  }
  .stage-shell:not(.is-theater) .ca-heat-grid {
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }
  .stage-shell:not(.is-theater) .live-scene {
    inset: 30px 6px 112px;
  }
  .reference-balls b {
    width: 14px;
    height: 14px;
    font-size: 8px;
  }
  .reference-balls {
    gap: 3px;
  }
  .reference-card {
    padding: 8px;
  }
  .reference-card h3 {
    font-size: 11px;
  }
  .reference-saved button {
    font-size: 9px;
  }
  .reference-card h3 small {
    display: none;
  }
  .reference-rhythm-block {
    min-height: 30px;
  }
  .reference-bars {
    height: 28px;
  }
}
/* Collection: all 21 designs in a single desktop view. */
.stage-shell:not(.is-theater) .tv-show {
  background: #06182b !important;
}
#gallery {
  box-sizing: border-box;
  width: min(1180px, 96vw);
  height: min(660px, 92dvh);
  max-height: 92dvh;
  padding: 18px;
  overflow: hidden;
  border-radius: 20px;
  background: #0a1c30;
  color: #f4f7fc;
}
#gallery[open] {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#gallery .gallery-top {
  flex: none;
  gap: 12px;
}
#gallery .gallery-top h2 {
  font-size: 23px;
  margin: 4px 0;
}
#gallery .gallery-top .tag {
  font-size: 10px;
  color: #95abc4;
}
#closeGallery {
  width: 36px;
  height: 36px;
  padding: 0;
  flex: none;
  border-radius: 50%;
}
#galleryGrid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
}
#gallery .galleryItem {
  min-width: 0;
  min-height: 0;
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 12px;
  position: relative;
  transition:
    border-color 0.18s,
    background 0.18s;
}
#gallery .galleryItem .art {
  flex: 1;
  min-height: 0;
  width: auto;
  height: auto;
  aspect-ratio: 1;
  max-width: 100%;
}
#gallery .galleryItem b {
  flex: none;
  font-size: 12px;
  line-height: 16px;
  margin: 5px 0 2px;
  color: #f7e4bd;
}
#gallery .galleryItem small {
  flex: none;
  font-size: 9px;
  line-height: 12px;
  min-height: 24px;
  max-width: 150px;
  color: #aebed1;
}
#gallery .galleryItem:hover,
#gallery .galleryItem:focus-visible {
  outline: 2px solid #ffd58b;
  outline-offset: -2px;
  background: #29354b;
}
#gallery .galleryItem[aria-pressed='true'] {
  border: 2px solid #f4c36e;
  background: radial-gradient(ellipse at top, #5a3c2e, #14263d);
}
#gallery .galleryItem[aria-pressed='true']:after {
  content: '✓';
  position: absolute;
  right: 7px;
  top: 6px;
  color: #ffd58b;
  font-size: 15px;
}
#gallery > p {
  flex: none;
  margin: 0;
  font-size: 11px;
  color: #9cb0c8;
}
@media (max-width: 800px) {
  #gallery {
    padding: 12px;
    height: 94dvh;
    max-height: 94dvh;
  }
  #galleryGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(7, minmax(104px, 1fr));
    gap: 7px;
  }
  #gallery .gallery-top h2 {
    font-size: 19px;
  }
  #gallery .galleryItem small {
    display: none;
  }
  #gallery .galleryItem .art {
    max-height: 75px;
  }
  #gallery .galleryItem b {
    font-size: 11px;
  }
}
@media (min-width: 801px) and (max-height: 600px) {
  #gallery {
    padding: 10px;
    gap: 6px;
  }
  #gallery .galleryItem small {
    display: none;
  }
  #gallery .galleryItem b {
    font-size: 11px;
  }
  #galleryGrid {
    gap: 6px;
  }
}
/* The embedded stage shares the full-screen mascot palette. */
.stage-shell:not(.is-theater) .tv-host {
  background: radial-gradient(ellipse at 50% 20%, var(--show-panel), var(--show-bg) 78%);
  border: 1px solid color-mix(in srgb, var(--show-accent) 35%, transparent);
  border-right: 0;
  color: var(--show-bright);
}
.stage-shell:not(.is-theater) .tv-board-area {
  background: radial-gradient(ellipse at 45% 0%, var(--show-panel), var(--show-bg) 85%);
  border: 1px solid color-mix(in srgb, var(--show-accent) 35%, transparent);
  border-left: 1px solid #ffffff12;
  color: var(--show-bright);
  box-shadow: inset 0 1px #ffffff0d;
}
.stage-shell:not(.is-theater) .tv-host-name,
.stage-shell:not(.is-theater) .tv-board-title h3 {
  color: var(--show-bright);
}
.stage-shell:not(.is-theater) .emission-caption,
.stage-shell:not(.is-theater) .tv-host-count,
.stage-shell:not(.is-theater) .compact-picker label,
.stage-shell:not(.is-theater) .compact-legend,
.stage-shell:not(.is-theater) .tv-board-title span,
.stage-shell:not(.is-theater) .tv-splits {
  color: #d4ced4;
}
.stage-shell:not(.is-theater) .compact-legend b,
.stage-shell:not(.is-theater) .tv-splits b {
  color: var(--show-accent);
}
.stage-shell:not(.is-theater) .tv-number {
  background: #ffffff09;
  color: #eee8e9;
  border-color: #ffffff26;
  box-shadow: inset 0 1px #ffffff0c;
  border-radius: 10px;
  opacity: 1;
}
.stage-shell:not(.is-theater) .tv-number > small {
  color: #b8b0bd;
}
.stage-shell:not(.is-theater) .tv-number.out {
  background: linear-gradient(135deg, var(--show-bright), var(--show-accent));
  color: #342410;
  border-color: var(--show-bright);
  box-shadow: 0 2px 9px #0003;
}
.stage-shell:not(.is-theater) .tv-number.out > small {
  color: #59432d;
}
.stage-shell:not(.is-theater) .tv-number.user-pick {
  background: linear-gradient(135deg, #ff6680, #d91f4b);
  color: #fff;
  border: 1px solid #ffb2bd;
  box-shadow:
    0 0 0 1px #ff668044,
    0 2px 10px #ef335033;
}
.stage-shell:not(.is-theater) .tv-number.user-pick > small {
  color: #ffe6ed;
}
.stage-shell:not(.is-theater) .compact-selected {
  background: #0004;
  border: 1px solid #ffffff1c;
}
.stage-shell:not(.is-theater) .compact-selected-slots .empty {
  background: #ffffff09;
  border-color: #ffffff26;
}
.stage-shell:not(.is-theater) .compact-picker .ghost,
.stage-shell:not(.is-theater) .compact-picker select {
  background: var(--show-bg);
  color: #efe7e2;
  border-color: #ffffff33;
}
.stage-shell:not(.is-theater) .compact-picker button:disabled {
  opacity: 0.4;
}
.stage-shell:not(.is-theater) .tv-ball {
  background: radial-gradient(circle at 30% 20%, var(--show-bright), var(--show-accent) 65%, #8e5c29);
  border-color: var(--show-bright);
  color: #3d2717;
  box-shadow: 0 0 24px color-mix(in srgb, var(--show-accent) 22%, transparent);
}
.stage-shell:not(.is-theater) .tv-series {
  border-color: var(--show-accent);
}

/* ---------- phần bổ sung của site: mua vé + thanh trên cùng cho di động ---------- */
.kl-buy {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.kl-buy select {
  padding: 5px 6px;
  font-size: 12px;
  background: #152a41;
  color: #f2dbb0;
  border: 1px solid #536177;
  border-radius: 8px;
}
.kl-buy button {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
}
.kl-buy .kl-cart {
  background: #ffffff0d;
  color: #ffe3ae;
  border: 1px solid #ffffff3d;
}
.kl-buy .kl-pay {
  background: linear-gradient(110deg, #ffe8ad, #dfac52);
  color: #552219;
  border: 1px solid #ffe2a2;
}
.kl-top {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #091f36;
  border-bottom: 1px solid #ffffff13;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.kl-top a {
  color: #e7f0ff;
  text-decoration: none;
}
.kl-top .kl-back {
  font-size: 28px;
  line-height: 1;
  width: 26px;
}
.kl-top b {
  font-size: 16px;
  flex: 1;
}
.kl-top .kl-bag {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid #ffffff24;
  border-radius: 8px;
  background: #152b44;
}
@media (max-width: 600px) {
  .kl-top {
    display: flex;
  }
  .compact-selected {
    flex-wrap: wrap;
  }
  .kl-buy {
    width: 100%;
    margin-left: 0;
  }
  .kl-buy button {
    flex: 1;
  }
}

/* Keno cơ bản: khung dashboard theo thiết kế mới, giữ nguyên dữ liệu và thao tác hiện có. */
@media (min-width: 761px) {
  .kl-body {
    height: 100dvh;
    overflow: hidden;
  }
  main {
    height: calc(100dvh - 42px);
    min-height: 0;
    max-width: none;
    padding: 4px 18px 6px;
  }
  .layout {
    height: 100% !important;
    min-height: 0;
  }
  .stage-shell:not(.is-theater) {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  .stage-shell:not(.is-theater) .tv-scene.tv-draw {
    grid-template-columns: minmax(128px, 15%) minmax(0, 1fr) minmax(235px, 28%);
    grid-template-rows: minmax(0, 1fr) clamp(76px, 13vh, 100px) clamp(50px, 8vh, 66px);
    gap: 8px 0;
    padding: 8px;
  }
}

/* The reference is a compact control-room view; keep its three-column hierarchy on small landscape displays. */
@media (min-width: 500px) and (max-width: 760px) {
  .kl-body {
    height: 100dvh;
    overflow: hidden;
  }
  .kl-top {
    height: 40px;
    min-height: 40px;
    padding: 4px 10px;
    gap: 8px;
  }
  .kl-top b {
    font-size: 13px;
  }
  .kl-top .kl-back {
    font-size: 24px;
  }
  .kl-top .kl-bag {
    padding: 4px 7px;
    font-size: 10px;
  }
  main {
    height: calc(100dvh - 40px);
    min-height: 0 !important;
    max-width: none;
    padding: 4px clamp(8px, 2.5vw, 16px) !important;
    overflow: hidden;
  }
  .layout {
    height: 100% !important;
    min-height: 0 !important;
  }
  .stage-shell:not(.is-theater) {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }
  .stage-shell:not(.is-theater) .tv-top {
    height: 34px;
    min-height: 34px;
    flex: none;
    gap: 4px;
    padding: 3px 6px;
    border-bottom: 1px solid #f32aa455;
  }
  .stage-shell:not(.is-theater) .tv-brand {
    display: none !important;
  }
  .stage-shell:not(.is-theater) .tv-series {
    display: block !important;
    position: relative;
    margin-left: 78px;
    padding-left: 6px;
    border-left: 2px solid var(--show-accent);
    font-size: 6px;
    line-height: 1.2;
    letter-spacing: 0.5px;
  }
  .stage-shell:not(.is-theater) .tv-series:before {
    left: -78px;
    top: -4px;
    font-size: 23px;
    letter-spacing: -1.5px;
  }
  .stage-shell:not(.is-theater) .tv-series strong {
    display: block;
    font-size: 10px;
  }
  .stage-shell:not(.is-theater) .tv-round {
    gap: 2px;
    margin: 0 0 0 auto;
    padding: 2px 4px;
    border-radius: 5px;
  }
  .stage-shell:not(.is-theater) .tv-round > span {
    font-size: 6px;
  }
  .stage-shell:not(.is-theater) .tv-round b {
    font-size: 14px;
    letter-spacing: 0;
  }
  .stage-shell:not(.is-theater) .tv-top button {
    padding: 3px 5px;
    border-radius: 5px;
    font-size: 7px;
  }
  .stage-shell:not(.is-theater) .tv-main {
    flex: 1;
    min-height: 0;
    margin: 0;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .tv-scene.tv-draw {
    grid-template-columns: minmax(82px, 19%) minmax(0, 1fr) minmax(116px, 27%);
    grid-template-rows: minmax(0, 1fr) 62px 36px;
    gap: 4px 3px;
    padding: 4px;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .tv-host {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 3px;
    border-radius: 7px;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .tv-host-art {
    width: min(100%, 54px);
    height: clamp(34px, 12vh, 52px);
    flex: none;
  }
  .stage-shell:not(.is-theater) .tv-host-name {
    display: block;
    font-size: 7px;
    line-height: 1.1;
    margin: 0;
    text-align: center;
  }
  .stage-shell:not(.is-theater) .tv-ball {
    width: clamp(32px, 7.5vw, 42px);
    height: clamp(32px, 7.5vw, 42px);
    font-size: 19px;
    margin: 1px 0;
  }
  .stage-shell:not(.is-theater) .tv-host-count {
    max-width: 100%;
    font-size: 6px;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0;
    text-align: center;
  }
  .stage-shell:not(.is-theater) .compact-picker {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    margin-top: 2px;
  }
  .stage-shell:not(.is-theater) .compact-picker label {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    font-size: 6px;
    line-height: 1.1;
  }
  .stage-shell:not(.is-theater) .compact-picker select {
    min-width: 0;
    max-width: 68%;
    padding: 1px 2px;
    font-size: 6px;
    line-height: 1.2;
  }
  .stage-shell:not(.is-theater) .compact-picker button {
    min-width: 0;
    min-height: 13px;
    padding: 2px 1px;
    border-radius: 4px;
    font-size: 6px;
    line-height: 1.05;
    white-space: normal;
  }
  .stage-shell:not(.is-theater) .compact-picker #compactSaved {
    grid-column: 1/-1;
    max-width: none;
    padding: 2px;
    font-size: 6px;
  }
  .stage-shell:not(.is-theater) .tv-board-area {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    gap: 3px;
    padding: 5px 4px 3px;
  }
  .stage-shell:not(.is-theater) .tv-board-title {
    gap: 3px;
    min-width: 0;
  }
  .stage-shell:not(.is-theater) .tv-board-title h3 {
    min-width: 0;
    font-size: 12px;
    line-height: 1.1;
  }
  .stage-shell:not(.is-theater) .tv-board-title span {
    font-size: 6px;
  }
  .stage-shell:not(.is-theater) .compact-legend {
    gap: 4px;
    font-size: 6px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .tv-number-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: repeat(8, minmax(0, 1fr));
    gap: 2px;
    min-height: 0;
  }
  .stage-shell:not(.is-theater) .tv-number {
    height: auto;
    min-height: 0;
    padding: 0;
    font-size: clamp(8px, 1.8vw, 11px);
    line-height: 1;
    border-radius: 4px;
  }
  .stage-shell:not(.is-theater) .tv-number > small {
    display: block !important;
    font-size: 5px;
    line-height: 1;
  }
  .stage-shell:not(.is-theater) .tv-splits {
    gap: 4px;
    padding: 2px 0;
    font-size: 6px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .tv-splits b {
    font-size: 8px;
  }
  .stage-shell:not(.is-theater) .compact-selected {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 0;
    margin: 0;
    padding: 2px 3px;
    border-radius: 5px;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .compact-selected-label {
    flex: none;
    font-size: 6px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .compact-selected-slots {
    flex-wrap: nowrap;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .compact-selected-slots button {
    flex: none;
    width: 17px;
    height: 17px;
    min-width: 0;
    padding: 0;
    border-radius: 50%;
    font-size: 7px;
  }
  .stage-shell:not(.is-theater) .compact-analysis {
    grid-column: 3;
    grid-row: 1/3;
    min-width: 0;
    min-height: 0;
    margin: 0 0 0 2px;
    padding: 4px;
    display: grid;
    grid-template-rows: 16px 34px 40px 31px minmax(42px, 1fr) 17px;
    gap: 2px;
    border-radius: 6px;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .ca-head {
    min-width: 0;
    font-size: 8px;
    line-height: 1.1;
  }
  .stage-shell:not(.is-theater) .ca-head select {
    max-width: 60px;
    padding: 1px 2px;
    font-size: 6px;
  }
  .stage-shell:not(.is-theater) .ca-focus {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 3px;
    padding: 3px;
    min-width: 0;
  }
  .stage-shell:not(.is-theater) .ca-focus > strong {
    font-size: 18px;
    line-height: 1;
  }
  .stage-shell:not(.is-theater) .ca-focus span {
    font-size: 6px;
    line-height: 1.25;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .ca-rank-title {
    font-size: 6px;
    line-height: 8px;
    margin: 0 0 1px;
  }
  .stage-shell:not(.is-theater) #caHot {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) #caHot button {
    height: 5px;
    padding: 0;
    grid-template-columns: 13px minmax(0, 1fr) 15px;
    gap: 1px;
    font-size: 6px;
    line-height: 5px;
  }
  .stage-shell:not(.is-theater) #caHot button small {
    font-size: 5px;
    line-height: 5px;
  }
  .stage-shell:not(.is-theater) #caGap {
    display: flex;
    gap: 1px;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) #caGap button {
    flex: 1;
    min-width: 0;
    height: 19px;
    padding: 1px 0;
    font-size: 6px;
    line-height: 8px;
  }
  .stage-shell:not(.is-theater) #caGap button small {
    font-size: 5px;
    line-height: 6px;
  }
  .stage-shell:not(.is-theater) .ca-heat-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    grid-column: auto;
  }
  .stage-shell:not(.is-theater) .ca-heat-title {
    flex: none;
    font-size: 6px;
    line-height: 8px;
    margin: 0 0 1px;
  }
  .stage-shell:not(.is-theater) .ca-heat-title small,
  .stage-shell:not(.is-theater) .ca-heat-legend {
    display: none;
  }
  .stage-shell:not(.is-theater) .ca-heat-grid {
    flex: 1;
    min-height: 0;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: repeat(8, minmax(0, 1fr));
    gap: 1px;
  }
  .stage-shell:not(.is-theater) .ca-heat-grid button {
    height: 100%;
    min-height: 0;
    padding: 0;
    font-size: 5px;
    border-radius: 1px;
  }
  .stage-shell:not(.is-theater) .ca-note {
    margin: 0;
    font-size: 5px;
    line-height: 1.1;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .reference-bottom {
    grid-column: 1/3;
    grid-row: 2;
    grid-template-columns: 1.1fr 1fr;
    gap: 3px;
    min-width: 0;
  }
  .stage-shell:not(.is-theater) .reference-card {
    padding: 3px 4px;
    border-radius: 5px;
  }
  .stage-shell:not(.is-theater) .reference-card h3 {
    font-size: 7px;
    line-height: 1.1;
    margin: 0 0 2px;
    gap: 2px;
  }
  .stage-shell:not(.is-theater) .reference-card h3 small {
    font-size: 5px;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .reference-balls {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 1px;
    max-width: none;
  }
  .stage-shell:not(.is-theater) .reference-balls b {
    width: 11px;
    height: 11px;
    max-width: 100%;
    font-size: 6px;
  }
  .stage-shell:not(.is-theater) .reference-saved {
    font-size: 6px;
    line-height: 1.2;
  }
  .stage-shell:not(.is-theater) .reference-rhythm {
    grid-column: 1/-1;
    grid-row: 3;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 5px;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .reference-rhythm > strong {
    display: block !important;
    flex: none;
    font-size: 6px;
  }
  .stage-shell:not(.is-theater) .reference-rhythm-block {
    gap: 3px;
    min-width: 0;
  }
  .stage-shell:not(.is-theater) .reference-rhythm-label {
    min-width: 28px;
    font-size: 5px;
    line-height: 1.1;
  }
  .stage-shell:not(.is-theater) .reference-bars {
    height: 24px;
    gap: 1px;
  }
  .stage-shell:not(.is-theater) .tv-controls {
    height: 28px;
    min-height: 28px;
    flex: none;
    gap: 3px;
    padding: 3px 5px;
  }
  .stage-shell:not(.is-theater) .tv-controls .tv-dots {
    display: none !important;
  }
  .stage-shell:not(.is-theater) .tv-controls button {
    padding: 3px 5px;
    font-size: 6px;
  }
  .stage-shell:not(.is-theater) .tv-music-wrap {
    gap: 2px;
  }
  .stage-shell:not(.is-theater) #tvVolume {
    width: 34px;
    height: 10px;
  }
  .stage-shell:not(.is-theater) .tv-status {
    margin-left: auto;
    font-size: 5px;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .live-scene {
    inset: 26px 4px 43px;
  }
}

.kl-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.kl-body > main {
  flex: 1 1 auto;
  height: auto !important;
  min-height: 0 !important;
  max-width: none;
  margin: 0;
  padding: 4px clamp(8px, 2.5vw, 16px) !important;
  overflow: hidden;
}
.stage-shell:not(.is-theater) .live-scene {
  z-index: 30;
  background-color: var(--show-bg);
}
.stage-shell:not(.is-theater) .live-scene.enter {
  animation: none;
}
.stage-shell:not(.is-theater) .tv-cell-emblem {
  display: none;
}
.tv-draw > .live-scene {
  inset: 0 !important;
  z-index: 30;
  border-radius: 0;
}
.stage-shell:not(.is-theater) .tv-draw > .live-scene {
  position: absolute;
  inset: 0 !important;
}
.stage-shell.is-theater .tv-draw > .live-scene {
  position: absolute;
  inset: 0 !important;
}

@media (max-width: 499px) {
  .kl-body {
    display: block;
    height: auto;
    min-height: 100%;
    overflow: visible;
  }
  .kl-body > main {
    height: auto !important;
    min-height: 0 !important;
    flex: none;
    overflow: visible;
  }
}

/* ---------- Thiết kế mới của bảng Keno (chỉ giao diện/bố cục, không đổi luồng) ---------- */
.kd-mascot,
.kd-last,
.kd-foot {
  display: contents;
}
.kd-last > small {
  display: none;
}
@media (max-width: 879px) {
  .stage-shell:not(.is-theater) .tv-board-title {
    flex-wrap: wrap;
    gap: 2px 8px;
  }
  .stage-shell:not(.is-theater) .tv-board-title .compact-legend {
    order: 3;
    flex: 0 0 100%;
    margin: 0;
  }
}
@media (min-width: 880px) {
  .stage-shell:not(.is-theater) .tv-scene.tv-draw {
    --kd-host: clamp(176px, 15.5vw, 236px);
    --kd-title: 42px;
    grid-template-columns: var(--kd-host) minmax(0, 1fr) minmax(280px, 27%);
    grid-template-rows: minmax(0, 1fr) clamp(84px, 11vh, 104px) clamp(50px, 8vh, 66px);
    gap: 10px 0;
    padding: 8px;
  }

  /* khung sân khấu: cột linh vật + bảng 80 số dùng chung một nền */
  .stage-shell:not(.is-theater) .tv-host,
  .stage-shell:not(.is-theater) .tv-board-area {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--show-panel) 42%, #0b0609),
      color-mix(in srgb, var(--show-bg) 72%, #050306)
    );
    border: 1px solid color-mix(in srgb, var(--show-accent) 26%, transparent);
    box-shadow: none;
  }
  .stage-shell:not(.is-theater) .tv-host {
    border-right: 0;
    border-radius: 14px 0 0 14px;
    padding: calc(var(--kd-title) + 9px) 12px 10px;
    gap: 7px;
    justify-content: flex-start;
  }
  .stage-shell:not(.is-theater) .tv-board-area {
    border-left: 0;
    border-radius: 0 14px 14px 0;
    padding: 0 14px 12px 4px;
    gap: 8px;
  }

  /* thanh tiêu đề chạy hết chiều ngang khung */
  .stage-shell:not(.is-theater) .tv-board-title {
    position: relative;
    z-index: 2;
    flex: none;
    justify-content: flex-start;
    gap: 14px;
    height: var(--kd-title);
    margin: 0 -14px 2px calc(-5px - var(--kd-host));
    padding: 0 14px;
    background: #ffffff0a;
    border-bottom: 1px solid #ffffff17;
    border-radius: 13px 13px 0 0;
  }
  .stage-shell:not(.is-theater) .tv-board-title h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .tv-board-title h3:before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff3b57;
    box-shadow: 0 0 0 3px #ff3b5733;
  }
  .stage-shell:not(.is-theater) .tv-board-title > span {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--show-accent) 45%, transparent);
    border-radius: 7px;
    background: #0005;
    color: var(--show-bright);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .tv-board-title > span:before {
    content: 'KỲ: ';
    opacity: 0.75;
  }
  .stage-shell:not(.is-theater) .compact-legend {
    margin: 0;
    gap: 12px;
    font-size: 10px;
    color: #b9aeb4;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
  }
  .stage-shell:not(.is-theater) .compact-legend b {
    color: var(--show-accent);
    font-weight: 600;
  }
  .stage-shell:not(.is-theater) .compact-legend em {
    color: #ff6b84;
    font-style: normal;
  }

  /* bảng 80 số */
  .stage-shell:not(.is-theater) .tv-number-grid {
    gap: 6px;
    padding: 8px;
    background: #0000002e;
    border: 1px solid #ffffff12;
    border-radius: 12px;
  }
  .stage-shell:not(.is-theater) .tv-number {
    background: #00000052;
    border: 1px solid #ffffff1c;
    border-radius: 8px;
    color: #f4eef0;
    font-size: clamp(14px, 2vh, 19px);
    font-weight: 700;
    box-shadow: none;
  }
  .stage-shell:not(.is-theater) .tv-number > small {
    color: #9d9198;
    font-size: 8px;
    font-weight: 400;
  }
  .stage-shell:not(.is-theater) .tv-number.out {
    background: linear-gradient(135deg, var(--show-bright), var(--show-accent));
    color: #342410;
    border-color: var(--show-bright);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--show-accent) 28%, transparent);
  }
  .stage-shell:not(.is-theater) .tv-number.out > small {
    color: #59432d;
  }
  .stage-shell:not(.is-theater) .tv-number.user-pick {
    background: linear-gradient(135deg, #ff6680, #d91f4b);
    color: #fff;
    border: 1px solid #ffb2bd;
    box-shadow:
      0 0 0 1px #ff668044,
      0 2px 10px #ef335033;
  }
  .stage-shell:not(.is-theater) .tv-number.user-pick > small {
    color: #ffe6ed;
  }
  .stage-shell:not(.is-theater) .tv-number.user-pick:after {
    right: -4px;
    top: -5px;
    width: 14px;
    height: 14px;
    line-height: 13px;
    font-size: 9px;
    box-shadow: 0 1px 3px #0006;
  }

  /* hàng dưới bảng: Lớn/Nhỏ/Chẵn/Lẻ + bộ đang chọn */
  .stage-shell:not(.is-theater) .kd-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    flex: none;
    min-width: 0;
  }
  .stage-shell:not(.is-theater) .tv-splits {
    flex: none;
    gap: 6px;
    padding: 0;
    border: 0;
    font-size: 11px;
    color: #d9d0d4;
  }
  .stage-shell:not(.is-theater) .tv-splits span {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #0000004d;
    border: 1px solid #ffffff1a;
    border-radius: 8px;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .tv-splits b {
    font-size: 12px;
    color: var(--show-accent);
  }
  .stage-shell:not(.is-theater) .compact-selected {
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-width: 0;
    margin: 0;
    min-height: 38px;
    padding: 5px 6px 5px 12px;
    gap: 5px 8px;
    background: color-mix(in srgb, var(--show-panel) 45%, #0000);
    border: 1px solid #ff4d6d59;
    border-radius: 10px;
  }
  .stage-shell:not(.is-theater) .compact-selected-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffe9ee;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .compact-selected-label br {
    display: none;
  }
  .stage-shell:not(.is-theater) .compact-selected-label b:before {
    content: ' (';
  }
  .stage-shell:not(.is-theater) .compact-selected-label b:after {
    content: '):';
  }
  .stage-shell:not(.is-theater) .compact-selected-slots {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    gap: 5px;
  }
  .stage-shell:not(.is-theater) .compact-selected-slots button {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    max-width: none;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    background: radial-gradient(circle at 32% 26%, #ff9fb0, #ff3b57 45%, #c9163a);
    border-color: #ff9db0;
  }
  .stage-shell:not(.is-theater) .compact-selected-slots .empty {
    background: #ffffff0d;
    border: 1px dashed #ffffff33;
  }
  .stage-shell:not(.is-theater) .kl-buy select {
    background: #0006;
    border-color: #ffffff33;
    color: #ffe9c2;
  }
  .stage-shell:not(.is-theater) .kl-buy button {
    padding: 6px 11px;
    font-size: 11px;
  }

  /* cột linh vật */
  .stage-shell:not(.is-theater) .kd-mascot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: none;
    width: min(100%, 150px);
    padding: 8px 8px 0;
    background: #0000004d;
    border: 1px solid var(--show-accent);
    border-radius: 10px;
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--show-accent) 14%, transparent);
  }
  .stage-shell:not(.is-theater) .tv-host-art {
    width: clamp(54px, 9vh, 104px);
    height: clamp(54px, 9vh, 104px);
  }
  .stage-shell:not(.is-theater) .tv-host-name {
    margin: 2px 0 -9px;
    padding: 3px 12px;
    border-radius: 5px;
    background: linear-gradient(180deg, var(--show-bright), var(--show-accent));
    color: #3a2208;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: 112%;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
  }
  .stage-shell:not(.is-theater) .emission-caption {
    display: none;
  }
  .stage-shell:not(.is-theater) .kd-last {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: none;
    width: 100%;
    margin-top: 10px;
    padding: 10px 8px;
    background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--show-panel) 80%, #000), #0000004d);
    border: 1px solid #ffffff21;
    border-radius: 12px;
  }
  .stage-shell:not(.is-theater) .kd-last > small {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--show-accent);
  }
  .stage-shell:not(.is-theater) .tv-ball {
    width: clamp(46px, 7.5vh, 86px);
    height: clamp(46px, 7.5vh, 86px);
    margin: 0;
    font-size: clamp(22px, 3.7vh, 40px);
    color: #fff;
    background: radial-gradient(circle at 32% 26%, #ffc6cf, #ff4d6d 38%, #c9163a 80%);
    border-color: #ff9db0;
    box-shadow:
      0 0 0 4px #ff4d6d1f,
      0 8px 22px #ff3b5740;
    text-shadow: 0 2px 2px #9a1632;
  }
  .stage-shell:not(.is-theater) .tv-host-count {
    margin: 0;
    padding: 4px 10px;
    background: #00000059;
    border: 1px solid #ffffff21;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #f1e6e9;
    white-space: nowrap;
  }
  .stage-shell:not(.is-theater) .compact-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: auto;
  }
  .stage-shell:not(.is-theater) .compact-picker > * {
    grid-column: 1/-1;
    min-width: 0;
  }
  .stage-shell:not(.is-theater) .compact-picker label {
    font-size: 11px;
    font-weight: 700;
    color: #f1e6e9;
  }
  .stage-shell:not(.is-theater) .compact-picker label select {
    background: #0006;
    color: var(--show-bright);
    border: 1px solid var(--show-accent);
    border-radius: 7px;
    padding: 4px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .stage-shell:not(.is-theater) .compact-picker button {
    padding: 8px 6px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    border: 0;
  }
  .stage-shell:not(.is-theater) .compact-picker #compactOne {
    background: linear-gradient(180deg, #ff5d78, #e11d48);
    color: #fff;
    box-shadow: 0 4px 12px #e11d4840;
  }
  .stage-shell:not(.is-theater) .compact-picker #compactFill {
    background: linear-gradient(180deg, #ffc24d, #e08a12);
    color: #3a2208;
    box-shadow: 0 4px 12px #e08a1233;
  }
  .stage-shell:not(.is-theater) .compact-picker #compactClear {
    grid-column: 1;
    background: #0000004d;
    color: #efe7e2;
    border: 1px solid #ffffff2e;
    padding: 7px 4px;
  }
  .stage-shell:not(.is-theater) .compact-picker #compactSave {
    grid-column: 2;
    background: #1b2f5c;
    color: #e6eeff;
    border: 1px solid #3e5a9a;
    padding: 7px 4px;
  }
  .stage-shell:not(.is-theater) .compact-picker #compactSaved {
    background: #0000004d;
    color: #efe7e2;
    border: 1px solid #ffffff2e;
    border-radius: 9px;
    padding: 6px;
    font-size: 10px;
    text-align: center;
  }

  /* Lăng kính dữ liệu */
  .stage-shell:not(.is-theater) .compact-analysis {
    grid-column: 3;
    margin-left: 12px;
    padding: 14px;
    gap: 9px;
    background: #0b1d35;
    border: 1px solid #223a5c;
    border-radius: 14px;
  }
  .stage-shell:not(.is-theater) .ca-head {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #fff;
  }
  .stage-shell:not(.is-theater) .ca-head select {
    background: #0000;
    border: 1px solid #4a6a94;
    border-radius: 20px;
    color: #dbe8fb;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .stage-shell:not(.is-theater) .ca-head select option {
    background: #0b1d35;
    color: #dbe8fb;
  }
  .stage-shell:not(.is-theater) .ca-focus {
    grid-template-columns: 44px 1fr;
    gap: 12px;
    padding: 8px 10px;
    background: linear-gradient(90deg, #12294a, #0d2038);
    border: 1px solid #27425f;
    border-radius: 10px;
  }
  .stage-shell:not(.is-theater) .ca-focus > strong {
    display: grid;
    place-items: center;
    width: 44px;
    height: 38px;
    border: 2px solid #fff;
    border-radius: 9px;
    background: #0006;
    color: #fff;
    font-size: 21px;
    letter-spacing: 0;
  }
  .stage-shell:not(.is-theater) .ca-focus span b {
    color: #ffb84d;
  }
  .stage-shell:not(.is-theater) .ca-rank-title {
    font-size: 10px;
    font-weight: 700;
    color: #eaf1fb;
  }
  .stage-shell:not(.is-theater) .hot-bar {
    background: #16304d;
  }
  .stage-shell:not(.is-theater) .hot-bar i {
    background: linear-gradient(90deg, #ff3152, #ff9a3d 60%, #ffe27a);
  }
  .stage-shell:not(.is-theater) #caGap button {
    background: #0d2440;
    border-color: #2c4a6b;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
  }
  .stage-shell:not(.is-theater) .ca-heat-grid {
    gap: 2px;
    padding: 4px;
    background: #00000038;
    border: 1px solid #223a5c;
    border-radius: 8px;
  }

  /* hai thẻ dưới */
  .stage-shell:not(.is-theater) .reference-card {
    background: #0b1d35;
    border: 1px solid #223a5c;
    border-radius: 14px;
    padding: 8px 14px;
  }
  .stage-shell:not(.is-theater) .reference-card h3 {
    align-items: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 6px;
    line-height: 20px;
  }
  .stage-shell:not(.is-theater) .reference-card h3 small {
    text-transform: none;
    letter-spacing: 0;
  }
  .stage-shell:not(.is-theater) .reference-card:first-child h3 {
    justify-content: flex-start;
    gap: 10px;
  }
  .stage-shell:not(.is-theater) .reference-card:first-child h3 small {
    padding: 2px 8px;
    border: 1px solid #3e5a9a;
    border-radius: 6px;
    color: #9fc0ff;
    font-weight: 700;
  }
  .stage-shell:not(.is-theater) .reference-card:nth-child(2) h3 small {
    color: #5fa8ff;
    font-size: 10px;
  }
  .stage-shell:not(.is-theater) .reference-balls {
    max-width: none;
    justify-items: center;
    gap: 5px 4px;
  }
  .stage-shell:not(.is-theater) .reference-balls b {
    width: clamp(18px, 2.6vh, 28px);
    height: clamp(18px, 2.6vh, 28px);
    font-size: clamp(8px, 1.15vh, 11px);
    color: #1c2738;
    background: radial-gradient(circle at 32% 26%, #fff, #d2d9e3 55%, #8d98a9);
    box-shadow: 0 2px 5px #0006;
  }
  .stage-shell:not(.is-theater) .reference-balls b.hit {
    color: #fff;
    background: radial-gradient(circle at 32% 26%, #ff9fb0, #ff3b57 45%, #c9163a);
  }

  /* Nhịp điệu Keno + thanh điều khiển */
  .stage-shell:not(.is-theater) .reference-rhythm {
    background: #0b1d35;
    border: 1px solid #223a5c;
    border-radius: 14px;
    padding: 8px 16px;
  }
  .stage-shell:not(.is-theater) .reference-rhythm > strong {
    font-size: 14px;
    font-weight: 800;
  }
  .stage-shell:not(.is-theater) .reference-bars button {
    background: #3b82d6;
  }
  .stage-shell:not(.is-theater) .reference-bars i {
    background: #ef3550;
  }
  .stage-shell:not(.is-theater) .tv-controls {
    height: 38px;
    padding: 6px 8px 0;
    gap: 10px;
  }
  .stage-shell:not(.is-theater) .tv-controls button {
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    background: #0c2440;
    border-color: #2c4a6b;
    color: #dbe8fb;
  }
  .stage-shell:not(.is-theater) .tv-controls #tvNow {
    background: linear-gradient(180deg, #3d97ff, #1667e0);
    border-color: #6fb2ff;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px #1667e04d;
  }
}
/* đủ cao: Dấu ấn kỳ quay dưới sân khấu, Bộ số của bạn dưới cột dữ liệu */
@media (min-width: 880px) and (min-height: 880px) {
  .stage-shell:not(.is-theater) .compact-analysis {
    grid-row: 1;
  }
  .stage-shell:not(.is-theater) .reference-bottom {
    display: contents;
  }
  .stage-shell:not(.is-theater) .reference-card:first-child {
    grid-column: 1/3;
    grid-row: 2;
  }
  .stage-shell:not(.is-theater) .reference-card:nth-child(2) {
    grid-column: 3;
    grid-row: 2;
    margin-left: 12px;
  }
}
/* màn hình thấp: linh vật và số vừa xổ đứng cạnh nhau để các nút chọn số luôn hiển thị đủ */
@media (min-width: 880px) and (max-height: 879px) {
  .stage-shell:not(.is-theater) .tv-scene.tv-draw {
    --kd-title: 36px;
    grid-template-rows: minmax(0, 1fr) clamp(78px, 12vh, 96px) clamp(44px, 7.5vh, 60px);
    gap: 8px 0;
  }
  .stage-shell:not(.is-theater) .tv-host {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: space-between;
    padding: calc(var(--kd-title) + 7px) 8px 8px;
    gap: 6px;
  }
  .stage-shell:not(.is-theater) .kd-mascot {
    width: calc(50% - 3px);
    padding: 4px 4px 0;
    margin-bottom: 6px;
  }
  .stage-shell:not(.is-theater) .tv-host-art {
    width: clamp(36px, 8vh, 64px);
    height: clamp(36px, 8vh, 64px);
  }
  .stage-shell:not(.is-theater) .tv-host-name {
    max-width: 108%;
    margin-bottom: -7px;
    padding: 2px 6px;
    font-size: 8px;
  }
  .stage-shell:not(.is-theater) .kd-last {
    width: calc(50% - 3px);
    margin: 0 0 6px;
    padding: 5px 4px;
    gap: 3px;
  }
  .stage-shell:not(.is-theater) .kd-last > small {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .stage-shell:not(.is-theater) .tv-ball {
    width: clamp(30px, 6.2vh, 50px);
    height: clamp(30px, 6.2vh, 50px);
    font-size: clamp(16px, 3.1vh, 25px);
  }
  .stage-shell:not(.is-theater) .tv-host-count {
    padding: 2px 5px;
    font-size: 7px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
  .stage-shell:not(.is-theater) .compact-picker {
    width: 100%;
    gap: 4px;
  }
  .stage-shell:not(.is-theater) .compact-picker label {
    font-size: 10px;
  }
  .stage-shell:not(.is-theater) .compact-picker button {
    padding: 4px;
    font-size: 10px;
  }
  .stage-shell:not(.is-theater) .compact-picker #compactClear,
  .stage-shell:not(.is-theater) .compact-picker #compactSave {
    padding: 3px;
  }
  .stage-shell:not(.is-theater) .compact-picker #compactSaved {
    padding: 2px;
  }
  .stage-shell:not(.is-theater) .tv-board-area {
    gap: 6px;
    padding-bottom: 8px;
  }
  .stage-shell:not(.is-theater) .tv-number-grid {
    gap: 4px;
    padding: 5px;
  }
  .stage-shell:not(.is-theater) .tv-number {
    font-size: clamp(11px, 1.9vh, 15px);
    line-height: 1;
  }
  .stage-shell:not(.is-theater) .tv-number > small {
    font-size: 7px;
    line-height: 1;
  }
  .stage-shell:not(.is-theater) .compact-analysis {
    padding: 10px;
    gap: 5px;
  }
  .stage-shell:not(.is-theater) .ca-heat-grid button {
    font-size: 7px;
    line-height: 1;
  }
  .stage-shell:not(.is-theater) .reference-card {
    padding: 5px 12px;
  }
  .stage-shell:not(.is-theater) .reference-card h3 {
    margin-bottom: 3px;
    line-height: 18px;
  }
  .stage-shell:not(.is-theater) .reference-balls {
    gap: 3px 4px;
  }
  .stage-shell:not(.is-theater) .tv-controls {
    height: 34px;
  }
  .stage-shell:not(.is-theater) .tv-controls button {
    padding: 5px 12px;
  }
}
/* màn hình hẹp: Lớn/Nhỏ/Chẵn/Lẻ lên thanh tiêu đề, nhường cả hàng dưới cho bộ đang chọn + mua vé */
@media (min-width: 880px) and (max-width: 1499px) {
  .stage-shell:not(.is-theater) .tv-board-area {
    position: relative;
  }
  .stage-shell:not(.is-theater) .tv-board-title .compact-legend {
    flex: 1 1 0;
    margin-right: 236px;
  }
  .stage-shell:not(.is-theater) .tv-board-title > span {
    margin-left: 0;
  }
  .stage-shell:not(.is-theater) .tv-splits {
    position: absolute;
    z-index: 3;
    top: calc((var(--kd-title) - 24px) / 2);
    right: 142px;
    gap: 4px;
    font-size: 10px;
  }
  .stage-shell:not(.is-theater) .tv-splits span {
    padding: 0 7px;
    height: 24px;
  }
}
@media (min-width: 880px) and (max-width: 1099px) {
  .stage-shell:not(.is-theater) .tv-board-title {
    gap: 8px;
  }
  .stage-shell:not(.is-theater) .tv-board-title h3 {
    font-size: 12px;
    letter-spacing: 0;
  }
  .stage-shell:not(.is-theater) .tv-board-title .compact-legend {
    visibility: hidden;
    margin-right: 190px;
  }
  .stage-shell:not(.is-theater) .tv-splits {
    font-size: 9px;
    gap: 3px;
  }
  .stage-shell:not(.is-theater) .tv-splits span {
    padding: 0 5px;
  }
  .stage-shell:not(.is-theater) .tv-splits b {
    font-size: 10px;
  }
  .stage-shell:not(.is-theater) .reference-card h3 {
    font-size: 11px;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
  }
  .stage-shell:not(.is-theater) .reference-card h3 small {
    flex: none;
  }
}

/* ---------- Chế độ nhúng (trang Sản phẩm: #kenoLive[data-embed]) ----------
   Chỉ giữ khối "Kết quả kỳ gần nhất": cột Thần Tài/Số vừa xổ/chọn bộ số, bảng 80 số,
   thanh Lớn/Nhỏ/Chẵn/Lẻ + Bộ đang chọn + mức tiền + Giỏ vé/Mua vé. */
.kl-embed {
  height: auto !important;
  overflow: visible !important;
  background: transparent !important;
}
.kl-embed > main {
  height: auto !important;
  padding: 0 !important;
  overflow: visible !important;
}
.kl-embed .tv-top,
.kl-embed .tv-controls,
.kl-embed .compact-analysis,
.kl-embed .reference-bottom,
.kl-embed .reference-rhythm,
.kl-embed .kl-top,
.kl-embed > header,
.kl-embed > main > footer {
  display: none !important;
}
.kl-embed .layout,
.kl-embed .stage-shell,
.kl-embed .tv-show {
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.kl-embed .stage-shell:before,
.kl-embed .tv-backdrop,
.kl-embed .tv-particles {
  display: none !important;
}
.kl-embed .tv-main {
  height: auto !important;
  min-height: 0 !important;
}
.kl-embed .layout .stage-shell .tv-show {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  height: auto !important;
}
.kl-embed .layout .stage-shell {
  overflow: visible !important;
}
.kl-embed .tv-show .tv-main {
  position: relative !important;
  height: auto !important;
  flex: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active {
  position: relative !important;
  inset: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  grid-template-rows: auto !important;
}
@media (min-width: 880px) {
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active {
    grid-template-columns: 212px minmax(0, 1fr) !important;
  }
}
.kl-embed .layout .stage-shell .tv-show {
  background: transparent !important;
}

/* ---------- Chế độ nhúng: giao diện "Kết quả kỳ gần nhất" theo thiết kế dashboard Keno ---------- */
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active {
  background: radial-gradient(120% 90% at 50% 0, #4a0d22 0, #2b0814 55%, #1d0610 100%) !important;
  border: 1px solid rgba(255, 77, 109, 0.38) !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 40px rgba(120, 0, 30, 0.25) !important;
  padding: 10px 14px 14px !important;
  gap: 12px !important;
  color: #f4f1f3 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-host,
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-area {
  grid-row: 2 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-title {
  grid-row: 1 !important;
  grid-column: 1/-1 !important;
  min-width: 0 !important;
  margin: 0 !important;
  position: static !important;
  width: auto !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 0 2px !important;
  background: none !important;
  border: 0 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-title h3 {
  flex: none !important;
  width: auto !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  transform: none !important;
  position: static !important;
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  margin: 0 !important;
  font:
    900 19px/1.2 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  letter-spacing: 0.2px !important;
  text-transform: uppercase !important;
  color: #fff !important;
  white-space: nowrap !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-title h3::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b5c;
  box-shadow:
    0 0 0 3px rgba(255, 59, 92, 0.25),
    0 0 10px #ff3b5c;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 !important;
  font:
    600 12px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #b9a3ad !important;
  white-space: nowrap !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend b,
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend em {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-style: normal !important;
  font-weight: 600 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend b {
  color: #ffd98a !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend em {
  color: #ff8da0 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend b::before,
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend em::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffd66b;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend em::before {
  background: #ff3b5c;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend span {
  font-size: 11px !important;
  font-weight: 500 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #tvDrawLabel {
  display: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kle-next {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 90, 120, 0.35);
  background: rgba(10, 2, 6, 0.55);
  font-family: 'Be Vietnam Pro', Arial, sans-serif;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kle-next span {
  font-size: 13px;
  font-weight: 600;
  color: #ffd0d8;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kle-next b {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* cột trái */
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-host {
  display: flex !important;
  flex-direction: column !important;
  gap: 9px !important;
  padding: 10px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 90, 120, 0.18) !important;
  background: rgba(20, 3, 9, 0.55) !important;
  height: auto !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kd-mascot {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  position: relative !important;
  margin: 0 auto 6px !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-host-art {
  width: 88px !important;
  height: 88px !important;
  border-radius: 12px !important;
  border: 2px solid #ffd66b !important;
  background: radial-gradient(circle at 50% 35%, #d0263f, #7a0a1f) !important;
  box-shadow: 0 0 14px rgba(255, 200, 80, 0.35) !important;
  overflow: hidden !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-host-art .art {
  width: 100% !important;
  height: 100% !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-host-name {
  position: absolute !important;
  left: 50% !important;
  bottom: -8px !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  padding: 2px 10px !important;
  border-radius: 999px !important;
  background: linear-gradient(#ffe48a, #f2b02b) !important;
  color: #5a2c00 !important;
  font:
    900 10px/1.4 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  letter-spacing: 0.3px !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .emission-caption {
  display: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kd-last {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 8px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 200, 90, 0.45) !important;
  background: radial-gradient(90% 80% at 50% 45%, #7c1830 0, #3b0a19 70%) !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kd-last > small {
  font:
    900 12px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #ffd66b !important;
  letter-spacing: 0.3px !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-ball {
  display: grid !important;
  place-items: center !important;
  width: 84px !important;
  height: 84px !important;
  border-radius: 50% !important;
  font:
    900 30px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #fff !important;
  border: 0 !important;
  background: radial-gradient(circle at 34% 28%, #fff 0, #ffd2da 9%, #ff5470 30%, #d4153a 62%, #7d0019 100%) !important;
  box-shadow:
    0 8px 22px rgba(255, 40, 80, 0.45),
    inset 0 -6px 12px rgba(80, 0, 20, 0.45) !important;
  text-shadow: 0 2px 4px rgba(90, 0, 20, 0.55) !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-host-count {
  display: inline-block !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 200, 90, 0.6) !important;
  background: rgba(25, 4, 10, 0.6) !important;
  color: #ffe2a3 !important;
  font:
    800 9.5px/1.3 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  white-space: nowrap !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-picker {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 7px 6px !important;
  margin-top: 4px !important;
  height: auto !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-picker > label,
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactOne,
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactFill,
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactSaved {
  grid-column: 1/-1 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-picker label {
  white-space: nowrap !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-picker label {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  font:
    600 11px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #f3e3e8 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactLevel {
  height: 22px !important;
  padding: 0 6px !important;
  border-radius: 5px !important;
  border: 1px solid #f4b92e !important;
  background: rgba(60, 30, 0, 0.45) !important;
  color: #ffd66b !important;
  font:
    800 10.5px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  width: auto !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactLevel option,
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactSaved option,
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #klStake option {
  background: #2b0814;
  color: #fff;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-picker > button {
  height: 28px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  font:
    700 11.5px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #fff !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactOne {
  background: linear-gradient(90deg, #ff3d6a, #e5194a) !important;
  box-shadow: 0 4px 12px rgba(255, 40, 90, 0.3) !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactFill {
  background: linear-gradient(90deg, #f6a51a, #d9760b) !important;
  box-shadow: 0 4px 12px rgba(240, 140, 20, 0.25) !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactClear {
  background: #1b2236 !important;
  border-color: #2c3755 !important;
  color: #dfe6f5 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactSave {
  background: #1d3c8a !important;
  border-color: #2c57c2 !important;
  color: #e6eeff !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactSave:disabled {
  opacity: 0.55 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactSaved {
  height: 28px !important;
  border-radius: 8px !important;
  border: 1px solid #2c3755 !important;
  background: #1b2236 !important;
  color: #dfe6f5 !important;
  font:
    700 11.5px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  text-align: center !important;
  text-align-last: center !important;
}

/* bảng 80 số */
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-area {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 12px !important;
  background: rgba(14, 3, 8, 0.65) !important;
  border: 1px solid rgba(255, 90, 120, 0.12) !important;
  height: auto !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number-grid {
  gap: 6px 7px !important;
  height: auto !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1px !important;
  min-height: 40px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  background: linear-gradient(180deg, #25121a, #1a0c12) !important;
  color: #f4f1f3 !important;
  font:
    800 15px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  box-shadow: none !important;
  outline: 0 !important;
  position: relative !important;
  transform: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number .cell-frequency {
  font:
    500 8px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #8c7880 !important;
  position: static !important;
  opacity: 1 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number .tv-cell-emblem {
  display: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number.out {
  background: linear-gradient(180deg, #fff0b0, #f7cd4f 55%, #eeb52a) !important;
  border-color: #ffe89a !important;
  color: #3b2200 !important;
  box-shadow: 0 0 10px rgba(255, 205, 70, 0.35) !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number.out .cell-frequency {
  color: #7a5300 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number.user-pick {
  background: linear-gradient(180deg, #ff5c75, #e0203f 60%, #c3122f) !important;
  border-color: #ff9bab !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(255, 50, 90, 0.45) !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number.user-pick .cell-frequency {
  color: #ffd3da !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number.matched::after {
  content: '✓';
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  color: #c3122f;
  font-size: 9px;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number.latest {
  outline: 2px solid #fff3b5 !important;
  outline-offset: 1px !important;
  box-shadow: 0 0 16px rgba(255, 220, 100, 0.7) !important;
}

/* chân bảng: Lớn/Nhỏ/Chẵn/Lẻ · Bộ đang chọn · mức tiền · Giỏ vé / Mua vé */
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kd-foot {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-splits {
  position: static !important;
  display: flex !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  transform: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-splits span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 5px 10px !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  font:
    600 12px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #dad3d7 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-splits span b {
  font-weight: 800 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-splits span:nth-child(1) b {
  color: #ffd66b !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-splits span:nth-child(2) b {
  color: #4fd1ff !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-splits span:nth-child(3) b {
  color: #33d17a !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-splits span:nth-child(4) b {
  color: #ff6f8e !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-splits small {
  display: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-selected {
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 6px 8px 6px 14px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 80, 110, 0.5) !important;
  background: rgba(60, 5, 20, 0.55) !important;
  height: auto !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-selected-label {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  font:
    800 11px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #ff8ea2 !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-selected-label br {
  display: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactCount {
  font: inherit !important;
  color: #ff8ea2 !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactCount::before {
  content: '(';
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactCount::after {
  content: '):';
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-selected-slots {
  display: flex !important;
  gap: 5px !important;
  flex-wrap: wrap !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-selected-slots button {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 0 !important;
  font:
    800 11px/1 'Be Vietnam Pro',
    Arial,
    sans-serif !important;
  color: #fff !important;
  background: radial-gradient(circle at 35% 30%, #ffd2da 0, #ff5a74 30%, #d8193c 70%, #8d0020 100%) !important;
  box-shadow: 0 2px 8px rgba(255, 40, 80, 0.45) !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-selected-slots button.empty {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px dashed rgba(255, 140, 160, 0.35) !important;
  color: transparent !important;
  box-shadow: none !important;
}
.kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kl-buy {
  margin-left: auto !important;
}
@media (max-width: 879px) {
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px !important;
    gap: 10px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-title {
    height: auto !important;
    flex-wrap: wrap !important;
    row-gap: 6px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-title h3 {
    font-size: 16px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kle-next {
    padding: 4px 10px;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kle-next b {
    font-size: 20px;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-host {
    display: grid !important;
    grid-template-columns: 110px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kd-mascot {
    margin: 0 auto 8px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kd-last {
    flex-direction: row !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    padding: 8px 10px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-ball {
    width: 56px !important;
    height: 56px !important;
    font-size: 22px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-picker {
    grid-column: 1/-1 !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-picker > button,
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active #compactSaved {
    height: 34px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-area {
    padding: 8px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number-grid {
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    gap: 4px 3px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number {
    min-height: 36px !important;
    width: auto !important;
    font-size: 12.5px !important;
    padding: 0 !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-number .cell-frequency {
    font-size: 7px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-selected {
    flex-wrap: wrap !important;
    border-radius: 12px !important;
    padding: 8px 10px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kl-buy {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kl-buy select {
    flex: 1 !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .tv-board-title {
    flex-wrap: wrap !important;
    height: auto !important;
    row-gap: 6px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .compact-legend {
    flex-wrap: wrap !important;
    white-space: normal !important;
    gap: 8px !important;
  }
  .kl-embed .layout .stage-shell .tv-show .tv-main > .tv-scene.tv-draw.active .kle-next {
    margin-left: 0;
  }
}

/* ---------- Màn Keno (không nhúng, lớp .kn) — dashboard theo thiết kế mới ----------
   Áp dụng cho bố cục desktop (≥880px) khi không ở chế độ toàn màn hình. Chỉ giao diện/bố cục:
   thanh trên (KENO · đồng hồ · Linh vật · Sân khấu) được thay bằng đồng hồ trên thanh tiêu đề,
   thẻ linh vật mở bộ sưu tập và nút "Bật toàn màn hình" ở thanh dưới. */
.kn-next,
.kn-only {
  display: none;
}
@media (min-width: 880px) {
  .kl-body.kn > main {
    padding: clamp(8px, 2.2vh, 23px) clamp(12px, 2.36vw, 34px) clamp(6px, 1vh, 10px) !important;
  }
  .kn .stage-shell:not(.is-theater) {
    container-type: size;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
  }
  .kn .stage-shell:not(.is-theater),
  .kn .stage-shell:not(.is-theater) * {
    font-family: 'Be Vietnam Pro', Arial, sans-serif;
  }
  .kn .stage-shell:not(.is-theater):before,
  .kn .stage-shell:not(.is-theater) .tv-backdrop,
  .kn .stage-shell:not(.is-theater) .tv-glow,
  .kn .stage-shell:not(.is-theater) .tv-particles,
  .kn .stage-shell:not(.is-theater) .tv-top,
  .kn .stage-shell:not(.is-theater) .tv-progress,
  .kn .stage-shell:not(.is-theater) .tv-status,
  .kn .stage-shell:not(.is-theater) #tvDrawLabel,
  .kn .stage-shell:not(.is-theater) .emission-caption {
    display: none;
  }
  .kn .stage-shell:not(.is-theater) .tv-show {
    background: none;
  }

  /* lưới chính: [cột linh vật][bảng 80 số][Lăng kính dữ liệu] × [sân khấu][2 thẻ][Nhịp điệu] */
  .kn .stage-shell:not(.is-theater) .tv-scene.tv-draw {
    --kn-pad: clamp(10px, 1.3vw, 19px);
    --kn-padt: clamp(8px, 1.34cqh, 12px);
    --kn-title: clamp(34px, 5.01cqh, 46px);
    --kn-gap: clamp(8px, 1.78cqh, 17px);
    --kn-hostw: clamp(170px, 16.6vw, 250px);
    --kn-colgap: clamp(8px, 1.1vw, 16px);
    --kn-side: clamp(10px, 1.4vw, 20px);
    grid-template-columns: calc(var(--kn-pad) + var(--kn-hostw)) minmax(0, 1fr) calc(
        var(--kn-side) + clamp(270px, 22.4vw, 340px)
      );
    grid-template-rows: minmax(0, 1fr) clamp(88px, 16.04cqh, 148px) clamp(46px, 7.69cqh, 71px);
    gap: clamp(8px, 1.56cqh, 15px) 0;
    padding: 0;
  }
  .kn .stage-shell:not(.is-theater) .tv-scene.tv-draw:before {
    content: '';
    grid-column: 1/3;
    grid-row: 1;
    z-index: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 77, 109, 0.42);
    background: radial-gradient(
      120% 95% at 22% 0,
      color-mix(in srgb, var(--show-panel) 58%, #12060c) 0,
      color-mix(in srgb, var(--show-bg) 78%, #0b0812) 58%,
      #150a17 100%
    );
    box-shadow:
      0 0 0 1px rgba(255, 60, 90, 0.1),
      0 0 34px rgba(255, 40, 80, 0.12),
      inset 0 0 70px rgba(255, 40, 80, 0.05);
  }

  .kn .stage-shell:not(.is-theater) .tv-draw > .live-scene {
    border-radius: 16px;
    overflow: hidden;
  }

  /* thanh tiêu đề: chạy hết chiều ngang khung, đồng hồ kỳ tiếp theo ở bên phải */
  .kn .stage-shell:not(.is-theater) .tv-board-area {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    min-height: 0;
    padding: var(--kn-padt) var(--kn-pad) var(--kn-pad) var(--kn-colgap);
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: #f1e9ec;
  }
  .kn .stage-shell:not(.is-theater) .tv-board-title {
    position: relative;
    z-index: 2;
    flex: none;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(10px, 1.2vw, 18px);
    height: var(--kn-title);
    margin: 0 0 var(--kn-gap) calc(-1 * (var(--kn-hostw) + var(--kn-colgap)));
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    min-width: 0;
  }
  .kn .stage-shell:not(.is-theater) .tv-board-title h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    margin: 0;
    font-size: clamp(13px, 1.12vw, 17px);
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .tv-board-title h3:before {
    content: '';
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff3b5c;
    box-shadow:
      0 0 0 3px rgba(255, 59, 92, 0.25),
      0 0 10px rgba(255, 59, 92, 0.7);
  }
  .kn .stage-shell:not(.is-theater) .tv-board-title .compact-legend {
    order: 0;
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    gap: 14px;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    visibility: visible;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #a8979f;
  }
  .kn .stage-shell:not(.is-theater) .compact-legend b,
  .kn .stage-shell:not(.is-theater) .compact-legend em {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    font-style: normal;
    font-weight: 600;
  }
  .kn .stage-shell:not(.is-theater) .compact-legend b {
    color: #ffd98a;
  }
  .kn .stage-shell:not(.is-theater) .compact-legend em {
    color: #ff8da0;
  }
  .kn .stage-shell:not(.is-theater) .compact-legend b:before,
  .kn .stage-shell:not(.is-theater) .compact-legend em:before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f7c948;
  }
  .kn .stage-shell:not(.is-theater) .compact-legend em:before {
    background: #ff3b5c;
  }
  .kn .stage-shell:not(.is-theater) .compact-legend span {
    font-size: 10px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kn .stage-shell:not(.is-theater) .compact-legend i {
    font-style: normal;
  }
  .kn .stage-shell:not(.is-theater) .kn-next {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    height: 100%;
    margin-left: auto;
    padding: 0 13px;
    border: 1px solid rgba(255, 90, 120, 0.4);
    border-radius: 10px;
    background: rgba(20, 6, 12, 0.55);
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .kn-next span {
    padding: 0;
    border: 0;
    background: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    color: #ffd0d8;
  }
  .kn .stage-shell:not(.is-theater) .kn-next span:before {
    content: none;
  }
  .kn .stage-shell:not(.is-theater) .kn-next b {
    font-size: clamp(19px, 2.67cqh, 25px);
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
  }

  /* cột linh vật · số vừa xổ · chọn bộ số */
  .kn .stage-shell:not(.is-theater) .tv-host {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    align-content: normal;
    justify-content: flex-start;
    gap: clamp(6px, 1.23cqh, 12px);
    min-width: 0;
    min-height: 0;
    height: auto;
    margin: calc(var(--kn-padt) + var(--kn-title) + var(--kn-gap)) 0 var(--kn-pad) var(--kn-pad);
    padding: clamp(7px, 1.45cqh, 14px) clamp(8px, 0.9vw, 14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(10, 4, 8, 0.46);
    box-shadow: none;
    overflow: hidden;
    color: #f1e9ec;
  }
  .kn .stage-shell:not(.is-theater) .kd-mascot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: none;
    position: relative;
    width: auto;
    margin: 0 0 9px;
    padding: clamp(3px, 0.67cqh, 6px);
    border: 2px solid #f4c95a;
    border-radius: 12px;
    background: radial-gradient(
      circle at 50% 38%,
      color-mix(in srgb, var(--show-panel) 82%, #000),
      color-mix(in srgb, var(--show-bg) 80%, #000)
    );
    box-shadow:
      0 0 18px rgba(244, 201, 90, 0.22),
      inset 0 0 16px rgba(0, 0, 0, 0.35);
    cursor: pointer;
  }
  .kn .stage-shell:not(.is-theater) .kd-mascot:hover {
    box-shadow:
      0 0 22px rgba(244, 201, 90, 0.42),
      inset 0 0 16px rgba(0, 0, 0, 0.35);
  }
  .kn .stage-shell:not(.is-theater) .tv-host-art {
    width: clamp(50px, 10.36cqh, 96px);
    height: clamp(50px, 10.36cqh, 96px);
    flex: none;
  }
  .kn .stage-shell:not(.is-theater) .tv-host-name {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    display: block;
    max-width: none;
    margin: 0;
    padding: 3px 12px;
    border-radius: 6px;
    background: linear-gradient(180deg, #ffe9a6, #f0b63a);
    color: #4a2500;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: visible;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  }
  .kn .stage-shell:not(.is-theater) .kd-last {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.11cqh, 11px);
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0;
    padding: clamp(5px, 1.23cqh, 12px) 8px;
    border: 1px solid rgba(244, 201, 90, 0.5);
    border-radius: 12px;
    background: radial-gradient(ellipse at 50% 34%, #6e4118, #43200f 62%, #2c120a);
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.35);
  }
  .kn .stage-shell:not(.is-theater) .kd-last > small {
    display: block;
    font-size: clamp(9px, 1.28cqh, 12px);
    font-weight: 900;
    letter-spacing: 0.5px;
    line-height: 1;
    color: #ffd66b;
  }
  .kn .stage-shell:not(.is-theater) .tv-ball {
    display: grid;
    place-items: center;
    flex: none;
    width: clamp(40px, 8.91cqh, 82px);
    height: clamp(40px, 8.91cqh, 82px);
    margin: 0;
    border: 0;
    border-radius: 50%;
    font-size: clamp(20px, 4.46cqh, 40px);
    font-weight: 900;
    line-height: 1;
    color: #fff;
    background: radial-gradient(circle at 34% 28%, #ffc3cc 0, #ff5674 30%, #d51c41 72%, #8e0d27 100%);
    box-shadow:
      0 0 0 5px rgba(255, 90, 120, 0.14),
      0 10px 24px rgba(255, 40, 80, 0.35);
    text-shadow: 0 2px 3px rgba(120, 10, 30, 0.7);
  }
  .kn .stage-shell:not(.is-theater) .tv-host-count {
    display: inline-block;
    flex: none;
    max-width: 100%;
    margin: 0;
    padding: clamp(2px, 0.56cqh, 5px) 10px;
    border: 1px solid rgba(255, 200, 90, 0.5);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.4);
    font-size: clamp(8px, 1.11cqh, 10px);
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1.2;
    color: #ffe9b8;
    text-align: center;
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(4px, 0.78cqh, 7px) 6px;
    flex: none;
    width: 100%;
    height: auto;
    margin: 0;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker > * {
    grid-column: 1/-1;
    min-width: 0;
    max-width: none;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: #f1e6e9;
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker label select {
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
    height: 22px;
    padding: 0 4px;
    border: 1px solid #f4b92e;
    border-radius: 6px;
    background: rgba(60, 30, 0, 0.5);
    color: #ffd66b;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: none;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker select option {
    background: #1a0d14;
    color: #f1e6e9;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker button {
    height: clamp(22px, 3.23cqh, 30px);
    min-height: 0;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: clamp(10px, 1.28cqh, 11.5px);
    font-weight: 700;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker #compactOne {
    background: linear-gradient(90deg, #ff3d6a, #e5194a);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 40, 90, 0.3);
  }
  .kn .stage-shell:not(.is-theater) .compact-picker #compactFill {
    background: linear-gradient(90deg, #f6a51a, #d9760b);
    color: #fff;
    box-shadow: 0 4px 12px rgba(240, 140, 20, 0.25);
  }
  .kn .stage-shell:not(.is-theater) .compact-picker #compactClear {
    grid-column: 1;
    padding: 0 4px;
    border-radius: 14px;
    background: #151d33;
    border-color: #2c3a5e;
    color: #dfe6f5;
    box-shadow: none;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker #compactSave {
    grid-column: 2;
    padding: 0 4px;
    border-radius: 14px;
    background: #1a2f6b;
    border-color: #2c57c2;
    color: #e6eeff;
    box-shadow: none;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker #compactSaved {
    height: clamp(22px, 3.23cqh, 30px);
    padding: 0 6px;
    border: 1px solid #2c3a5e;
    border-radius: 14px;
    background: #151d33;
    color: #dfe6f5;
    font-size: clamp(10px, 1.28cqh, 11.5px);
    font-weight: 600;
    text-align: center;
    text-align-last: center;
  }

  /* bảng 80 số */
  .kn .stage-shell:not(.is-theater) .tv-number-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: repeat(8, minmax(0, 1fr));
    gap: clamp(3px, 0.67cqh, 6px) clamp(4px, 0.55vw, 8px);
    height: auto;
    min-height: 0;
    padding: clamp(6px, 1.11cqh, 11px) clamp(6px, 0.8vw, 12px);
    background: rgba(10, 4, 8, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
  }
  .kn .stage-shell:not(.is-theater) .tv-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: #f1e9ec;
    font-size: clamp(12px, 1.73cqh, 16px);
    font-weight: 500;
    line-height: 1;
    box-shadow: none;
    opacity: 1;
    outline: 0;
    cursor: pointer;
    transition:
      background 0.15s,
      border-color 0.15s;
  }
  .kn .stage-shell:not(.is-theater) .tv-number:hover {
    border-color: rgba(255, 255, 255, 0.28);
  }
  .kn .stage-shell:not(.is-theater) .tv-number > small {
    display: block !important;
    position: static;
    font-size: clamp(7px, 0.95cqh, 9px);
    font-weight: 500;
    line-height: 1;
    color: #8c7880;
    opacity: 1;
  }
  .kn .stage-shell:not(.is-theater) .tv-number.out {
    background: linear-gradient(180deg, #fff0b0, #f7cd4f 55%, #eeb52a);
    border-color: #ffe89a;
    color: #3b2200;
    font-weight: 800;
    box-shadow:
      0 0 12px rgba(255, 205, 80, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
  .kn .stage-shell:not(.is-theater) .tv-number.out > small {
    color: #7a5300;
  }
  .kn .stage-shell:not(.is-theater) .tv-number.user-pick {
    background: linear-gradient(180deg, #ff5c75, #e0203f 60%, #c3122f);
    border-color: #ff9bab;
    color: #fff;
    font-weight: 800;
    box-shadow:
      0 0 12px rgba(255, 60, 90, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  .kn .stage-shell:not(.is-theater) .tv-number.user-pick > small {
    color: #ffd3da;
  }
  .kn .stage-shell:not(.is-theater) .tv-number.user-pick:after {
    display: none !important;
  }
  .kn .stage-shell:not(.is-theater) .tv-number.user-pick.out:after {
    content: '✓';
    display: grid !important;
    place-items: center;
    position: absolute;
    left: auto;
    top: -6px;
    right: -6px;
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #c3122f;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  }
  .kn .stage-shell:not(.is-theater) .tv-number.latest {
    outline: 2px solid #fff3b5;
    outline-offset: 1px;
    box-shadow: 0 0 16px rgba(255, 220, 100, 0.7);
  }

  /* hàng dưới bảng: Lớn/Nhỏ/Chẵn/Lẻ · Bộ đang chọn · mức tiền + Giỏ vé / Mua vé */
  .kn .stage-shell:not(.is-theater) .kd-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 10px;
    flex: none;
    min-width: 0;
    margin-top: var(--kn-gap);
  }
  .kn .stage-shell:not(.is-theater) .tv-splits {
    position: static;
    display: flex;
    flex: none;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 11px;
    line-height: 1;
    color: #e6dde1;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits span {
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: clamp(26px, 3.68cqh, 32px);
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(10, 4, 8, 0.5);
    font-weight: 600;
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits span b {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits span b:before {
    content: ':';
    margin-right: 4px;
    color: #e6dde1;
    font-weight: 600;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits span:nth-child(1) b {
    color: #ffd66b;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits span:nth-child(2) b {
    color: #4fd1ff;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits span:nth-child(3) b {
    color: #33d17a;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits span:nth-child(4) b {
    color: #ff6f8e;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits small {
    display: none;
  }
  .kn .stage-shell:not(.is-theater) .compact-selected {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: clamp(30px, 4.34cqh, 40px);
    margin: 0 0 0 auto;
    padding: 3px 9px 3px 14px;
    border: 1px solid rgba(255, 77, 109, 0.5);
    border-radius: 12px;
    background: rgba(70, 10, 24, 0.5);
    overflow: hidden;
  }
  .kn .stage-shell:not(.is-theater) .compact-selected-label {
    flex: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1;
    color: #ffe9ee;
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .compact-selected-label b {
    font: inherit;
    color: #ff8ea2;
  }
  .kn .stage-shell:not(.is-theater) .compact-selected-slots {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    gap: 5px;
    min-width: 0;
  }
  .kn .stage-shell:not(.is-theater) .compact-selected-slots button {
    flex: 0 0 clamp(22px, 3.01cqh, 27px);
    width: clamp(22px, 3.01cqh, 27px);
    height: clamp(22px, 3.01cqh, 27px);
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: radial-gradient(circle at 34% 28%, #ffb0bd, #ff4563 42%, #c9163a);
    box-shadow: 0 2px 6px rgba(200, 20, 50, 0.45);
  }
  .kn .stage-shell:not(.is-theater) .compact-selected-slots .empty {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 140, 160, 0.35);
    color: transparent;
    box-shadow: none;
  }
  .kn .stage-shell:not(.is-theater) .kd-foot > .kl-buy {
    display: flex;
    align-items: center;
    flex: none;
    gap: 6px;
    width: auto;
    margin: 0 0 0 auto;
  }
  .kn .stage-shell:not(.is-theater) .kl-buy select {
    height: clamp(26px, 3.68cqh, 32px);
    padding: 0 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(10, 4, 8, 0.6);
    color: #ffe9c2;
    font-size: 11px;
    font-weight: 600;
  }
  .kn .stage-shell:not(.is-theater) .kl-buy button {
    flex: none;
    height: clamp(26px, 3.68cqh, 32px);
    padding: 0 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
  }

  /* Lăng kính dữ liệu */
  .kn .stage-shell:not(.is-theater) .compact-analysis {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(5px, 1.34cqh, 13px);
    min-width: 0;
    min-height: 0;
    margin: 0 0 0 var(--kn-side);
    padding: clamp(9px, 1.78cqh, 16px) clamp(10px, 1.1vw, 16px);
    background: linear-gradient(180deg, #0d2340, #0a1b33);
    border: 1px solid #1f3a5c;
    border-radius: 14px;
    overflow: hidden;
    color: #dbe8fb;
  }
  .kn .stage-shell:not(.is-theater) .compact-analysis > * {
    flex: none;
    min-width: 0;
    height: auto;
  }
  .kn .stage-shell:not(.is-theater) .ca-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: clamp(12px, 1.05vw, 14px);
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.2;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .ca-head select {
    max-width: none;
    padding: 4px 8px;
    border: 1px solid #3d6ea8;
    border-radius: 999px;
    background: rgba(61, 151, 255, 0.08);
    color: #8cc4ff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .kn .stage-shell:not(.is-theater) .ca-focus {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(10px, 1vw, 14px);
    padding: clamp(6px, 1.45cqh, 13px) 14px;
    border: 1px solid #27425f;
    border-radius: 12px;
    background: linear-gradient(90deg, #132a4b, #0d2038);
  }
  .kn .stage-shell:not(.is-theater) .ca-focus:after {
    content: '';
    position: absolute;
    right: -1px;
    top: 16%;
    bottom: 16%;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, #ff4d6d, #3d97ff);
  }
  .kn .stage-shell:not(.is-theater) .ca-focus > strong {
    display: grid;
    place-items: center;
    width: clamp(34px, 5.68cqh, 52px);
    height: clamp(34px, 5.68cqh, 52px);
    border: 2px solid #ff5a3c;
    border-radius: 10px;
    background: #1a0d12;
    color: #fff;
    font-size: clamp(17px, 2.79cqh, 26px);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    box-shadow:
      0 0 14px rgba(255, 90, 60, 0.45),
      inset 0 0 10px rgba(255, 90, 60, 0.18);
  }
  .kn .stage-shell:not(.is-theater) .ca-focus span {
    font-size: 11px;
    line-height: 1.75;
    color: #c9d6ea;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .kn .stage-shell:not(.is-theater) .ca-focus span b {
    color: #ffb84d;
    font-weight: 700;
  }
  .kn .stage-shell:not(.is-theater) .ca-focus span em {
    color: #39d98a;
    font-style: normal;
    font-weight: 700;
  }
  .kn .stage-shell:not(.is-theater) .ca-rank-title,
  .kn .stage-shell:not(.is-theater) .ca-heat-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 clamp(3px, 0.67cqh, 7px);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    color: #eaf1fb;
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .ca-rank-title:after {
    font-size: 9px;
    font-weight: 500;
    color: #4da3ff;
  }
  .kn .stage-shell:not(.is-theater) .ca-rank-title:has(+ #caHot):after {
    content: 'Tỷ lệ xuất hiện';
  }
  .kn .stage-shell:not(.is-theater) .ca-rank-title:has(+ #caGap):after {
    content: 'Số kỳ chưa về';
  }
  .kn .stage-shell:not(.is-theater) .ca-heat-title small {
    font-size: 9px;
    font-weight: 500;
    color: #4da3ff;
  }
  .kn .stage-shell:not(.is-theater) #caHot {
    display: flex;
    flex-direction: column;
    gap: clamp(1px, 0.5cqh, 5px);
    overflow: visible;
  }
  .kn .stage-shell:not(.is-theater) #caHot button {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: 11px;
    line-height: 1.25;
    text-align: left;
  }
  .kn .stage-shell:not(.is-theater) #caHot button b {
    color: #ffd66b;
    font-weight: 700;
  }
  .kn .stage-shell:not(.is-theater) #caHot .hot-bar {
    display: block;
    height: 5px;
    border-radius: 5px;
    background: #16304d;
    overflow: hidden;
  }
  .kn .stage-shell:not(.is-theater) #caHot .hot-bar i {
    display: block;
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #ff3152, #ff9a3d 60%, #ffd24d);
  }
  .kn .stage-shell:not(.is-theater) #caHot button small {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    color: #dbe8fb;
    text-align: right;
  }
  .kn .stage-shell:not(.is-theater) #caGap {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }
  .kn .stage-shell:not(.is-theater) #caGap button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: clamp(28px, 4.68cqh, 43px);
    padding: 0;
    border: 1px solid #2c4a6b;
    border-radius: 8px;
    background: #0d2440;
    color: #fff;
    font-size: clamp(11px, 1.39cqh, 13px);
    font-weight: 700;
    line-height: 1;
  }
  .kn .stage-shell:not(.is-theater) #caGap button small {
    display: block;
    font-size: 8px;
    font-weight: 500;
    line-height: 1;
    color: #9fb3cc;
  }
  .kn .stage-shell:not(.is-theater) #caGap button:first-child {
    border-color: #ff4d6d;
    background: rgba(255, 77, 109, 0.12);
    color: #ff8ea2;
  }
  .kn .stage-shell:not(.is-theater) .compact-analysis > .ca-heat-section {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    grid-column: auto;
  }
  .kn .stage-shell:not(.is-theater) .ca-heat-title {
    flex: none;
  }
  .kn .stage-shell:not(.is-theater) .ca-heat-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: repeat(8, minmax(0, 1fr));
    gap: 2px;
    min-height: 96px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #1f3a5c;
    border-radius: 8px;
  }
  .kn .stage-shell:not(.is-theater) .ca-heat-grid button {
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: var(--heat);
    color: #fff;
    font-size: clamp(7px, 1cqh, 9px);
    font-weight: 600;
    line-height: 1;
  }
  .kn .stage-shell:not(.is-theater) .ca-heat-grid button.focus {
    background: var(--heat) !important;
    outline: 2px solid #fff;
    outline-offset: -2px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
  }
  .kn .stage-shell:not(.is-theater) .ca-heat-legend {
    display: flex;
    align-items: center;
    flex: none;
    gap: 8px;
    margin-top: clamp(3px, 0.67cqh, 7px);
    font-size: 9px;
    line-height: 1.2;
    color: #9fb3cc;
  }
  .kn .stage-shell:not(.is-theater) .ca-heat-legend i {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #1f3f8f, #543ea0, #a83062, #e2552d, #f0a23a);
  }
  .kn .stage-shell:not(.is-theater) .ca-note {
    margin: 0;
    font-size: 9px;
    font-style: italic;
    line-height: 1.4;
    color: #8ea3bd;
    text-align: center;
    overflow: hidden;
  }

  /* Dấu ấn kỳ quay · Bộ số của bạn */
  .kn .stage-shell:not(.is-theater) .reference-bottom {
    display: contents;
  }
  .kn .stage-shell:not(.is-theater) .reference-card {
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: clamp(5px, 1.34cqh, 13px) clamp(12px, 1.25vw, 18px);
    background: linear-gradient(180deg, #0d2340, #0a1b33);
    border: 1px solid #1f3a5c;
    border-radius: 14px;
    overflow: hidden;
  }
  .kn .stage-shell:not(.is-theater) .reference-card:first-child {
    grid-column: 1/3;
    grid-row: 2;
  }
  .kn .stage-shell:not(.is-theater) .reference-card:nth-child(2) {
    grid-column: 3;
    grid-row: 2;
    margin-left: var(--kn-side);
  }
  .kn .stage-shell:not(.is-theater) .reference-card h3 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin: 0 0 clamp(3px, 1.11cqh, 12px);
    font-size: clamp(11px, 0.92vw, 13px);
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: clamp(16px, 2.34cqh, 22px);
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    overflow: visible;
  }
  .kn .stage-shell:not(.is-theater) .reference-card h3 small {
    flex: none;
    text-transform: none;
    letter-spacing: 0;
  }
  .kn .stage-shell:not(.is-theater) .reference-card:first-child h3 small {
    padding: 1px 8px;
    border: 1px solid #2c8fb0;
    border-radius: 6px;
    background: rgba(44, 200, 255, 0.07);
    color: #6fd6f5;
    font-size: 9px;
    font-weight: 700;
  }
  .kn .stage-shell:not(.is-theater) .reference-card:first-child h3:after {
    content: 'Thứ tự từ nhỏ đến lớn';
    margin-left: auto;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: #8ea3bd;
  }
  .kn .stage-shell:not(.is-theater) .reference-card:nth-child(2) h3 {
    justify-content: space-between;
  }
  .kn .stage-shell:not(.is-theater) .reference-card:nth-child(2) h3 small {
    color: #4da3ff;
    font-size: 11px;
    font-weight: 500;
  }
  .kn .stage-shell:not(.is-theater) .reference-balls {
    --kn-ball: clamp(20px, 4cqh, 37px);
    --kn-ball-gap: clamp(5px, 1.1cqh, 10px);
    display: grid;
    grid-template-columns: repeat(10, var(--kn-ball));
    justify-content: start;
    justify-items: center;
    gap: var(--kn-ball-gap);
    max-width: none;
  }
  .kn .stage-shell:not(.is-theater) .reference-balls b,
  .kn .stage-shell:not(.is-theater) .reference-saved button b {
    display: grid;
    place-items: center;
    flex: none;
    width: clamp(17px, 3.23cqh, 30px);
    height: clamp(17px, 3.23cqh, 30px);
    max-width: none;
    border-radius: 50%;
    font-size: clamp(8px, 1.34cqh, 12px);
    font-weight: 700;
    line-height: 1;
    color: #1c2738;
    background: radial-gradient(circle at 34% 28%, #fff, #cfd6e0 52%, #838fa1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  }
  .kn .stage-shell:not(.is-theater) .reference-balls b {
    width: var(--kn-ball);
    height: var(--kn-ball);
    font-size: clamp(9px, 1.6cqh, 14px);
  }
  .kn .stage-shell:not(.is-theater) .reference-balls b.hit,
  .kn .stage-shell:not(.is-theater) .reference-saved button b.hit {
    color: #fff;
    background: radial-gradient(circle at 34% 28%, #ffb0bd, #ff4563 42%, #c9163a);
  }
  .kn .stage-shell:not(.is-theater) .reference-balls b.last,
  .kn .stage-shell:not(.is-theater) .reference-saved button b.last {
    color: #4a2a00;
    background: radial-gradient(circle at 34% 28%, #fff6c8, #f7cd4f 48%, #d99a12);
  }
  .kn .stage-shell:not(.is-theater) .reference-saved {
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.78cqh, 7px);
    font-size: 11px;
    line-height: 1.3;
  }
  .kn .stage-shell:not(.is-theater) .reference-saved button {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.5vw, 8px);
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    text-align: left;
  }
  .kn .stage-shell:not(.is-theater) .reference-saved p {
    margin: clamp(1px, 0.56cqh, 6px) 0 0;
    font-size: 11px;
    color: #6f86a3;
    text-align: center;
  }

  /* Nhịp điệu Keno */
  .kn .stage-shell:not(.is-theater) .reference-rhythm {
    grid-column: 1/-1;
    grid-row: 3;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: clamp(4px, 1.11cqh, 10px) clamp(12px, 1.4vw, 22px);
    background: linear-gradient(180deg, #0d2340, #0a1b33);
    border: 1px solid #1f3a5c;
    border-radius: 14px;
    overflow: hidden;
  }
  .kn .stage-shell:not(.is-theater) .reference-rhythm > strong {
    font-size: clamp(13px, 1.05vw, 15px);
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
  }

  /* thanh dưới: nhạc nền · máy chủ · toàn màn hình · tạm dừng · xem quay thử */
  .kn .stage-shell:not(.is-theater) .tv-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    height: clamp(30px, 4.46cqh, 41px);
    min-height: 0;
    margin-top: clamp(5px, 1.56cqh, 15px);
    padding: 0 4px;
    background: none;
    border: 0;
    opacity: 1 !important;
  }
  .kn .stage-shell:not(.is-theater) .tv-music-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 0;
  }
  .kn .stage-shell:not(.is-theater) .kn-music-label {
    display: inline;
    font-size: 11px;
    font-weight: 500;
    color: #c9d6ea;
    white-space: pre;
  }
  .kn .stage-shell:not(.is-theater) .tv-controls button {
    height: clamp(24px, 3.23cqh, 30px);
    padding: 0 14px;
    border: 1px solid #2c4a6b;
    border-radius: 8px;
    background: #0c2440;
    color: #dbe8fb;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }
  .kn.kn-music-idle .stage-shell:not(.is-theater) #tvMusic {
    font-size: 0;
  }
  .kn.kn-music-idle .stage-shell:not(.is-theater) #tvMusic:after {
    content: 'Kim Hưng Thịnh (Mặc định)';
    font-size: 11px;
  }
  .kn.kn-music-idle .stage-shell:not(.is-theater) #tvVolume {
    display: none;
  }
  .kn .stage-shell:not(.is-theater) #tvVolume {
    width: 60px;
  }
  .kn .stage-shell:not(.is-theater) .kn-server {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #8ea3bd;
    white-space: nowrap;
  }
  .kn .stage-shell:not(.is-theater) .kn-server i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #33d17a;
    box-shadow: 0 0 6px #33d17a;
  }
  .kn .stage-shell:not(.is-theater) #knFull {
    display: inline-block;
  }
  .kn .stage-shell:not(.is-theater) .tv-controls #tvPause {
    margin-left: auto;
    border-radius: 999px;
  }
  .kn .stage-shell:not(.is-theater) .tv-controls #tvNow {
    border-radius: 999px;
    padding: 0 18px;
    background: linear-gradient(180deg, #3d97ff, #1667e0);
    border-color: #6fb2ff;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(22, 103, 224, 0.35);
  }
}
/* sân khấu thấp: linh vật và số vừa xổ đứng cạnh nhau để các nút chọn số luôn hiển thị đủ */
@container (min-width:840px) and (max-height:680px) {
  .kn .stage-shell:not(.is-theater) .tv-host {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    align-content: flex-start;
    justify-content: space-between;
    gap: 6px;
  }
  .kn .stage-shell:not(.is-theater) .kd-mascot {
    flex: 0 0 calc(50% - 3px);
    justify-content: center;
    margin: 0 0 8px;
  }
  .kn .stage-shell:not(.is-theater) .kd-last {
    flex: 0 0 calc(50% - 3px);
    width: auto;
    margin: 0 0 8px;
    padding: 5px 3px;
    gap: 3px;
  }
  .kn .stage-shell:not(.is-theater) .tv-host-count {
    padding: 2px 4px;
    font-size: 7px;
    white-space: normal;
  }
  .kn .stage-shell:not(.is-theater) .tv-host-name {
    font-size: 8px;
    padding: 2px 6px;
  }
}
/* cửa sổ hẹp: gọn chú thích trên thanh tiêu đề và thanh dưới */
@media (min-width: 880px) and (max-width: 1299px) {
  .kn .stage-shell:not(.is-theater) .compact-legend span {
    display: none;
  }
  .kn .stage-shell:not(.is-theater) .kn-server {
    display: none;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker label {
    gap: 4px;
    font-size: 10px;
  }
  .kn .stage-shell:not(.is-theater) .compact-picker label select {
    padding: 0 1px;
    font-size: 9px;
  }
}
@media (min-width: 880px) and (max-width: 1049px) {
  .kn .stage-shell:not(.is-theater) .tv-board-title .compact-legend {
    display: none;
  }
  .kn .stage-shell:not(.is-theater) .kn-next {
    padding: 0 10px;
    gap: 8px;
  }
  .kn .stage-shell:not(.is-theater) .kn-next span {
    font-size: 10px;
  }
  .kn .stage-shell:not(.is-theater) .tv-splits span {
    padding: 0 7px;
  }
  .kn .stage-shell:not(.is-theater) .kn-music-label {
    display: none;
  }
}

/* Beta 1.0 — ẩn lối vào giỏ hàng trong màn Keno (Mua vé vẫn giữ nguyên) */
.kl-buy .kl-cart,
.kl-top .kl-bag {
  display: none !important;
}
/* Ảnh linh vật của ShadowRoot: khai báo trong CSS thay cho thẻ style do script tạo. */
.art {
  background-image: url('../img/keno-live/atlas.png');
}
.art.object {
  background-image: url('../img/keno-live/objects.png');
  background-size: 300% 300%;
}
.art.talisman {
  background-image: url('../img/keno-live/talismans.png');
  background-size: 200% 200%;
}
