/* Badge Draw — camp, stage-ready theme. Shares the Full House Realness / Queen Central
   Vote / Random Task palette + core components across landing / control / display. */
:root {
  --bg: #160a2b;
  --bg2: #0d0620;
  --panel: #241041;
  --panel2: #2f1553;
  --line: #40206a;
  --text: #f5e9ff;
  --muted: #b79fd6;
  --pink: #ff2d95;
  --pink2: #ff5db1;
  --gold: #ffd24a;
  --mint: #2ee6a6;
  --purple: #b06bff;
  --danger: #ff5a7a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 50% -12%, #3a1a6b 0%, rgba(58,26,107,0) 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--pink2); }
h1, h2, h3 { font-family: "Chonburi", "Bowlby One SC", system-ui, serif; font-weight: 400; }

/* Brand lockup */
.brand { line-height: 1.05; }
.brand .t1 { font-size: 26px; }
.brand .t1 .accent { color: var(--pink); }
.brand .t2 { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

/* LIVE badge */
.live { display: inline-flex; align-items: center; gap: 7px; background: var(--pink); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 5px 11px; border-radius: 999px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.badge-soft { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 11px 16px; border-radius: 12px; font-weight: 700; cursor: pointer; font-size: 15px; }
.btn:hover { border-color: var(--pink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--pink2), var(--pink)); border-color: transparent; color: #fff; }
.btn.gold { background: linear-gradient(180deg, #ffe07a, var(--gold)); border-color: transparent; color: #4a2c00; }
.btn.mint { background: var(--mint); border-color: transparent; color: #04351f; }
.btn.danger { background: transparent; border-color: #6b2740; color: var(--danger); }
.btn:active { transform: translateY(1px); }

/* Big call-to-action button */
.gen-btn { width: 100%; border: none; border-radius: 999px; padding: 16px; cursor: pointer; font-family: "Chonburi", serif; font-size: 21px; letter-spacing: .04em; color: #fff; background: linear-gradient(180deg, var(--pink2), var(--pink)); box-shadow: 0 10px 30px rgba(255,45,149,.5); }
.gen-btn:active { transform: translateY(2px); }
.gen-btn:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }

/* Center forms (landing) */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.sheet { width: 480px; max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; color: var(--muted); font-size: 13px; }
input, select, textarea { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); }
.err { color: var(--danger); font-size: 14px; min-height: 18px; }
.hint { color: var(--muted); font-size: 13px; }

/* URL result rows (landing) */
.urls { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.urlrow { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.urlrow .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.urlrow .v { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.urlrow .v code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.urlrow .v a { flex: 0 0 auto; }

/* Shared panels + heads */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ============ CONTROL (control.html) ============ */
.wrap { max-width: 900px; margin: 0 auto; padding: 16px; }

/* Draw-settings grid */
.cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.cfg-grid .field { margin: 8px 0; }
.cfg-grid input:disabled { opacity: .5; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; padding: 0; border: none; border-radius: 999px; background: linear-gradient(90deg, var(--pink), var(--gold)); cursor: pointer; }
input[type="range"]:disabled { opacity: .5; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--pink); box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--pink); cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
#claimLabel { color: var(--gold); }

/* Venue rows */
.row-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-line label.k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.venue-sel { flex: 1; min-width: 220px; }

.controls-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

/* Current-draw preview on the control board */
.now { display: flex; align-items: center; gap: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-height: 64px; }
.now .now-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.now .now-text { font-weight: 800; font-size: 18px; }
.now .rtag { font-family: "Chonburi", serif; font-size: 20px; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 3px 14px; flex: 0 0 auto; }

/* ============ DISPLAY (display.html) ============ */
.dwrap { position: relative; height: 100vh; display: flex; flex-direction: column; padding: 2.5vmin 4vmin; overflow: hidden; }
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 2vmin; flex: 0 0 auto; z-index: 3; }
.dhead .title { font-family: "Chonburi", serif; font-size: 5vmin; }
.dhead .title .accent { color: var(--pink); }
.dhead .right { display: flex; align-items: center; gap: 2vmin; font-size: 2.6vmin; color: var(--muted); }
.live-xl { font-size: 2.4vmin; padding: 0.8vmin 1.6vmin; }

.dbody { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5vmin; z-index: 2; }
.dcap { font-size: 3vmin; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); text-align: center; }
.dsub { font-size: 3.2vmin; color: var(--muted); text-align: center; max-width: 88vw; }
.dsub b, .dsub .cd { color: var(--gold); }
.dtitle-lg { font-family: "Chonburi", serif; font-size: 9vmin; text-align: center; color: #fff; }
.dtitle-lg .accent { color: var(--pink); }

/* The big drawn badge number */
.dnum {
  font-family: "Chonburi", serif; font-size: 26vmin; line-height: 1; text-align: center;
  color: #fff; text-shadow: 0 0 6vmin rgba(255,45,149,.4), 0 0.4vmin 0 rgba(0,0,0,.25);
  background: linear-gradient(90deg, #fff 0%, #ffd7f0 45%, #d9c2ff 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* Flicker while the randomiser is spinning. */
.dnum.flash { animation: flashPulse .18s steps(1) infinite; }
@keyframes flashPulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(1.04); } }
/* Slam-in reveal when the winning number lands. */
.dnum.reveal { animation: numReveal .5s cubic-bezier(.2,1.5,.4,1); }
@keyframes numReveal { 0% { opacity: 0; transform: scale(1.8) rotate(-4deg); } 60% { transform: scale(.92) rotate(2deg); } 100% { opacity: 1; transform: none; } }
.dnum.win { background: linear-gradient(90deg, #ffe07a 0%, var(--gold) 60%, #fff2c2 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Prize amount */
.dprize { font-family: "Chonburi", serif; font-size: 12vmin; line-height: 1; color: var(--gold); text-shadow: 0 0 5vmin rgba(255,210,74,.45); }
.dprize.win { font-size: 9vmin; }

/* Floating emoji layer */
.emoji-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.emoji { position: absolute; bottom: -12vmin; font-size: 6vmin; will-change: transform, opacity; animation: floatUp linear forwards; opacity: 0; }
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg) scale(.8); opacity: 0; }
  12% { opacity: .95; }
  85% { opacity: .95; }
  100% { transform: translateY(-118vh) rotate(var(--spin, 40deg)) scale(1.1); opacity: 0; }
}
.dwrap::before { content: ""; position: absolute; inset: -20%; z-index: 0; background: radial-gradient(3px 3px at 20% 30%, rgba(255,210,74,.6), transparent), radial-gradient(3px 3px at 70% 60%, rgba(255,45,149,.6), transparent), radial-gradient(2px 2px at 45% 80%, rgba(46,230,166,.6), transparent), radial-gradient(2px 2px at 85% 25%, rgba(176,107,255,.6), transparent); background-size: 60% 60%; animation: drift 22s linear infinite; opacity: .5; }
@keyframes drift { 0% { transform: translate(0,0); } 100% { transform: translate(4%, 3%); } }

/* Venue logo — bottom-left, never over the number. */
.venue-logo { position: fixed; left: 3vmin; bottom: 3vmin; z-index: 4; display: flex; align-items: center; gap: 1.4vmin; background: rgba(13,6,32,.55); border: 1px solid var(--line); border-radius: 2vmin; padding: 1.2vmin 2vmin; backdrop-filter: blur(6px); transition: opacity .3s ease, transform .3s ease; }
.venue-logo[hidden] { display: none; }
.venue-logo img { height: 7vmin; max-width: 34vmin; object-fit: contain; }
.venue-logo .vcap { font-size: 1.5vmin; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.locked-full { height: 100vh; display: grid; place-items: center; text-align: center; }

@media (max-width: 560px) { .cfg-grid { grid-template-columns: 1fr; } }
