:root {
  --range-green: #064e3b;
  --stadium-bg: #0f172a;
  --gold: #fbbf24;
  --red: #ef4444;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Lexend", system-ui, sans-serif;
}

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

body {
  font-family: var(--body);
  background: var(--stadium-bg);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 2px solid #334155;
  padding: 0.6rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.brand h1 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: -0.02em;
}

.brand p {
  font-size: 0.72rem;
  color: #9ca3af;
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

select {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 600;
  background: #1e293b;
  color: #fff;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 0.4rem 1.8rem 0.4rem 0.8rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239ca3af%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem top 50%;
  background-size: 0.65rem auto;
}

.btn-header {
  background: #1e293b;
  border: 1px solid #475569;
  color: #fff;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}
.btn-header:hover { background: #334155; border-color: #fbbf24; }

/* Main Arena */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 0.8rem 1rem;
}

/* Jumbotron */
.scoreboard {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 3px solid #334155;
  border-radius: 16px;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.shot-clock {
  background: #000;
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 0.3rem 0.8rem;
  font-family: monospace;
  font-size: 1.8rem;
  font-weight: 900;
  color: #ef4444;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  min-width: 60px;
  text-align: center;
}

.jumbo-question {
  text-align: center;
  flex: 1;
}

.jumbo-question-text {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
  letter-spacing: 0.03em;
}

.jumbo-sub {
  font-size: 0.85rem;
  color: #9ca3af;
}

.score-panel {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.score-digit-box {
  background: #000;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 0.3rem 0.8rem;
  font-family: monospace;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fbbf24;
  min-width: 60px;
  text-align: center;
}

.streak-flame {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: #f97316;
}

/* Range Canvas Container */
.range-container {
  position: relative;
  width: 100%;
  height: 480px;
  background: #064e3b;
  border-radius: 18px;
  border: 2px solid #334155;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
}

#range-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Target Rack Buttons */
.target-rack {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.2rem;
  z-index: 10;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.archery-btn {
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #f59e0b;
  color: #fff;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.archery-btn:hover {
  transform: translateY(-4px) scale(1.08);
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.6);
}

.archery-btn:active {
  transform: scale(0.96);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-card {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 2.2rem;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}

.modal-card h2 {
  font-family: var(--display);
  font-size: 2rem;
  color: #fbbf24;
  margin-bottom: 0.5rem;
}

.modal-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.8rem 2rem;
  font-family: var(--body);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  transition: transform 0.2s;
  margin-top: 1.2rem;
}
.modal-btn:hover { transform: scale(1.05); }

