/* Page layout, hero and game boxes. Tokens come from theme.css. */

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

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  background-image: var(--paper-grain);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
}

:where(a):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 16px 40px;
}

/* ── Hero ───────────────────────────────────────────────── */
/* A fixed-height band keeps the game boxes at the same place however small the guns are */
.hero-frame {
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero {
  display: block;
  width: 100%;
  height: auto;
}
/* Five pairs, 85 px tall at full width: each gun, flash included, stays under half a game box */
.hero-wide { max-width: 900px; }
.hero-narrow { display: none; max-width: 300px; }

/* Phones: only the middle pair, so the guns don't shrink to icons */
@media (max-width: 479px) {
  .hero-frame { height: auto; }
  .hero-wide { display: none; }
  .hero-narrow { display: block; }
}

.gun-metal    { fill: var(--gun-metal); }
.gun-cylinder { fill: var(--gun-cylinder); }
.gun-grip     { fill: var(--gun-grip); }
.gun-line     { fill: none; stroke: var(--gun-metal); }
.flash-rim    { fill: var(--flash-rim); }
.flash-core   { fill: var(--flash-core); }
.smoke        { fill: var(--smoke); }

/* ── Games ──────────────────────────────────────────────── */
.games {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.game-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  aspect-ratio: 1;
  padding: 12px;
  background: var(--color-surface);
  border: 3px double var(--color-border-strong);
  border-radius: 4px;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
  color: var(--color-accent);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

/* Nail heads in the corners */
.game-box::before {
  content: '';
  position: absolute;
  inset: 5px;
  pointer-events: none;
  --nail: radial-gradient(circle, var(--color-border-strong) 2.5px, transparent 3px);
  background:
    var(--nail) top left / 8px 8px no-repeat,
    var(--nail) top right / 8px 8px no-repeat,
    var(--nail) bottom left / 8px 8px no-repeat,
    var(--nail) bottom right / 8px 8px no-repeat;
}

.game-box:focus-visible {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}

@media (hover: hover) {
  .game-box:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-raised);
  }
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  padding: 16px 16px 24px;
  text-align: center;
  font-size: 13px;
}
footer a { color: var(--color-text-muted); }
@media (hover: hover) {
  footer a:hover { color: var(--color-text); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
