:root {
  --bg: #05070d;
  --bg-2: #0b1220;
  --panel: rgba(12, 20, 36, 0.72);
  --line: rgba(56, 189, 248, 0.22);
  --cyan: #38bdf8;
  --cyan-dim: #0ea5e9;
  --blue: #1d4ed8;
  --lime: #a8e6a2;
  --text: #e2f4ff;
  --muted: #7f9ab3;
  --glow: 0 0 12px rgba(56, 189, 248, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 78% -10%, rgba(29, 78, 216, 0.30), transparent 70%),
    radial-gradient(700px 420px at 8% 8%, rgba(56, 189, 248, 0.16), transparent 70%),
    linear-gradient(transparent 0 39px, rgba(56, 189, 248, 0.05) 40px),
    linear-gradient(90deg, transparent 0 39px, rgba(56, 189, 248, 0.05) 40px);
  background-size: auto, auto, 40px 40px, 40px 40px;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }

.staging-watermark {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(5, 7, 13, 0.85);
  border-bottom: 1px solid var(--line);
  color: #ff4d6d;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  z-index: 1000;
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 26px;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 5vw, 56px);
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.22em;
  font-size: 18px;
  color: var(--text);
  text-shadow: var(--glow);
}

.brand span { color: var(--cyan); }
.brand-jolt { color: var(--lime); text-shadow: 0 0 10px rgba(168, 230, 162, 0.7); }

.topbar nav { display: flex; gap: clamp(10px, 2vw, 26px); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.topbar nav a { color: var(--muted); text-decoration: none; padding-bottom: 4px; border-bottom: 1px solid transparent; }
.topbar nav a:hover, .topbar nav a.active { color: var(--cyan); border-bottom-color: var(--cyan); text-shadow: var(--glow); }

.hero { padding: clamp(60px, 12vh, 130px) 20px clamp(50px, 9vh, 90px); text-align: center; }
.eyebrow { margin: 0 0 14px; color: var(--lime); letter-spacing: 0.28em; font-size: 12px; text-transform: uppercase; }

.hero h1 {
  margin: 0;
  font-size: clamp(52px, 13vw, 132px);
  line-height: 0.92;
  letter-spacing: 0.06em;
  font-weight: 800;
}

.glow-word { color: var(--cyan); text-shadow: 0 0 24px rgba(56, 189, 248, 0.75), 0 0 70px rgba(29, 78, 216, 0.6); }

.tagline { margin: 18px 0 34px; color: var(--muted); font-size: clamp(15px, 2.4vw, 19px); }

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--cyan);
  transition: box-shadow 0.2s, transform 0.2s, background-color 0.2s;
}

.btn-primary { background: var(--cyan); color: #04121d; box-shadow: var(--glow); }
.btn-primary:hover { background: #7dd3fc; box-shadow: 0 0 26px rgba(56, 189, 248, 0.9); transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--cyan); }
.btn-ghost:hover { background: rgba(56, 189, 248, 0.12); box-shadow: var(--glow); transform: translateY(-2px); }

.strip { padding: clamp(30px, 6vh, 60px) clamp(16px, 5vw, 56px); max-width: 1180px; margin: 0 auto; }

.strip-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 22px;
  font-size: clamp(20px, 3.6vw, 30px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}

.strip-title span { color: var(--cyan-dim); font-size: 0.7em; letter-spacing: 0.2em; }
.strip-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

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

.tile {
  position: relative;
  display: block;
  padding: 18px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tile:hover { transform: translateY(-4px); border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 12px 34px rgba(2, 8, 20, 0.7), var(--glow); }

.tile h3 { margin: 14px 0 6px; font-size: 19px; letter-spacing: 0.04em; color: var(--cyan); }
.tile p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.tile-art {
  height: 120px;
  border-radius: 8px;
  background: linear-gradient(160deg, #071322, #0d1b30);
  border: 1px solid rgba(56, 189, 248, 0.14);
  position: relative;
  overflow: hidden;
}

.art-placeholder { display: flex; align-items: center; justify-content: center; font-size: 42px; color: rgba(56, 189, 248, 0.35); }

.tile-soon { opacity: 0.72; cursor: not-allowed; }
.tile-soon:hover { transform: none; box-shadow: none; border-color: var(--line); }

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tag-live { background: rgba(56, 189, 248, 0.16); color: var(--cyan); border: 1px solid var(--cyan); box-shadow: var(--glow); }
.tag-soon { background: rgba(127, 154, 179, 0.12); color: var(--muted); border: 1px solid rgba(127, 154, 179, 0.4); }

.panel {
  padding: clamp(18px, 3vw, 28px);
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.panel h3 { margin: 0 0 8px; color: var(--cyan); letter-spacing: 0.05em; }
.panel p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.panel-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.panel-row { display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.scores { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scores th, .scores td { text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(56, 189, 248, 0.12); font-size: 14px; }
.scores th { color: var(--cyan-dim); text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; }
.scores td:first-child { color: var(--cyan); }
.num { text-align: right; }

.swatches { display: flex; gap: 8px; }
.swatches span { width: 34px; height: 34px; border-radius: 6px; background: var(--c); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent); }

.footer {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 26px clamp(16px, 5vw, 56px) 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--cyan); }
.foot-ver { margin-left: auto; color: var(--cyan-dim); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  padding: 11px 20px;
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.95);
  border: 1px solid var(--cyan);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.08em;
  box-shadow: var(--glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Boulder Dodge mini art */
.art-boulder .boulder {
  position: absolute;
  top: -18px;
  left: 24%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6b7f96, #2a3648);
  animation: fall 2.6s linear infinite;
}
.art-boulder .b2 { left: 66%; top: -30px; width: 16px; height: 16px; animation-delay: 1.1s; }
.art-boulder .runner {
  position: absolute;
  bottom: 12px;
  left: 40%;
  width: 12px;
  height: 20px;
  border-radius: 3px;
  background: var(--lime);
  box-shadow: 0 0 12px rgba(168, 230, 162, 0.8);
  animation: dodge 2.6s ease-in-out infinite alternate;
}

@keyframes fall { to { transform: translateY(150px); } }
@keyframes dodge { from { transform: translateX(-24px); } to { transform: translateX(30px); } }

/* ---------- Auth slot (nav, top right) ---------- */

.auth-slot { display: flex; align-items: center; gap: 12px; margin-left: clamp(8px, 2vw, 22px); }

.btn-sm { padding: 7px 15px; font-size: 11px; letter-spacing: 0.12em; }

.auth-me {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(56, 189, 248, 0.07);
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* The nav styles .topbar nav a aggressively; undo that for the pill. */
.topbar nav .auth-me {
  color: var(--text);
  border-bottom: 1px solid var(--line);
  text-shadow: none;
  padding: 4px 12px 4px 4px;
}
.topbar nav .auth-me:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: var(--glow);
  text-shadow: var(--glow);
}

.auth-me:hover { border-color: var(--cyan); box-shadow: var(--glow); }

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0d1b30;
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: block;
}

/* ---------- Auth card (login / join) ---------- */

.auth-wrap {
  padding: clamp(40px, 9vh, 90px) 20px clamp(50px, 10vh, 110px);
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(430px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(2, 8, 20, 0.6);
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: clamp(24px, 4.4vw, 32px);
  letter-spacing: 0.05em;
  color: var(--cyan);
  text-shadow: var(--glow);
}

.auth-sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.field { display: block; margin-bottom: 16px; }

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan-dim);
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(5, 7, 13, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: var(--glow);
}

.input::placeholder { color: rgba(127, 154, 179, 0.55); }

.auth-submit { width: 100%; margin-top: 6px; text-align: center; }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(56, 189, 248, 0.12);
  font-size: 13px;
}

.auth-links a { color: var(--cyan); text-decoration: none; }
.auth-links a:hover { text-shadow: var(--glow); }
.auth-links .muted-link { color: var(--muted); }
.auth-links .muted-link:hover { color: var(--cyan); text-shadow: none; }

.notice {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.5;
}

.notice-warn {
  background: rgba(255, 77, 109, 0.09);
  border: 1px solid rgba(255, 77, 109, 0.35);
  color: #ffb3c0;
}

.notice-error {
  background: rgba(255, 77, 109, 0.14);
  border: 1px solid rgba(255, 77, 109, 0.5);
  color: #ffc4ce;
}

.notice-ok {
  background: rgba(168, 230, 162, 0.1);
  border: 1px solid rgba(168, 230, 162, 0.4);
  color: var(--lime);
}

[hidden] { display: none !important; }

/* ---------- Profile page ---------- */

.profile-head {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  background: #0d1b30;
  border: 1px solid var(--line);
  box-shadow: var(--glow);
}

.profile-meta h1 { margin: 0 0 4px; font-size: clamp(26px, 5vw, 38px); color: var(--text); }
.profile-handle { margin: 0; color: var(--cyan); font-size: 15px; letter-spacing: 0.06em; }

.picker-title {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan-dim);
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 10px;
}

.avatar-opt {
  padding: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #0d1b30;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}

.avatar-opt img { width: 100%; aspect-ratio: 1; display: block; }
.avatar-opt:hover { border-color: rgba(56, 189, 248, 0.5); transform: translateY(-2px); }
.avatar-opt.sel { border-color: var(--cyan); box-shadow: var(--glow); }

/* Leaderboard rows get a face next to the name once scores come from the server. */
.scores .player { display: flex; align-items: center; gap: 9px; }
.row-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0d1b30;
  border: 1px solid rgba(56, 189, 248, 0.3);
  flex: 0 0 auto;
}

.profile-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 26px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 560px) {
  .topbar nav a:nth-child(3) { display: none; }
  .footer { flex-wrap: wrap; }
  .foot-ver { margin-left: 0; }
  .auth-slot { margin-left: 8px; }
  .auth-me span { display: none; }
  .auth-me { padding: 4px; }
}

/* ---------------------------------------------------------------------------
   Landing page (site root). Purple joins cyan/lime as an accent: Ross's palette
   is blues, greens, purples on near-black. Kept additive so /games/ and /lab/
   are unaffected by anything here.
   --------------------------------------------------------------------------- */
.hero-cover { position: relative; }
.glow-violet {
  color: #a78bfa;
  text-shadow: 0 0 24px rgba(167, 139, 250, 0.7), 0 0 70px rgba(109, 40, 217, 0.55);
}

/* Faint grid + violet wash behind the cover so the dark bg is not a flat void. */
.landing main { position: relative; }
.hero-cover::before {
  content: '';
  position: absolute;
  inset: -40px 0 auto;
  height: 130%;
  background:
    radial-gradient(60rem 28rem at 50% -10%, rgba(109, 40, 217, 0.22), transparent 70%),
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px) 0 0 / 100% 3rem;
  pointer-events: none;
  z-index: -1;
}

.scroll-hint {
  margin: clamp(26px, 6vh, 64px) 0 0;
  color: var(--muted);
  font-size: 20px;
  animation: janknet-bob 2.4s ease-in-out infinite;
}
@keyframes janknet-bob {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50%      { transform: translateY(7px); opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint { animation: none; }
}

/* Purple as the third accent, only where a link leaves the current page context. */
.landing .tile:hover { border-color: rgba(167, 139, 250, 0.6); box-shadow: 0 0 14px rgba(167, 139, 250, 0.3); }

/* Hall-of-fame table sits inside an existing .panel; only these two are new. */
#hall-table { margin-top: 18px; }
#hall-status { margin-bottom: 0; }

/* ---------- Admin: locked-out password queue (profile.html) --------------------- */
/* Only visible when /api/me reports role === 'admin'. Kept in the same palette as the
   rest of the site: cyan for structure, lime for confirmation, red only for failure. */

.pwreq-list { display: grid; gap: 10px; }

.pwreq {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 7, 13, 0.55);
  padding: 12px 14px;
}

.pwreq.done { opacity: 0.55; }

.pwreq-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pwreq-head strong {
  color: var(--cyan);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.pwreq-head span {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.pwreq-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-dim);
  white-space: pre-wrap;      /* notes are free text; keep any line breaks they typed */
  word-break: break-word;
}

.pwreq-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pwreq-acts .input {
  flex: 1 1 180px;
  min-width: 150px;
  padding: 9px 11px;
  font-size: 14px;
}

.pwreq-showall {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-dim);
  margin-left: auto;
  cursor: pointer;
}

#spool-path {
  font-size: 12px;
  word-break: break-all;
  color: var(--lime);
}
