/* ─── Navixar — "Let's Take A Break" Intervals ───
   1. Shared break framing
   2. The Junction (crossing sim + ADAS question)
   3. You Be The Model (labelling game)
   4. Vyapar (autonomy Monopoly)
   Stages stay dark in light mode — they're game panels.
*/

/* ── 1. Shared ── */
.break-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px dashed rgba(255, 183, 77, 0.6); border-radius: 20px;
  padding: 8px 18px; margin-bottom: 20px;
  font: 700 12px/1 'Space Grotesk', sans-serif; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--marigold, #FFD700);
  background: rgba(255, 183, 77, 0.06);
}
.break-stage {
  position: relative; margin-top: 40px; padding: 0 !important; overflow: hidden;
  background: #0d0a1c !important; border-color: rgba(255,183,77,.35) !important;
  min-height: 440px;
}
/* CRITICAL: our display rules must not defeat the hidden attribute —
   otherwise quiz/end overlays cover the games from page load */
.break-stage [hidden] { display: none !important; }
.brk-continue {
  display: inline-block; margin-top: 8px; padding: 13px 28px; border-radius: 26px;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, #ff9933, #ffd700);
  color: #1a0533; font: 700 14px/1 'Space Grotesk', sans-serif; letter-spacing: .5px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.brk-continue:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,153,51,.35); }
.brk-continue em { font-style: normal; opacity: .7; font-weight: 600; }

/* ── 2. The Junction ── */
#jxCanvas { display: block; width: 100%; height: 520px; touch-action: none; }
.jx-hud {
  position: absolute; top: 14px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; pointer-events: none;
  font: 700 12px/1 'Space Grotesk', sans-serif; letter-spacing: 1px;
}
#jxNear { color: #ff453a; }
#jxGoalLbl { color: #30d158; }
.jx-quiz {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 32px; gap: 18px;
  background: rgba(5, 3, 15, 0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.jxq-title { font: 700 clamp(18px, 2.4vw, 26px)/1.3 'Space Grotesk', sans-serif; color: #ffd700; }
.jxq-q { font-size: clamp(15px, 1.8vw, 19px); line-height: 1.5; color: #fdfbf7; max-width: 620px; }
.jxq-q em { color: #ff9933; font-style: normal; font-weight: 700; }
.jxq-opts { display: grid; grid-template-columns: repeat(2, minmax(180px, 240px)); gap: 12px; }
.jxq-opts button {
  padding: 14px 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.05);
  color: #fdfbf7; font: 600 14px/1.3 Inter, sans-serif; transition: all .25s ease;
}
.jxq-opts button:hover { border-color: #ff9933; background: rgba(255,153,51,.1); }
.jxq-opts button.right { border-color: #30d158; background: rgba(48,209,88,.15); color: #7be29a; }
.jxq-opts button.wrong { border-color: #ff453a; background: rgba(255,69,58,.1); color: #ff8a80; opacity: .7; }
.jxq-reveal p { max-width: 640px; font-size: 15px; line-height: 1.7; color: #fdfbf7; margin-bottom: 16px; }
.jxq-reveal strong { color: #ffd700; }

/* ── 3. You Be The Model ── */
#lbStage { min-height: 480px; }
.lb-road {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 70px, rgba(255,255,255,.09) 70px 74px),
    linear-gradient(180deg, #171130 0%, #241a44 45%, #171130 100%);
}
.lb-road::before, .lb-road::after {
  content: ''; position: absolute; left: 0; right: 0; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255,215,0,.35) 0 26px, transparent 26px 52px);
}
.lb-road::before { top: 12%; }
.lb-road::after { bottom: 12%; }
.lb-hud {
  position: absolute; top: 14px; left: 16px; right: 16px; z-index: 5;
  display: flex; justify-content: space-between; pointer-events: none;
  font: 700 12px/1 'Space Grotesk', sans-serif; letter-spacing: 1px;
}
#lbScore { color: #30d158; }
#lbTimer { color: #ffd700; }
#lbMissed { color: #ff453a; }
.lb-item {
  position: absolute; z-index: 3; cursor: pointer; user-select: none;
  font-size: 44px; line-height: 1; padding: 8px; will-change: transform;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.6));
  transition: none;
}
.lb-item.tagged { cursor: default; }
.lb-item.tagged::before {
  content: ''; position: absolute; inset: 0;
  border: 2px solid #30d158; border-radius: 6px;
  box-shadow: 0 0 18px rgba(48,209,88,.5);
}
.lb-item.tagged::after {
  content: attr(data-label) ' ✓'; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 3px 8px; border-radius: 5px;
  background: rgba(48,209,88,.9); color: #04120a;
  font: 800 10px/1 'Space Grotesk', sans-serif; letter-spacing: 1px;
}
.lb-item.gone { opacity: 0; transition: opacity .5s ease .6s; }
.lb-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; justify-content: center; align-items: center; text-align: center;
  background: rgba(5, 3, 15, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.lb-end-card { max-width: 640px; padding: 32px; }
.lb-end-card p { font-size: 15px; line-height: 1.7; color: #fdfbf7; margin: 14px 0 20px; }
.lb-end-card strong { color: #ffd700; }

/* ── 4. Vyapar ── */
.vy-stage { padding: 28px !important; min-height: 0; }
.vy-board {
  display: grid; gap: 8px;
  grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr);
  max-width: 680px; aspect-ratio: 1; margin: 0 auto;
}
.vy-tile {
  border: 1px solid rgba(255,183,77,.4); border-radius: 10px;
  background: rgba(255,255,255,.07); padding: 10px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  transition: all .3s ease; position: relative;
}
.vt-name { font: 700 clamp(9px, 1.1vw, 12.5px)/1.25 'Space Grotesk', sans-serif; color: #fdfbf7; }
.vt-sub { font: 600 clamp(8px, 0.95vw, 11px)/1 Inter, sans-serif; color: #30d158; }
.vy-tile.ev .vt-sub { color: #ff9933; }
.vy-tile.go { border-color: rgba(48,209,88,.5); background: rgba(48,209,88,.06); }
.vy-tile.here {
  border-color: #ffd700; background: rgba(255,215,0,.1);
  box-shadow: 0 0 24px rgba(255,215,0,.35), inset 0 0 12px rgba(255,215,0,.08);
  transform: scale(1.04); z-index: 2;
}
.vy-tile.here::after {
  content: '🚗'; position: absolute; top: -14px; right: -8px; font-size: 22px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.7));
}
/* perimeter placement (clockwise from top-left) */
.t0 { grid-area: 1/1; } .t1 { grid-area: 1/2; } .t2 { grid-area: 1/3; } .t3 { grid-area: 1/4; }
.t4 { grid-area: 2/4; } .t5 { grid-area: 3/4; } .t6 { grid-area: 4/4; } .t7 { grid-area: 4/3; }
.t8 { grid-area: 4/2; } .t9 { grid-area: 4/1; } .t10 { grid-area: 3/1; } .t11 { grid-area: 2/1; }
.vy-center {
  grid-area: 2/2/4/4; border-radius: 12px;
  border: 1px dashed rgba(255,183,77,.3); background: rgba(255,153,51,.03);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 10px; padding: 16px; text-align: center;
}
.vy-title { font: 800 clamp(16px, 2vw, 24px)/1 'Space Grotesk', sans-serif; letter-spacing: 3px; color: #ffd700; }
.vy-title span { display: block; margin-top: 5px; font: 600 10px/1 Inter, sans-serif; letter-spacing: 2px; color: #b8a9c4; }
.vy-dice { font-size: clamp(36px, 5vw, 56px); line-height: 1; color: #fdfbf7; }
.vy-dice.rolling { animation: vyShake .12s linear infinite; }
@keyframes vyShake { 0%{transform:rotate(-8deg)} 50%{transform:rotate(8deg)} 100%{transform:rotate(-8deg)} }
.vy-treasury { font: 600 11px/1.4 Inter, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #b8a9c4; }
.vy-treasury span { display: block; font: 800 clamp(20px, 2.6vw, 30px)/1.1 'Space Grotesk', sans-serif; color: #30d158; }
.vy-log { font-size: clamp(10px, 1.2vw, 12.5px); line-height: 1.5; color: #fdfbf7; min-height: 38px; max-width: 300px; }

/* light mode: break stages remain dark game-panels; only the eyebrow adapts */
html[data-theme="light"] .break-eyebrow { background: rgba(217, 154, 0, 0.1); }

@media (max-width: 780px) {
  #jxCanvas { height: 420px; }
  .jxq-opts { grid-template-columns: 1fr 1fr; }
  .lb-item { font-size: 34px; }
  .vy-board { max-width: 100%; }
  .vy-center { padding: 8px; gap: 6px; }
}
