/* ─── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg: #0a0a0b;
  --card-bg: #121214;
  --rust: #cd4a1f;
  --rust-hot: #f07a40;
  --text: #e1e1e6;
  --muted: #88888f;
  --border: rgba(255, 255, 255, 0.08);
  
  --display: 'Rajdhani', sans-serif;
  --mono: 'Share Tech Mono', monospace;
  --sans: 'Inter', sans-serif;
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  color: var(--text);
    font-family: var(--sans), serif;
  line-height: 1.5;
  overflow-x: hidden;
}

.index-body {
  overflow-y: auto;
  scrollbar-width: none;
}
.index-body::-webkit-scrollbar { display: none; }

.noise {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05; pointer-events: none; z-index: 999;
}

#particles-js {
  position: fixed; width: 100%; height: 100%;
  top: 0; left: 0; z-index: -1;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}

.hero-content {
  width: 100%;
  max-width: 600px;
  text-align: center;
}

.hero-header { margin-bottom: 3rem; }

.site-title {
    font-family: var(--display), serif;
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.site-title .accent { color: var(--rust); }

.site-tagline {
    font-family: var(--mono), serif;
  color: var(--muted);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.hero-header--compact { margin-bottom: 1.5rem; }
.hero-header--compact .site-title { font-size: 2.5rem; }
.hero-header--compact .site-tagline { font-size: 0.85rem; letter-spacing: 0.15em; }

/* ─── Search card ────────────────────────────────────────────────────────────── */
.search-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.search-card::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--rust), var(--rust-hot));
}

.search-card-inner { position: relative; z-index: 1; }

.search-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.8rem;
  border-bottom: 2px solid var(--border);
}

.search-tab {
  font-family: var(--display), sans-serif;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .75rem 1.6rem;
  background: none;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.search-tab:hover { color: var(--text); }

.search-tab.active {
  color: var(--rust);
  border-bottom-color: var(--rust);
}

.tab-panel { animation: tabFadeIn .2s ease; }
@keyframes tabFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.search-label {
    font-family: var(--display), serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .04em;
}

.search-form {
  display: flex;
  gap: .75rem;
}

.input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute; left: 14px;
  color: var(--muted);
  display: flex; align-items: center;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: .85rem 1rem .85rem 2.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: .75rem;
  color: #fff;
    font-family: var(--mono), serif;
  font-size: 1rem;
  transition: all .2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 4px rgba(205, 74, 31, 0.15);
}

.search-input::placeholder { color: var(--muted); }

.search-btn {
  padding: 0 1.5rem;
  background: var(--rust);
  border: none;
  border-radius: .75rem;
  color: #fff;
    font-family: var(--display), serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; gap: .5rem;
  transition: all .2s ease;
}

.search-btn:hover {
  background: var(--rust-hot);
  transform: translateY(-1px);
}

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

.search-hint {
  margin-top: 1.5rem;
  font-size: .85rem;
  color: var(--muted);
}

.search-hint a { color: var(--rust-hot); text-decoration: none; }
.search-hint a:hover { text-decoration: underline; }

/* ─── Search field guidance ───────────────────────────────────────────────── */
.search-sublabel {
  margin: .35rem 0 1.6rem;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--muted);
}

.search-form-v {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-align: left;
}

.field-label {
  font-family: var(--display), sans-serif;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.field-label .req,
.field-label .optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: .68rem;
  padding: .1rem .4rem;
  border-radius: 5px;
}
.field-label .req      { color: var(--rust-hot); border: 1px solid rgba(240,122,64,.35); }
.field-label .optional { color: var(--muted);    border: 1px solid var(--border); }

.field-help {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--muted);
}
.field-help strong { color: var(--text); font-weight: 600; }
.field-help code {
  font-family: var(--mono), monospace;
  color: var(--rust-hot);
  background: rgba(255,255,255,0.06);
  padding: .05rem .35rem;
  border-radius: 4px;
  font-size: .78rem;
}

.search-input--lg    { height: 55px; font-size: 1.1rem; }
.search-input--plain { padding-left: 1rem; }

.mode-toggle {
  display: flex;
  gap: 2px;
  width: fit-content;
}
.mode-btn {
  font-family: var(--display), sans-serif;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .55rem 1.3rem;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .12s ease;
}
.mode-btn:first-child { border-radius: 3px 0 0 3px; }
.mode-btn:last-child  { border-radius: 0 3px 3px 0; }
.mode-btn:hover { color: var(--text); background: rgba(255,255,255,.08); }
.mode-btn.active {
  background: rgba(16,185,129,.15);
  border-color: rgba(16,185,129,.5);
  color: #10b981;
}
.mode-rec {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--rust);
  color: #fff;
  padding: .1rem .4rem;
  border-radius: 2px;
  margin-left: .4rem;
  vertical-align: middle;
}

.server-selected {
  display: none;
  font-size: .8rem;
  color: var(--rust-hot);
  font-family: var(--mono), monospace;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
  user-select: none;
  text-align: left;
}
.check-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--rust);
  margin-top: 2px;
  flex-shrink: 0;
}
.check-title {
  display: block;
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
  margin-bottom: .15rem;
}

.search-btn--block { width: 100%; height: 55px; font-size: 1.1rem; justify-content: center; }

/* "How search works" collapsible guide */
.search-guide {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: rgba(0,0,0,0.2);
  overflow: hidden;
}
.search-guide > summary {
  cursor: pointer;
  padding: .85rem 1.1rem;
  font-family: var(--display), sans-serif;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.search-guide > summary::-webkit-details-marker { display: none; }
.search-guide > summary::before {
  content: '?';
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--rust);
  color: #fff;
  font-size: .72rem;
  font-family: var(--mono), monospace;
}
.search-guide[open] > summary { border-bottom: 1px solid var(--border); }
.search-guide-body {
  padding: .85rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.guide-item {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: left;
}
.guide-badge {
  flex-shrink: 0;
  font-family: var(--mono), monospace;
  font-size: .7rem;
  color: var(--rust-hot);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .12rem .45rem;
  white-space: nowrap;
  min-width: 82px;
  text-align: center;
}

/* ─── Error banner ────────────────────────────────────────────────────────── */
.error-banner {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #f87171;
  font-size: .9rem;
  text-align: left;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-title { font-size: 3rem; }
  .hero-header--compact .site-title { font-size: 2rem; }
  .search-form { flex-direction: column; }
  .search-btn  { justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════════════
   UI/UX enhancements (added) — shared header, toasts, chips, polish
   ══════════════════════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }

::selection { background: rgba(205, 74, 31, 0.35); color: #fff; }

/* Slimmer, on-theme scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--rust) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(205,74,31,.5); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--rust); }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--rust-hot);
  outline-offset: 2px;
}

/* ─── Shared top navigation (works on every page) ─────────────────────────── */
.top-nav {
  height: 64px;
  background: rgba(18, 18, 20, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-family: var(--display), sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .6rem;
  letter-spacing: .03em;
}
.nav-logo:hover { color: #fff; }

.nav-right { display: flex; align-items: center; gap: 1.25rem; }

.nav-links { display: flex; align-items: center; gap: 1.25rem; }

.nav-link {
  font-family: var(--display), sans-serif;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .03em;
  color: var(--muted);
  text-decoration: none;
  display: flex; align-items: center; gap: .4rem;
  transition: color .2s ease;
}
.nav-link:hover { color: #fff; }
.nav-link.active { color: var(--rust-hot); }

.nav-user {
  font-family: var(--mono), monospace;
  color: var(--muted);
  font-size: .82rem;
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Compact button used in the header and small actions */
.btn-sm {
  font-family: var(--display), sans-serif;
  font-weight: 600;
  font-size: .85rem;
  padding: .5rem 1rem;
  border-radius: .6rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: all .2s ease;
}
.btn-sm:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.btn-sm.btn-danger { background: rgba(205,74,31,0.12); border-color: var(--rust); color: var(--rust-hot); }
.btn-sm.btn-danger:hover { background: var(--rust); color: #fff; }

/* ─── Auth message banners (login / register) ────────────────────────────── */
.error-msg, .success-msg {
  margin-bottom: 1rem;
  padding: .8rem 1rem;
  border-radius: .6rem;
  font-size: .9rem;
  text-align: left;
  display: flex; align-items: center; gap: .6rem;
}
.error-msg   { background: rgba(239,68,68,0.1);  border-left: 3px solid #ef4444; color: #f87171; }
.success-msg { background: rgba(34,197,94,0.1);   border-left: 3px solid #22c55e; color: #4ade80; }

/* ─── Toast notifications ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: .6rem;
  max-width: min(360px, calc(100vw - 3rem));
}
.toast {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--rust);
  border-radius: .7rem;
  padding: .85rem 1rem;
  color: var(--text);
  font-size: .9rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  display: flex; align-items: center; gap: .6rem;
  animation: toastIn .25s ease;
}
.toast.hide { animation: toastOut .25s ease forwards; }
.toast.success { border-left-color: #22c55e; }
.toast.error   { border-left-color: #ef4444; }
.toast.info    { border-left-color: var(--rust-hot); }
.toast-icon { font-size: 1.1rem; line-height: 1; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ─── Chips / summary pills ───────────────────────────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .85rem;
  border-radius: 2rem;
  font-size: .82rem;
  font-family: var(--mono), monospace;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip.online { color: #34d399; border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.08); }
.chip.online .dot { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.5); }
.chip.total .dot { background: var(--muted); }

/* ─── Tracking capacity meter ─────────────────────────────────────────────── */
.capacity { margin-top: 1.1rem; max-width: 420px; }
.capacity-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono), monospace; font-size: .8rem; color: var(--muted);
  margin-bottom: .45rem; letter-spacing: .03em;
}
.capacity-head .count { color: var(--text); font-size: .95rem; }
.capacity-head .count.full { color: var(--rust-hot); }
.capacity-bar {
  height: 8px; border-radius: 2rem; overflow: hidden;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
}
.capacity-fill {
  height: 100%; border-radius: 2rem;
  background: linear-gradient(90deg, var(--rust), var(--rust-hot));
  transition: width .4s ease;
}
.capacity-fill.full { background: var(--rust-hot); box-shadow: 0 0 10px rgba(240,122,64,.45); }
.capacity-note {
  margin-top: .55rem; font-size: .8rem; color: var(--rust-hot);
  display: flex; align-items: center; gap: .4rem;
}

/* ─── Inline rename editor (My Players) ───────────────────────────────────── */
.rename-editor {
  display: flex; gap: .6rem; align-items: center;
  margin-top: 1.1rem; padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.rename-input {
  flex: 1; min-width: 0;
  padding: .55rem .8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: .55rem;
  color: var(--text); font-family: var(--sans), sans-serif; font-size: .9rem;
}
.rename-input::placeholder { color: var(--muted); }
.rename-input:focus { outline: none; border-color: var(--rust); background: rgba(255,255,255,0.06); }
.rename-save {
  border-color: var(--rust) !important; color: var(--rust-hot) !important;
  background: rgba(205,74,31,0.12) !important;
}
.rename-save:hover { background: var(--rust) !important; color: #fff !important; }

/* ─── Toolbar (filter + actions) ──────────────────────────────────────────── */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  margin: 1.5rem 0 .5rem;
}
.toolbar .filter-input {
  flex: 1; min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .6rem .9rem;
  color: #fff;
  font-family: var(--sans), sans-serif;
  font-size: .9rem;
  transition: border-color .2s ease;
}
.toolbar .filter-input:focus { outline: none; border-color: var(--rust); }

.btn-refresh svg { transition: transform .5s ease; }
.btn-refresh.spinning svg { transform: rotate(360deg); }

/* List row entry/leave helpers */
.fade-row { transition: opacity .2s ease; }
.is-hidden { display: none !important; }

/* ─── Rate limit bar ────────────────────────────────────────────────────── */
.rate-limit-bar {
  margin-top: 1rem;
  padding: .8rem 1rem;
  border-radius: .6rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
}
.rl-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
}
.rl-label {
  font-family: var(--display), sans-serif;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.rl-counts {
  font-family: var(--mono), monospace;
  font-size: .85rem;
  color: var(--text);
}
.rl-bar-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.rl-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--rust-hot);
  transition: width .3s ease;
}
.rl-bar-fill[style*="width:0%"],
.rl-bar-fill[style*="width: 0%"] {
  background: #e74c3c;
}
.rl-reset {
  margin-top: .4rem;
  font-size: .75rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .top-nav { padding: 0 1rem; }
  .nav-links { gap: .8rem; }
  .nav-user { display: none; }
}
