/* ═══════════════════════════════════════════════════════════════════════════
   ELDORIA — dark theme
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0f1114;
  --bg-elevated: #16181c;
  --surface: #1a1d21;
  --surface-hover: #22262c;
  --border: #2d3239;
  --border-subtle: #23272e;

  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --text-dim: #6b7280;

  --brand: #1bd96a;
  --brand-hover: #15c25d;
  --brand-dim: rgba(27, 217, 106, 0.12);
  --brand-glow: rgba(27, 217, 106, 0.25);

  --online: #1bd96a;
  --online-hover: #15c25d;
  --online-dim: rgba(27, 217, 106, 0.12);
  --online-glow: rgba(27, 217, 106, 0.25);

  --red: #f87171;
  --yellow: #fbbf24;
  --blue: #60a5fa;
  --purple: #a78bfa;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --header-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

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

/* ─── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(15, 17, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img { border-radius: 6px; }

.site-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.auth-guest {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.auth-guest[hidden],
.auth-user[hidden] {
  display: none !important;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  image-rendering: pixelated;
}

.auth-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.auth-username-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.auth-username-btn:hover .auth-username {
  color: var(--brand);
}

.site-nav a[hidden] {
  display: none !important;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: #0a1a10;
}

.btn-primary:hover {
  background: var(--brand-hover);
  color: #0a1a10;
  box-shadow: 0 0 20px var(--brand-glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

.text-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
}

.text-link:hover { text-decoration: underline; }

/* ─── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding: 3.5rem 0 2.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, var(--brand-dim), transparent),
    var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.online { background: var(--online); box-shadow: 0 0 8px var(--online-glow); }
.status-dot.offline { background: var(--red); }

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stat-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  min-width: 130px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

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

/* ─── Layout ───────────────────────────────────────────────────────────────── */

.section { padding: 3rem 0; }
.section-alt { background: var(--bg-elevated); }
.page-section { padding-top: 2rem; min-height: calc(100vh - var(--header-h) - 120px); }
.section-join { border-top: 1px solid var(--border-subtle); }

.site-nav a.nav-active {
  color: var(--text);
  background: var(--surface);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-head-tabs {
  align-items: flex-start;
}

.section-head-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.section-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.section-tab {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.section-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.section-tab.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.section-tab[hidden] {
  display: none !important;
}

.settings-card[hidden],
#dashboard-content[hidden],
#dashboard-denied[hidden] {
  display: none !important;
}

.meta-pill {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.3rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.search-input {
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  min-width: 200px;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 1.25rem;
  align-items: start;
}

.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

/* ─── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 1rem 1.15rem; }
.card-footer { padding: 0.85rem 1.15rem; border-top: 1px solid var(--border-subtle); }
.card-compact .card-body { padding: 1.15rem; }

.join-card h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.join-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ─── Server Info ──────────────────────────────────────────────────────────── */

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.info-list li:last-child { border-bottom: none; }

.info-key { color: var(--text-muted); }
.info-val { font-weight: 500; }

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.feature-tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: var(--brand-dim);
  color: var(--brand);
  border-radius: 6px;
}

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

.address-row code {
  flex: 1;
  font-size: 0.8rem;
  color: var(--online);
  background: var(--bg);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Map ──────────────────────────────────────────────────────────────────── */

.card-map .map-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  background: var(--bg);
}

.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
  background: var(--bg);
}

.map-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.map-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.map-loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: map-spin 0.8s linear infinite;
}

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

.map-fallback-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 17, 20, 0.88);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.map-fallback-bar a {
  font-weight: 600;
}

/* ─── Feeds ────────────────────────────────────────────────────────────────── */

.feed { max-height: 280px; overflow-y: auto; }

.feed-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.feed-item:last-child { border-bottom: none; }

.feed-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.feed-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.feed-tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.feed-tag.event { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.feed-tag.update { background: rgba(96, 165, 250, 0.15); color: var(--blue); }
.feed-tag.announcement { background: rgba(251, 191, 36, 0.15); color: var(--yellow); }

.feed-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.feed-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.update-version {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
}

.update-changes {
  list-style: none;
  margin-top: 0.3rem;
}

.update-changes li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 0.85rem;
  position: relative;
}

.update-changes li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--brand);
}

/* ─── Player Stats Table ───────────────────────────────────────────────────── */

.card-table { padding: 0; }

.table-wrap { overflow-x: auto; }

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.stats-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.stats-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.stats-table tbody tr:hover {
  background: var(--surface-hover);
}

.stats-table tbody tr.online-row {
  background: var(--online-dim);
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem !important;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  image-rendering: pixelated;
  background: var(--bg);
}

.player-name {
  font-weight: 600;
}

.player-online {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 6px var(--online-glow);
  margin-left: 0.35rem;
  vertical-align: middle;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--brand-dim);
  color: var(--brand);
  border-radius: 6px;
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 160px;
}

.skill-bar-row {
  display: grid;
  grid-template-columns: minmax(76px, 92px) 1fr 22px;
  align-items: center;
  gap: 0.5rem;
}

.skill-bar-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-bar-track {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  min-width: 0;
}

.skill-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  min-width: 2px;
}

.skill-bar-val {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
}

.footer-status-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.footer-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-discord:hover {
  color: #5865f2;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-icon:hover {
  background: var(--bg);
  color: var(--text);
}

/* ─── Modal ────────────────────────────────────────────────────────────────── */

.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 520px;
  width: calc(100% - 2rem);
  margin: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.modal:not([open]) {
  display: none;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  color: var(--text);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-player-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.modal-player-head img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  image-rendering: pixelated;
}

.modal-player-head h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.modal-player-head p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.modal-skill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.65rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.modal-skill span:first-child {
  color: var(--text-muted);
  text-transform: capitalize;
}

.modal-skill span:last-child {
  font-weight: 600;
  color: var(--brand);
}

/* ─── Staff ────────────────────────────────────────────────────────────────── */

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.staff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}

.staff-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.staff-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.staff-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.staff-name {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.staff-role {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.role-king { background: rgba(251, 191, 36, 0.15); color: var(--yellow); }
.role-mage { background: rgba(167, 139, 250, 0.15); color: var(--purple); }
.role-warrior { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.role-lore { background: var(--brand-dim); color: var(--brand); }
.role-mod { background: rgba(96, 165, 250, 0.15); color: var(--blue); }
.role-builder { background: rgba(251, 191, 36, 0.12); color: var(--yellow); }

.staff-motto {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Join steps ───────────────────────────────────────────────────────────── */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.step-card {
  padding: 1.5rem;
  position: relative;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--brand-dim);
  color: var(--brand);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.step-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.address-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.address-box code {
  flex: 1;
  font-size: 0.85rem;
  color: var(--online);
}

/* ─── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
  }
  .main-column { grid-column: 1 / -1; order: -1; }
}

@media (max-width: 768px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .nav-toggle { display: flex; }
  .header-inner .btn-primary.btn-sm { display: none; }
  .dashboard { grid-template-columns: 1fr; }
  .stat-cards { width: 100%; }
  .stat-card { flex: 1; min-width: 100px; }
  .modal-skills-grid { grid-template-columns: 1fr; }
  .stats-table th:nth-child(6),
  .stats-table td:nth-child(6) { display: none; }
}

@media (max-width: 480px) {
  .stats-table th:nth-child(4),
  .stats-table td:nth-child(4) { display: none; }
  .auth-guest .btn:first-child { display: none; }
}

/* ─── Auth & roles ─────────────────────────────────────────────────────────── */

.role-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.role-chief { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }
.role-admin { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.role-moderator { background: rgba(96, 165, 250, 0.15); color: var(--blue); }
.role-donator { background: rgba(167, 139, 250, 0.15); color: var(--purple); }

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand);
}

.form-error {
  color: var(--red);
  font-size: 0.8rem;
  min-height: 1.2em;
}

.form-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: -0.25rem;
}

.form-success {
  color: var(--brand);
  font-size: 0.85rem;
}

.form-success[hidden] {
  display: none !important;
}

/* ─── Settings ─────────────────────────────────────────────────────────────── */

.settings-card {
  max-width: 520px;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.settings-avatar {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  image-rendering: pixelated;
}

.settings-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.settings-discord {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.settings-form {
  max-width: 360px;
}

/* ─── Staff dashboard ──────────────────────────────────────────────────────── */

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

.dashboard-stat-cards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.dashboard-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  text-align: center;
}

.dashboard-stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.dashboard-stat-value.online { color: var(--brand); }
.dashboard-stat-value.offline { color: var(--red); }

.dashboard-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dashboard-card .card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.dashboard-card-wide {
  grid-column: span 2;
}

.dashboard-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-role-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dashboard-role-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dashboard-role-list strong {
  color: var(--text);
}

.dashboard-staff-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dashboard-staff-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dashboard-staff-row img {
  border-radius: 6px;
  image-rendering: pixelated;
}

.dashboard-staff-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}

.admin-section {
  margin-top: 1.25rem;
}

.admin-section:empty {
  display: none;
}

.admin-card {
  margin-top: 0;
}

.admin-table .form-input-sm {
  padding: 0.3rem 0.45rem;
  font-size: 0.8rem;
  min-width: 100px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.status-paused {
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-active {
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
}

.staff-title-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  color: var(--title-color, var(--brand));
  background: color-mix(in srgb, var(--title-color, var(--brand)) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--title-color, var(--brand)) 35%, transparent);
}

.title-create-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.title-create-form .form-input {
  flex: 1;
  min-width: 140px;
}

.form-input-color {
  width: 48px;
  height: 38px;
  padding: 0.2rem;
  cursor: pointer;
}

.title-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.title-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modrinth-panel-desc {
  margin-bottom: 1rem;
}

.modrinth-status {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.modrinth-status p {
  margin: 0.25rem 0;
}

.modrinth-upload-form,
.modrinth-url-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.modrinth-url-form {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.settings-staff-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.settings-subheading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.server-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.server-stat-card .card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.35rem 1.5rem;
}

.server-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
}

.server-stat-currency {
  line-height: 1.1;
  width: 100%;
}

.server-stat-currency .currency-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 1.25rem;
}

.server-stat-currency .currency-row .currency-part {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
}

.server-stat-currency .currency-row .currency-stack-val,
.server-stat-currency .currency-row .currency-amount {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.server-stat-currency .currency-row .currency-coin {
  width: 1.35em;
  height: 1.35em;
  font-size: 1.15rem;
}

.server-stat-currency .currency-stack {
  gap: 0.45rem;
}

.server-stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.server-stat-sub {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.currency-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #bd9838;
  background: color-mix(in srgb, #bd9838 14%, transparent);
  border: 1px solid color-mix(in srgb, #bd9838 28%, transparent);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}

.currency-stack-wrap {
  min-width: 56px;
}

.currency-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.currency-stack-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.currency-stack-val {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: right;
}

.currency-stack-empty {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.currency-stack .currency-coin {
  width: 1.25em;
  height: 1.25em;
  font-size: 1rem;
}

.currency-display {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.currency-part {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  line-height: 1;
}

.currency-amount {
  font-variant-numeric: tabular-nums;
}

.currency-coin {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: pixelated;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .server-stats-grid {
    grid-template-columns: 1fr;
  }
}

.content-mgmt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.content-table .content-row-title {
  display: block;
  margin-bottom: 0.2rem;
}

.content-table .content-row-excerpt {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .content-mgmt-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-card-wide {
    grid-column: span 1;
  }
}

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

/* ─── Live chat ────────────────────────────────────────────────────────────── */

.card-chat {
  margin-top: 1.25rem;
}

.chat-messages {
  max-height: 280px;
  overflow-y: auto;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.chat-empty {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem 0;
}

.chat-message {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.chat-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.chat-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.chat-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  word-break: break-word;
}

.chat-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
}

.chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
}

.chat-input:focus {
  outline: none;
  border-color: var(--brand);
}

.chat-input:disabled {
  opacity: 0.5;
}
