/* Pixelbreaks — shared theme + hub skin (PIX-6 pixel-art portal).
   styles.css is the brand seam: the hub uses the pixel-art components below,
   and every game inherits the brand palette through the legacy --pb-* tokens,
   which are remapped onto the 19-color BRAND_PALETTE. Swap a token, reskin
   everything. Pixel discipline: image-rendering:pixelated, hard-offset shadows,
   steps() transitions — no blur. */

@font-face {
  font-family: "BigBlue";
  /* Brand font (BigBlue Terminal, CC BY-SA). Drop the .ttf at /fonts/ and it
     activates everywhere; until then the monospace stack below carries it. */
  src: url("fonts/BigBlueTerm.ttf") format("truetype");
  font-display: swap;
}

:root {
  /* --- Pixelbreaks brand tokens (== pixelize.py BRAND_PALETTE, 19 colors) --- */
  --navy: #0d1026;
  --navy-2: #15182e;
  --deep-navy: #1b2244;
  --slate-d: #232a40;
  --slate: #3a4258;
  --indigo: #2c396b;
  --slateblue: #425a9e;
  --teal-d: #126e7a;
  --teal: #1fa8a8;
  --mint: #4fe3c1;
  --pale: #a9f7e6;
  --plum: #7a1f5c;
  --magenta: #c82b7d;
  --pink: #ff5d9e;
  --red-d: #b02a2a;
  --red: #ff4d3d;
  --amber: #f29e2e;
  --gold: #ffd66b;
  --white: #f5f3e6;
  --slate-text: #8a93b5;

  /* spacing scale (8px grid) */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --maxw: 1200px;

  --pb-font: "BigBlue", ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  /* --- Legacy --pb-* token seam: games read these. Remapped to brand. --- */
  --pb-bg: var(--navy);
  --pb-bg-elev: var(--deep-navy);
  --pb-bg-card: var(--slate-d);
  --pb-ink: var(--white);
  --pb-ink-dim: var(--slate-text);
  --pb-accent: var(--gold);
  --pb-accent-ink: var(--navy);
  --pb-line: var(--teal-d);
  --pb-radius: 0px;
  --pb-shadow: 5px 5px 0 #00000059;
  --pb-font-display: var(--pb-font);
  --pb-maxw: var(--maxw);
}

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

html, body {
  background: var(--navy);
  color: var(--white);
  font-family: var(--pb-font);
  -webkit-font-smoothing: none;
}

body {
  /* faint pixel-grid texture so empty navy never reads as a blank programmer bg */
  background-image:
    linear-gradient(rgba(63, 72, 98, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 72, 98, 0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  image-rendering: pixelated;
}

img { image-rendering: pixelated; }
a { color: var(--gold); text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s3); }
.eyebrow { color: var(--pink); letter-spacing: 0.18em; font-size: 15px; text-transform: uppercase; }
.muted { color: var(--slate-text); }
[hidden] { display: none !important; }

/* ---------- logo lockup (the brand atom, reused everywhere) ---------- */
.lockup { display: flex; align-items: center; gap: 12px; }
.lockup .sq { display: inline-block; width: 18px; height: 18px; }
.lockup .sq.p { background: var(--pink); }
.lockup .sq.t { background: var(--mint); margin-left: -4px; }
.lockup .word {
  font-size: 26px; letter-spacing: 0.06em; color: var(--white);
  text-shadow: 3px 3px 0 #00000080;
}

/* ---------- header bar ---------- */
.pb-top { border-bottom: 3px solid var(--teal); background: linear-gradient(180deg, #11142b, #0d1026); }
.header-in { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.tag { color: var(--slate-text); font-size: 14px; letter-spacing: 0.04em; margin-top: 4px; }
.cadence {
  display: flex; align-items: center; gap: 10px; border: 2px solid var(--teal-d);
  background: #0e213a; padding: 8px 14px; color: var(--mint); font-size: 14px; letter-spacing: 0.08em;
}
.cadence .dot { width: 10px; height: 10px; background: var(--pink); box-shadow: 0 0 0 3px #ff5d9e30; }

/* ---------- featured / hero (ties hub to the share-card identity) ---------- */
.hero { padding: var(--s5) 0 var(--s4); }
.feature { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--s4); align-items: stretch; }
.feature .copy { display: flex; flex-direction: column; justify-content: center; }
.feature h1 {
  font-size: 62px; line-height: 0.96; letter-spacing: 0.01em; color: var(--white);
  text-shadow: 5px 5px 0 #12061880; margin: 14px 0 0; text-transform: uppercase;
}
.feature .meta { color: var(--mint); font-size: 18px; letter-spacing: 0.04em; margin-top: 18px; line-height: 1.5; }
.feature .meta b { color: var(--gold); font-weight: normal; }
.rule { height: 8px; width: 300px; max-width: 100%; background: var(--amber); margin: 22px 0 26px; }
.play {
  display: inline-flex; align-items: center; gap: 14px; align-self: flex-start;
  background: var(--red); border: 3px solid var(--gold); color: var(--white);
  font-size: 22px; letter-spacing: 0.06em; padding: 14px 26px; cursor: pointer;
  box-shadow: 6px 6px 0 #00000066; text-decoration: none;
}
.play:hover { color: var(--white); }
.play .tri {
  width: 0; height: 0; border-left: 18px solid var(--white);
  border-top: 11px solid transparent; border-bottom: 11px solid transparent;
}

/* the featured art = a framed pixel scene (latest game's share-scene) */
.shot { position: relative; border: 4px solid var(--teal); background: var(--deep-navy); box-shadow: 8px 8px 0 #00000066; overflow: hidden; min-height: 300px; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, #00000026 0 2px, transparent 2px 4px); }
.shot .ribbon { position: absolute; top: 14px; left: -2px; background: var(--magenta); color: var(--white); font-size: 14px; letter-spacing: 0.08em; padding: 6px 16px; box-shadow: 4px 4px 0 #00000059; }
.shot .now { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, transparent, #0d1026e6); padding: 18px 16px 12px; font-size: 14px; color: var(--pale); letter-spacing: 0.06em; }

/* ---------- section header ---------- */
.section-h { display: flex; align-items: baseline; gap: 16px; margin: var(--s5) 0 var(--s3); }
.section-h h2 { font-size: 24px; letter-spacing: 0.10em; color: var(--white); }
.section-h .count { color: var(--gold); font-size: 16px; }
.section-h .line { flex: 1; height: 3px; background: var(--slate-d); position: relative; top: -4px; }

/* ---------- the GAME GRID + TILE SPEC ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.tile {
  background: var(--deep-navy); border: 3px solid var(--teal-d); box-shadow: 5px 5px 0 #00000059;
  display: flex; flex-direction: column; transition: transform 0.08s steps(2), border-color 0.08s steps(2);
  cursor: pointer; text-decoration: none; color: inherit;
}
.tile .thumb { position: relative; aspect-ratio: 600 / 315; overflow: hidden; border-bottom: 3px solid var(--teal-d); background: var(--slate-d); }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .thumb .scan { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, #0000001f 0 2px, transparent 2px 4px); }
.tile .best { position: absolute; top: 10px; right: 10px; background: var(--navy); border: 2px solid var(--gold); color: var(--gold); font-size: 13px; letter-spacing: 0.06em; padding: 4px 10px; }
.tile .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tile .title { font-size: 19px; color: var(--white); letter-spacing: 0.03em; }
.tile .row { display: flex; justify-content: space-between; align-items: center; color: var(--slate-text); font-size: 13px; letter-spacing: 0.04em; margin-top: auto; gap: 12px; }
.tile .row .plays { color: var(--teal); text-align: right; }
.tile .overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #0d1026b3; opacity: 0; transition: opacity 0.08s steps(2); }
.tile .overlay span { display: inline-flex; align-items: center; gap: 10px; color: var(--white); font-size: 18px; letter-spacing: 0.08em; border: 3px solid var(--gold); background: var(--red); padding: 10px 20px; box-shadow: 4px 4px 0 #00000066; }
.tile .overlay .tri { width: 0; height: 0; border-left: 14px solid var(--white); border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.tile:hover, .tile:focus-visible { transform: translate(-3px, -3px); border-color: var(--mint); outline: none; }
.tile:hover .overlay, .tile:focus-visible .overlay { opacity: 1; }

/* COMING-FRIDAY tile = in-grid placeholder before a launch */
.tile.coming { background: repeating-linear-gradient(135deg, #141a30 0 14px, #10152a 14px 28px); border: 3px dashed var(--teal-d); box-shadow: none; cursor: default; }
.tile.coming:hover { transform: none; border-color: var(--teal-d); }
.tile.coming .thumb { background: transparent; border-bottom: 3px dashed var(--teal-d); display: flex; align-items: center; justify-content: center; }
.tile.coming .cal { font-size: 40px; color: var(--slate); line-height: 1; }
.tile.coming .body { align-items: center; text-align: center; gap: 6px; justify-content: center; }
.tile.coming .drops { color: var(--mint); font-size: 15px; letter-spacing: 0.10em; }
.tile.coming .sub { color: var(--slate-text); font-size: 13px; }

/* ---------- loading skeleton + empty/error state ---------- */
.skel { background: var(--deep-navy); border: 3px solid var(--slate-d); box-shadow: 5px 5px 0 #00000059; display: flex; flex-direction: column; overflow: hidden; }
.skel .sthumb { aspect-ratio: 600 / 315; background: linear-gradient(100deg, #232a40 30%, #3a4258 50%, #232a40 70%); background-size: 300% 100%; animation: sh 1.1s steps(8) infinite; }
.skel .sbar { height: 16px; margin: 14px 16px 0; background: var(--slate-d); }
.skel .sbar.short { width: 55%; margin-bottom: 16px; }
@keyframes sh { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.emptybox { grid-column: 1 / -1; border: 3px dashed var(--teal-d); background: #10152a; text-align: center; padding: var(--s5) var(--s3); }
.emptybox .big { font-size: 40px; color: var(--slate); margin-bottom: 14px; }
.emptybox h3 { font-size: 22px; color: var(--white); letter-spacing: 0.06em; }
.emptybox p { color: var(--slate-text); font-size: 15px; margin-top: 10px; letter-spacing: 0.04em; line-height: 1.5; }
.emptybox.error { border-color: var(--red-d); }
.emptybox.error .big, .emptybox.error h3 { color: var(--red); }

/* ---------- footer ---------- */
.pb-footer { border-top: 3px solid var(--teal-d); margin-top: var(--s6); background: #0b0e20; }
.foot-in { display: flex; align-items: center; justify-content: center; gap: 14px; height: 80px; color: var(--slate-text); font-size: 14px; letter-spacing: 0.06em; text-align: center; flex-wrap: wrap; padding: 16px; }
.foot-in .url { color: var(--amber); }

/* ---------- responsive: single column on mobile ---------- */
@media (max-width: 680px) {
  .wrap { padding: 0 var(--s2); }
  .header-in { height: auto; padding: 14px 0; flex-direction: column; gap: 12px; align-items: flex-start; }
  .feature { grid-template-columns: 1fr; gap: var(--s3); }
  .feature h1 { font-size: 42px; }
  .grid { grid-template-columns: 1fr; }
  .section-h { flex-wrap: wrap; gap: 8px; }
  .section-h .count { font-size: 14px; }
  .section-h .line { display: none; }
}
