@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;800&family=Manrope:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --void: #0a0612;
  --deep: #150a26;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-border: rgba(255, 255, 255, 0.09);
  --violet: #8b5cf6;
  --magenta: #f0399a;
  --gold: #ffd166;
  --text-primary: #f5eefb;
  --text-muted: #a996c2;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.sunset-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    #140a2e 0%,
    #2c0f4a 20%,
    #5a1758 42%,
    #9a2260 58%,
    #c94a3f 76%,
    #7a2a1f 100%
  );
}

.palm-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom center;
  opacity: 0.85;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Header ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 12px 2px var(--magenta);
}

.auth-slot {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-login {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.btn-login:hover { border-color: var(--violet); transform: translateY(-1px); }
.btn-login svg { width: 16px; height: 16px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 6px 16px 6px 6px;
  border-radius: 100px;
}
.user-chip img { width: 30px; height: 30px; border-radius: 50%; display: block; }
.user-chip .name { font-size: 14px; font-weight: 700; }
.user-chip .admin-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.4);
  padding: 1px 6px;
  border-radius: 100px;
}
.link-quiet {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  font-weight: 600;
}
.link-quiet:hover { color: var(--text-primary); }

/* ---------- Hero / pulse signature ---------- */

.hero {
  position: relative;
  padding: clamp(40px, 9vw, 90px) 24px 30px;
  text-align: center;
  overflow: hidden;
}

.eyebrow {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px 1px #34d399;
}

.hero h1 {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 12vw, 128px);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #ffffff 0%, #d9c4f7 55%, var(--magenta) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.sub {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 18px auto 40px;
  color: var(--text-muted);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
}

.btn-join {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: #12071f;
  background: linear-gradient(120deg, var(--magenta), var(--violet));
  padding: 18px 40px;
  border-radius: 100px;
  text-decoration: none;
  box-shadow: 0 0 24px 2px rgba(240, 57, 154, 0.35);
  transition: transform 0.2s ease;
}
.btn-join:hover { transform: translateY(-2px) scale(1.02); }

.hero-meta {
  position: relative;
  z-index: 2;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Roles panel ---------- */

.panel {
  max-width: 640px;
  margin: 10px auto 80px;
  padding: 28px clamp(20px, 5vw, 36px);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  backdrop-filter: blur(6px);
}
.panel h2 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}
.panel .desc {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 18px;
}

.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.role-chip {
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--chip-color, var(--violet));
  color: var(--chip-color, var(--violet));
  background: color-mix(in srgb, var(--chip-color, var(--violet)) 12%, transparent);
}
.role-chip.empty { color: var(--text-muted); border-color: var(--surface-border); }

.btn-save {
  width: 100%;
  background: linear-gradient(120deg, var(--violet), var(--magenta));
  color: #fff;
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14.5px;
  transition: filter 0.2s ease;
}
.btn-save:hover { filter: brightness(1.1); }
.btn-save:disabled { opacity: 0.6; cursor: default; }

.save-msg {
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
  color: #34d399;
}

.signin-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

footer {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.7;
}

.hidden { display: none !important; }

/* ---------- Admin ---------- */

.admin-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 40px) 80px;
}

.admin-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 30px;
}
.admin-head h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  margin: 0;
}
.admin-head .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 40px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-border);
}

.table-wrap {
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
}
.who img { width: 28px; height: 28px; border-radius: 50%; }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.role-mini {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  margin: 2px 3px 2px 0;
  border: 1px solid var(--chip-color, var(--violet));
  color: var(--chip-color, var(--violet));
}
.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.denied {
  max-width: 480px;
  margin: 120px auto;
  text-align: center;
}
.denied h1 { font-family: var(--font-display); font-size: 28px; }
.denied p { color: var(--text-muted); }
