/* ==========================================================================
   KARYON2 — Classic Metin2 3-Column Portal | Obsidian-Jade & Imperial-Gold
   Zero inline styles required (Strict CSP style-src 'self')
   ========================================================================== */

:root {
  --bg-deep: #040908;
  --bg-stone: #081311;
  --bg-panel: #0a1714;
  --bg-panel-alt: #0d1f1b;
  --bg-input: #050d0b;
  --border-gold: rgba(214, 173, 86, 0.34);
  --border-gold-strong: rgba(236, 198, 108, 0.65);
  --border-jade: rgba(45, 212, 160, 0.34);
  --gold: #dfb65b;
  --gold-bright: #fbe3a1;
  --gold-deep: #8f6c25;
  --jade: #2dd4a0;
  --jade-deep: #0f7658;
  --jade-glow: rgba(45, 212, 160, 0.16);
  --text: #eaf2ee;
  --text-soft: #b8cdc5;
  --muted: #7f9c92;
  --red: #f87171;
  --red-bg: rgba(220, 38, 38, 0.16);
  --shadow-box: 0 12px 34px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(251, 227, 161, 0.10);
  --font-rpg: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
img { max-width: 100%; display: block; }
code {
  font-family: Consolas, 'Courier New', monospace;
  background: rgba(45, 212, 160, 0.10);
  border: 1px solid rgba(45, 212, 160, 0.24);
  color: var(--jade);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

.is-hidden { display: none !important; }
.font-rpg { font-family: var(--font-rpg); letter-spacing: 0.04em; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Ambient Floating Embers Canvas */
#emberCanvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0.42;
}

/* ---------- TOP CLASSIC RIBBON BAR ---------- */
.top-ribbon {
  position: relative; z-index: 30;
  background: linear-gradient(180deg, #071210 0%, #040a09 100%);
  border-bottom: 1px solid var(--border-gold);
  font-size: 12px; color: var(--text-soft);
}
.top-ribbon-inner {
  max-width: 1240px; margin: 0 auto; padding: 7px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.ribbon-left, .ribbon-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ribbon-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 4px;
  background: rgba(45, 212, 160, 0.08); border: 1px solid rgba(45, 212, 160, 0.24);
  color: #b7f5e1; font-weight: 600;
}
.ribbon-copy {
  background: rgba(223, 182, 91, 0.10); border: 1px solid var(--border-gold);
  color: var(--gold-bright); padding: 2px 10px; border-radius: 4px;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: background 0.18s;
}
.ribbon-copy:hover { background: rgba(223, 182, 91, 0.22); }
.orb {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.orb-on { background: var(--jade); box-shadow: 0 0 9px var(--jade); }
.orb-off { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ---------- CLASSIC METIN2 FULL-BLEED HEADER & LOGO STAGE ---------- */
.portal-header {
  position: relative; z-index: 10;
  background:
    radial-gradient(ellipse 68% 58% at 50% 34%, rgba(45, 212, 160, 0.15), transparent 70%),
    linear-gradient(180deg, rgba(4, 9, 8, 0.30) 0%, rgba(4, 9, 8, 0.42) 56%, rgba(4, 9, 8, 0.96) 96%, var(--bg-deep) 100%),
    url('/assets/classic_hero_bg.jpg') center top/cover no-repeat;
  padding: 36px 16px 26px;
  border-bottom: 2px solid var(--gold-deep);
}
.header-stage {
  max-width: 1240px; margin: 0 auto; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.header-crest-wrap {
  display: inline-flex; flex-direction: column; align-items: center;
  margin-bottom: 18px;
}
.header-logo {
  width: 390px; max-width: 86vw; height: auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.88)) drop-shadow(0 0 18px rgba(45, 212, 160, 0.22));
  transition: transform 0.25s ease;
}
.header-logo:hover { transform: scale(1.02); }
.header-tagline {
  margin-top: 4px;
  padding: 4px 18px;
  font-family: var(--font-rpg);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  text-transform: uppercase;
  background: linear-gradient(90deg, transparent, rgba(5, 16, 13, 0.88) 20%, rgba(5, 16, 13, 0.88) 80%, transparent);
  border-top: 1px solid rgba(223, 182, 91, 0.35);
  border-bottom: 1px solid rgba(223, 182, 91, 0.35);
}

/* Iconic Classic Metin2 Action Medallions */
.hero-medallions {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap; margin: 8px 0 24px;
}
.medallion-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 26px;
  border-radius: 6px;
  font-family: var(--font-rpg);
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.18s ease;
  text-align: left;
}
.medallion-btn::before {
  content: ''; position: absolute; inset: 3px; border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22); pointer-events: none;
}
.medallion-gold {
  background: linear-gradient(180deg, #f5d882 0%, #c89331 55%, #8a5f18 100%);
  color: #161003;
  border: 2px solid #fce7a8;
  box-shadow: 0 8px 28px rgba(214, 173, 86, 0.36), inset 0 2px 0 rgba(255, 255, 255, 0.45);
}
.medallion-gold:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 12px 34px rgba(223, 182, 91, 0.52); }
.medallion-jade {
  background: linear-gradient(180deg, #1d6f57 0%, #0d4435 55%, #07261e 100%);
  color: var(--gold-bright);
  border: 2px solid var(--jade);
  box-shadow: 0 8px 28px rgba(45, 212, 160, 0.25), inset 0 1px 0 rgba(167, 243, 208, 0.35);
}
.medallion-jade:hover { transform: translateY(-2px); filter: brightness(1.12); box-shadow: 0 12px 34px rgba(45, 212, 160, 0.40); }
.medallion-icon { font-size: 22px; line-height: 1; }
.medallion-main { display: block; font-size: 15px; letter-spacing: 0.06em; line-height: 1.15; }
.medallion-sub { display: block; font-family: var(--font-ui); font-size: 11px; font-weight: 700; opacity: 0.88; letter-spacing: 0.02em; text-transform: none; }

/* ---------- CLASSIC GILDED STONE NAVIGATION BAR ---------- */
.classic-nav-wrap {
  max-width: 1240px; width: 100%; margin: 0 auto;
}
.classic-nav {
  display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap;
  background: linear-gradient(180deg, #102420 0%, #091613 50%, #06100e 100%);
  border: 1px solid var(--border-gold-strong);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(251, 227, 161, 0.22);
  overflow: hidden;
}
.nav-link {
  position: relative;
  padding: 13px 20px;
  font-family: var(--font-rpg);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #d6e4de;
  border-right: 1px solid rgba(214, 173, 86, 0.16);
  transition: background 0.18s, color 0.18s;
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-link:last-child { border-right: none; }
.nav-link:hover {
  background: linear-gradient(180deg, rgba(223, 182, 91, 0.16), rgba(45, 212, 160, 0.08));
  color: var(--gold-bright);
}
.nav-link.active {
  background: linear-gradient(180deg, rgba(223, 182, 91, 0.28) 0%, rgba(16, 46, 38, 0.90) 100%);
  color: var(--gold-bright);
  box-shadow: inset 0 -3px 0 var(--gold), inset 0 1px 0 rgba(251, 227, 161, 0.35);
}

/* ---------- MAIN CLASSIC 3-COLUMN PORTAL SHELL ---------- */
.portal-shell {
  position: relative; z-index: 10;
  max-width: 1240px;
  margin: 22px auto 44px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 266px minmax(0, 1fr) 276px;
  gap: 18px;
  align-items: start;
}
.sidebar-col { display: flex; flex-direction: column; gap: 16px; }
.center-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- ORNATE CLASSIC METIN2 PANEL BOXES ---------- */
.m2-box {
  position: relative;
  background: linear-gradient(180deg, rgba(12, 27, 23, 0.96) 0%, rgba(7, 17, 15, 0.98) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  box-shadow: var(--shadow-box);
  overflow: hidden;
}
.m2-box::before, .m2-box::after {
  content: ''; position: absolute; width: 10px; height: 10px; pointer-events: none; z-index: 3;
}
.m2-box::before {
  top: 0; left: 0;
  border-top: 2px solid var(--gold); border-left: 2px solid var(--gold);
}
.m2-box::after {
  top: 0; right: 0;
  border-top: 2px solid var(--gold); border-right: 2px solid var(--gold);
}

.m2-box-head {
  padding: 10px 13px;
  background: linear-gradient(90deg, rgba(18, 44, 37, 0.95) 0%, rgba(11, 27, 23, 0.95) 65%, rgba(18, 44, 37, 0.95) 100%);
  border-bottom: 1px solid var(--border-gold);
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.m2-box-title {
  font-family: var(--font-rpg);
  font-size: 12.8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-bright);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.m2-box-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px;
  background: rgba(45, 212, 160, 0.14); border: 1px solid var(--border-jade);
  color: var(--jade);
  white-space: nowrap; flex-shrink: 0;
}
.m2-box-body { padding: 14px; }
.m2-box-body-lg { padding: 18px 20px; }

/* ---------- BUTTONS & INPUTS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 5px; font-weight: 700; font-size: 13px;
  cursor: pointer; border: 1px solid transparent; transition: all 0.18s ease;
  text-decoration: none; white-space: nowrap;
}
.btn-full { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-gold {
  background: linear-gradient(180deg, #f2d27a 0%, #c69232 100%);
  color: #161004; border-color: #fae3a2;
  box-shadow: 0 4px 14px rgba(214, 173, 86, 0.25);
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-jade {
  background: linear-gradient(180deg, #27b889 0%, #0f7053 100%);
  color: #f3fffb; border-color: #5eead4;
}
.btn-jade:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-stone {
  background: linear-gradient(180deg, #132823 0%, #0b1916 100%);
  color: var(--text); border-color: var(--border-gold);
}
.btn-stone:hover { border-color: var(--gold-bright); color: var(--gold-bright); background: #16302a; }
.btn-danger {
  background: rgba(220, 38, 38, 0.16); color: #fecaca; border-color: rgba(248, 113, 113, 0.45);
}
.btn-danger:hover { background: rgba(220, 38, 38, 0.30); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; }
.field label { font-size: 12px; font-weight: 700; color: var(--text-soft); }
.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 5px;
  background: var(--bg-input);
  border: 1px solid rgba(214, 173, 86, 0.28);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.field input:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(223, 182, 91, 0.18);
}
.field-hint { font-size: 11.5px; color: var(--muted); }

/* Honeypot Trap (hidden from humans) */
.hp-field {
  position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

/* Alerts */
.alert {
  padding: 10px 12px; border-radius: 5px; font-size: 12.8px; font-weight: 600;
  margin-bottom: 12px; display: none; line-height: 1.45;
}
.alert.show-ok {
  display: block; background: rgba(45, 212, 160, 0.13);
  border: 1px solid rgba(45, 212, 160, 0.48); color: #a7f3d0;
}
.alert.show-err {
  display: block; background: var(--red-bg);
  border: 1px solid rgba(248, 113, 113, 0.48); color: #fecaca;
}

/* ---------- LEFT SIDEBAR: ACCOUNT WIDGET ---------- */
.sidebar-acc-header {
  padding: 10px 12px; border-radius: 5px; margin-bottom: 11px;
  background: linear-gradient(135deg, rgba(45, 212, 160, 0.12), rgba(223, 182, 91, 0.10));
  border: 1px solid var(--border-jade);
}
.sidebar-acc-name { font-family: var(--font-rpg); font-size: 16px; font-weight: 800; color: var(--gold-bright); }
.sidebar-balances {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px;
}
.bal-pill {
  padding: 5px 8px; border-radius: 4px; background: rgba(4, 11, 9, 0.72);
  border: 1px solid rgba(214, 173, 86, 0.24); font-size: 11.5px; color: var(--text-soft);
}
.bal-pill strong { color: var(--gold-bright); font-size: 13px; display: block; }
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sidebar-menu-btn {
  width: 100%; text-align: left; padding: 8px 11px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(214, 173, 86, 0.16);
  color: var(--text); font-size: 12.8px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  transition: all 0.15s;
}
.sidebar-menu-btn:hover { background: rgba(223, 182, 91, 0.12); border-color: var(--gold); color: var(--gold-bright); }
.login-links {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 10px;
  font-size: 12px; color: var(--gold);
}
.login-links a:hover { text-decoration: underline; color: var(--gold-bright); }

/* ---------- SERVER STATUS & STATS WIDGET ---------- */
.ch-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.ch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 4px;
  background: rgba(4, 11, 9, 0.68); border: 1px solid rgba(214, 173, 86, 0.15);
  font-size: 12.8px;
}
.ch-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ch-state-on { color: var(--jade); font-weight: 800; font-size: 11.5px; }
.ch-state-off { color: var(--red); font-weight: 800; font-size: 11.5px; }

.stat-rows { display: flex; flex-direction: column; gap: 5px; border-top: 1px solid rgba(214, 173, 86, 0.18); padding-top: 10px; }
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--text-soft); padding: 2px 0;
}
.stat-row strong { color: var(--gold-bright); font-weight: 800; }

/* Quick Download Sidebar Widget */
.quick-dl-stack { display: flex; flex-direction: column; gap: 8px; }
.qr-mini-wrap {
  margin-top: 10px; display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 5px; background: rgba(4, 11, 9, 0.65);
  border: 1px solid rgba(45, 212, 160, 0.22);
}
.qr-mini-box {
  background: #fff; padding: 4px; border-radius: 5px; width: 66px; height: 66px; flex-shrink: 0;
}
.qr-mini-text { font-size: 11.5px; color: var(--text-soft); line-height: 1.4; }
.qr-mini-text strong { color: var(--jade); display: block; margin-bottom: 2px; }

/* ---------- CENTER STAGE: CLASSIC SLIDER ---------- */
.slider-box {
  position: relative; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border-gold-strong);
  box-shadow: var(--shadow-box);
  height: 280px; background: #040908;
}
.slide {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity 0.55s ease;
}
.slide.active { opacity: 1; pointer-events: auto; }
.slide-img { width: 100%; height: 100%; object-fit: cover; }
.slide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(4, 9, 8, 0.94) 0%, rgba(4, 9, 8, 0.42) 52%, rgba(4, 9, 8, 0.12) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px 22px 34px;
}
.slide-tag {
  width: fit-content; padding: 3px 9px; border-radius: 3px; margin-bottom: 7px;
  background: var(--gold); color: #161004; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.slide-title {
  font-family: var(--font-rpg); font-size: 20px; font-weight: 800; color: var(--gold-bright);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); margin-bottom: 4px;
}
.slide-desc { font-size: 13px; color: #d8e7e1; max-width: 560px; }
.slider-controls {
  position: absolute; bottom: 10px; right: 14px; z-index: 5;
  display: flex; align-items: center; gap: 6px;
}
.slider-dot {
  width: 24px; height: 6px; border-radius: 3px; border: 1px solid var(--border-gold);
  background: rgba(5, 13, 11, 0.72); cursor: pointer; transition: all 0.2s;
}
.slider-dot.active { background: var(--gold); border-color: var(--gold-bright); width: 34px; }
.slider-arrow {
  position: absolute; top: 12px; z-index: 5;
  width: 30px; height: 30px; border-radius: 5px;
  background: rgba(5, 13, 11, 0.80); border: 1px solid var(--border-gold);
  color: var(--gold-bright); font-size: 16px; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.18s;
}
.slider-arrow:hover { background: rgba(223, 182, 91, 0.28); }
.slider-prev { right: 48px; }
.slider-next { right: 12px; }

/* Live Events Ticker */
.events-strip {
  padding: 10px 14px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(223, 182, 91, 0.16), rgba(45, 212, 160, 0.12));
  border: 1px solid var(--border-gold-strong);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px;
}
.events-pill {
  background: var(--gold); color: #161004; font-size: 10.5px; font-weight: 800;
  padding: 3px 9px; border-radius: 3px; text-transform: uppercase;
}

/* News Feed (Classic Metin2 Announcements) */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-item {
  padding: 14px 15px; border-radius: 5px;
  background: rgba(4, 11, 9, 0.70); border: 1px solid rgba(214, 173, 86, 0.18);
  transition: border-color 0.18s;
}
.news-item:hover { border-color: var(--border-gold-strong); }
.news-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.news-badge {
  font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 3px;
  background: rgba(45, 212, 160, 0.15); border: 1px solid var(--border-jade);
  color: var(--jade); text-transform: uppercase; letter-spacing: 0.06em;
}
.news-badge-gold {
  background: rgba(223, 182, 91, 0.16); border-color: var(--border-gold); color: var(--gold-bright);
}
.news-date { font-size: 11.5px; color: var(--muted); }
.news-title { font-family: var(--font-rpg); font-size: 15.5px; color: var(--gold-bright); margin-bottom: 5px; }
.news-summary { font-size: 13px; color: var(--text-soft); }
.news-full {
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed rgba(214, 173, 86, 0.22);
  font-size: 13px; color: var(--text);
}
.news-toggle {
  margin-top: 8px; background: none; border: none; color: var(--jade);
  font-size: 12px; font-weight: 700; cursor: pointer; padding: 0;
}
.news-toggle:hover { color: var(--gold-bright); text-decoration: underline; }

/* 3-Step Classic Quick Start */
.steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.step-card {
  padding: 13px; border-radius: 5px; text-align: center;
  background: rgba(4, 11, 9, 0.72); border: 1px solid rgba(214, 173, 86, 0.18);
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 7px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep)); color: #161004;
}
.step-card h4 { font-family: var(--font-rpg); font-size: 13.5px; color: var(--gold-bright); margin-bottom: 4px; }
.step-card p { font-size: 12px; color: var(--muted); }

/* ---------- RIGHT SIDEBAR: MINI LEADERBOARDS ---------- */
.mini-rank-list { display: flex; flex-direction: column; gap: 6px; }
.mini-rank-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 9px; border-radius: 4px;
  background: rgba(4, 11, 9, 0.68); border: 1px solid rgba(214, 173, 86, 0.13);
  font-size: 12.5px;
}
.mini-rank-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini-rank-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 118px; }
.mini-rank-sub { font-size: 11px; color: var(--muted); }
.mini-rank-val { font-weight: 800; color: var(--gold-bright); white-space: nowrap; font-size: 12.5px; }

.rank-medal {
  width: 23px; height: 23px; border-radius: 4px; display: inline-grid; place-items: center;
  font-size: 11.5px; font-weight: 800; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07); color: var(--text-soft);
}
.rank-1 { background: linear-gradient(135deg, #fde68a, #b47b16); color: #1a1102; }
.rank-2 { background: linear-gradient(135deg, #e2e8f0, #64748b); color: #0f172a; }
.rank-3 { background: linear-gradient(135deg, #fdba74, #9a3412); color: #1c0c02; }

/* Kingdom / Empire Badges */
.emp {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.03em;
}
.emp-1 { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.38); }
.emp-2 { background: rgba(250, 204, 21, 0.16); color: #fde047; border: 1px solid rgba(250, 204, 21, 0.38); }
.emp-3 { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.38); }
.emp-0 { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.28); }

/* Weekly Schedule */
.sched-list { display: flex; flex-direction: column; gap: 6px; font-size: 12.2px; }
.sched-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 9px; border-radius: 4px; background: rgba(4, 11, 9, 0.65);
  border-left: 3px solid var(--gold);
}
.sched-day { color: var(--gold-bright); font-weight: 700; }
.sched-ev { color: var(--text-soft); text-align: right; }

/* ---------- SUB-VIEWS: REGISTER, DOWNLOAD, RANKINGS, GUIDE, RULES, ACCOUNT ---------- */
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Password Strength Meter */
.pw-meter {
  height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.08);
  overflow: hidden; margin-top: 4px;
}
.pw-meter-bar { height: 100%; width: 0%; transition: width 0.2s ease, background 0.2s ease; }
.pw-s1 { width: 25%; background: #ef4444; }
.pw-s2 { width: 52%; background: #f59e0b; }
.pw-s3 { width: 78%; background: #2dd4a0; }
.pw-s4 { width: 100%; background: #34d399; }

.challenge-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.challenge-question {
  padding: 8px 13px; border-radius: 5px; font-weight: 800; font-size: 14.5px;
  background: rgba(45, 212, 160, 0.12); border: 1px solid var(--border-jade);
  color: var(--jade); white-space: nowrap;
}
.challenge-input { max-width: 120px; }
.pow-status {
  margin-top: 6px; font-size: 11.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.pow-ok { color: var(--jade); font-weight: 700; }

.check-row {
  display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 14px;
  font-size: 12.5px; color: var(--text-soft); cursor: pointer;
}
.check-row input { width: auto; margin-top: 3px; accent-color: var(--gold); }

.gift-banner {
  padding: 11px 13px; border-radius: 5px; margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(223, 182, 91, 0.14), rgba(45, 212, 160, 0.11));
  border: 1px solid var(--border-gold); font-size: 12.5px; color: #f4e6be;
}

/* Download Center */
.dl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.dl-panel {
  padding: 16px; border-radius: 5px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  background: rgba(4, 11, 9, 0.78); border: 1px solid var(--border-gold);
}
.dl-panel h3 { font-family: var(--font-rpg); font-size: 16px; color: var(--gold-bright); margin: 5px 0; }
.dl-bullets { list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-soft); }
.dl-bullets li::before { content: '✦ '; color: var(--gold); }
.hash-box {
  margin-top: 6px; padding: 6px 8px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: Consolas, monospace; font-size: 11px; color: var(--muted);
  word-break: break-all;
}
.qr-large-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.qr-large-box { background: #fff; padding: 6px; border-radius: 6px; width: 96px; height: 96px; flex-shrink: 0; }

/* Rankings Full Table & Filter Bar */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.filter-bar select, .filter-bar input {
  padding: 8px 10px; border-radius: 5px; background: var(--bg-input);
  border: 1px solid var(--border-gold); color: var(--text); font-size: 12.8px;
}
.filter-bar input { flex: 1; min-width: 150px; }
.tab-strip { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px; border-radius: 5px; border: 1px solid var(--border-gold);
  background: rgba(4, 11, 9, 0.75); color: var(--text-soft);
  font-family: var(--font-rpg); font-size: 12.8px; font-weight: 700; cursor: pointer;
}
.tab-btn.active {
  background: linear-gradient(180deg, rgba(223, 182, 91, 0.25), rgba(13, 35, 29, 0.95));
  color: var(--gold-bright); border-color: var(--gold-bright);
}

.table-scroll { overflow-x: auto; }
.m2-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.m2-table th {
  text-align: left; padding: 10px 10px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--gold);
  background: rgba(14, 34, 29, 0.85); border-bottom: 1px solid var(--border-gold);
}
.m2-table td {
  padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.m2-table tr:hover td { background: rgba(45, 212, 160, 0.05); }
.lvl-cell { font-weight: 800; color: var(--gold-bright); }
.pts-cell { font-weight: 800; color: var(--jade); }

/* Guide / Rules Cards */
.guide-kpi-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 16px;
}
.guide-kpi {
  padding: 11px 12px; border-radius: 5px; text-align: center;
  background: linear-gradient(180deg, rgba(16, 40, 34, 0.85), rgba(5, 13, 11, 0.92));
  border: 1px solid var(--border-gold);
}
.guide-kpi-val {
  display: block; font-family: var(--font-rpg); font-size: 16px; font-weight: 800;
  color: var(--gold-bright); letter-spacing: 0.03em;
}
.guide-kpi-lbl {
  display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px;
}
.guide-section { margin-bottom: 18px; }
.guide-section:last-child { margin-bottom: 0; }

.evolve-flow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px; align-items: stretch; margin-bottom: 12px;
}
.evolve-step {
  padding: 12px; border-radius: 5px;
  background: rgba(4, 11, 9, 0.78); border: 1px solid rgba(214, 173, 86, 0.24);
  display: flex; flex-direction: column; gap: 5px;
}
.evolve-step-mid { border-color: rgba(45, 212, 160, 0.42); background: rgba(8, 28, 23, 0.82); }
.evolve-step-beta {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(46, 34, 12, 0.55), rgba(7, 18, 15, 0.9));
}
.evolve-badge {
  display: inline-block; align-self: flex-start;
  padding: 2px 7px; border-radius: 3px; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(223, 182, 91, 0.16); color: var(--gold-bright);
  border: 1px solid rgba(223, 182, 91, 0.35);
}
.evolve-step strong { font-family: var(--font-rpg); font-size: 13.5px; color: var(--gold-bright); }
.evolve-step p { font-size: 12px; color: var(--text-soft); line-height: 1.45; }
.evolve-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: var(--gold);
}

.lvl-pill, .tag-jade, .tag-gold {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.lvl-pill { background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.12); }
.tag-jade { background: rgba(45, 212, 160, 0.14); color: var(--jade); border: 1px solid var(--border-jade); }
.tag-gold { background: rgba(223, 182, 91, 0.14); color: var(--gold-bright); border: 1px solid var(--border-gold); }

.guide-note {
  margin-top: 10px; padding: 10px 12px; border-radius: 5px;
  background: rgba(45, 212, 160, 0.08); border: 1px solid rgba(45, 212, 160, 0.28);
  font-size: 12.5px; color: var(--text-soft);
}
.guide-cta-bar {
  margin-top: 14px; padding: 14px 16px; border-radius: 5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(223, 182, 91, 0.15), rgba(45, 212, 160, 0.12));
  border: 1px solid var(--border-gold);
}
.guide-cta-bar strong { display: block; font-family: var(--font-rpg); font-size: 14.5px; color: var(--gold-bright); }
.guide-cta-bar p { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.guide-cta-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.guide-card {
  padding: 14px; border-radius: 5px;
  background: rgba(4, 11, 9, 0.72); border: 1px solid rgba(214, 173, 86, 0.20);
}
.guide-card h4 { font-family: var(--font-rpg); font-size: 14.5px; color: var(--gold-bright); margin-bottom: 6px; }
.guide-card p, .guide-card li { font-size: 12.8px; color: var(--text-soft); }
.guide-card ul { padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }

.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule-item {
  padding: 12px 14px; border-radius: 5px;
  background: rgba(4, 11, 9, 0.72); border-left: 3px solid var(--gold);
}
.rule-item strong { color: var(--gold-bright); display: block; margin-bottom: 3px; font-size: 13.5px; }
.rule-item p { font-size: 12.8px; color: var(--text-soft); }

/* Account Dashboard */
.char-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 11px 13px; border-radius: 5px; margin-bottom: 8px;
  background: rgba(4, 11, 9, 0.75); border: 1px solid rgba(214, 173, 86, 0.18);
}
.acc-section-title {
  font-family: var(--font-rpg); font-size: 14px; color: var(--gold-bright);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 16px 0 9px; padding-bottom: 5px; border-bottom: 1px solid rgba(214, 173, 86, 0.22);
}
.audit-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit-table th {
  text-align: left; padding: 7px 8px; color: var(--gold);
  border-bottom: 1px solid var(--border-gold); font-size: 11px;
}
.audit-table td { padding: 7px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-soft); }
.delcode-reveal {
  margin-top: 8px; padding: 10px 14px; border-radius: 5px;
  background: rgba(45, 212, 160, 0.12); border: 1px solid var(--jade);
  font-size: 15px; font-weight: 800; color: var(--gold-bright); letter-spacing: 0.16em;
  text-align: center;
}

/* ---------- FOOTER ---------- */
.portal-footer {
  position: relative; z-index: 10;
  background: linear-gradient(180deg, #06100e 0%, #030706 100%);
  border-top: 2px solid var(--gold-deep);
  padding: 26px 16px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 12.8px;
}
.footer-links {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px;
}
.footer-links a { color: var(--text-soft); font-weight: 600; }
.footer-links a:hover { color: var(--gold-bright); }
.footer-shields {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 12px 0;
}
.shield-tag {
  padding: 4px 10px; border-radius: 4px; font-size: 11.5px; font-weight: 700;
  background: rgba(45, 212, 160, 0.08); border: 1px solid var(--border-jade); color: #a7f3d0;
}

/* ---------- RESPONSIVE BREAKPOINTS ---------- */
@media (max-width: 1100px) {
  .portal-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .right-sidebar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .portal-shell { grid-template-columns: 1fr; }
  .center-col { order: 1; }
  .left-sidebar { order: 2; }
  .right-sidebar { order: 3; grid-template-columns: 1fr; }
  .dl-cards, .guide-grid, .form-2col, .steps-grid { grid-template-columns: 1fr; }
  .guide-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evolve-flow { grid-template-columns: 1fr; }
  .evolve-arrow { transform: rotate(90deg); padding: 2px 0; }
  .slider-box { height: 230px; }
  .nav-link { padding: 10px 12px; font-size: 12px; flex: 1 1 auto; justify-content: center; }
}
