@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,300;0,400;0,600;0,700;0,900;1,700&family=Chakra+Petch:wght@500;700;800&family=Share+Tech+Mono&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

:root {
  --primary-gold: #ffd700;
  --gold-glow: #ffc400;
  --red-border: #d41414;
  --dark-card: #09090b;
  --dark-card-border: #4a0808;
}

body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background-color: #110000;
  font-family: 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 16:9 Broadcast Container */
.broadcast-stage {
  position: relative;
  width: 100vw;
  height: 56.25vw; /* 16:9 ratio */
  max-height: 100vh;
  max-width: 177.78vh; /* 16:9 ratio */
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
  transition: background 0.5s ease;
}

/* Background Presets */
.bg-red-silk {
  background: 
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(255, 30, 30, 0.4) 0%, rgba(130, 0, 0, 0.8) 60%, #300000 100%),
    repeating-linear-gradient(45deg, rgba(200, 0, 0, 0.15) 0px, rgba(200, 0, 0, 0.15) 30px, rgba(140, 0, 0, 0.3) 30px, rgba(140, 0, 0, 0.3) 60px),
    linear-gradient(135deg, #800000 0%, #b30000 25%, #600000 50%, #990000 75%, #400000 100%);
}

.bg-dark-cyber {
  background: 
    radial-gradient(circle at 80% 20%, rgba(255, 0, 0, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #121214 0%, #0a0a0c 100%);
}

.bg-golden-luxury {
  background: 
    radial-gradient(ellipse at 50% 50%, #4a3500 0%, #201500 70%, #080500 100%),
    linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, transparent 60%);
}

.bg-obs-chroma {
  background: #00ff00 !important; /* Green screen chroma key */
}

.bg-transparent {
  background: transparent !important;
}

/* Background Dimmer / Color Overlay */
.bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

/* Ambient Silk Texture Overlay */
.silk-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  background: 
    radial-gradient(ellipse at 70% 30%, rgba(255, 80, 80, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 70%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
  mix-blend-mode: screen;
}

/* Main Content Layer */
.main-stage-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 1.5% 2.5%;
  justify-content: space-between;
}

/* Top Navigation / Status Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 12%;
}

/* Top Left Branding Badge */
.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.circular-badge-sm {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, #e60000 0%, #800000 70%, #400000 100%);
  border: 3px solid #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 4px;
}

.badge-text-top {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.badge-text-bot {
  font-size: 14px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.hud-channel-wrap {
  display: flex;
  flex-direction: column;
  position: relative;
}

.hud-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 10px rgba(255, 215, 0, 0.5);
  letter-spacing: 0.5px;
}

/* Sci-Fi HUD accent bar */
.hud-line {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.hud-bar {
  width: 120px;
  height: 5px;
  background: linear-gradient(90deg, #00f0ff 0%, #0088ff 70%, transparent 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px #00f0ff;
}

.hud-ticks {
  display: flex;
  gap: 3px;
}

.hud-ticks span {
  width: 4px;
  height: 4px;
  background: #00f0ff;
  border-radius: 1px;
}

/* Top Center Clock & Date Widget */
.clock-widget {
  background: rgba(0, 0, 0, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 28px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8), inset 0 0 12px rgba(255, 215, 0, 0.15);
  backdrop-filter: blur(8px);
}

.clock-date {
  font-size: 15px;
  font-weight: 400;
  color: #e0e0e0;
  letter-spacing: 0.5px;
  margin-bottom: -2px;
}

.clock-time {
  font-family: 'Share Tech Mono', 'Chakra Petch', monospace;
  font-size: 44px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.clock-time .colon {
  display: inline-block;
  animation: colonBlink 1s infinite;
  color: #ffd700;
}

@keyframes colonBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Main Two Columns Grid */
.stage-body {
  display: grid;
  grid-template-columns: 46% 51%;
  gap: 3%;
  height: 85%;
  align-items: stretch;
}

/* LEFT SIDE: Vietnam Table & Large Banner */
.left-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* Vietnam Live Results Table Box */
.vietnam-box {
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7), 0 0 15px rgba(255, 215, 0, 0.3);
  overflow: hidden;
  border: 2px solid #e0e0e0;
}

.vietnam-header {
  background: linear-gradient(90deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.vietnam-header .xem-them {
  font-size: 13px;
  font-weight: 600;
  color: #fffbeb;
  text-decoration: underline;
  cursor: pointer;
}

.vietnam-sub {
  background: #f1f3f5;
  border-bottom: 1px solid #dee2e6;
  padding: 4px 12px;
  font-size: 12px;
  color: #495057;
  display: flex;
  justify-content: space-between;
}

.vietnam-content {
  padding: 8px 12px 14px 12px;
  text-align: center;
  background: #ffffff;
}

.vietnam-stars {
  color: #adb5bd;
  font-size: 13px;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.vietnam-special-prize {
  font-size: 46px;
  font-weight: 900;
  color: #111827;
  letter-spacing: 3px;
  line-height: 1.1;
  padding: 4px 0 8px 0;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 8px;
  font-family: 'Chakra Petch', sans-serif;
  transition: all 0.3s ease;
}

.vietnam-sub-table {
  width: 100%;
  border-collapse: collapse;
}

.vietnam-sub-table td {
  padding: 4px 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 1px;
  border: 1px solid #e9ecef;
}

/* Bottom Left Large Banner & Details */
.bottom-banner-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  position: relative;
}

.banner-text-block {
  display: flex;
  flex-direction: column;
}

.banner-title-big {
  font-size: 58px;
  font-weight: 900;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff3a8 0%, #ffd700 50%, #d49a00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.9)) drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
  letter-spacing: 1px;
}

.banner-date-sub {
  font-size: 38px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 3px 6px #000000, 0 0 10px rgba(0,0,0,0.8);
  letter-spacing: 1px;
}

/* Bottom circular badge */
.circular-badge-lg {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: radial-gradient(circle, #e60000 0%, #8b0000 70%, #4a0000 100%);
  border: 4px solid #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.7), inset 0 0 15px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 5;
}

.badge-lg-top {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px #000;
}

.badge-lg-bot {
  font-size: 19px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 2px 4px #000;
}

/* Festive Decorative Props (Fans & Lantern) */
.fan-decor-left {
  position: absolute;
  bottom: -25px;
  left: -35px;
  width: 140px;
  height: 140px;
  pointer-events: none;
  opacity: 0.95;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
  z-index: 2;
}

.lantern-decor-right {
  position: absolute;
  bottom: -15px;
  right: 15px;
  width: 85px;
  pointer-events: none;
  filter: drop-shadow(0 6px 15px rgba(255, 0, 0, 0.6));
  z-index: 2;
  animation: lanternSway 3.5s ease-in-out infinite alternate;
  transform-origin: top center;
}

@keyframes lanternSway {
  0% { transform: rotate(-3deg); }
  100% { transform: rotate(3deg); }
}

/* RIGHT SIDE: TOP / BOTTOM LOTTERY TIERS */
.right-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Column Header: บน / ล่าง with Triangle */
.right-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 30px;
  padding-right: 50px;
  margin-bottom: 8px;
}

.header-label {
  font-size: 44px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 3px 8px #000000, 0 0 12px rgba(255, 215, 0, 0.4);
  letter-spacing: 1px;
}

.header-marker {
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid #ffd700;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.8));
  margin: 0 15px;
}

/* 5 Rows Container */
.rounds-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  flex: 1;
}

/* Individual Round Card */
.round-card {
  display: grid;
  grid-template-columns: 28% 10% 32% 30%;
  align-items: center;
  background: #000000;
  border: 3px solid #d41414;
  border-radius: 8px;
  padding: 4px 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.9), 0 0 15px rgba(212, 20, 20, 0.5);
  position: relative;
  transition: all 0.3s ease;
}

.round-card.highlight {
  border-color: #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8), inset 0 0 10px rgba(255, 215, 0, 0.4);
}

.round-card.drawing {
  animation: pulseCard 1.2s infinite alternate;
}

@keyframes pulseCard {
  0% {
    border-color: #d41414;
    box-shadow: 0 0 10px rgba(212, 20, 20, 0.5);
  }
  100% {
    border-color: #ff3333;
    box-shadow: 0 0 25px rgba(255, 50, 50, 0.9), inset 0 0 12px rgba(255, 0, 0, 0.4);
  }
}

/* Round Name */
.round-name-box {
  display: flex;
  align-items: center;
  padding-left: 6px;
}

.round-name {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
  white-space: nowrap;
}

/* Star emblem in red circle */
.star-emblem-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.star-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #e60000 0%, #8b0000 100%);
  border: 2px solid #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.star-circle svg {
  width: 26px;
  height: 26px;
  fill: #ffd700;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

/* Top 3-digit Box */
.num-box-top {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 3px solid #333333;
  height: 100%;
  padding-right: 10px;
}

/* Bottom 2-digit Box */
.num-box-bot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding-left: 10px;
}

/* Big Digits */
.number-val {
  font-family: 'Kanit', 'Chakra Petch', sans-serif;
  font-size: 58px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
  transition: transform 0.3s ease, color 0.3s ease;
}

.number-val.rolling {
  color: #ffd700;
  animation: numPop 0.5s ease-out;
}

@keyframes numPop {
  0% { transform: scale(1.3); filter: drop-shadow(0 0 15px #ffd700); }
  100% { transform: scale(1); filter: none; }
}

.number-empty {
  color: #555555;
  font-size: 40px;
}

/* Spinner indicator for drawing status */
.spinner-drawing {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 4px solid rgba(255, 215, 0, 0.3);
  border-radius: 50%;
  border-top-color: #ffd700;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fullscreen / Audio Control Widget (Subtle floating button for stream setup) */
.stream-controls {
  position: absolute;
  top: 10px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 100;
  opacity: 0.15;
  transition: opacity 0.3s ease;
}

.stream-controls:hover {
  opacity: 1;
}

.ctrl-btn {
  background: rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
}

.ctrl-btn:hover {
  background: #d41414;
  border-color: #ffd700;
}

