:root {
  /* zTrivia palette — derived from the trivia game splash:
     magenta/purple stage + teal cyan CTA + white text. */
  --bg-0: #120819;
  --bg-1: #1c0e26;
  --surface: #2a1432;
  --surface-2: #38183f;
  --accent: #2dd4bf;        /* teal cyan from in-game CTA */
  --accent-bright: #5eead4;
  --accent-glow: rgba(45, 212, 191, 0.45);
  --magenta: #c026d3;       /* zTrivia magenta highlight */
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.72);
  --text-faint: rgba(255, 255, 255, 0.45);
  --shadow-tile: 0 18px 40px rgba(0, 0, 0, 0.45),
                 0 2px 6px rgba(0, 0, 0, 0.35);

  --header-h: 84px;
  --footer-h: 40px;
  --page-pad-x: 32px;
  --page-pad-y: 18px;
  --gap: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(192, 38, 211, 0.25), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(45, 212, 191, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  overflow: hidden; /* enforce no-scroll above-the-fold */
}

/* ---------- header ---------- */
.site-header {
  height: var(--header-h);
  flex: 0 0 auto;
  padding: 0 var(--page-pad-x);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-family: 'Fredoka', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

.brand-word {
  background: linear-gradient(180deg, #ffffff, #d4b5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-plus {
  color: var(--accent);
  font-size: 0.9em;
  margin-left: 2px;
  text-shadow: 0 0 18px var(--accent-glow);
}

.tagline {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.2px;
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---------- main stage ---------- */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: var(--gap);
  padding: 0 var(--page-pad-x) var(--page-pad-y);
  align-items: stretch;
  justify-content: center;
}

/* Tile base */
.tile {
  position: relative;
  display: block;
  height: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-tile);
  text-decoration: none;
  color: var(--text);
  transition:
    transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 240ms ease,
    outline-color 240ms ease;
  outline: 1px solid rgba(255, 255, 255, 0.06);
  outline-offset: 0;
  isolation: isolate;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.tile-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.55) 55%,
    rgba(0, 0, 0, 0.85) 100%);
  pointer-events: none;
}

.tile-name {
  font-family: 'Fredoka', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.1px;
  line-height: 1.1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.tile-sub {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.tile-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #04222a;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* Hero tile (Ziosk Trivia) */
.tile--hero {
  border-radius: 22px;
}
.tile--hero .tile-name { font-size: 24px; }
.tile--hero .tile-sub  { font-size: 13px; }
.tile--hero .tile-overlay { padding: 28px 22px 20px; gap: 6px; }
.tile--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.35);
}

/* Sub grid: 3 cols x 2 rows */
.subs {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, auto);
  grid-template-rows: repeat(2, 1fr);
  gap: var(--gap);
  min-width: 0;
}

.subs .tile {
  height: 100%;
}

/* Hover / focus */
.tile:hover,
.tile:focus-visible {
  transform: translateY(-4px);
  outline-color: var(--accent);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.55),
    0 0 0 1px var(--accent),
    0 0 30px var(--accent-glow);
}
.tile:focus-visible { outline-width: 2px; }

/* ---------- footer ---------- */
.site-footer {
  height: var(--footer-h);
  flex: 0 0 auto;
  padding: 0 var(--page-pad-x);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.2px;
}

.site-footer .dot { opacity: 0.5; }

/* ---------- responsive: small screens get vertical scroll ---------- */
@media (max-width: 900px), (max-height: 640px) {
  body { overflow: auto; }
  .stage {
    flex-direction: column;
    align-items: center;
    height: auto;
    padding-bottom: 32px;
  }
  .tile, .tile--hero {
    height: auto;
    width: min(86vw, 360px);
  }
  .subs {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    width: min(86vw, 360px);
  }
  .subs .tile { width: 100%; height: auto; }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding-top: 14px;
    padding-bottom: 14px;
    height: auto;
  }
  .tagline { border-left: 0; padding-left: 0; }
}
