:root {
  --kitchen-wood: #78350f;
  --crust: #d97706;
  --sauce: #dc2626;
  --cheese: #fef08a;
  --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: #111827;
  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, #f97316, #ea580c);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.brand h1 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fb923c;
  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: #fb923c; }

/* 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: 80px;
  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: #fb923c;
  text-shadow: 0 2px 10px rgba(251, 146, 60, 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;
}

/* Kitchen Arena */
.kitchen-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1e293b;
  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.4rem;
}

.pizza-board {
  width: 300px;
  height: 300px;
  position: relative;
  cursor: pointer;
}

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

.serve-controls {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.selected-status {
  font-size: 1.1rem;
  font-weight: 700;
  color: #cbd5e1;
}

.status-num {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 900;
  color: #fbbf24;
}

.btn-serve {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 0.65rem 1.8rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-serve:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.6);
}

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

/* Choice Cards */
.choice-rack {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 650px;
  width: 100%;
}

.fraction-btn {
  background: #0f172a;
  border: 2px solid #4b5563;
  color: #fff;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  padding: 0.6rem 1.4rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.fraction-btn:hover {
  transform: translateY(-3px) scale(1.06);
  border-color: #fb923c;
  background: #1e293b;
  box-shadow: 0 0 15px rgba(251, 146, 60, 0.5);
}

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

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

.fraction-btn.wrong-shake {
  animation: shake 0.4s ease-in-out;
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.3) !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: #fb923c;
  margin-bottom: 0.5rem;
}

.modal-btn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  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(249, 115, 22, 0.4);
  transition: transform 0.2s;
  margin-top: 1.2rem;
}
.modal-btn:hover { transform: scale(1.05); }

