/* ChallengeHub design system — bright TV game show, per the Library Hunt mockups */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;600;800&display=swap');

:root {
  --blue: #3E8E41; /* Cowper house green (variable keeps its historic name so every accent downstream follows) */ --green: #22C55E; --orange: #FFBA00;
  --purple: #8B5CF6; --red: #EF4444; --cyan: #06B6D4;
  --gold: #FFD700; --navy: #0D1B2A; --navy2: #13253d;
  --ink: #FFFFFF; --dim: #BDD3F5;
  --header: 'Bebas Neue', Impact, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 130% 90% at 50% 30%, #8fce7a 0%, #4da34a 30%, #2c7d33 55%, #1a5423 78%, #0d3314 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* rotating light rays, like the mockup spotlight burst */
body::before {
  content: '';
  position: fixed;
  left: 50%; top: 35%;
  width: 240vmax; height: 240vmax;
  margin: -120vmax 0 0 -120vmax;
  z-index: 0;
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg,
    rgba(255,255,255,.075) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0%, transparent 62%);
  animation: rays 120s linear infinite;
}
@keyframes rays { to { transform: rotate(360deg); } }

/* floating confetti specks */
body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
  background-image:
    radial-gradient(4px 4px at 8% 15%, #FFD700 50%, transparent 52%),
    radial-gradient(3px 3px at 22% 68%, #fff 50%, transparent 52%),
    radial-gradient(5px 5px at 37% 30%, #06B6D4 50%, transparent 52%),
    radial-gradient(3px 3px at 52% 80%, #FFBA00 50%, transparent 52%),
    radial-gradient(4px 4px at 64% 12%, #ff7ad9 50%, transparent 52%),
    radial-gradient(3px 3px at 78% 55%, #fff 50%, transparent 52%),
    radial-gradient(5px 5px at 90% 25%, #FFD700 50%, transparent 52%),
    radial-gradient(3px 3px at 45% 50%, #8ef0ff 50%, transparent 52%),
    radial-gradient(4px 4px at 15% 88%, #22C55E 50%, transparent 52%),
    radial-gradient(3px 3px at 85% 85%, #FFBA00 50%, transparent 52%);
  background-size: 900px 700px;
  animation: drift 40s linear infinite;
}
@keyframes drift { to { background-position: 0 700px; } }

body > * { position: relative; z-index: 1; }

h1, h2, h3, .display { font-family: var(--header); letter-spacing: .04em; font-weight: 400; }

/* chunky outlined show-title text */
.showtitle {
  font-family: var(--header);
  color: #fff;
  -webkit-text-stroke: 2px rgba(13,27,42,.9);
  text-shadow: 0 5px 0 rgba(13,27,42,.45), 0 0 34px rgba(255,255,255,.35);
}

.panel {
  background: linear-gradient(170deg, rgba(13,27,42,.88), rgba(13,27,42,.72));
  border: 3px solid rgba(255,255,255,.22);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(6,15,40,.45), inset 0 2px 0 rgba(255,255,255,.14);
}
.panel.glow, .panel.team {
  border-color: var(--tc, var(--blue));
  box-shadow: 0 0 22px -4px var(--tc, var(--blue)),
              0 10px 26px rgba(6,15,40,.45),
              inset 0 2px 0 rgba(255,255,255,.14);
}
.panel.team {
  background:
    linear-gradient(160deg, rgba(13,27,42,.55), rgba(13,27,42,.9)),
    linear-gradient(160deg, var(--tc, var(--blue)), var(--navy));
}

/* numbered circle badge, mockup style */
.numbadge {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid var(--tc, var(--blue));
  font-family: var(--header);
  font-size: 22px;
  color: #fff;
  box-shadow: 0 0 12px -2px var(--tc, var(--blue));
  flex: 0 0 auto;
}

/* gold-edged show ribbon */
.ribbon {
  display: inline-block;
  font-family: var(--header);
  font-size: 24px;
  letter-spacing: .12em;
  color: var(--gold);
  background: var(--navy);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 6px 30px;
  box-shadow: 0 6px 16px rgba(6,15,40,.5), inset 0 1px 0 rgba(255,255,255,.15);
  text-transform: uppercase;
}

.btn {
  font-family: var(--header);
  font-size: 22px;
  letter-spacing: .06em;
  color: #fff;
  background: linear-gradient(180deg, #6fbf62 0%, #3E8E41 45%, #2a6b2e 100%);
  border: none;
  border-radius: 14px;
  padding: 14px 26px;
  min-height: 52px;
  min-width: 52px;
  cursor: pointer;
  box-shadow: 0 6px 0 #14401a, 0 10px 18px rgba(6,25,10,.45), inset 0 2px 0 rgba(255,255,255,.45);
  transition: transform .08s, box-shadow .08s, filter .15s;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(13,27,42,.5);
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #10265e, inset 0 2px 0 rgba(255,255,255,.45); }
.btn:disabled { filter: grayscale(1) brightness(.65); cursor: default; }
.btn.green { background: linear-gradient(180deg, #5ee8a4 0%, #22C55E 45%, #12813c 100%); box-shadow: 0 6px 0 #0b4d24, 0 10px 18px rgba(6,15,40,.45), inset 0 2px 0 rgba(255,255,255,.45); }
.btn.red { background: linear-gradient(180deg, #ff8a8a 0%, #EF4444 45%, #b91c1c 100%); box-shadow: 0 6px 0 #6b1010, 0 10px 18px rgba(6,15,40,.45), inset 0 2px 0 rgba(255,255,255,.45); }
.btn.gold { background: linear-gradient(180deg, #ffe680 0%, #FFBA00 45%, #d98a00 100%); box-shadow: 0 6px 0 #7a4d00, 0 10px 18px rgba(6,15,40,.45), inset 0 2px 0 rgba(255,255,255,.5); color: #3b2800; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.btn.ghost { background: rgba(13,27,42,.55); box-shadow: inset 0 0 0 2px rgba(189,211,245,.45); text-shadow: none; }
.btn.small { font-size: 15px; padding: 8px 14px; min-height: 38px; border-radius: 10px; }
.btn.huge { font-size: 34px; padding: 22px 44px; border-radius: 20px; }

.chip {
  display: inline-block;
  font-family: var(--header);
  font-size: 14px;
  letter-spacing: .08em;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(13,27,42,.7);
  border: 2px solid rgba(189,211,245,.5);
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
}
.chip.live { background: #16a34a; border-color: #7ef0ae; animation: pulse 1.6s infinite; }
.chip.hot { background: #b91c1c; border-color: #ff9d9d; animation: pulse .8s infinite; }
.chip.gold { background: var(--navy); border-color: var(--gold); color: var(--gold); }

input[type=text], input[type=number], textarea, select {
  font-family: var(--body);
  font-weight: 600;
  font-size: 20px;
  color: var(--navy);
  background: #fff;
  border: 3px solid #b9cdf0;
  border-radius: 14px;
  padding: 14px 16px;
  width: 100%;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(13,27,42,.12);
}
input[type=text]::placeholder, input[type=number]::placeholder, textarea::placeholder { color: #7f93b8; }
input[type=text]:focus, input[type=number]:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 14px -2px var(--gold); }

.timer-ring { position: relative; display: grid; place-items: center; }
.timer-ring svg { transform: rotate(-90deg); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
@keyframes floatin { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes glowpulse {
  0%,100% { box-shadow: 0 0 18px -4px var(--tc, var(--blue)), 0 10px 26px rgba(6,15,40,.45); }
  50% { box-shadow: 0 0 40px 2px var(--tc, var(--blue)), 0 10px 26px rgba(6,15,40,.45); }
}

.pop { animation: pop .45s cubic-bezier(.2,1.4,.4,1) both; }
.floatin { animation: floatin .4s ease-out both; }
.shake { animation: shake .35s ease both; }

/* --- game-show animations --- */
@keyframes bannerIn {
  0% { transform: scale(.25) rotate(-6deg); opacity: 0; }
  55% { transform: scale(1.09) rotate(1.5deg); opacity: 1; }
  75% { transform: scale(.96) rotate(-.5deg); }
  100% { transform: scale(1) rotate(0); }
}
.banner-in { animation: bannerIn .55s cubic-bezier(.2,1.5,.4,1) both; }

@keyframes scorePop {
  0% { transform: scale(1); }
  35% { transform: scale(1.5); filter: brightness(1.9); }
  100% { transform: scale(1); }
}
.score-pop { animation: scorePop .7s cubic-bezier(.2,1.6,.4,1); }

@keyframes hardShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-9px, 3px); }
  40% { transform: translate(8px, -4px); }
  60% { transform: translate(-6px, -3px); }
  80% { transform: translate(5px, 4px); }
}
.hard-shake { animation: hardShake .5s ease both; }

/* wheel: glow halo, land flash + expanding starburst ring */
.wheel-wrap::before {
  content: '';
  position: absolute; inset: -13%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,.17) 28%, transparent 64%);
  animation: pulse 2.4s infinite;
  pointer-events: none;
}
@keyframes landFlash {
  0% { filter: brightness(2.5) saturate(1.7) drop-shadow(0 0 55px #FFD700); }
  100% { filter: brightness(1) drop-shadow(0 0 22px rgba(37,99,235,.55)); }
}
.wheel-wrap.landed .wheel-svg { animation: landFlash .8s ease-out; }
.wheel-wrap .landburst {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 6px solid rgba(255,215,0,.95);
  opacity: 0;
  pointer-events: none;
}
@keyframes burstRing {
  0% { transform: scale(.92); opacity: 1; }
  100% { transform: scale(1.55); opacity: 0; }
}
.wheel-wrap.landed .landburst { animation: burstRing .8s ease-out; }

.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(9,20,48,.85);
  backdrop-filter: blur(6px);
}
.overlay .card { text-align: center; padding: 40px 60px; }

.overtime-mode { animation: otbg 1s infinite; }
@keyframes otbg { 0%,100% { box-shadow: inset 0 0 0 0 transparent; } 50% { box-shadow: inset 0 0 0 8px rgba(239,68,68,.55); } }

#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(189,211,245,.4); border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; }
  body::before, body::after { display: none; }
}
