/* ================================================================
   Chicago L Eats — styles.css
   ================================================================ */

:root {
  --red: #C8102E; --blue: #00A1DE; --brown: #62361B; --green: #009B3A;
  --orange: #F9461C; --purple: #522398; --pink: #E27EA6; --yellow: #F9E300;
  --bg: #0a0a0a; --surface: #141414; --surface2: #1e1e1e; --border: #2a2a2a;
  --text: #f0ede8; --muted: #888; --accent: #F9E300;
  --amtrak: #1a4fa3; --metra: #006747; --southshore: #8B0000;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ---- ANIMATED TRACK ---- */
.hero-track {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 6px; z-index: 999;
  background: repeating-linear-gradient(90deg,
    var(--red)    0px  100px,
    var(--blue)   100px 200px,
    var(--brown)  200px 300px,
    var(--green)  300px 400px,
    var(--orange) 400px 500px,
    var(--purple) 500px 600px,
    var(--pink)   600px 700px,
    var(--yellow) 700px 800px
  );
  background-size: 800px 100%;
  animation: slide 16s linear infinite;
}
@keyframes slide {
  from { background-position: 0 0; }
  to   { background-position: 800px 0; }
}

/* ---- HERO with VIDEO BACKGROUND ----
.hero {
  position: relative; padding: 120px 40px 80px; text-align: center;
  border-bottom: 1px solid var(--border); overflow: hidden; margin-top: 6px;
  min-height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center;
}


/* ---- HERO with VIDEO BACKGROUND ---- */
.hero {
  position: relative;
  padding: 120px 40px 80px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  margin-top: 6px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* YouTube iframe wrapper */
.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* YouTube iframe background */
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.78vh;
  height: 56.25vw;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  opacity: 0.75;
  z-index: 0;
  pointer-events: none;
  border: 0;
}

/* Dark overlay over video */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(10,10,10,0.5) 0%,
    rgba(10,10,10,0.3) 50%,
    rgba(10,10,10,0.7) 100%
  );
  pointer-events: none;
}

/* All hero content sits above video */
.hero > *:not(.hero-video-wrap):not(.hero-overlay) {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-family: 'Space Mono', monospace;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--accent);
  text-shadow: 0 0 60px rgba(249,227,0,0.3), 0 2px 20px rgba(0,0,0,0.8);
}

.hero h1 span { color: var(--text); }

.hero p {
  font-size: 1.05rem;
  color: rgba(240,237,232,0.85);
  max-width: 480px;
  margin: 14px auto 0;
  line-height: 1.6;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.stat { text-align: center; }

.stat-n {
  font-family: 'Space Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(249,227,0,0.3);
}

.stat-l {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}


/* ---- SURPRISE ME BUTTON ---- */
.surprise-wrap { display: flex; justify-content: center; margin-top: 28px; }
.surprise-btn {
  font-family: 'Space Mono', monospace; font-size: 0.82rem; font-weight: 700;
  background: transparent; border: 1.5px solid var(--accent); color: var(--accent);
  padding: 10px 24px; border-radius: 30px; cursor: pointer;
  transition: all 0.2s; letter-spacing: 0.04em;
}
.surprise-btn:hover { background: var(--accent); color: #000; transform: scale(1.04); }

/* ---- MAP SECTION ---- */
.map-section {
  border-bottom: 1px solid var(--border); padding: 40px;
  background: var(--surface);
}
.map-section-inner { max-width: 900px; margin: 0 auto; }
.map-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.map-title { font-family: 'Space Mono', monospace; font-size: 1rem; font-weight: 700; color: var(--text); }
.map-subtitle { font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.map-img-wrap {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface2); text-align: center;
}
.map-img-wrap img { width: 100%; max-width: 860px; display: block; margin: 0 auto; }
.map-img-placeholder {
  padding: 60px 20px; color: var(--muted); font-family: 'Space Mono', monospace; font-size: 0.8rem;
}
.map-img-placeholder .map-icon { font-size: 3rem; margin-bottom: 12px; }
.map-source { font-size: 0.72rem; color: var(--muted); margin-top: 10px; text-align: right; }
.map-source a { color: var(--muted); text-decoration: underline; }

/* ---- TRANSIT LEGEND ---- */
.transit-legend { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 16px; }
.transit-group-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; font-family: 'Space Mono', monospace; }
.transit-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.transit-pill {
  display: flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 20px; font-family: 'Space Mono', monospace; font-size: 0.7rem; font-weight: 700;
  border: 1.5px solid transparent; cursor: default;
}
.transit-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ---- LINE LEGEND (filter) ---- */
.lines-legend {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 20px 40px; border-bottom: 1px solid var(--border);
}
.line-badge {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-radius: 20px; font-family: 'Space Mono', monospace; font-size: 0.72rem;
  font-weight: 700; cursor: pointer; transition: transform 0.15s, opacity 0.15s;
  border: 2px solid transparent; user-select: none;
}
.line-badge:hover { transform: scale(1.05); }
.line-badge.active { border-color: rgba(255,255,255,0.5); }
.line-badge.inactive { opacity: 0.28; }
.line-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ---- CONTROLS ---- */
.controls {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 16px 40px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.controls input[type=text] {
  flex: 1; min-width: 200px; padding: 10px 16px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-family: 'Space Mono', monospace; font-size: 0.82rem;
}
.controls input[type=text]::placeholder { color: var(--muted); }
.controls input[type=text]:focus { outline: none; border-color: var(--accent); }
.controls select {
  padding: 10px 14px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: 'Space Mono', monospace; font-size: 0.8rem; cursor: pointer;
}
.sort-btn {
  padding: 10px 14px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted); font-family: 'Space Mono', monospace;
  font-size: 0.75rem; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.sort-btn:hover, .sort-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
.count-badge { margin-left: auto; font-family: 'Space Mono', monospace; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

/* ---- GRID ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--border); }
.card {
  background: var(--bg); padding: 24px; display: flex; flex-direction: column;
  gap: 12px; cursor: pointer; transition: background 0.15s; position: relative; overflow: hidden;
}
.card:hover { background: var(--surface); }
.card-accent-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-name { font-family: 'Space Mono', monospace; font-size: 0.9rem; font-weight: 700; line-height: 1.3; color: var(--text); }
.card-rating { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.rating-num { font-family: 'Space Mono', monospace; font-size: 1.4rem; font-weight: 700; }
.rating-stars { font-size: 0.62rem; color: var(--muted); }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.meta-tag {
  font-size: 0.68rem; padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--muted); font-family: 'Space Mono', monospace;
}
.meta-tag.cuisine { border-color: #444; color: #ccc; }
.meta-tag.price { border-color: var(--accent); color: var(--accent); }
.card-station { display: flex; align-items: flex-start; gap: 10px; }
.station-icon { font-size: 10px; background: var(--surface2); padding: 4px 7px; border-radius: 5px; font-family: 'Space Mono', monospace; color: var(--muted); flex-shrink: 0; margin-top: 1px; }
.station-name { font-size: 0.8rem; color: var(--text); font-weight: 500; line-height: 1.4; }
.card-lines { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.line-pill { width: 20px; height: 8px; border-radius: 4px; }
.connector-badge {
  font-family: 'Space Mono', monospace; font-size: 0.58rem; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.03em;
}
.badge-amtrak { background: var(--amtrak); color: #fff; }
.badge-metra { background: var(--metra); color: #fff; }
.badge-southshore { background: var(--southshore); color: #fff; }
.card-comment { font-size: 0.8rem; color: var(--muted); line-height: 1.5; font-style: italic; border-left: 2px solid var(--border); padding-left: 10px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.card-hood { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.card-link { font-family: 'Space Mono', monospace; font-size: 0.68rem; color: var(--accent); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.no-results { padding: 80px 40px; text-align: center; color: var(--muted); font-family: 'Space Mono', monospace; font-size: 0.85rem; }

/* ---- MODAL ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.88);
  z-index: 200; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-hero { padding: 32px 32px 0; position: relative; }
.modal-hero-bar { height: 4px; border-radius: 2px; margin-bottom: 24px; }
.modal-title { font-family: 'Space Mono', monospace; font-size: 1.3rem; font-weight: 700; line-height: 1.2; padding-right: 40px; }
.modal-close {
  position: absolute; top: 16px; right: 16px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
  font-size: 1rem; cursor: pointer; padding: 4px 10px; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 32px 32px; display: flex; flex-direction: column; gap: 18px; }
.modal-row { display: flex; gap: 12px; }
.modal-field { flex: 1; }
.modal-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 5px; }
.modal-value { font-size: 0.9rem; color: var(--text); line-height: 1.5; }
.modal-comment-box {
  background: var(--surface2); border-radius: 10px; padding: 16px;
  font-size: 0.85rem; color: var(--text); line-height: 1.65; font-style: italic;
  border-left: 3px solid var(--accent);
}
.modal-lines { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.modal-line-pill {
  display: flex; align-items: center; gap: 6px; padding: 5px 13px;
  border-radius: 20px; font-family: 'Space Mono', monospace; font-size: 0.7rem; font-weight: 700;
}
.modal-connectors { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 4px; }
.modal-connector-pill {
  font-family: 'Space Mono', monospace; font-size: 0.72rem; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
}
.modal-cta {
  display: block; text-align: center; background: var(--accent); color: #000;
  text-decoration: none; font-family: 'Space Mono', monospace; font-weight: 700;
  font-size: 0.85rem; padding: 14px; border-radius: 10px; margin-top: 4px;
}
.modal-cta:hover { opacity: 0.88; }

/* ================================================================
   CINEMATIC SURPRISE ME MODAL
   ================================================================ */

/* Full-screen dark overlay */
.surprise-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0); backdrop-filter: blur(0px);
  align-items: center; justify-content: center;
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
.surprise-overlay.open {
  display: flex;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
}

/* The card itself */
.surprise-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 520px; width: 100%;
  padding: 0;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.88) translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.34,1.56,0.64,1), transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.surprise-overlay.open .surprise-modal {
  opacity: 1; transform: scale(1) translateY(0);
}

/* Animated line color banner at top */
.surprise-line-banner {
  height: 6px; width: 100%;
  background: var(--accent);
  transition: background 0.6s ease;
}

/* PHASE 1: Rolling screen */
.surprise-rolling-phase {
  padding: 52px 32px 44px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.surprise-rolling-phase.hidden { display: none; }

/* 3D dice */
.dice-wrap {
  perspective: 400px;
  margin-bottom: 28px;
}
.dice {
  width: 72px; height: 72px;
  font-size: 4rem; line-height: 72px; text-align: center;
  display: inline-block;
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 20px rgba(249,227,0,0.5));
}
.dice.rolling {
  animation: diceRoll 0.18s linear infinite;
}
@keyframes diceRoll {
  0%   { transform: rotate3d(1,1,0,0deg)   scale(1); }
  25%  { transform: rotate3d(0,1,1,90deg)  scale(1.1); }
  50%  { transform: rotate3d(1,0,1,180deg) scale(0.95); }
  75%  { transform: rotate3d(1,1,0,270deg) scale(1.1); }
  100% { transform: rotate3d(0,1,1,360deg) scale(1); }
}
.dice.landing {
  animation: diceLand 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes diceLand {
  0%   { transform: scale(1.4) rotate(15deg); }
  60%  { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Slot machine cycling names */
.slot-machine-wrap {
  height: 38px; overflow: hidden; margin-bottom: 10px; width: 100%;
}
.slot-machine {
  font-family: 'Space Mono', monospace; font-size: 1.1rem; font-weight: 700;
  color: var(--accent);
  animation: slotSpin 0.12s linear infinite;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 16px;
}
@keyframes slotSpin {
  0%   { transform: translateY(0);     opacity: 1; }
  45%  { transform: translateY(-100%); opacity: 0; }
  46%  { transform: translateY(100%);  opacity: 0; }
  100% { transform: translateY(0);     opacity: 1; }
}
.slot-machine.stopped { animation: none; }

.rolling-label {
  font-family: 'Space Mono', monospace; font-size: 0.72rem;
  color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase;
  margin-top: 4px;
}

/* Spinning L line dots during roll */
.rolling-lines {
  display: flex; gap: 8px; justify-content: center; margin-top: 20px;
}
.rolling-line-dot {
  width: 12px; height: 12px; border-radius: 50%;
  animation: linePulse 0.8s ease-in-out infinite alternate;
}
.rolling-line-dot:nth-child(2) { animation-delay: 0.1s; }
.rolling-line-dot:nth-child(3) { animation-delay: 0.2s; }
.rolling-line-dot:nth-child(4) { animation-delay: 0.3s; }
.rolling-line-dot:nth-child(5) { animation-delay: 0.4s; }
.rolling-line-dot:nth-child(6) { animation-delay: 0.5s; }
.rolling-line-dot:nth-child(7) { animation-delay: 0.6s; }
@keyframes linePulse {
  from { transform: scale(0.6); opacity: 0.3; }
  to   { transform: scale(1.2); opacity: 1; }
}

/* PHASE 2: Reveal screen */
.surprise-reveal-phase {
  display: none; flex-direction: column;
}
.surprise-reveal-phase.visible { display: flex; }

/* Big photo/color header */
.surprise-reveal-header {
  position: relative; height: 180px; overflow: hidden;
  display: flex; align-items: flex-end;
  background: var(--surface2);
}
.surprise-reveal-bg {
  position: absolute; inset: 0;
  opacity: 0.18;
  background: radial-gradient(ellipse at center, var(--accent) 0%, transparent 70%);
  transition: background 0.6s;
}
.surprise-reveal-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--surface) 0%, transparent 60%);
}
.surprise-reveal-title-wrap {
  position: relative; z-index: 2; padding: 0 28px 22px; width: 100%;
}
.surprise-reveal-restaurant {
  font-family: 'Space Mono', monospace; font-size: 1.45rem; font-weight: 700;
  color: var(--text); line-height: 1.2;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.5s 0.1s ease, transform 0.5s 0.1s ease;
}
.surprise-reveal-phase.visible .surprise-reveal-restaurant {
  opacity: 1; transform: translateY(0);
}
.surprise-reveal-subtitle-row {
  display: flex; gap: 8px; align-items: center; margin-top: 8px;
  flex-wrap: wrap;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.5s 0.2s ease, transform 0.5s 0.2s ease;
}
.surprise-reveal-phase.visible .surprise-reveal-subtitle-row {
  opacity: 1; transform: translateY(0);
}

/* Big animated star rating */
.surprise-stars-row {
  display: flex; justify-content: center; gap: 6px;
  padding: 20px 28px 0;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.4s 0.35s ease, transform 0.4s 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.surprise-reveal-phase.visible .surprise-stars-row { opacity: 1; transform: scale(1); }
.surprise-star {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px rgba(249,227,0,0.7));
  animation: starPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.surprise-star:nth-child(1) { animation-delay: 0.4s; }
.surprise-star:nth-child(2) { animation-delay: 0.5s; }
.surprise-star:nth-child(3) { animation-delay: 0.6s; }
.surprise-star:nth-child(4) { animation-delay: 0.7s; }
.surprise-star:nth-child(5) { animation-delay: 0.8s; }
@keyframes starPop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  70%  { transform: scale(1.3) rotate(5deg);  opacity: 1; }
  100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* Tags row */
.surprise-tags-row {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  padding: 14px 28px 0;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s 0.5s ease, transform 0.4s 0.5s ease;
}
.surprise-reveal-phase.visible .surprise-tags-row { opacity: 1; transform: translateY(0); }

/* Louis's quote */
.surprise-quote {
  margin: 16px 28px 0;
  background: var(--surface2); border-radius: 10px; padding: 14px 16px;
  font-size: 0.85rem; color: var(--text); line-height: 1.6; font-style: italic;
  border-left: 3px solid var(--accent);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s 0.6s ease, transform 0.4s 0.6s ease;
}
.surprise-reveal-phase.visible .surprise-quote { opacity: 1; transform: translateY(0); }
.surprise-quote-author {
  display: block; margin-top: 6px; font-style: normal;
  font-size: 0.72rem; color: var(--muted);
}

/* CTA station row */
.surprise-station-row {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 28px 0;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s 0.65s ease, transform 0.4s 0.65s ease;
}
.surprise-reveal-phase.visible .surprise-station-row { opacity: 1; transform: translateY(0); }
.surprise-station-icon {
  font-size: 10px; background: var(--surface2); padding: 4px 8px;
  border-radius: 5px; font-family: 'Space Mono', monospace; color: var(--muted);
  flex-shrink: 0; border: 1px solid var(--border);
}
.surprise-station-name {
  font-size: 0.82rem; color: var(--text); font-weight: 500;
}

/* Action buttons */
.surprise-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 20px 28px 28px; margin-top: 4px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s 0.7s ease, transform 0.4s 0.7s ease;
}
.surprise-reveal-phase.visible .surprise-actions { opacity: 1; transform: translateY(0); }
.surprise-action-btn {
  font-family: 'Space Mono', monospace; font-size: 0.78rem; font-weight: 700;
  padding: 11px 22px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface2);
  color: var(--text); transition: all 0.15s;
}
.surprise-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.surprise-action-btn.primary {
  background: var(--accent); color: #000; border-color: var(--accent);
}
.surprise-action-btn.primary:hover { opacity: 0.88; transform: scale(1.02); }

/* surprise overlay uses .surprise-overlay class, not .modal-overlay */
.surprise-close-btn {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: rgba(255,255,255,0.7);
  font-size: 1rem; cursor: pointer; padding: 4px 10px; line-height: 1;
  backdrop-filter: blur(4px); transition: all 0.15s;
}
.surprise-close-btn:hover { color: #fff; background: rgba(0,0,0,0.8); }

/* Confetti particle */
.confetti-particle {
  position: fixed; pointer-events: none; z-index: 400;
  width: 8px; height: 8px; border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ---- FOOTER ---- */
footer { padding: 40px; text-align: center; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; font-family: 'Space Mono', monospace; line-height: 1.8; }
footer strong { color: var(--accent); }
footer a { color: var(--muted); text-decoration: underline; }

/* ---- GALLERY ---- */
.gallery-section {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 48px 40px;
  overflow: hidden;
}
.gallery-section-inner { max-width: 900px; margin: 0 auto; }
.gallery-header { margin-bottom: 28px; }
.gallery-title { font-family: 'Space Mono', monospace; font-size: 1rem; font-weight: 700; color: var(--text); }
.gallery-subtitle { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.gallery-stage {
  position: relative; border-radius: 14px; overflow: hidden;
  background: var(--surface2); border: 1px solid var(--border);
  aspect-ratio: 16/9;
}
.gallery-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.7s ease-in-out;
  display: flex; align-items: flex-end;
}
.gallery-slide.active { opacity: 1; z-index: 2; }
.gallery-slide.prev   { opacity: 0; z-index: 1; }
.gallery-slide-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transform-origin: center center;
}
.gallery-slide.active .gallery-slide-img {
  animation: kenBurns 6s ease-in-out forwards;
}
@keyframes kenBurns {
  0%   { transform: scale(1.08) translate(1%, 1%); }
  100% { transform: scale(1.0)  translate(-1%, -1%); }
}
.gallery-slide::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
}
.gallery-caption {
  position: relative; z-index: 2; padding: 20px 24px 22px; width: 100%;
}
.gallery-caption-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gallery-caption-name {
  font-family: 'Space Mono', monospace; font-size: 1rem; font-weight: 700;
  color: #fff; line-height: 1.2;
}
.gallery-caption-tag {
  font-family: 'Space Mono', monospace; font-size: 0.65rem; font-weight: 700;
  padding: 3px 9px; border-radius: 12px; background: rgba(255,255,255,0.15);
  color: #fff; backdrop-filter: blur(4px);
}
.gallery-caption-sub {
  font-size: 0.78rem; color: rgba(255,255,255,0.7); margin-top: 5px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.gallery-caption-bar { height: 3px; border-radius: 2px; margin-bottom: 14px; width: 48px; }
.gallery-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; gap: 12px;
}
.gallery-dots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gallery-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  border: none; padding: 0;
}
.gallery-dot.active { transform: scale(1.4); }
.gallery-nav { display: flex; gap: 8px; }
.gallery-nav-btn {
  font-family: 'Space Mono', monospace; font-size: 0.75rem;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); padding: 7px 14px; border-radius: 8px;
  cursor: pointer; transition: all 0.15s;
}
.gallery-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.gallery-pause-btn {
  font-family: 'Space Mono', monospace; font-size: 0.7rem;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); padding: 7px 12px; border-radius: 8px;
  cursor: pointer; transition: all 0.15s;
}
.gallery-pause-btn:hover { color: var(--text); border-color: #555; }
.gallery-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--muted); font-family: 'Space Mono', monospace; font-size: 0.8rem;
  gap: 10px; background: var(--surface2);
}
.gallery-placeholder-icon { font-size: 2.5rem; }

/* ---- L TRAIN GALLERY ---- */
.l-train-section {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 48px 40px;
  overflow: hidden;
}
.l-train-section-inner { max-width: 900px; margin: 0 auto; }
.l-train-header { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.l-train-title { font-family: 'Space Mono', monospace; font-size: 1rem; font-weight: 700; color: var(--text); }
.l-train-subtitle { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.l-train-badge {
  font-family: 'Space Mono', monospace; font-size: 0.68rem; font-weight: 700;
  padding: 4px 12px; border-radius: 20px; background: rgba(249,227,0,0.1);
  border: 1px solid rgba(249,227,0,0.3); color: var(--accent);
}

@media (max-width: 640px) {
  .l-train-section { padding: 32px 16px; }
}
@media (max-width: 640px) {
  .hero { padding: 60px 20px 40px; }
  .hero-stats { gap: 20px; }
  .controls { padding: 14px 16px; }
  .lines-legend { padding: 14px 16px; }
  .map-section { padding: 24px 16px; }
  .gallery-section { padding: 32px 16px; }
  .gallery-stage { aspect-ratio: 4/3; }
  .gallery-caption-name { font-size: 0.85rem; }
  .grid { grid-template-columns: 1fr; }
  .modal-body, .modal-hero { padding-left: 18px; padding-right: 18px; }
  .surprise-modal { padding: 28px 18px; }
}
