/* ============================================================================
   HUD v2 — arcade score rail, collection board frame, lookbook, pixel FX
   ============================================================================ */
.screen-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 372px);
  gap: clamp(16px, 2.4vw, 30px);
  width: 100%;
  max-width: 1180px;
  align-items: start;
}

/* Grid items default to min-width:auto (= min-content). Force 0 so the board and
   rail can shrink below the tile images' intrinsic width on WebKit / iOS Safari,
   instead of overflowing the phone screen. */
.board-stage, #right-rail, .board-wrap, .model-panel { min-width: 0; }

/* ---- Full-screen side logo (left edge, gameplay only) ------------------- */
/* Fixed, full-viewport-height band. The wordmark PNG has wide side margins,
   so object-fit: cover crops them away and fills the band top-to-bottom.
   The game content is pushed clear of the band via body.game-active .app. */
.side-logo {
  position: fixed; left: 0; top: 0;
  width: clamp(132px, 13vw, 220px); height: 100dvh;
  padding: clamp(18px, 3.4vh, 40px) clamp(12px, 1.3vw, 24px);
  background: transparent; z-index: 6; overflow: hidden;
}
.side-logo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  image-rendering: pixelated; display: block;
}
/* Pull the game clear of the band, trim vertical padding, and centre it so the
   board + rail sit on a single screen. */
body.game-active .app {
  padding-left: clamp(160px, 15vw, 252px);
  padding-block: clamp(12px, 2.2vh, 22px);
  align-items: center;
}

/* ---- LEVEL tag + Claim/Quit, now under the score & lookbook ------------- */
.rail-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 2px;
}
.rail-controls .level-tag {
  background: #ffc5d3; color: #fff; border-color: var(--ink-strong);
  font-family: var(--font-arcade); font-size: 10px; letter-spacing: 0; padding: 9px 13px;
  box-shadow: var(--cab-shadow-sm);
}
.rail-controls .level-tag .lv-num { color: var(--arc-yellow); }
.rail-controls button { flex: 1; padding: 12px 14px; font-size: 12px; }

/* ---- Board wrap — collection-colored cabinet frame --------------------- */
.board-wrap {
  --frame: var(--sw-5);
  --frame-ink: var(--ink-strong);
  background: var(--frame);
  border-radius: var(--radius-lg);
  padding: clamp(12px, 1.6vw, 18px);
  position: relative;
  border: 3px solid var(--ink-strong);
  box-shadow: var(--cab-shadow), inset 0 0 0 2px rgba(255,255,255,0.35);
  transition: background .5s var(--ease-soft);
}
.board-wrap[data-level="1"] { --frame: var(--sw-1); }
.board-wrap[data-level="2"] { --frame: var(--sw-2); }
.board-wrap[data-level="3"] { --frame: var(--sw-3); }
.board-wrap[data-level="4"] { --frame: var(--sw-4); --frame-ink: #f3f6fa; }
.board-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 4px 12px; color: var(--frame-ink);
  font-family: var(--font-arcade); font-size: 10px; letter-spacing: 0; text-transform: uppercase;
}
.board-status .level-label { display: flex; align-items: center; gap: 8px; }
.board-status .level-label::before {
  content: ""; width: 10px; height: 10px; background: var(--arc-red);
  border: 2px solid var(--frame-ink);
}
.board-wrap[data-level="2"] .board-status .level-label::before { background: var(--arc-orange); }
.board-wrap[data-level="3"] .board-status .level-label::before { background: var(--arc-blue); }
.board-wrap[data-level="4"] .board-status .level-label::before { background: var(--arc-yellow); }
.board-status .level-target {
  background: #bfbfbf; color: var(--arc-yellow);
  padding: 5px 9px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.board-wrap[data-level="4"] .board-status .level-target { background: #fff; color: var(--ink-strong); }

/* ════════════════════════════════════════════════════════════════════════
   ARCADE SCORE RAIL (model panel)
   ════════════════════════════════════════════════════════════════════════ */
.model-panel {
  background: var(--card);
  border: 3px solid var(--ink-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--cab-shadow);
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}

/* SCORE block — Daytona / Metal Slug style */
.score-block {
  background: #bfbfbf; border-radius: var(--radius-sm);
  padding: 10px 13px 11px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.score-block .score-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.score-block .score-head .caption { color: var(--arc-yellow); font-family: var(--font-arcade); font-size: 9px; letter-spacing: 0; }
.score-block .best { font-family: var(--font-arcade); font-size: 8px; color: #aeb6c6; text-align: right; line-height: 1.5; }
.score-block .best b { color: #fff; display: block; }
.score-num {
  font-family: var(--font-arcade); font-weight: 400;
  font-size: clamp(30px, 4.4vw, 44px); line-height: 1;
  color: var(--arc-yellow);
  font-variant-numeric: tabular-nums; letter-spacing: 0;
  display: inline-block;
  text-shadow: 3px 3px 0 #b56a00, 0 0 0 #000;
}
.score-num { transform: skewX(-7deg); }
.score-num.bump { animation: score-bump .26s steps(3); }
@keyframes score-bump { 40% { transform: skewX(-7deg) scale(1.16); } }

/* Goal — segmented arcade bar */
.goal-wrap { display: flex; flex-direction: column; gap: 6px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; }
.goal-head .caption { font-family: var(--font-arcade); font-size: 9px; letter-spacing: 0; color: var(--ink); }
.goal-head .goal-pct { font-family: var(--font-arcade); font-size: 9px; color: var(--arc-blue); }
.goal-bar {
  position: relative; height: 18px; border-radius: 4px;
  background: var(--paper-2); border: 2px solid var(--ink-strong); overflow: hidden;
  box-shadow: inset 2px 2px 0 rgba(20,21,29,0.12);
}
.goal-bar .fill {
  height: 100%; width: 0%;
  background:
    repeating-linear-gradient(90deg, var(--arc-blue) 0 10px, #1559cc 10px 12px);
  transition: width .45s steps(8);
}
.goal-bar.complete .fill { background: repeating-linear-gradient(90deg, var(--arc-green) 0 10px, #199a52 10px 12px); }

/* Live reward meter — climbs toward the next discount tier */
.reward-meter { display: flex; flex-direction: column; gap: 6px; }
.reward-head { display: flex; justify-content: space-between; align-items: baseline; }
.reward-head .caption { font-family: var(--font-arcade); font-size: 9px; letter-spacing: 0; color: var(--ink); }
.reward-now { font-family: var(--font-arcade); font-size: 9px; color: var(--ink-dim); }
.reward-meter.earned .reward-now { color: var(--arc-gold); }
.reward-bar {
  position: relative; height: 16px; border-radius: 4px;
  background: var(--paper-2); border: 2px solid var(--ink-strong); overflow: hidden;
  box-shadow: inset 2px 2px 0 rgba(20,21,29,0.12);
}
.reward-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, var(--arc-gold) 0 10px, #d98c00 10px 12px);
  transition: width .5s var(--ease-soft);
}
.reward-next { font-family: var(--font-arcade); font-size: 8px; color: var(--arc-red); }

/* Reward popup — celebratory center card when a reward tier is reached */
.reward-pop {
  position: fixed; inset: 0; z-index: 58;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.reward-pop-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--ink-strong); color: #fff;
  border: 4px solid var(--ink-strong); border-radius: var(--radius-lg);
  padding: 22px 30px; box-shadow: var(--cab-shadow);
  animation: reward-pop-in .5s var(--ease-pop) both;
}
.reward-pop.out .reward-pop-card { animation: reward-pop-out .34s var(--ease-soft) both; }
.reward-pop .rp-title { font-family: var(--font-arcade); font-size: 11px; color: var(--arc-red); }
.reward-pop .rp-big {
  font-family: var(--font-arcade); font-size: clamp(26px, 5vw, 44px); color: var(--arc-yellow);
  transform: skewX(-6deg);
  text-shadow: -3px -3px 0 var(--ink-strong), 3px -3px 0 var(--ink-strong), -3px 3px 0 var(--ink-strong), 3px 3px 0 var(--ink-strong), 0 6px 0 var(--arc-red);
}
.reward-pop .rp-code {
  font-family: var(--font-arcade); font-size: 14px; color: var(--arc-yellow);
  background: rgba(255,255,255,0.1); border: 2px dashed var(--arc-yellow); border-radius: 6px; padding: 6px 12px;
}
.reward-pop .rp-note { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: #cfd6e6; }
@keyframes reward-pop-in { 0% { transform: scale(.4) rotate(-4deg); opacity: 0; } 60% { transform: scale(1.08); } }
@keyframes reward-pop-out { to { transform: scale(.85) translateY(-14px); opacity: 0; } }

/* ════════════════════════════════════════════════════════════════════════
   LOOKBOOK — pixel-art collection looks, revealed as milestones
   ════════════════════════════════════════════════════════════════════════ */
.lookbook { display: flex; flex-direction: column; gap: 10px; }
.lookbook-head { display: flex; justify-content: space-between; align-items: baseline; }
.lookbook-head .caption { font-family: var(--font-arcade); font-size: 9px; letter-spacing: 0; color: var(--ink); }
.lookbook-head .count { font-family: var(--font-arcade); font-size: 9px; color: var(--arc-red); }

.look-feature {
  position: relative; border: 3px solid var(--ink-strong); border-radius: var(--radius-sm);
  background: var(--paper-2); overflow: hidden; height: clamp(186px, 23vw, 240px);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3);
}
.look-feature img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 14%;
  display: block; image-rendering: pixelated;
  animation: look-in .5s var(--ease-pop);
}
@keyframes look-in { 0% { transform: scale(1.12); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.look-feature .look-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, transparent, rgba(20,21,29,0.85));
}
.look-feature .look-meta .idx { font-family: var(--font-arcade); font-size: 9px; color: var(--arc-yellow); }

/* 3-slot reveal strip */
.look-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.look-slot {
  position: relative; aspect-ratio: 1 / 1; border: 2px solid var(--ink-strong); border-radius: 4px;
  overflow: hidden; background: var(--paper-2);
}
.look-slot img { width: 100%; height: 100%; object-fit: cover; object-position: center 16%; display: block; image-rendering: pixelated; }
.look-slot.locked img { filter: grayscale(1) brightness(0.5) contrast(0.7); }
.look-slot.locked::after {
  content: "?"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-arcade); font-size: 16px; color: #fff;
  background: rgba(20,21,29,0.55);
}
.look-slot.current { border-color: var(--arc-red); box-shadow: 0 0 0 2px var(--arc-yellow); }
.look-slot .slot-num { position: absolute; top: 2px; left: 3px; font-family: var(--font-arcade); font-size: 8px; color: #fff; text-shadow: 1px 1px 0 #000; }

/* ════════════════════════════════════════════════════════════════════════
   FX LAYER — pixel score pops, giant combo, square particles
   ════════════════════════════════════════════════════════════════════════ */
#fx-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.score-pop {
  position: fixed; transform: translate(-50%, -50%) skewX(-7deg);
  font-family: var(--font-arcade); font-size: 17px;
  color: var(--arc-yellow);
  text-shadow: 2px 2px 0 var(--ink-strong), -1px -1px 0 var(--ink-strong), 1px -1px 0 var(--ink-strong), -1px 1px 0 var(--ink-strong);
  font-variant-numeric: tabular-nums; white-space: nowrap; will-change: transform, opacity;
}
.combo-pop {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%,-50%);
  font-family: var(--font-arcade); text-align: center; white-space: nowrap; will-change: transform, opacity;
}
.combo-pop .cx {
  display: block; font-size: clamp(40px, 8vw, 80px); line-height: 1;
  color: var(--arc-yellow); transform: skewX(-7deg);
  text-shadow:
    -3px -3px 0 var(--ink-strong), 3px -3px 0 var(--ink-strong),
    -3px  3px 0 var(--ink-strong), 3px  3px 0 var(--ink-strong),
     0    6px 0 var(--arc-red);
}
.combo-pop .lbl {
  display: block; font-size: clamp(12px, 1.8vw, 18px); letter-spacing: 0.1em;
  color: #fff; margin-top: 8px;
  text-shadow: -2px -2px 0 var(--ink-strong), 2px -2px 0 var(--ink-strong), -2px 2px 0 var(--ink-strong), 2px 2px 0 var(--ink-strong);
}
.combo-pop.fever .cx { color: var(--arc-red); text-shadow: -3px -3px 0 var(--ink-strong), 3px -3px 0 var(--ink-strong), -3px 3px 0 var(--ink-strong), 3px 3px 0 var(--ink-strong), 0 6px 0 var(--arc-yellow); }
.particle { position: fixed; will-change: transform, opacity; image-rendering: pixelated; }

/* screen shake + flash */
.app.shake { animation: shake var(--shake-dur, .34s) steps(3); }
@keyframes shake {
  10%,90% { transform: translate(-1px, 0); }
  30%,50%,70% { transform: translate(-4px, 1px); }
  40%,60% { transform: translate(4px, -1px); }
}
#flash-layer { position: fixed; inset: 0; z-index: 45; pointer-events: none; opacity: 0; background: #fff; }
#flash-layer.go { animation: flash .2s steps(2); }
@keyframes flash { 0% { opacity: 0.55; } 100% { opacity: 0; } }

/* ---- Milestone "LOOK UNLOCKED" reveal over the board ------------------- */
.look-reveal {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  pointer-events: none;
}
.look-reveal .banner {
  font-family: var(--font-arcade); font-size: clamp(13px, 2vw, 18px); color: var(--arc-yellow);
  background: var(--ink-strong); border: 3px solid var(--ink-strong); padding: 10px 16px; border-radius: 6px;
  box-shadow: var(--cab-shadow);
  text-shadow: 2px 2px 0 var(--arc-red);
  animation: banner-in .4s var(--ease-pop) both;
}
.look-reveal .reveal-card {
  width: min(46%, 240px); aspect-ratio: 4/5; border: 4px solid var(--ink-strong); border-radius: 8px;
  overflow: hidden; box-shadow: var(--cab-shadow); background: var(--paper-2);
  animation: reveal-card-in .5s var(--ease-pop) both;
}
.look-reveal .reveal-card img { width: 100%; height: 100%; object-fit: cover; object-position: center 16%; image-rendering: pixelated; display: block; }
@keyframes banner-in { 0% { transform: translateY(-16px) scale(.8); opacity: 0; } }
@keyframes reveal-card-in { 0% { transform: scale(.4) rotate(-5deg); opacity: 0; } 60% { transform: scale(1.06); } }

/* Round transition overlay — arcade STAGE CLEAR */
.round-overlay {
  position: fixed; inset: 0; z-index: 55;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px;
  background: rgba(234,238,243,0.92);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: ro-in .25s steps(2);
}
.round-overlay .caption { font-family: var(--font-arcade); font-size: 11px; color: var(--arc-red); }
.round-overlay h2 {
  font-family: var(--font-arcade); font-size: clamp(22px, 5vw, 46px); color: var(--arc-yellow);
  transform: skewX(-6deg);
  text-shadow: -3px -3px 0 var(--ink-strong), 3px -3px 0 var(--ink-strong), -3px 3px 0 var(--ink-strong), 3px 3px 0 var(--ink-strong), 0 7px 0 var(--arc-red);
  animation: ro-pop .45s var(--ease-pop);
}
.round-overlay .reveal-card {
  width: min(280px, 60vw); aspect-ratio: 4/5; border: 4px solid var(--ink-strong); border-radius: 8px;
  overflow: hidden; box-shadow: var(--cab-shadow); background: var(--paper-2);
}
.round-overlay .reveal-card img { width: 100%; height: 100%; object-fit: cover; object-position: center 14%; image-rendering: pixelated; display: block; animation: look-in .5s var(--ease-pop); }
.round-overlay .editorial { font-family: var(--font-display); color: var(--ink); font-weight: 800; }
@keyframes ro-in { from { opacity: 0; } }
@keyframes ro-pop { 0% { transform: skewX(-6deg) scale(0.5); opacity: 0; } 60% { transform: skewX(-6deg) scale(1.08); } }
