/* ─────────────────────────────────────────────────────────────
   Matan 13.0 — cyberpunk bar mitzvah experience
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #05070a;
  --bg-2: #0a0e14;
  --ink: #e6fff3;
  --ink-dim: #7aa098;
  --ink-faint: #3d544c;
  --neon: #39ff8c;          /* primary green */
  --neon-soft: #39ff8c33;
  --cyan: #00e7ff;
  --magenta: #ff2bd6;
  --amber: #ffb84a;
  --red: #ff3b5c;
  --grid: rgba(57, 255, 140, 0.06);
  --scanline: rgba(57, 255, 140, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app, .stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* ── Background layers ─────────────────────────────────────── */
.bg-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
  z-index: 1;
}

.bg-rain {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  mix-blend-mode: screen;
  pointer-events: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    var(--scanline) 2px,
    var(--scanline) 3px
  );
  mix-blend-mode: overlay;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 29;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
}

.flicker {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 31;
  background: rgba(57, 255, 140, 0.02);
  animation: flicker 6s infinite steps(2);
}
@keyframes flicker {
  0%, 97%, 100% { opacity: 1; }
  98% { opacity: 0.85; }
  99% { opacity: 1.1; }
}

/* ── Top HUD ───────────────────────────────────────────────── */
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  padding: 22px 32px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.hud .col { display: flex; gap: 20px; align-items: center; }
.hud .col.right { justify-content: flex-end; }
.hud .col.center { justify-self: center; }

.hud .label { color: var(--ink-faint); }
.hud .val { color: var(--neon); font-weight: 700; }
.hud .val.cyan { color: var(--cyan); }
.hud .val.amber { color: var(--amber); }
.hud .val.magenta { color: var(--magenta); }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--neon);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--neon);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--ink);
}
.brand .accent { color: var(--neon); }

/* ── Chapter card (massive year display) ───────────────────── */
.year-mega {
  position: absolute;
  top: 16%; left: 200px;
  z-index: 5;
  pointer-events: none;
}
.year-mega .label {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.year-mega .num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(140px, 16vw, 280px);
  line-height: 0.85;
  color: var(--ink);
  letter-spacing: -0.04em;
  text-shadow:
    0 0 40px rgba(57, 255, 140, 0.25),
    -3px 0 var(--magenta),
    3px 0 var(--cyan);
  mix-blend-mode: screen;
}
.year-mega .of {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.3em;
  margin-top: 16px;
}
.year-mega .codename {
  margin-top: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--neon);
  text-transform: uppercase;
}

/* ── Photo collage ─────────────────────────────────────────── */
.collage {
  position: absolute;
  top: 16%;
  right: 4%;
  width: 50vw;
  height: 62vh;
  z-index: 4;
}

.photo-frame {
  position: absolute;
  border: 1px solid var(--neon-soft);
  background: var(--bg-2);
  overflow: hidden;
  box-shadow:
    0 0 24px rgba(57, 255, 140, 0.15),
    inset 0 0 0 1px rgba(57, 255, 140, 0.08);
  opacity: 0;
  animation: frame-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.photo-frame.fading-out {
  animation: frame-out 0.5s ease-in both;
}

@keyframes frame-in {
  0%   { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes frame-out {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.96); filter: blur(6px); }
}

/* The actual photo — fills the auto-sized frame exactly */
.photo-frame .photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  user-select: none;
  -webkit-user-drag: none;
}

/* Empty batch placeholder */
.empty-batch {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-faint);
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
}
.empty-batch .empty-icon { font-size: 48px; opacity: 0.4; }
.empty-batch .empty-text {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* Batch counter pill — sits above the collage so it doesn't overlap photos */
.batch-counter {
  position: absolute;
  top: -34px;
  right: 0;
  z-index: 10;
  background: rgba(5, 7, 10, 0.95);
  border: 1px solid var(--neon);
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.batch-counter .v { color: var(--neon); font-weight: 700; }
.batch-counter .dim { color: var(--ink-faint); }

.photo-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 60%, rgba(57, 255, 140, 0.08) 100%);
  pointer-events: none;
  z-index: 4;
}

.photo-frame .corner {
  position: absolute;
  width: 14px; height: 14px;
  border: 1.5px solid var(--neon);
  z-index: 3;
}
.photo-frame .corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.photo-frame .corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.photo-frame .corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.photo-frame .corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.photo-frame .meta {
  position: absolute;
  bottom: 8px; left: 10px; right: 10px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--neon);
  text-transform: uppercase;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  padding: 12px 4px 2px;
}

.photo-frame .meta.entering { opacity: 0; }

/* image-slot inside */
.photo-frame image-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--neon);
}
/* Override image-slot's default light-theme shadow DOM parts → cyber-dark */
.photo-frame image-slot::part(frame) {
  background: rgba(57, 255, 140, 0.03);
}
.photo-frame image-slot::part(ring) {
  border: 1.5px dashed rgba(57, 255, 140, 0.45);
}
.photo-frame image-slot::part(empty) {
  color: var(--neon);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ── Terminal ──────────────────────────────────────────────── */
.terminal {
  position: absolute;
  bottom: 10%;
  left: 5%;
  width: 40vw;
  max-width: 580px;
  z-index: 10;
  background: linear-gradient(180deg, rgba(5,7,10,0.92), rgba(5,7,10,0.75));
  border: 1px solid var(--neon-soft);
  border-left: 2px solid var(--neon);
  padding: 18px 22px;
  font-size: 13px;
  line-height: 1.6;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(57, 255, 140, 0.1);
}

.terminal .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(57, 255, 140, 0.15);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.terminal .head .pid { color: var(--neon); }

.terminal .line { display: block; min-height: 1.6em; }
.terminal .prompt { color: var(--neon); margin-right: 8px; }
.terminal .prompt.cyan { color: var(--cyan); }
.terminal .prompt.magenta { color: var(--magenta); }
.terminal .text { color: var(--ink); }
.terminal .dim { color: var(--ink-dim); }
.terminal .ok { color: var(--neon); }
.terminal .err { color: var(--red); }
.terminal .warn { color: var(--amber); }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--neon);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Score panel — top-left, aligned to year, clear of HUD ── */
.score {
  position: absolute;
  left: 32px;
  top: 18%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.score .row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  padding: 8px 14px;
  background: rgba(5, 7, 10, 0.78);
  border: 1px solid rgba(57, 255, 140, 0.18);
  border-left: 2px solid var(--neon);
  min-width: 120px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.score .row .lbl { color: var(--ink-faint); font-size: 9px; }
.score .row .v {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--neon);
  letter-spacing: 0;
  line-height: 1;
}
.score .row .v.cyan { color: var(--cyan); }
.score .row .v.magenta { color: var(--magenta); }
.score .row .v.amber { color: var(--amber); }

.achievement {
  position: absolute;
  left: 32px;
  top: 100px;
  z-index: 25;
  padding: 14px 18px;
  background: rgba(5, 7, 10, 0.95);
  border: 1px solid var(--amber);
  border-left: 3px solid var(--amber);
  box-shadow: 0 0 30px rgba(255, 184, 74, 0.4);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: translateX(-120%);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 280px;
}
.achievement.show { transform: translateX(0); }
.achievement .top { color: var(--amber); font-weight: 700; }
.achievement .name { color: var(--ink); font-size: 14px; text-transform: none; letter-spacing: 0.05em; }

/* ── Bottom timeline / controls ────────────────────────────── */
.timeline {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  padding: 16px 32px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  background: linear-gradient(to top, rgba(5,7,10,0.9), transparent);
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid rgba(57, 255, 140, 0.25);
  color: var(--neon);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.btn:hover {
  background: rgba(57, 255, 140, 0.08);
  border-color: var(--neon);
  box-shadow: 0 0 12px var(--neon-soft);
}
.btn.primary {
  width: 44px; height: 44px;
  background: var(--neon);
  color: var(--bg);
  border-color: var(--neon);
}
.btn.primary:hover { box-shadow: 0 0 24px var(--neon); }

.chapters {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  padding: 0 12px;
}
.chapter-dot {
  flex: 1;
  height: 4px;
  background: rgba(57, 255, 140, 0.15);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.chapter-dot:hover { background: rgba(57, 255, 140, 0.35); }
.chapter-dot.done { background: var(--neon); }
.chapter-dot.active {
  background: var(--neon);
  box-shadow: 0 0 12px var(--neon);
}
.chapter-dot.active::after {
  content: "";
  position: absolute;
  inset: -4px 0;
  border: 1px solid var(--neon);
}
.chapter-dot.has-photos:not(.done):not(.active)::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 3px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--amber);
}

.timeline-meta {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  text-transform: uppercase;
  display: flex;
  gap: 18px;
  align-items: center;
}
.timeline-meta .v { color: var(--neon); font-weight: 700; }

/* ── Audio bars ────────────────────────────────────────────── */
.audio-bars {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
  margin-left: 8px;
}
.audio-bars span {
  display: block;
  width: 2px;
  background: var(--neon);
  animation: bars 0.8s ease-in-out infinite alternate;
}
.audio-bars span:nth-child(1) { height: 40%; animation-delay: 0.0s; }
.audio-bars span:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.audio-bars span:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.audio-bars span:nth-child(4) { height: 60%; animation-delay: 0.3s; }
.audio-bars span:nth-child(5) { height: 80%; animation-delay: 0.15s; }
.audio-bars.muted span { animation-play-state: paused; opacity: 0.3; }

/* ── Boot overlay ──────────────────────────────────────────── */
.boot {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: opacity 0.6s;
  overflow-y: auto;
  padding: 24px 16px;
}
.boot.hidden { opacity: 0; pointer-events: none; }
.boot-inner {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.boot-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 6vw, 96px);
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
  text-shadow:
    -3px 0 var(--magenta),
    3px 0 var(--cyan);
}
.boot-sub {
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--ink-dim);
  margin-top: 12px;
  text-transform: uppercase;
}
.boot-log {
  margin-top: 22px;
  text-align: left;
  font-size: 12px;
  color: var(--neon);
  line-height: 1.6;
  min-height: 0;
  width: min(500px, 88vw);
}
.boot-log .dim { color: var(--ink-faint); }
.boot-cta {
  margin-top: 20px;
  padding: 14px 28px;
  background: var(--neon);
  color: var(--bg);
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(57, 255, 140, 0.5);
  transition: all 0.2s;
  flex-shrink: 0;
}
.boot-cta:hover { transform: scale(1.04); box-shadow: 0 0 50px rgba(57, 255, 140, 0.8); }
.boot-cta:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── End slate ─────────────────────────────────────────────── */
.end-slate {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(5,7,10,0.6), rgba(5,7,10,0.95));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s;
}
.end-slate.show { opacity: 1; pointer-events: auto; }
.end-slate .title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(80px, 12vw, 200px);
  text-align: center;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-shadow:
    -4px 0 var(--magenta),
    4px 0 var(--cyan),
    0 0 60px rgba(57, 255, 140, 0.4);
}
.end-slate .sub {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  letter-spacing: 0.4em;
  color: var(--neon);
  text-transform: uppercase;
}
.end-slate .btn-replay {
  display: block;
  margin: 40px auto 0;
  padding: 14px 32px;
  background: transparent;
  border: 1px solid var(--neon);
  color: var(--neon);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.end-slate .btn-replay:hover {
  background: var(--neon);
  color: var(--bg);
  box-shadow: 0 0 30px var(--neon);
}

/* ─────────────────────────────────────────────────────────────
   Responsive: tablet & mobile
   ───────────────────────────────────────────────────────────── */

/* Tablet — under 1100px wide */
@media (max-width: 1100px) {
  .hud { padding: 14px 18px; font-size: 10px; gap: 12px; }
  .hud .col { gap: 12px; flex-wrap: wrap; }
  .brand { font-size: 13px; }

  .year-mega { left: 160px; top: 14%; }
  .year-mega .num { font-size: clamp(110px, 14vw, 220px); }
  .year-mega .codename { font-size: 12px; }

  .score { left: 18px; top: 16%; gap: 6px; }
  .score .row { padding: 6px 10px; min-width: 110px; }
  .score .row .v { font-size: 18px; }

  .collage { width: 56vw; right: 3%; top: 16%; height: 60vh; }

  .terminal { width: 52vw; max-width: 480px; left: 3%; bottom: 11%; font-size: 12px; padding: 14px 16px; }

  .timeline { padding: 14px 18px 18px; gap: 14px; }
  .timeline-meta { font-size: 9px; gap: 12px; }
}

/* Small tablet & big phones — under 820px */
@media (max-width: 820px) {
  .hud { display: none; }

  .year-mega { left: 16px; top: 12px; }
  .year-mega .label { font-size: 10px; margin-bottom: 4px; }
  .year-mega .num { font-size: clamp(72px, 18vw, 130px); }
  .year-mega .of { font-size: 10px; margin-top: 6px; }
  .year-mega .codename { font-size: 11px; margin-top: 10px; }

  /* Photos take main top area, score becomes a small horizontal strip below year */
  .score {
    position: absolute;
    left: 16px;
    top: auto;
    bottom: auto;
    /* place under year-mega */
    top: 220px;
    flex-direction: row;
    gap: 6px;
  }
  .score .row { padding: 4px 8px; min-width: 70px; }
  .score .row .lbl { font-size: 8px; }
  .score .row .v { font-size: 14px; }

  /* Stage layout: photos fill most of right + bottom */
  .collage {
    left: 50%;
    right: auto;
    top: 12px;
    width: 48vw;
    height: 56vh;
  }

  /* Terminal becomes full-width strip at bottom */
  .terminal {
    left: 12px;
    right: 12px;
    bottom: 70px;
    width: auto;
    max-width: none;
    font-size: 11px;
    padding: 12px 14px;
    line-height: 1.45;
  }
  .terminal .head { font-size: 9px; }

  .timeline { grid-template-columns: 1fr; gap: 8px; padding: 8px 12px 12px; }
  .timeline .chapters { padding: 0 4px; }
  .timeline-meta { justify-content: center; font-size: 9px; gap: 10px; }
  .btn { width: 32px; height: 32px; font-size: 12px; }
  .btn.primary { width: 38px; height: 38px; }

  .achievement {
    left: 16px;
    top: auto;
    bottom: 130px;
    min-width: 220px;
    padding: 10px 14px;
    font-size: 10px;
  }
  .achievement .name { font-size: 12px; }

  .batch-counter { top: -28px; font-size: 9px; padding: 4px 8px; }

  /* Boot tightens up */
  .boot-title { font-size: clamp(36px, 9vw, 72px); }
  .boot-sub { font-size: 10px; letter-spacing: 0.3em; }
  .boot-log { font-size: 11px; width: 92vw; margin-top: 16px; }
  .boot-cta { font-size: 11px; padding: 12px 22px; letter-spacing: 0.25em; }

  /* End slate */
  .end-slate .title { font-size: clamp(48px, 14vw, 110px); }
  .end-slate .sub { font-size: 11px; letter-spacing: 0.25em; }
}

/* Phone portrait — under 560px */
@media (max-width: 560px) {
  .year-mega { left: 12px; }
  .year-mega .num { font-size: clamp(64px, 22vw, 110px); }

  .score {
    left: 12px;
    top: 200px;
    flex-direction: row;
    gap: 4px;
  }
  .score .row { padding: 4px 6px; min-width: 60px; }
  .score .row .v { font-size: 12px; }
  .score .row .lbl { font-size: 7px; letter-spacing: 0.12em; }

  .collage {
    left: 50%;
    width: 46vw;
    top: 12px;
    height: 48vh;
  }

  .terminal {
    bottom: 76px;
    font-size: 10px;
    padding: 10px 12px;
    line-height: 1.4;
  }
  .terminal .head { display: none; }

  .timeline { padding: 6px 8px 10px; }
  .timeline-meta { font-size: 8px; gap: 6px; }
  .chapter-dot { height: 3px; }

  .end-slate .title { font-size: clamp(36px, 18vw, 78px); }

  .upload-panel { width: 100% !important; max-height: 96vh; }
  .upload-panel.wide { width: 100% !important; }
  .up-head { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .up-tabs { width: 100%; order: 3; }
  .up-body { padding: 14px; }
  .up-counts-grid { grid-template-columns: repeat(5, 1fr); }
  .mg-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .mg-actions { flex-direction: column; align-items: stretch; }
  .mg-buttons { justify-content: stretch; }
  .mg-buttons .up-btn, .mg-buttons .mg-move-select { flex: 1; min-width: 0; }
}

/* Very short viewports — landscape phones */
@media (max-height: 540px) and (max-width: 1100px) {
  .year-mega { top: 8px; }
  .year-mega .num { font-size: clamp(56px, 12vh, 120px); }
  .score { top: 130px; flex-direction: row; gap: 4px; }
  .score .row { padding: 3px 8px; min-width: 60px; }
  .collage { top: 8px; height: 56vh; }
  .terminal { bottom: 62px; padding: 10px 12px; font-size: 10px; }
  .timeline { padding: 6px 12px 10px; }
}

/* ── Drop hint banner (shows briefly after boot) ───────────── */
.drop-hint {
  position: absolute;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 25;
  background: rgba(5, 7, 10, 0.95);
  border: 1px solid var(--amber);
  border-left: 3px solid var(--amber);
  padding: 12px 24px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(255, 184, 74, 0.3);
}
.drop-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.drop-hint .accent { color: var(--amber); font-weight: 700; }
.drop-hint .arrow {
  display: inline-block;
  margin-right: 10px;
  animation: hint-pulse 1.4s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ── Scene transition flash ────────────────────────────────── */
.flash {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: var(--neon);
  pointer-events: none;
  opacity: 0;
}
.flash.on {
  animation: flash 0.4s ease-out;
}
@keyframes flash {
  0% { opacity: 0; }
  20% { opacity: 0.15; }
  100% { opacity: 0; }
}

/* ── Photo treatment variants ──────────────────────────────── */
/* Photos display in original colors. Only soft scanline/glitch frame
   overlays remain (around the photo, not on top of its pixels). */
.photo-frame.treat-glitch::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 0%, transparent 49%, rgba(255,43,214,0.25) 50%, transparent 51%);
  mix-blend-mode: screen;
  animation: glitch-shift 4s steps(8) infinite;
  pointer-events: none;
  opacity: 0.2;
  z-index: 4;
}
@keyframes glitch-shift {
  0%, 90%, 100% { transform: translateX(0); }
  92% { transform: translateX(-4px); }
  94% { transform: translateX(3px); }
  96% { transform: translateX(-2px); }
}

.photo-frame.treat-scan::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(57,255,140,0.05) 3px, rgba(57,255,140,0.05) 4px);
  pointer-events: none;
  z-index: 4;
  opacity: 0.5;
}
