/* GamesArsenal — retro CRT arcade shell */
:root {
  --bg: #05080a;
  --bg-elev: #0b1210;
  --panel: #0e1714;
  --ink: #d7ffe8;
  --muted: #7aa88e;
  --neon: #39ff14;
  --cyan: #00f0ff;
  --mag: #ff2bd6;
  --amber: #ffb000;
  --bezel: #121a16;
  --danger: #ff3b6b;
  --shadow: 0 0 18px rgba(57, 255, 20, 0.28);
  --font-pixel: "Press Start 2P", "IBM Plex Mono", ui-monospace, monospace;
  --font-ui: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --cabinet-min-h: 640px;
}

html[data-theme="dim"] {
  --bg: #10140f;
  --bg-elev: #171d16;
  --panel: #1b2319;
  --ink: #e8f5ea;
  --neon: #7cff6a;
  --cyan: #7defff;
  --shadow: 0 0 10px rgba(124, 255, 106, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.45;
  background-image:
    radial-gradient(ellipse at top, rgba(57, 255, 20, 0.08), transparent 42%),
    linear-gradient(180deg, #05080a 0%, #07140e 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  opacity: 0.09;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55) 0px,
    rgba(0, 0, 0, 0.55) 1px,
    transparent 1px,
    transparent 3px
  );
}

html[data-scanlines="off"] body::before {
  display: none;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: var(--neon);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--neon);
  color: #041006;
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 22px;
  background: rgba(5, 8, 10, 0.92);
  border-bottom: 1px solid rgba(57, 255, 20, 0.28);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-name {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--neon);
  text-shadow: var(--shadow);
}

.brand-tag {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hdr-btn {
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1.2;
  padding: 10px 12px;
  border: 1px solid rgba(0, 240, 255, 0.45);
  background: var(--panel);
  color: var(--cyan);
  cursor: pointer;
  min-height: 40px;
}

.hdr-btn[aria-pressed="true"] {
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: var(--shadow);
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 36px 0 12px;
}

.hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-pixel);
  font-size: clamp(16px, 3vw, 26px);
  line-height: 1.5;
  color: var(--neon);
  text-shadow: var(--shadow);
}

.hero p {
  margin: 0 0 18px;
  max-width: 62ch;
  color: var(--muted);
}

.kicker {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--cyan);
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.12em;
  margin: 28px 0 14px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  padding-bottom: 40px;
}

.game-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(57, 255, 20, 0.08), transparent 40%),
    var(--bg-elev);
  border: 1px solid rgba(57, 255, 20, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.12), var(--shadow);
  position: relative;
}

.game-card:hover,
.game-card:focus-within {
  border-color: var(--cyan);
}

.pixel-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 6px 8px;
  color: #041006;
  background: var(--neon);
}

.game-card h2 {
  margin: 28px 0 8px;
  font-family: var(--font-pixel);
  font-size: 13px;
  line-height: 1.45;
}

.game-card p {
  margin: 0 0 16px;
  color: var(--muted);
  flex: 1;
}

.card-meta {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.play-btn,
.fav-btn {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 12px 14px;
  border: 0;
  cursor: pointer;
  min-height: 44px;
}

.play-btn {
  background: var(--neon);
  color: #041006;
  flex: 1;
}

.play-btn:hover {
  background: var(--cyan);
}

.fav-btn {
  background: transparent;
  color: var(--amber);
  border: 1px solid rgba(255, 176, 0, 0.5);
  min-width: 52px;
}

.fav-btn[aria-pressed="true"] {
  background: var(--amber);
  color: #1a1200;
}

.site-footer {
  border-top: 1px solid rgba(57, 255, 20, 0.22);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 15px;
}

.site-footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.site-footer nav a {
  white-space: normal;
}

.site-footer .disclaimer {
  max-width: 72ch;
  margin: 12px 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

/* Play page */
.play-shell {
  padding: 18px 0 40px;
}

.play-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.back-link {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--cyan);
}

.play-title {
  font-family: var(--font-pixel);
  font-size: clamp(12px, 2.2vw, 16px);
  color: var(--neon);
  margin: 0;
}

.cabinet-safe {
  /* Keep display ads ≥50px from the playable iframe (plus 12px bezel inset). */
  max-width: 1032px;
  margin: 0 auto;
  padding: 56px;
}

.cabinet {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  background: var(--bezel);
  border: 2px solid rgba(57, 255, 20, 0.4);
  /* Reserved size prevents CLS; iframe fills this box */
  aspect-ratio: var(--game-aspect, 3 / 4);
  min-height: var(--cabinet-min-h);
  height: auto;
}

.cabinet-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.game-frame {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  border: 0;
  background: #000;
  z-index: 1;
}

.play-copy {
  max-width: 920px;
  margin: 8px auto 0;
  color: var(--muted);
}

.play-copy h2 {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--amber);
  line-height: 1.7;
}

.play-copy h3 {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--cyan);
  margin-top: 22px;
  line-height: 1.7;
}

.play-copy p {
  margin: 0 0 12px;
}

.legal {
  padding: 32px 0 64px;
  max-width: 72ch;
}

.legal h1 {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--neon);
  line-height: 1.6;
}

.legal h2 {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--amber);
  line-height: 1.7;
  margin-top: 28px;
}

.legal h3 {
  font-size: 1.05rem;
  color: var(--cyan);
  margin-top: 18px;
}

.legal p,
.legal li {
  margin: 0 0 12px;
}

.legal ul {
  padding-left: 1.2em;
}

.error-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 16px;
}

.error-page h1 {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--danger);
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  :root {
    --cabinet-min-h: 480px;
  }

  .cabinet-safe {
    padding: 56px 8px;
  }

  .brand-tag {
    display: none;
  }
}
