:root {
  --bg: #120a0a;
  --bg-elev: #1a0f0f;
  --bg-elev-2: #261414;
  --bg-input: #261414;
  --border: #3d1f1f;
  --text: #f5e6e6;
  --text-dim: #b89292;
  --accent: #ff3333;
  --accent-2: #ff6666;
  --gold: #ffd700;
  --silver: #c0c4cc;
  --bronze: #cd7f32;
  --radius: 14px;
  --sidebar-w: 240px;
  --bg-hover: #2a1515;
  --bg-card: #1f1212;
  --text-muted: #8d6b6b;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #5c2a2a; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #7a3a3a; }

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

main.container { flex: 1; padding-bottom: 4rem; }

/* ===== Layout (sidebar + content) ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--bg-elev) 0%, #150c0c 100%);
  border-right: 1px solid var(--border);
  padding: 1rem 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Sidebar scrollbar ===== */
.sidebar { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #5a2e2e; }

/* ===== Brand & nav ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.25rem;
  background: rgba(255, 51, 51, 0.06);
  border: 1px solid rgba(255, 51, 51, 0.12);
  border-radius: 12px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.brand:hover { text-decoration: none; background: rgba(255, 51, 51, 0.11); border-color: rgba(255, 51, 51, 0.25); transform: translateX(2px); }

.brand-logo {
  height: 38px;
  width: 38px;
  object-fit: contain;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 4px rgba(255, 51, 51, 0.25));
}

.brand:hover .brand-logo { transform: scale(1.12) rotate(-6deg); }

.brand-text { font-size: 1rem; line-height: 1.2; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 0.12rem; }

.nav-top { flex: 0 0 auto; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.6rem 0.25rem;
  flex-shrink: 0;
}

.nav-category {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-dim);
  padding: 1rem 0.85rem 0.35rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-category::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}
.nav-top > .nav-category:first-of-type { padding-top: 0.65rem; }

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: 11px;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, transform 0.12s, border-color 0.15s;
}

.nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.15s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
  transform: translateX(3px);
  border-color: rgba(255, 102, 102, 0.12);
}

.nav a:hover svg { color: var(--accent-2); transform: scale(1.1); }

.nav a.active {
  background: linear-gradient(135deg, rgba(255, 51, 51, 0.22), rgba(255, 80, 80, 0.08));
  color: #fff;
  font-weight: 600;
  border-color: rgba(255, 51, 51, 0.25);
  box-shadow: inset 0 0 12px rgba(255, 51, 51, 0.08);
}

.nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(to bottom, var(--accent-2), var(--accent));
}

.nav a.active svg { color: #fff; }

/* ===== Hero ===== */
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }

.hero-logo {
  height: 84px;
  width: 84px;
  object-fit: contain;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 6px 24px rgba(255, 51, 51, 0.5));
  animation: heroFloat 4s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, #ff5555);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-dim); margin-top: 0.4rem; }

/* ===== Loading ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 5rem 0;
  color: var(--text-dim);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Toolbar ===== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.toolbar input[type="search"] {
  flex: 1 1 240px;
}

.toolbar input, .toolbar select {
  background: var(--bg-input);
  border: 1px solid transparent;
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: background 0.25s ease-in-out, border-color 0.15s;
}

.toolbar input:focus, .toolbar select:focus { background: var(--bg-elev-2); border-color: rgba(255, 51, 51, 0.5); outline: none; }

.result-count { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 1rem; }

/* ===== Level list ===== */
.level-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.level-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  opacity: 0;
}

.level-card.in-view {
  opacity: 1;
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.level-card.in-view.no-anim {
  animation: none;
}

.level-card:hover {
  border-color: #5c2a2a;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.level-card.user-beaten {
  border-color: #2e9e5b;
}

.level-card.user-beaten:hover {
  border-color: #3cc973;
  box-shadow: 0 8px 24px rgba(46, 158, 91, 0.25);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes expandIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page:not([hidden]) { animation: fadeIn 0.3s ease; }

/* AML-style banner card */
.level-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 200px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  border-radius: inherit;
}

.banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.level-card:hover .banner-img { transform: scale(1.04); }

.banner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 5rem;
  color: var(--text-dim);
  background: linear-gradient(135deg, var(--bg-elev-2), hsl(0, 0%, 22%));
}

.banner-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.15) 100%);
}

.level-info {
  position: relative;
  display: flex;
  align-items: center;
  margin: auto 0;
  z-index: 1;
}

.level-top {
  font-family: "JetBrains Mono", monospace;
  font-size: 30px;
  font-weight: 700;
  margin-left: 22px;
  margin-right: 14px;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
}

.level-top.top1 { color: var(--gold); }
.level-top.top3 { color: var(--silver); }
.level-top.top10 { color: var(--bronze); }

.level-info .info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.level-name {
  font-weight: 800;
  font-size: 19px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22ch;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
}

.creator {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-dim);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.creator a { color: #8ab4f8; }
.creator a:hover { text-decoration: underline; }

.level-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text) !important;
  transition: border-color 0.15s, filter 0.15s;
}

.link-btn { transition: border-color 0.15s ease, filter 0.15s ease, transform 0.15s ease; }
.link-btn:hover { text-decoration: none; filter: brightness(1.15); transform: translateY(-1px); }
.link-btn.video { border-color: rgba(255, 51, 51, 0.5); color: var(--accent) !important; }
.link-btn.game { border-color: rgba(255, 100, 100, 0.45); color: #ff8080 !important; }
.link-btn.guide { border-color: rgba(255, 150, 100, 0.45); color: #ff9966 !important; }

.level-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.points {
  background: rgba(255, 51, 51, 0.12);
  color: var(--accent);
  border: 1px solid rgba(255, 51, 51, 0.35);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.badge.paid { background: rgba(255, 51, 51, 0.12); color: #ff7777; border: 1px solid rgba(255, 51, 51, 0.3); }
.badge.roam { background: rgba(255, 100, 100, 0.12); color: #ff8888; border: 1px solid rgba(255, 100, 100, 0.3); }
.badge.victors { background: rgba(255, 150, 100, 0.12); color: #ffaa77; border: 1px solid rgba(255, 150, 100, 0.3); }
.badge.unbeaten { background: rgba(154, 163, 181, 0.1); color: var(--text-dim); border: 1px solid var(--border); }

.level-expand {
  border-top: 1px solid var(--border);
  padding: 0.9rem 1.1rem;
  background: var(--bg-elev-2);
}

.level-expand:not([hidden]) { animation: expandIn 0.25s ease; }

.level-expand h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.victor-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.victor-chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text) !important;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  transition: border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.victor-chip:hover {
  border-color: rgba(255, 51, 51, 0.6);
  color: var(--accent) !important;
  transform: translateY(-1px);
  text-decoration: none;
}

.level-expand h3 .hint {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  opacity: 0.7;
}

.victor-chip.first {
  border-color: rgba(255, 215, 0, 0.5);
  color: var(--gold);
}

.no-victors { color: var(--text-dim); font-size: 0.9rem; }

/* ===== Empty ===== */
.empty { text-align: center; padding: 3.5rem 0; color: var(--text-dim); }
.empty h2 { color: var(--text); margin-bottom: 0.4rem; }

/* ===== Leaderboard ===== */
.leaderboard { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.leaderboard > div { animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards; }

.lb-row:hover { border-color: #5c2a2a; transform: translateX(4px); }

.lb-expand:not([hidden]) { animation: expandIn 0.25s ease; }

.lb-rank {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  min-width: 2.8rem;
  text-align: center;
  color: var(--text-dim);
}

.lb-rank.top1 { color: var(--gold); }
.lb-rank.top2 { color: var(--silver); }
.lb-rank.top3 { color: var(--bronze); }

.lb-name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lb-completions { color: var(--text-dim); font-size: 0.82rem; white-space: nowrap; }

.lb-points {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.lb-expand {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -0.5rem;
  padding: 0.9rem 1.1rem;
}

.lb-row.expanded { border-radius: var(--radius) var(--radius) 0 0; }

.lb-expand ul { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }

.lb-expand li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
}

.lb-expand li .pts { font-family: "JetBrains Mono", monospace; color: var(--text-dim); }

/* ===== Stats ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.stat-card:hover { border-color: #5c2a2a; transform: translateY(-3px); }

.stat-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent-2);
}

.stat-label { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.2rem; }

.stats-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}

.stats-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stats-card h2 { font-size: 1rem; margin-bottom: 0.75rem; }

.stats-card ol { padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.92rem; }

.stats-card ol .count { color: var(--text-dim); }

/* ===== Roulette ===== */
.roulette-setup {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.roulette-setup-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roulette-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.roulette-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.roulette-tab {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.roulette-tab:hover { background: #3d1f1f; border-color: var(--accent-2); }

.roulette-tab.active {
  background: linear-gradient(135deg, rgba(255,51,51,0.35), rgba(255,80,80,0.15));
  border-color: rgba(255,51,51,0.6);
  color: var(--accent-2);
}

.roulette-start-btn {
  background: linear-gradient(135deg, #ff3333, #cc1111);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  align-self: center;
  transition: opacity 0.15s, transform 0.15s;
  margin-top: 0.5rem;
}

.roulette-start-btn:hover { opacity: 0.88; transform: scale(1.03); }

.roulette-count-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  width: 100px;
  outline: none;
}

.roulette-count-input:focus { border-color: var(--accent-2); }

.roulette-time-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.roulette-time-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  padding: 0.5rem 1rem;
  text-align: center;
  width: 130px;
  outline: none;
}

.roulette-time-input:focus { border-color: var(--accent-2); }

.roulette-run { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }

.roulette-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  max-width: 600px;
}

.roulette-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}

.roulette-pip.done { background: #44bb44; }
.roulette-pip.current { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

.roulette-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  text-align: center;
  max-width: 480px;
  width: 100%;
  animation: fadeUp 0.3s ease both;
}

.roulette-step {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.roulette-rank {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-2);
  margin-bottom: 0.25rem;
}

.roulette-mode-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.roulette-game {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.roulette-requirement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
}

.roulette-req-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.roulette-req-time {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-2);
  font-family: "JetBrains Mono", monospace;
}

.roulette-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.roulette-btn {
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.roulette-btn:hover { opacity: 0.85; transform: scale(1.03); }

.roulette-btn-success { background: #228822; color: #fff; }
.roulette-btn-fail { background: #882222; color: #fff; }
.roulette-btn-skip { background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text-dim); }

.roulette-end {
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: fadeUp 0.3s ease both;
}

.roulette-end-win { border-color: rgba(80,200,80,0.4); }
.roulette-end-fail { border-color: rgba(200,60,60,0.4); }

.roulette-end-icon { font-size: 3rem; }
.roulette-end h2 { font-size: 1.5rem; font-weight: 900; }
.roulette-end-sub { color: var(--text-dim); font-size: 0.9rem; }

.roulette-passed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ===== Roblox Items ===== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  padding-bottom: 2rem;
}

.item-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  animation: fadeUp 0.3s ease both;
}

.item-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== Unavailable Games ===== */
.unavail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
  padding-bottom: 2rem;
}

.unavail-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  animation: fadeUp 0.3s ease both;
}

.unavail-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
  display: block;
}

.unavail-name:hover { text-decoration: underline; }

.unavail-name-dead {
  color: var(--text-dim);
}

/* ===== Challenges ===== */
.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 2rem;
}

.challenge-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  animation: fadeUp 0.4s ease both;
}

.challenge-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.challenge-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 0.85rem;
}

.challenge-victors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.challenge-victors-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-right: 0.2rem;
}

/* ===== Unverified Modes ===== */
.uv-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.uv-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  transition: border-color 0.2s, transform 0.2s;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.uv-card:hover {
  border-color: rgba(255, 51, 51, 0.45);
  transform: translateX(4px);
}

.uv-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.uv-mode-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.uv-progress-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 150, 100, 0.15);
  color: #ffaa77;
  border: 1px solid rgba(255, 150, 100, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.uv-game {
  font-size: 0.9rem;
  color: var(--accent-2);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.uv-game:hover { text-decoration: underline; }

.uv-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.uv-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.uv-pill-progress {
  background: rgba(255, 51, 51, 0.1);
  border-color: rgba(255, 51, 51, 0.3);
  color: var(--accent-2);
}

.uv-pill-rank {
  background: rgba(255, 51, 51, 0.14);
  border-color: rgba(255, 51, 51, 0.35);
  color: var(--accent-2);
  font-weight: 700;
}

.uv-pill-points {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f5a623;
}

.uv-pill-list {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.35);
  color: #a78bfa;
}

.profile-list-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.profile-list-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.profile-list-row:hover {
  border-color: rgba(255, 51, 51, 0.4);
  background: var(--bg-hover);
}

.profile-list-row .uv-pill-list {
  flex: 1;
  min-width: 0;
}

/* ===== Info ===== */
.info-card { max-width: 720px; margin: 0 auto; }
.info-card h2 { margin-top: 1.25rem; }
.info-card h2:first-child { margin-top: 0; }
.info-card p { color: var(--text-dim); margin-top: 0.4rem; }

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #ff7a4d);
  color: #fff !important;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  margin-top: 0.5rem;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }

/* ===== Home page ===== */
.hero-large {
  padding: 3.5rem 0 2.5rem;
}

.hero-title-large {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff 20%, #ff5555 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 1rem;
}

.subtitle-large {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-dim);
  max-width: 600px;
  margin: 0.75rem auto 0;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 1.8rem;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.15s;
}

.hero-btn:hover { text-decoration: none; transform: translateY(-2px); }

.hero-btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff5555);
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(255, 51, 51, 0.4);
}

.hero-btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 28px rgba(255, 51, 51, 0.5); }

.hero-btn-secondary {
  background: var(--bg-elev-2);
  color: var(--text) !important;
  border: 1px solid var(--border);
}

.hero-btn-secondary:hover { border-color: rgba(255, 51, 51, 0.5); background: #3d1f1f; }

.home-section {
  margin: 3rem 0;
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.section-text {
  color: var(--text-dim);
  max-width: 700px;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.home-card {
  position: relative;
  display: flex;
  height: 180px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  overflow: hidden;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.home-card:hover {
  border-color: rgba(255, 51, 51, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  text-decoration: none;
}

.home-card .banner-shade {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.85) 100%);
}

.home-card-body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 1.1rem 1.2rem;
}

.home-card-body h2 {
  font-size: 1.25rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.home-card-body p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0.15rem 0 0.5rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.quick-link:hover {
  border-color: rgba(255, 51, 51, 0.5);
  background: #3d1f1f;
  transform: translateY(-2px);
  text-decoration: none;
}

.quick-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent-2);
}

/* ===== List tabs ===== */
.list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.list-tab {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.list-tab:hover { color: var(--text); border-color: #5c2a2a; }

.list-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 51, 51, 0.35), rgba(255, 80, 80, 0.18));
  border-color: rgba(255, 51, 51, 0.6);
}

/* ===== Mode detail page ===== */
.back-link {
  display: inline-block;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 1.5rem 0 1rem;
  transition: color 0.15s, transform 0.15s;
}
.back-link:hover { color: var(--text); text-decoration: none; transform: translateX(-3px); }

.mode-hero {
  position: relative;
  height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  margin-bottom: 1rem;
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.mode-hero-info {
  position: relative;
  display: flex;
  align-items: center;
  margin: auto 0;
  z-index: 1;
}

.mode-title {
  font-weight: 900;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.85);
}

.mode-section { margin-top: 1rem; animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards; }

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.mode-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .mode-hero { height: 220px; }
}

/* ===== Reduced motion ===== */
/* ===== Profile page ===== */
.profile-banner-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 0;
  border-radius: 14px 14px 0 0;
  overflow: visible;
}
.profile-banner {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
}
.profile-banner-empty {
  height: 120px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
  border-radius: 14px 14px 0 0;
  border-bottom: 1px solid var(--border);
}
.profile-banner-avatar {
  position: absolute;
  bottom: -40px;
  left: 1.5rem;
}
.profile-banner-avatar .profile-avatar,
.profile-banner-avatar .profile-avatar-img {
  width: 88px;
  height: 88px;
  font-size: 2rem;
  border: 4px solid var(--bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.profile-header {
  display: flex;
  align-items: flex-start;
  padding: 3rem 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.banner-crop-wrap {
  width: 100%;
  cursor: grab;
  user-select: none;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}
.banner-crop-wrap:active { cursor: grabbing; }
#banner-crop-canvas { display: block; width: 100%; height: auto; }

.banner-upload-preview-wrap {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  position: relative;
}
.banner-upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.banner-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.profile-username-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-username {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.profile-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.profile-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.profile-share-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

.profile-share-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  width: 260px;
  outline: none;
  font-family: "JetBrains Mono", monospace;
}

.profile-share-copy {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.profile-share-copy:hover { border-color: var(--accent-2); }

.profile-stats-grid {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.profile-stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  min-width: 120px;
  text-align: center;
}

.profile-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-2);
  line-height: 1;
}

.profile-stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}

.profile-runs-section { margin-bottom: 2rem; }

.profile-empty {
  padding: 3rem 0;
  text-align: center;
  color: var(--text-dim);
}

.profile-avatar-wrap { flex-shrink: 0; }

.profile-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-bio {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 480px;
  margin-top: 0.1rem;
}

.profile-edit-btn {
  display: inline-block;
  margin-top: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.profile-edit-btn:hover { border-color: var(--accent-2); }

/* ===== Submit page ===== */
.submit-form-wrap { max-width: 620px; margin: 0 auto; }
.submit-form {
  padding: 1.75rem 1.75rem 1.5rem;
  border-radius: 14px;
  border-top: 3px solid var(--accent-2);
}
.submit-form .section-heading {
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.submit-form .modal-btn { margin-top: 0.5rem; }
.required { color: var(--accent); font-size: 0.8rem; }
.sub-status-pending { background: #b07d00; color: #fff; }
.sub-status-approved { background: var(--accent-2); color: #fff; }
.sub-status-rejected { background: var(--accent); color: #fff; }
.sub-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  width: 100%;
  outline: none;
}
.sub-select:focus { border-color: var(--accent-2); }

.sub-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.sub-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.sub-dropdown-item:last-child { border-bottom: none; }
.sub-dropdown-item:hover { background: var(--bg-input); }

.sub-dd-rank {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 2.5rem;
}
.sub-dd-mode { font-weight: 600; font-size: 0.9rem; flex: 1; }
.sub-dd-game { font-size: 0.8rem; color: var(--text-dim); text-align: right; flex-shrink: 0; }

.sub-selected-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--accent-2) 12%, var(--bg-input));
  border: 1px solid var(--accent-2);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: -0.25rem;
  margin-bottom: 0.85rem;
}

.sub-clear-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.2rem;
}
.sub-clear-btn:hover { color: var(--text); }

.sub-notes { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.4rem; line-height: 1.5; }
.sub-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }

.sub-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0 0.25rem;
  margin-top: 0.25rem;
}
.sub-pager-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
}
.sub-pager-btn:hover:not(:disabled) { border-color: var(--accent-2); }
.sub-pager-btn:disabled { opacity: 0.35; cursor: default; }
.sub-pager-info { font-size: 0.85rem; color: var(--text-dim); }

/* ===== Staff page ===== */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.staff-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.staff-card:hover { border-color: var(--accent-2); text-decoration: none; }

.staff-avatar-wrap { flex-shrink: 0; }

.staff-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.staff-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.staff-name {
  font-weight: 700;
  font-size: 1rem;
}

.staff-discord {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.staff-bio {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 0.2rem;
}

.profile-stat-card-action { cursor: default; }

.profile-verify-section { margin-bottom: 1.5rem; }

.profile-verify-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 420px;
}

.profile-verify-title {
  font-weight: 700;
  font-size: 1rem;
}

.profile-verify-steps {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.profile-verify-steps code {
  background: var(--bg-input);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  color: var(--accent-2);
}

.profile-verify-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  margin: 0.25rem 0;
}

.profile-verify-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ===== Auth sidebar button ===== */
.auth-sidebar {
  padding: 0.5rem 0.75rem;
  margin-top: auto;
}

.auth-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}
.auth-sidebar-btn:hover { background: var(--bg-hover); color: var(--text); border-color: rgba(255, 102, 102, 0.12); transform: translateX(3px); }
.auth-sidebar-btn svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-dim); transition: color 0.15s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.auth-sidebar-btn:hover svg { color: var(--accent-2); transform: scale(1.1); }

/* ===== Auth Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal-wide { max-width: 520px; }

.modal-field textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  outline: none;
  width: 100%;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.modal-field textarea:focus { border-color: var(--accent-2); }

.modal-field-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  animation: fadeUp 0.2s ease both;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.modal-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-field input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  outline: none;
  width: 100%;
}
.modal-field input:focus { border-color: var(--accent-2); }

.modal-error {
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 1.2em;
  margin-bottom: 0.5rem;
}

.modal-btn {
  width: 100%;
  padding: 0.65rem;
  background: var(--accent-2);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: opacity 0.15s;
}
.modal-btn:hover { opacity: 0.85; }
.modal-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.modal-btn-secondary { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); margin-top: 0.75rem; }
.modal-btn-danger { background: var(--accent); margin-top: 0.5rem; }

.avatar-crop-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto;
  cursor: grab;
  user-select: none;
  background: #111;
  border-radius: 8px;
}
.avatar-crop-wrap:active { cursor: grabbing; }
#avatar-crop-canvas { display: block; }
#avatar-crop-modal { z-index: 9999; }

.avatar-upload-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.avatar-upload-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-upload-btn {
  padding: 0.45rem 1rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.avatar-upload-btn:hover { background: var(--bg-card); }
.avatar-upload-clear {
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
}
.avatar-upload-clear:hover { background: var(--accent); color: #fff; }

.run-widget { display: flex; flex-direction: column; gap: 0.5rem; }
.run-widget-label { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.run-video-input {
  padding: 0.6rem 0.75rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.run-video-input:focus { border-color: var(--accent-2); }
.run-msg { font-size: 0.85rem; margin: 0; min-height: 1.2em; }

.modal-switch {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.9rem;
  text-align: center;
}
.modal-switch a { color: var(--accent-2); text-decoration: none; }
.modal-switch a:hover { text-decoration: underline; }

.modal-profile-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.modal-username { font-size: 1.1rem; font-weight: 700; }
.modal-role {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-staff { background: var(--accent-2); color: #fff; }
.role-admin { background: var(--accent); color: #fff; }
.role-developer { background: #7c3aed; color: #fff; }
.role-trial_staff { background: #f59e0b; color: #fff; }

/* ===== Run submit widget ===== */
.run-submit-widget {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}
.run-submit-title { font-size: 0.85rem; color: var(--text-dim); font-weight: 600; }
.run-submit-url {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  width: 100%;
  max-width: 380px;
  outline: none;
}
.run-submit-url:focus { border-color: var(--accent-2); }
.run-submit-btn {
  background: var(--accent-2);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.run-submit-btn:hover { opacity: 0.85; }
.run-submit-login-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.run-submit-login-btn:hover { border-color: var(--accent-2); color: var(--text); }
.run-submit-msg { font-size: 0.85rem; min-height: 1.2em; }

/* ===== Section heading ===== */
.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Settings page ── */
.settings-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem 1.25rem;
  max-width: 720px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.setting-row:last-of-type { border-bottom: none; }

.setting-text { flex: 1; }

.setting-label {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.setting-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.4;
}

.setting-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.setting-switch {
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--bg-elev-2, #333);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.2s ease;
}

.setting-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s ease, background 0.2s ease;
}

.setting-row input:checked + .setting-switch {
  background: #7f1d1d;
  border-color: #a83232;
}

.setting-row input:checked + .setting-switch::after {
  transform: translateX(18px);
  background: #fff;
}

.setting-row input:focus-visible + .setting-switch {
  outline: 2px solid #a83232;
  outline-offset: 2px;
}

.settings-reset { margin-top: 1rem; }

/* Center settings page */
.page-centered .hero,
.page-centered .settings-card {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.page-centered .settings-card { text-align: left; }

/* Hide banner images */
body.hide-banners .level-banner .banner-img,
body.hide-banners .level-banner .banner-placeholder { display: none; }
body.hide-banners .level-banner .banner-shade { background: none; }

/* Compact list view */
body.compact-list .level-banner { height: 84px; }
body.compact-list .level-banner .banner-img,
body.compact-list .level-banner .banner-placeholder { display: none; }
body.compact-list .level-banner .banner-shade { background: none; }
body.compact-list .level-top { font-size: 22px; }

/* Reduce motion */
body.no-motion *, body.no-motion *::before, body.no-motion *::after {
  animation: none !important;
  transition: none !important;
}
body.no-motion .level-card { opacity: 1; }

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

/* ===== Responsive — mobile ===== */
@media (max-width: 640px) {
  /* General */
  .container { padding: 0 0.75rem; }
  main.container { padding-bottom: 5rem; }

  /* Hero */
  .hero { padding: 1.75rem 0 1rem; }
  .hero-large { padding: 2rem 0 1.5rem; }
  .hero-title-large { font-size: clamp(1.5rem, 7vw, 2.2rem); }
  .hero h1 { font-size: clamp(1.4rem, 6vw, 2rem); }
  .subtitle-large { font-size: 0.9rem; }
  .hero-ctas { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .hero-btn { justify-content: center; font-size: 0.95rem; padding: 0.75rem 1.25rem; }

  /* Home cards */
  .home-cards { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: repeat(2, 1fr); }

  /* Modal */
  .modal-overlay { padding: 0.5rem; align-items: flex-end; }
  .modal {
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.25rem 1rem 2rem;
    width: 100%;
    max-width: 100% !important;
  }
  .modal-wide { max-width: 100% !important; }

  /* Leaderboard */
  .lb-completions { display: none; }
  .lb-row { gap: 0.5rem; padding: 0.7rem 0.85rem; }
  .lb-rank { min-width: 2rem; font-size: 0.8rem; }
  .lb-points { font-size: 0.8rem; }

  /* Stats grid */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Mode page */
  .mode-hero { height: 160px; }
  .mode-title { font-size: clamp(1.2rem, 5vw, 1.8rem); }
  .mode-nav { flex-direction: column; gap: 0.5rem; }
  .mode-nav a, .mode-nav span { text-align: center; }

  /* Victor chips */
  .victor-chips { gap: 0.35rem; }
  .victor-chip { font-size: 0.8rem; padding: 0.25rem 0.6rem; }

  /* List toolbar */
  .toolbar { flex-direction: column; gap: 0.5rem; }
  .toolbar input[type="search"] { flex: unset; width: 100%; }
  .toolbar select { width: 100%; }

  /* Profile page */
  .profile-banner { height: 110px; }
  .profile-banner-empty { height: 80px; }
  .profile-banner-avatar { bottom: -32px; left: 1rem; }
  .profile-banner-avatar .profile-avatar,
  .profile-banner-avatar .profile-avatar-img { width: 68px; height: 68px; font-size: 1.5rem; }
  .profile-header { padding: 2.5rem 0 1rem 1rem; flex-direction: column; gap: 0.5rem; }
  .profile-username { font-size: 1.35rem; }
  .profile-share-input { width: 100%; min-width: 0; }
  .profile-share { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .profile-stats-grid { gap: 0.6rem; }
  .profile-stat-card { flex: 1 1 calc(50% - 0.3rem); min-width: 0; padding: 0.75rem; }
  .profile-stat-value { font-size: 1.5rem; }

  /* Submit page dropdown */
  .sub-dd-game { display: none; }
  .sub-dropdown { max-height: 220px; }

  /* Staff grid */
  .staff-grid { grid-template-columns: 1fr 1fr; }

  /* Roulette */
  .roulette-card { padding: 1.25rem 1rem; width: 100%; }
  .roulette-mode-name { font-size: 1.15rem; }
  .roulette-req-time { font-size: 1.6rem; }
  .roulette-actions { gap: 0.5rem; }
  .roulette-btn { padding: 0.6rem 1rem; font-size: 0.9rem; flex: 1 1 calc(50% - 0.25rem); }

  /* Admin panel */
  .admin-row { flex-direction: column; align-items: stretch; }
  .admin-input { width: 100%; }
  .admin-tab { font-size: 0.78rem; padding: 0.35rem 0.65rem; }

  /* Challenges */
  .challenge-card { padding: 1rem; }

  /* Unverified / pending / unavailable cards */
  .uv-card { padding: 0.85rem 0.9rem; }
  .uv-card-header { flex-wrap: wrap; gap: 0.3rem; }

  /* Section headings */
  .section-heading { font-size: 1.1rem; }
  .section-title { font-size: 1.2rem; }

  /* Nav — icon-only on small screens */
  .nav a span, .nav a:not(:has(svg)) { font-size: 0; }
  .nav a { padding: 0.45rem 0.6rem; }
  #auth-sidebar-label { display: none; }
  .auth-sidebar-btn { padding: 0.45rem 0.6rem; min-width: unset; }
  .auth-sidebar { margin-left: auto; }
}

.admin-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.admin-tab {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.admin-tab:hover { background: var(--bg-card); color: var(--text); }
.admin-tab.active { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }

.admin-tab-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.admin-input {
  padding: 0.5rem 0.75rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.admin-input:focus { border-color: var(--accent-2); }
.admin-input select { appearance: none; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== Admin panel: sections & searchable mode picker ===== */
.admin-section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.admin-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.admin-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.admin-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.adm-search-wrap { position: relative; max-width: 440px; }
.adm-sugg {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 60;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}
.adm-sugg-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.adm-sugg-item:last-child { border-bottom: none; }
.adm-sugg-item:hover { background: var(--bg-hover); }
.adm-sugg-rank {
  min-width: 2.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.adm-sugg-body { flex: 1; min-width: 0; }
.adm-sugg-mode {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-sugg-game {
  font-size: 0.76rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-list-pill {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.adm-list-pill-main { color: #4caf50; border-color: rgba(76,175,80,0.45); background: rgba(76,175,80,0.12); }
.adm-list-pill-extended { color: #a78bfa; border-color: rgba(167,139,250,0.45); background: rgba(167,139,250,0.12); }
.adm-list-pill-unlimited { color: #e0a63c; border-color: rgba(224,166,60,0.45); background: rgba(224,166,60,0.12); }
.adm-list-pill-aim { color: #ef6461; border-color: rgba(239,100,97,0.45); background: rgba(239,100,97,0.12); }

.adm-editing-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.55rem;
}
.adm-editing-note:empty { display: none; }

/* Admin mode form */
.adm-form-card {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  max-width: 640px;
}
.adm-form-title {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.adm-form-title b { color: var(--text); }
.adm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.adm-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.adm-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.adm-victor-row {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
}

@media (max-width: 600px) {
  .adm-form-grid { grid-template-columns: 1fr; }
  .adm-form-grid .adm-field[style*="span 2"] { grid-column: auto !important; }
  .adm-search-wrap { max-width: 100%; }
}

@media (min-width: 1400px) {
  .container { max-width: 1280px; }
}

@media (max-width: 900px) {
  .layout { flex-direction: column; min-height: 100vh; }
  .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    min-height: unset;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: visible;
    z-index: 100;
  }
  .content {
    flex: 1;
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }
  .brand { background: transparent; border: none; padding: 0.25rem 0.4rem; flex-shrink: 0; }
  .brand:hover { background: transparent; border-color: transparent; }
  .brand-text { display: none; }
  .nav { flex-direction: row; gap: 0.35rem; }
  .nav-top { flex: 0 1 auto; }
  .nav-divider { display: none; }
  .nav-category { display: none; }
  .nav a.active::before { display: none; }
  .nav a:hover { transform: none; }
  .nav a { padding: 0.45rem 0.7rem; white-space: nowrap; gap: 0.45rem; border-radius: 10px; }
  .nav a svg { width: 16px; height: 16px; }
  .level-list { grid-template-columns: 1fr; }
  .level-banner { height: 190px; }
} 