/* ========================================================================== */
/* Matt Makes Those — Shared/Home Styles                                      */
/* ========================================================================== */

:root {
  --bg: #090d16;
  --panel: #0e1520;
  --panel2: #0b1018;
  --panel3: #121c2a;
  --line: #1d2e48;
  --line-soft: rgba(141, 170, 210, 0.14);
  --accent: #3b8eff;
  --accent-strong: #67a8ff;
  --teal: #38d4b8;
  --pink: #d438a2;
  --text: #dde6f8;
  --text-strong: #f7fbff;
  --mute: #8ca0c0;
  --hint: #5a7898;
  --danger: #e05050;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --header-h: 64px;
}

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

html {
  min-height: 100%;
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-top: var(--header-h);
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse 80% 50% at 16% -10%, rgba(59, 142, 255, 0.10) 0%, transparent 62%),
    radial-gradient(ellipse 60% 42% at 90% 8%, rgba(56, 212, 184, 0.07) 0%, transparent 58%),
    radial-gradient(ellipse 58% 45% at 50% 115%, rgba(212, 56, 162, 0.055) 0%, transparent 62%),
    linear-gradient(180deg, #090d16 0%, #070a11 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, black 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 0%, black 0%, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.09;
  mix-blend-mode: overlay;
}

img,
video,
canvas,
svg,
iframe { max-width: 100%; }

a { color: inherit; }

button,
input,
textarea,
select { font: inherit; }

button { cursor: pointer; }

/* ========================================================================== */
/* Header / Navigation                                                        */
/* ========================================================================== */

header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: var(--header-h);
  z-index: 1000;
  background: rgba(9, 13, 22, 0.88);
  border-bottom: 1px solid rgba(29, 46, 72, 0.9);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: saturate(130%) blur(10px);
  backdrop-filter: saturate(130%) blur(10px);
}

.nav {
  width: 100%;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  font-size: 0.9rem;
}

.nav a {
  color: var(--mute);
  text-decoration: none;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s;
  white-space: nowrap;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text-strong);
}

.nav > a:first-child {
  position: relative;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: 0.2rem;
}

.nav > a:first-child::after,
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  opacity: 0;
  transform: scaleX(0.7);
  transition: opacity 0.18s, transform 0.18s;
}

.nav a[aria-current="page"] { position: relative; }
.nav a[aria-current="page"]::after { opacity: 1; transform: scaleX(1); }

.nav a.nav-maker,
.donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 36px;
  padding: 0.42rem 0.72rem;
  color: var(--text);
  background: rgba(59, 142, 255, 0.08);
  border: 1px solid rgba(59, 142, 255, 0.25);
  border-radius: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav a.nav-maker:hover,
.donate-btn:hover {
  color: var(--text-strong);
  background: rgba(59, 142, 255, 0.16);
  border-color: rgba(59, 142, 255, 0.52);
  transform: translateY(-1px);
}

.nav a.nav-maker[aria-current="page"] {
  background: rgba(59, 142, 255, 0.18);
  border-color: rgba(59, 142, 255, 0.55);
  color: var(--accent-strong);
}

.donate-btn {
  margin-left: auto;
  background: rgba(56, 212, 184, 0.08);
  border-color: rgba(56, 212, 184, 0.25);
}

.donate-btn:hover {
  background: rgba(56, 212, 184, 0.15);
  border-color: rgba(56, 212, 184, 0.5);
}

.donate-btn + .account-area { margin-left: 0; }

/* ── Nav Dropdowns ─────────────────────────────────────────────── */

.nav-group {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.42rem 0.72rem;
  color: var(--text);
  background: rgba(59, 142, 255, 0.08);
  border: 1px solid rgba(59, 142, 255, 0.25);
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.nav-group-btn:hover,
.nav-group:focus-within .nav-group-btn {
  color: var(--text-strong);
  background: rgba(59, 142, 255, 0.16);
  border-color: rgba(59, 142, 255, 0.52);
}

/* Group whose current page is inside it */
.nav-group.has-current .nav-group-btn {
  background: rgba(59, 142, 255, 0.18);
  border-color: rgba(59, 142, 255, 0.55);
  color: var(--accent-strong);
}

/* Games dropdown — gold/green accent */
.nav-group.nav-games .nav-group-btn {
  background: rgba(56, 212, 184, 0.08);
  border-color: rgba(56, 212, 184, 0.28);
  color: var(--teal);
}

.nav-group.nav-games .nav-group-btn:hover,
.nav-group.nav-games:focus-within .nav-group-btn {
  background: rgba(56, 212, 184, 0.16);
  border-color: rgba(56, 212, 184, 0.55);
  color: #ecfeff;
}

.nav-group.nav-games.has-current .nav-group-btn {
  background: rgba(56, 212, 184, 0.18);
  border-color: rgba(56, 212, 184, 0.6);
  color: #a7f3d0;
}

.nav-chevron {
  font-size: 0.7rem;
  opacity: 0.65;
  transition: transform 0.18s, opacity 0.18s;
  flex-shrink: 0;
  display: inline-block;
}

.nav-group:hover .nav-chevron,
.nav-group:focus-within .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-group-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: rgba(9, 13, 22, 0.97);
  border: 1px solid rgba(59, 142, 255, 0.28);
  border-radius: 12px;
  padding: 0.4rem;
  z-index: 2000;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  flex-direction: column;
  gap: 2px;
  animation: navMenuIn 0.14s ease-out;
}

@keyframes navMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-group:hover .nav-group-menu,
.nav-group:focus-within .nav-group-menu {
  display: flex;
}

.nav-group-menu a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 0.14s, color 0.14s;
}

.nav-group-menu a:hover {
  background: rgba(59, 142, 255, 0.12);
  color: var(--text-strong);
}

.nav-group-menu a[aria-current="page"] {
  background: rgba(59, 142, 255, 0.18);
  color: var(--accent-strong);
}

/* Games dropdown menu uses teal accent */
.nav-group.nav-games .nav-group-menu {
  border-color: rgba(56, 212, 184, 0.28);
}

.nav-group.nav-games .nav-group-menu a:hover {
  background: rgba(56, 212, 184, 0.12);
  color: #ecfeff;
}

.nav-group.nav-games .nav-group-menu a[aria-current="page"] {
  background: rgba(56, 212, 184, 0.18);
  color: #a7f3d0;
}

/* ── The People's Tower game link special treatment ─────────────── */
.nav-peoples-tower {
  position: relative;
  overflow: hidden;
}

.nav-peoples-tower::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(56,212,184,0.08), rgba(59,142,255,0.06));
  border-radius: inherit;
}

.nav-peoples-tower .nav-pt-label {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-peoples-tower .nav-pt-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-strong);
}

.nav-peoples-tower .nav-pt-sub {
  font-size: 0.68rem;
  color: var(--teal);
  letter-spacing: 0.03em;
}

/* ── End Nav Dropdowns ──────────────────────────────────────────── */

.account-area {
  margin-left: auto;
  position: relative;
  flex-shrink: 0;
}

.account-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.16s;
}

.account-btn:hover {
  color: var(--accent-strong);
  border-color: rgba(59, 142, 255, 0.55);
  background: rgba(59, 142, 255, 0.10);
}

.account-btn .acct-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.account-btn.logged-in {
  color: var(--accent-strong);
  background: rgba(59, 142, 255, 0.10);
  border-color: rgba(59, 142, 255, 0.42);
}

.account-btn.logged-in:hover { background: rgba(59, 142, 255, 0.16); }
.account-btn .acct-chevron { font-size: 0.65rem; opacity: 0.7; }

.account-dropdown {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 200;
  min-width: 210px;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
}

.account-dropdown.open { display: flex; }

.account-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: var(--panel2);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}

.account-dropdown .dd-header {
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.account-dropdown .dd-header .dd-label {
  color: var(--hint);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-dropdown .dd-header .dd-username {
  margin-top: 0.12rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  word-break: break-all;
}

.account-dropdown .dd-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.58rem 0.75rem;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 8px;
  text-align: left;
  font-size: 0.88rem;
  transition: background 0.12s, color 0.12s;
}

.account-dropdown .dd-item:hover {
  color: var(--accent-strong);
  background: rgba(59, 142, 255, 0.10);
}

.account-dropdown .dd-item.danger:hover {
  color: #ff8484;
  background: rgba(224, 80, 80, 0.11);
}

/* ========================================================================== */
/* Shared Buttons / Auth Modal                                                */
/* ========================================================================== */

button.primary,
button.secondary {
  min-height: 42px;
  border-radius: 9px;
  padding: 0.62rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.15s, border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}

button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #256fd1);
  border: 1px solid rgba(103, 168, 255, 0.55);
  box-shadow: 0 8px 24px rgba(59, 142, 255, 0.20);
}

button.primary:hover { opacity: 0.92; transform: translateY(-1px); }
button.primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

button.secondary {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
}

button.secondary:hover {
  color: var(--accent-strong);
  border-color: rgba(59, 142, 255, 0.5);
  background: rgba(59, 142, 255, 0.09);
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.74);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.auth-modal-backdrop.open { display: flex; }

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 410px;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(14, 21, 32, 0.98), rgba(11, 16, 24, 0.98));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.65);
  animation: auth-modal-in 0.18s ease-out;
}

@keyframes auth-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal h2 {
  margin: 0 0 1rem;
  color: var(--text-strong);
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem;
  margin-bottom: 1.2rem;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.auth-tab {
  flex: 1;
  padding: 0.55rem;
  color: var(--mute);
  background: none;
  border: 0;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  color: var(--accent-strong);
  background: rgba(59, 142, 255, 0.16);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.auth-field label {
  color: var(--hint);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.auth-field input {
  min-height: 43px;
  padding: 0.72rem 0.85rem;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:hover { border-color: rgba(59, 142, 255, 0.42); }
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 142, 255, 0.18);
}

.auth-hint {
  margin: -0.3rem 0 0.9rem;
  color: var(--hint);
  font-size: 0.76rem;
  line-height: 1.45;
}

.auth-error {
  display: none;
  margin-bottom: 0.9rem;
  padding: 0.6rem 0.75rem;
  color: #ff9696;
  background: rgba(224, 80, 80, 0.11);
  border: 1px solid rgba(224, 80, 80, 0.32);
  border-radius: 8px;
  font-size: 0.85rem;
}

.auth-error.show { display: block; }
.auth-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.auth-actions button { flex: 1; }

.auth-modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  padding: 0.3rem 0.5rem;
  color: var(--mute);
  background: none;
  border: 0;
  border-radius: 7px;
  font-size: 1.4rem;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}

.auth-modal-close:hover {
  color: var(--text);
  background: var(--panel2);
}

/* ========================================================================== */
/* Home Page                                                                  */
/* ========================================================================== */

.home-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
  position: relative;
}

.home-shell::after {
  content: "";
  position: absolute;
  inset: 0 -8vw auto;
  height: 680px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 58% at 50% 0%, rgba(255, 255, 255, 0.045), transparent 72%);
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(59, 142, 255, 0.20);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(59, 142, 255, 0.09), rgba(56, 212, 184, 0.025) 44%, rgba(212, 56, 162, 0.055)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  filter: blur(34px);
  opacity: 0.84;
}

.hero::before {
  top: -26%;
  left: -16%;
  width: 46%;
  height: 82%;
  background: radial-gradient(closest-side, rgba(59, 142, 255, 0.40), transparent 72%);
}

.hero::after {
  right: -18%;
  bottom: -28%;
  width: 48%;
  height: 80%;
  background: radial-gradient(closest-side, rgba(56, 212, 184, 0.28), transparent 72%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.78fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 6vw, 5.8rem) clamp(1.25rem, 5vw, 4rem);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(56, 212, 184, 0.86);
}

.hero h1 {
  max-width: 10ch;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
}

.hero h1::after {
  content: "";
  display: block;
  width: 132px;
  height: 3px;
  margin: 1.1rem 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--teal), transparent);
}

.hero-lede {
  max-width: 61ch;
  margin: 1.25rem 0 0;
  color: var(--mute);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.55rem;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.17s, border-color 0.17s, background 0.17s, box-shadow 0.17s;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #256fd1);
  border: 1px solid rgba(103, 168, 255, 0.58);
  box-shadow: 0 10px 28px rgba(59, 142, 255, 0.24);
}

.secondary-action {
  color: var(--text);
  background: rgba(11, 16, 24, 0.68);
  border: 1px solid var(--line);
}

.hero-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.secondary-action:hover {
  color: var(--accent-strong);
  border-color: rgba(59, 142, 255, 0.55);
  background: rgba(59, 142, 255, 0.09);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100%, 580px);
  margin-top: 1.65rem;
}

.hero-metrics div {
  padding: 0.85rem 0.9rem;
  background: rgba(11, 16, 24, 0.62);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
}

.hero-metrics strong {
  display: block;
  color: var(--text-strong);
  font-size: 1.02rem;
  line-height: 1.2;
}

.hero-metrics span {
  display: block;
  margin-top: 0.16rem;
  color: var(--hint);
  font-size: 0.78rem;
  line-height: 1.35;
}

.hero-showcase {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
}

.showcase-orbit {
  position: absolute;
  border: 1px solid rgba(141, 170, 210, 0.16);
  border-radius: 999px;
  pointer-events: none;
}

.orbit-one {
  width: 88%;
  aspect-ratio: 1;
  transform: rotate(-18deg) scaleX(0.86);
}

.orbit-two {
  width: 68%;
  aspect-ratio: 1;
  transform: rotate(24deg) scaleX(1.08);
  border-color: rgba(56, 212, 184, 0.16);
}

.showcase-card {
  position: relative;
  width: min(100%, 350px);
  padding: 1rem;
  background: linear-gradient(180deg, rgba(14, 21, 32, 0.92), rgba(11, 16, 24, 0.88));
  border: 1px solid rgba(59, 142, 255, 0.24);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.showcase-card-main::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(59, 142, 255, 0.55), rgba(56, 212, 184, 0.16), rgba(212, 56, 162, 0.28));
  filter: blur(18px);
  opacity: 0.38;
}

.mini-window-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.1rem 0 0.75rem;
}

.mini-window-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(140, 160, 192, 0.45);
}

.mini-window-bar span:nth-child(1) { background: rgba(224, 80, 80, 0.72); }
.mini-window-bar span:nth-child(2) { background: rgba(255, 200, 92, 0.68); }
.mini-window-bar span:nth-child(3) { background: rgba(56, 212, 184, 0.72); }

.rack-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  padding: clamp(1.1rem, 4vw, 1.6rem);
  justify-items: center;
  align-items: center;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(59, 142, 255, 0.12), rgba(56, 212, 184, 0.07)),
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.06), transparent 64%),
    #080d15;
  border: 1px solid rgba(141, 170, 210, 0.13);
  transform: perspective(900px) rotateX(54deg) rotateZ(-24deg) translateY(0.5rem);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
}

.rack-preview span {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(3, 7, 13, 0.99) 0 27%,
    rgba(10, 18, 31, 0.99) 27% 29%,
    rgba(44, 93, 162, 0.42) 29% 44%,
    rgba(114, 177, 255, 0.18) 44% 57%,
    rgba(255, 255, 255, 0.08) 57% 61%,
    rgba(16, 25, 39, 0.72) 61% 77%,
    rgba(8, 13, 21, 0.94) 77% 100%);
  border: 1px solid rgba(103, 168, 255, 0.24);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.72), 0 5px 14px rgba(59, 142, 255, 0.10);
}

.preview-readout {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  background: rgba(9, 13, 22, 0.72);
  border: 1px solid rgba(141, 170, 210, 0.12);
  border-radius: 14px;
}

.preview-readout span {
  color: var(--hint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-readout strong {
  color: var(--teal);
  font-size: 0.85rem;
  text-align: right;
}

.floating-chip {
  position: absolute;
  z-index: 2;
  padding: 0.55rem 0.72rem;
  color: var(--text);
  background: rgba(14, 21, 32, 0.82);
  border: 1px solid rgba(141, 170, 210, 0.16);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chip-code { left: 0; top: 19%; color: #a5cfff; border-color: rgba(59, 142, 255, 0.32); }
.chip-print { right: 0; top: 12%; color: #99f0de; border-color: rgba(56, 212, 184, 0.30); }
.chip-ai { right: 7%; bottom: 24%; color: #f1a8dc; border-color: rgba(212, 56, 162, 0.30); }

.section-heading {
  width: min(760px, 100%);
  margin: 4.5rem auto 1.4rem;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.75rem, 3.8vw, 2.65rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.section-heading p:not(.section-kicker) {
  margin: 0.7rem auto 0;
  color: var(--mute);
  max-width: 64ch;
}

.compact-heading { margin-bottom: 1.1rem; }

.feature-grid,
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.features {
  display: block;
}

.feature {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  padding: 1.45rem;
  background: linear-gradient(180deg, rgba(14, 21, 32, 0.92), rgba(11, 16, 24, 0.86));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.feature::after {
  content: "";
  position: absolute;
  inset: auto -25% -45% -25%;
  height: 65%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(59, 142, 255, 0.13), transparent 70%);
  opacity: 0;
  transition: opacity 0.18s;
}

.feature:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 142, 255, 0.38);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(59, 142, 255, 0.05) inset;
}

.feature:hover::after { opacity: 1; }

.feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  color: var(--accent-strong);
  background: linear-gradient(135deg, rgba(59, 142, 255, 0.16), rgba(56, 212, 184, 0.06));
  border: 1px solid rgba(59, 142, 255, 0.30);
  border-radius: 13px;
  box-shadow: 0 10px 25px rgba(59, 142, 255, 0.08);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.feature p {
  margin: 0.65rem 0 0;
  color: var(--mute);
  font-size: 0.95rem;
}

/* ========================================================================== */
/* Media / Gallery / Game / CTA                                               */
/* ========================================================================== */

.media,
.gallery,
.game,
.cta {
  margin-top: 4.75rem;
}

.media { text-align: center; }

.video-wrap {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(900px 240px at 50% -40%, rgba(59, 142, 255, 0.22), transparent 65%),
    #060a10;
  border: 1px solid rgba(59, 142, 255, 0.20);
  border-radius: 20px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.video-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 16%);
  z-index: 1;
}

.video-frame {
  position: relative;
  padding-top: 56.25%;
}

iframe.cf-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.caption {
  width: min(900px, 100%);
  margin: 1rem auto 0;
  color: var(--mute);
  font-size: 1rem;
  line-height: 1.75;
}

.media .caption:not(.caption--short) { display: none; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 21, 32, 0.94), rgba(11, 16, 24, 0.88));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 142, 255, 0.40);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.card img,
.card video {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: #070a11;
}

.card .card-body { padding: 0.85rem; }
.card .title {
  margin: 0;
  color: var(--text-strong);
  font-size: 1rem;
  line-height: 1.35;
}
.card .meta {
  margin: 0.35rem 0 0;
  color: var(--hint);
  font-size: 0.84rem;
}

.game {
  text-align: center;
}

#gameHost {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(14, 21, 32, 0.72), rgba(11, 16, 24, 0.62));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.25);
}

#snakeCanvas {
  display: block;
  width: clamp(280px, 88vw, 640px);
  height: auto;
  margin: 0 auto;
  background:
    radial-gradient(circle at 50% -20%, rgba(59, 142, 255, 0.14), transparent 45%),
    repeating-linear-gradient(0deg, #070a11, #070a11 8px, #0a1019 8px, #0a1019 16px);
  border: 1px solid rgba(59, 142, 255, 0.24);
  border-radius: 14px;
  outline: none;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.38);
  touch-action: none;
}

#snakeCanvas:focus {
  border-color: rgba(56, 212, 184, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 212, 184, 0.12), 0 0 24px rgba(0, 0, 0, 0.38);
}

.hint {
  margin: 0.7rem 0 0;
  color: var(--hint);
  font-size: 0.9rem;
}

.cta {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 3.2rem);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(59, 142, 255, 0.10), rgba(56, 212, 184, 0.04), rgba(212, 56, 162, 0.06)),
    linear-gradient(180deg, rgba(14, 21, 32, 0.92), rgba(11, 16, 24, 0.88));
  border: 1px solid rgba(59, 142, 255, 0.22);
  border-radius: 24px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.cta::before {
  content: "";
  position: absolute;
  inset: -40% auto auto 50%;
  width: 420px;
  height: 420px;
  background: radial-gradient(closest-side, rgba(56, 212, 184, 0.18), transparent 70%);
  transform: translateX(-50%);
  pointer-events: none;
}

.cta > * {
  position: relative;
  z-index: 1;
}

.cta h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.cta p:not(.section-kicker) {
  width: min(720px, 100%);
  margin: 0.9rem auto 0;
  color: var(--mute);
}

.site-footer {
  margin-top: auto;
  padding: 2rem 1rem;
  color: var(--hint);
  text-align: center;
  border-top: 1px solid rgba(29, 46, 72, 0.7);
  background: rgba(7, 10, 17, 0.46);
}

.site-footer p { margin: 0; }

/* ========================================================================== */
/* Game Overlay                                                               */
/* ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  width: 100vw;
  height: calc(var(--vh, 1dvh) * 100);
  display: none;
  place-items: center;
  padding: 4vmin;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(120%) blur(4px);
  backdrop-filter: saturate(120%) blur(4px);
}

.overlay.open { display: grid; }

.overlay-inner {
  position: relative;
  width: min(92vw, 900px);
  max-height: calc(var(--vh, 1dvh) * 92);
  overflow: hidden;
  padding: clamp(0.5rem, 2vmin, 1rem);
  background: linear-gradient(180deg, rgba(14, 21, 32, 0.98), rgba(7, 10, 17, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.68);
}

.overlay-close {
  position: absolute;
  top: 0.3rem;
  right: 0.55rem;
  z-index: 2;
  padding: 0.15rem 0.45rem;
  color: var(--mute);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 2rem;
  line-height: 1;
}

.overlay-close:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.06);
}

body.modal-open {
  height: calc(var(--vh, 1dvh) * 100);
  overflow: hidden;
  overscroll-behavior: contain;
}

.overlay #snakeCanvas {
  width: 100%;
  height: auto;
  max-height: calc(var(--vh, 1dvh) * 85);
  object-fit: contain;
}

/* ========================================================================== */
/* Responsive                                                                 */
/* ========================================================================== */

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    align-items: center;
    text-align: center;
  }

  .hero h1 {
    max-width: 12ch;
  }

  .hero h1::after {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-showcase {
    min-height: 330px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root { --header-h: 58px; }

  body { padding-top: var(--header-h); }

  .nav {
    min-height: var(--header-h);
    gap: 0.5rem;
    padding: 0 0.75rem;
    overflow-x: auto;
  }

  .nav::-webkit-scrollbar { display: none; }

  .nav a.nav-maker,
  .donate-btn,
  .account-btn {
    min-height: 34px;
    padding: 0.38rem 0.6rem;
    font-size: 0.8rem;
  }

  .nav-group-btn {
    min-height: 34px;
    padding: 0.38rem 0.6rem;
    font-size: 0.8rem;
  }

  /* On mobile, dropdown appears as a fixed full-width sheet below the header
     so it isn't clipped by the nav's overflow:auto. */
  .nav-group-menu {
    position: fixed;
    top: var(--header-h);
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    min-width: 0;
  }

  .donate-btn { margin-left: 0; }

  .account-area { margin-left: 0; }

  .account-dropdown {
    right: 0;
    min-width: 200px;
  }

  .home-shell {
    width: min(100% - 1rem, 1200px);
    padding-top: 1rem;
  }

  .hero {
    border-radius: 20px;
  }

  .hero-grid {
    padding: 2.4rem 1rem;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 15vw, 4.4rem);
    letter-spacing: -0.06em;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-showcase {
    min-height: 300px;
  }

  .floating-chip {
    font-size: 0.7rem;
    padding: 0.45rem 0.58rem;
  }

  .chip-code { left: 1%; top: 12%; }
  .chip-print { right: 0; top: 6%; }
  .chip-ai { right: 8%; bottom: 16%; }

  .section-heading {
    margin-top: 3.3rem;
  }

  .media,
  .gallery,
  .game,
  .cta {
    margin-top: 3.5rem;
  }
}

@media (max-width: 600px) {
  .hero-actions {
    width: 100%;
  }

  .hero-action {
    flex: 1 1 100%;
  }

  .rack-preview {
    gap: 0.52rem;
  }

  .preview-readout {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .preview-readout strong {
    text-align: left;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  #gameHost {
    padding: 0.65rem;
    border-radius: 16px;
  }

  .overlay { padding: 3vmin; }

  .overlay-inner {
    width: min(96vw, 900px);
    max-height: calc(var(--vh, 1dvh) * 96);
    border-radius: 14px;
  }

  .overlay #snakeCanvas {
    max-height: calc(var(--vh, 1dvh) * 88);
  }
}
