:root {
  --bg0: #05080f;
  --bg1: #0a101c;
  --bg2: #121a2b;
  --ink: #eef5ff;
  --muted: #8fa3c2;
  --line: rgba(0, 170, 255, 0.16);
  --accent: #00a8ff;
  --accent-2: #4cc9ff;
  --accent-deep: #0066cc;
  --ok: #3dd68c;
  --danger: #ff6b7a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --glow: 0 0 24px rgba(0, 168, 255, 0.28);
  --radius: 16px;
  --font-display: 'Orbitron', 'Segoe UI', sans-serif;
  --font-body: 'Sora', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg0);
  line-height: 1.5;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--accent-2);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(0, 168, 255, 0.22), transparent 55%),
    radial-gradient(700px 420px at 92% 0%, rgba(0, 102, 204, 0.18), transparent 50%),
    linear-gradient(165deg, #070c16 0%, #03050a 42%, #0a1220 100%);
}

.atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 8, 15, 0.82);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-logo {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.7rem;
  object-fit: cover;
  border: 1px solid rgba(0, 168, 255, 0.35);
  box-shadow: var(--glow);
  background: #000;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-text strong .accent-word {
  color: var(--accent-2);
}

.brand-text small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 0.35rem;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-link,
.btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.nav-link {
  background: transparent;
  color: var(--muted);
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: rgba(0, 168, 255, 0.1);
  border-color: rgba(0, 168, 255, 0.25);
}

.btn-primary {
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  color: #f4faff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 32px rgba(0, 168, 255, 0.4);
}

.btn-secondary {
  background: var(--bg2);
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: rgba(0, 168, 255, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255, 107, 122, 0.35);
}

.session {
  margin-left: auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-chip img {
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--line);
}

main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.hero {
  min-height: calc(100vh - 7rem);
  display: grid;
  align-items: center;
  gap: 1.5rem;
  max-width: 44rem;
  animation: rise 700ms ease both;
}

.hero-logo {
  width: min(100%, 22rem);
  height: auto;
  border-radius: 1rem;
  border: 1px solid rgba(0, 168, 255, 0.28);
  box-shadow: var(--glow), var(--shadow);
  background: #000;
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0;
  font-family: var(--font-display);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  line-height: 1.08;
  margin: 0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero h1 .accent-word {
  color: var(--accent-2);
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.panel {
  background: linear-gradient(180deg, rgba(18, 26, 43, 0.95), rgba(10, 16, 28, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  animation: rise 420ms ease both;
}

.panel.narrow {
  max-width: 34rem;
  margin: 0 auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.panel-head h2,
.block h3 {
  font-family: var(--font-display);
  margin: 0 0 0.25rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 1.05rem;
}

.panel-head p,
.hint,
.empty {
  color: var(--muted);
  margin: 0;
}

.stack {
  display: grid;
  gap: 0.85rem;
}

.stack label,
.inline {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.inline {
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(0, 168, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.12);
}

textarea {
  resize: vertical;
}

.row-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.row-form > * {
  flex: 1 1 10rem;
}

.row-form .btn {
  flex: 0 0 auto;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.guild-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 0.55rem;
}

.guild-card strong {
  font-size: 1.05rem;
}

.guild-card button {
  justify-self: start;
}

.dash-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.22);
}

.block.wide {
  grid-column: 1 / -1;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.form-msg {
  min-height: 1.25rem;
  color: var(--accent-2);
  margin: 0.5rem 0 0;
}

.form-msg.error {
  color: var(--danger);
}

.form-msg.ok {
  color: var(--ok);
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  color: var(--muted);
  font-weight: 600;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

.pill.unused {
  color: var(--accent-2);
}
.pill.redeemed {
  color: var(--ok);
}
.pill.revoked {
  color: var(--danger);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
  }
  .nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: auto;
    padding: 2rem 0;
  }
}
