/* Tridex shared design system — modern, dynamic, restrained. */
:root {
  --bg: #0b0e14;
  --bg-2: #0f131c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ecf4;
  --text-dim: #9aa5b8;
  --text-faint: #66708a;
  --accent: #5b8cff;
  --accent-2: #7c6cff;
  --accent-glow: rgba(91, 140, 255, 0.35);
  --good: #34d399;
  --good-glow: rgba(52, 211, 153, 0.6);
  --warn: #fbbf24;
  --bad: #f87171;
  --gold: #fcd34d;
  --silver: #cbd5e1;
  --bronze: #d8a06a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --maxw: 1080px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(91, 140, 255, 0.12), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(124, 108, 255, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #84a8ff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* --- Top navigation ------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 14, 20, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  font-size: 18px;
}
.brand .logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-weight: 900; color: white; font-size: 16px;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.brand .logo-img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; display: block; }
.nav-links { display: flex; gap: 6px; margin-left: 8px; }
.nav-links a {
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--surface); color: var(--text); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-spacer { flex: 1; }

/* --- User chip ----------------------------------------------------------- */
.user-chip {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
}
.user-chip img, .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; background: var(--surface-2);
}
.avatar.sm { width: 26px; height: 26px; }
.avatar.fallback {
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--text-dim);
  border: 1px solid var(--border);
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 11px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: white;
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn.primary:hover { box-shadow: 0 8px 26px var(--accent-glow); filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.discord { background: #5865f2; border-color: transparent; color: white; }
.btn.discord:hover { background: #4a57e0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card.tight { padding: 16px; }

/* --- Generic layout helpers --------------------------------------------- */
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 16px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-faint); margin: 0 0 12px;
}
h1 { letter-spacing: -0.03em; }

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding: 56px 0 28px;
  text-align: center;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 12px; font-weight: 850; }
.hero p { color: var(--text-dim); font-size: 17px; max-width: 560px; margin: 0 auto; }
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-glow);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
  border: 1px solid rgba(91, 140, 255, 0.25);
}

/* --- Countdown pills ----------------------------------------------------- */
.countdown {
  display: inline-flex; gap: 6px; align-items: stretch;
}
.cd-unit {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px; text-align: center; min-width: 48px;
}
.cd-unit b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-unit span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border);
}
.badge.open { color: var(--good); background: rgba(52, 211, 153, 0.12); border-color: rgba(52,211,153,0.25); }
.badge.locked { color: var(--bad); background: rgba(248, 113, 113, 0.12); border-color: rgba(248,113,113,0.25); }
.badge.soon { color: var(--warn); background: rgba(251, 191, 36, 0.12); border-color: rgba(251,191,36,0.25); }

/* --- Live dot ------------------------------------------------------------ */
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 var(--good-glow);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--good-glow); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* --- Toast / status ------------------------------------------------------ */
.status-msg { font-size: 14px; font-weight: 600; min-height: 20px; }
.status-msg.ok { color: var(--good); }
.status-msg.err { color: var(--bad); }

.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #131825; border: 1px solid var(--border-strong);
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); animation: toastIn 0.25s ease;
}
.toast.ok { border-color: rgba(52,211,153,0.4); }
.toast.err { border-color: rgba(248,113,113,0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- Modal --------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 7, 11, 0.7);
  backdrop-filter: blur(4px); z-index: 90;
  display: grid; place-items: center; padding: 20px;
  animation: fade 0.2s ease;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); width: 100%; max-width: 880px;
  max-height: 86vh; overflow: auto; box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-2); }
.modal-body { padding: 20px; }
.x-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* --- Inputs -------------------------------------------------------------- */
input, select {
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 12px; border-radius: 10px; font-family: inherit; font-size: 14px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }

/* --- Footer -------------------------------------------------------------- */
.footer { text-align: center; color: var(--text-faint); font-size: 13px; padding: 40px 0; }

.reveal { opacity: 0; transform: translateY(14px); animation: reveal 0.5s ease forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
