/* ==========================================================
   SAHAPHAN Allfriend — Ferrofluid × Liquid Glass × Gothic
   ========================================================== */

@property --ring-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@font-face {
  font-family: "Blacksword";
  src: url("../fonts/Blacksword.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #030406;
  --ink: #f4f6f9;
  --ink-dim: rgba(232, 237, 244, 0.62);
  --ink-faint: rgba(232, 237, 244, 0.34);
  --font-hero: "Syncopate", sans-serif;
  --font-blacksword: "Blacksword", cursive, sans-serif;
  --font-gothic: "Grenze Gotisch", "UnifrakturMaguntia", serif;
  --font-fraktur: "UnifrakturMaguntia", "Grenze Gotisch", serif;
  --font-body: "Noto Sans Thai", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --title-gradient: linear-gradient(180deg, #ffffff 0%, #eceef1 28%, #a3a8af 60%, #3a3e44 100%);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* No text selection / dragging */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
img, svg, canvas { -webkit-user-drag: none; }
input { -webkit-user-select: text; user-select: text; }

button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------------- Background ---------------- */
#bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 0;
}
.grain {
  position: fixed; inset: -50%; z-index: 1;
  pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}

/* ---------------- Liquid Glass hosts ----------------
   The glass itself is rendered by WebGL (js/ferro-glass.js) behind
   every [data-glass] element. These elements stay transparent. */
[data-glass] {
  position: relative;
  background: transparent;
  border: 0;
}
/* Fallback when WebGL is unavailable */
.no-webgl [data-glass] {
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), inset 0 0 0 1px rgba(255,255,255,0.1), 0 20px 50px -20px rgba(0,0,0,0.9);
}
.no-webgl #bg { background: radial-gradient(ellipse at 50% 60%, #0d0f13, #030406 70%); }

/* ---------------- Loader ---------------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--bg);
  transition: opacity 1s var(--ease-out), visibility 1s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-mark {
  font-family: var(--font-hero); font-size: 78px; line-height: 1;
  background: var(--title-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pulse 1.6s ease-in-out infinite;
}
.loader-bar { width: 120px; height: 1px; background: rgba(255,255,255,0.12); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 40%; background: #fff; animation: load 1.2s var(--ease-out) infinite; }

/* ---------------- Views ---------------- */
.view {
  position: fixed; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  padding: max(22px, env(safe-area-inset-top)) clamp(18px, 4vw, 48px) max(22px, env(safe-area-inset-bottom));
}
.view-landing {
  animation: fade 0.9s var(--ease-out);
}

.hud {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em;
  color: var(--ink-faint); text-transform: uppercase;
  opacity: 0; animation: fade 1.4s var(--ease-out) 0.3s forwards;
}
.hud b { font-weight: 400; margin: 0 6px; }

/* ---------------- Hero ---------------- */
.hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding-bottom: clamp(24px, 4vh, 48px);
  min-height: 0;
}
.hero-eyebrow {
  margin: 0 0 clamp(8px, 1.8vh, 18px);
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.3em;
  color: var(--ink-dim);
  opacity: 0; animation: rise 1.2s var(--ease-out) 0.4s forwards;
}
.hero-eyebrow span { width: 46px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45)); }
.hero-eyebrow span:last-child { transform: scaleX(-1); }

.hero-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.hero-line {
  position: relative;
  display: inline-block;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.75));
  opacity: 0;
  animation: reveal 1.8s var(--ease-out) forwards;
  overflow: visible;
  white-space: nowrap;
}
.hero-line-1 {
  font-family: var(--font-hero);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(32px, 6vw, 88px);
  line-height: 1.08;
  letter-spacing: 0.1em;
  padding: 0.06em 0.22em 0.08em;
  animation-delay: 0.55s;
}
.hero-line-2 {
  font-family: var(--font-hero);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(25px, 4.6vw, 68px);
  line-height: 1.08;
  letter-spacing: 0.12em;
  margin-top: 0.06em;
  padding: 0.06em 0.22em 0.2em;
  background: linear-gradient(180deg, #ffffff 0%, #d4d7dc 36%, #6c7178 75%, #34383d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  animation-delay: 0.85s;
}
/* light sweep over the title */
.hero-line::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  padding: inherit;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  background: linear-gradient(100deg, transparent 42%, rgba(255,255,255,0.95) 50%, transparent 58%);
  background-size: 260% 100%;
  background-position: 160% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sweep 7s ease-in-out 2.6s infinite;
  pointer-events: none;
}

/* ---------------- The button: ring + shine ---------------- */
.enter-wrap {
  margin-top: clamp(32px, 5vh, 60px);
  opacity: 0; animation: rise 1.2s var(--ease-out) 1.4s forwards;
}
.enter-btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 clamp(38px, 5vw, 56px);
  border: 0; border-radius: 999px;
  background: #000;
  color: #fff;
  font-family: var(--font-body); font-weight: 600;
  font-size: clamp(16px, 1.8vw, 19px); letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow:
    0 24px 60px -12px rgba(0,0,0,1),
    0 0 0 1px rgba(255,255,255,0.06);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
/* rotating white ring */
.enter-btn::before {
  content: ""; position: absolute; inset: -1.5px; z-index: -1;
  border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--ring-angle),
    rgba(255,255,255,0.08) 0deg, rgba(255,255,255,0.08) 190deg,
    rgba(255,255,255,0.35) 270deg,
    rgba(255,255,255,0.85) 335deg,
    #ffffff 355deg,
    rgba(255,255,255,0.08) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ring-spin 3s linear infinite;
}
/* glossy black face */
.enter-btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(255,255,255,0.10) 0%, transparent 55%),
    linear-gradient(180deg, #1b1c1f 0%, #050506 52%, #000 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.32),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    inset 0 0 18px rgba(0,0,0,0.9);
}
/* soft halo that follows the ring */
.enter-glow {
  position: absolute; inset: -5px; z-index: -2; border-radius: inherit;
  background: conic-gradient(from var(--ring-angle),
    transparent 0deg, transparent 280deg, rgba(255,255,255,0.5) 350deg, transparent 360deg);
  filter: blur(12px);
  opacity: 0.65;
  animation: ring-spin 3s linear infinite;
}
/* glass gloss on the upper half */
.enter-gloss {
  position: absolute; left: 6%; right: 6%; top: 3px; height: 46%;
  border-radius: 999px 999px 40% 40% / 999px 999px 100% 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.04) 70%, transparent 100%);
  pointer-events: none;
}
/* diagonal shine sweeping across the face */
.enter-shine {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  pointer-events: none;
}
.enter-shine::before {
  content: ""; position: absolute; top: -50%; bottom: -50%; width: 38%;
  left: -60%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0.42) 50%, rgba(255,255,255,0.05) 70%, transparent 100%);
  transform: skewX(-18deg);
  animation: shine 4.2s var(--ease-out) 2.4s infinite;
}
.enter-label {
  position: relative; z-index: 1;
  text-shadow: 0 0 14px rgba(255,255,255,0.35);
}
.enter-arrow { position: relative; z-index: 1; transition: transform 0.5s var(--ease-out); }

.enter-btn:hover {
  transform: translateY(-2px) scale(1.035);
  box-shadow: 0 30px 80px -12px rgba(0,0,0,1), 0 0 44px rgba(255,255,255,0.16), 0 0 0 1px rgba(255,255,255,0.1);
}
.enter-btn:hover::before, .enter-btn:hover .enter-glow { animation-duration: 1.5s; }
.enter-btn:hover .enter-shine::before { animation-duration: 1.6s; animation-delay: 0s; }
.enter-btn:hover .enter-arrow { transform: translateX(5px); }
.enter-btn:active { transform: scale(0.97); }
.enter-btn:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }

/* ---------------- Transition ---------------- */
.dive {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, rgba(255,255,255,0.95) 0%, rgba(200,210,225,0.35) 12%, #000 55%);
  opacity: 0; transform: scale(0.2);
}
.dive.is-on { animation: dive 1.6s var(--ease-out) forwards; }

/* ---------------- Members view ---------------- */
.view-home {
  overflow-y: auto; overflow-x: hidden;
  animation: fade 0.9s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.home-top { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.back-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: transform 0.4s var(--ease-out), box-shadow 0.3s;
}
.back-btn:hover {
  transform: translateX(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), inset 0 0 0 1px rgba(255,255,255,0.14);
}
.home-brand { font-family: var(--font-gothic); font-weight: 700; font-size: 22px; letter-spacing: 0.04em; }
.home-brand b { font-family: var(--font-fraktur); font-weight: 400; color: var(--ink-dim); }

.home-body {
  width: 100%; max-width: 1180px;
  margin: clamp(28px, 6vh, 60px) auto 0;
  display: flex; flex-direction: column; gap: 30px;
  padding-bottom: 80px;
}
.home-head { text-align: center; }
.home-kicker {
  display: block;
  font-family: var(--font-fraktur); font-size: clamp(22px, 3vw, 30px);
  color: var(--ink-dim);
}
.home-title {
  margin: 4px 0 0;
  font-weight: 800; font-size: clamp(36px, 6vw, 64px); line-height: 1.15;
  background: var(--title-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.8));
}

/* Crew name in the members heading — same font as the landing hero */
.crew-name {
  font-family: var(--font-hero); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.home-kicker .crew-name { font-size: 0.62em; vertical-align: 0.12em; }
/* same style as .home-brand next to the back button */
.kicker-brand { font-family: var(--font-gothic); font-weight: 700; letter-spacing: 0.04em; color: var(--ink); }
.home-title .crew-name { font-size: 0.82em; }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; }
.search {
  display: flex; align-items: center; gap: 10px;
  width: min(380px, 100%); height: 50px; padding: 0 20px;
  border-radius: 999px; color: var(--ink-dim); cursor: text;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: box-shadow 0.3s;
}
.search:focus-within {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), inset 0 0 0 1px rgba(255,255,255,0.18), 0 0 22px rgba(255,255,255,0.08);
}
.search input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: 0; outline: 0;
  color: #fff; font: 500 14px var(--font-body); letter-spacing: 0.02em;
}
.search input::placeholder { color: var(--ink-faint); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 8px 0 18px;
  border-radius: 999px; cursor: pointer;
  font: 600 12px var(--font-body); letter-spacing: 0.12em;
  color: var(--ink-dim);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: color 0.3s, transform 0.4s var(--ease-out), box-shadow 0.3s;
}
.filter-btn i { width: 7px; height: 7px; border-radius: 50%; margin-right: -2px; }
.filter-btn b {
  display: grid; place-items: center;
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px;
  font: 700 11px var(--font-mono);
  background: rgba(255,255,255,0.08); color: #fff;
}
.filter-btn:hover {
  color: #fff; transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 0 0 1px rgba(255,255,255,0.1);
}
.filter-btn.is-active {
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 0 0 1px rgba(255,255,255,0.2), 0 0 20px rgba(255,255,255,0.12);
}
.filter-btn.is-active b { background: #fff; color: #000; }

/* Role badge + pill buttons (used by the member modal) */
.mc-role {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 10px var(--font-mono); letter-spacing: 0.2em;
  color: var(--ink-dim);
}
.mc-role i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.mc-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  background: rgba(255,255,255,0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.06);
  color: #fff; text-decoration: none; cursor: pointer; border: 0;
  font: 500 12px var(--font-body);
  max-width: 100%; min-width: 0;
  transition: background 0.25s, transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.mc-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-link:hover {
  background: rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 0 0 1px rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

/* ---------- Role bands: one section per position ---------- */
.role-bands { display: flex; flex-direction: column; gap: clamp(36px, 6vh, 56px); }
.role-band { --role: #ffffff; }
.rb-head {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 14px; margin-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
/* short accent bar under the heading, in the role colour */
.rb-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 150px; height: 2px;
  background: linear-gradient(90deg, var(--role), transparent);
}
.rb-tag {
  flex: none; margin: 0;
  padding: 8px 18px; border-radius: 999px;
  font: 700 13px var(--font-hero); letter-spacing: 0.16em; color: var(--role);
  background: color-mix(in srgb, var(--role) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--role) 38%, transparent);
}
.rb-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0.1), transparent); }
.rb-count {
  flex: none;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; color: var(--ink-faint);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* Member cards */
.rb-grid, .member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.member-card {
  border-radius: 28px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 220px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  opacity: 0;
  animation: rise 0.9s var(--ease-out) forwards;
  cursor: pointer;
}
.member-card:hover {
  transform: translateY(-6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 0 0 1px rgba(255,255,255,0.14), 0 24px 50px -15px rgba(0,0,0,0.85);
}

.mc-top { display: flex; align-items: center; justify-content: space-between; }
.mc-num { font: 600 11px var(--font-mono); color: var(--ink-faint); letter-spacing: 0.1em; }

.mc-body { display: flex; align-items: center; gap: 16px; }
.mc-avatar {
  position: relative; width: 66px; height: 66px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #2a2d33 0%, #0b0c0e 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -6px 12px rgba(0,0,0,0.6), 0 8px 20px rgba(0,0,0,0.6);
  overflow: hidden;
}
.mc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mc-avatar span {
  font-family: var(--font-fraktur); font-size: 34px; line-height: 1;
  background: var(--title-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mc-name {
  margin: 0;
  font-family: var(--font-gothic); font-weight: 700;
  font-size: 30px; line-height: 1; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff 0%, #c9cdd3 70%, #8b9097 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  overflow-wrap: anywhere;
}
.mc-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-dim); }

.mc-bio {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mc-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: -4px;
}
.mc-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-faint);
  font-family: var(--font-mono); letter-spacing: 0.04em;
}

.mc-links { display: flex; gap: 8px; margin-top: auto; }

.uc-empty {
  display: grid; place-items: center; min-height: 120px;
  border-radius: 28px; border: 1px dashed rgba(255,255,255,0.12);
  font-size: 13px; color: var(--ink-faint);
}

.member-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-dim);
  padding: 60px 24px;
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* ---------------- Crews view (4 profile cards) ---------------- */
.crews-body { margin-top: clamp(4px, 2vh, 24px); gap: clamp(18px, 3.5vh, 36px); padding-bottom: 40px; }
.crews-body .home-kicker { font-size: clamp(18px, 2.2vw, 24px); }
.crews-body .home-title { font-size: clamp(28px, 4.2vw, 46px); }
.crew-row {
  display: flex; gap: clamp(14px, 1.8vw, 24px);
  justify-content: center;
}
.crew-card {
  --accent: #ffffff;
  position: relative; isolation: isolate;
  flex: 1 1 0; min-width: 0;
  /* shrink on short screens so the whole card fits under the heading */
  max-width: min(270px, calc((100dvh - 250px) / 1.533));
  aspect-ratio: 3 / 4.6;
  container-type: inline-size;
  /* artwork height: its natural ratio, capped so tall banners leave room for the info */
  --img-h: min(100cqw / var(--ar, 1.78), 60cqw);
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255,255,255,0.05) 0%, transparent 60%),
    linear-gradient(180deg, #0d0e10 0%, #050506 55%, #000 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 30px 60px -24px rgba(0,0,0,1);
  opacity: 0;
  animation: rise 0.9s var(--ease-out) forwards;
  transition: translate 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out), filter 0.5s;
}
/* light rising from the bottom, tinted by the crew accent */
.crew-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 55% at 50% 105%, color-mix(in srgb, var(--accent) 34%, transparent) 0%, transparent 70%),
    radial-gradient(70% 40% at 50% 26%, rgba(255,255,255,0.08) 0%, transparent 70%);
  opacity: 0; transform: translateY(20%);
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
}
/* diagonal shine that crosses the card once on reveal */
.crew-card::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 45%; left: -70%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.12) 50%, transparent);
  transform: skewX(-16deg);
  pointer-events: none;
}

/* optional crew artwork: almost black at rest, full colour on reveal */
.cc-bg {
  position: absolute; inset: 0 0 auto 0; z-index: -2;
  height: var(--img-h);
  /* landscape art sits full-width across the top so the whole picture stays visible */
  background-size: cover; background-position: 50% 40%; background-repeat: no-repeat;
  transform-origin: 50% 0;
  filter: grayscale(1) brightness(0.28);
  opacity: 0.55;
  transform: scale(1.12);
  transition: filter 0.8s var(--ease-out), opacity 0.6s, transform 1.4s var(--ease-out);
}
/* darken the lower half so the info stays readable over the art */
.cc-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 62%, rgba(0,0,0,0.75) 88%, #000 100%);
}
.crew-card.has-image .cc-mark { transition: top 0.8s var(--ease-out), transform 0.8s var(--ease-out), opacity 0.4s; }

/* with artwork: info starts right under the picture, button stays at the bottom */
.crew-card.has-image .cc-info {
  top: calc(var(--img-h) + 14px);
  justify-content: flex-start;
}
.crew-card.has-image .cc-btn { margin-top: auto; }
/* very small cards: drop the secondary lines so nothing overlaps */
@container (max-width: 215px) {
  .crew-card.has-image .cc-desc, .crew-card.has-image .cc-th { display: none; }
  .cc-stats { margin-top: 10px; padding-top: 8px; }
  .cc-info { padding: 0 14px 14px; }
}

/* rotating ring border, same language as the enter button */
.cc-ring {
  position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--ring-angle),
    transparent 0deg, transparent 200deg,
    color-mix(in srgb, var(--accent) 50%, transparent) 290deg,
    #ffffff 350deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  animation: ring-spin 3.2s linear infinite;
  transition: opacity 0.5s;
  pointer-events: none;
}

.cc-no {
  position: absolute; top: 20px; left: 22px;
  font: 600 11px var(--font-mono); letter-spacing: 0.2em;
  color: var(--ink-faint);
  transition: color 0.5s;
}
/* big outlined emblem — the only thing visible on the dark card */
.cc-mark {
  position: absolute; left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  font: 700 clamp(72px, 9vw, 120px)/1 var(--font-hero);
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.13);
  transition: top 0.8s var(--ease-out), transform 0.8s var(--ease-out), -webkit-text-stroke-color 0.5s;
}
.cc-line {
  position: absolute; left: 22px; right: 22px; bottom: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  transition: opacity 0.4s;
}

.cc-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 20px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.cc-info > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.45s var(--ease-out), transform 0.7s var(--ease-out);
}
.cc-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 10px var(--font-mono); letter-spacing: 0.22em; color: var(--accent);
}
.cc-tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.cc-name {
  margin: 10px 0 0;
  font: 700 min(19px, 6.4cqw)/1.2 var(--font-hero); letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap; max-width: 100%;
  background: var(--title-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cc-th { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-dim); }
.cc-desc { margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-faint); }
.cc-stats {
  margin: 14px 0 0; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px;
}
.cc-stats dd small { font-size: 11px; font-weight: 500; color: var(--ink-faint); margin-left: 1px; }
.cc-stats div + div { border-left: 1px solid rgba(255,255,255,0.08); }
.cc-stats dt { font: 500 11px var(--font-body); letter-spacing: 0.04em; color: var(--ink-faint); }
.cc-stats dd { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }
.cc-btn {
  margin-top: 16px; width: 100%; height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px;
  font: 600 13px var(--font-body); letter-spacing: 0.06em;
  color: #000; background: linear-gradient(180deg, #ffffff 0%, #d9dde3 100%);
  text-decoration: none;
  box-shadow: inset 0 1px 0 #fff, 0 10px 26px -8px rgba(255,255,255,0.35);
}
.cc-btn svg { transition: transform 0.4s var(--ease-out); }
.cc-btn:hover svg { transform: translateX(4px); }
.cc-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ----- Reveal: hover, keyboard focus, or touch screens ----- */
.crew-row:hover .crew-card:not(:hover) { filter: saturate(0.4) brightness(0.5); }
.crew-card:hover,
.crew-card:focus-within {
  translate: 0 -10px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 40px 80px -24px rgba(0,0,0,1),
    0 0 50px -10px color-mix(in srgb, var(--accent) 30%, transparent);
}
.crew-card:hover::after, .crew-card:focus-within::after { left: 130%; transition: left 1.1s var(--ease-out); }
.crew-card:hover::before, .crew-card:focus-within::before,
.crew-card:hover .cc-ring, .crew-card:focus-within .cc-ring { opacity: 1; transform: none; }
.crew-card:hover .cc-no, .crew-card:focus-within .cc-no { color: var(--ink); }
.crew-card:hover .cc-line, .crew-card:focus-within .cc-line { opacity: 0; }
.crew-card:hover .cc-mark, .crew-card:focus-within .cc-mark {
  top: 21%;
  transform: translate(-50%, -50%) scale(0.62);
  -webkit-text-stroke-color: rgba(255,255,255,0.9);
}
.crew-card:hover .cc-info > *, .crew-card:focus-within .cc-info > * { opacity: 1; transform: none; }
.crew-card:hover .cc-info > :nth-child(1), .crew-card:focus-within .cc-info > :nth-child(1) { transition-delay: 0.08s; }
.crew-card:hover .cc-info > :nth-child(2), .crew-card:focus-within .cc-info > :nth-child(2) { transition-delay: 0.13s; }
.crew-card:hover .cc-info > :nth-child(3), .crew-card:focus-within .cc-info > :nth-child(3) { transition-delay: 0.18s; }
.crew-card:hover .cc-info > :nth-child(4), .crew-card:focus-within .cc-info > :nth-child(4) { transition-delay: 0.23s; }
.crew-card:hover .cc-info > :nth-child(5), .crew-card:focus-within .cc-info > :nth-child(5) { transition-delay: 0.28s; }
.crew-card:hover .cc-info > :nth-child(6), .crew-card:focus-within .cc-info > :nth-child(6) { transition-delay: 0.34s; }

.crew-card:hover .cc-bg, .crew-card:focus-within .cc-bg { filter: none; opacity: 1; transform: none; }
.crew-card.has-image:hover .cc-mark, .crew-card.has-image:focus-within .cc-mark { opacity: 0; }

/* empty "coming soon" slots */
.crew-card.is-placeholder .cc-mark { -webkit-text-stroke-color: rgba(255,255,255,0.08); }
.cc-btn.is-disabled {
  color: var(--ink-faint); background: rgba(255,255,255,0.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); cursor: default;
}

/* ‹ 1/2 › — plain text overlay, bottom-right of the crews view */
.crew-pager {
  position: fixed; z-index: 25;
  right: clamp(18px, 4vw, 48px);
  bottom: max(26px, calc(env(safe-area-inset-bottom) + 16px));
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); color: var(--ink);
  text-shadow: 0 2px 12px rgba(0,0,0,0.9);
  animation: fade 0.8s var(--ease-out);
}
.pg-label { font-size: 15px; font-weight: 600; letter-spacing: 0.12em; white-space: nowrap; }
.pg-arrow {
  padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: 300 28px/1 var(--font-body); color: var(--ink);
  text-shadow: inherit;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}
#pgPrev:hover:not(:disabled) { transform: translateX(-4px); }
#pgNext:hover:not(:disabled) { transform: translateX(4px); }
.pg-arrow:disabled { opacity: 0.2; cursor: default; }
.pg-arrow:focus-visible { outline: 1px solid #fff; outline-offset: 4px; border-radius: 4px; }

/* No hover on touch screens: show every card already revealed */
@media (hover: none) {
  .crew-card::before, .cc-ring { opacity: 1; transform: none; }
  .crew-card .cc-mark { top: 21%; transform: translate(-50%, -50%) scale(0.62); -webkit-text-stroke-color: rgba(255,255,255,0.9); }
  .crew-card .cc-info > * { opacity: 1; transform: none; }
  .crew-card .cc-line { opacity: 0; }
  .crew-card .cc-bg { filter: none; opacity: 1; transform: none; }
  .crew-card.has-image .cc-mark { opacity: 0; }
}

/* Narrow screens: keep one row, swipe sideways */
@media (max-width: 900px) {
  .crew-row {
    justify-content: flex-start;
    overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * clamp(18px, 4vw, 48px));
    padding: 14px clamp(18px, 4vw, 48px) 24px;
    scrollbar-width: none;
  }
  .crew-row::-webkit-scrollbar { display: none; }
  .crew-card { flex: 0 0 min(260px, 72vw); max-width: none; scroll-snap-align: center; }
  .cc-mark { font-size: 96px; }
}

/* ---------------- Member Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; /* above the ☰ button (140) */
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(3, 4, 6, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.35s var(--ease-out), visibility 0.35s;
}
.modal-backdrop.is-open {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.modal-card {
  position: relative;
  width: min(540px, 100%);
  border-radius: 32px;
  padding: 32px;
  display: flex; flex-direction: column; gap: 20px;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.4s var(--ease-out);
  background: linear-gradient(145deg, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.03) 60%, rgba(255,255,255,0.01) 100%);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.36),
    inset 0 0 0 1px rgba(255,255,255,0.12),
    inset 0 -20px 40px rgba(0,0,0,0.5),
    0 30px 80px rgba(0,0,0,0.95);
}
.modal-backdrop.is-open .modal-card {
  transform: translateY(0) scale(1);
}
.modal-close {
  position: absolute; top: 22px; right: 22px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: rgba(255,255,255,0.07);
  color: #fff; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: background 0.25s, transform 0.25s;
}
.modal-close:hover { background: rgba(255,255,255,0.18); transform: rotate(90deg); }
.modal-header { display: flex; align-items: center; gap: 20px; }
.modal-avatar {
  position: relative; width: 80px; height: 80px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #2a2d33 0%, #0b0c0e 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -6px 12px rgba(0,0,0,0.6), 0 8px 24px rgba(0,0,0,0.7);
}
.modal-avatar span {
  font-family: var(--font-fraktur); font-size: 42px; line-height: 1;
  background: var(--title-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.modal-heading { display: flex; flex-direction: column; min-width: 0; }
.modal-name {
  margin: 2px 0 0; font-family: var(--font-gothic); font-weight: 700;
  font-size: 36px; line-height: 1; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff 0%, #c9cdd3 70%, #8b9097 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-sub { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-dim); }
.modal-section { display: flex; flex-direction: column; gap: 6px; }
.modal-label { font: 600 11px var(--font-mono); letter-spacing: 0.2em; color: var(--ink-faint); text-transform: uppercase; }
.modal-text { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.modal-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-info-item {
  padding: 12px 16px; border-radius: 16px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.modal-info-val { font: 600 13px var(--font-mono); color: #fff; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ---------------- Card editor ---------------- */
/* bar under the search/filters: login state + "สร้างการ์ด" */
.admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  margin-top: -10px;
  font-size: 13px; color: var(--ink-dim);
}
.admin-bar:empty { display: none; }
.ab-test {
  padding: 4px 10px; border-radius: 999px;
  font: 600 10px var(--font-mono); letter-spacing: 0.16em; color: #fbbf24;
  box-shadow: inset 0 0 0 1px rgba(251,191,36,0.4);
}
.ab-user b { color: var(--ink); font-weight: 600; }
.ab-note { color: var(--ink-faint); }
.ab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 13px var(--font-body); color: var(--ink);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: background 0.25s, transform 0.25s var(--ease-out);
}
.ab-btn:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
.ab-primary { color: #000; background: linear-gradient(180deg, #ffffff 0%, #d9dde3 100%); box-shadow: 0 10px 26px -10px rgba(255,255,255,0.4); }
.ab-primary:hover { background: #fff; }
.ab-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* pencil on each card (only for people allowed to edit that crew) */
.mc-top-right { display: inline-flex; align-items: center; gap: 10px; }
.mc-edit {
  width: 30px; height: 30px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--ink);
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  transition: background 0.25s, transform 0.25s var(--ease-out);
}
.mc-edit:hover { background: #fff; color: #000; transform: scale(1.08); }
.mc-edit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* editor / test-login dialog */
.editor-card { width: min(600px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; gap: 18px; }
.editor-title { margin: 0; font-weight: 800; font-size: 24px; }
.editor-sub { margin: -12px 0 0; font-size: 13px; color: var(--ink-dim); }
.editor-avatar-row { display: flex; align-items: center; gap: 18px; }
.editor-avatar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-avatar-actions small { flex-basis: 100%; font-size: 11.5px; color: var(--ink-faint); }
.editor-upload { cursor: pointer; }
.editor-upload:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span { font: 600 12px var(--font-body); letter-spacing: 0.04em; color: var(--ink-faint); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 0; border-radius: 14px;
  font: 500 14px var(--font-body); color: #fff;
  background: rgba(0,0,0,0.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
  outline: none; transition: box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #aaa 50%), linear-gradient(135deg, #aaa 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { color: #000; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), 0 0 0 3px rgba(255,255,255,0.08); }
.field input::placeholder { color: var(--ink-faint); }
.editor-error { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 13px; color: #fecaca; background: rgba(239,68,68,0.12); box-shadow: inset 0 0 0 1px rgba(239,68,68,0.35); }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ed-spacer { flex: 1; }
.ed-btn {
  height: 42px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 13.5px var(--font-body); color: var(--ink);
  background: rgba(255,255,255,0.07);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
  transition: background 0.25s, opacity 0.25s;
}
.ed-btn:hover:not(:disabled) { background: rgba(255,255,255,0.15); }
.ed-btn:disabled { opacity: 0.5; cursor: progress; }
.ed-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ed-primary { color: #000; background: linear-gradient(180deg, #ffffff 0%, #d9dde3 100%); }
.ed-primary:hover:not(:disabled) { background: #fff; }
.ed-danger { color: #fca5a5; box-shadow: inset 0 0 0 1px rgba(239,68,68,0.45); background: rgba(239,68,68,0.08); }
.ed-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }
.editor-confirm {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(239,68,68,0.1); box-shadow: inset 0 0 0 1px rgba(239,68,68,0.35);
  font-size: 13.5px;
}
.editor-confirm span { flex: 1; min-width: 160px; }
@media (max-width: 520px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-card { padding: 24px 18px; }
}

/* ---------------- Button size (menu → ขนาดปุ่ม) ---------------- */
:root { --ui-scale: 1; --card-scale: 1; } /* set live from the menu (js/menu.js) */
.crew-row, .role-bands { zoom: var(--card-scale); }
.enter-btn, .back-btn, .menu-btn, .player, .filter-btn, .search, .cc-btn, .mc-link, .mc-edit,
.ab-btn, .crew-pager, .ed-btn, .mp-item, .signin-primary, .signin-trigger {
  zoom: var(--ui-scale);
}

/* ---------------- Hamburger menu ---------------- */
/* plain overlay icon, flush right — no button chrome */
.menu-btn {
  position: fixed; z-index: 140;
  top: max(26px, calc(env(safe-area-inset-top) + 18px));
  right: 14px;
  width: 34px; height: 34px; padding: 0; border: 0; cursor: pointer;
  display: grid; place-content: center; gap: 4px;
  color: var(--ink); background: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.9));
  opacity: 0; animation: fade 1.2s var(--ease-out) 1.9s forwards;
  transition: transform 0.3s var(--ease-out);
}
.menu-btn:hover { transform: scale(1.1); }
.menu-btn span {
  display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform 0.4s var(--ease-out), opacity 0.25s;
}
.menu-btn.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { opacity: 0; }
.menu-btn.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-btn.is-signed-in::after { /* small dot = signed in */
  content: ""; position: absolute; top: 3px; right: 1px; width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 6px #4ade80;
}
.menu-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* light dim, no blur: size changes stay visible behind the panel */
.menu-scrim {
  position: fixed; inset: 0; z-index: 130;
  background: linear-gradient(90deg, rgba(3,4,6,0.05) 0%, rgba(3,4,6,0.45) 100%);
  opacity: 0; transition: opacity 0.35s var(--ease-out);
}
.menu-scrim.is-on { opacity: 1; }
.menu-panel {
  position: fixed; z-index: 135; top: 0; right: 0; bottom: 0;
  width: min(380px, 100%);
  display: flex; flex-direction: column; gap: 18px;
  padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(28,30,36,0.92) 0%, rgba(8,9,11,0.96) 100%);
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.12), -30px 0 80px rgba(0,0,0,0.7);
  transform: translateX(105%); visibility: hidden;
  transition: transform 0.5s var(--ease-out), visibility 0.5s;
}
.menu-panel.is-open { transform: none; visibility: visible; }
.mp-head { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 50px; padding-right: 44px; }
.mp-brand { font-family: var(--font-gothic); font-weight: 700; font-size: 20px; letter-spacing: 0.03em; }
.mp-brand b { font-family: var(--font-fraktur); font-weight: 400; color: var(--ink-dim); }
.mp-title { font: 600 11px var(--font-mono); letter-spacing: 0.32em; color: var(--ink-faint); }
.mp-label { margin: 0 0 10px; font: 600 12px var(--font-body); letter-spacing: 0.04em; color: var(--ink-faint); }

.mp-account {
  padding: 18px; border-radius: 22px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.mp-guest { display: flex; flex-direction: column; gap: 14px; }
.mp-avatar.is-guest { font-family: var(--font-body); font-size: 22px; color: var(--ink-faint); }
.mp-guest .mp-who small { font: 500 12.5px var(--font-body); letter-spacing: 0; }
.mp-user { display: flex; align-items: center; gap: 14px; }
.mp-avatar, .pf-avatar {
  flex: none; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-fraktur); line-height: 1;
  background: radial-gradient(circle at 35% 30%, #2a2d33 0%, #0b0c0e 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 0 0 1px rgba(255,255,255,0.12);
}
.mp-avatar { width: 52px; height: 52px; font-size: 28px; }
.mp-who { display: flex; flex-direction: column; min-width: 0; }
.mp-who b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-who small { margin-top: 3px; font: 500 11px var(--font-mono); color: var(--ink-faint); letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; }

.mp-list { display: flex; flex-direction: column; gap: 6px; }
.mp-list:empty { display: none; }
.mp-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border: 0; border-radius: 16px; cursor: pointer; text-align: left;
  font: 600 14px var(--font-body); color: var(--ink);
  background: transparent;
  transition: background 0.25s;
}
.mp-item:hover, .mp-item:focus-visible { background: rgba(255,255,255,0.07); outline: none; }
.mp-item span { flex: 1; }
.mp-item small { font-size: 12px; font-weight: 500; color: var(--ink-faint); }
.mp-item i { font-style: normal; font-size: 20px; color: var(--ink-faint); transition: transform 0.3s var(--ease-out); }
.mp-item:hover i { transform: translateX(3px); }
#mpSignout { color: #fca5a5; }

.mp-foot { margin-top: auto; text-align: center; font: 600 10px var(--font-mono); letter-spacing: 0.28em; color: var(--ink-faint); }

/* menu groups */
.mp-group { display: flex; flex-direction: column; gap: 10px; }
.mp-group-head { display: flex; align-items: center; justify-content: space-between; }
.mp-group-head .mp-label { margin: 0; }
.mp-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-navbtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 14px; border: 0; border-radius: 16px; cursor: pointer; text-align: left;
  font: 600 13.5px var(--font-body); color: var(--ink);
  background: rgba(255,255,255,0.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
  transition: background 0.25s, transform 0.25s var(--ease-out);
}
.mp-navbtn svg { color: var(--ink-dim); }
.mp-navbtn:hover, .mp-navbtn:focus-visible { background: rgba(255,255,255,0.09); transform: translateY(-1px); outline: none; }
.mp-reset {
  padding: 4px 12px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 12px var(--font-body); color: var(--ink-dim); background: rgba(255,255,255,0.06);
}
.mp-reset:hover { color: #fff; background: rgba(255,255,255,0.12); }

/* size controls */
.mp-ctl {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 18px;
  background: rgba(255,255,255,0.035); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
}
.mp-ctl-head { display: flex; align-items: center; justify-content: space-between; }
.mp-ctl-name { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.mp-ctl-name svg { color: var(--ink-dim); }
.mp-ctl-val { min-width: 52px; padding: 3px 10px; border-radius: 999px; text-align: center; font: 700 13px var(--font-mono); background: rgba(0,0,0,0.4); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.mp-ctl-row { display: flex; align-items: center; gap: 10px; }
.mp-step {
  flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
  font: 500 18px/1 var(--font-body); color: var(--ink);
  background: rgba(255,255,255,0.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.mp-step:hover:not(:disabled) { background: rgba(255,255,255,0.16); }
.mp-step:disabled { opacity: 0.3; cursor: default; }
.mp-range {
  --fill: 50%;
  flex: 1; height: 6px; margin: 0; border-radius: 999px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(90deg, #fff 0 var(--fill), rgba(255,255,255,0.14) var(--fill) 100%);
}
.mp-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #c9ced6); box-shadow: 0 0 0 4px rgba(255,255,255,0.12), 0 4px 10px rgba(0,0,0,0.6);
}
.mp-range::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; }
.mp-range:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.mp-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-presets button {
  height: 30px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 12.5px var(--font-body); color: var(--ink-dim); background: rgba(0,0,0,0.3);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.mp-presets button:hover { color: #fff; }
.mp-presets button.is-active { color: #000; background: linear-gradient(180deg, #ffffff 0%, #d9dde3 100%); box-shadow: none; }
.mp-note { margin: 0; font-size: 12px; color: var(--ink-faint); }

/* ---------------- Profile ---------------- */
.profile-card { width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding-top: 0; gap: 18px; }
.pf-cover {
  height: 96px; margin: 0 -32px;
  background:
    radial-gradient(80% 120% at 20% 0%, rgba(255,255,255,0.18), transparent 60%),
    radial-gradient(60% 100% at 90% 30%, rgba(255,255,255,0.08), transparent 70%),
    linear-gradient(180deg, #1b1d22, #0b0c0e);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pf-head { display: flex; align-items: flex-end; gap: 16px; margin-top: -54px; }
.pf-avatar { width: 92px; height: 92px; font-size: 48px; box-shadow: 0 0 0 4px #0b0c0e, 0 0 0 5px rgba(255,255,255,0.18), 0 12px 30px rgba(0,0,0,0.7); }
.pf-avatar, .mp-avatar { color: #e9ecf1; }
.pf-id { min-width: 0; padding-bottom: 6px; }
.pf-name { margin: 0; font-family: var(--font-gothic); font-weight: 700; font-size: 28px; line-height: 1.1; overflow-wrap: anywhere; }
.pf-user { margin: 4px 0 0; font: 500 12.5px var(--font-mono); color: var(--ink-faint); }
.pf-user:empty { display: none; }
.pf-grid { display: grid; gap: 8px; }
.pf-row {
  display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 14px;
  background: rgba(0,0,0,0.3); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
}
.pf-row span { font: 600 12px var(--font-body); letter-spacing: 0.04em; color: var(--ink-faint); align-self: center; }
.pf-row b { font: 600 13.5px var(--font-mono); overflow-wrap: anywhere; text-align: right; }
.pf-section .mp-label { margin-bottom: 10px; }
.pf-crews { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip {
  --accent: #fff;
  padding: 7px 14px; border-radius: 999px; font: 600 12.5px var(--font-body);
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.pf-chip.is-admin { --accent: #f5c542; }
.pf-empty { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-faint); }

/* profile: accent colour, picture, bio, edit form */
.profile-card { --pf-accent: #ffffff; }
.pf-cover {
  background:
    radial-gradient(80% 140% at 15% 0%, color-mix(in srgb, var(--pf-accent) 45%, transparent), transparent 65%),
    radial-gradient(60% 100% at 90% 30%, color-mix(in srgb, var(--pf-accent) 18%, transparent), transparent 70%),
    linear-gradient(180deg, #1b1d22, #0b0c0e) !important;
  transition: background 0.4s;
}
.pf-avatar { overflow: hidden; box-shadow: 0 0 0 4px #0b0c0e, 0 0 0 6px var(--pf-accent), 0 12px 30px rgba(0,0,0,0.7) !important; }
.pf-avatar img, .mp-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mp-avatar { overflow: hidden; }
.pf-view, .pf-form { display: flex; flex-direction: column; gap: 16px; }
.pf-view[hidden], .pf-form[hidden] { display: none; }
.pf-bio { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink-dim); white-space: pre-line; }
.pf-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pf-swatch {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.pf-swatch:hover { transform: scale(1.1); }
.pf-swatch.is-active { box-shadow: 0 0 0 2px #0b0c0e, 0 0 0 4px #fff; }
.pf-swatch:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.pf-colors input[type="color"] { width: 34px; height: 34px; padding: 3px; border: 0; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,0.08); }

/* ---------------- Settings window ---------------- */
.settings-card {
  width: min(940px, 100%); height: min(760px, calc(100dvh - 40px));
  padding: 0; gap: 0; overflow: hidden;
  display: grid; grid-template-columns: 220px 1fr;
}
.settings-card > .modal-close { z-index: 3; }
.st-nav {
  display: flex; flex-direction: column; gap: 4px;
  padding: 28px 14px; border-right: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
}
.st-title { margin: 0 10px 16px; font-weight: 800; font-size: 22px; }
.st-tab {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 0; border-radius: 14px; cursor: pointer; text-align: left;
  font: 600 14px var(--font-body); color: var(--ink-dim); background: transparent;
  transition: background 0.2s, color 0.2s;
}
.st-tab:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
.st-tab.is-active { color: #000; background: linear-gradient(180deg, #ffffff 0%, #d9dde3 100%); }
.st-tab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.st-tab[hidden] { display: none; }
.st-pane { position: relative; overflow-y: auto; padding: 28px 32px 32px; }
.st-section { display: flex; flex-direction: column; gap: 16px; }
.st-section[hidden] { display: none; }
.st-section .editor-title { margin-right: 48px; }
/* profile pane reuses the profile-card look without being a separate modal */
.st-section.profile-card { width: auto; max-height: none; overflow: visible; padding: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; }
.st-section .pf-cover { margin: -28px -32px 0; }
.st-section.admin-card { width: auto; }
.st-section .mp-display { gap: 12px; }
.st-signin { width: auto; padding: 0 28px; }

@media (max-width: 720px) {
  .settings-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: calc(100dvh - 24px); }
  .st-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding: 18px 56px 12px 14px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); scrollbar-width: none; }
  .st-title { display: none; }
  .st-tab { flex: none; width: auto; padding: 9px 14px; }
  .st-pane { padding: 22px 18px 26px; }
  .st-section .pf-cover { margin: -22px -18px 0; }
}

/* ---------------- Card hub ---------------- */
.ch-list { display: flex; flex-direction: column; gap: 10px; }
.ch-item {
  --accent: #fff;
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 10px 16px 10px 10px; border: 0; border-radius: 18px; cursor: pointer; text-align: left;
  color: var(--ink); background: rgba(0,0,0,0.3);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: box-shadow 0.3s, transform 0.3s var(--ease-out);
}
.ch-item:hover, .ch-item:focus-visible { outline: none; transform: translateY(-1px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 10px 30px -12px color-mix(in srgb, var(--accent) 40%, transparent); }
.ch-thumb {
  flex: none; width: 76px; height: 50px; border-radius: 12px;
  background: #0b0c0e center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.ch-mark { display: grid; place-items: center; font: 700 22px var(--font-hero); color: var(--ink-faint); }
.ch-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ch-text b { font: 700 14px var(--font-hero); letter-spacing: 0.08em; text-transform: uppercase; }
.ch-text small { margin-top: 3px; font-size: 12px; color: var(--ink-faint); }
.ch-go { font-size: 12.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ---------------- Gang management (positions / roles) ---------------- */
.admin-card { width: min(680px, 100%); }
.admin-card.is-busy, #adminModal.is-busy .admin-card { cursor: progress; }
#adminModal.is-busy .adm-body { opacity: 0.6; pointer-events: none; }
.editor-sub b { color: var(--ink); }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-tab {
  --accent: #fff;
  height: 36px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 12px var(--font-hero); letter-spacing: 0.08em; color: var(--ink-dim); text-transform: uppercase;
  background: rgba(255,255,255,0.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.adm-tab.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.adm-body { display: flex; flex-direction: column; gap: 22px; transition: opacity 0.2s; }
.adm-sec { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.07); }
.adm-sec .mp-label { margin: 0; }
.adm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.adm-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(0,0,0,0.3); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
}
.adm-who { flex: 1; min-width: 140px; font-weight: 600; font-size: 14px; }
.adm-who small { font: 500 11.5px var(--font-mono); color: var(--ink-faint); }
.adm-chip {
  --accent: #a3acb9;
  padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.adm-perms { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.adm-perm { padding: 2px 8px; border-radius: 6px; font-size: 11.5px; color: var(--ink-dim); background: rgba(255,255,255,0.07); }
.adm-perm.is-none { color: var(--ink-faint); }
.adm-count { font-size: 12px; color: var(--ink-faint); }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-end { justify-content: flex-end; }
.adm-row select, .adm-row input:not([type]) , .adm-row input[type="text"] {
  flex: 1; min-width: 160px; height: 40px; padding: 0 12px; border: 0; border-radius: 12px;
  font: 500 13.5px var(--font-body); color: #fff; background: rgba(0,0,0,0.38);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); outline: none;
}
.adm-row select option { color: #000; }
.adm-row input[type="color"] { width: 44px; height: 40px; padding: 4px; border: 0; border-radius: 12px; background: rgba(0,0,0,0.38); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); cursor: pointer; }
.adm-row select:focus, .adm-row input:focus { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5); }
.adm-sm { height: 36px; padding: 0 14px; font-size: 12.5px; }
.adm-role-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,0.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.adm-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--ink-dim); }
.adm-checks label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.adm-checks input { width: 16px; height: 16px; accent-color: #fff; }
.adm-confirm select { height: 36px; border: 0; border-radius: 10px; padding: 0 10px; color: #fff; background: rgba(0,0,0,0.4); }
.adm-confirm select option { color: #000; }
.adm-hint { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-faint); }
.adm-tab-all { text-transform: none !important; font-family: var(--font-body) !important; letter-spacing: 0.02em !important; }
.adm-guide {
  padding: 14px 16px; border-radius: 16px; font-size: 13.5px; line-height: 1.7; color: var(--ink-dim);
  background: rgba(255,255,255,0.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.adm-guide > b { color: var(--ink); font-size: 14px; }
.adm-guide ol { margin: 6px 0 4px; padding-left: 20px; }
.adm-guide li b { color: var(--ink); }
.adm-search input {
  width: 100%; height: 42px; padding: 0 14px; border: 0; border-radius: 12px;
  font: 500 14px var(--font-body); color: #fff; background: rgba(0,0,0,0.38);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); outline: none;
}
.adm-search input:focus { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5); }
.adm-accounts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-acc {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(0,0,0,0.3); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
}
.adm-acc-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-fraktur); font-size: 22px; color: #e9ecf1;
  background: radial-gradient(circle at 35% 30%, #2a2d33 0%, #0b0c0e 70%); box-shadow: 0 0 0 1px rgba(255,255,255,0.14);
}
.adm-acc-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 3px; }
.adm-acc-name { font-weight: 700; font-size: 15px; }
.adm-me { margin-left: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #000; background: #f5c542; }
.adm-acc-sub { font: 500 12px var(--font-body); color: var(--ink-faint); }
.adm-acc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.adm-acc-chips .adm-chip { display: inline-flex; align-items: center; gap: 6px; }
.adm-none { font-size: 12px; color: var(--ink-faint); }
.adm-x {
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  font: 700 13px/1 var(--font-body); color: inherit; background: rgba(255,255,255,0.12);
}
.adm-x:hover { background: rgba(239,68,68,0.5); color: #fff; }
.adm-acc-grant { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-acc-grant select {
  height: 36px; max-width: 260px; padding: 0 10px; border: 0; border-radius: 10px;
  font: 500 13px var(--font-body); color: #fff; background: rgba(0,0,0,0.45); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.adm-acc-grant select option { color: #000; }
.adm-acc-grant .adm-uid {
  height: 36px; width: 210px; padding: 0 12px; border: 0; border-radius: 10px;
  font: 600 13px var(--font-mono); letter-spacing: 0.04em; color: #fff;
  background: rgba(0,0,0,0.45); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); outline: none;
}
.adm-uid::placeholder { font-family: var(--font-body); letter-spacing: 0; color: var(--ink-faint); }
.adm-acc-grant .adm-uid:focus, .adm-row .adm-uid:focus { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55); }
.adm-row .adm-uid { font-family: var(--font-mono); letter-spacing: 0.04em; }
.adm-acc-new { background: rgba(245,197,66,0.06); box-shadow: inset 0 0 0 1px rgba(245,197,66,0.3); }
.adm-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.adm-log li { display: flex; gap: 12px; color: var(--ink-dim); }
.adm-log time { flex: none; font: 500 11.5px var(--font-mono); color: var(--ink-faint); padding-top: 2px; }
.adm-log b { color: var(--ink); }

/* ---------------- Music card ---------------- */
.player {
  position: fixed; z-index: 30;
  top: max(16px, calc(env(safe-area-inset-top) + 10px));
  right: 56px; /* leave room for the ☰ menu icon */
  display: flex; align-items: center; gap: 10px;
  padding: 6px 7px 6px 6px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), inset 0 0 0 1px rgba(255,255,255,0.08), 0 16px 40px -15px rgba(0,0,0,0.9);
  opacity: 0; animation: fade 1.2s var(--ease-out) 1.9s forwards;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.vinyl-wrap {
  position: relative; width: 42px; height: 42px; flex: none;
  padding: 0; border: 0; background: none; cursor: pointer;
}
.vinyl {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-radial-gradient(circle, #0a0a0b 0 1px, #18181a 1.5px 2.5px),
    #111;
  box-shadow: 0 8px 22px rgba(0,0,0,0.85), inset 0 0 0 1px rgba(255,255,255,0.08);
  animation: spin 3.2s linear infinite;
  animation-play-state: paused;
}
.vinyl::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 15%, rgba(255,255,255,0.16) 20%, transparent 28% 65%, rgba(255,255,255,0.1) 70%, transparent 78%);
}
.vinyl-label {
  position: absolute; inset: 29%; border-radius: 50%;
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 2px #000;
}
.vinyl-hole { position: absolute; inset: 46%; border-radius: 50%; background: #050506; }
.tonearm {
  position: absolute; right: -4px; top: -3px; width: 20px; height: 20px;
  transform-origin: 80% 15%; transform: rotate(-28deg);
  transition: transform 0.8s var(--ease-out);
  pointer-events: none;
}
.tonearm::before { content: ""; position: absolute; right: 1px; top: 1px; width: 5px; height: 5px; border-radius: 50%; background: #d9dde2; box-shadow: 0 0 6px rgba(0,0,0,0.7); }
.tonearm span { position: absolute; right: 3px; top: 3px; width: 1.5px; height: 17px; background: linear-gradient(#eef0f2, #8b9097); transform-origin: top; transform: rotate(20deg); border-radius: 2px; }
.vinyl-state {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 50%; color: #fff; background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.3s;
}
.vinyl-wrap:hover .vinyl-state, .player:not(.is-playing) .vinyl-state { opacity: 1; }
.ic-pause { display: none; }
.player.is-playing .ic-play { display: none; }
.player.is-playing .ic-pause { display: block; }
.player.is-playing .vinyl { animation-play-state: running; }
.player.is-playing .tonearm { transform: rotate(0deg); }

.player-info { display: grid; gap: 2px; min-width: 0; width: 140px; }
.player-kicker { font: 600 8px var(--font-mono); letter-spacing: 0.2em; color: var(--ink-faint); }
.player-kicker { display: flex; justify-content: space-between; gap: 8px; }
.player-kicker b { font-weight: 600; color: var(--ink-faint); }
.player-nav { display: flex; gap: 4px; flex: none; }
.player-arrow svg { width: 13px; height: 13px; }
.player-arrow {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; padding: 0;
  border: 0; cursor: pointer; color: var(--ink);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: background 0.3s, transform 0.3s var(--ease-out), opacity 0.3s;
}
.player-arrow:hover:not(:disabled) { background: rgba(255,255,255,0.16); transform: scale(1.08); }
.player-arrow:active:not(:disabled) { transform: scale(0.94); }
.player-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.player-arrow:disabled { opacity: 0.3; cursor: default; }
/* vinyl label crossfades when the track changes */
.vinyl-label { transition: opacity 0.35s; }
.vinyl-label.is-swapping { opacity: 0; }
.player-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-row { display: flex; align-items: center; gap: 8px; }
.player-eq { display: flex; align-items: flex-end; gap: 2px; height: 9px; flex: none; }
.player-eq i { width: 2px !important; }
.player-eq i { width: 3px; height: 25%; background: #fff; border-radius: 1px; opacity: 0.8; }
.player.is-playing .player-eq i { animation: eq 0.9s ease-in-out infinite; }
.player-eq i:nth-child(2) { animation-delay: -0.3s !important; }
.player-eq i:nth-child(3) { animation-delay: -0.6s !important; }
.player-eq i:nth-child(4) { animation-delay: -0.15s !important; }
.player-eq i:nth-child(5) { animation-delay: -0.45s !important; }
.player-vol { flex: 1; display: flex; align-items: center; gap: 6px; color: var(--ink-faint); }
.player-vol input { width: 100%; accent-color: #fff; cursor: pointer; }

.yt-holder {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 200px;
  height: 200px;
  opacity: 0.001;
  pointer-events: none;
  z-index: -10;
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; top: 24px; left: 50%; z-index: 170;
  transform: translate(-50%, -20px);
  padding: 11px 22px; border-radius: 999px;
  background: rgba(20, 22, 26, 0.6);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 0 0 1px rgba(255,255,255,0.1), 0 14px 40px rgba(0,0,0,0.7);
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: transform 0.4s var(--ease-out), opacity 0.4s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Keyframes ---------------- */
@keyframes ring-spin { to { --ring-angle: 360deg; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes reveal {
  from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(14px) drop-shadow(0 10px 30px rgba(0,0,0,0.75)); }
  to   { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 10px 30px rgba(0,0,0,0.75)); }
}
@keyframes sweep { 0%, 55% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
@keyframes shine { 0% { left: -60%; } 45%, 100% { left: 130%; } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes grain { 0% { transform: translate(0,0); } 25% { transform: translate(-5%, 3%); } 50% { transform: translate(4%, -4%); } 75% { transform: translate(-3%, -2%); } }
@keyframes dive {
  0% { opacity: 0; transform: scale(0.2); }
  35% { opacity: 1; transform: scale(1.4); }
  70% { opacity: 1; transform: scale(3); background: #000; }
  100% { opacity: 0; transform: scale(3); background: #000; }
}
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 640px) {
  .hud { font-size: 9.5px; }
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.22em; }
  .hero-eyebrow span { width: 24px; }
  .enter-btn { height: 60px; }
  .player { gap: 6px; padding: 5px; }
  .player-info { display: none; }
  .vinyl-wrap { width: 36px; height: 36px; }
  .player-arrow { width: 26px; height: 26px; }
  .home-brand { font-size: 17px; }
  .home-brand b { display: none; }
  .player { right: 52px; }
  .rb-grid { grid-template-columns: 1fr; }
  .rb-head { gap: 10px; flex-wrap: wrap; }
  .rb-line { display: none; }
  .rb-count { margin-left: auto; }
  .home-body { padding-bottom: 60px; }
}

@media (max-width: 480px) {
  .modal-card { padding: 26px 18px; }
  .modal-info-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column; }
}

@media (max-height: 840px) {
  .hero-line-1 { font-size: clamp(28px, 5vw, 72px); }
  .hero-line-2 { font-size: clamp(24px, 4.1vw, 60px); }
  .enter-wrap { margin-top: clamp(24px, 4.5vh, 44px); }
  .enter-btn { height: 56px; }
}

@media (max-height: 680px) {
  .hero { padding-bottom: 20px; }
  .hero-eyebrow { margin-bottom: 6px; font-size: 11px; }
  .hero-line-1 { font-size: clamp(24px, 4vw, 56px); }
  .hero-line-2 { font-size: clamp(20px, 3.3vw, 46px); }
  .enter-wrap { margin-top: 18px; }
  .enter-btn { height: 50px; padding: 0 32px; font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .enter-btn::before, .enter-glow { animation: ring-spin 8s linear infinite !important; }
}
