/*
 * styles.css — all styling for the hub.
 *
 * Set dressing is carried over unchanged from the games it links to
 * (DevilsHeavy13, DevilsRoulette, MemoryPoker, WallGo2): one overhead light on
 * a concrete cell wall, dark slabs bolted to it with a gold hairline, purple
 * for game furniture, gold for anything you act on, engraved Cinzel caps for
 * names and numbers, Zilla Slab for prose.
 *
 * The page reads as a noticeboard in a cell block, lit like a match-select
 * screen: the wall is the page, each game is a slab screwed to it, and the
 * roster ends on an empty slab because it is not finished. The arcade layer
 * (scanlines, vignette, glow, the spotlight that tracks the cursor) is light
 * and set dressing only — it adds no copy and no controls to the page.
 *
 * used_by: index.html
 * related: ui.js (builds .slab cards from games.js into #roster)
 * rules:
 *   - Mobile-first at ~380px. Every tappable control is at least 44px.
 *   - Colour has one meaning each: gold = act on this, purple = furniture,
 *     green = live, cream = text on a slab, dark ink = text on the wall.
 *   - Every name and number is Cinzel. Body face is for prose only.
 *   - Fonts are local files in fonts/. No url() to another origin, ever.
 *   - This page scrolls (unlike the games, which are one screen each).
 *   - Text is not selectable anywhere (house rule across all the sites);
 *     form fields are the only exception.
 *   - All motion is behind prefers-reduced-motion, including the idle
 *     flicker and the cursor spotlight.
 * wiki: README.md
 */

@font-face { font-family: "Cinzel"; font-weight: 400 700; font-style: normal; font-display: swap; src: url("fonts/cinzel-latin.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/zilla-slab-400.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/zilla-slab-600.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/zilla-slab-700.woff2") format("woff2"); }

:root {
  /* Concrete. One bulb, a long way up, and the dark takes the rest. */
  --wall-lit: #827f79;
  --wall-mid: #55534f;
  --wall-dark: #322f2d;
  --wall-deep: #141312;

  /* Ink on the wall */
  --ink: #16120f;
  --ink-soft: #2c2622;
  --ink-faint: #453f39;

  /* Slabs laid on the wall */
  --slab: #1c1917;
  --slab-deep: #121110;
  --slab-bg: linear-gradient(180deg, rgba(38, 34, 32, 0.95), rgba(17, 16, 15, 0.97));
  --line: rgba(240, 220, 164, 0.2);
  --line-soft: rgba(240, 220, 164, 0.1);
  --cream: #d6cec2;
  --mute: #9c948a;
  --stock: #fbf9f4;

  /* Purple: the game furniture */
  --purple-900: #2d1245;
  --purple-700: #4a1d73;
  --purple-600: #5f2a94;
  --purple-500: #7634b4;
  --purple-400: #8a46c9;
  --purple-300: #ad7ae0;
  --purple-100: #e4d4f5;

  /* Gold: you, and anything you act on */
  --gold-600: #9c7628;
  --gold-500: #c6992f;
  --gold-400: #d9b254;
  --gold-200: #f0dca4;

  --green: #5cc487;
  --green-deep: #1f6a43;
  --red: #d8604f;

  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Zilla Slab", Rockwell, Georgia, serif;
  --turn: 0.75s;
  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
  --ease-snap: cubic-bezier(0.34, 1.46, 0.5, 1);
  --shadow-slab: 0 24px 48px -24px rgba(0, 0, 0, 0.9), 0 4px 10px -6px rgba(0, 0, 0, 0.7);
  --glow-gold: 0 0 18px rgba(217, 178, 84, 0.35);
  --glow-purple: 0 0 24px rgba(138, 70, 201, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  /* Nothing on this page is meant to be selected or long-pressed: it is an
     app surface, not a document. Fields stay selectable (rule below) so a
     form added later does not break. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 100svh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cream);
  background-color: var(--wall-dark);
  /* One overhead light on a concrete wall. */
  background-image:
    /* A purple bloom in the dark, well under the concrete. */
    radial-gradient(90% 55% at 50% 118%, rgba(74, 29, 115, 0.5), transparent 70%),
    radial-gradient(110% 60% at 50% -4%, var(--wall-lit) 0%, var(--wall-mid) 30%, var(--wall-dark) 58%, var(--wall-deep) 88%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Concrete grain, lifted from the games so the surfaces match. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(2%, 1%); }
}

/* CRT scanlines — the screen the match is being selected on. */
.scan {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.3;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.4) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: multiply;
}

/* Darkened edges, so the light overhead reads as the only light. */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(95% 72% at 50% 4%, transparent 26%, rgba(0, 0, 0, 0.5) 62%, rgba(0, 0, 0, 0.88) 100%);
}

/* Bars across the top of the wall, as in Memory Poker's set dressing. */
.bars {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)),
    repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 34px);
  opacity: 0.55;
}

button, input { font: inherit; color: inherit; }
/* The one exception: anything the visitor types into. */
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
h1, h2, h3, p { margin: 0; }
img, svg { display: block; max-width: 100%; }

a { color: var(--gold-200); }

.shell {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
}

/* Skip link — the roster is the point of the page. */
.skip {
  position: absolute;
  left: 20px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--slab-deep);
  border: 1px solid var(--line);
  color: var(--gold-200);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 20px; }

/* ============================================================
   Hero — engraved on the lit part of the wall, no slab.
   ============================================================ */

.hero {
  padding: 84px 0 54px;
  text-align: center;
}

.eyebrow {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #c9bfb1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

.wordmark {
  margin: 14px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 11vw, 86px);
  line-height: 0.96;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  /* Lit from above: a pale face with the shadow falling below it. */
  color: #e8dfd0;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14),
    0 2px 3px rgba(0, 0, 0, 0.75),
    0 14px 40px rgba(0, 0, 0, 0.6);
}
.wordmark .thin {
  display: block;
  font-size: 0.38em;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: #c7bcaa;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

/* A gold rule with a diamond, the same mark the games use as a divider. */
.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 26px auto 0;
  max-width: 300px;
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-600), transparent);
}
.rule span {
  width: 9px;
  height: 9px;
  background: var(--gold-500);
  transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   Roster — one slab per game.
   ============================================================ */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
}
.section-head h2 {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #a59a8c;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}
.section-head::after {
  content: "";
  flex: 1 1 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-600), transparent);
}

.roster {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .roster { grid-template-columns: repeat(2, 1fr); }
}

.slab {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--slab-bg);
  background-color: var(--slab);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-slab);
  /* Bolted on: the hairline reads as an inlay, not a border. */
  outline: 1px solid rgba(0, 0, 0, 0.5);
  outline-offset: 2px;
  overflow: hidden;
  transition: transform var(--turn) var(--ease), box-shadow var(--turn) var(--ease), border-color var(--turn) var(--ease);
}

/* The cursor spotlight. --mx/--my are written by ui.js on pointermove. */
.slab > * { position: relative; z-index: 1; }
.slab {
  background-image:
    radial-gradient(
      220px 220px at var(--mx, -999px) var(--my, -999px),
      rgba(217, 178, 84, 0.13),
      transparent 70%
    ),
    var(--slab-bg);
}

.slab:hover,
.slab:focus-within {
  transform: translateY(-3px);
  border-color: rgba(240, 220, 164, 0.42);
  box-shadow: 0 30px 56px -22px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(240, 220, 164, 0.08), var(--glow-purple);
}

/* Four corner bolts, drawn rather than imaged. */
.slab::before,
.slab::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold-600);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  z-index: 2;
}
.slab::before { top: 8px; left: 8px; }
.slab::after { top: 8px; right: 8px; }

/* Match number, stencilled large and faint in the corner. */
.slab-no {
  position: absolute;
  top: 6px;
  right: 14px;
  font-family: var(--display);
  font-size: 58px;
  font-weight: 700;
  line-height: 1;
  color: rgba(240, 220, 164, 0.07);
  letter-spacing: -0.02em;
  user-select: none;
}

.slab-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.plaque {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 6px 14px -8px rgba(0, 0, 0, 0.9);
  transition: transform var(--turn) var(--ease-snap), box-shadow var(--turn) var(--ease);
}
.slab:hover .plaque {
  transform: scale(1.05) rotate(-1.5deg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 22px -4px rgba(138, 70, 201, 0.55);
}
.plaque img { width: 100%; height: 100%; }

.slab-title { min-width: 0; }

.slab h3 {
  font-family: var(--display);
  font-size: clamp(22px, 5.4vw, 28px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gold-200);
  transition: text-shadow var(--turn) var(--ease);
}
.slab:hover h3 { text-shadow: var(--glow-gold); }

.from {
  margin-top: 6px;
  font-size: 13px;
  font-style: italic;
  color: var(--mute);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 9px;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge[data-status="dev"] {
  color: var(--purple-300);
  border: 1px solid rgba(173, 122, 224, 0.35);
  background: rgba(74, 29, 115, 0.3);
}
.badge[data-status="dev"]::before { background: var(--purple-400); box-shadow: 0 0 8px rgba(138, 70, 201, 0.8); }

.hook {
  margin: 18px 0 0;
  color: var(--cream);
  font-size: 15px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  padding: 5px 9px;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-100);
  background: var(--purple-900);
  border: 1px solid rgba(118, 52, 180, 0.4);
  transition: border-color var(--turn) var(--ease), box-shadow var(--turn) var(--ease);
}
.slab:hover .facts li {
  border-color: rgba(173, 122, 224, 0.6);
  box-shadow: inset 0 0 14px -6px rgba(173, 122, 224, 0.8);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 24px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--gold-600);
  overflow: hidden;
  transition: background var(--turn) var(--ease), color var(--turn) var(--ease),
              transform 0.14s var(--ease), box-shadow var(--turn) var(--ease);
}
.btn:active { transform: translateY(1px); }

/* The chevron that says this one goes somewhere. */
.btn-play::after {
  content: "▸";
  font-size: 13px;
  line-height: 1;
  transition: transform var(--turn) var(--ease-snap);
}
.btn-play:hover::after { transform: translateX(3px); }

.btn-play {
  color: var(--slab-deep);
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  border-color: var(--gold-200);
  box-shadow: 0 6px 16px -10px rgba(217, 178, 84, 0.9);
}
.btn-play:hover {
  background: linear-gradient(180deg, var(--gold-200), var(--gold-400));
  box-shadow: 0 6px 20px -8px rgba(217, 178, 84, 0.9), var(--glow-gold);
}

/* A light sweeps across the button on hover. Decoration, behind the label. */
.btn-play::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s var(--ease);
}
.btn-play:hover::before { left: 115%; }

.btn-off {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.45);
  box-shadow: none;
}
.btn-off:hover {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  box-shadow: none;
}
.btn-off::before { display: none; }
.btn-off:hover::after { transform: none; }

.btn-ghost {
  color: var(--gold-200);
  background: transparent;
}
.btn-ghost:hover { background: rgba(240, 220, 164, 0.1); }

.note {
  align-self: center;
  font-size: 13px;
  font-style: italic;
  color: var(--mute);
}

/* The empty slab that ends the roster. */
.slab-next {
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 220px;
  background: rgba(26, 24, 22, 0.5);
  background-image: none;
  border: 1px dashed rgba(240, 220, 164, 0.3);
  outline: none;
  box-shadow: none;
}
.slab-next::before, .slab-next::after { display: none; }
.slab-next:hover { transform: none; border-color: rgba(240, 220, 164, 0.5); box-shadow: none; }
.slab-next .mark {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  color: var(--gold-600);
  letter-spacing: 0.1em;
}
.slab-next h3 { margin-top: 10px; color: var(--mute); font-size: 20px; }
.slab-next p { margin-top: 10px; max-width: 32ch; font-size: 14px; color: var(--mute); }

/* ============================================================
   Footer
   ============================================================ */

.foot {
  margin-top: 64px;
  padding: 26px 22px;
  background: var(--slab-bg);
  background-color: var(--slab);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-slab);
  font-size: 15px;
  line-height: 1.6;
  color: var(--cream);
  text-align: center;
}
.foot p + p { margin-top: 10px; }
.foot a { color: var(--gold-200); text-decoration-color: var(--gold-600); }
.foot a:hover { color: var(--stock); }

/* ============================================================
   Load-in: the slabs drop onto the wall in order.
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: drop 0.62s var(--ease) forwards;
    animation-delay: var(--delay, 0s);
  }
  @keyframes drop {
    to { opacity: 1; transform: translateY(0); }
  }

  /* The overhead light is not a new bulb: one slow dip, rarely. Anything
     faster than this reads as a fault in the page, not in the room. */
  .vignette { animation: flicker 16s ease-in-out infinite; }
  @keyframes flicker {
    0%, 88%, 100% { opacity: 1; }
    94% { opacity: 0.93; }
  }
}
