/* ============================================================
   base.css — reset, typography, the signature background grid,
   and the CRT / old-console texture used on every page.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.4;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
  image-rendering: pixelated;
}

/* ---------- the transparent grid that sits behind everything ----------
   A faint graph-paper grid, always present, on every page (nav, login,
   games, info, community). Colors follow the active theme's --grid-line. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-gap) var(--grid-gap);
}

/* ---------- faint scanlines for the old-console feel ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.14) 0px,
    rgba(0, 0, 0, 0.14) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.5;
}

/* everything real is above the grid + scanline layers */
#page {
  position: relative;
  z-index: 2;
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
}

h1 { font-size: 28px; }
h2 { font-size: 18px; margin-bottom: 14px; }
h3 { font-size: 13px; }

p, label, input, textarea, select, button {
  font-family: var(--font-body);
}

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

button {
  cursor: pointer;
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 11px;
  padding: 10px 14px;
  letter-spacing: 1px;
  transition: transform var(--transition-speed) ease, background var(--transition-speed) ease, color var(--transition-speed) ease;
}

button:hover {
  background: var(--accent);
  color: var(--bg);
  transform: scale(1.05);
}

button:disabled {
  border-color: var(--locked);
  color: var(--locked);
  cursor: not-allowed;
}
button:disabled:hover {
  background: transparent;
  color: var(--locked);
  transform: none;
}

input, textarea, select {
  background: var(--bg-panel);
  border: 2px solid var(--fg-dim);
  color: var(--fg);
  font-size: 16px;
  padding: 8px 10px;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

/* generic pixel-bordered panel, reused by cards / windows / forms */
.panel {
  background: var(--bg-panel);
  border: 2px solid var(--fg-dim);
  box-shadow: 4px 4px 0 var(--accent-dim);
}

.small-note {
  font-size: 15px;
  color: var(--fg-dim);
}
