@font-face {
  font-family: HousieHindi;
  src: url(/assets/fonts/NotoSansDevanagari.ttf) format("truetype");
  font-display: swap;
}
.grid.print-layout-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.print-layout-preview {
  position: sticky;
  top: 16px;
  min-width: 0;
}
#preview-sheet {
  position: relative;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
#layout-preview {
  display: block;
  border: 0;
  transform-origin: top left;
}
.layout-record {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.layout-record .actions {
  flex-wrap: wrap;
}
.layout-record .actions > button {
  flex: 0 1 auto;
  overflow-wrap: normal;
}
@media (max-width: 760px) {
  .grid.print-layout-grid {
    display: flex;
    flex-direction: column;
  }
  .print-layout-grid > * {
    width: 100%;
  }
  .print-layout-preview {
    position: sticky;
    top: 8px;
    order: -1;
    z-index: 2;
  }
  .print-layout-preview .card {
    padding: 12px;
  }
  .preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .preview-toolbar h3 {
    margin: 0;
    font-size: 17px;
  }
  .preview-toolbar label {
    margin: 0;
    width: 52%;
  }
  .preview-toolbar label > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #preview-status {
    font-size: 12px;
    margin: 6px 0;
  }
  #open-preview {
    font-size: 13px;
  }
  #layout-form input,
  #layout-form select {
    scroll-margin-top: 410px;
  }
}
:root {
  color-scheme: light;
  --ink: #33141b;
  --muted: #8a6a5c;
  --green: #7e1226;
  --bg: #f7efdf;
  --line: #e4cfa6;
  --paper: #fffbf2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.55 HousieHindi,
    system-ui,
    sans-serif;
}
header,
nav,
main {
  max-width: 1240px;
  margin: auto;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 24px 12px;
  align-items: center;
}
header h1 {
  font:
    30px Georgia,
    serif;
  margin: 5px 0;
}
small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
header small {
  letter-spacing: 0.12em;
}
nav {
  display: flex;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  gap: 10px;
}
nav a {
  padding: 14px 12px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--muted);
}
nav a.active {
  color: var(--green);
  border-bottom: 3px solid var(--green);
}
main {
  padding: 28px 24px 70px;
}
h2 {
  font:
    34px/1.2 Georgia,
    serif;
  margin: 0 0 14px;
}
h3 {
  font-size: 20px;
  margin: 0 0 16px;
}
h4 {
  margin: 12px 0;
}
p {
  margin: 8px 0 18px;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--green);
  padding: 12px 17px;
  cursor: pointer;
  font: 600 15px system-ui;
  min-height: 44px;
}
button.primary {
  background: var(--green);
  color: white;
}
button.danger {
  color: #b23b3b;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d9c19a;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}
textarea {
  min-height: 180px;
}
input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}
label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
}
a {
  color: var(--green);
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: 24px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 22px;
  overflow-wrap: anywhere;
}
.call {
  background: var(--green);
  color: white;
}
.call small {
  color: #f3e3c0;
}
.call h2 {
  font-family: HousieHindi, system-ui, sans-serif;
  margin: 28px 0 12px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.actions > * {
  flex: 1;
}
.muted {
  color: var(--muted);
}
.badge {
  display: inline-block;
  background: #f3e3c0;
  padding: 5px 10px;
  border-radius: 30px;
  color: var(--green);
  font-size: 12px;
}
.warning,
#notice {
  background: #fcf0d5;
  border-left: 4px solid #c9a227;
  padding: 14px;
  margin: 15px 0;
}
.error {
  background: #f9e2dd;
  border-left-color: #b23b3b;
}
#notice {
  max-width: 1192px;
  margin: 18px auto;
  position: sticky;
  top: 0;
  z-index: 5;
}
#connection {
  font-size: 13px;
}
.login {
  max-width: 420px;
  margin: 40px auto;
}
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.history {
  max-height: 400px;
  overflow: auto;
}
.history .row {
  align-items: flex-start;
  font-size: 14px;
}
.board {
  min-height: 65vh;
  background: #7e1226;
  color: #fbefcf;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 45px;
  border-radius: 18px;
}
.board h2 {
  font: clamp(38px, 6vw, 84px) / 1.3 system-ui;
  color: #e8ce96;
}
.board p {
  font-size: 25px;
}
.board .muted {
  color: #e8cfae;
}
.phone {
  max-width: 620px;
  margin: auto;
}
.songmark {
  display: flex;
  gap: 14px;
  align-items: center;
  border-bottom: 1px dashed var(--line);
  padding: 13px 0;
}
.songmark button {
  min-width: 44px;
}
.songmark.marked span {
  text-decoration: line-through;
  opacity: 0.6;
}
details > summary {
  cursor: pointer;
  font-weight: 650;
  padding: 10px 0;
}
.paper {
  margin: 15mm auto;
  background: white;
  max-width: 280mm;
  padding: 12mm;
  border: 1px solid #aaa;
}
.paper table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.paper td {
  border: 1px solid #bbb;
  padding: 6px;
  vertical-align: top;
  font-size: 11px;
  height: 90px;
}
.paper h1 {
  font: 24px Georgia;
}
.qr {
  width: 140px;
  height: 140px;
}
#scanner {
  position: fixed;
  inset: 0;
  background: #5e0c1def;
  z-index: 20;
  padding: 30px;
  color: white;
  text-align: center;
}
video {
  max-width: 90vw;
  width: 550px;
  max-height: 70vh;
}
#scanner button {
  display: block;
  margin: 15px auto;
}
[hidden] {
  display: none !important;
}
@media (max-width: 740px) {
  header {
    padding: 20px 16px;
    align-items: flex-start;
  }
  header h1 {
    font-size: 25px;
  }
  header small {
    font-size: 9px;
  }
  .grid,
  .columns {
    grid-template-columns: 1fr;
  }
  main {
    padding: 22px 16px;
  }
  nav {
    padding: 0 8px;
  }
  nav a {
    font-size: 14px;
    padding: 12px 9px;
  }
  .card {
    padding: 19px;
  }
  h2 {
    font-size: 30px;
  }
  .row {
    flex-wrap: wrap;
  }
  .board {
    padding: 24px;
  }
  .board p {
    font-size: 20px;
  }
  #notice {
    margin: 12px 16px;
  }
  .paper {
    width: 100%;
    overflow: auto;
  }
}
@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }
  .paper {
    break-after: page;
    border: 0;
    margin: 0;
    padding: 0;
    max-width: none;
  }
  body {
    background: white;
  }
  .paper td {
    font-size: 10px;
  }
  header,
  nav,
  #notice {
    display: none;
  }
}

.song-table {
  max-height: 70vh;
  overflow: auto;
}
.song-edit-row {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px;
}
.song-edit-row label {
  margin: 0;
  font-size: 12px;
}
.ticket-preview {
  overflow: auto;
  margin: 16px 0;
}
.ticket-preview > div {
  display: grid;
  grid-template-columns: repeat(9, minmax(55px, 1fr));
}
.ticket-preview span {
  border: 1px solid var(--line);
  padding: 5px;
  min-height: 65px;
  font-size: 11px;
}
.ticket-preview small {
  font-size: 9px;
}
.export-controls {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 600px) {
  .song-edit-row {
    grid-template-columns: 24px 1fr;
  }
  .song-edit-row label:last-child {
    grid-column: 2;
  }
  .song-edit-row b {
    grid-row: span 2;
  }
}

/* The stage presentation owns the whole display. Operator panels keep their shell. */
.led-page > header,
.led-page > nav,
.led-page > #notice {
  display: none;
}
.led-page #app {
  max-width: none;
  margin: 0;
  padding: 0;
}
.live-board {
  --led-bg: #2a0611;
  --led-panel: #7e1226;
  --led-gold: #e8ce96;
  --led-text: #fbefcf;
  --led-soft: #e8cfae;
  --led-border: #8a4055;
  min-height: 100svh;
  width: 100%;
  padding: clamp(18px, 3vw, 52px);
  border-radius: 0;
  gap: 20px;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, var(--led-panel), transparent 68%),
    var(--led-bg);
  color: var(--led-text);
}
.led-midnight {
  --led-bg: #0b1127;
  --led-panel: #1e3560;
  --led-gold: #b2d4ff;
  --led-soft: #c0cbe3;
  --led-border: #576c94;
}
.led-festival {
  --led-bg: #2e0d20;
  --led-panel: #65243f;
  --led-gold: #ffe1a0;
  --led-soft: #e5bccc;
  --led-border: #8e6076;
}
.led-topline,
.led-bottom {
  width: 100%;
  position: relative;
  z-index: 1;
}
.led-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
  font-size: clamp(14px, 1.5vw, 24px);
  color: var(--led-soft);
}
.led-signal {
  flex-shrink: 0;
  font: 700 12px system-ui;
  letter-spacing: 0.12em;
  border: 1px solid var(--led-border);
  border-radius: 30px;
  padding: 9px 16px;
}
.led-signal::before {
  content: "";
  display: inline-block;
  border-radius: 50%;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  background: #9ae8bd;
}
.led-signal[lang="hi"] {
  letter-spacing: normal;
}
.led-signal.ended::before {
  background: var(--led-gold);
}
.led-signal.lost {
  color: #ffe4b9;
  background: #663821;
}
.led-signal.lost::before {
  background: #ffd195;
}
.led-scene {
  width: 100%;
  max-width: 1450px;
  position: relative;
  z-index: 1;
  padding: 20px 0;
  margin: auto;
}
.live-board .led-title,
.live-board .led-song h2 {
  font:
    650 clamp(38px, 5.5vw, 98px) / 1.3 HousieHindi,
    system-ui,
    sans-serif;
  color: var(--led-gold);
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.live-board .led-eyebrow {
  font: 700 clamp(14px, 1.5vw, 22px) system-ui;
  letter-spacing: 0.16em;
  color: var(--led-soft);
}
.live-board .led-translation,
.live-board .led-song p {
  font-size: clamp(21px, 2.4vw, 42px);
  color: var(--led-text);
  margin: 12px 0 30px;
}
.live-board .led-prize {
  display: inline-block;
  font-size: clamp(24px, 3vw, 48px);
  border-bottom: 1px solid var(--led-border);
  padding: 8px 24px 14px;
  color: var(--led-text);
}
.led-prize-name small {
  display: block;
  font-size: 0.6em;
  font-weight: 500;
  color: var(--led-soft);
  margin-top: 4px;
}
.live-board .led-caption {
  font-size: clamp(16px, 1.7vw, 28px);
  color: var(--led-soft);
}
.led-tickets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 24px auto;
  max-width: 1350px;
}
.led-ticket {
  background: var(--led-panel);
  border: 1px solid var(--led-border);
  border-radius: 14px;
  padding: 17px 22px;
  min-width: 180px;
}
.led-ticket span {
  display: block;
  font: 600 11px system-ui;
  letter-spacing: 0.17em;
  color: var(--led-soft);
  margin-bottom: 8px;
}
.led-ticket strong {
  font: 750 clamp(20px, 2.5vw, 40px) / 1.25 system-ui;
  letter-spacing: 0.025em;
  overflow-wrap: anywhere;
}
.winning-tickets .led-ticket {
  border: 2px solid var(--led-gold);
  padding: 24px 38px;
  box-shadow: 0 0 55px #f5d68218;
}
.winning-tickets strong {
  color: var(--led-gold);
  font-size: clamp(32px, 4.5vw, 76px);
}
.led-countdown {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: clamp(100px, 11vw, 160px);
  min-height: clamp(100px, 11vw, 160px);
  border: 2px solid var(--led-gold);
  border-radius: 50%;
  margin: 18px auto;
}
.led-countdown strong {
  font: 750 clamp(42px, 5vw, 70px) system-ui;
  color: var(--led-gold);
}
.led-countdown span {
  max-width: 85%;
  margin: 0 auto 10px;
  font: 650 10px/1.4 system-ui;
  letter-spacing: 0.05em;
}
.live-board .led-current {
  font-size: clamp(13px, 1.4vw, 22px);
  color: var(--led-soft);
  margin: 10px 0;
}
.led-ticker {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--led-border);
  padding-top: 16px;
}
.led-ticker > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(13px, 1.35vw, 21px);
}
.led-ticker span {
  color: var(--led-soft);
}
.led-ticker b {
  color: var(--led-gold);
  white-space: nowrap;
}
.led-results {
  margin: 20px auto;
  max-width: 1100px;
}
.led-results > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  border-bottom: 1px solid var(--led-border);
  padding: 14px 20px;
  font-size: clamp(20px, 2.4vw, 40px);
  text-align: left;
}
.led-results span {
  flex: 1;
  min-width: 0;
}
/* Ticket IDs stay whole; the prize name wraps instead. */
.led-results strong {
  color: var(--led-gold);
  white-space: nowrap;
  flex-shrink: 0;
}
.led-prizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px auto;
}
.led-prizes > div {
  background: var(--led-panel);
  border: 1px solid var(--led-border);
  padding: 24px;
  border-radius: 14px;
}
.led-prizes h3 {
  font-size: clamp(20px, 2vw, 32px);
}
.led-prizes p {
  font-size: 16px;
  color: var(--led-soft);
  margin: 12px 0 0;
}
.led-pill {
  display: inline-block;
  border: 1px solid var(--led-gold);
  color: var(--led-gold);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 13px;
}
.led-history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
  text-align: left;
}
.led-history p {
  border-bottom: 1px solid var(--led-border);
  padding: 12px;
  font-size: clamp(18px, 2vw, 32px);
}
.led-history small {
  color: var(--led-soft);
  font-size: 16px;
}
.live-board .led-page-count {
  color: var(--led-soft);
  font-size: 14px;
  margin: 20px 0 0;
}
.led-fullscreen {
  position: fixed;
  z-index: 5;
  right: 16px;
  bottom: 12px;
  opacity: 0.15;
  background: var(--paper);
}
.led-fullscreen:hover,
.led-fullscreen:focus {
  opacity: 1;
}
.music-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  gap: 11px;
  margin: 28px auto;
}
.music-bars i {
  width: 6px;
  height: 30px;
  background: var(--led-gold);
  border-radius: 4px;
  animation: music-pulse 1.5s ease-in-out infinite alternate;
}
.music-bars i:nth-child(2n) {
  animation-delay: -0.4s;
  height: 55px;
}
.music-bars i:nth-child(3n) {
  animation-delay: -0.9s;
  height: 42px;
}
@keyframes music-pulse {
  from {
    transform: scaleY(0.45);
    opacity: 0.4;
  }
  to {
    transform: scaleY(1);
    opacity: 0.9;
  }
}
.lottery-orbit {
  position: absolute;
  width: 70vw;
  height: 70vw;
  max-width: 800px;
  max-height: 800px;
  border: 1px dashed var(--led-border);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.25;
  z-index: -1;
  animation: lottery-orbit 45s linear infinite;
}
@keyframes lottery-orbit {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
.winner-sparkles {
  color: var(--led-gold);
  font-size: clamp(28px, 5vw, 80px);
  letter-spacing: 0.5em;
  animation: winner-glow 2s ease-in-out infinite alternate;
}
@keyframes winner-glow {
  to {
    opacity: 0.45;
    transform: scale(0.92);
  }
}
.led-no-motion *,
.led-no-motion .scene-enter {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .live-board *,
  .live-board .scene-enter {
    animation: none !important;
  }
}
.display-settings-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.display-preview {
  position: sticky;
  top: 12px;
  min-width: 0;
}
.led-preview {
  margin: 18px 0;
  border-radius: 10px;
  overflow: hidden;
}
.led-preview .live-board {
  min-height: 400px;
  padding: 20px;
  gap: 12px;
}
.led-preview .led-topline {
  font-size: 11px;
}
.led-preview .led-signal {
  font-size: 9px;
  padding: 5px;
}
.led-preview .led-title,
.led-preview .led-song h2 {
  font-size: 27px;
}
.led-preview .led-translation,
.led-preview .led-song p,
.led-preview .led-prize {
  font-size: 19px;
}
.led-preview .led-caption,
.led-preview .led-current,
.led-preview .led-ticker > div {
  font-size: 12px;
}
.led-preview .led-ticket {
  min-width: 120px;
  padding: 10px;
}
.led-preview .led-ticket strong {
  font-size: 20px;
}
.led-preview .led-countdown {
  width: 95px;
  min-height: 95px;
}
.led-preview .led-countdown strong {
  font-size: 36px;
}
.led-preview .led-results > div {
  font-size: 16px;
  padding: 10px;
}
.led-preview .led-prizes {
  grid-template-columns: 1fr;
}
.led-preview .led-prizes h3 {
  font-size: 18px;
}
.led-preview .winner-sparkles {
  font-size: 30px;
}
.led-preview .led-history p {
  font-size: 16px;
}
.lottery-needed {
  background: #fff1ce;
  border: 1px solid #d9bc72;
  padding: 6px 10px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 13px;
}
@media (max-width: 740px) {
  .live-board {
    padding: 20px 16px;
  }
  .led-topline {
    gap: 10px;
    font-size: 13px;
  }
  .led-signal {
    font-size: 9px;
    padding: 7px 10px;
    max-width: 48%;
  }
  .led-tickets {
    gap: 10px;
  }
  .led-ticket {
    min-width: 0;
    max-width: 100%;
    padding: 14px;
  }
  .led-results > div {
    padding: 12px 0;
    gap: 12px;
    font-size: 18px;
  }
  .led-prizes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .led-prizes > div {
    padding: 16px 10px;
  }
  .led-history {
    grid-template-columns: 1fr;
  }
  .display-settings-grid {
    grid-template-columns: 1fr;
  }
  .display-preview {
    position: static;
  }
  .led-ticker {
    gap: 10px;
  }
}

.led-rehearsal {
  color: var(--led-soft);
  font-size: 10px;
  letter-spacing: 0.15em;
  margin-top: 3px;
}
/* Scene layers animate inside the persistent board, including on older browsers. */
.led-page {
  background: #2a0611;
}
.led-scene-content {
  position: relative;
  padding: 1px 0;
}
@media (min-width: 741px) {
  .led-page .live-board {
    height: 100svh;
    min-height: 0;
  }
  .led-page .led-scene {
    flex: 1;
    min-height: 0;
    margin: 0 auto;
    padding: 0;
  }
  .led-page .led-many .led-feature-layout {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
    align-items: center;
    gap: 4vw;
  }
  .led-page .led-many .led-feature-intro .led-title {
    font-size: clamp(30px, 3.3vw, 56px);
  }
  .led-page .led-many .led-feature-intro .led-translation {
    font-size: clamp(20px, 2vw, 30px);
    margin-bottom: 18px;
  }
  .led-page .led-many .led-feature-intro .led-prize {
    font-size: clamp(24px, 2.5vw, 36px);
  }
  .led-page .led-many .led-feature-intro .led-caption {
    font-size: clamp(16px, 1.6vw, 24px);
  }
  .led-page .led-many .led-feature-layout .led-tickets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 14px;
  }
  .led-page .led-many .led-ticket,
  .led-page .led-many .winning-tickets .led-ticket {
    padding: 16px;
    min-width: 0;
  }
  .led-page .led-many .led-ticket strong {
    font-size: clamp(20px, 2.1vw, 33px);
  }
  .led-page .led-many .winning-tickets .led-ticket {
    min-width: 26%;
  }
  .led-page .led-many .winner-sparkles {
    font-size: clamp(32px, 3vw, 52px);
    margin-bottom: 18px;
  }
  .led-page .led-dense .led-feature-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .led-page .led-dense .led-feature-layout .led-tickets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0;
  }
  .led-page .led-dense .led-ticket {
    padding: 10px;
  }
  .led-page .led-dense .led-ticket strong {
    font-size: clamp(16px, 1.8vw, 26px);
  }
  .led-page .led-dense .led-lottery-intro {
    display: grid;
    grid-template-columns: 1fr 1fr 96px;
    column-gap: 24px;
    align-items: center;
  }
  .led-page .led-dense .led-lottery-intro .led-title {
    grid-column: 1;
    grid-row: 1;
    font-size: 34px;
    margin: 0;
  }
  .led-page .led-dense .led-lottery-intro .led-translation {
    grid-column: 1;
    grid-row: 2;
    font-size: 18px;
    margin: 0;
  }
  .led-page .led-dense .led-lottery-intro .led-prize {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    font-size: 28px;
  }
  .led-page .led-dense .led-countdown {
    grid-column: 3;
    grid-row: 1 / 3;
    width: 96px;
    min-height: 96px;
    margin: 0;
  }
  .led-page .led-dense .led-countdown strong {
    font-size: 36px;
  }
  .led-page .led-dense .led-caption {
    grid-column: 1 / -1;
    font-size: 16px;
    margin: 5px;
  }
  .led-page .led-scene-content {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%) scale(var(--scene-scale, 1));
    transform-origin: center;
  }
}
.live-board::before,
.live-board::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, var(--led-gold), transparent 65%);
  opacity: 0.035;
  transform: translate3d(0, 0, 0);
  animation: ambient-drift 20s ease-in-out infinite alternate;
}
.live-board::before {
  left: -30vw;
  top: -25vw;
}
.live-board::after {
  right: -30vw;
  bottom: -30vw;
  animation-delay: -10s;
}
@keyframes ambient-drift {
  to {
    transform: translate3d(15vw, 8vh, 0) scale(1.15);
    opacity: 0.07;
  }
}
.live-board[data-scene="lottery"] .led-ticket {
  animation: ticket-float 2.6s ease-in-out infinite;
}
.live-board[data-scene="lottery"] .led-ticket:nth-child(2n) {
  animation-delay: -0.6s;
}
.live-board[data-scene="lottery"] .led-ticket:nth-child(3n) {
  animation-delay: -1.3s;
}
.live-board[data-scene="lottery"] .led-ticket:nth-child(4n) {
  animation-delay: -1.9s;
}
@keyframes ticket-float {
  50% {
    transform: translateY(-6px);
    border-color: var(--led-gold);
    box-shadow: 0 7px 30px #0003;
  }
}
.led-confetti {
  position: absolute;
  inset: -10% 0 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}
.led-confetti i {
  position: absolute;
  top: -25px;
  left: 7%;
  width: 8px;
  height: 16px;
  background: var(--led-gold);
  border-radius: 2px;
  animation: confetti-fall 5.4s linear infinite;
  opacity: 0;
}
.led-confetti i:nth-child(2n) {
  left: 18%;
  animation-delay: -1.1s;
  background: #f3e3c0;
}
.led-confetti i:nth-child(3n) {
  left: 32%;
  animation-delay: -2.5s;
}
.led-confetti i:nth-child(4n) {
  left: 48%;
  animation-delay: -0.4s;
  background: #c9a227;
}
.led-confetti i:nth-child(5n) {
  left: 64%;
  animation-delay: -3.7s;
}
.led-confetti i:nth-child(6n) {
  left: 77%;
  animation-delay: -1.8s;
}
.led-confetti i:nth-child(7n) {
  left: 92%;
  animation-delay: -4.5s;
}
@keyframes confetti-fall {
  10% {
    opacity: 0.8;
  }
  85% {
    opacity: 0.6;
  }
  to {
    transform: translate3d(28px, 65vh, 0) rotate(380deg);
    opacity: 0;
  }
}
.led-no-motion::before,
.led-no-motion::after {
  animation: none !important;
}
.led-no-motion .led-confetti {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .live-board::before,
  .live-board::after {
    animation: none !important;
  }
  .led-confetti {
    display: none;
  }
}

/* Public display in a phone or narrow app iframe: readable cards, natural scrolling. */
@media (max-width: 740px) {
  .led-page .live-board {
    padding: 18px 14px 62px;
    gap: 14px;
  }
  .led-page .led-topline > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .led-page .led-scene {
    padding: 6px 0;
  }
  .led-page .led-title,
  .led-page .led-song h2 {
    font-size: clamp(26px, 7vw, 38px);
    line-height: 1.35;
    margin: 8px 0;
  }
  .led-page .led-translation,
  .led-page .led-song p {
    font-size: clamp(16px, 4.5vw, 22px);
    line-height: 1.4;
    margin: 6px 0 14px;
    overflow-wrap: anywhere;
  }
  .led-page .led-prize {
    font-size: 23px;
    padding: 4px 12px 8px;
    margin: 10px 0;
  }
  .led-page .led-caption {
    font-size: 14px;
    line-height: 1.5;
    margin: 10px 0;
  }
  .led-page .led-countdown {
    width: 88px;
    min-height: 88px;
    margin: 12px auto;
  }
  .led-page .led-countdown strong {
    font-size: 36px;
  }
  .led-page .led-countdown span {
    font-size: 8px;
  }
  .led-page .led-tickets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 18px 0;
  }
  .led-page .led-ticket,
  .led-page .winning-tickets .led-ticket {
    padding: 12px 8px;
    min-width: 0;
    border-radius: 10px;
  }
  .led-page .led-ticket strong {
    font-size: clamp(13px, 3.55vw, 22px);
    letter-spacing: 0;
  }
  .led-page .led-ticket:only-child {
    grid-column: 1 / -1;
    justify-self: center;
    padding: 18px;
  }
  .led-page .led-ticket:only-child strong {
    font-size: clamp(22px, 6vw, 32px);
  }
  .led-page .led-ticket span {
    font-size: 9px;
    margin-bottom: 5px;
  }
  .led-page .winner-sparkles {
    font-size: 32px;
  }
  .led-page .music-bars {
    height: 50px;
    margin: 18px auto;
  }
  .led-page .led-page-count {
    margin-top: 10px;
  }
  .led-page .led-current {
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .led-page .led-ticker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 10px;
  }
  .led-page .led-ticker > div {
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    text-align: left;
  }
  .led-page .led-ticker b {
    overflow-wrap: anywhere;
    text-align: right;
  }
  .led-page .led-results > div {
    font-size: 15px;
  }
  .led-page .led-history p {
    font-size: 18px;
  }
  .led-page .led-history small {
    font-size: 14px;
  }
  .led-page .led-fullscreen {
    position: relative;
    display: block;
    margin: -54px 10px 10px auto;
    min-width: 44px;
    min-height: 44px;
    right: auto;
    bottom: auto;
    opacity: 0.75;
  }
}
.draw-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
.draw-board button {
  min-width: 0;
  padding: 10px 0;
  font-size: 18px;
  font-weight: 700;
  /* The card allows breaking anywhere; a number must never split. */
  overflow-wrap: normal;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* Narrow boards keep each ten on two rows of five, with thumb-sized buttons. */
.draw-card {
  container-type: inline-size;
}
@container (max-width: 480px) {
  .draw-board {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
}
.draw-board button.called {
  background: var(--green);
  color: var(--paper);
  opacity: 1;
}
.chit summary {
  cursor: pointer;
  margin-top: 8px;
  font-size: 14px;
}
.live-board .led-song p.led-song-info {
  font: 500 clamp(15px, 1.6vw, 28px) system-ui;
  color: var(--led-soft);
  letter-spacing: 0.02em;
  margin: -14px 0 24px;
}
.ticket-status {
  padding: 14px;
  margin: 15px 0;
  border-left: 4px solid #2f7a4a;
  background: #e3f1e6;
}
.ticket-status.unsold,
.ticket-status.void,
.ticket-status.not_found {
  border-left-color: #b23b3b;
  background: #f9e2dd;
}
.unsold-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.unsold-preview span {
  background: #f3e3c0;
  padding: 6px 12px;
  border-radius: 30px;
}
#unsold-text {
  width: 100%;
  min-height: 90px;
  font: inherit;
}
#notice.error {
  background: #f9e2dd;
  border-left-color: #b23b3b;
}
