/* ==========================================================================
   UNM Games — CITADEL THEMES & DESIGN SYSTEM
   Supports 2 Complete Themes: Light (Default) & Dark
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

/* --------------------------------------------------------------------------
   THEME 1: LIGHT THEME (Sunwell / High Elven Citadel / Alliance Dawn) — DEFAULT
   -------------------------------------------------------------------------- */
:root,
html[data-theme="light"],
body[data-theme="light"] {
  --bg-main: #f4f6fa;
  --bg-gradient: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(180, 130, 24, 0.12), transparent 70%),
                 radial-gradient(circle 700px at 100% 100%, rgba(2, 132, 199, 0.07), transparent 60%),
                 radial-gradient(circle 600px at 0% 80%, rgba(147, 51, 234, 0.05), transparent 60%),
                 #f4f6fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-glass: rgba(255, 255, 255, 0.88);
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-modal: #ffffff;
  --bg-modal-box: #ffffff;
  --bg-dropdown: #ffffff;
  --bg-input: #ffffff;
  --bg-th: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #b48218;
  --border-outer: rgba(180, 130, 24, 0.28);
  --text-main: #0f172a;
  --text-muted: #52637a;
  --text-subtle: #94a3b8;
  --gold: #b48218;
  --gold-bright: #d49a1d;
  --gold-glow: rgba(180, 130, 24, 0.22);
  --gold-border: rgba(180, 130, 24, 0.4);
  --blue: #0284c7;
  --green: #16a34a;
  --red: #dc2626;
  --purple: #9333ea;
  --radius: 12px;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 16px 36px -4px rgba(180, 130, 24, 0.18), 0 6px 14px -2px rgba(15, 23, 42, 0.06);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  --nav-active-bg: rgba(180, 130, 24, 0.1);
  --toolbar-btn-bg: #ffffff;
  --toolbar-btn-border: #cbd5e1;
  --code-bg: #e2e8f0;
  --code-color: #0f172a;
  --font-heading: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* --------------------------------------------------------------------------
   THEME 2: DARK THEME (Frozen Throne / Citadel Night / Shadow & Mithril)
   -------------------------------------------------------------------------- */
html[data-theme="dark"],
body[data-theme="dark"] {
  --bg-main: #090c12;
  --bg-gradient: radial-gradient(ellipse 90% 60% at 50% -15%, rgba(245, 158, 11, 0.14), transparent 70%),
                 radial-gradient(circle 800px at 100% 100%, rgba(56, 189, 248, 0.08), transparent 70%),
                 radial-gradient(circle 700px at 0% 80%, rgba(168, 85, 247, 0.06), transparent 70%),
                 #090c12;
  --bg-card: #131823;
  --bg-card-hover: #19202f;
  --bg-card-glass: rgba(19, 24, 35, 0.88);
  --bg-header: rgba(10, 13, 20, 0.94);
  --bg-modal: #131823;
  --bg-modal-box: #131823;
  --bg-dropdown: #111622;
  --bg-input: #0c1017;
  --bg-th: rgba(0, 0, 0, 0.4);
  --border: #222c3f;
  --border-subtle: #192131;
  --border-focus: #f59e0b;
  --border-outer: rgba(245, 158, 11, 0.3);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --gold: #f59e0b;
  --gold-bright: #fbbf24;
  --gold-glow: rgba(245, 158, 11, 0.3);
  --gold-border: rgba(245, 158, 11, 0.45);
  --blue: #38bdf8;
  --green: #22c55e;
  --red: #ef4444;
  --purple: #c084fc;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-hover: 0 16px 40px rgba(245, 158, 11, 0.22);
  --shadow-modal: 0 25px 60px rgba(0, 0, 0, 0.85);
  --nav-active-bg: rgba(245, 158, 11, 0.15);
  --toolbar-btn-bg: #161c28;
  --toolbar-btn-border: #273449;
  --code-bg: #182030;
  --code-color: #f1f5f9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, .brand-title, .hero h1, .section-header h2 {
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--gold-bright);
}

/* Header & Navigation */
header.portal-header, header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, transparent 0%, var(--gold) 20%, var(--gold-bright) 50%, var(--gold) 80%, transparent 100%) 1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav-container {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--gold);
  letter-spacing: 1.2px;
  text-decoration: none;
}

.brand-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 6px var(--gold-glow));
}

.brand-title {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 2px var(--gold-glow));
}

.brand-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(180, 130, 24, 0.12);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 0.4rem;
}

nav a {
  color: var(--text-muted);
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  border: 1px solid transparent;
}

nav a:hover, nav a.active {
  color: var(--gold);
  background: var(--nav-active-bg);
  border: 1px solid var(--gold-border);
  box-shadow: 0 2px 10px var(--gold-glow);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--toolbar-btn-bg, var(--bg-card));
  border: 1px solid var(--toolbar-btn-border, var(--border));
  color: var(--text-main);
  padding: 0.38rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.theme-toggle-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--gold-glow);
}

.theme-toggle-btn #theme-toggle-icon {
  font-size: 1rem;
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover #theme-toggle-icon {
  transform: rotate(25deg) scale(1.2);
}

/* Main Container */
main {
  flex: 1;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 1.25rem 2.2vw 3rem 2.2vw;
  box-sizing: border-box;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, rgba(180, 130, 24, 0.08) 0%, rgba(2, 132, 199, 0.05) 100%), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
}

.hero h1 {
  font-size: 2.4rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hero h1 span {
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 750px;
  margin: 0 auto 1.5rem auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #d4a737 0%, #b8861d 50%, #a47614 100%);
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px var(--gold-glow);
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e5b642 0%, #c99324 50%, #b38217 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--gold-glow);
  color: #ffffff !important;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.6rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  opacity: 0.5;
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-hover);
}

.stat-card:hover::before {
  left: 5%;
  right: 5%;
  opacity: 1;
}

.stat-card .title {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--gold);
}

.stat-card .desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 1.45rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  opacity: 0.5;
  transition: all 0.25s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-hover);
}

.game-card:hover::before {
  left: 5%;
  right: 5%;
  opacity: 1;
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.game-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
}

.badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-lobby {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--green);
  color: var(--green);
}

.badge-running {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--blue);
  color: var(--blue);
}

.badge-pvpgn {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid var(--purple);
  color: var(--purple);
}

.badge-unm {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
}

.game-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.game-meta div {
  margin-bottom: 0.25rem;
}

.game-meta strong {
  color: var(--text-main);
}

.slots-bar-container {
  margin-bottom: 1rem;
}

.slots-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.slots-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.slots-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
}

.btn-join {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* Chat Container */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.chat-msg-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-msg-source {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.src-web { background: rgba(56, 189, 248, 0.2); color: var(--blue); }
.src-tg { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.src-dc { background: rgba(168, 85, 247, 0.2); color: var(--purple); }
.src-server { background: rgba(212, 175, 55, 0.2); color: var(--gold); }

.chat-msg-author {
  font-weight: 600;
  color: var(--gold);
}

.chat-msg-text {
  color: var(--text-main);
  word-break: break-word;
}

.chat-input-bar {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(12, 15, 20, 0.6);
  border-top: 1px solid var(--border);
}

.chat-input-bar input {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
}

.chat-input-bar input:focus {
  border-color: var(--gold);
}

.chat-input-author {
  width: 160px;
}

.chat-input-text {
  flex: 1;
}

/* Tables (Bots / Forum) */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover td {
  background: var(--bg-card-hover);
}

/* Wiki & Knowledge Base */
.wiki-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.wiki-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  height: fit-content;
}

.wiki-sidebar h3 {
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.wiki-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wiki-nav-list a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.wiki-nav-list a:hover, .wiki-nav-list a.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.wiki-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.wiki-content-card h2 {
  color: var(--gold);
  margin-bottom: 1rem;
}

.wiki-body {
  color: var(--text-main);
  line-height: 1.7;
}

.wiki-body p {
  margin-bottom: 1rem;
}

.wiki-body pre {
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-family: monospace;
  margin-bottom: 1rem;
  color: var(--blue);
}

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

footer a {
  color: var(--gold);
}

/* Forum & Wiki Interactive UI */
.forum-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.forum-breadcrumbs a {
  color: var(--gold);
  text-decoration: none;
}

.forum-breadcrumbs a:hover {
  text-decoration: underline;
}

.forum-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.topic-row {
  cursor: pointer;
  transition: background 0.2s;
}

.topic-row:hover {
  background: var(--bg-card-hover);
}

.topic-title-link {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
}

.topic-title-link:hover {
  text-decoration: underline;
}

.topic-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.post-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.post-card-header {
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-author {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95rem;
}

.post-date {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.post-body {
  padding: 1.25rem;
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-wrap;
}

.reply-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.reply-box h3 {
  color: var(--gold);
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.form-input, .form-textarea {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--gold);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 8px;
  max-width: 650px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: var(--gold);
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--red);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Wiki Search */
.wiki-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.wiki-search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-size: 0.95rem;
  min-width: 280px;
}

.wiki-search-input:focus {
  border-color: var(--gold);
  outline: none;
}

/* Responsive */
@media (max-width: 860px) {
  .wiki-layout {
    grid-template-columns: 1fr;
  }
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Category Pills Toolbar */
.category-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.pill.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* Modal Card and Close Button */
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: 10px;
  max-width: 650px;
  width: 95%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
  padding: 1.5rem;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--red);
}

/* Badge variants */
.badge-info {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--blue);
  color: var(--blue);
}

.badge-dota {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--red);
  color: #fca5a5;
}

.badge-td {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--green);
  color: #86efac;
}

.badge-custom {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid var(--purple);
  color: #d8b4fe;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: rgba(0, 0, 0, 0.3);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Player tags */
.player-tag-list {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.player-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-main);
}

/* Replay Match Details Modal Styles */
.replay-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-item .meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-item .meta-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 0.15rem;
}

/* Teams Layout */
.teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .teams-grid {
    grid-template-columns: 1fr;
  }
}

.team-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.team-sentinel {
  border-color: rgba(34, 197, 94, 0.4);
}

.team-scourge {
  border-color: rgba(239, 68, 68, 0.4);
}

.team-header {
  padding: 0.6rem 0.9rem;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-sentinel .team-header {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-bottom: 1px solid rgba(34, 197, 94, 0.3);
}

.team-scourge .team-header {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

.team-players-list {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.player-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
}

.player-slot-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.player-info-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.slot-sub-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Leaderboard & MMR Tier Badges */
.tier-immortal {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.3) 0%, rgba(249, 115, 22, 0.3) 100%);
  border: 1px solid #eab308;
  color: #fde047;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.tier-divine {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid #c084fc;
  color: #e9d5ff;
  font-weight: 600;
}

.tier-ancient {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #60a5fa;
  color: #bfdbfe;
  font-weight: 600;
}

.tier-legend {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #4ade80;
  color: #bbf7d0;
  font-weight: 600;
}

.tier-archon {
  background: rgba(202, 138, 4, 0.2);
  border: 1px solid #eab308;
  color: #fef08a;
}

.tier-crusader {
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid #cbd5e1;
  color: #f1f5f9;
}

.tier-guardian {
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid #64748b;
  color: #94a3b8;
}

/* ==========================================================================
   Live Game Spectator UI (Stage 57)
   ========================================================================== */

.spectator-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.spectator-title-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.live-indicator-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-dot 1.4s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.spectator-meta h2 {
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.spectator-submeta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.timer-badge {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: var(--gold);
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
}

.sse-status-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
}
.sse-status-badge.online { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid #22c55e; }
.sse-status-badge.connecting { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid #3b82f6; }
.sse-status-badge.fallback { background: rgba(234, 179, 8, 0.15); color: #fde047; border: 1px solid #eab308; }

.spectator-controls-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.spectator-select {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
}
.spectator-select:focus { border-color: var(--blue); }

/* Live Scoreboard Banner */
.live-score-banner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.team-score-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.team-score-block.sentinel-side {
  justify-content: flex-start;
}
.team-score-block.scourge-side {
  justify-content: flex-end;
}

.team-flag-tag {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}
.sentinel-side .team-flag-tag { color: #4ade80; }
.scourge-side .team-flag-tag { color: #f87171; }

.team-score-num {
  font-size: 2.75rem;
  font-weight: 900;
  font-family: monospace;
  line-height: 1;
}
.sentinel-side .team-score-num { color: #4ade80; text-shadow: 0 0 15px rgba(34, 197, 94, 0.4); }
.scourge-side .team-score-num { color: #f87171; text-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }

.score-vs-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.vs-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-muted);
}

.networth-lead-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.networth-lead-badge.sent-lead {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #86efac;
}
.networth-lead-badge.scou-lead {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fca5a5;
}

/* Spectator Layout Grid */
.spectator-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .spectator-grid { grid-template-columns: 1fr; }
}

.spectator-main-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.spectator-side-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.spectator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* Minimap Card & SVG */
.minimap-wrapper-card {
  padding: 1.25rem;
}

.minimap-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 0.4rem; }
.legend-dot.sent { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; display: inline-block; }
.legend-dot.scou { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; display: inline-block; }
.legend-tower { width: 8px; height: 8px; background: #22c55e; display: inline-block; border-radius: 2px; }
.legend-rosh { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; display: inline-block; }

.minimap-container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  background: #090e0c;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8), 0 6px 20px rgba(0, 0, 0, 0.5);
  position: relative;
}

.minimap-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

.minimap-tower { cursor: pointer; transition: transform 0.2s; }
.minimap-tower:hover { transform: scale(1.3); }

.minimap-hero-node {
  cursor: pointer;
  will-change: transform;
}
.minimap-hero-node:hover circle:first-child {
  stroke-width: 4;
  opacity: 0.9;
}

/* Team Tables */
.team-table-card.sentinel-card {
  border-top: 3px solid #22c55e;
}
.team-table-card.scourge-card {
  border-top: 3px solid #ef4444;
}

.scoreboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.scoreboard-table th {
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-muted);
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.scoreboard-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  vertical-align: middle;
}
.player-row-dead {
  opacity: 0.5;
  background: rgba(239, 68, 68, 0.05);
}

.items-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 220px;
}
.item-tag {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

.hp-mp-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100px;
}
.hp-bar-bg {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}
.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.4s ease;
}
.mp-bar-bg {
  width: 100%;
  height: 4px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
}
.mp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  transition: width 0.4s ease;
}

/* Towers Status Block */
.towers-status-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.side-tower-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.tower-icons-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tower-icons-row strong { color: var(--text-main); }

/* Roshan Card */
.roshan-status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.4);
}
.roshan-status-card.alive {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}
.roshan-status-card.dead {
  border-color: #64748b;
  background: rgba(51, 65, 85, 0.2);
  opacity: 0.8;
}
.roshan-icon { font-size: 1.8rem; line-height: 1; }
.roshan-state { font-weight: 700; font-size: 0.95rem; color: #fbbf24; }
.roshan-status-card.dead .roshan-state { color: #94a3b8; }
.roshan-sub { font-size: 0.75rem; color: var(--text-muted); }

/* Combat Feed */
.combat-log-card {
  display: flex;
  flex-direction: column;
  max-height: 380px;
}
.combat-log-feed {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  max-height: 320px;
  padding-right: 0.25rem;
}
.combat-log-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
  border-left: 3px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.4;
}
.combat-log-item.sentinel { border-left-color: #22c55e; }
.combat-log-item.scourge { border-left-color: #ef4444; }
.combat-log-item.firstblood { background: rgba(239, 68, 68, 0.15); border-left-color: #ef4444; font-weight: 600; }
.combat-log-item.roshan { background: rgba(245, 158, 11, 0.12); border-left-color: #f59e0b; }
.combat-log-item.tower { background: rgba(59, 130, 246, 0.1); border-left-color: #3b82f6; }
.combat-log-icon { font-size: 1rem; flex-shrink: 0; }
.combat-log-time { color: var(--text-muted); font-size: 0.75rem; font-family: monospace; flex-shrink: 0; }
.combat-log-text { color: var(--text-main); flex: 1; }





/* ==========================================================================
   ENHANCED MULTI-MAP WIKI & KNOWLEDGE BASE (STAGE 71: TKOK & MULTI-MAP)
   ========================================================================== */

/* Wiki Map Selector Bar */
.wiki-map-selector {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.wiki-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.wiki-map-btn:hover {
  border-color: var(--gold);
  color: var(--text-main);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.wiki-map-btn.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

.wiki-map-btn .badge {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wiki-map-btn.active .badge {
  background: var(--gold);
  color: #12141a;
  font-weight: 700;
}

/* Wiki Sidebar Map Info Card */
.wiki-sidebar-map-info {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.wiki-sidebar-map-info h4 {
  color: var(--gold);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.wiki-sidebar-map-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Wiki Category Accordion */
.wiki-category-group {
  margin-bottom: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.01);
}

.wiki-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s;
}

.wiki-category-header:hover {
  background: rgba(212, 175, 55, 0.1);
}

.wiki-category-count {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.wiki-category-header.active .wiki-category-count {
  background: var(--gold);
  color: #12141a;
}

.wiki-category-body {
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wiki-subcategory-label {
  font-size: 0.72rem;
  color: var(--gold-light, #f1c40f);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.45rem 0.65rem 0.15rem;
  font-weight: 700;
}

.wiki-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.15s;
}

.wiki-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding-left: 0.85rem;
}

.wiki-nav-item.active {
  background: rgba(212, 175, 55, 0.15);
  border-left: 3px solid var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* Wiki Article Content Layout */
.wiki-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.wiki-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.wiki-breadcrumbs a:hover {
  color: var(--gold);
}

.wiki-breadcrumbs .sep {
  color: rgba(255, 255, 255, 0.2);
}

.wiki-breadcrumbs .current {
  color: var(--gold);
  font-weight: 600;
}

/* Quick Table of Contents pills */
.wiki-toc {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
}

.wiki-toc-title {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.wiki-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.wiki-toc-item a {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.wiki-toc-item a:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* Visual Composer & Clean HTML Grid */
.wiki-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5rem 1rem -0.5rem;
}

.wiki-row-inner {
  margin: 0.5rem -0.25rem;
}

.wiki-col {
  flex: 1 0 0%;
  padding: 0 0.5rem;
  min-width: 250px;
}

.wiki-col-3 { flex: 0 0 25%; max-width: 25%; }
.wiki-col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.wiki-col-6 { flex: 0 0 50%; max-width: 50%; }
.wiki-col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.wiki-col-9 { flex: 0 0 75%; max-width: 75%; }

@media (max-width: 860px) {
  .wiki-col-3, .wiki-col-4, .wiki-col-6, .wiki-col-8, .wiki-col-9 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.wiki-section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 2rem 0 1.5rem;
}

.wiki-section-divider::before, .wiki-section-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.wiki-section-divider span {
  padding: 0 1.25rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.95rem;
}

.wiki-divider {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 1.75rem 0;
}

.wiki-heading {
  color: var(--gold);
  margin: 1.75rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.wiki-callout {
  background: rgba(20, 24, 34, 0.85);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.wiki-callout-title h4 {
  color: var(--gold);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.wiki-callout-body {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.6;
}

.wiki-cta-btn {
  margin-top: 1rem;
}

.wiki-alert {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  border-left: 4px solid;
}

.wiki-alert-info {
  background: rgba(52, 152, 219, 0.12);
  border-color: #3498db;
  color: var(--text-main);
}

.wiki-accordion {
  margin: 1.5rem 0;
}

.wiki-accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.wiki-accordion-header {
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
  color: var(--gold);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wiki-accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.wiki-accordion-header::-webkit-details-marker {
  display: none;
}

.wiki-accordion-header::after {
  content: '▼';
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.wiki-accordion-item[open] .wiki-accordion-header::after {
  transform: rotate(180deg);
}

.wiki-accordion-body {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

/* Wiki Content Media & Tables */
.wiki-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  margin: 0.85rem 0;
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
}

.wiki-body img:hover {
  transform: scale(1.015);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25);
  border-color: rgba(212, 175, 55, 0.5);
}

.wiki-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: 6px;
  overflow: hidden;
}

.wiki-body table th, .wiki-body table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.wiki-body table th {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.wiki-body table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.wiki-body table tr:hover {
  background: rgba(212, 175, 55, 0.04);
}

.wiki-body h1, .wiki-body h2, .wiki-body h3, .wiki-body h4 {
  color: var(--gold);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.wiki-body ul, .wiki-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.wiki-body li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

/* Lightbox Modal */
.wiki-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: zoom-out;
  padding: 1.5rem;
  backdrop-filter: blur(6px);
}

.wiki-lightbox.active {
  display: flex;
}

.wiki-lightbox-img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.wiki-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.wiki-lightbox-close:hover {
  color: var(--gold);
}

/* ==========================================================================
   STAGE 72: PORTAL REDESIGN v2.0 (WIDESCREEN 16:9, 4:3, MOBILE, REALMS, AUTH)
   ========================================================================== */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Container overrides for pages that used .container */
.container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 1.5rem 2.2vw !important;
}

/* Compact Modern Header */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, transparent 0%, var(--gold) 20%, var(--gold-bright) 50%, var(--gold) 80%, transparent 100%) 1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.portal-header .nav-container {
  max-width: 100%;
  width: 100%;
  padding: 0.6rem 2.2vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--gold);
  text-decoration: none;
  white-space: nowrap;
}

.brand-icon {
  font-size: 1.3rem;
}

.brand-title {
  letter-spacing: 0.6px;
}

.mobile-menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1.2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
}

.main-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-list > li > a,
.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.85rem;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  font-family: inherit;
}

.nav-list > li > a:hover,
.nav-list > li > a.active,
.nav-dropdown-btn:hover,
.nav-dropdown.open .nav-dropdown-btn {
  color: var(--gold);
  background: var(--nav-active-bg);
  border-color: var(--gold-border);
  box-shadow: 0 2px 8px var(--gold-glow);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown .caret {
  font-size: 0.75rem;
  opacity: 0.75;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  background: var(--bg-dropdown, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: var(--shadow-modal);
  z-index: 1500;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-menu li {
  list-style: none;
  width: 100%;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.25);
}

/* Header Right Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.38rem 0.7rem;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}

.toolbar-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lang-switch {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.38rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--gold);
  color: #0c0f14;
}

.btn-account {
  padding: 0.42rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 7px;
  white-space: nowrap;
}

/* Hero Compact Portal Banner */
.hero-portal {
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
  text-align: left;
  background: radial-gradient(circle at 85% 20%, rgba(212, 175, 55, 0.14), transparent 55%),
              linear-gradient(135deg, rgba(21, 25, 33, 0.98) 0%, rgba(12, 15, 20, 0.98) 100%);
}

.hero-portal .hero-content {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hero-portal h1 {
  font-size: 2rem;
  margin-bottom: 0.1rem;
}

.hero-portal p {
  margin: 0;
  max-width: 900px;
  font-size: 1rem;
}

.hero-portal .hero-actions {
  justify-content: flex-start;
  margin-top: 0.5rem;
}

.stats-grid-compact {
  margin-bottom: 1.75rem;
}

/* Game Realms Showcase Grid (Boss Battle, TKoK RPG, DotA, Custom) */
.realms-showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
  margin-bottom: 2rem;
}

.realm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.realm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.realm-boss { border-top: 3px solid #f59e0b; }
.realm-boss:hover { border-color: #f59e0b; }

.realm-tkok { border-top: 3px solid #d4af37; }
.realm-tkok:hover { border-color: #d4af37; }

.realm-dota { border-top: 3px solid #ef4444; }
.realm-dota:hover { border-color: #ef4444; }

.realm-custom { border-top: 3px solid #38bdf8; }
.realm-custom:hover { border-color: #38bdf8; }

.realm-card-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.realm-card h3 {
  font-size: 1.2rem;
  color: var(--text-main);
  margin: 0;
}

.realm-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.realm-card-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

/* Unified Realm Filter Pills Bar */
.realm-filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.realm-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.realm-pill:hover {
  color: var(--text-main);
  border-color: var(--gold);
}

.realm-pill.active {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--gold);
  color: var(--gold);
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

/* Unified Account Modal */
.modal-box.account-modal-box {
  background: var(--bg-modal-box, var(--bg-card));
  border: 1px solid var(--gold);
  border-radius: 12px;
  max-width: 480px;
  width: 95%;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--red);
}

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.08);
  padding: 0.35rem;
  border-radius: 8px;
}

.account-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.55rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.account-tab.active {
  background: var(--gold);
  color: #ffffff;
}

.account-hint {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.45;
  background: rgba(212, 175, 55, 0.06);
  border-left: 3px solid var(--gold);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
}

.account-contacts-box {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.contacts-box-title {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.account-modal-box input {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
}

.account-modal-box input:focus {
  border-color: var(--gold);
  outline: none;
}

.form-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--red);
  color: #fca5a5;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.84rem;
  margin-bottom: 0.85rem;
}

.form-msg {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--green);
  color: #86efac;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.84rem;
  margin-bottom: 0.85rem;
}

.profile-summary-banner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.profile-avatar {
  font-size: 2rem;
}

.profile-username {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
}

.profile-role-badge {
  font-size: 0.78rem;
  color: #4ade80;
}

/* ==========================================================================
   3 VIEWPORT MODES: 16:9 WIDESCREEN, 4:3 SQUARE, MOBILE
   ========================================================================== */

/* 1. Widescreen 16:9 Mode (Full width, no black side bars) */
body.view-widescreen main,
body.view-widescreen .container,
body:not(.view-classic):not(.view-square):not(.view-mobile) main,
body:not(.view-classic):not(.view-square):not(.view-mobile) .container {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding-left: 2.2vw !important;
  padding-right: 2.2vw !important;
}

body.view-widescreen .wiki-layout,
body:not(.view-classic):not(.view-square):not(.view-mobile) .wiki-layout {
  grid-template-columns: 310px 1fr;
}

/* 2. Square 4:3 / 5:4 Monitor Mode */
body.view-square main,
body.view-square .container,
body.view-classic main,
body.view-classic .container {
  max-width: 1280px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding-left: 1.2rem !important;
  padding-right: 1.2rem !important;
}

body.view-square .portal-header .nav-container {
  flex-wrap: wrap;
  padding: 0.5rem 1.2rem;
}

body.view-square .portal-header .brand-group {
  order: 1;
}

body.view-square .portal-header .header-controls {
  order: 2;
  margin-left: auto;
}

body.view-square .portal-header .main-nav {
  order: 3;
  width: 100%;
  justify-content: flex-start;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.view-square .realms-showcase-grid {
  grid-template-columns: repeat(2, 1fr);
}

body.view-square .wiki-layout {
  grid-template-columns: 240px 1fr;
  gap: 1rem;
}

body.view-square .spectator-grid {
  grid-template-columns: 1fr;
}

/* 3. Mobile Mode (Manual or Auto on Smartphones) */
body.view-mobile main,
body.view-mobile .container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0.85rem 0.75rem !important;
}

body.view-mobile .mobile-menu-toggle {
  display: inline-flex;
}

body.view-mobile .portal-header .nav-container {
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
}

body.view-mobile .portal-header .brand-group {
  order: 1;
}

body.view-mobile .portal-header .header-controls {
  order: 2;
  margin-left: auto;
}

body.view-mobile .main-nav {
  display: none;
  width: 100%;
  order: 3;
  margin-top: 0.5rem;
  background: var(--bg-dropdown, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: var(--shadow-modal);
}

body.view-mobile .main-nav.mobile-open {
  display: block;
}

body.view-mobile .nav-list {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

body.view-mobile .nav-dropdown-menu {
  position: static;
  box-shadow: none;
  border: none;
  border-left: 2px solid var(--gold);
  margin-left: 0.75rem;
  background: transparent;
}

body.view-mobile .realms-showcase-grid,
body.view-mobile .games-grid,
body.view-mobile .news-grid,
body.view-mobile .wiki-layout,
body.view-mobile .spectator-grid,
body.view-mobile .teams-grid {
  grid-template-columns: 1fr !important;
}

body.view-mobile .header-status {
  display: none;
}

/* Automatic Media Queries — Keep Header Controls on Top-Right Row with Brand */
@media (max-width: 1320px) {
  .realms-showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portal-header .nav-container {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }
  .portal-header .brand-group {
    order: 1;
  }
  .portal-header .header-controls {
    order: 2;
    margin-left: auto;
  }
  .portal-header .main-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .hero-command-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .portal-header .main-nav {
    display: none;
    width: 100%;
    order: 3;
    margin-top: 0.35rem;
    background: var(--bg-dropdown, var(--bg-card));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: var(--shadow-modal);
  }
  .portal-header .main-nav.mobile-open {
    display: block;
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--gold);
    margin-left: 0.75rem;
    background: transparent;
  }
  .realms-showcase-grid,
  .games-grid,
  .news-grid,
  .wiki-layout,
  .spectator-grid {
    grid-template-columns: 1fr !important;
  }
  .header-status {
    display: none;
  }
  main, .container {
    padding: 1rem 0.85rem !important;
  }
  .hero-portal {
    padding: 1.25rem;
  }
  .hero-portal h1 {
    font-size: 1.45rem;
  }
}

/* ==========================================================================
   EPIC CITADEL COMMAND CENTER HERO (STAGE 73 HOMEPAGE REDESIGN)
   ========================================================================== */
.hero-citadel {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background:
    radial-gradient(ellipse at 15% 15%, rgba(212, 175, 55, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(56, 189, 248, 0.14) 0%, transparent 55%),
    linear-gradient(135deg, #121723 0%, #0b0e16 55%, #131824 100%);
  padding: 2.2rem 2.4rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hero-citadel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37, #38bdf8, #d4af37, transparent);
}

.hero-command-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.9rem;
}

.hero-eyebrow-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.hero-citadel-title {
  font-size: 2.45rem;
  font-weight: 900;
  line-height: 1.15;
  color: #f8fafc;
  margin: 0 0 0.85rem 0;
  letter-spacing: -0.4px;
}

.hero-citadel-title .gold-gradient {
  background: linear-gradient(90deg, #fde047 0%, #d4af37 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
}

.hero-citadel-subtitle {
  font-size: 1.02rem;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0 0 1.35rem 0;
  max-width: 720px;
}

.hero-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.hero-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-citadel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-glow-gold {
  background: linear-gradient(180deg, #facc15 0%, #d4af37 55%, #b48a1e 100%);
  color: #090d16;
  font-weight: 800;
  padding: 0.8rem 1.45rem;
  border-radius: 9px;
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-glow-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.55);
  color: #090d16;
}

.hero-telemetry-panel {
  background: rgba(11, 15, 23, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 14px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
}

.telemetry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.7rem;
}

.telemetry-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.telemetry-badge {
  font-size: 0.72rem;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-weight: 700;
}

.telemetry-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.telemetry-kpi-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.2s;
}

.telemetry-kpi-box:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.telemetry-kpi-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.2rem;
}

.telemetry-kpi-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.15;
}

.telemetry-kpi-sub {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.telemetry-quick-connect {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: rgba(212, 175, 55, 0.07);
  border: 1px dashed rgba(212, 175, 55, 0.35);
  border-radius: 9px;
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
}

/* Clickable News Cards & News Comments Modal */
.news-card-clickable {
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-card-clickable:hover {
  transform: translateY(-3px);
  border-color: var(--gold) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
}

.news-modal-box {
  background: var(--bg-modal-box, var(--bg-card));
  border: 1px solid var(--gold);
  border-radius: 14px;
  max-width: 780px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.news-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.news-article-content {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.news-article-content ul {
  padding-left: 1.35rem;
  margin: 0.75rem 0;
}

.news-article-content li {
  margin-bottom: 0.45rem;
}

.news-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.news-comment-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.news-comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.news-comment-author {
  color: var(--gold);
  font-weight: 700;
}

/* ==========================================================================
   PROMO START PLAYING SECTION (index.html)
   ========================================================================== */
.promo-start-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.promo-start-card {
  background: linear-gradient(135deg, rgba(19, 24, 34, 0.95) 0%, rgba(15, 23, 42, 0.92) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2rem;
  align-items: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.promo-start-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.promo-start-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.promo-start-content h2 {
  font-size: 1.5rem;
  color: #f8fafc;
  margin: 0;
  line-height: 1.25;
}

.promo-start-content p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.promo-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.5rem;
}

.promo-steps-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.promo-step-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.promo-step-item:hover {
  transform: translateX(4px);
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.05);
}

.promo-step-item .step-num {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #b48a1e);
  color: #0b0f19;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.promo-step-item .step-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.promo-step-item .step-info strong {
  font-size: 0.88rem;
  color: #f1f5f9;
}

.promo-step-item .step-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   DEDICATED CLIENT DOWNLOAD PAGE (download.html)
   ========================================================================== */
.download-hero {
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.download-hero-card {
  background: radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
              linear-gradient(145deg, #10141f 0%, #0a0d16 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.download-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #facc15, #d4af37, transparent);
}

.download-hero-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 6px 16px rgba(212, 175, 55, 0.45));
}

.download-hero-card h1 {
  font-size: 2.35rem;
  margin: 0.25rem 0 0.5rem;
  color: #f8fafc;
  letter-spacing: -0.5px;
}

.download-hero-card .download-hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 720px;
  line-height: 1.6;
  margin: 0 auto 1.75rem;
}

.btn-download-hero {
  background: linear-gradient(180deg, #fde047 0%, #d4af37 60%, #a17c16 100%);
  color: #080c14;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 1.1rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(212, 175, 55, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-download-hero:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 42px rgba(212, 175, 55, 0.65);
  color: #080c14;
}

.download-meta-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.download-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.download-meta-pill strong {
  color: var(--gold);
}

.download-secondary-actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hash-verification-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 760px;
  width: 100%;
  box-sizing: border-box;
}

.hash-verification-box .hash-label {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.hash-verification-box code {
  font-family: monospace;
  font-size: 0.78rem;
  color: #cbd5e1;
  word-break: break-all;
  flex: 1;
  text-align: left;
}

.btn-copy-hash {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn-copy-hash:hover {
  background: var(--gold);
  color: #0b0f19;
}

/* Steps section */
.how-to-start-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.how-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.how-step-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.45);
}

.how-step-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.how-step-card h3 {
  font-size: 1.15rem;
  margin: 0;
  color: #f1f5f9;
}

.how-step-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Features Grid */
.client-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.client-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.client-feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.client-feature-icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.client-feature-card h3 {
  font-size: 1.1rem;
  color: #f8fafc;
  margin: 0;
}

.client-feature-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Specs Table */
.specs-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.specs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.specs-card h3 {
  font-size: 1.1rem;
  color: var(--gold);
  margin-top: 0;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.specs-table td:first-child {
  color: var(--text-muted);
  width: 40%;
}

.specs-table td:last-child {
  color: #f1f5f9;
  font-weight: 600;
}

/* FAQ Accordion / Cards */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.faq-card h4 {
  margin: 0;
  font-size: 1rem;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Media Queries for Download & Promo */
@media (max-width: 980px) {
  .promo-start-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .how-to-start-grid,
  .client-features-grid {
    grid-template-columns: 1fr 1fr;
  }
  .specs-container,
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .how-to-start-grid,
  .client-features-grid {
    grid-template-columns: 1fr;
  }
  .download-hero-card {
    padding: 1.75rem 1.25rem;
  }
  .download-hero-card h1 {
    font-size: 1.8rem;
  }
  .btn-download-hero {
    font-size: 1rem;
    padding: 0.95rem 1.5rem;
    width: 100%;
    justify-content: center;
  }
  .hash-verification-box {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ====================================================
   STAGE 78: INTERACTIVE LIVE LOBBY CHAT MODAL & STYLES
   ==================================================== */
.lobby-chat-modal-box {
  background: var(--bg-modal-box, var(--bg-card));
  border: 1px solid var(--gold);
  border-radius: 14px;
  max-width: 680px;
  width: 95%;
  height: 80vh;
  max-height: 720px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.lobby-chat-header-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.lobby-chat-header-title .chat-icon {
  font-size: 1.6rem;
}

.lobby-chat-header-title h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-main);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #4ade80;
  margin-top: 0.15rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  display: inline-block;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.lobby-chat-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.65rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.lobby-chat-info-bar .info-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lobby-chat-info-bar .info-label {
  color: var(--text-muted);
}

.lobby-chat-info-bar strong {
  color: var(--gold);
}

.lobby-chat-messages {
  flex: 1;
  padding: 1rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--bg-main);
}

.chat-empty-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: auto 0;
  padding: 2rem 1rem;
  line-height: 1.5;
}

.lobby-chat-msg {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid transparent;
  transition: background 0.15s ease;
}

.lobby-chat-msg:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lobby-chat-msg .msg-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.badge-source {
  font-size: 0.72rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-game {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-web {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-tg {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.badge-dc {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-sys {
  background: rgba(156, 163, 175, 0.2);
  color: #d1d5db;
  border: 1px solid rgba(156, 163, 175, 0.4);
}

.lobby-chat-msg.source-game {
  border-left-color: #38bdf8;
}

.lobby-chat-msg.source-web {
  border-left-color: #fbbf24;
}

.lobby-chat-msg.source-telegram {
  border-left-color: #0284c7;
}

.lobby-chat-msg.source-discord {
  border-left-color: #7c3aed;
}

.lobby-chat-msg.source-system {
  border-left-color: #6b7280;
  background: rgba(255, 255, 255, 0.01);
  font-style: italic;
}

.lobby-chat-msg .msg-author {
  color: var(--text-main);
  font-weight: 600;
}

.lobby-chat-msg.source-web .msg-author {
  color: #fbbf24;
}

.lobby-chat-msg.source-game .msg-author {
  color: #38bdf8;
}

.lobby-chat-msg .msg-text {
  color: #e5e7eb;
  word-break: break-word;
}

.lobby-msg-cmd .msg-text {
  color: #93c5fd;
  font-family: monospace;
}

.lobby-chat-form {
  padding: 0.85rem 1.25rem;
  background: var(--bg-card, var(--bg-modal-box));
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.lobby-chat-author-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.lobby-chat-author-row .author-prefix {
  color: var(--text-muted);
}

.lobby-chat-author-row input {
  max-width: 160px;
  padding: 0.3rem 0.55rem;
  font-size: 0.82rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-main);
}

.lobby-chat-author-row .author-hint {
  color: var(--text-muted);
}

.lobby-chat-author-row .author-hint a {
  color: var(--gold);
  text-decoration: underline;
}

.lobby-chat-input-row {
  display: flex;
  gap: 0.65rem;
}

.lobby-chat-input-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0.65rem 0.95rem;
  font-size: 0.92rem;
  transition: border-color 0.15s ease;
}

.lobby-chat-input-row input:focus {
  border-color: var(--gold);
  outline: none;
}

.btn-lobby-send {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn-chat-trigger {
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  white-space: nowrap;
}


/* ====================================================
   STAGE 79: WEB RCON & LOBBY MANAGEMENT STYLES
   ==================================================== */
.lobby-modal-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-nav-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.lobby-nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.lobby-nav-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(245, 158, 11, 0.08);
}

.lobby-manage-panel {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.manage-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.manage-alert.alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
  color: #86efac;
}

.manage-alert.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.manage-alert.alert-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fde68a;
}

.manage-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.manage-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.manage-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.manage-latency-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.latency-pill {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.latency-pill:hover {
  border-color: var(--gold);
}

.latency-pill.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--gold);
  color: var(--gold);
}

.manage-slots-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.manage-slots-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.manage-slots-table th,
.manage-slots-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.manage-slots-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-weight: 600;
}

.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.btn-danger {
  background: #dc2626;
  border-color: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* ==========================================================================
   LIGHT THEME OVERRIDES (HIGH ELVEN CITADEL / SUNWELL DAWN)
   ========================================================================== */
html[data-theme="light"] .hero-citadel {
  border-color: rgba(180, 130, 24, 0.35);
  background:
    radial-gradient(ellipse at 15% 15%, rgba(180, 130, 24, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(2, 132, 199, 0.08) 0%, transparent 55%),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .hero-citadel-title {
  color: #0f172a;
}

html[data-theme="light"] .hero-citadel-subtitle {
  color: #475569;
}

html[data-theme="light"] .hero-feature-pill {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .hero-telemetry-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(180, 130, 24, 0.35);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 1);
}

html[data-theme="light"] .telemetry-header {
  border-bottom-color: #e2e8f0;
}

html[data-theme="light"] .telemetry-kpi-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .telemetry-kpi-val {
  color: #0f172a;
}

html[data-theme="light"] .telemetry-kpi-sub {
  color: #64748b;
}

html[data-theme="light"] .telemetry-connect-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .hero-portal {
  background: radial-gradient(circle at 85% 20%, rgba(180, 130, 24, 0.12), transparent 55%),
              linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .hero-portal h1 {
  color: #0f172a;
}

html[data-theme="light"] .download-hero-card {
  background: radial-gradient(circle at 80% 20%, rgba(180, 130, 24, 0.1) 0%, transparent 60%),
              linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(180, 130, 24, 0.35);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .download-hero-card h1 {
  color: #0f172a;
}

html[data-theme="light"] .promo-start-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-color: rgba(180, 130, 24, 0.35);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .promo-start-content h2 {
  color: #0f172a;
}

html[data-theme="light"] .promo-start-content p {
  color: #475569;
}

html[data-theme="light"] .scoreboard-table th {
  background: #f1f5f9;
  color: #475569;
}

html[data-theme="light"] .item-tag {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .clan-card {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .clan-tab-btn {
  background: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

html[data-theme="light"] .clan-tab-btn.active {
  background: linear-gradient(180deg, #fefce8 0%, #ffffff 100%);
  border-color: var(--gold);
  color: var(--gold);
}



/* ==========================================================================
   STAGE 105: PORTAL EPIC TOP BANNER & 2-COLUMN SIDEBAR LAYOUT
   ========================================================================== */

/* 1. Epic Hero Top Banner */
.portal-epic-banner {
  position: relative;
  width: 100%;
  min-height: 280px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
}

.portal-epic-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37, #38bdf8, #d4af37, transparent);
  z-index: 3;
}

.banner-image-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: 1;
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: brightness(0.62) contrast(1.12);
  transform: scale(1.02);
  transition: transform 0.6s ease;
}

.portal-epic-banner:hover .banner-image {
  transform: scale(1.05);
}

.banner-vignette-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(8, 11, 18, 0.95) 0%, rgba(8, 11, 18, 0.82) 48%, rgba(8, 11, 18, 0.45) 82%, rgba(8, 11, 18, 0.75) 100%),
              radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.16) 0%, transparent 65%);
  pointer-events: none;
}

.banner-content-overlay {
  position: relative;
  z-index: 2;
  padding: 2.4rem 2.8rem;
  max-width: 860px;
}

.banner-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #f59e0b;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.85rem;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.banner-brand-title {
  font-family: var(--font-heading);
  font-size: 2.9rem;
  font-weight: 900;
  line-height: 1.1;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
  letter-spacing: 0.5px;
}

.banner-brand-title .gold-gradient {
  background: linear-gradient(90deg, #fde047 0%, #d4af37 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 35px rgba(212, 175, 55, 0.35);
}

.banner-description {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0 0 1.4rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* 2. 2-Column Portal Layout Container */
.portal-layout-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 2rem;
  align-items: start;
}

.portal-main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.portal-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 80px;
}

/* 3. Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  position: relative;
}

.sidebar-widget:hover {
  border-color: var(--gold-border);
  box-shadow: var(--shadow-hover);
}

.sidebar-widget .widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.95rem;
  gap: 0.5rem;
}

.sidebar-widget .widget-title {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-widget .widget-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.sidebar-widget .widget-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

.sidebar-widget .widget-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.widget-client-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.65rem;
}

/* Telemetry Widget */
.sidebar-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.sidebar-kpi-box {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  text-align: center;
}

.sidebar-kpi-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-kpi-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

.sidebar-latency-info {
  display: flex;
  gap: 0.4rem;
  justify-content: space-between;
}

.lat-pill {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.2rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
}

/* Epic Battle Promo Widget */
.widget-promo-banner {
  padding: 0;
}

.promo-banner-media {
  position: relative;
  width: 100%;
  height: 135px;
  overflow: hidden;
}

.promo-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.widget-promo-banner:hover .promo-banner-img {
  transform: scale(1.08);
}

.promo-banner-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(10,14,22,0.92) 100%);
}

.promo-banner-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.65rem;
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.promo-banner-body {
  padding: 1.1rem 1.25rem;
}

.promo-banner-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.35rem 0;
}

.promo-banner-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0 0 0.85rem 0;
}

.promo-banner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Hall of Fame Widget */
.widget-header-link {
  font-size: 0.78rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.widget-header-link:hover {
  text-decoration: underline;
}

.sidebar-top-players {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-player-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.sidebar-player-row .rank {
  font-weight: 800;
  width: 22px;
  text-align: center;
}

.sidebar-player-row .p-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-player-row .p-hours {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 700;
}

/* Tools Widget */
.sidebar-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.sidebar-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
}

.sidebar-tool-card:hover {
  border-color: var(--gold-border);
  transform: translateY(-2px);
  background: var(--bg-card);
}

.sidebar-tool-card .tool-icon {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.sidebar-tool-card .tool-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Light Theme Overrides */
html[data-theme="light"] .banner-description {
  color: #f1f5f9;
}

html[data-theme="light"] .sidebar-widget {
  background: #ffffff;
  border-color: var(--border);
}

html[data-theme="light"] .sidebar-kpi-box,
html[data-theme="light"] .lat-pill,
html[data-theme="light"] .sidebar-player-row,
html[data-theme="light"] .sidebar-tool-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .sidebar-tool-card:hover {
  background: #ffffff;
}

/* Responsive queries */
@media (max-width: 1140px) {
  .portal-layout-container {
    grid-template-columns: 1fr;
  }
  .portal-sidebar-col {
    position: static;
  }
}

@media (max-width: 768px) {
  .portal-epic-banner {
    min-height: auto;
  }
  .banner-content-overlay {
    padding: 1.8rem 1.4rem;
  }
  .banner-brand-title {
    font-size: 2rem;
  }
  .banner-description {
    font-size: 0.95rem;
  }
}


/* ==========================================================================
   WIKI BOOK OF KNOWLEDGE DESIGN (STAGE 105)
   Interactive Multi-Tome Grimoire Architecture
   ========================================================================== */

.wiki-tome-selector {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.wiki-tome-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
}

.wiki-tome-tab:hover {
  border-color: var(--gold-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.wiki-tome-tab.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(18, 24, 35, 0.95) 100%);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
}

.wiki-tome-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.wiki-book-container {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.8rem;
  align-items: start;
}

/* Sidebar: Book Spine & Chapters */
.wiki-book-spine {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.wiki-tome-hero-card {
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  text-align: center;
}

.wiki-tome-hero-icon {
  font-size: 2.2rem;
  margin-bottom: 0.35rem;
}

.wiki-tome-hero-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.35rem 0;
}

.wiki-tome-hero-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Chapters Accordion */
.wiki-chapter-group {
  margin-bottom: 1rem;
}

.wiki-chapter-header {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gold);
  margin-bottom: 0.45rem;
  padding: 0.3rem 0.5rem;
  background: rgba(212, 175, 55, 0.08);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wiki-pages-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wiki-page-link {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.35;
  border-left: 2px solid transparent;
}

.wiki-page-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-left-color: var(--gold);
}

.wiki-page-link.active {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  font-weight: 700;
  border-left-color: var(--gold);
}

/* Reader Area */
.wiki-reader-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem 2.6rem;
  box-shadow: var(--shadow);
  min-height: 500px;
}

.wiki-reader-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.wiki-lang-switch-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.wiki-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wiki-lang-pill.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
}

/* Grand CTA Cards for UNM Games Tome */
.wiki-cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem 0;
}

.wiki-cta-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.wiki-cta-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.wiki-cta-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
}

.wiki-cta-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.45rem 0;
}

.wiki-cta-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

/* Navigation Pager at bottom */
.wiki-book-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.wiki-pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card-hover);
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.wiki-pager-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--bg-card);
}

@media (max-width: 992px) {
  .wiki-book-container {
    grid-template-columns: 1fr;
  }
  .wiki-book-spine {
    position: static;
    max-height: none;
  }
  .wiki-reader-card {
    padding: 1.5rem 1.25rem;
  }
}

/* DotA Allstars 7.03b2 Hero Pantheon & Drawer */
.hero-attr-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.hero-attr-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hero-attr-tab:hover, .hero-attr-tab.active {
  border-color: var(--gold);
  background: var(--bg-card-hover);
  color: var(--gold);
  box-shadow: 0 4px 14px var(--gold-glow);
}
.dota-heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.dota-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.dota-hero-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.dota-hero-icon {
  font-size: 2rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-subtle);
}
.dota-hero-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.dota-hero-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.hero-modal-drawer {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: none;
  animation: fadeIn 0.3s ease;
  box-shadow: var(--shadow-hover);
}

/* ============================================================= */
/* Two-Tier Unified Portal Header                                */
/* ============================================================= */
.portal-header .nav-container.header-two-tier {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 2.2vw 0.4rem 2.2vw;
  gap: 0.35rem;
  max-width: 100%;
  width: 100%;
  margin: 0;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.header-nav-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.35rem;
  overflow: visible;
  position: relative;
}

.header-nav-row .nav-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.header-nav-row .nav-dropdown {
  position: relative;
}

.header-nav-row .nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
  background: var(--bg-dropdown, #131823);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  z-index: 99999;
}

@media (max-width: 1024px) {
  .header-nav-row .nav-dropdown:last-child .nav-dropdown-menu {
    left: auto;
    right: 0;
  }
}

.header-nav-row .nav-dropdown:hover > .nav-dropdown-menu,
.header-nav-row .nav-dropdown.open > .nav-dropdown-menu {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (max-width: 1100px) {
  .header-nav-row .nav-list {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .header-nav-row {
    overflow-x: visible;
  }
}

/* ============================================================= */
/* Mini Web-Chat on Main Page                                    */
/* ============================================================= */
.widget-mini-chat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow);
}

.mini-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.mini-chat-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mini-chat-box {
  height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--bg-input);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.mini-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border-left: 2px solid var(--gold);
}

.mini-chat-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mini-chat-author {
  font-weight: 700;
  color: var(--gold-bright);
}

.mini-chat-text {
  color: var(--text-main);
  word-break: break-word;
}

.mini-chat-input-row {
  display: flex;
  gap: 0.5rem;
}

.mini-chat-input-row input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  color: var(--text-main);
  font-size: 0.85rem;
}

.mini-chat-input-row input:focus {
  border-color: var(--gold);
  outline: none;
}

/* ============================================================= */
/* Support & Tickets Styles                                      */
/* ============================================================= */
.support-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.support-tab-btn.active, .support-tab-btn:hover {
  color: var(--gold);
  border-color: var(--gold-border);
  background: var(--nav-active-bg);
  box-shadow: 0 2px 8px var(--gold-glow);
}

.active-pill {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
  background: var(--nav-active-bg) !important;
}

.ticket-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.ticket-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ticket-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ticket-badge.open {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid var(--green);
}

.ticket-badge.closed {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.ticket-badge.answered, .ticket-badge.in_progress {
  background: rgba(56, 189, 248, 0.15);
  color: var(--blue);
  border: 1px solid var(--blue);
}

.ticket-messages-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-input);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.ticket-message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  max-width: 85%;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ticket-message.user {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--gold-border);
  align-self: flex-start;
}

.ticket-message.staff {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  align-self: flex-end;
}

.ticket-msg-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.ticket-message.staff .ticket-msg-author {
  color: var(--blue);
}

.ticket-msg-time {
  font-size: 0.72rem;
  color: var(--text-subtle);
  align-self: flex-end;
}
