/* ============================================================
   MuOnline CMS - Dark Theme
   Aesthetic: Gothic Fantasy / Dark Medieval
   Fonts: Cinzel (display) + Nunito (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Italiana&family=Nunito:wght@300;400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg-primary:    #080b10;
  --bg-secondary:  rgba(13,17,23,1);
  --bg-card:       rgba(17,24,39,1);
  --bg-card-hover: rgba(26,34,54,1);
  --bg-input:      rgba(13,21,32,1);

  /* Per-block opacity — PHP injects :root overrides in header.php AFTER this file loads.
     These fallbacks are only used if header.php fails to inject values. */
  --op-navbar:     0.95;
  --op-cards:      1;
  --op-sidebar:    1;
  --op-dropdown:   0.97;
  --op-table:      1;
  --op-footer:     1;
  --op-statusbar:  1;
  --op-ppcard:     1;

  --border:        #1e2d40;
  --border-glow:   #4a7faa55;

  --gold:          #8ab4d6;
  --gold-light:    #b0d4f0;
  --gold-dark:     #5a8aaa;
  --gold-glow:     rgba(100, 160, 210, 0.3);

  --red:           #c0392b;
  --red-glow:      rgba(192, 57, 43, 0.3);
  --green:         #27ae60;
  --blue:          #2980b9;
  --purple:        #8e44ad;

  --text-primary:  #dde4ec;
  --text-secondary:#9aa5b4;
  --text-muted:    #5a6a7e;
  --text-gold:     #8ab4d6;

  --shadow-gold:   0 0 20px rgba(100, 160, 210, 0.2);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.5);
  --shadow-deep:   0 8px 48px rgba(0,0,0,0.8);

  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     20px;

  --transition:    all 0.2s ease;
  --transition-slow: all 0.4s ease;

  --nav-height:    70px;
  --sidebar-width: 260px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(13,17,23,var(--op-cards)); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

.text-gold   { color: var(--gold); }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--red); }
.text-success{ color: var(--green); }
.font-display{ font-family: 'Cinzel', serif; }

/* ── Layout ─────────────────────────────────────────────────── */
.container      { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm   { max-width: 800px;  margin: 0 auto; padding: 0 24px; }
.container-xs   { max-width: 480px;  margin: 0 auto; padding: 0 24px; }

.page-wrapper   { display: flex; min-height: 100vh; flex-direction: column; }
.main-content   { flex: 1; padding: 32px 0; }

/* With sidebar */
.panel-layout { display: flex; gap: 24px; padding: 24px; max-width: 1400px; margin: 0 auto; }
.panel-sidebar { width: var(--sidebar-width); flex-shrink: 0; }
.panel-main    { flex: 1; min-width: 0; }

/* Grid */
.grid-2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* ── Navigation ─────────────────────────────────────────────── */
.navbar {
  height: var(--nav-height);
  background: rgba(8,11,16,var(--op-navbar));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.3;
}

.navbar > .container {
  height: 100%;
}

.navbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}

.navbar-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 2px;
  white-space: nowrap;
  overflow: visible;
}

.navbar-logo-img {
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
  transition: opacity 0.2s;
}
.navbar-logo:hover .navbar-logo-img { opacity: 0.85; }

.navbar-logo span { color: var(--text-secondary); font-weight: 400; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex: 1;
}

.navbar-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  letter-spacing: 0.5px;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--gold);
  background: rgba(100,160,210,0.08);
}

.navbar-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 60%; height: 2px;
  background: var(--gold);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--gold);
}

/* Dropdown nav */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: rgba(17,24,39,var(--op-dropdown));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

.nav-dropdown-menu a:hover { 
  color: var(--gold); 
  background: rgba(100,160,210,0.08);
  padding-left: 18px;
}

/* ── Server Switcher ─────────────────────────────────────────── */
.server-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}
.server-btn {
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.server-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}
.server-btn.active {
  font-weight: 700;
  cursor: default;
}
.server-btn.active:hover {
  opacity: 0.9;
}

.navbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* Mobile menu toggle */
.navbar-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.4rem; cursor: pointer; }

/* ── Server Status Bar ───────────────────────────────────────── */
.status-bar {
  background: rgba(13,17,23,var(--op-statusbar));
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
  font-size: 0.8rem;
}

.status-bar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #888;
  box-shadow: none;
}
.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}
.status-dot.offline {
  background: #e74c3c;
  box-shadow: 0 0 6px #e74c3c;
  animation: none;
}

.status-dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ── Staff popup ─────────────────────────────────────────────── */
.sb-staff-wrap { position: relative; }
.sb-staff-popup {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  min-width: 220px;
  filter: drop-shadow(0 16px 40px rgba(0,0,0,.75));
}
.sb-staff-wrap:hover .sb-staff-popup { display: block; animation: sb-fade .15s ease; }
@keyframes sb-fade { from { opacity:0; transform:translateX(-50%) translateY(-4px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
.sb-sp-arrow { width:0; height:0; border-left:6px solid transparent; border-right:6px solid transparent; border-bottom:6px solid rgba(201,162,39,.22); margin:0 auto; position:relative; z-index:1; }
.sb-sp-inner { background:#0d1119; border:1px solid rgba(201,162,39,.22); border-radius:10px; overflow:hidden; margin-top:-1px; }
.sb-sp-inner::before { content:''; display:block; height:1px; background:linear-gradient(90deg,transparent,rgba(201,162,39,.55),transparent); }
.sb-sp-head { padding:8px 14px; border-bottom:1px solid rgba(255,255,255,.06); font-size:.6rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:rgba(255,255,255,.4); display:flex; align-items:center; gap:7px; }
.sb-sp-badge { margin-left:auto; font-size:.56rem; background:rgba(34,212,122,.08); border:1px solid rgba(34,212,122,.2); border-radius:4px; padding:1px 7px; color:#22d47a; font-weight:700; text-transform:none; letter-spacing:0; }
.sb-sp-row { display:flex; align-items:center; gap:9px; padding:9px 13px; border-bottom:1px solid rgba(255,255,255,.04); }
.sb-sp-row:last-of-type { border-bottom:none; }
.sb-sp-offline { opacity:.38; }
.sb-sp-av { width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-family:'Cinzel',serif; font-size:.62rem; font-weight:700; flex-shrink:0; }
.sb-sp-av.admin { background:rgba(201,162,39,.12); border:1.5px solid rgba(201,162,39,.4); color:#c9a227; }
.sb-sp-av.gm    { background:rgba(77,143,255,.1);  border:1.5px solid rgba(77,143,255,.35); color:#4d8fff; }
.sb-sp-info { flex:1; min-width:0; }
.sb-sp-name { font-family:'Cinzel',serif; font-size:.73rem; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb-sp-name.admin { color:#c9a227; }
.sb-sp-name.gm    { color:#60a5fa; }
.sb-sp-role { font-size:.54rem; text-transform:uppercase; letter-spacing:.05em; margin-top:2px; color:rgba(255,255,255,.25); }
.sb-sp-status { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.sb-sp-dot { width:6px; height:6px; border-radius:50%; }
.sb-sp-dot.on  { background:#22d47a; box-shadow:0 0 5px rgba(34,212,122,.6); animation:sb-pulse 2s infinite; }
.sb-sp-dot.off { background:rgba(255,255,255,.18); }
@keyframes sb-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(34,212,122,.5)} 70%{box-shadow:0 0 0 4px rgba(34,212,122,0)} }
.sb-sp-on  { font-size:.58rem; color:#22d47a; font-weight:600; }
.sb-sp-off { font-size:.58rem; color:rgba(255,255,255,.25); font-weight:500; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: rgba(17,24,39,var(--op-cards));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible;
  transition: var(--transition);
  position: relative;
}

.card:hover { border-color: var(--gold-dark); box-shadow: var(--shadow-gold); }

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

/* Stat card */
.stat-card {
  background: rgba(17,24,39,var(--op-cards));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--gold);
}

.stat-card .stat-value {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  box-shadow: 0 2px 12px var(--gold-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: 0 4px 20px var(--gold-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(100,160,210,0.1);
  border-color: var(--gold);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red) 0%, #8B0000 100%);
  color: #fff;
  box-shadow: 0 2px 12px var(--red-glow);
}

.btn-danger:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 20px var(--red-glow); }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }
.btn-full { width: 100%; }

.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-size: 0.925rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background: rgba(100,160,210,0.03);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c89600' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  color: var(--text-primary);
  border-color: var(--border);
}

select.form-control:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

select.form-control option {
  background-color: rgba(17,24,39,var(--op-cards));
  color: var(--text-primary, #e8e0d0);
  padding: 10px 14px;
  font-size: 0.9rem;
}

select.form-control option:checked,
select.form-control option:hover {
  background-color: var(--bg-card-hover);
  color: #c89600;
}

/* Custom select wrapper for JS-powered dropdowns */
.custom-select-wrapper {
  position: relative;
  width: 100%;
  z-index: 10;
}

.custom-select-wrapper .form-control {
  display: none;
}

.cs-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.925rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.cs-display.has-value { color: var(--text-primary); }
.cs-display:hover, .cs-display.open {
  border-color: var(--gold-dark);
  background: rgba(100,160,210,0.03);
}
.cs-display.open { box-shadow: 0 0 0 3px var(--gold-glow); border-radius: var(--radius) var(--radius) 0 0; }

.cs-arrow {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
  color: var(--gold);
  font-size: 0.7rem;
  flex-shrink: 0;
}
.cs-display.open .cs-arrow { transform: rotate(180deg); }

.cs-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: rgba(17,24,39,var(--op-dropdown));
  border: 1px solid var(--gold-dark);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 9999;
  max-height: 260px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
}

.cs-dropdown.open { display: block; }

.cs-dropdown::-webkit-scrollbar { width: 4px; }
.cs-dropdown::-webkit-scrollbar-track { background: rgba(13,17,23,var(--op-cards)); }
.cs-dropdown::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 2px; }

.cs-option {
  padding: 11px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-option:last-child { border-bottom: none; }

.cs-option:hover {
  background: rgba(100,160,210,0.08);
  color: var(--gold);
  padding-left: 22px;
}

.cs-option.selected {
  background: rgba(100,160,210,0.12);
  color: var(--gold);
  font-weight: 600;
}

.cs-option.placeholder-opt {
  color: var(--text-muted);
  font-style: italic;
}

.cs-option-icon {
  width: 24px; height: 24px;
  background: rgba(100,160,210,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  color: var(--gold);
  flex-shrink: 0;
  font-weight: 700;
}

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.form-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.alert-success { background: rgba(39,174,96,0.1); border-color: rgba(39,174,96,0.3); color: #55d98d; }
.alert-danger   { background: rgba(192,57,43,0.1);  border-color: rgba(192,57,43,0.3);  color: #e74c3c; }
.alert-warning  { background: rgba(100,160,210,0.1);  border-color: rgba(100,160,210,0.3);  color: var(--gold); }
.alert-info     { background: rgba(41,128,185,0.1); border-color: rgba(41,128,185,0.3); color: #5dade2; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: rgba(17,24,39,var(--op-table)); position: relative; }

table { width: 100%; border-collapse: collapse; }

thead { background: rgba(100,160,210,0.08); }

th {
  padding: 12px 16px;
  text-align: left;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30,45,64,0.5);
  font-size: 0.9rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(100,160,210,0.03); color: var(--text-primary); }

.rank-num {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--gold);
}

.rank-1 { color: #FFD700; }
.rank-2 { color: #C0C0C0; }
.rank-3 { color: #CD7F32; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-gold    { background: rgba(100,160,210,0.2); color: var(--gold); border: 1px solid var(--gold-dark); }
.badge-success { background: rgba(39,174,96,0.2); color: #55d98d; }
.badge-danger  { background: rgba(192,57,43,0.2); color: #e74c3c; }
.badge-info    { background: rgba(41,128,185,0.2); color: #5dade2; }
.badge-vip     { background: linear-gradient(135deg, rgba(90,120,180,0.3), rgba(100,160,210,0.3)); color: var(--gold); border: 1px solid rgba(90,120,180,0.5); }

/* ── Sidebar Panel ───────────────────────────────────────────── */
.sidebar {
  background: rgba(17,24,39,var(--op-sidebar));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  position: sticky;
  top: calc(var(--nav-height) + 16px);
}

.sidebar-section { margin-bottom: 4px; }

.sidebar-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  margin-bottom: 3px;
  transition: all .15s;
}
.sidebar-pill:hover { filter: brightness(1.15); }
.sidebar-pill-ico {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
}
.sidebar-pill-label {
  font-size: 0.72rem;
  font-weight: 700;
  flex: 1;
}
.sidebar-pill-count {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
}
.sidebar-pill-chv {
  font-size: 0.5rem;
  color: var(--text-muted);
  transition: transform .2s;
}
.sidebar-pill-chv.collapsed { transform: rotate(-90deg); }

.sidebar-group-body {
  overflow: hidden;
  transition: max-height .25s ease;
}
.sidebar-group-body.collapsed {
  max-height: 0 !important;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 8px 12px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-link i { width: 16px; text-align: center; color: var(--text-muted); font-size: 0.72rem; }

.sidebar-link:hover {
  background: rgba(100,160,210,0.08);
  color: var(--text-primary);
}

.sidebar-link:hover i { color: var(--gold); }

.sidebar-link.active {
  background: rgba(100,160,210,0.12);
  color: var(--gold);
  border: 1px solid rgba(100,160,210,0.2);
}

.sidebar-link.active i { color: var(--gold); }

/* User info in sidebar */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-avatar {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}

.sidebar-username {
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--text-primary);
}

.sidebar-coins {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 500;
}

/* ── Hero Section ────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px 0;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(100,160,210,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 50%, rgba(100,0,200,0.06) 0%, transparent 40%);
  pointer-events: none;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* ── News Cards ──────────────────────────────────────────────── */
.news-card {
  background: rgba(17,24,39,var(--op-cards));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.news-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-dark);
  box-shadow: var(--shadow-gold);
}

.news-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(13,17,23,var(--op-cards)), rgba(17,24,39,var(--op-cards)));
}

.news-card-body { padding: 20px; }
.news-card-category { font-size: 0.72rem; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-bottom: 8px; }
.news-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.news-card-title a { color: var(--text-primary); text-decoration: none; }
.news-card-title a:hover { color: var(--gold); }
.news-card-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 12px; align-items: center; }
.news-card-excerpt { font-size: 0.875rem; color: var(--text-secondary); margin: 10px 0; line-height: 1.6; }

/* ── Progress Bar ────────────────────────────────────────────── */
.progress {
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 100px;
  transition: width 0.5s ease;
  position: relative;
}

.progress-bar.animated::after {
  content: '';
  position: absolute;
  top: 0; right: -20px;
  width: 20px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ── Character Card ──────────────────────────────────────────── */
.char-card {
  background: rgba(17,24,39,var(--op-cards));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.char-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 0 var(--radius-lg) 0 100%;
  background: rgba(100,160,210,0.07);
}

.char-card .char-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}

.char-card .char-class { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }

.char-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.char-stat-item { font-size: 0.82rem; color: var(--text-muted); }
.char-stat-item span { color: var(--text-primary); font-weight: 600; }

/* ── Roulette ────────────────────────────────────────────────── */
.roulette-wheel {
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  box-shadow: 0 0 40px var(--gold-glow), inset 0 0 40px rgba(0,0,0,0.5);
  position: relative;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  margin: 0 auto 32px;
  background: conic-gradient(
    #1a0a00 0deg, #2d1500 45deg,
    #1a0a00 45deg, #2d1500 90deg,
    #1a0a00 90deg, #2d1500 135deg,
    #1a0a00 135deg, #2d1500 180deg,
    #1a0a00 180deg, #2d1500 225deg,
    #1a0a00 225deg, #2d1500 270deg,
    #1a0a00 270deg, #2d1500 315deg,
    #1a0a00 315deg, #2d1500 360deg
  );
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: rgba(17,24,39,var(--op-cards));
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
  background: rgba(100,160,210,0.12);
  color: var(--gold);
  border-color: var(--gold-dark);
}

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }

.tab-btn {
  padding: 10px 20px;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  letter-spacing: 0.5px;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--gold); }
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  background: rgba(13,17,23,var(--op-footer));
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand { font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 900; color: var(--gold); margin-bottom: 12px; }
.footer-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }

.footer-heading { font-family: 'Cinzel', serif; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 16px; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 0.875rem; color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Lang Switcher ───────────────────────────────────────────── */
.lang-switcher { display: flex; gap: 2px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.lang-btn {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  transition: var(--transition);
  background: none;
  letter-spacing: 0.5px;
}
.lang-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.07);
}
.lang-btn.active {
  color: var(--gold);
  background: rgba(100,160,210,0.15);
}

/* ── Toast Notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  border-left: 4px solid;
  background: rgba(17,24,39,var(--op-cards));
  box-shadow: var(--shadow-card);
  font-size: 0.875rem;
  max-width: 320px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3s forwards;
}

.toast-success { border-color: var(--green); color: #55d98d; }
.toast-error   { border-color: var(--red); color: #e74c3c; }
.toast-warning { border-color: var(--gold); color: var(--gold); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 24px 0;
}

.divider-gold {
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
  opacity: 0.5;
}

/* ── Coin display ────────────────────────────────────────────── */
.coin-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(100,160,210,0.1);
  border: 1px solid rgba(100,160,210,0.2);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
}

.coin-icon { font-size: 0.9rem; }

/* ── Utility ─────────────────────────────────────────────────── */
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.mb-32  { margin-bottom: 32px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.p-24   { padding: 24px; }
.w-full { width: 100%; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 100%; }

  .navbar-nav, .status-bar .status-item:not(:first-child) { display: none; }
  .navbar-toggle { display: block; }
  .navbar-nav.open { display: flex; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: rgba(13,17,23,var(--op-cards)); padding: 12px; border-bottom: 1px solid var(--border); }
  .server-switcher { margin-left: 8px; }
  .server-btn { padding: 3px 8px; font-size: 0.65rem; }

  .panel-layout { flex-direction: column; padding: 16px; }
  .panel-sidebar { position: static; width: 100%; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  .hero { padding: 48px 0; }
  .tabs { overflow-x: auto; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .card-body { padding: 16px; }
}

/* ── Page-specific decorations ───────────────────────────────── */
.page-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--gold);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--gold);
}

.page-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }

/* ── Loading overlay ─────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(100,160,210,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Sticky footer ───────────────────────────────────────────── */
#site-main {
  min-height: calc(100vh - 363px);
}


/* ═══════════════════════════════════════════════════════════════════
   Navbar mercury highlight
   ───────────────────────────────────────────────────────────────────
   A liquid blob that flows between menu items. The .nav-mercury class is
   added by the script in templates/default/partials/navbar.php, so without
   JS, below 768px, or with reduced motion the menu keeps the original
   hover background above and none of these rules apply.
   ═══════════════════════════════════════════════════════════════════ */

.nav-goo-host { display: none; }

.navbar-nav.nav-mercury { position: relative; }

.navbar-nav.nav-mercury > li.nav-goo-host {
  display: block;
  position: absolute;
  inset: 0;
  list-style: none;
  pointer-events: none;
  z-index: 0;
}

/* Blur + alpha contrast is what makes the blob and the droplet melt into
   one body when they come close — the filter must wrap both. */
.nav-goo-layer {
  position: absolute;
  inset: 0;
  filter: url(#navGoo);
}

.nav-goo-blob {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 34px;
  border-radius: 17px;
  background: linear-gradient(135deg, #7fb3d8 0%, #6f8fd0 100%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.5, 1),
              width 0.5s cubic-bezier(0.34, 1.2, 0.5, 1),
              height 0.3s ease,
              opacity 0.28s ease;
}

.nav-goo-drop {
  position: absolute;
  left: 0; top: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7fb3d8 0%, #6f8fd0 100%);
  opacity: 0;
}

/* Top rim highlight. Lives outside .nav-goo-layer on purpose: the goo blur
   would smear a 1px line into nothing. It tracks the blob geometry from the
   same script, so it only ever covers the settled body, never the droplet. */
.nav-goo-shine {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 34px;
  border-radius: 17px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.5, 1),
              width 0.5s cubic-bezier(0.34, 1.2, 0.5, 1),
              height 0.3s ease,
              opacity 0.28s ease;
}

/* Items ride above the liquid layer */
.navbar-nav.nav-mercury > li { position: relative; z-index: 1; }

.navbar-nav.nav-mercury a { transition: color 0.26s ease; }

/* The blob replaces both the hover pill and the active underline */
.navbar-nav.nav-mercury a:hover,
.navbar-nav.nav-mercury a.active { background: transparent; }
.navbar-nav.nav-mercury a.active::after { opacity: 0; }

/* Label colour under the blob is also set inline by the script, so items
   with their own inline colour (the admin-only entry) darken too. */
.navbar-nav.nav-mercury a.goo-on,
.navbar-nav.nav-mercury a.goo-on i { color: #0a1017; }

@media (max-width: 768px) {
  .navbar-nav.nav-mercury > li.nav-goo-host { display: none; }
}
