/* Barcade home page: bar meets retro arcade */
:root {
  --red: #CB333B;
  --deep: #9E1F27;
  --ink: #1B1B1B;
  --gold: #F2C14E;
  --pink: #ff4f9a;
  --blue: #3fd0ff;
  --bg: #140d10;
  --wood: #3a2216;
  --head: Oswald, "Avenir Next Condensed", "DIN Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Source Sans 3", "Avenir Next", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(203,51,59,0.35), transparent 60%),
    radial-gradient(ellipse at 10% 40%, rgba(63,208,255,0.10), transparent 50%),
    radial-gradient(ellipse at 90% 60%, rgba(255,79,154,0.10), transparent 50%),
    var(--bg);
  color: #f6eee6;
  font-family: var(--body);
  overflow-x: hidden;
}
.bg-lights {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.35;
  background-image: radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1.5px);
  background-size: 22px 22px;
}
.hero, main, .site-footer { position: relative; z-index: 1; }

/* ---------- neon sign ---------- */
.hero { text-align: center; padding: max(28px, env(safe-area-inset-top)) 16px 8px; }
.sign {
  display: inline-block;
  padding: 14px 28px 16px;
  border: 3px solid rgba(255,79,154,0.85);
  border-radius: 22px;
  box-shadow: 0 0 10px rgba(255,79,154,0.7), inset 0 0 14px rgba(255,79,154,0.45), 0 18px 40px rgba(0,0,0,0.5);
  background: rgba(20,8,14,0.65);
}
.neon-title {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(54px, 15vw, 120px);
  line-height: 0.95;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff4f4;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--red), 0 0 26px var(--red), 0 0 48px rgba(203,51,59,0.8);
  animation: flicker 6s infinite;
}
.sign-sub {
  margin-top: 6px;
  font-family: var(--head);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: clamp(13px, 3.4vw, 18px);
}
.neon-pink { color: #ffd1e6; text-shadow: 0 0 6px var(--pink), 0 0 14px var(--pink); }
.neon-blue { color: #d9f6ff; text-shadow: 0 0 6px var(--blue), 0 0 14px var(--blue); }
.dot { color: var(--gold); text-shadow: 0 0 8px var(--gold); }
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .neon-title, .insert-coin { animation: none !important; }
}
.tagline { margin: 18px auto 4px; max-width: 34em; font-size: clamp(16px, 4vw, 19px); color: #e9d9cf; }
.insert-coin {
  margin: 6px 0 0;
  font-family: var(--head);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 14px;
  animation: blink 1.2s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* ---------- bar rail + grid ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 18px 16px 40px; }
.bar-rail {
  height: 14px; margin: 6px 0 24px; border-radius: 8px;
  background: linear-gradient(#7a4a2c, var(--wood) 60%, #22140c);
  box-shadow: 0 4px 0 #120a06, 0 10px 24px rgba(0,0,0,0.5), inset 0 2px 0 rgba(255,255,255,0.18);
}
.section-title {
  font-family: var(--head); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 20px; margin: 0 0 16px; display: flex; align-items: center; gap: 12px; color: #fff;
}
.section-title::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--red), transparent); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.card {
  --accent: var(--red);
  display: flex; flex-direction: column;
  background: #fffaf3;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--accent), 0 16px 30px rgba(0,0,0,0.45);
  transition: transform 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.card.live:hover, .card.live:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 0 var(--accent), 0 22px 36px rgba(0,0,0,0.5); outline: none; }
.card.live:active { transform: translateY(2px); box-shadow: 0 3px 0 var(--accent), 0 10px 20px rgba(0,0,0,0.45); }
.card.soon { opacity: 0.88; }
.thumb {
  position: relative; aspect-ratio: 16 / 10; background: #111; border-bottom: 3px solid var(--ink); overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0 12px, transparent 12px 24px),
    radial-gradient(circle at 50% 45%, var(--accent), #1b1b1b 75%);
}
.thumb-emoji { font-size: 64px; filter: grayscale(0.2) drop-shadow(0 4px 0 rgba(0,0,0,0.35)); }
.badge {
  position: absolute; top: 10px; left: 10px;
  font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px;
  background: var(--ink); color: #fff; padding: 4px 10px; border-radius: 999px; border: 2px solid #fff;
}
.badge-live { background: var(--red); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { margin: 0; font-family: var(--head); text-transform: uppercase; letter-spacing: 0.04em; font-size: 24px; line-height: 1.1; }
.card-desc { margin: 0 0 8px; font-size: 16px; line-height: 1.35; color: #4a4040; flex: 1; }
.play-btn {
  align-self: flex-start;
  font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; font-size: 18px;
  background: var(--accent); color: #fff; border: 2px solid var(--ink); border-radius: 12px;
  padding: 10px 22px; min-height: 48px; display: inline-flex; align-items: center;
}
.play-btn.disabled { background: #d9d0c8; color: #6b625b; }
.noscript { color: #fff; }

/* ---------- footer ---------- */
.site-footer { text-align: center; padding: 0 16px max(28px, env(safe-area-inset-bottom)); color: #cdbdb2; }
.checker {
  height: 18px; margin-bottom: 18px;
  background: repeating-conic-gradient(#1b1b1b 0 25%, #f3ebe2 0 50%) 0 0 / 18px 18px;
  opacity: 0.8;
}
.site-footer p { margin: 4px 0; font-family: var(--head); letter-spacing: 0.12em; text-transform: uppercase; font-size: 14px; }
.site-footer .small { font-size: 12px; opacity: 0.7; }

@media (max-width: 480px) {
  .sign { padding: 10px 18px 12px; }
  .grid { gap: 18px; }
}

/* live top 5 on a game card */
.card-top5 { margin: 6px 0 10px; background: #1f1416; color: #fff6ea; border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px; }
.card-top5[hidden] { display: none; }
.top5-title { font-family: Oswald, "Arial Narrow", Impact, sans-serif; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: #ffcf5a; margin-bottom: 4px; }
.top5-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.top5-row { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.top5-rank { width: 16px; text-align: center; font-weight: 700; color: #ff8a8f; }
.top5-av { width: 22px; height: 22px; border-radius: 50%; background: #e9a11c; border: 1px solid #1b1b1b; }
.top5-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top5-score { font-weight: 700; color: #ffd25a; }
.top5-empty { font-size: 13px; opacity: 0.8; }

/* ---------- v11: compact game cards so every game is above the fold on phones + iPad portrait ---------- */
.card-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
@media (min-width: 601px) and (max-width: 1100px) {
  .hero { padding-top: max(18px, env(safe-area-inset-top)); }
  .neon-title { font-size: clamp(54px, 10vw, 90px); }
  .tagline { margin-top: 10px; }
  main { padding-top: 8px; }
  .bar-rail { margin: 4px 0 16px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .card-body { padding: 10px 12px 12px; gap: 4px; }
  .card-title { font-size: 19px; }
  .card-desc { font-size: 14px; margin-bottom: 4px; -webkit-line-clamp: 3; }
  .badge { font-size: 11px; top: 7px; left: 7px; padding: 3px 8px; }
  .play-btn { font-size: 15px; padding: 6px 14px; min-height: 38px; }
  .top5-row { font-size: 13px; }
}
@media (max-width: 600px) {
  .hero { padding: max(12px, env(safe-area-inset-top)) 12px 2px; }
  .sign { padding: 6px 16px 8px; border-radius: 16px; }
  .neon-title { font-size: 46px; }
  .sign-sub { margin-top: 2px; font-size: 12px; }
  .tagline { margin: 8px auto 0; font-size: 14px; }
  .insert-coin { font-size: 12px; margin-top: 2px; }
  main { padding: 6px 12px 28px; }
  .bar-rail { height: 10px; margin: 4px 0 12px; }
  .section-title { font-size: 16px; margin-bottom: 10px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { flex-direction: row; border-radius: 14px; box-shadow: 0 4px 0 var(--accent), 0 10px 20px rgba(0,0,0,0.45); min-height: 112px; }
  .thumb { flex: 0 0 40%; aspect-ratio: auto; border-bottom: 0; border-right: 3px solid var(--ink); }
  .thumb img { position: absolute; inset: 0; }
  .badge { display: none; }
  .card-body { padding: 8px 10px 9px; gap: 3px; min-width: 0; }
  .card-title { font-size: 18px; line-height: 1.08; }
  .card-desc { font-size: 13px; line-height: 1.28; margin: 0 0 4px; -webkit-line-clamp: 2; }
  .card-top5 { display: none; }
  .play-btn { font-size: 14px; padding: 4px 12px; min-height: 30px; border-radius: 9px; }
}

/* ---------- Landscape (phone sideways): short neon header in one row, games in a 2-column grid of wide cards ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  .hero { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; justify-content: center; align-items: center; column-gap: 20px;
    text-align: left; padding: max(8px, env(safe-area-inset-top)) 16px 0; }
  .sign { grid-row: 1 / span 2; padding: 4px 16px 6px; border-radius: 14px; }
  .neon-title { font-size: 40px; }
  .sign-sub { margin-top: 0; font-size: 11px; }
  .tagline { margin: 0; font-size: 14px; max-width: 26em; align-self: end; }
  .insert-coin { font-size: 11px; margin-top: 2px; align-self: start; }
  main { padding: 2px 16px 20px; }
  .bar-rail { height: 8px; margin: 6px 0 8px; }
  .section-title { font-size: 15px; margin-bottom: 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .card { flex-direction: row; border-radius: 14px; box-shadow: 0 4px 0 var(--accent), 0 10px 20px rgba(0,0,0,0.45); min-height: 104px; }
  .thumb { flex: 0 0 38%; aspect-ratio: auto; border-bottom: 0; border-right: 3px solid var(--ink); }
  .thumb img { position: absolute; inset: 0; }
  .badge { display: none; }
  .card-body { padding: 7px 10px 8px; gap: 3px; min-width: 0; }
  .card-title { font-size: 17px; line-height: 1.08; }
  .card-desc { font-size: 13px; line-height: 1.26; margin: 0 0 4px; -webkit-line-clamp: 2; }
  .card-top5 { display: none; }
  .play-btn { font-size: 14px; padding: 4px 12px; min-height: 32px; border-radius: 9px; }
}

/* Instagram badge (Scorsese art) */
.ig-section { margin: 14px 0 0; text-align: center; }
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) { .ig-section { margin-top: 10px; } }
.ig-link { display: inline-block; line-height: 0; border-radius: 999px; transition: transform .15s ease; }
.ig-link img { display: block; max-width: 100%; height: auto; }
.ig-link:hover { transform: translateY(-2px); }
.ig-link:focus-visible { outline: 3px solid #ffb52e; outline-offset: 3px; }

/* ---------- v14: data-driven category sections (games.js CATEGORIES) ---------- */
.games + .games { margin-top: 30px; }
.section-title { margin-bottom: 4px; }
.section-sub {
  margin: 0 0 14px; font-family: var(--head); text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 13px; color: var(--gold);
}
@media (max-width: 600px) {
  .section-title { margin-bottom: 2px; }
  .section-sub { font-size: 11px; margin-bottom: 9px; }
  .games + .games { margin-top: 20px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .insert-coin { grid-row: 1 / span 2; align-self: center; }
  .bar-rail { margin: 5px 0 6px; }
  .section-title { margin-bottom: 0; }
  .section-sub { font-size: 11px; margin-bottom: 5px; }
  .games + .games { margin-top: 16px; }
}

/* ---------- 2007 Games: black-and-gold spy section (CSS + type only, no art) ---------- */
.games.theme-spy {
  --spy-gold: #D4AF37; --spy-gold-hi: #F5DD8A; --spy-black: #050505;
  position: relative; isolation: isolate; overflow: hidden;
  margin-left: -4px; margin-right: -4px; padding: 18px 18px 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(212,175,55,0.16), transparent 42%),
    linear-gradient(180deg, #0d0b06, var(--spy-black));
  border: 1px solid rgba(212,175,55,0.55); border-radius: 16px;
  box-shadow: inset 0 0 0 4px var(--spy-black), inset 0 0 0 5px rgba(212,175,55,0.25), 0 14px 30px rgba(0,0,0,0.55);
}
/* faint gun-barrel rings in the section corner */
.games.theme-spy::before {
  content: ""; position: absolute; z-index: -1; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 14px, rgba(212,175,55,0.13) 14px 16px);
  pointer-events: none;
}
.theme-spy .section-title { color: var(--spy-gold-hi); letter-spacing: 0.3em; font-weight: 600; }
.theme-spy .section-title::before {
  content: ""; flex: 0 0 auto; width: 1.15em; height: 1.15em; border-radius: 50%;
  background: radial-gradient(circle, var(--spy-black) 0 28%, var(--spy-gold) 30% 38%, var(--spy-black) 40% 54%, var(--spy-gold) 56% 64%, transparent 66%);
}
.theme-spy .section-title::after { background: linear-gradient(90deg, var(--spy-gold), transparent); height: 1px; }
.theme-spy .section-sub { color: var(--spy-gold); font-style: italic; text-transform: none; letter-spacing: 0.14em; font-size: 15px; }
.theme-spy .card {
  background: #0b0a08; color: #efe6cf; border: 1px solid var(--spy-gold); border-radius: 12px;
  box-shadow: 0 0 0 3px var(--spy-black), 0 0 0 4px rgba(212,175,55,0.35), 0 14px 26px rgba(0,0,0,0.6);
}
.theme-spy .card.soon { opacity: 1; }
.theme-spy .thumb { background: var(--spy-black); border-bottom: 1px solid var(--spy-gold); }
.theme-spy .card-title { color: var(--spy-gold-hi); letter-spacing: 0.12em; }
.theme-spy .card-desc { color: #bfb49a; }
.theme-spy .badge { background: var(--spy-black); color: var(--spy-gold-hi); border: 1px solid var(--spy-gold); letter-spacing: 0.2em; }
.theme-spy .play-btn { background: var(--spy-gold); color: var(--spy-black); border: 1px solid var(--spy-gold-hi); }
.theme-spy .play-btn.disabled { background: transparent; color: var(--spy-gold); border: 1px solid var(--spy-gold); letter-spacing: 0.2em; }
/* the gun-barrel tile: rifled barrel (conic grooves) with a gold iris and a pinpoint dot */
.thumb-barrel { display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 50%, #17140c 0, var(--spy-black, #050505) 70%); }
.barrel-ring {
  position: relative; width: min(62%, 150px); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 34%, rgba(0,0,0,0.85) 36% 100%),
    repeating-conic-gradient(from 8deg, #2a2415 0 9deg, #0a0906 9deg 30deg);
  box-shadow: 0 0 0 2px #D4AF37, 0 0 0 7px #050505, 0 0 0 8px rgba(212,175,55,0.45), inset 0 0 22px #000;
}
.barrel-ring::before { content: ""; position: absolute; inset: 32%; border-radius: 50%; border: 2px solid #D4AF37;
  background: radial-gradient(circle, #f8eac0 0, #D4AF37 20%, #1a1508 62%, #050505 100%); }
.barrel-dot { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #fff6d6; box-shadow: 0 0 10px 3px rgba(245,221,138,0.85); z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .barrel-ring { animation: barrel-turn 14s linear infinite; }
  .barrel-ring::before, .barrel-dot { animation: barrel-turn 14s linear infinite reverse; }
}
@keyframes barrel-turn { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .games.theme-spy { padding: 12px 12px 14px; margin-left: 0; margin-right: 0; }
  .games.theme-spy::before { width: 170px; height: 170px; right: -55px; top: -55px; }
  .theme-spy .section-sub { font-size: 12px; }
  .theme-spy .thumb { border-bottom: 0; border-right: 1px solid var(--spy-gold); }
  .barrel-ring { width: min(66%, 84px); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .games.theme-spy { padding: 10px 12px 12px; margin-left: 0; margin-right: 0; }
  .theme-spy .section-sub { font-size: 12px; }
  .theme-spy .thumb { border-bottom: 0; border-right: 1px solid var(--spy-gold); }
  .barrel-ring { width: min(64%, 76px); }
}
.theme-spy .thumb-barrel .badge { display: none; }

/* ---------- HiScore text logo (CSS/type only; Scorsese will supply real logo art) ---------- */
.brand-logo { display: inline-flex; align-items: baseline; gap: 0.04em; }
.brand-hi { color: #fff2c4; text-shadow: 0 0 4px #fff, 0 0 12px var(--gold), 0 0 26px var(--gold), 0 0 44px rgba(242,193,78,0.75); }
.brand-score { color: #fff4f4; }
/* nested sub-sections (supported by arcade.js, unused for now) */
.games.subsection { margin-top: 18px; }
.section-title.sub-title { font-size: 0.85em; }
