:root {
  --bg:       #09090b;
  --panel:    #18181b;
  --border:   #27272a;
  --text:     #fafafa;
  --muted:    #a1a1aa;
  --dim:      #52525b;
  --accent:   #2dd4bf;
  --accent2:  #0f766e;
  --online:   #22c55e;
  --offline:  #ef4444;
  --amber:    #eab308;
  --discord:  #5865f2;
  --font:     'DM Sans', sans-serif;
  --mono:     'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--muted);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-texture {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 30% at 15% 0%, rgba(45,212,191,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 100%, rgba(45,212,191,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(250,250,250,0.01) 0%, transparent 70%);
}

.app { position: relative; z-index: 1; min-height: 100vh; }

/* Bar */
.bar {
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 24px;
}

.bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bar-mark {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 7px;
  color: var(--bg);
  font-size: 14px;
  box-shadow: 0 0 16px rgba(45,212,191,0.25);
}

.bar-name {
  font-size: 16px; font-weight: 700; color: var(--text);
  letter-spacing: -0.2px;
}

.bar-metrics {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}

.bar-metric {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
}

.bar-metric i { font-size: 12px; color: var(--dim); }

.bar-dot {
  width: 7px; height: 7px; border-radius: 50%;
  transition: background 0.3s, box-shadow 0.3s;
}

.bar-dot.online  { background: var(--online); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.bar-dot.offline { background: var(--offline); box-shadow: 0 0 6px rgba(239,68,68,0.5); }

.bar-val { font-weight: 700; color: var(--text); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.bar-key { color: var(--dim); }

.bar-div { width: 1px; height: 14px; background: var(--border); }

.bar-gauge {
  flex: 1; height: 3px; background: var(--border);
  border-radius: 2px; overflow: hidden; max-width: 120px; min-width: 50px;
}

.bar-gauge-fill {
  height: 100%; background: var(--online); border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1); width: 0%;
}

.bar-gauge-fill.warning { background: var(--amber); }
.bar-gauge-fill.danger  { background: var(--offline); }

.bar-user { flex-shrink: 0; }

.bar-user-inner {
  display: flex; align-items: center; gap: 8px;
}

.bar-user-inner.hidden { display: none; }

.bar-av {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border);
}

.bar-un {
  font-size: 13px; font-weight: 600; color: var(--text);
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.bar-badge {
  font-size: 9px; font-weight: 700; font-family: var(--mono);
  background: rgba(45,212,191,0.12); color: var(--accent);
  padding: 2px 7px; border-radius: 3px; letter-spacing: 0.3px;
  display: none;
}

.bar-out {
  color: var(--dim); text-decoration: none; font-size: 13px;
  opacity: 0; transition: opacity 0.15s;
}

.bar-user-inner:hover .bar-out { opacity: 1; }
.bar-out:hover { color: var(--text); }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  min-height: calc(100vh - 52px);
}

.grid-main {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 48px;
}

.grid-side {
  background: rgba(24,24,27,0.5);
  border-left: 1px solid var(--border);
  padding: 40px 32px;
  display: flex; flex-direction: column; gap: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.state.hidden { display: none; }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.hero-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(88,101,242,0.1); color: var(--discord);
  border-radius: 14px; font-size: 26px;
  margin-bottom: 24px;
}

.hero-h1 {
  font-size: 44px; font-weight: 800; color: var(--text);
  line-height: 1.05; letter-spacing: -0.8px; margin-bottom: 16px;
}

.hero-sub {
  font-size: 15px; color: var(--dim); line-height: 1.6;
  max-width: 380px; margin-bottom: 32px;
}

.hero-queue {
  position: relative;
}

/* Hero actions (centered buttons within left-aligned hero) */
.hero .btn-accent,
.hero .btn-primary,
.hero .btn-hero {
  align-self: center;
  max-width: 300px;
  justify-content: center;
  width: 100%;
}

.btn-hero {
  padding: 16px 36px; font-size: 16px; font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  padding: 14px 36px; border: none; border-radius: 12px;
  cursor: pointer; text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-sm { padding: 10px 22px; font-size: 13px; }

.btn-primary {
  background: var(--discord); color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-primary:hover {
  background: #4752c4;
  box-shadow: 0 4px 16px rgba(88,101,242,0.3);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-accent {
  background: var(--accent); color: var(--bg); font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-accent:hover {
  background: #5eead4;
  box-shadow: 0 4px 20px rgba(45,212,191,0.35);
  transform: translateY(-1px);
}

.btn-accent:active { transform: translateY(0); }

.btn-ghost {
  background: none; color: var(--dim); font-size: 12px;
  padding: 8px 0; font-weight: 500; display: block; margin: 12px auto 0;
}

.btn-ghost:hover { color: var(--text); }

/* Loader */
.loader {
  width: 36px; height: 36px; margin: 60px auto;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Whitelist status */
.wl-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--dim);
  margin-bottom: 28px;
  align-self: center;
}

.wl-dot { width: 7px; height: 7px; background: var(--online); border-radius: 50%; flex-shrink: 0; }
.wl-dot.denied { background: var(--offline); }

.wl-text { color: var(--dim); }

/* Queue */
.queue-tag {
  position: absolute; top: 0; right: 0;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  background: rgba(45,212,191,0.1); color: var(--accent);
  padding: 5px 12px; border-radius: 5px;
  display: none;
}

.queue-tag.visible { display: block; }

.queue-num-wrap {
  padding: 16px 0 8px;
}

.queue-num {
  font-family: var(--mono); font-size: clamp(96px, 14vw, 180px);
  font-weight: 800; color: var(--text);
  line-height: 1; font-variant-numeric: tabular-nums;
  letter-spacing: -4px;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 80%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.queue-info {
  display: flex; gap: 24px; margin: 8px 0 24px;
}

.qi-stat {
  display: flex; flex-direction: column; gap: 2px;
}

.qi-val {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums;
}

.qi-lbl { font-size: 11px; color: var(--dim); font-weight: 500; }

/* Queue track */
.queue-track {
  position: relative; height: 3px; background: var(--border);
  border-radius: 2px; margin-bottom: 12px; max-width: 360px;
}

.queue-track-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}

.queue-track-nodes {
  position: absolute; inset: 0;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: none;
}

.queue-track-nodes span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--border); transition: background 0.4s;
}

.queue-track-nodes span.passed {
  background: var(--accent); box-shadow: 0 0 8px rgba(45,212,191,0.5);
}

.queue-status {
  display: block; font-family: var(--mono);
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--dim); margin-bottom: 8px;
}

/* Ready */
.ready-signal {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(234,179,8,0.1); color: var(--amber);
  font-size: 24px; margin-bottom: 24px;
  animation: ready-glow 2s ease-in-out infinite;
}

@keyframes ready-glow {
  0%,100% { box-shadow: 0 0 0 rgba(234,179,8,0); }
  50%    { box-shadow: 0 0 24px rgba(234,179,8,0.2); }
}

.countdown {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 64px; font-weight: 800;
  color: var(--text); font-variant-numeric: tabular-nums;
  margin: 20px 0 32px; letter-spacing: -2px;
}

.cd-colon { color: var(--border); }

.expired-note {
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 12px; color: var(--offline);
  width: 100%;
}

.expired-note.hidden { display: none; }

.expired-note i { font-size: 14px; }

/* Side cards */
.side-card {
  background: rgba(24,24,27,0.6);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px;
}

.side-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.side-head i { font-size: 12px; color: var(--accent); }

.side-status {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}

.side-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.side-dot.online  { background: var(--online); box-shadow: 0 0 10px rgba(34,197,94,0.4); }
.side-dot.offline { background: var(--offline); box-shadow: 0 0 10px rgba(239,68,68,0.4); }

#side-status-text {
  font-size: 14px; font-weight: 700; color: var(--text);
}

.side-status-sub {
  font-size: 11px; color: var(--dim);
}

.side-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 14px;
}

.side-stat {
  display: flex; flex-direction: column; gap: 2px;
}

.side-stat-val {
  font-family: var(--mono); font-size: 18px; font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums;
}

.side-stat-lbl {
  font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.4px;
}

.side-bar-wrap {
  display: flex; align-items: center; gap: 10px;
}

.side-bar {
  flex: 1; height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}

.side-bar-fill {
  height: 100%; background: var(--online); border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1); width: 0%;
}

.side-bar-fill.warning { background: var(--amber); }
.side-bar-fill.danger  { background: var(--offline); }

.side-bar-pct {
  font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--dim);
}

/* Side roles */
.side-roles-list {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px;
}

.side-role {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: rgba(255,255,255,0.015);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px;
}

.side-role .role-name {
  display: flex; align-items: center; gap: 8px; color: var(--text);
}

.side-role .role-name::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

.side-role .role-points {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--accent);
}

.role-empty {
  font-size: 12px; color: var(--dim); padding: 8px 0; text-align: center;
}

.side-total {
  font-size: 11px; font-weight: 600; color: var(--dim); text-align: right;
}

.side-total strong { color: var(--accent); font-family: var(--mono); }

.side-card.hidden { display: none; }

/* Steps */
.steps {
  display: flex; flex-direction: column; gap: 8px;
}

.step {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--dim);
}

.step-n {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(45,212,191,0.1); color: var(--accent);
  font-family: var(--mono); font-size: 10px; font-weight: 700; flex-shrink: 0;
}

/* Toast */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}

.toast {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
  min-width: 290px; max-width: 380px;
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border-left: 3px solid var(--offline);
}

.toast.toast-out { animation: toast-out 0.2s ease-in forwards; }

.toast-icon { flex-shrink: 0; font-size: 16px; }
.toast-body { flex: 1; line-height: 1.4; }

.toast-close {
  flex-shrink: 0; background: none; border: none;
  color: var(--dim); cursor: pointer; font-size: 16px; padding: 0;
}

.toast-close:hover { color: var(--text); }

.toast-success { border-left-color: var(--online); }
.toast-success .toast-icon { color: var(--online); }
.toast-warning { border-left-color: var(--amber); }
.toast-warning .toast-icon { color: var(--amber); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .grid-side { border-left: none; border-top: 1px solid var(--border); padding: 28px 20px; }
  .grid-main { padding: 32px 20px; }
  .hero-h1 { font-size: 36px; }
  .queue-num { font-size: 100px !important; }
  .countdown { font-size: 48px; }
  .bar-metrics .bar-div { display: none; }
  .bar-gauge { display: none; }
  .bar-metrics { gap: 10px; font-size: 11px; }
  .bar { padding: 0 16px; gap: 12px; }
}
