/* ============================================================
   FANFEST Predictions — EVE Tactical HUD theme.
   Dark, slim, modern. Cyan secondary accent, monospace numerals,
   angular clipped corners, faint scanlines + hex grid backdrop.
   ============================================================ */

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

:root {
  --bg: #050912;
  --bg-soft: #0a1120;
  --panel: #0c1322;
  --panel-2: #131c30;
  --panel-3: #1a2540;
  --border: #1d2942;
  --border-soft: #16203a;
  --hairline: #2a3a5e;
  --text: #c8d4eb;
  --text-bright: #e6ebf5;
  --text-dim: #7889ad;
  --text-mute: #4d5b7f;
  --accent: #9146ff;
  --accent-dim: #7c3aed;
  --accent-soft: rgba(145, 70, 255, 0.18);
  --accent-glow: rgba(145, 70, 255, 0.4);
  --cyan: #5af2ff;
  --cyan-soft: rgba(90, 242, 255, 0.12);
  --cyan-glow: rgba(90, 242, 255, 0.35);
  --orange: #ff9a3c;
  --orange-soft: rgba(255, 154, 60, 0.14);
  --gold: #f5b942;
  --gold-soft: rgba(245, 185, 66, 0.16);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --red-glow: rgba(248, 113, 113, 0.5);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.14);
  --mono: 'JetBrains Mono', 'Consolas', monospace;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(90, 242, 255, 0.025) 0%, transparent 60%),
    repeating-linear-gradient(60deg, transparent 0, transparent 28px, rgba(29, 41, 66, 0.5) 28px, rgba(29, 41, 66, 0.5) 29px),
    repeating-linear-gradient(-60deg, transparent 0, transparent 28px, rgba(29, 41, 66, 0.5) 28px, rgba(29, 41, 66, 0.5) 29px);
  opacity: 0.5;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(255, 255, 255, 0.012) 2px,
    rgba(255, 255, 255, 0.012) 3px);
}
.app, .profile-layout, .admin-layout {
  position: relative;
  z-index: 2;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: 14px; }

input, select, textarea {
  font-family: inherit;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-bright);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-soft);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--cyan-glow); }

.tabular, .mono { font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-transform: uppercase;
  font-family: var(--mono);
}
.btn:hover { background: var(--panel-3); border-color: var(--cyan); color: var(--text-bright); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-soft);
}
.btn.primary:hover { background: var(--accent-dim); }
.btn.cyan { background: var(--cyan-soft); border-color: var(--cyan); color: var(--cyan); }
.btn.cyan:hover { background: var(--cyan); color: var(--bg); }
.btn.danger { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: var(--bg); }
.btn.success { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.btn.success:hover { background: var(--green); color: var(--bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text-bright); }

/* LAYOUT */
.app { display: grid; grid-template-rows: 56px 1fr 28px; height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-soft) 100%);
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--cyan-glow) 50%, transparent 100%);
  opacity: 0.5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  font-size: 13px;
  text-transform: uppercase;
}
.brand .title { color: var(--text-bright); }
.brand .sep { color: var(--hairline); font-weight: 400; font-size: 14px; }
.brand .status {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 1.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.brand .live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--text-mute);
  color: var(--text-mute);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
  transition: all 0.3s;
}
.brand .live-pill.live {
  border-color: var(--red);
  color: var(--red);
  text-shadow: 0 0 8px var(--red-glow);
  box-shadow: 0 0 12px var(--red-glow);
  animation: live-pulse 2.4s ease-in-out infinite;
}
.brand .live-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.brand .live-pill.live .dot { box-shadow: 0 0 8px currentColor; }
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 12px var(--red-glow); }
  50% { box-shadow: 0 0 20px var(--red-glow); }
}
.brand .channel-link { color: var(--text); margin-left: 4px; }
.brand .channel-link:hover { color: var(--cyan); text-decoration: none; }

.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-dim); }
.live-vote {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 8px;
  background: var(--cyan-soft);
  border: 1px solid var(--cyan);
  border-radius: 3px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  font-weight: 600;
}
.live-vote .blip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* MAIN GRID */
.main {
  display: grid;
  grid-template-columns: 1fr 320px 280px;
  gap: 1px;
  background: var(--hairline);
  overflow: hidden;
}
.main.chat-collapsed { grid-template-columns: 1fr 320px 36px; }

.col { background: var(--bg); overflow: hidden; display: flex; flex-direction: column; position: relative; }

.col-header {
  padding: 12px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
  background: var(--bg-soft);
  position: relative;
}
.col-header::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 14px; height: 100%;
  background: linear-gradient(90deg, var(--cyan-soft) 0%, transparent 100%);
  pointer-events: none;
}
.col-header h2 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--cyan);
  font-family: var(--mono);
}
.col-header .count {
  font-size: 10px;
  color: var(--text-mute);
  font-family: var(--mono);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.scroll { overflow-y: auto; flex: 1; padding: 12px 14px 20px; }
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--cyan); }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* PREDICTION CARDS */
.pred {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.pred::before {
  content: '';
  position: absolute;
  top: 0; left: 12px;
  width: 30px; height: 1px;
  background: var(--cyan);
  opacity: 0.6;
}
.pred.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-soft) inset, 0 4px 22px var(--cyan-soft);
}
.pred.active::before { opacity: 1; box-shadow: 0 0 6px var(--cyan); }
.pred.correct { border-left: 3px solid var(--green); }
.pred.wrong { border-left: 3px solid var(--red); }

.pred-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.pred-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-bright);
  letter-spacing: 0.2px;
}
.pred-title .pred-id {
  font-family: var(--mono);
  color: var(--cyan);
  margin-right: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}
.pred-title .pred-sep { color: var(--hairline); margin-right: 10px; font-weight: 400; }
.pred-text { display: inline; }
.pred-status {
  flex-shrink: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  padding: 4px 10px;
  border-radius: 3px;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--mono);
  border: 1px solid currentColor;
}
.status-pending { color: var(--blue); background: var(--blue-soft); }
.status-open    { color: var(--cyan); background: var(--cyan-soft); }
.status-closed  { color: var(--gold); background: var(--gold-soft); }
.status-correct { color: var(--green); background: var(--green-soft); }
.status-wrong   { color: var(--red); background: var(--red-soft); }

.pred-ratings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.rating-block {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.rating-block .label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-mute);
  margin-bottom: 6px;
  font-family: var(--mono);
  font-weight: 600;
}
.rating-block .value {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.rating-block .value.gold { color: var(--gold); }
.rating-block .value.cyan { color: var(--cyan); }
.rating-block .value .denom { color: var(--text-mute); font-size: 13px; font-weight: 400; }
.rating-block .meta {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 4px;
  font-family: var(--mono);
  letter-spacing: 0.4px;
}

.stars { display: inline-flex; gap: 2px; margin-left: 6px; }
.star {
  width: 10px; height: 10px;
  background: var(--text-mute);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.star.filled.gold { background: var(--gold); }
.star.filled.cyan { background: var(--cyan); }

.vote-progress {
  margin-top: 12px;
  height: 3px;
  background: var(--panel-2);
  border-radius: 1px;
  overflow: hidden;
}
.vote-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  box-shadow: 0 0 6px var(--cyan-glow);
  transition: width 0.3s;
}

/* PREDICTION ADMIN CONTROLS */
.pred-controls { display: none; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.is-admin .pred-controls { display: flex; }
.pred-controls .btn { font-size: 10px; padding: 5px 10px; }

/* CAST VOTE WIDGET */
.cast-vote {
  display: none;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--hairline);
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.is-logged-in .pred.active .cast-vote { display: flex; }
.cast-vote .label {
  font-size: 10px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-right: 4px;
  font-family: var(--mono);
  font-weight: 700;
}
.rating-btn {
  width: 32px;
  height: 32px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.15s;
  cursor: pointer;
  font-family: var(--mono);
}
.rating-btn:hover { background: var(--panel-3); border-color: var(--cyan); color: var(--cyan); }
.rating-btn.selected {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--bg);
  box-shadow: 0 0 10px var(--cyan-glow);
}
.cast-vote .your-vote {
  font-size: 10px;
  color: var(--cyan);
  margin-left: 4px;
  font-family: var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* LEADERBOARD */
.leaderboard-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  transition: background 0.15s, border-color 0.15s;
}
.leaderboard-item:hover { background: var(--panel-2); border-color: var(--border); }
.leaderboard-item .rank {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-mute);
  font-family: var(--mono);
  letter-spacing: 0.5px;
}
.leaderboard-item .rank::before { content: '#'; opacity: 0.5; }
.leaderboard-item.top1 .rank { color: var(--gold); }
.leaderboard-item.top2 .rank { color: #d1d5db; }
.leaderboard-item.top3 .rank { color: #b45309; }
.leaderboard-item .user { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.leaderboard-item .name {
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-bright);
}
.leaderboard-item .name:hover { text-decoration: underline; text-decoration-color: var(--cyan); }
.leaderboard-item .points {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.leaderboard-item .points .unit { color: var(--text-mute); font-weight: 400; font-size: 10px; margin-left: 2px; text-transform: uppercase; letter-spacing: 1px; }

.name-glow { text-shadow: 0 0 8px currentColor; }
.name-italic { font-style: italic; }
.name-bold { font-weight: 700; }
.user-icon { flex-shrink: 0; display: inline-flex; align-items: center; }
.user-icon img { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }
.user-icon .emoji { font-size: 13px; }

/* CHAT SIDEBAR */
.chat-toggle {
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
}
.chat-toggle:hover { color: var(--cyan); }

.chat-collapsed-bar {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 16px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  height: 100%;
  font-family: var(--mono);
  font-weight: 700;
}
.chat-collapsed-bar:hover { color: var(--cyan); }

.chat-msg {
  padding: 5px 4px;
  font-size: 12px;
  line-height: 1.45;
  border-bottom: 1px solid rgba(29, 41, 66, 0.5);
  word-wrap: break-word;
}
.chat-msg .who { font-weight: 600; cursor: pointer; }
.chat-msg .who:hover { text-decoration: underline; }
.chat-msg .badge {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 2px;
  vertical-align: text-bottom;
  margin-right: 4px;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  font-weight: 700;
  color: #fff;
  font-family: var(--mono);
}
.badge-broadcaster { background: var(--red); }
.badge-mod { background: var(--green); color: var(--bg); }
.badge-vip { background: #ec4899; }
.badge-sub { background: var(--accent); }
.chat-msg .text { color: var(--text); }
.chat-msg .cmd { color: var(--cyan); font-family: var(--mono); font-size: 11px; }
.chat-msg .system { color: var(--text-mute); font-style: italic; font-size: 11px; }

/* FLOATING USER CARDS (draggable, multi-open) */
.floating-card {
  position: fixed;
  width: 280px;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--hairline);
  overflow: hidden;
  border: 2px solid var(--cyan);
  z-index: 100;
  user-select: none;
  transition: box-shadow 0.15s;
}
.floating-card:hover { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--cyan-glow); }
.floating-card .drag-handle {
  height: 80px;
  background: linear-gradient(135deg, #1a2540, #131c30, #1a2540);
  position: relative;
  cursor: grab;
  overflow: hidden;
}
.floating-card .drag-handle:active { cursor: grabbing; }
.floating-card .drag-handle .banner-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.7;
  pointer-events: none;
}
.floating-card .drag-handle::after {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  pointer-events: none;
}
.floating-card .avatar {
  width: 70px; height: 70px;
  border-radius: 50%;
  background-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), var(--cyan));
  background-size: cover !important;
  background-position: center !important;
  border: 4px solid var(--panel);
  position: absolute;
  top: 45px;     /* anchor relative to card top so it never escapes */
  left: 18px;
  z-index: 2;
}
.floating-card .body { padding: 50px 18px 16px; position: relative; }
.floating-card .uname { font-weight: 600; font-size: 16px; margin-bottom: 2px; color: var(--text-bright); }
.floating-card .uhandle {
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 14px;
  font-family: var(--mono);
}
.floating-card .uhandle a { color: var(--cyan); }
.floating-card .stat-row {
  display: flex; justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.floating-card .stat-row:last-child { border-bottom: none; }
.floating-card .stat-row .l { color: var(--text-mute); text-transform: uppercase; font-size: 10px; letter-spacing: 1px; font-family: var(--mono); }
.floating-card .stat-row .v { font-weight: 600; color: var(--text-bright); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.floating-card .close-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid var(--hairline);
  z-index: 3;
}
.floating-card .close-btn:hover { background: var(--red); border-color: var(--red); }

/* ADMIN PAGE */
.admin-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 1px;
  background: var(--hairline);
  overflow: hidden;
  height: calc(100vh - 56px);
}
.admin-nav { background: var(--panel); padding: 16px 0; }
.admin-nav-item {
  display: block;
  padding: 10px 20px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  font-family: var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
}
.admin-nav-item:hover { color: var(--cyan); background: var(--panel-2); }
.admin-nav-item.active { color: var(--cyan); background: var(--panel-2); border-left-color: var(--cyan); }
.admin-content { overflow-y: auto; padding: 24px 32px; background: var(--bg); }
.admin-section { display: none; max-width: 820px; }
.admin-section.active { display: block; }
.admin-section h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; color: var(--text-bright); letter-spacing: 0.3px; }
.admin-section .sub { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; }
.admin-section h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cyan);
  margin: 24px 0 12px;
  font-weight: 700;
  font-family: var(--mono);
}

.form-row { display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 12px; margin-bottom: 10px; }
.form-row label { font-size: 12px; color: var(--text-dim); font-family: var(--mono); letter-spacing: 0.4px; text-transform: uppercase; }
.form-row input, .form-row select { width: 100%; }
.form-row .hint { font-size: 11px; color: var(--text-mute); margin-top: 4px; grid-column: 2; font-family: var(--mono); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 14px;
  width: 24px; height: 1px;
  background: var(--cyan);
  opacity: 0.4;
}

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  width: 460px;
  background: var(--panel);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--cyan-soft);
}
.modal h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-bright);
  font-family: var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.modal p { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* PROFILE PAGE */
.profile-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1px;
  background: var(--hairline);
  overflow: hidden;
  height: calc(100vh - 56px);
}
.profile-sidebar { background: var(--panel); padding: 24px; overflow-y: auto; }
.profile-content { background: var(--bg); padding: 24px 32px; overflow-y: auto; position: relative; }

.profile-preview {
  position: relative;
  width: 100%;
  max-width: 290px;
}
.preview-card {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 2px solid var(--cyan);
  overflow: hidden;
}
.preview-card .banner {
  height: 80px;
  background: linear-gradient(135deg, #1a2540, var(--accent), #1a2540);
  position: relative;
  overflow: hidden;
}
.preview-card .banner-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.7;
}
.preview-card .avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), var(--cyan));
  background-size: cover !important;
  background-position: center !important;
  border: 4px solid var(--panel);
  position: absolute;
  top: 45px;
  left: 18px;
  z-index: 2;
}
.preview-card .body { padding: 50px 18px 18px; }
.preview-card .uname { font-weight: 600; font-size: 16px; margin-bottom: 2px; color: var(--text-bright); }
.preview-card .uhandle { font-size: 11px; color: var(--text-mute); margin-bottom: 14px; font-family: var(--mono); }
.preview-card .stat-row {
  display: flex; justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.preview-card .stat-row:last-child { border-bottom: none; }
.preview-card .stat-row .l { color: var(--text-mute); text-transform: uppercase; font-size: 10px; letter-spacing: 1px; font-family: var(--mono); }
.preview-card .stat-row .v { font-weight: 600; color: var(--text-bright); font-family: var(--mono); }

.bb-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.5px;
}
.bb-badge .symbol { font-weight: 700; }

.cust-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}
.cust-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cust-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cust-grid.cols-icon { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }

.cust-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.cust-option:hover { border-color: var(--cyan); }
.cust-option.selected {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  box-shadow: 0 0 0 1px var(--cyan-soft);
}
.cust-option.owned::after {
  content: 'OWNED';
  position: absolute;
  top: 4px; right: 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.8px;
  color: var(--green);
  background: var(--green-soft);
  padding: 1px 4px;
  border-radius: 2px;
}
.cust-option .swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}
.cust-option .cost {
  margin-left: auto;
  font-size: 10px;
  color: var(--gold);
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.cust-option .cost.free { color: var(--text-mute); }
.cust-option .icon-img { width: 38px; height: 38px; object-fit: contain; }
.cust-option .icon-name {
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 2px;
  font-family: var(--mono);
  letter-spacing: 0.3px;
}
.cust-option.icon-cell {
  flex-direction: column;
  gap: 4px;
  padding: 8px 6px;
  justify-content: center;
  text-align: center;
  align-items: center;
}
.cust-option.icon-cell .cost { margin-left: 0; }

.color-wheel-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--cyan);
  background: var(--bg-soft);
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 22px;
}
.color-wheel-trigger:hover { background: var(--cyan-soft); }
.color-wheel-trigger.selected { background: var(--cyan-soft); border-style: solid; }
.color-wheel-trigger .swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--hairline); }
.color-wheel-trigger .label { font-size: 12px; }
.color-wheel-trigger .cost { margin-left: auto; font-family: var(--mono); color: var(--gold); font-size: 10px; font-weight: 600; }

.action-bar {
  position: sticky;
  bottom: 0;
  margin: 24px -32px -24px;
  padding: 16px 32px;
  background: linear-gradient(180deg, rgba(5, 9, 18, 0) 0%, var(--bg) 50%);
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 10;
}
.action-bar .summary {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.4px;
}
.action-bar .summary .cost { color: var(--gold); font-weight: 700; }
.action-bar .summary .cost.over { color: var(--red); }

/* LOGIN AREA IN TOPBAR */
.login-area { display: flex; align-items: center; gap: 10px; }
.login-area .username {
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-bright);
}
.login-area .username:hover { color: var(--cyan); }
.bb-balance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold-soft);
  color: var(--gold);
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.5px;
  border: 1px solid var(--gold);
}

/* FOOTER */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--bg-soft);
  border-top: 1px solid var(--hairline);
  font-size: 10px;
  color: var(--text-mute);
  font-family: var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--cyan); text-decoration: none; }
.footer .left, .footer .right { display: flex; align-items: center; gap: 12px; }
.footer .sep { color: var(--hairline); }

/* ANIMATIONS (firework + spaceship) */
.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}

.fx-firework {
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px currentColor;
  animation: firework-launch 1.4s ease-out forwards;
}
@keyframes firework-launch {
  0%   { transform: translate(0, 0) scale(0.5); opacity: 1; }
  60%  { transform: translate(0, -60vh) scale(1.2); opacity: 1; }
  61%  { transform: translate(0, -60vh) scale(1.2); opacity: 0; }
  100% { transform: translate(0, -60vh) scale(1.2); opacity: 0; }
}
.fx-burst-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: burst 1.2s ease-out forwards;
}
@keyframes burst {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 100px), var(--dy, 100px)) scale(0); opacity: 0; }
}

.fx-ship {
  position: absolute;
  width: 96px;
  height: 96px;
  animation: ship-fly 5.5s linear forwards;
}
.fx-ship img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px var(--cyan-glow));
}
@keyframes ship-fly {
  0%   { left: -120px; top: var(--ship-top, 30%); transform: rotate(-3deg) scale(0.85); }
  50%  { transform: rotate(2deg) scale(1); }
  100% { left: calc(100% + 120px); top: var(--ship-top, 35%); transform: rotate(-2deg) scale(0.85); }
}

/* TOAST */
.toast-host {
  position: fixed;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--cyan);
  border-left: 3px solid var(--cyan);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.4px;
  animation: slideUp 0.2s ease-out;
  color: var(--text-bright);
}
.toast.error { border-left-color: var(--red); border-color: var(--red); color: var(--red); }
.toast.success { border-left-color: var(--green); border-color: var(--green); color: var(--green); }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* OBS MODE */
.obs-mode .topbar-right .login-area,
.obs-mode .pred-controls,
.obs-mode .cast-vote,
.obs-mode .stage-actions,
.obs-mode .chat-toggle,
.obs-mode .footer .right { display: none !important; }
.obs-mode .footer { background: transparent; border-color: rgba(29, 41, 66, 0.6); }

/* STAGE ACTION BUTTONS (firework / ship) */
.stage-actions {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  margin: 0 6px;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
.is-logged-in .stage-actions { display: flex; }
.stage-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  padding: 5px 10px;
  font-size: 11px;
  font-family: var(--mono);
  cursor: pointer;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: all 0.15s;
}
.stage-action-btn:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.stage-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.stage-action-btn .cost-tag {
  color: var(--gold);
  font-weight: 700;
}

/* UTIL */
.hidden { display: none !important; }
.muted { color: var(--text-mute); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.center { text-align: center; }
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}
