/* ============================================================
   SPANISH VOCAB — Word Highway (highway) styles
   Every selector is prefixed with .g-highway (module contract).
   Accent colour: blue, with red for danger.
   ============================================================ */

/* ---------- Top bar ---------- */
.g-highway .game-title > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.g-highway .game-title .icon { background: rgba(77, 163, 255, 0.15); border-color: rgba(77, 163, 255, 0.4); box-shadow: 0 0 18px rgba(77, 163, 255, 0.25); }
.g-highway-tag { font-family: var(--font-body); font-size: 0.78rem; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.g-highway-best { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--c-amber); padding: 6px 12px; border-radius: var(--r-pill); background: rgba(77, 163, 255, 0.1); border: 1px solid rgba(77, 163, 255, 0.3); white-space: nowrap; }
.g-highway .game-topbar .row { gap: 8px; }
.g-highway-pausebtn { min-height: 40px; }

/* ---------- HUD ---------- */
.g-highway-hud { gap: var(--sp-3) var(--sp-5); }
.g-highway-hud .hud-item .val { font-variant-numeric: tabular-nums; min-width: 2ch; }
.g-highway-fuel { flex: 1 1 200px; min-width: 170px; }
.g-highway-fuelbar { flex: 1; min-width: 90px; }
.g-highway-fuel .val { min-width: 3ch; text-align: right; }
.g-highway-fuel .bar-fill { background: var(--c-amber); transition: width 200ms linear, background var(--t-med); }
.g-highway-fuel.is-low .bar-fill { background: var(--c-rose); }
.g-highway-fuel.is-low .val { color: var(--c-rose); animation: pulse 1s ease-in-out infinite; }
.g-highway-nitro { flex: 0 1 170px; min-width: 130px; }
.g-highway-nitrobar { flex: 1; min-width: 70px; }
.g-highway-nitro .bar-fill { background: var(--c-mint); transition: width 120ms linear; }
.g-highway-nitro.is-on .bar-fill { background: #fff; box-shadow: 0 0 12px var(--c-mint); }
.g-highway-nitro.is-on .label { color: var(--c-mint); }
.g-highway-biome { gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.g-highway-biome-icon { font-size: 1.05rem; line-height: 1; }
.g-highway-biome .val { font-size: 0.95rem; }
.g-highway-streak .val { transition: color var(--t-fast); }
.g-highway-streak.is-hot .val { color: var(--c-mint); text-shadow: 0 0 12px rgba(255, 138, 43, 0.6); animation: g-highway-flame 0.9s ease-in-out infinite; }
@keyframes g-highway-flame { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-1px) scale(1.06); } }

/* ---------- Stage ---------- */
.g-highway-stage { background: #0a1230; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.g-highway-canvas { width: 100%; height: 100%; display: block; }
.g-highway-mini { position: absolute; top: 12px; right: 12px; width: 132px; height: 132px; z-index: 3; border-radius: 50%; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); background: rgba(6, 10, 22, 0.5); pointer-events: none; }
.g-highway-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 70px rgba(5, 8, 26, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.04); z-index: 2; }

/* Banner */
.g-highway-banner { position: absolute; top: 14%; left: 50%; transform: translateX(-50%); width: min(100% - 32px, 560px); text-align: center; pointer-events: none; z-index: 3; opacity: 0; transition: opacity var(--t-med); }
.g-highway-banner.is-on { opacity: 1; animation: g-highway-banner-in var(--t-slow) var(--ease-bounce) both; }
@keyframes g-highway-banner-in { from { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(0.92); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
.g-highway-banner-title { font-family: var(--font-display); font-size: clamp(1.4rem, 4.5vw, 2.3rem); font-weight: 900; letter-spacing: -0.01em; line-height: 1.1; color: #fff; text-shadow: 0 0 24px rgba(77, 163, 255, 0.9), 0 6px 18px rgba(0, 0, 0, 0.7); }
.g-highway-banner-sub { margin-top: 4px; font-size: 0.9rem; font-weight: 600; color: var(--text-2); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }

/* ---------- Checkpoint question (inside the shared modal) ---------- */
.g-highway-q { display: flex; flex-direction: column; gap: var(--sp-4); }
.g-highway-qhead { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid rgba(239, 59, 77, 0.45); background: rgba(239, 59, 77, 0.08); animation: pop var(--t-med) var(--ease-bounce) both; }
.g-highway-qhead b { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.g-highway-qhead span:last-child { font-size: 0.85rem; color: var(--text-2); }
.g-highway-qicon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); border: 1px solid var(--border-strong); }

/* ---------- Controls ---------- */
.g-highway-touch { align-items: center; }
.g-highway-is-touch .g-highway-touch { display: flex; }
.g-highway-touch .touch-btn { width: 64px; height: 60px; font-size: 1.5rem; }
.g-highway-touch .tc-group { gap: 8px; }
.g-highway-gas { background: rgba(77, 163, 255, 0.16); border-color: rgba(77, 163, 255, 0.5); color: var(--c-amber); width: 76px !important; }
.g-highway-brake { background: rgba(239, 59, 77, 0.12); border-color: rgba(239, 59, 77, 0.45); color: var(--c-rose); }
.g-highway-nitrobtn { background: rgba(255, 138, 43, 0.16); border-color: rgba(255, 138, 43, 0.55); color: var(--c-mint); font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; }
.g-highway-nitrobtn.is-down { background: rgba(255, 138, 43, 0.4); border-color: var(--c-mint); }
.g-highway-touch-pause { width: 48px; height: 48px; font-size: 1.1rem; }
.g-highway-help { text-align: center; }
.g-highway-is-touch .g-highway-help { display: none; }

/* ---------- Overlays ---------- */
.g-highway-overlay .panel { max-width: 560px; }
.g-highway-overlay-intro { padding: 12px; }
.g-highway-intro.panel { padding: 20px var(--sp-6); }
.g-highway-intro-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 2px; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(77, 163, 255, 0.5)); }
.g-highway-intro h2 { margin-bottom: 6px; }
.g-highway-intro p { margin-bottom: 12px; }
.g-highway-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; text-align: left; font-size: 0.82rem; color: var(--text-2); margin-bottom: 12px; }
.g-highway-legend > div { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.g-highway-legend b { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(77, 163, 255, 0.14); color: var(--c-amber); font-family: var(--font-display); font-size: 1rem; }
.g-highway-intro-best { margin-bottom: var(--sp-3); }
.g-highway-colors { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 12px; }
.g-highway-swatches { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.g-highway-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); background: linear-gradient(135deg, color-mix(in srgb, var(--swatch) 85%, #fff) 0%, var(--swatch) 45%, var(--stripe) 46%, var(--stripe) 54%, var(--swatch) 55%); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); transition: transform var(--t-fast) var(--ease-bounce), border-color var(--t-fast); cursor: pointer; }
.g-highway-swatch:hover { transform: scale(1.12); }
.g-highway-swatch[aria-pressed="true"] { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.5), 0 3px 10px rgba(0, 0, 0, 0.35); }
.g-highway-actions { justify-content: center; margin-top: var(--sp-2); }
.g-highway-overlay-over { padding: 12px; }
.g-highway-over.panel { padding: 16px var(--sp-6); max-width: 600px; }
.g-highway-over .eyebrow { margin-bottom: 2px; }
.g-highway-over h2 { font-size: 1.45rem; margin-bottom: 0; }
.g-highway-over .big { font-size: 2.3rem; margin: 2px 0; }
.g-highway-newbest { display: inline-block; padding: 4px 14px; border-radius: 999px; background: rgba(77, 163, 255, 0.15); border: 1px solid rgba(77, 163, 255, 0.5); color: var(--c-amber); font-weight: 700; font-size: 0.85rem; animation: pulse 1.2s ease-in-out infinite; }
.g-highway-over .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.g-highway-over .stat { padding: 6px 6px; }
.g-highway-over .stat-val { font-size: 1.2rem; }
.g-highway-missed-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.g-highway-missed { max-height: 132px; overflow: auto; scrollbar-width: thin; margin-top: 4px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.g-highway-missed-row { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid rgba(77, 163, 255, 0.35); }
.g-highway-missed-row .en { color: var(--text-2); font-size: 0.85rem; }
.g-highway-missed-row .en::after { content: '→'; color: var(--muted); margin-left: 6px; }
.g-highway-missed-row .es { font-family: var(--font-display); font-weight: 800; font-size: 1rem; white-space: nowrap; }
.g-highway-over .g-highway-actions { margin-top: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .g-highway-tag { display: none; }
  .g-highway-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; padding: 10px 12px; gap: 8px 6px; }
  .g-highway-fuel { grid-column: 1 / -1; min-width: 0; }
  .g-highway-hud .hud-item { font-size: 0.82rem; gap: 4px; min-width: 0; }
  .g-highway-hud .hud-item:not(.g-highway-fuel):not(.g-highway-biome) { flex-direction: column; }
  .g-highway-hud .hud-item .label { font-size: 0.6rem; letter-spacing: 0.06em; }
  .g-highway-hud .hud-item .val { font-size: 0.95rem; }
  .g-highway-hud .hud-spacer { display: none; }
  .g-highway-biome { grid-column: span 2; justify-content: center; }
  .g-highway-nitro { grid-column: span 2; min-width: 0; flex-direction: row !important; }
  .g-highway-mini { width: 96px; height: 96px; top: 8px; right: 8px; }
  .g-highway-overlay { padding: var(--sp-3); }
  .g-highway-overlay .panel { padding: var(--sp-5) var(--sp-4); }
  .g-highway-overlay .panel h2 { font-size: 1.35rem; }
  .g-highway-overlay .panel .big { font-size: 2.2rem; }
  .g-highway-overlay .panel p { font-size: 0.9rem; margin-bottom: var(--sp-3); }
  .g-highway-intro-icon { font-size: 2.2rem; }
  .g-highway-legend { grid-template-columns: 1fr; gap: 4px; font-size: 0.78rem; margin-bottom: 8px; }
  .g-highway-legend > div:nth-child(n+3) { display: none; }
  .g-highway-swatch { width: 24px; height: 24px; }
  .g-highway-colors { margin: 0 0 8px; }
  .g-highway-legend > div { padding: 4px 8px; }
  .g-highway-legend b { flex-basis: 24px; height: 24px; font-size: 0.9rem; }
  .g-highway-over.panel { padding: var(--sp-4); }
  .g-highway-over .eyebrow { display: none; }
  .g-highway-over h2 { font-size: 1.3rem; }
  .g-highway-over .big { font-size: 1.9rem; }
  .g-highway-newbest { font-size: 0.78rem; padding: 3px 10px; }
  .g-highway-over .stat-grid { gap: 6px; margin: 8px 0; }
  .g-highway-over .stat { padding: 6px 4px; border-radius: 10px; }
  .g-highway-over .stat-val { font-size: 1rem; }
  .g-highway-over .stat-label { font-size: 0.6rem; letter-spacing: 0.04em; }
  .g-highway-missed-title { display: none; }
  .g-highway-missed { gap: 4px; max-height: 120px; margin-bottom: 6px; }
  .g-highway-missed-row { padding: 3px 8px; gap: 6px; }
  .g-highway-missed-row .en { font-size: 0.72rem; }
  .g-highway-missed-row .es { font-size: 0.85rem; }
  .g-highway-overlay .panel .btn-lg { padding: 11px 18px; font-size: 0.95rem; }
  .g-highway-actions { gap: 8px; }
  .g-highway-touch .touch-btn { width: 50px; height: 52px; }
  .g-highway-gas { width: 60px !important; }
  .g-highway-touch .tc-group { gap: 6px; }
}
