/*
 * hey404 games — shared theme (shell + games).
 * Brand rules (hey404 brand guide): cream base, ink text/borders, ONE accent per
 * piece, lime never as text, every coloured thing contained by an ink outline,
 * hard offset shadows (blur 0), no gradients, corner radius <= 8px everywhere.
 * Display: League Spartan. Body/labels: Anonymous Pro.
 */
@import url("https://fonts.googleapis.com/css2?family=Anonymous+Pro:wght@400;700&family=League+Spartan:wght@800&display=swap");

:root {
  --paper: #fcefe3;      /* base */
  --paper-2: #f3e3d2;    /* recessed areas */
  --bone: #fffaf4;       /* window bodies, inputs */
  --ink: #14121a;        /* text, borders, shadows */
  --ink-soft: #4a4552;   /* secondary text */
  --acid: #7ee84c;       /* lime: accent fills only, never text */
  --bubble: #ff5fa2;
  --grape: #b49bff;
  --lemon: #ffd84d;
  --blaze: #ff4d17;
  --electric: #2b4bff;

  --line: 3px;
  --r: 6px;
  --shadow: 4px 4px 0 0 var(--ink);
  --shadow-lg: 8px 8px 0 0 var(--ink);
  --shadow-xl: 12px 12px 0 0 var(--ink);
  --font-display: "League Spartan", system-ui, sans-serif;
  --font-body: "Anonymous Pro", ui-monospace, monospace;
  color-scheme: light;
}

/* Graph-paper ground ("cuadrille"). */
.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(20, 18, 26, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 18, 26, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
}

.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 0.95; }
.mono { font-family: var(--font-body); }
.eyebrow { font-family: var(--font-body); font-weight: 700; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }

/* System window: the signature container. */
.window {
  position: relative;
  background: var(--bone);
  border: var(--line) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
}
.window__bar {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-bottom: var(--line) solid var(--ink);
  background: var(--wb, var(--bone));
  border-radius: calc(var(--r) - 2px) calc(var(--r) - 2px) 0 0;
  font-family: var(--font-body); font-weight: 700; font-size: 14px; color: var(--ink);
}
.window__bar i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.window__bar i:nth-child(1) { background: var(--bubble); }
.window__bar i:nth-child(2) { background: var(--lemon); }
.window__bar i:nth-child(3) { background: var(--acid); }
.window__bar span { margin-left: 8px; }

/* Buttons: flat fill, ink outline, hard shadow that "presses". */
.btn {
  --c: var(--lemon);
  appearance: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.01em; text-transform: uppercase;
  color: var(--fg, var(--ink));
  background: var(--c);
  border: var(--line) solid var(--ink);
  border-radius: var(--r);
  padding: 0.85em 1.3em 0.7em;
  box-shadow: var(--shadow);
  transition: transform 0.06s, box-shadow 0.06s;
  touch-action: manipulation;
}
.btn:active, .btn.is-down { transform: translate(4px, 4px); box-shadow: 0 0 0 0 var(--ink); }
.btn:disabled { background: var(--paper-2); color: var(--ink-soft); box-shadow: none; transform: none; cursor: default; }
.btn--ghost { --c: var(--bone); }
.btn--dark { --c: var(--ink); --fg: var(--bone); }

/* Player token: a keycap in the player's colour with their initial. */
.patch {
  --c: var(--lemon);
  --s: 56px;
  position: relative; flex: none;
  width: var(--s); height: var(--s);
  display: grid; place-items: center;
  background: var(--c);
  border: max(2px, calc(var(--s) * 0.05)) solid var(--ink);
  border-radius: max(4px, calc(var(--s) * 0.16));
  box-shadow: 0 max(3px, calc(var(--s) * 0.09)) 0 0 var(--ink);
  transition: filter 0.3s, opacity 0.3s, transform 0.3s;
}
.patch::after { /* the keycap's top face */
  content: ""; position: absolute; inset: 14% 14% 22% 14%;
  border-radius: max(3px, calc(var(--s) * 0.1));
  background: rgba(255, 255, 255, 0.28);
}
.patch__initial, .patch b {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 800;
  font-size: calc(var(--s) * 0.5); line-height: 1;
  color: var(--pt, var(--ink));
  transform: translateY(calc(var(--s) * -0.02));
}
.patch--away { filter: grayscale(1); opacity: 0.45; }

/* Chips / tags. */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  padding: 4px 10px; border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--c, var(--bone)); color: var(--ink);
}

@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } to { transform: scale(1); } }
.pop-in { animation: pop-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }

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