:root {
  --chamber-bg: #111827;
  --gold: #fbbf24;
  --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(--chamber-bg);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
header {
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 2px solid #374151;
  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: #1f2937;
  color: #fff;
  border: 1px solid #4b5563;
  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: #1f2937;
  border: 1px solid #4b5563;
  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: #374151; 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;
}

/* Scoreboard */
.scoreboard {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border: 3px solid #374151;
  border-radius: 16px;
  padding: 0.9rem 1.6rem;
  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;
}

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

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

.jumbo-question-text {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

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

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

/* Chamber Container */
.chamber-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  border-radius: 18px;
  border: 2px solid #374151;
  padding: 1.5rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  min-height: 480px;
  gap: 1.8rem;
}

.clock-display-wrap {
  width: 280px;
  height: 280px;
  position: relative;
}

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

/* Time Choice Buttons */
.choice-rack {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 600px;
  width: 100%;
}

.time-btn {
  background: #111827;
  border: 2px solid #4b5563;
  color: #fff;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  padding: 0.8rem 1.6rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.time-btn:hover {
  transform: translateY(-4px) scale(1.06);
  border-color: #38bdf8;
  background: #1e293b;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.time-btn.wrong-shake {
  animation: shake 0.4s ease-in-out;
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.3) !important;
}

.time-btn.correct-glow {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.8) !important;
  transform: scale(1.1) !important;
}

/* 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 #374151;
  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); }

