/* ====================================================================
   INDOMARET RUN DOORPRIZE - FUTURISTIC AI & CASINO SLOT ENGINE
   Color Palette: #c23433 (Red), #2e6baf (Blue), #f7cc4c (Yellow)
   Typography: Akira Expanded Demo.otf (with modern fallback)
   ==================================================================== */

@font-face {
  font-family: 'Akira Expanded';
  src: url('../assets/fonts/Akira Expanded Demo.otf') format('opentype'),
       url('../assets/fonts/Akira-Expanded-Demo.otf') format('opentype'),
       url('../assets/fonts/AkiraExpanded.otf') format('opentype'),
       local('Akira Expanded'),
       local('Akira Expanded Demo');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Indomaret Official Palette */
  --idm-red: #c23433;
  --idm-blue: #2e6baf;
  --idm-yellow: #f7cc4c;

  /* Modern AI Dark Theme Palette */
  --bg-deep: #070a13;
  --bg-card: rgba(14, 20, 34, 0.72);
  --bg-card-solid: #0e1524;
  --bg-reel: #090e1c;
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow-blue: rgba(46, 107, 175, 0.55);
  --border-glow-red: rgba(194, 52, 51, 0.55);
  --border-glow-yellow: rgba(247, 204, 76, 0.6);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Fonts */
  --font-display: 'Akira Expanded', -apple-system, BlinkMacSystemFont, 'Montserrat', 'Syne', 'Orbitron', 'Arial Black', sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;

  /* Shadows & Glows */
  --glow-yellow-box: 0 0 35px rgba(247, 204, 76, 0.4), 0 0 15px rgba(247, 204, 76, 0.3);
  --glow-blue-box: 0 0 35px rgba(46, 107, 175, 0.45), 0 0 15px rgba(46, 107, 175, 0.3);
  --glow-red-box: 0 0 35px rgba(194, 52, 51, 0.45), 0 0 15px rgba(194, 52, 51, 0.3);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-ui);
  user-select: none;
}

/* ====================================================================
   MAIN VIEWPORT & BACKGROUND MODES (16:9 / 1920x1080)
   ==================================================================== */
#app-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: background 0.3s ease;
}

/* Default Futuristic AI Background */
.bg-futuristic {
  background: radial-gradient(circle at 50% 15%, rgba(46, 107, 175, 0.22) 0%, transparent 60%),
              radial-gradient(circle at 15% 85%, rgba(194, 52, 51, 0.18) 0%, transparent 55%),
              radial-gradient(circle at 85% 85%, rgba(247, 204, 76, 0.12) 0%, transparent 55%),
              linear-gradient(180deg, #090e1b 0%, #060912 100%);
}

.bg-futuristic::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0.1) 85%);
  pointer-events: none;
}

/* Green Screen Chroma Key Mode (#00ff00) */
.bg-greenscreen {
  background: #00ff00 !important;
}
.bg-greenscreen::before,
.bg-greenscreen #ambient-canvas {
  display: none !important;
}
.bg-greenscreen .glass-panel {
  background: rgba(14, 20, 34, 0.95) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
}

/* Custom Image Background */
.bg-custom-image {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

#ambient-canvas, #confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
#confetti-canvas {
  z-index: 99;
}

/* ====================================================================
   HEADER & TOP CONTROLS
   ==================================================================== */
.stage-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 36px;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(8, 12, 22, 0.75) 0%, rgba(8, 12, 22, 0.1) 100%);
  border-bottom: 1px solid var(--border-glass);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  backdrop-filter: blur(10px);
}

.brand-stripes {
  display: flex;
  gap: 4px;
}
.brand-stripes span {
  width: 5px;
  height: 20px;
  border-radius: 2px;
}
.stripe-red { background-color: var(--idm-red); box-shadow: 0 0 8px var(--idm-red); }
.stripe-blue { background-color: var(--idm-blue); box-shadow: 0 0 8px var(--idm-blue); }
.stripe-yellow { background-color: var(--idm-yellow); box-shadow: 0 0 8px var(--idm-yellow); }

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.brand-title span.run-text {
  color: var(--idm-yellow);
  text-shadow: 0 0 15px rgba(247, 204, 76, 0.6);
}

/* Stats Badges */
.header-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: rgba(18, 26, 44, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  font-size: 13px;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
}
.stat-pill strong {
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}
.stat-pill .indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Top Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ====================================================================
   STAGE CENTER & PRIZE BANNER
   ==================================================================== */
.stage-main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 40px;
  max-width: 1720px;
  margin: 0 auto;
  width: 100%;
}

.prize-pill-container {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: floatSubtle 4s ease-in-out infinite;
}

@keyframes floatSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.prize-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(18, 26, 44, 0.7);
  border: 1px solid var(--border-glass);
  color: var(--idm-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}
.prize-nav-btn:hover {
  background: var(--idm-blue);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(46, 107, 175, 0.6);
}
.prize-nav-btn:active {
  transform: scale(0.95);
}

.prize-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 28px;
  background: linear-gradient(135deg, rgba(46, 107, 175, 0.25) 0%, rgba(14, 20, 34, 0.85) 100%);
  border: 1.5px solid var(--border-glow-yellow);
  border-radius: 9999px;
  box-shadow: 0 0 25px rgba(247, 204, 76, 0.25);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.25s ease;
}
.prize-pill:hover {
  box-shadow: 0 0 35px rgba(247, 204, 76, 0.45);
  border-color: #fff;
}

.prize-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(247, 204, 76, 0.8));
}

.prize-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--idm-yellow);
  text-shadow: 0 0 14px rgba(247, 204, 76, 0.5);
}

.prize-count-badge {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--idm-red);
  color: #fff;
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(194, 52, 51, 0.6);
  white-space: nowrap;
}

/* ====================================================================
   SLOT MACHINE DISPLAY (FOR 1 - 3 WINNERS)
   Guide Book Page 2 Specification
   ==================================================================== */
.slot-machine-rack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
}

/* Individual Slot Unit */
.slot-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.4s ease;
}

/* Slot Machine Frame */
.slot-cabinet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 22px 28px;
  background: linear-gradient(160deg, #162238 0%, #0d1524 50%, #070c16 100%);
  border: 2px solid var(--border-glow-blue);
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7),
              0 0 35px rgba(46, 107, 175, 0.35),
              inset 0 1px 2px rgba(255, 255, 255, 0.2);
  position: relative;
}

/* Glossy highlight line on cabinet */
.slot-cabinet::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  border-radius: 9999px;
  pointer-events: none;
}

/* Slot Reel Drum */
.slot-reel {
  width: 130px;
  height: 190px;
  background: linear-gradient(180deg, #070c18 0%, #111a2f 50%, #070c18 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 15px 25px rgba(0, 0, 0, 0.9),
              inset 0 -15px 25px rgba(0, 0, 0, 0.9),
              0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Glass lens overlay on each reel */
.slot-reel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, 
    rgba(0, 0, 0, 0.75) 0%, 
    rgba(255, 255, 255, 0.08) 35%, 
    rgba(255, 255, 255, 0) 50%, 
    rgba(255, 255, 255, 0.05) 65%, 
    rgba(0, 0, 0, 0.8) 100%
  );
  pointer-events: none;
  z-index: 5;
}

.reel-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  width: 100%;
  top: 0;
  transition: transform 0.1s linear;
}

.reel-item {
  width: 100%;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 78px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
  letter-spacing: -1px;
}

/* Standby Question Mark (Page 2 Guidebook) */
.reel-item.standby-question {
  color: var(--text-dim);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
  font-size: 84px;
}

/* Reel Locked Highlight */
.slot-reel.locked {
  border-color: var(--idm-yellow);
  box-shadow: inset 0 0 20px rgba(247, 204, 76, 0.3), 
              0 0 25px rgba(247, 204, 76, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.slot-reel.locked .reel-item {
  color: var(--idm-yellow);
  text-shadow: 0 0 30px rgba(247, 204, 76, 0.8), 0 0 10px #fff;
}

/* Winner Name Card Reveal (Smooth Slide Up Under Slot) */
.winner-hero-card {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 36px;
  background: linear-gradient(135deg, rgba(14, 21, 37, 0.95) 0%, rgba(22, 33, 56, 0.95) 100%);
  border: 2px solid var(--idm-yellow);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(247, 204, 76, 0.4), 0 15px 35px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-hero-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.winner-badge-rank {
  font-family: var(--font-display);
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--idm-red);
  color: #fff;
  letter-spacing: 1px;
  box-shadow: 0 0 12px var(--idm-red);
}

.winner-hero-info {
  display: flex;
  flex-direction: column;
}

.winner-hero-number {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.winner-hero-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.5);
}

/* Multi-Winner Row for 2-3 Winners */
.multi-slot-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  width: 100%;
}
.multi-slot-container .slot-cabinet {
  padding: 16px 20px;
  gap: 10px;
}
.multi-slot-container .slot-reel {
  width: 80px;
  height: 125px;
}
.multi-slot-container .reel-item {
  font-size: 52px;
  height: 125px;
}
.multi-slot-container .winner-hero-card {
  padding: 12px 24px;
}
.multi-slot-container .winner-hero-name {
  font-size: 22px;
}

/* ====================================================================
   MASS DRAW GRID DISPLAY (> 3 or 10+ WINNERS)
   Guide Book Page 2 Specification: Langsung keluar bersamaan
   ADAPTIVE DENSITY ENGINE:
   - Density Normal (<= 10): 5 cols x 2 rows
   - Density Compact (11 - 20): 5 cols x 4 rows
   - Density Dense (21 - 35, e.g. 30 Winners): 6 cols x 5 rows
   - Density Micro (> 35): 7-8 cols
   Guarantees no name is truncated or clipped!
   ==================================================================== */
.mass-draw-container {
  width: 100%;
  max-width: 1680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.mass-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  max-height: 560px;
  overflow-y: auto;
  padding: 10px;
  transition: all 0.3s ease;
}

.mass-grid::-webkit-scrollbar {
  width: 6px;
}
.mass-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Density 1: <= 10 winners (5 columns x 2 rows) */
.mass-grid.grid-density-normal {
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.mass-grid.grid-density-normal .mass-card {
  padding: 14px 18px;
}
.mass-grid.grid-density-normal .mass-number {
  font-size: 16px;
}
.mass-grid.grid-density-normal .mass-name {
  font-size: 14px;
  min-height: 2.4em;
}

/* Density 2: 11 - 20 winners (5 columns x 3-4 rows) */
.mass-grid.grid-density-compact {
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.mass-grid.grid-density-compact .mass-card {
  padding: 10px 14px;
}
.mass-grid.grid-density-compact .mass-number {
  font-size: 14px;
}
.mass-grid.grid-density-compact .mass-name {
  font-size: 13px;
  min-height: 2.4em;
}

/* Density 3: 21 - 35 winners (PERFECT FOR 30 WINNERS: 6 columns x 5 rows) */
.mass-grid.grid-density-dense {
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-height: 570px;
}
.mass-grid.grid-density-dense .mass-card {
  padding: 7px 12px;
  border-radius: 12px;
  gap: 4px;
}
.mass-grid.grid-density-dense .mass-number {
  font-size: 13px;
  letter-spacing: 1px;
}
.mass-grid.grid-density-dense .mass-rank {
  font-size: 10px;
}
.mass-grid.grid-density-dense .mass-name {
  font-size: 12px;
  line-height: 1.2;
  min-height: 2.4em;
}

/* Density 4: > 35 winners (7-8 columns) */
.mass-grid.grid-density-micro {
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.mass-grid.grid-density-micro .mass-card {
  padding: 5px 8px;
  border-radius: 10px;
  gap: 2px;
}
.mass-grid.grid-density-micro .mass-number {
  font-size: 11px;
}
.mass-grid.grid-density-micro .mass-name {
  font-size: 10.5px;
  line-height: 1.15;
  min-height: 2.3em;
}

/* Base Mass Card Styling */
.mass-card {
  background: linear-gradient(135deg, rgba(16, 24, 42, 0.9) 0%, rgba(10, 16, 28, 0.9) 100%);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.mass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--idm-blue);
  transition: all 0.3s ease;
}

.mass-card.revealed {
  border-color: var(--border-glow-yellow);
  box-shadow: 0 0 25px rgba(247, 204, 76, 0.25), 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: cardPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.mass-card.revealed::before {
  background: var(--idm-yellow);
}

@keyframes cardPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.mass-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mass-rank {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--idm-yellow);
  letter-spacing: 1px;
}

.mass-number {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1.2px;
}

/* Crucial: Multi-line name wrap so names are NEVER cut off */
.mass-name {
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: normal;
  line-height: 1.2;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mass-shuffling {
  animation: scramblePulse 0.15s infinite;
  opacity: 0.85;
}
@keyframes scramblePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3) drop-shadow(0 0 6px var(--idm-blue)); }
}

/* ====================================================================
   STAGE CONTROLS AREA (DIRECTLY BELOW DRAWING BOX, ALIGNED CENTER)
   Guide Book Page 1 Aesthetic: Glowing Pill Action Buttons
   ==================================================================== */
.drawing-box-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.stage-controls-area {
  position: relative;
  z-index: 15;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 24px;
}

.stage-footer {
  display: none !important;
}

.controls-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* Quick Winner Count Selector */
.count-selector-pill {
  display: flex;
  align-items: center;
  background: rgba(18, 25, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  padding: 4px;
}
.count-opt {
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.count-opt.active {
  background: var(--idm-blue);
  color: #fff;
  box-shadow: 0 0 15px rgba(46, 107, 175, 0.6);
}

/* Primary Action Buttons */
.btn-futuristic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 44px;
  border-radius: 9999px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 900;
  cursor: pointer;
  outline: none;
  border: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-futuristic::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 20%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 80%
  );
  transform: rotate(30deg);
  pointer-events: none;
  animation: shineHover 3s infinite;
}

@keyframes shineHover {
  0% { transform: translate(-100%, -100%) rotate(30deg); }
  100% { transform: translate(100%, 100%) rotate(30deg); }
}

/* START Button (Guidebook Pill Style: Glowing Blue/Yellow) */
.btn-start {
  background: linear-gradient(135deg, #1d4ed8 0%, #2e6baf 60%, #3b82f6 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 30px rgba(46, 107, 175, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.btn-start:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 45px rgba(46, 107, 175, 0.8), inset 0 1px 2px rgba(255,255,255,0.6);
}
.btn-start:active {
  transform: translateY(1px) scale(0.98);
}

/* STOP Button (High Voltage Red) */
.btn-stop {
  background: linear-gradient(135deg, #b91c1c 0%, #c23433 60%, #ef4444 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 35px rgba(194, 52, 51, 0.7), inset 0 1px 1px rgba(255,255,255,0.4);
  animation: stopPulse 1.2s infinite alternate;
}
@keyframes stopPulse {
  0% { box-shadow: 0 0 25px rgba(194, 52, 51, 0.6); }
  100% { box-shadow: 0 0 45px rgba(194, 52, 51, 1); }
}
.btn-stop:hover {
  transform: translateY(-2px) scale(1.03);
}

/* RESET Button (Sleek Dark Pill) */
.btn-reset {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
  padding: 14px 28px;
  font-size: 15px;
}
.btn-reset:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-2px);
}

/* ====================================================================
   ADMIN PANEL MODAL & DRAWER
   ==================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.75);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.admin-window {
  width: 92%;
  max-width: 1040px;
  max-height: 88vh;
  background: #0c1220;
  border: 1px solid var(--border-glow-blue);
  border-radius: 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 40px rgba(46, 107, 175, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-backdrop.open .admin-window {
  transform: scale(1);
}

.admin-header {
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
}

.admin-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
}
.tab-btn {
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover {
  color: #fff;
}
.tab-btn.active {
  color: var(--idm-yellow);
  border-bottom-color: var(--idm-yellow);
}

.admin-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* Form Styles */
.form-group {
  margin-bottom: 24px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(18, 25, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.2s ease;
}
.form-input:focus, .form-select:focus {
  border-color: var(--idm-blue);
  box-shadow: 0 0 10px rgba(46, 107, 175, 0.4);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* File Upload Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--idm-yellow);
  background: rgba(247, 204, 76, 0.05);
}
.dropzone-icon {
  font-size: 38px;
  color: var(--idm-blue);
  margin-bottom: 10px;
}

/* Tables in Admin */
.history-table-container {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
}
.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.custom-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}
.custom-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
}
.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.btn-small {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-danger {
  background: rgba(194, 52, 51, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(194, 52, 51, 0.5);
}
.btn-danger:hover {
  background: var(--idm-red);
  color: #fff;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
}

/* Background selector cards */
.bg-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.bg-choice-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(18, 25, 42, 0.6);
  border: 2px solid var(--border-glass);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.bg-choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}
.bg-choice-card.selected {
  border-color: var(--idm-yellow);
  box-shadow: 0 0 20px rgba(247, 204, 76, 0.3);
}
.bg-preview-box {
  height: 90px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ====================================================================
   CELEBRATION OVERLAY MODAL
   ==================================================================== */
.celebration-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.85);
  backdrop-filter: blur(16px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.celebration-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.celebration-box {
  text-align: center;
  max-width: 800px;
  padding: 48px;
  background: linear-gradient(160deg, #152238 0%, #0d1525 60%, #080d17 100%);
  border: 2px solid var(--idm-yellow);
  border-radius: 32px;
  box-shadow: 0 0 60px rgba(247, 204, 76, 0.5), 0 20px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.celebration-modal.open .celebration-box {
  transform: scale(1);
}

.celebration-tag {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--idm-yellow);
  margin-bottom: 12px;
}
.celebration-prize {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 24px;
}
.celebration-number {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 900;
  color: var(--idm-yellow);
  text-shadow: 0 0 30px rgba(247, 204, 76, 0.8);
  letter-spacing: 2px;
}
.celebration-name {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  color: #fff;
  margin-top: 10px;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

/* Utility Animations */
.pulse-glow {
  animation: pulseGlow 2s infinite alternate;
}
@keyframes pulseGlow {
  0% { filter: drop-shadow(0 0 8px rgba(46, 107, 175, 0.4)); }
  100% { filter: drop-shadow(0 0 20px rgba(46, 107, 175, 0.9)); }
}

/* ====================================================================
   PRESET HADIAH STYLING (MANAJEMEN & STAGE PICKER)
   ==================================================================== */
.stage-preset-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.stage-preset-select {
  appearance: none;
  background: rgba(14, 21, 37, 0.9);
  color: var(--idm-yellow);
  border: 1px solid var(--border-glow-yellow);
  border-radius: 9999px;
  padding: 8px 36px 8px 18px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 0 15px rgba(247, 204, 76, 0.2);
  transition: all 0.2s ease;
}
.stage-preset-select:hover {
  border-color: #fff;
  box-shadow: 0 0 25px rgba(247, 204, 76, 0.4);
}
.stage-preset-arrow {
  position: absolute;
  right: 14px;
  pointer-events: none;
  color: var(--idm-yellow);
  font-size: 11px;
}

/* Preset Cards in Admin */
.preset-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}
.preset-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(18, 26, 44, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  transition: all 0.2s ease;
}
.preset-card-item:hover {
  background: rgba(18, 26, 44, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}
.preset-card-item.active-preset {
  border-color: var(--idm-yellow);
  background: linear-gradient(135deg, rgba(46, 107, 175, 0.2) 0%, rgba(18, 26, 44, 0.9) 100%);
  box-shadow: 0 0 20px rgba(247, 204, 76, 0.25);
}
.preset-order-badge {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--text-dim);
  width: 28px;
}
.preset-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preset-item-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.8px;
}
.preset-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.badge-gimmick {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.badge-gimmick.slot {
  background: rgba(247, 204, 76, 0.2);
  color: var(--idm-yellow);
  border: 1px solid rgba(247, 204, 76, 0.4);
}
.badge-gimmick.mass {
  background: rgba(46, 107, 175, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(46, 107, 175, 0.4);
}
.preset-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

