:root {
  --bg: #071116;
  --bg-2: #0c1720;
  --panel: rgba(12, 22, 32, 0.92);
  --panel-strong: #0f1d2a;
  --panel-soft: rgba(17, 31, 46, 0.9);
  --line: rgba(142, 190, 208, 0.12);
  --line-strong: rgba(142, 190, 208, 0.2);
  --text: #eef6fb;
  --muted: #8ca3b1;
  --gold: #f8b73a;
  --emerald: #69e2a0;
  --copper: #ff8a47;
  --danger: #ff6f83;
  --warning: #f0c35c;
  --navy: #122334;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(105, 226, 160, 0.16), transparent 26rem),
    radial-gradient(circle at top right, rgba(248, 183, 58, 0.14), transparent 24rem),
    linear-gradient(180deg, #061015 0%, #071116 50%, #08141b 100%);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.shell {
  width: min(1440px, calc(100% - 28px));
  margin: 18px auto 30px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 16, 24, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-wrap { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 56px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111a0d;
  background: linear-gradient(145deg, #ffe070 0%, #ffb93a 54%, #ff7a45 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 26px rgba(248, 183, 58, 0.18);
}
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-title { font-family: "Chakra Petch", sans-serif; font-size: 1.45rem; font-weight: 700; }
.brand-subtitle { color: var(--muted); font-size: 0.9rem; }
.topnav { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-actions.compact { justify-content: flex-end; }
.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 310px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(13, 24, 35, 0.9);
}
.searchbar svg { width: 20px; height: 20px; fill: var(--muted); flex: 0 0 auto; }
.searchbar input {
  width: 100%; border: 0; outline: 0; color: var(--text); background: transparent;
}
.searchbar input::placeholder { color: #7290a1; }

.status-pill, .mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.status-pill.muted, .mini-pill.muted { background: rgba(255, 255, 255, 0.06); color: #bcccdc; }
.status-pill.success, .mini-pill.success { background: rgba(105, 226, 160, 0.14); color: #91f0ba; }
.status-pill.warning, .mini-pill.warning { background: rgba(240, 195, 92, 0.14); color: #f8d27d; }
.status-pill.danger, .mini-pill.danger { background: rgba(255, 111, 131, 0.15); color: #ff99a8; }

.page { display: grid; gap: 22px; margin-top: 20px; }
.hero-card, .panel-surface { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.hero-card {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 20px;
  padding: 28px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -4rem -5rem auto;
  width: 22rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(248, 183, 58, 0.16), transparent 60%);
  pointer-events: none;
}
.eyebrow, .panel-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 800;
}
.eyebrow { color: var(--gold); }
.hero-content h1, .section-heading h2, .panel-toolbar h2 { margin: 0; font-family: "Chakra Petch", sans-serif; }
.hero-content h1 { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 0.96; }
.hero-text { max-width: 42rem; margin: 14px 0 0; color: #acc0ce; font-size: 1rem; }
.hero-stats { display: grid; gap: 12px; align-content: center; }
.stat-card {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(15, 27, 39, 0.86);
}
.stat-label, .chip-label, .helper-text, .cooldown-title, .queue-row p, .admin-player-identity p { color: var(--muted); }
.stat-label, .chip-label, .cooldown-title {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.stat-card strong { display: block; margin-top: 8px; font-size: 1.15rem; }

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}
.mode-tab {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 96px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  background: rgba(11, 20, 29, 0.86);
  color: #8ea7b6;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.mode-tab:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.mode-tab.active {
  color: var(--text);
  border-color: rgba(248, 183, 58, 0.34);
  background: linear-gradient(180deg, rgba(248, 183, 58, 0.14), rgba(12, 22, 32, 0.98));
}
.mode-icon, .token-icon { display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
.mode-icon { width: 42px; aspect-ratio: 1; }
.mode-icon img, .token-icon img, .rank-chip-label img { width: 24px; height: 24px; image-rendering: pixelated; }
.mode-name { font-size: 0.95rem; font-weight: 800; text-align: center; }

.panel-surface { padding: 18px; border-radius: 0 26px 26px 26px; }
.panel-toolbar, .table-head, .player-card { display: grid; align-items: center; }
.panel-toolbar { grid-template-columns: 1.2fr auto; gap: 16px; margin-bottom: 18px; }
.panel-toolbar h2 { font-size: 1.55rem; }
.toolbar-meta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.meta-chip {
  min-width: 138px;
  padding: 11px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(15, 28, 40, 0.92);
}
.table-head {
  grid-template-columns: 84px 1.8fr 120px 1fr;
  gap: 14px;
  padding: 0 16px 12px;
  color: #617d8e;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.leaderboard, .admin-player-list { display: grid; gap: 10px; }
.player-card {
  grid-template-columns: 84px minmax(0, 1.8fr) 120px 1fr;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(131, 151, 188, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 31, 43, 0.98), rgba(12, 22, 32, 0.98));
}
.player-rank {
  min-height: 76px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(248, 183, 58, 0.24), rgba(255, 122, 69, 0.12));
  border: 1px solid rgba(248, 183, 58, 0.2);
}
.player-card.silver .player-rank { background: linear-gradient(135deg, rgba(190, 211, 224, 0.24), rgba(90, 113, 130, 0.16)); }
.player-card.bronze .player-rank { background: linear-gradient(135deg, rgba(229, 146, 88, 0.24), rgba(120, 70, 44, 0.18)); }
.placement { font-family: "Chakra Petch", sans-serif; font-size: clamp(1.85rem, 3vw, 2.6rem); font-style: italic; font-weight: 700; }
.player-main { min-width: 0; display: flex; align-items: center; gap: 16px; }
.skin-wrap {
  width: 76px; min-width: 76px; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: rgba(255, 255, 255, 0.04);
}
.skin { width: 100%; height: 100%; object-fit: cover; }
.player-copy, .player-name, .player-topline { min-width: 0; }
.player-topline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.player-name, .admin-player-identity h3, .section-heading h2 { margin: 0; }
.player-name { font-size: 1.12rem; }
.score-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #bfd0db;
  font-size: 0.82rem;
  font-weight: 700;
}
.title-line { margin: 6px 0 0; color: #95a9b6; }
.region-pill {
  justify-self: center;
  min-width: 58px;
  padding: 11px 0;
  border-radius: 14px;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.region-pill.eu { background: rgba(105, 226, 160, 0.16); color: #90f0b9; }
.region-pill.na { background: rgba(255, 111, 131, 0.16); color: #ff98a8; }
.region-pill.unknown { background: rgba(255, 255, 255, 0.08); color: #cad6df; }
.tier-cluster, .cooldown-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.tier-token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.token-icon { width: 24px; height: 24px; border-radius: 999px; }
.token-rank { font-size: 0.8rem; font-weight: 800; color: #d9e6ee; }
.empty-state { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 34px 18px; }
.empty-title { margin: 0; font-size: 1.1rem; }
.empty-text, .helper-text { margin: 8px 0 0; }

.admin-page { gap: 18px; }
.admin-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 18px; }
.settings-card, .queue-card, .admin-results { border-radius: 24px; }
.section-heading { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.section-heading.wide-gap { flex-direction: row; justify-content: space-between; align-items: flex-start; }
.settings-form, .inline-form { display: grid; gap: 14px; }
.field, .inline-form label { display: grid; gap: 8px; }
.field span, .inline-form span { font-size: 0.85rem; font-weight: 700; color: #c3d1da; }
.field input, .inline-form select {
  width: 100%; min-height: 46px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13, 24, 35, 0.92); color: var(--text); outline: none;
}
.button-row, .admin-actions-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.action-button {
  min-height: 46px; padding: 0 16px; border: 0; border-radius: 14px; font-weight: 800; cursor: pointer;
}
.action-button.primary { background: linear-gradient(135deg, #7ce59d, #34ba6a); color: #071116; }
.action-button.secondary { background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--line); }
.admin-search { margin-bottom: 16px; }
.queue-summary { display: grid; gap: 10px; }
.queue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(14, 26, 37, 0.92);
}
.queue-row p, .admin-player-identity p { margin: 4px 0 0; }
.queue-row.open { border-color: rgba(105, 226, 160, 0.22); }
.queue-row.closed { border-color: rgba(255, 255, 255, 0.08); }
.admin-player-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 31, 44, 0.98), rgba(11, 21, 31, 0.98));
}
.admin-player-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.admin-player-identity { display: flex; align-items: center; gap: 14px; }
.admin-head { width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); }
.admin-rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.rank-chip-grid {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.rank-chip-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #c9d6de; }
.rank-chip-grid strong { font-size: 1rem; }
.cooldown-block { display: grid; gap: 10px; margin-bottom: 16px; }
.inline-form {
  flex: 1 1 280px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 1180px) {
  .topbar, .hero-card, .panel-toolbar, .admin-grid, .section-heading.wide-gap { grid-template-columns: 1fr; }
  .section-heading.wide-gap { display: grid; }
  .toolbar-meta, .topnav { justify-content: flex-start; }
}

@media (max-width: 860px) {
  .shell { width: min(100% - 18px, 1440px); margin-top: 12px; }
  .topbar { grid-template-columns: 1fr; }
  .topbar-actions, .searchbar, .admin-search { width: 100%; min-width: 100%; }
  .table-head { display: none; }
  .panel-surface { padding: 14px; border-radius: 0 18px 18px 18px; }
  .player-card { grid-template-columns: 1fr; gap: 12px; }
  .player-rank, .region-pill { justify-self: start; }
  .admin-player-header { flex-direction: column; align-items: flex-start; }
}
