/* ================================================================
   GAMERS-FUSION · Indocron — 2026 UI
   Mobile-first responsive design system
   ================================================================ */

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

/* ── Design tokens ── */
:root {
  /* Surfaces */
  --s-bg:       #080c14;
  --s-base:     #0c1220;
  --s-raised:   #111827;
  --s-overlay:  #19253a;
  --s-hover:    #1e2d47;
  --s-active:   #243558;

  /* Borders */
  --b-subtle:   rgba(255,255,255,0.06);
  --b-default:  rgba(255,255,255,0.10);
  --b-strong:   rgba(255,255,255,0.18);
  --b-accent:   rgba(99,179,237,0.35);

  /* Brand */
  --blue:       #63b3ed;
  --blue-dark:  #2b6cb0;
  --cyan:       #4fd1c5;
  --gold:       #ecc94b;
  --red:        #fc8181;
  --green:      #68d391;
  --purple:     #b794f4;
  --orange:     #f6ad55;

  /* Glow */
  --glow-blue:  0 0 12px rgba(99,179,237,0.25);
  --glow-cyan:  0 0 12px rgba(79,209,197,0.25);
  --glow-red:   0 0 12px rgba(252,129,129,0.25);
  --glow-gold:  0 0 10px rgba(236,201,75,0.25);

  /* Text */
  --t-primary:    rgba(255,255,255,0.90);
  --t-secondary:  rgba(255,255,255,0.55);
  --t-muted:      rgba(255,255,255,0.30);
  --t-accent:     #63b3ed;

  /* Typography */
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;
  --font-disp:  'Syne', 'Inter', sans-serif;

  /* Spacing & shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 350ms;

  /* Layout */
  --sidebar-w: 220px;
  --topbar-h:  56px;
  --gap:       12px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--t-primary);
  background: var(--s-bg);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 100% 50% at 60% -5%, rgba(37,62,110,0.45) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(20,40,80,0.3) 0%, transparent 60%);
}

/* ── Scrollbar ── */
::-webkit-scrollbar              { width: 4px; height: 4px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--s-overlay); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover  { background: var(--s-hover); }

/* ── Focus ring ── */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── Links ── */
a { color: var(--blue); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--cyan); }

/* ── Selection ── */
::selection { background: rgba(99,179,237,0.25); color: var(--t-primary); }

/* ================================================================
   TOP NAVIGATION BAR
   ================================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  background: rgba(8,12,20,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--b-subtle);
}

/* Hamburger — mobile only */
.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--b-default);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--t-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.topbar-menu-btn:hover { background: var(--s-hover); color: var(--t-primary); }
.topbar-menu-btn svg  { width: 18px; height: 18px; }

/* Brand */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.topbar-brand-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--glow-blue);
}
.topbar-brand-name {
  font-family: var(--font-disp);
  font-size: 1rem;
  font-weight: 800;
  color: var(--t-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Topbar centre spacer */
.topbar-spacer { flex: 1; }

/* Topbar meta */
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--t-muted);
}
.topbar-clock {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  letter-spacing: 0.03em;
}
.topbar-tag {
  padding: 2px 8px;
  background: var(--s-raised);
  border: 1px solid var(--b-subtle);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--t-muted);
  white-space: nowrap;
}

/* Player avatar pill — topbar */
.topbar-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--s-raised);
  border: 1px solid var(--b-default);
  border-radius: 24px;
  cursor: default;
}
.topbar-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b6cb0, #4fd1c5);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.topbar-player-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--t-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-player-rank {
  font-size: 0.65rem;
  color: var(--t-muted);
  font-family: var(--font-mono);
}

/* ================================================================
   PAGE SHELL (sidebar + content)
   ================================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-w);
  grid-template-rows: 1fr;
  grid-template-areas: "left main right";
  min-height: 100vh;
  padding-top: var(--topbar-h);
  gap: 0;
}

/* ── Sidebar base ── */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--gap);
  scrollbar-width: thin;
}
.sidebar-left  { grid-area: left; border-right: 1px solid var(--b-subtle); }
.sidebar-right { grid-area: right; border-left: 1px solid var(--b-subtle); }
.main          { grid-area: main; padding: var(--gap); min-width: 0; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 149;
}

/* ================================================================
   PANEL / CARD
   ================================================================ */
.panel {
  background: var(--s-raised);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease);
  margin-bottom: var(--gap);
}
.panel:hover { border-color: var(--b-default); }

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--b-subtle);
  background: rgba(255,255,255,0.02);
}
.panel-title {
  font-family: var(--font-disp);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-secondary);
  flex: 1;
}
.panel-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gold);
  background: rgba(236,201,75,0.1);
  border: 1px solid rgba(236,201,75,0.2);
  padding: 1px 6px;
  border-radius: 20px;
}
.panel-body { padding: 14px; }
.panel-body--tight { padding: 10px 12px; }

/* Main content card (bigger radius, slight glow border) */
.content-card {
  background: var(--s-raised);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.content-card:hover { border-color: var(--b-default); }

.content-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--b-subtle);
  background: rgba(255,255,255,0.02);
}
.content-card-title {
  font-family: var(--font-disp);
  font-size: 1rem;
  font-weight: 800;
  color: var(--t-primary);
  letter-spacing: -0.02em;
}
.content-card-body { padding: 20px; }

/* ================================================================
   PLAYER STATS — Left Sidebar
   ================================================================ */
.player-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(43,108,176,0.15), rgba(79,209,197,0.08));
  border: 1px solid var(--b-accent);
  border-radius: var(--r-lg);
  margin-bottom: var(--gap);
}
.player-avatar-lg {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-dark), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--glow-blue);
}
.player-hero-name {
  font-family: var(--font-disp);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--t-primary);
  line-height: 1.2;
}
.player-hero-meta {
  font-size: 0.7rem;
  color: var(--t-muted);
  font-family: var(--font-mono);
  margin-top: 1px;
}

/* Vitals (HP / Energy / EXP) */
.vital { margin-bottom: 10px; }
.vital-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.vital-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-muted);
  font-family: var(--font-mono);
}
.vital-value {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--t-secondary);
}
.vital-track {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  overflow: hidden;
}
.vital-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s var(--ease);
}
.vital-fill--hp     { background: linear-gradient(90deg, #c53030, #fc8181); }
.vital-fill--energy { background: linear-gradient(90deg, #2b6cb0, #63b3ed); }
.vital-fill--exp    { background: linear-gradient(90deg, #b7791f, #ecc94b); }

/* Currency grid */
.currency-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.currency-table tr { border-bottom: 1px solid var(--b-subtle); }
.currency-table tr:last-child { border-bottom: none; }
.currency-table td { padding: 4px 0; vertical-align: middle; }
.currency-table .c-label {
  color: var(--t-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.currency-table .c-value {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gold);
}

/* ================================================================
   NAVIGATION — Left Sidebar
   ================================================================ */
.nav-group { margin-bottom: 16px; }
.nav-group-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--t-muted);
  padding: 0 8px;
  margin-bottom: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  color: var(--t-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  position: relative;
}
.nav-item:hover {
  background: var(--s-hover);
  color: var(--t-primary);
}
.nav-item.active {
  background: rgba(99,179,237,0.12);
  color: var(--blue);
}
.nav-item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }
.nav-item span { flex: 1; }
.nav-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(252,129,129,0.15);
  color: var(--red);
  border: 1px solid rgba(252,129,129,0.25);
  font-weight: 600;
}
.nav-pill--neutral {
  background: var(--s-overlay);
  color: var(--t-muted);
  border-color: var(--b-subtle);
}
.nav-item--danger { color: var(--red); }
.nav-item--danger:hover { background: rgba(252,129,129,0.1); color: var(--red); }
.nav-item--gold  { color: var(--gold); }
.nav-item--gold:hover { background: rgba(236,201,75,0.08); color: var(--gold); }
.nav-divider { height: 1px; background: var(--b-subtle); margin: 8px 0; }

/* ================================================================
   ONLINE PLAYERS — Right Sidebar
   ================================================================ */
.online-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--b-subtle);
  font-size: 0.8rem;
}
.online-item:last-child { border-bottom: none; }
.online-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
  animation: pulse-dot 2.5s ease infinite;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 6px var(--green); }
  50%      { box-shadow: 0 0 12px var(--green), 0 0 20px rgba(104,211,145,0.2); }
}
.online-item a { color: var(--t-primary); font-weight: 500; flex: 1; }
.online-item a:hover { color: var(--cyan); }
.online-id   { font-family: var(--font-mono); font-size: 0.65rem; color: var(--t-muted); }
.admin-crown { font-size: 0.65rem; color: var(--gold); }
.player-tag-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--purple);
  background: rgba(183,148,244,0.1);
  padding: 0 4px;
  border-radius: 3px;
}
.online-empty { font-size: 0.75rem; color: var(--t-muted); text-align: center; padding: 12px 0; }

/* Server stat rows */
.server-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--b-subtle);
  font-size: 0.78rem;
}
.server-stat:last-child { border-bottom: none; }
.server-stat-label { color: var(--t-muted); }
.server-stat-value { font-family: var(--font-mono); color: var(--cyan); font-weight: 500; }

/* ================================================================
   TABLES
   ================================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}
.data-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t-muted);
  border-bottom: 1px solid var(--b-subtle);
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--b-subtle);
  color: var(--t-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--t-fast) var(--ease); }
.data-table tbody tr:hover td { background: var(--s-hover); }

/* Backwards compat alias for old .twig files that use <table> directly */
table { width: 100%; border-collapse: collapse; font-size: 0.825rem; }
table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t-muted);
  border-bottom: 1px solid var(--b-subtle);
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
}
table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--b-subtle);
  color: var(--t-primary);
  vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tbody tr { transition: background var(--t-fast) var(--ease); }
table tbody tr:hover td { background: var(--s-hover); }

/* ================================================================
   FORMS
   ================================================================ */
.form-field { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--t-muted);
  margin-bottom: 6px;
}
.form-hint {
  font-size: 0.7rem;
  color: var(--t-muted);
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  background: var(--s-base);
  border: 1px solid var(--b-default);
  border-radius: var(--r-md);
  color: var(--t-primary);
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  width: auto;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(99,179,237,0.15);
}
input::placeholder, textarea::placeholder { color: var(--t-muted); }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffffff40' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
select option { background: var(--s-raised); }
textarea { resize: vertical; display: block; }

.input-full { width: 100%; display: block; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: var(--r-md);
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue-dark), #3a7bc8);
  color: #fff;
  border-color: rgba(99,179,237,0.3);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #3a7bc8, var(--blue)); color: #fff; box-shadow: var(--glow-blue); }
.btn-ghost {
  background: transparent;
  color: var(--t-secondary);
  border-color: var(--b-default);
}
.btn-ghost:hover { background: var(--s-hover); color: var(--t-primary); border-color: var(--b-strong); }
.btn-danger { background: rgba(252,129,129,0.1); color: var(--red); border-color: rgba(252,129,129,0.25); }
.btn-danger:hover { background: rgba(252,129,129,0.2); box-shadow: var(--glow-red); }
.btn-sm { font-size: 0.75rem; padding: 5px 12px; }
.btn-full { width: 100%; }

/* Map old input[type=submit] to look like btn-primary */
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--blue-dark), #3a7bc8);
  color: #fff;
  border: 1px solid rgba(99,179,237,0.3);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: all var(--t-fast) var(--ease);
}
input[type="submit"]:hover { background: linear-gradient(135deg, #3a7bc8, var(--blue)); box-shadow: var(--glow-blue); }

/* Old-style form-table compat */
.form-table { border-collapse: collapse; }
.form-table td { padding: 5px 8px; vertical-align: middle; }
.form-table td:first-child { font-size: 0.75rem; color: var(--t-muted); white-space: nowrap; padding-right: 14px; }
.center { text-align: center; }

/* ================================================================
   ALERTS / MESSAGES
   ================================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 0.825rem;
  margin-bottom: 14px;
  border: 1px solid;
}
.alert-error   { background: rgba(252,129,129,0.08); border-color: rgba(252,129,129,0.25); color: #fca5a5; }
.alert-success { background: rgba(104,211,145,0.08); border-color: rgba(104,211,145,0.25); color: #86efac; }
.alert-info    { background: rgba(99,179,237,0.08);  border-color: rgba(99,179,237,0.25);  color: #93c5fd; }
.alert-warn    { background: rgba(236,201,75,0.08);  border-color: rgba(236,201,75,0.25);  color: #fde68a; }

/* Backwards-compat aliases */
.msg-error   { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border-radius:var(--r-md); font-size:0.825rem; margin-bottom:14px; border:1px solid rgba(252,129,129,0.25); background:rgba(252,129,129,0.08); color:#fca5a5; }
.msg-success { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border-radius:var(--r-md); font-size:0.825rem; margin-bottom:14px; border:1px solid rgba(104,211,145,0.25); background:rgba(104,211,145,0.08); color:#86efac; }

/* ================================================================
   TYPOGRAPHY HELPERS
   ================================================================ */
h1, h2, h3, h4 { font-family: var(--font-disp); font-weight: 800; color: var(--t-primary); line-height: 1.2; }
h1 { font-size: 1.6rem; letter-spacing: -0.03em; }
h2 { font-size: 1.2rem; letter-spacing: -0.02em; }
h3 { font-size: 1rem; }

.section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--t-muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--b-subtle);
}

b, strong { color: var(--t-primary); font-weight: 600; }
em { color: var(--t-secondary); font-style: normal; }
code, .mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--s-overlay);
  border: 1px solid var(--b-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--cyan);
}
hr { border: none; border-top: 1px solid var(--b-subtle); margin: 16px 0; }

ul { list-style: none; padding: 0; }
ul li { padding: 3px 0; font-size: 0.875rem; color: var(--t-secondary); }
ul li::before { content: none; }
ul li a { color: var(--t-primary); }
ul li a:hover { color: var(--cyan); }

/* ================================================================
   STATUS / BADGE CHIPS
   ================================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid;
}
.chip-blue   { background: rgba(99,179,237,0.12);  border-color: rgba(99,179,237,0.25);  color: var(--blue); }
.chip-green  { background: rgba(104,211,145,0.12); border-color: rgba(104,211,145,0.25); color: var(--green); }
.chip-red    { background: rgba(252,129,129,0.12); border-color: rgba(252,129,129,0.25); color: var(--red); }
.chip-gold   { background: rgba(236,201,75,0.12);  border-color: rgba(236,201,75,0.25);  color: var(--gold); }
.chip-purple { background: rgba(183,148,244,0.12); border-color: rgba(183,148,244,0.25); color: var(--purple); }

/* News */
.news-card {
  border-left: 3px solid var(--gold);
  background: rgba(236,201,75,0.04);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.news-card .news-by   { font-size: 0.7rem; color: var(--t-muted); margin-bottom: 4px; font-family: var(--font-mono); }
.news-card .news-title { font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.news-card .news-body  { font-size: 0.85rem; color: var(--t-secondary); }

/* Battle log */
.battle-log {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  background: var(--s-base);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-md);
  padding: 14px;
  max-height: 320px;
  overflow-y: auto;
}

/* Chat */
#chat-log {
  font-size: 0.825rem;
  line-height: 1.8;
  background: var(--s-base);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-md);
  padding: 14px;
  height: 340px;
  overflow-y: auto;
}

/* ================================================================
   GUEST PAGE (login / register)
   ================================================================ */
.guest-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -5%, rgba(30,58,110,0.6) 0%, transparent 65%),
    radial-gradient(ellipse 50% 45% at 90% 110%, rgba(15,40,70,0.4) 0%, transparent 60%),
    var(--s-bg);
}
.guest-inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.guest-brand {
  text-align: center;
  animation: fadeDown 0.5s var(--ease) both;
}
.guest-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue-dark), var(--cyan));
  font-family: var(--font-disp);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: var(--glow-blue), 0 8px 24px rgba(0,0,0,0.4);
}
.guest-brand-title {
  font-family: var(--font-disp);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--t-primary);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.guest-brand-sub {
  font-size: 0.75rem;
  color: var(--t-muted);
  letter-spacing: 0.05em;
}

.guest-card {
  width: 100%;
  background: var(--s-raised);
  border: 1px solid var(--b-default);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: fadeUp 0.4s var(--ease) 0.1s both;
}
.guest-card-header {
  padding: 20px 24px 0;
}
.guest-card-title {
  font-family: var(--font-disp);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--t-primary);
  margin-bottom: 4px;
}
.guest-card-sub {
  font-size: 0.8rem;
  color: var(--t-muted);
  margin-bottom: 20px;
}
.guest-card-body { padding: 20px 24px 24px; }

.player-count-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--s-overlay);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-md);
  font-size: 0.78rem;
  color: var(--t-muted);
  margin-bottom: 20px;
}
.player-count-pill strong { color: var(--gold); }

.guest-field { margin-bottom: 16px; }
.guest-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--t-secondary);
  margin-bottom: 6px;
}
.guest-field input { width: 100%; display: block; }
.guest-field .hint { font-size: 0.7rem; color: var(--t-muted); margin-top: 4px; }

.guest-submit { margin-top: 20px; }
.guest-submit input[type="submit"] { width: 100%; padding: 11px; font-size: 0.9rem; letter-spacing: 0.01em; }

.guest-footer-links {
  font-size: 0.8rem;
  color: var(--t-muted);
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--b-subtle);
  margin-top: 4px;
}
.guest-footer-links a { color: var(--blue); font-weight: 500; }
.guest-footer-links a:hover { color: var(--cyan); }

.guest-page-footer {
  font-size: 0.7rem;
  color: var(--t-muted);
  text-align: center;
  animation: fadeUp 0.4s var(--ease) 0.2s both;
}

/* ================================================================
   ERROR PAGE
   ================================================================ */
.error-page { text-align: center; }
.error-num {
  font-family: var(--font-disp);
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--red), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 8px;
}
.error-text { font-size: 1rem; color: var(--t-secondary); margin-bottom: 24px; }

/* ================================================================
   FOOTER
   ================================================================ */
.page-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.72rem;
  color: var(--t-muted);
  border-top: 1px solid var(--b-subtle);
  margin-top: 8px;
}

/* ================================================================
   KEYFRAMES
   ================================================================ */
@keyframes fadeDown { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(10px);  } to { opacity:1; transform:translateY(0); } }

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* ── Tablet: hide right sidebar, compress left ── */
@media (max-width: 1100px) {
  :root { --sidebar-w: 200px; }
  .shell { grid-template-columns: var(--sidebar-w) 1fr; grid-template-areas: "left main"; }
  .sidebar-right { display: none; }
}

/* ── Mobile: stacked, drawer sidebar ── */
@media (max-width: 720px) {
  :root { --topbar-h: 52px; }

  .topbar-meta   { display: none; }
  .topbar-player { display: none; }
  .topbar-menu-btn { display: flex; }

  .shell {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  /* Left sidebar becomes off-canvas drawer */
  .sidebar-left {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    z-index: 150;
    background: var(--s-base);
    border-right: 1px solid var(--b-default);
    border-radius: 0;
    padding: calc(var(--topbar-h) + 12px) 12px 12px;
    transform: translateX(-100%);
    transition: transform var(--t-slow) var(--ease);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .sidebar-left.open { transform: translateX(0); }
  .sidebar-overlay   { display: block; }

  .main { padding: 10px; }
  .content-card-body { padding: 14px; }
  .content-card-header { padding: 14px 16px; }

  /* Inline-ify old .form-table */
  .form-table td:first-child { display: block; margin-bottom: 2px; }
  .form-table td { display: block; padding: 3px 0; }
}

/* ── Extra small ── */
@media (max-width: 420px) {
  .guest-inner { gap: 16px; }
  .guest-card-header, .guest-card-body { padding-left: 16px; padding-right: 16px; }
  .guest-brand-title { font-size: 1.3rem; }
}


/* ================================================================
   CONTROL PANEL — CP-specific styles
   ================================================================ */

/* Sub-navigation tabs */
.cp-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--b-subtle);
}
.cp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--t-secondary);
  border: 1px solid var(--b-subtle);
  background: var(--s-overlay);
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
}
.cp-tab:hover { background: var(--s-hover); color: var(--t-primary); border-color: var(--b-default); }
.cp-tab--active { background: rgba(99,179,237,.12); color: var(--blue); border-color: rgba(99,179,237,.3); }

/* Dashboard cards */
.cp-dashboard {}
.cp-header { margin-bottom: 20px; }
.cp-heading { font-family: var(--font-disp); font-size: 1.4rem; font-weight: 800; color: var(--t-primary); margin-bottom: 4px; }
.cp-subheading { font-size: .85rem; color: var(--t-muted); }

.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.cp-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--s-overlay);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
}
.cp-card:hover { background: var(--s-hover); border-color: var(--b-default); transform: translateY(-1px); }
.cp-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
}
.cp-card-icon--blue   { background: rgba(99,179,237,.15); color: var(--blue); }
.cp-card-icon--gold   { background: rgba(236,201,75,.15);  color: var(--gold); }
.cp-card-icon--green  { background: rgba(104,211,145,.15); color: var(--green); }
.cp-card-icon--cyan   { background: rgba(79,209,197,.15);  color: var(--cyan); }
.cp-card-icon--purple { background: rgba(183,148,244,.15); color: var(--purple); }
.cp-card-icon--red    { background: rgba(252,129,129,.15); color: var(--red); }
.cp-card-label { font-weight: 700; font-size: .9rem; color: var(--t-primary); }
.cp-card-desc  { font-size: .75rem; color: var(--t-muted); line-height: 1.4; }

/* Permission chips */
.cp-my-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  background: rgba(99,179,237,.1);
  color: var(--blue);
  border: 1px solid rgba(99,179,237,.2);
}
.perm-chip--owner { background: rgba(236,201,75,.1); color: var(--gold); border-color: rgba(236,201,75,.2); }

/* Rank chips */
.rank-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: .65rem;
  font-weight: 700;
  border: 1px solid;
}
.rank-chip--owner     { background: rgba(236,201,75,.15); color: var(--gold);   border-color: rgba(236,201,75,.3); }
.rank-chip--admin     { background: rgba(252,129,129,.12); color: var(--red);   border-color: rgba(252,129,129,.25); }
.rank-chip--moderator { background: rgba(183,148,244,.12); color: var(--purple);border-color: rgba(183,148,244,.25); }
.rank-chip--staff     { background: rgba(79,209,197,.12);  color: var(--cyan);  border-color: rgba(79,209,197,.25); }
.rank-chip--member    { background: var(--s-overlay);      color: var(--t-muted);border-color: var(--b-subtle); }

/* Stat cards */
.cp-stat-card {
  background: var(--s-overlay);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-lg);
  padding: 16px;
  text-align: center;
}
.cp-stat-num   { font-family: var(--font-disp); font-size: 1.8rem; font-weight: 800; color: var(--cyan); }
.cp-stat-label { font-size: .75rem; color: var(--t-muted); margin-top: 2px; }

/* Action panels */
.cp-action-panel {
  background: var(--s-overlay);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 16px;
}

/* Toolbar / search */
.cp-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cp-search-form { display: flex; gap: 8px; flex: 1; }
.cp-search-input { flex: 1; }

/* Table wrap */
.cp-table-wrap { overflow-x: auto; }

/* Inline form rows within table cells */
.cp-action-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cp-inline-form { display: inline-flex; align-items: center; gap: 4px; }
.cp-select-sm { font-size: .75rem; padding: 3px 6px; }
.cp-input-sm  { font-size: .75rem; padding: 3px 6px; width: auto; }

/* Roles grid */
.cp-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.cp-role-card {
  background: var(--s-overlay);
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-lg);
  padding: 16px;
}
.cp-role-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--b-subtle);
}
.cp-perms-list { display: flex; flex-direction: column; gap: 2px; }
.cp-perm-group-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--t-muted);
  margin: 10px 0 4px;
}
.cp-perm-group-label:first-child { margin-top: 0; }
.cp-perm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  font-size: .8rem;
  color: var(--t-secondary);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.cp-perm-row:hover { background: var(--s-hover); color: var(--t-primary); }
.cp-perm-row input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--blue); flex-shrink: 0; }

/* Modals */
.cp-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cp-modal[style*="flex"] { display: flex !important; }
.cp-modal-box {
  background: var(--s-raised);
  border: 1px solid var(--b-default);
  border-radius: var(--r-xl);
  padding: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: fadeUp .25s var(--ease) both;
}
.cp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-disp);
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--b-subtle);
}
.cp-modal-close {
  background: none; border: none; color: var(--t-muted); cursor: pointer; font-size: 1rem; padding: 0;
}
.cp-modal-close:hover { color: var(--t-primary); }
.cp-modal-form .form-field { margin-bottom: 12px; }

/* Responsive */
@media (max-width: 720px) {
  .cp-grid { grid-template-columns: 1fr 1fr; }
  .cp-roles-grid { grid-template-columns: 1fr; }
  .cp-action-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .cp-grid { grid-template-columns: 1fr; }
}
