/* ─── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800;900&family=Barlow:wght@400;500;600&display=swap');

/* ─── Brand Variables — Agile Fanatics ─────────────────────────────────────── */
:root {
  /* Core brand */
  --af-red: #FF0000;
  --af-orange: #FF5500;
  --af-gradient: linear-gradient(135deg, #FF0000 0%, #FF5500 50%, #FF8C00 100%);
  --af-gradient-h: linear-gradient(90deg, #FF0000 0%, #FF8C00 100%);

  /* Game UI */
  --bg: #FFFFFF;
  --bg-card: #F5F5F5;
  --bg-card-hover: #EBEBEB;
  --border: #DEDEDE;
  --border-bright: #CCCCCC;
  --text: #111111;
  --text-muted: #666666;
  --text-dim: #AAAAAA;

  /* Status colors */
  --green: #22C55E;
  --green-dim: #16A34A;
  --yellow: #EAB308;
  --orange-warn: #F97316;
  --red-burn: #EF4444;
  --red-burn-dim: #B91C1C;
  --blue: #3B82F6;

  /* Typography */
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;

  /* Spacing */
  --radius: 8px;
  --radius-lg: 14px;
  --gap: 16px;

  /* Transitions */
  --trans: 0.18s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

a { color: var(--af-orange); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--trans);
}

/* ─── App Shell ─────────────────────────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Screens ───────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 100vh;
}
.screen.active { display: flex; }

/* ─── Header / Nav bar ──────────────────────────────────────────────────────── */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.game-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-header .logo svg { height: 32px; width: auto; }

.game-header .logo-text {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  background: var(--af-gradient-h);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.room-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
}

/* ─── Landing / Join Screen ─────────────────────────────────────────────────── */
#screen-landing {
  background: var(--bg);
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,80,0,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--af-orange);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 16px;
}

.hero-title .gradient-text {
  background: var(--af-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 48px;
}

/* Join card */
.join-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.join-card h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--text);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--trans);
}

.form-group input:focus {
  outline: none;
  border-color: var(--af-orange);
  box-shadow: 0 0 0 3px rgba(255,85,0,0.15);
}

.form-group input::placeholder { color: var(--text-dim); }

.btn-primary {
  width: 100%;
  padding: 14px 24px;
  font-size: 1.1rem;
  border-radius: var(--radius);
  background: var(--af-gradient);
  color: #fff;
  letter-spacing: 0.08em;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255,80,0,0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.error-msg {
  color: var(--red-burn);
  font-size: 0.85rem;
  margin-top: 10px;
  min-height: 20px;
}

/* Leaderboard section */
.leaderboard-section {
  padding: 48px 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.leaderboard-section h2 {
  font-size: 1.8rem;
  margin-bottom: 24px;
  text-align: center;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.leaderboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.leaderboard-card h3 {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--af-orange);
  margin-bottom: 14px;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.leaderboard-entry:last-child { border-bottom: none; }

.lb-rank {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--text-muted);
  width: 24px;
}
.lb-rank.gold { color: #FFD700; }
.lb-rank.silver { color: #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; }

.lb-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.lb-room { font-size: 0.75rem; color: var(--text-muted); }
.lb-score {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--af-orange);
}

/* ─── Lobby Screen ──────────────────────────────────────────────────────────── */
#screen-lobby {
  padding: 40px 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

#screen-lobby h1 { font-size: 2.2rem; margin-bottom: 8px; }
#screen-lobby .subtitle { color: var(--text-muted); margin-bottom: 32px; }

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.player-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-chip .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--af-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}

.player-chip .player-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-chip.is-me { border-color: var(--af-orange); }

.round-info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.round-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.round-info-card .round-num {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--af-orange);
  margin-bottom: 6px;
}

.round-info-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.round-info-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-start-round {
  padding: 16px 40px;
  font-size: 1.3rem;
  border-radius: var(--radius);
  background: var(--af-gradient);
  color: #fff;
  letter-spacing: 0.06em;
}

.btn-start-round:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255,80,0,0.35);
}

/* ─── Game Screen ───────────────────────────────────────────────────────────── */
#screen-game {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.game-layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  grid-template-rows: 1fr;
  gap: 0;
  overflow: hidden;
}

/* Left panel — scoreboard + feed */
.panel-left {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Right panel — orders (round 3) / instructions */
.panel-right {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

/* Center area */
.game-center {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
  gap: 16px;
}

/* Round header */
.round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.round-header .round-label {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
}

.round-header .round-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.timer-display {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: 0.02em;
  color: var(--text);
  transition: color var(--trans);
}

.timer-display.urgent { color: var(--red-burn); }

/* WIP badge */
.wip-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  transition: all var(--trans);
}

.wip-badge.free { border-color: var(--green); color: var(--green); }
.wip-badge.full { border-color: var(--yellow); color: var(--yellow); }
.wip-badge.exceeded { border-color: var(--red-burn); color: var(--red-burn); }

/* ─── Oven ──────────────────────────────────────────────────────────────────── */
.oven-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.oven-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.oven-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.oven-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

.oven-slot {
  background: var(--bg);
  padding: 20px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: background var(--trans);
}

.oven-slot:hover { background: var(--bg-card-hover); }

.oven-slot.empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
}

.oven-slot.occupied { cursor: default; }

.slot-pizza-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  animation: sizzle 1.5s ease-in-out infinite;
}

@keyframes sizzle {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.05) rotate(2deg); }
}

.slot-owner {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.slot-ingredients {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}

.ingredient-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Slot timer bar */
.slot-timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--green);
  transition: width 1s linear, background 0.3s;
  border-radius: 0 0 0 0;
}

.slot-timer-bar.warning { background: var(--yellow); }
.slot-timer-bar.danger { background: var(--red-burn); }

/* Slot state overlays */
.oven-slot.burning {
  animation: burnFlash 0.5s ease-in-out infinite alternate;
}

@keyframes burnFlash {
  from { background: var(--bg); }
  to { background: rgba(239,68,68,0.2); }
}

/* Collect button on slot */
.btn-collect {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  background: var(--green);
  color: #000;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.btn-collect:hover { background: var(--green-dim); }

/* ─── Pizza Builder ─────────────────────────────────────────────────────────── */
.builder-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.builder-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.builder-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Pizza preview */
.pizza-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: var(--bg);
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius);
  padding: 16px;
}

.pizza-preview .pizza-visual {
  font-size: 3rem;
  margin-bottom: 8px;
}

.pizza-preview .pizza-ingredients {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pizza-preview.empty { color: var(--text-dim); font-size: 0.85rem; font-family: var(--font-heading); }

/* Ingredient buttons */
.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.btn-ingredient {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 2px solid var(--border-bright);
  color: var(--text);
  font-size: 0.9rem;
  transition: all var(--trans);
}

.btn-ingredient:hover { border-color: var(--af-orange); }
.btn-ingredient.active {
  border-color: var(--af-orange);
  background: rgba(255,85,0,0.1);
  color: var(--af-orange);
}

.btn-ingredient .ing-icon { font-size: 1.2rem; }
.btn-ingredient .ing-name { font-weight: 600; font-size: 0.85rem; }

/* Submit / action buttons */
.builder-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.btn-submit {
  padding: 13px 20px;
  font-size: 1rem;
  border-radius: var(--radius);
  background: var(--af-gradient);
  color: #fff;
  letter-spacing: 0.05em;
  transition: all var(--trans);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,80,0,0.3);
}

.btn-submit.wip-warn {
  background: linear-gradient(135deg, var(--yellow), var(--orange-warn));
  color: #000;
}

.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-reset {
  padding: 13px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
}

.btn-reset:hover { border-color: var(--text-muted); color: var(--text); }

/* ─── Score Panel ───────────────────────────────────────────────────────────── */
.score-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.score-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  transition: background var(--trans);
}

.score-entry:hover { background: var(--bg-card-hover); }
.score-entry.is-me { background: rgba(255,85,0,0.07); }

.score-entry .s-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--af-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}

.score-entry .s-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-entry .s-score {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--af-orange);
}

.score-delta {
  position: fixed;
  pointer-events: none;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.2rem;
  animation: deltaFloat 1.2s ease-out forwards;
  z-index: 1000;
}

@keyframes deltaFloat {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}

.score-delta.positive { color: var(--green); }
.score-delta.negative { color: var(--red-burn); }
.score-delta.bonus { color: #FFD700; }

/* ─── Feed ──────────────────────────────────────────────────────────────────── */
.feed-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column-reverse;
}

.feed-item {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 3px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.feed-item.info { color: var(--text-muted); }
.feed-item.success { color: var(--green); background: rgba(34,197,94,0.06); }
.feed-item.error { color: var(--red-burn); background: rgba(239,68,68,0.06); }
.feed-item.warning { color: var(--yellow); background: rgba(234,179,8,0.06); }
.feed-item.system { color: var(--text-dim); font-style: italic; }
.feed-item.bonus { color: #FFD700; background: rgba(255,215,0,0.06); }
.feed-item.order { color: var(--blue); background: rgba(59,130,246,0.06); }

/* ─── Orders Panel (Round 3) ────────────────────────────────────────────────── */
.orders-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-card {
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 12px;
  animation: orderIn 0.3s ease;
  position: relative;
  overflow: hidden;
}

@keyframes orderIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; }
}

.order-card.rush {
  border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(234,179,8,0.2);
}

.order-card .order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-card .order-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
}

.order-card .order-points {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--af-orange);
}

.order-card.rush .order-points { color: var(--yellow); }

.order-card .rush-badge {
  font-size: 0.65rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--yellow);
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.3);
  border-radius: 4px;
  padding: 1px 6px;
  margin-bottom: 6px;
}

.order-card .order-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.order-timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--green);
  transition: width 1s linear, background 0.3s;
}

.order-timer-bar.warning { background: var(--yellow); }
.order-timer-bar.danger { background: var(--red-burn); }

/* Menu card (right panel round 1&2) */
.menu-card {
  margin: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.menu-card .menu-header {
  padding: 10px 14px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .mi-name { font-weight: 600; }
.menu-item .mi-pts { font-family: var(--font-heading); font-weight: 700; color: var(--af-orange); }

/* ─── WIP Banner ────────────────────────────────────────────────────────────── */
.wip-banner {
  display: none;
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(249,115,22,0.95);
  color: #000;
  padding: 10px 24px;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  z-index: 200;
  animation: bannerIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

@keyframes bannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.wip-banner.show { display: block; }

/* ─── Debrief Screen ────────────────────────────────────────────────────────── */
#screen-debrief {
  padding: 60px 24px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  align-items: center;
  text-align: center;
}

.debrief-round-badge {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--af-orange);
  margin-bottom: 12px;
}

#screen-debrief h1 { font-size: 2.2rem; margin-bottom: 32px; }

.debrief-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  margin-bottom: 32px;
}

.debrief-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.debrief-stat .stat-value {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 4px;
}

.debrief-stat .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-heading);
  font-weight: 600;
}

.debrief-stat.highlight .stat-value { color: var(--af-orange); }
.debrief-stat.danger .stat-value { color: var(--red-burn); }

.debrief-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--af-orange);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: left;
  width: 100%;
  margin-bottom: 16px;
}

.debrief-question .q-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--af-orange);
  margin-bottom: 8px;
}

.debrief-question .q-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.debrief-principle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,85,0,0.08);
  border: 1px solid rgba(255,85,0,0.2);
  border-radius: var(--radius);
  padding: 14px 20px;
  width: 100%;
  margin-bottom: 32px;
}

.debrief-principle .p-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--af-orange);
  white-space: nowrap;
}

.debrief-principle .p-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.player-scores-debrief {
  width: 100%;
  margin-bottom: 32px;
}

.player-scores-debrief table {
  width: 100%;
  border-collapse: collapse;
}

.player-scores-debrief td, .player-scores-debrief th {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.player-scores-debrief th {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.player-scores-debrief td:last-child {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--af-orange);
  text-align: right;
}

.btn-next-round {
  padding: 16px 48px;
  font-size: 1.2rem;
  border-radius: var(--radius);
  background: var(--af-gradient);
  color: #fff;
  letter-spacing: 0.06em;
}

.btn-next-round:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255,80,0,0.35);
}

/* ─── End Screen ────────────────────────────────────────────────────────────── */
#screen-end {
  padding: 60px 24px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  align-items: center;
  text-align: center;
}

.end-logo { margin-bottom: 24px; }
.end-logo svg { height: 48px; }

#screen-end h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 8px; }
.end-subtitle { color: var(--text-muted); margin-bottom: 40px; font-size: 1.05rem; }

.score-journey {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 40px;
}

.journey-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}

.journey-card .j-round {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--af-orange);
  margin-bottom: 6px;
}

.journey-card .j-score {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
}

.journey-card .j-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Lead capture form */
.lead-form-container {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 16px;
  text-align: left;
}

.lead-form-container h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.lead-form-container .lead-incentive {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-incentive-icon {
  font-size: 1.2rem;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lead-grid .full-width { grid-column: 1 / -1; }

.btn-lead-submit {
  width: 100%;
  padding: 15px 24px;
  font-size: 1.1rem;
  border-radius: var(--radius);
  background: var(--af-gradient);
  color: #fff;
  letter-spacing: 0.06em;
  margin-top: 16px;
}

.btn-lead-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(255,80,0,0.35);
}

.lead-skip {
  color: var(--text-dim);
  font-size: 0.82rem;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 8px;
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
}

.lead-skip:hover { color: var(--text-muted); }

.lead-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--green);
}

.lead-success.show { display: flex; }
.lead-success .success-icon { font-size: 3rem; }
.lead-success h3 { font-size: 1.4rem; color: var(--text); }
.lead-success p { color: var(--text-muted); font-size: 0.9rem; }

/* ─── Toast notifications ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: auto;
}

.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red-burn); color: var(--red-burn); }
.toast.warning { border-color: var(--yellow); color: var(--yellow); }
.toast.bonus { border-color: #FFD700; color: #FFD700; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* ─── Overlays / Modals ─────────────────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.overlay.show { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 90%;
  text-align: center;
}

.modal h2 { font-size: 1.6rem; margin-bottom: 12px; }
.modal p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

/* ─── Base validation button states (v1.1) ──────────────────────────────────── */
.btn-submit.no-ingredients {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  cursor: not-allowed;
}

.btn-submit.no-base {
  background: var(--red-burn);
  color: #fff;
  cursor: not-allowed;
}

.btn-submit.no-base:hover { transform: none; box-shadow: none; }

/* ─── Kanban intro card (v1.1) ──────────────────────────────────────────────── */
.kanban-intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.kanban-intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-top: 4px solid var(--af-orange);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  animation: introIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes introIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.intro-eyebrow {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--af-orange);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.intro-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.8rem;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
  line-height: 1.1;
}

.intro-body {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 28px;
}

.intro-body strong { color: var(--text); font-weight: 600; }

.btn-intro-start {
  padding: 14px 40px;
  font-size: 1.1rem;
  border-radius: var(--radius);
  background: var(--af-gradient);
  color: #fff;
  letter-spacing: 0.06em;
  width: 100%;
}

.btn-intro-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255,80,0,0.35);
}

/* ─── CTA Banner (v1.1) — niet wegklikbaar, volle breedte ──────────────────── */
.cta-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--af-gradient-h);
  color: #fff;
  padding: 18px 32px;
  z-index: 350;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 -4px 32px rgba(255,80,0,0.3);
  animation: bannerSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bannerSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cta-banner.show { display: flex; }

.cta-banner .cta-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.cta-banner .cta-sub {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 2px;
}

.btn-cta-next {
  padding: 12px 32px;
  font-size: 1rem;
  border-radius: var(--radius);
  background: #fff;
  color: var(--af-red);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-cta-next:hover {
  background: rgba(255,255,255,0.9);
  transform: scale(1.02);
}

/* ─── Scroll anchors ────────────────────────────────────────────────────────── */
.scroll-anchor {
  scroll-margin-top: 70px;
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */

/* ── Tablet & small desktop (≤ 900px) ── */
@media (max-width: 900px) {
  /* Game layout: single column */
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
  }

  /* Reorder panels: gameplay first, orders second, scoreboard last */
  .game-center { order: 1; }
  .panel-right  { order: 2; }
  .panel-left   { order: 3; }

  /* Panels: remove side borders, add top separator */
  .panel-left {
    border: none;
    border-top: 1px solid var(--border);
    max-height: 180px;
  }

  .panel-right {
    border: none;
    border-top: 1px solid var(--border);
    max-height: none; /* orders zijn gameplay-kritisch, geen hoogte-cap */
  }

  /* Lobby: rondekaarten onder elkaar */
  .round-info-cards {
    grid-template-columns: 1fr;
  }

  /* Lead form & end screen: één kolom */
  .lead-grid {
    grid-template-columns: 1fr;
  }

  .score-journey {
    grid-template-columns: 1fr;
  }

  /* CTA banner: stapel verticaal */
  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }

  .btn-cta-next {
    width: 100%;
    text-align: center;
  }
}

/* ── Mobiel (≤ 600px) ── */
@media (max-width: 600px) {
  /* Header: compacter, minder elementen */
  .game-header {
    padding: 10px 14px;
    gap: 8px;
  }

  .game-header .logo-text { display: none; }
  #game-player-name-header { display: none; }

  .timer-display { font-size: 1.6rem; }

  /* Landing: minder padding bovenaan */
  .landing-hero {
    padding: 32px 16px 24px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 32px;
  }

  .join-card {
    padding: 24px 20px;
  }

  /* Lobby */
  #screen-lobby {
    padding: 24px 16px;
  }

  #screen-lobby h1 { font-size: 1.8rem; }

  /* Game center */
  .game-center {
    padding: 14px;
    gap: 12px;
  }

  /* Ingrediëntknoppen: 2 kolommen i.p.v. 3 (grotere tapzone) */
  .ingredients-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-ingredient {
    padding: 12px 14px;
  }

  /* Collect-knop: groter tapgebied */
  .btn-collect {
    padding: 10px 14px;
    font-size: 0.85rem;
    bottom: 6px;
    right: 6px;
  }

  /* Oven slots: iets lager minimum */
  .oven-slot { min-height: 120px; }

  /* Debrief */
  #screen-debrief {
    padding: 32px 16px;
  }

  #screen-debrief h1 { font-size: 1.8rem; }

  /* Debrief tabel: horizontaal scrollbaar als nodig */
  .player-scores-debrief {
    overflow-x: auto;
  }

  .player-scores-debrief table {
    min-width: 280px;
  }

  /* Debrief principe: stapel verticaal */
  .debrief-principle {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  /* End screen */
  #screen-end {
    padding: 32px 16px;
  }

  /* Lead form */
  .lead-form-container {
    padding: 20px 16px;
  }

  /* Toasts: volledige breedte bovenaan */
  .toast-container {
    left: 12px;
    right: 12px;
    top: 60px;
  }

  /* WIP banner */
  .wip-banner {
    font-size: 0.82rem;
    padding: 8px 16px;
    top: 56px;
  }

  /* Intro overlay kaart */
  .kanban-intro-card {
    padding: 24px 20px;
  }

  .btn-start-round {
    width: 100%;
  }
}

/* ── Kleine telefoons (≤ 400px) ── */
@media (max-width: 400px) {
  .hero-title { font-size: 2.2rem; }
  .timer-display { font-size: 1.4rem; }
  .wip-badge { font-size: 0.75rem; padding: 4px 10px; }
  .room-badge { display: none; }
  .builder-body { padding: 14px; }
  .game-header .logo svg { height: 26px; }
}
