
/* ═══════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════ */
:root {
  --bg:         #08090d;
  --bg2:        #0e1018;
  --bg3:        #13151f;
  --border:     #2a2d3e;
  --border2:    #3d4160;
  --gold:       #c9a84c;
  --gold2:      #f0d080;
  --gold-glow:  rgba(201,168,76,0.18);
  --red:        #8b1a1a;
  --red2:       #d44;
  --text:       #d8d4c8;
  --text-dim:   #6b6a6a;
  --text-muted: #4a4a5a;
  --card-w:     240px;
  --sidebar-w:  280px;
  --sidebar-collapsed-w: 48px;
  --topnav-h:   52px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* noise grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: .5;
}

/* ═══════════════════════════════════════
   TOP NAV TABS
═══════════════════════════════════════ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 800;
  background: rgba(8,9,13,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  box-shadow: 0 1px 0 rgba(201,168,76,0.06), 0 4px 24px rgba(0,0,0,0.45);
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: var(--topnav-h);
  padding: 0 16px;
  gap: 4px;
}

.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 24px;
  border-right: 1px solid rgba(201,168,76,0.2);
  margin-right: 10px;
  flex-shrink: 0;
}

.top-nav-brand .brand-name {
  font-family: 'Philosopher', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  white-space: nowrap;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(201,168,76,0.45), 0 0 40px rgba(201,168,76,0.15);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-family: 'Philosopher', serif;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.nav-tab .tab-icon { font-size: 14px; flex-shrink: 0; }
.nav-tab .tab-label { }

.nav-tab:hover { color: var(--text); background: rgba(201,168,76,0.04); }

.nav-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 12px rgba(201,168,76,0.3);
}

/* live pulse indicator */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,60,60,.15);
  border: 1px solid rgba(255,60,60,.3);
  border-radius: 999px;
  padding: 2px 7px 2px 5px;
  font-size: 9px;
  font-family: 'Be Vietnam Pro', sans-serif;
  letter-spacing: 1px;
  color: #ff5a5a;
  font-weight: 600;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4444;
  animation: livePulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes livePulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

/* ═══════════════════════════════════════
   PAGE LAYOUT  (sidebar + main)
═══════════════════════════════════════ */
.page-layout {
  display: flex;
  min-height: calc(100vh - var(--topnav-h));
  position: relative;
}

/* ═══════════════════════════════════════
   LEFT SIDEBAR
═══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--topnav-h);
  height: calc(100vh - var(--topnav-h));
  overflow: hidden;
  transition: width .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

/* sidebar header row */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 48px;
}

.sidebar-title {
  font-family: 'Philosopher', serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}

.sidebar.collapsed .sidebar-title { opacity: 0; width: 0; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--gold);
  font-size: 13px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .3s;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
}

.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

/* sidebar body (scrollable) */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.sidebar.collapsed .sidebar-body { overflow: hidden; }

/* collapsed icon buttons in sidebar */
.sidebar-collapsed-icons {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.sidebar.collapsed .sidebar-collapsed-icons { display: flex; }
.sidebar.collapsed .sidebar-content { display: none; }

.collapsed-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}

.collapsed-icon-btn:hover { background: var(--gold-glow); color: var(--gold); }

.collapsed-icon-btn .ci-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  display: none;
}

.collapsed-icon-btn .ci-badge.visible { display: block; }

/* ── sidebar search ── */
.sidebar-search-wrap {
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-search-label {
  font-family: 'Philosopher', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: .7;
}

.sidebar-name-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border2);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg3);
  transition: border-color .2s;
}

.sidebar-name-wrap:focus-within { border-color: var(--gold); box-shadow: 0 0 10px rgba(201,168,76,.1); }

.sidebar-name-icon { padding: 0 10px; color: var(--gold); font-size: 12px; background: var(--bg3); }

#nameSearch {
  flex: 1;
  padding: 9px 10px 9px 10px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px;
  outline: none;
}

#nameSearch::placeholder { color: var(--text-muted); font-style: italic; }

.name-clear {
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 16px;
  display: none;
  align-items: center;
  cursor: pointer;
  border-left: 1px solid var(--border);
  height: 38px;
  transition: color .15s;
}
.name-clear.visible { display: flex; }
.name-clear:hover { color: var(--gold); }

/* ── sidebar filter groups ── */
.filter-group {
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(42,45,62,.6);
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}

.filter-group-header:hover { background: rgba(201,168,76,.05); }

.filter-group-name {
  font-family: 'Philosopher', serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group-badge {
  background: var(--gold);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  display: none;
}

.filter-group-badge.visible { display: inline-block; }

.filter-group-arrow {
  color: var(--gold);
  font-size: 9px;
  transition: transform .25s ease;
  flex-shrink: 0;
}

.filter-group.open .filter-group-arrow { transform: rotate(180deg); }

.filter-group-body {
  display: none;
  padding: 4px 12px 10px;
}

.filter-group.open .filter-group-body { display: block; }

/* inner search inside filter group */
.filter-inner-search {
  width: 100%;
  padding: 6px 10px;
  margin-bottom: 6px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 3px;
  color: var(--text);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  outline: none;
  transition: border-color .2s;
}

.filter-inner-search:focus { border-color: var(--gold); }
.filter-inner-search::placeholder { color: var(--text-muted); }

.filter-scroll-list {
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.filter-scroll-list label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px 6px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 13px;
  transition: background .12s;
  color: var(--text);
}

.filter-scroll-list label:hover { background: rgba(201,168,76,.08); color: var(--gold2); }

.filter-scroll-list input[type="checkbox"] {
  appearance: none;
  width: 13px;
  height: 13px;
  border: 1px solid var(--border2);
  border-radius: 2px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  position: relative;
}

.filter-scroll-list input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: var(--gold);
}

.filter-scroll-list input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #000;
  font-weight: 900;
}

/* selected tags inside group */
.filter-selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 12px 8px;
}

.tag {
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.35);
  color: var(--gold2);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: 'Philosopher', serif;
  display: flex;
  gap: 6px;
  align-items: center;
  animation: tagIn .2s ease;
}

@keyframes tagIn {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}

.tag .remove {
  cursor: pointer;
  color: var(--gold);
  font-weight: bold;
  font-size: 13px;
  line-height: 1;
  opacity: .7;
  transition: opacity .15s;
}
.tag .remove:hover { opacity: 1; }

/* sidebar footer actions */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar.collapsed .sidebar-footer { display: none; }

.search-btn {
  padding: 9px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Philosopher', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  transition: background .2s, color .2s, box-shadow .2s;
  width: 100%;
}

.search-btn:hover {
  background: var(--gold);
  color: #000;
  box-shadow: 0 0 20px rgba(201,168,76,.3);
}

.reset-all-btn {
  padding: 7px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 3px;
  color: var(--text-muted);
  font-family: 'Philosopher', serif;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
}

.reset-all-btn:hover { border-color: var(--red2); color: var(--red2); }

/* ═══════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════ */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── tab pages ── */
.tab-page { display: none; flex: 1; flex-direction: column; }
.tab-page.active { display: flex; }

/* ── library page header ── */
.library-header {
  padding: 32px 28px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

/* ── lib view switch ── */
.lib-view-switch {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px; padding: 4px;
}
.lib-view-btn {
  padding: 7px 22px; border-radius: 20px; border: none;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; color: #6a5c48; background: none;
  font-family: inherit;
}
.lib-view-btn.active {
  background: rgba(201,168,76,0.18);
  border: 1px solid rgba(201,168,76,0.4);
  color: #c9a84c;
}
.lib-view-btn:hover:not(.active) { color: #a08050; }

/* ── trait grid ── */
.trait-grid {
  display: block;
  padding: 24px 28px;
}
.trait-section-wrap { margin-bottom: 36px; }
.trait-section-heading {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 0.72rem; font-weight: 700; color: #c9a84c;
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.trait-section-heading small {
  color: #4a3c2a; font-size: 0.68rem;
  font-weight: 400; text-transform: none; letter-spacing: 0;
}
.trait-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.trait-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 14px; padding: 22px 16px 16px;
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.trait-card:hover {
  background: rgba(201,168,76,0.06);
  border-color: rgba(201,168,76,0.3);
}
.trait-card-icon {
  width: 76px; height: 76px; border-radius: 50%;
  object-fit: contain;
  border: 2px solid rgba(201,168,76,0.25);
  background: rgba(255,255,255,0.03);
}
.trait-card-name {
  font-size: 0.92rem; font-weight: 700; color: #e8d5a3;
}
.trait-card-des {
  font-size: 0.76rem; color: #7a6a54; line-height: 1.65; flex: 1;
}
.trait-card-chars {
  font-size: 0.68rem; color: #8a7860; line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 8px; width: 100%;
}

.library-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 28px;
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.library-title {
  font-family: 'Philosopher', serif;
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 40px rgba(201,168,76,.3);
  letter-spacing: 2px;
}

.library-title span { color: var(--gold); }

/* ── toolbar ── */
.toolbar {
  padding: 14px 24px;
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.toolbar.visible { display: flex; }

.result-count {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px;
  color: var(--text-dim);
  flex: 1;
}

.result-count b { color: var(--gold); font-weight: 700; }

.toolbar-right { display: flex; align-items: center; gap: 10px; }

.sort-wrap { display: flex; align-items: center; gap: 8px; }

.sort-label {
  font-family: 'Philosopher', serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sort-select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px;
  padding: 6px 28px 6px 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c9a84c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .2s;
}

.sort-select:hover, .sort-select:focus { border-color: var(--gold); }

/* ═══════════════════════════════════════
   STATES
═══════════════════════════════════════ */
.state-box {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
  text-align: center;
}

.state-box.visible { display: flex; }

.state-icon { font-size: 52px; filter: grayscale(.4); }

.state-title {
  font-family: 'Philosopher', serif;
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 2px;
}

.state-sub { font-size: 15px; color: var(--text-dim); font-style: italic; }

.spinner-rune {
  width: 56px;
  height: 56px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   CHARACTER GRID
═══════════════════════════════════════ */
#charGrid {
  padding: 24px;
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr));
  gap: 24px;
  justify-items: center;
  align-content: start;
}

#charGrid.visible { display: grid; }

/* ═══════════════════════════════════════
   CHARACTER CARD
═══════════════════════════════════════ */
.char-card {
  width: var(--card-w);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  animation: cardReveal .4s ease both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.char-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(201,168,76,.2), 0 24px 48px rgba(0,0,0,.6), 0 0 60px rgba(201,168,76,.08);
}

.char-card::before, .char-card::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  opacity: 0;
  transition: opacity .3s;
  z-index: 2;
}

.char-card::before { top: 6px; left: 6px; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); }
.char-card::after  { bottom: 6px; right: 6px; border-bottom: 1px solid var(--gold); border-right: 1px solid var(--gold); }
.char-card:hover::before, .char-card:hover::after { opacity: 1; }

.char-avatar-wrap {
  width: 100%;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(ellipse at 50% 30%, #1a1c2a 0%, #08090d 100%);
}

.char-avatar-circle {
  width: 180px; height: 180px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #fff;
  border: 2px solid var(--border2);
  box-shadow: 0 0 0 4px rgba(201,168,76,.08), 0 8px 24px rgba(0,0,0,.5);
  transition: border-color .3s, box-shadow .3s;
  display: flex; align-items: center; justify-content: center;
}

.char-card:hover .char-avatar-circle {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,168,76,.18), 0 8px 32px rgba(0,0,0,.6);
}

.char-thumb {
  width: 100%; height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform .4s ease;
}

.quality-strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  opacity: .6;
}

.char-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  position: relative;
}

.char-name {
  font-family: 'Philosopher', serif;
  font-size: 14px;
  font-weight: 700;
  color: #f0ead8;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.char-meta { display: flex; gap: 8px; align-items: center; }
.char-gender { font-size: 12px; color: var(--text-dim); font-style: italic; }
.char-class  { font-size: 11px; color: var(--gold); font-family: 'Philosopher', serif; letter-spacing: .5px; opacity: .8; }
.char-quality { margin-left: auto; font-size: 10px; font-family: 'Philosopher', serif; letter-spacing: 1px; color: var(--gold2); opacity: .6; text-transform: uppercase; }

.char-avatar-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  background: linear-gradient(160deg, #1a1c2a, #08090d);
}

/* stagger */
.char-card:nth-child(1)  { animation-delay: .02s }
.char-card:nth-child(2)  { animation-delay: .04s }
.char-card:nth-child(3)  { animation-delay: .06s }
.char-card:nth-child(4)  { animation-delay: .08s }
.char-card:nth-child(5)  { animation-delay: .10s }
.char-card:nth-child(6)  { animation-delay: .12s }
.char-card:nth-child(7)  { animation-delay: .14s }
.char-card:nth-child(8)  { animation-delay: .16s }
.char-card:nth-child(9)  { animation-delay: .18s }
.char-card:nth-child(10) { animation-delay: .20s }
.char-card:nth-child(n+11) { animation-delay: .22s }

/* ═══════════════════════════════════════
   LIVE EVENTS PAGE
═══════════════════════════════════════ */
.live-page {
  padding: 32px 28px;
  flex: 1;
}

.live-page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.live-page-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 180px;
  height: 1px;
  background: linear-gradient(90deg, #ff4444, transparent);
}

.live-page-title {
  font-family: 'Philosopher', serif;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
}

.live-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.live-event-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
  cursor: pointer;
  animation: cardReveal .35s ease both;
}

.live-event-card:hover { border-color: var(--gold); transform: translateY(-4px); }

.live-event-card.is-live { border-color: rgba(255,68,68,.4); }
.live-event-card.is-live:hover { border-color: #ff4444; }

.event-banner {
  height: 110px;
  background: linear-gradient(135deg, #1a1022, #0e0810);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}

.event-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.6) 100%);
}

.event-banner-live-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,60,60,.08) 0%, transparent 70%);
  pointer-events: none;
}

.event-status-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.event-status-pill.live {
  background: rgba(255,60,60,.2);
  border: 1px solid rgba(255,60,60,.5);
  color: #ff6666;
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-status-pill.upcoming {
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.3);
  color: var(--gold);
}

.event-status-pill.ended {
  background: rgba(100,100,100,.12);
  border: 1px solid rgba(100,100,100,.25);
  color: var(--text-muted);
}

.event-body {
  padding: 16px;
}

.event-name {
  font-family: 'Philosopher', serif;
  font-size: 15px;
  font-weight: 700;
  color: #f0ead8;
  margin-bottom: 6px;
  letter-spacing: .5px;
}

.event-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 12px;
}

.event-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Philosopher', serif;
  letter-spacing: .5px;
}

.event-meta-time { color: var(--gold); opacity: .8; }

/* countdown */
.event-countdown {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  min-width: 48px;
}

.countdown-num {
  font-family: 'Philosopher', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.countdown-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ═══════════════════════════════════════
   RANKING PAGE
═══════════════════════════════════════ */
.ranking-page {
  padding: 32px 28px;
  flex: 1;
}

.ranking-page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.ranking-page-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 160px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.ranking-page-title {
  font-family: 'Philosopher', serif;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Be Vietnam Pro', sans-serif;
}

.ranking-table thead tr {
  border-bottom: 1px solid var(--border2);
}

.ranking-table th {
  font-family: 'Philosopher', serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  padding: 10px 16px;
  text-align: left;
  opacity: .7;
}

.ranking-table tbody tr {
  border-bottom: 1px solid rgba(42,45,62,.5);
  transition: background .12s;
}

.ranking-table tbody tr:hover { background: rgba(201,168,76,.04); }

.ranking-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}

.rank-num {
  font-family: 'Philosopher', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  width: 40px;
}

.rank-num.gold-rank   { color: #ffd700; }
.rank-num.silver-rank { color: #c0c0c0; }
.rank-num.bronze-rank { color: #cd7f32; }

.rank-char-info { display: flex; align-items: center; gap: 12px; }
.rank-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border2); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.rank-name { font-family: 'Philosopher', serif; font-size: 14px; color: #f0ead8; }
.rank-class { font-size: 11px; color: var(--text-muted); }
.rank-quality-badge { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-family: 'Philosopher', serif; letter-spacing: 1px; }
.rank-quality-badge.saint  { background: rgba(201,168,76,.15); border: 1px solid rgba(201,168,76,.35); color: var(--gold2); }
.rank-quality-badge.epic   { background: rgba(138,43,226,.12); border: 1px solid rgba(138,43,226,.3); color: #c590ff; }
.rank-quality-badge.rare   { background: rgba(30,144,255,.1);  border: 1px solid rgba(30,144,255,.25); color: #7ac4ff; }
.rank-quality-badge.common { background: rgba(100,100,100,.1); border: 1px solid rgba(100,100,100,.2); color: var(--text-muted); }

/* ═══════════════════════════════════════
   NEWS PAGE
═══════════════════════════════════════ */
.news-page {
  padding: 32px 28px;
  flex: 1;
}

.news-page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.news-page-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.news-page-title {
  font-family: 'Philosopher', serif;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
}

.news-list { display: flex; flex-direction: column; gap: 16px; }

.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 24px 0 8px;
}

.news-pag-btn {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-muted);
  font-family: 'Philosopher', serif;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}

.news-pag-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}

.news-pag-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #08090d;
  font-weight: 700;
}

.news-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-family: 'Philosopher', serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .7;
  transition: opacity .2s;
}
.news-card:hover .read-more { opacity: 1; }

/* ═══════════════════════════════════════
   FEATURE MODAL (article / document style)
═══════════════════════════════════════ */
.news-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9100;
  backdrop-filter: blur(4px);
  padding: 20px;
}
.news-modal.open { display: flex; }
.news-panel {
  width: min(760px, 96vw);
  max-height: 90vh;
  background: #f5f0e6;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: panelIn .25s ease;
}
.news-panel-topbar {
  padding: 10px 20px;
  background: #f5f0e6;
  border-bottom: 1px solid #d8d0bc;
  flex-shrink: 0;
}
.news-panel-back {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #555;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  transition: color .15s;
}
.news-panel-back:hover { color: #111; }
.news-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 48px 40px;
  background: #f5f0e6;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}
.news-panel-title {
  font-family: 'Philosopher', serif;
  font-size: clamp(14px, 2vw, 19px);
  font-weight: 900;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.4;
}
.news-panel-meta {
  text-align: right;
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.news-panel-divider {
  border: none;
  border-top: 1px solid #ccc;
  margin: 0 0 20px;
}
.news-panel-content {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  line-height: 1.85;
  color: #1a1a1a;
}
.news-panel-content p { margin-bottom: 12px; }
.news-panel-content p:last-child { margin-bottom: 0; }
.news-panel-content strong { font-weight: 700; }
.news-panel-content ul { list-style: none; margin-bottom: 14px; }
.news-panel-content ul li { padding: 3px 0; }
.news-panel-content ul li::before { content: "- "; }
.news-panel-content img { max-width: 100%; border-radius: 4px; margin: 16px 0; display: block; }
.news-panel-content h3 { font-weight: 700; font-size: 14px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .5px; }

/* image grid — 2 portrait screenshots side by side */
.feat-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.feat-img-grid img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: contain;
  border-radius: 6px;
  background: #e4dfd4;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  display: block;
}
/* single portrait screenshot, centered, not full width */
.feat-img-single {
  display: block;
  max-width: 220px;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 3px 14px rgba(0,0,0,.22);
  margin: 16px auto;
}

.news-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color .2s;
  cursor: pointer;
  animation: cardReveal .3s ease both;
}

.news-card:hover { border-color: var(--gold); }

.news-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }

.news-content { flex: 1; }

.news-category {
  font-family: 'Philosopher', serif;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .7;
  margin-bottom: 4px;
}

.news-title {
  font-family: 'Philosopher', serif;
  font-size: 15px;
  font-weight: 700;
  color: #f0ead8;
  margin-bottom: 6px;
  line-height: 1.4;
}

.news-excerpt {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.news-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: 'Philosopher', serif;
  letter-spacing: .5px;
}

/* ═══════════════════════════════════════
   MODAL
═══════════════════════════════════════ */
.char-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9000;
  backdrop-filter: blur(6px);
  animation: fadeIn .2s ease;
}

@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.char-panel {
  width: min(1500px, 96vw);
  max-height: 90vh;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.8), 0 0 0 1px rgba(201,168,76,.1);
  animation: panelIn .25s ease;
  position: relative;
}

@keyframes panelIn {
  from { opacity:0; transform: scale(.96) translateY(16px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.char-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  line-height: 1;
  z-index: 10;
  transition: color .2s;
  font-family: serif;
}

.modal-close:hover { color: var(--gold); }

.char-left {
  width: 700px;
  height: 700px;
  flex-shrink: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-radius: 4px 0 0 4px;
}

.char-left img { width: 100%; height: 100%; object-fit: contain; }
.char-left-placeholder { font-size: 90px; opacity: .4; }

.char-right {
  flex: 1;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.modal-name {
  font-family: 'Philosopher', serif;
  font-size: 22px;
  font-weight: 900;
  color: #f0ead8;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.modal-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin: 14px 0;
  opacity: .4;
}

.modal-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-bottom: 4px;
}

.info-row { display: flex; flex-direction: column; gap: 2px; }

.info-label {
  font-family: 'Philosopher', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  opacity: .7;
}

.info-value { font-size: 15px; color: var(--text); }

.skill-tabs {
  display: flex;
  gap: 14px;
  margin: 20px 0 12px;
  flex-wrap: wrap;
  align-items: center;
}

.skill-tabs button {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  cursor: pointer;
  background: var(--bg3);
  padding: 0;
  overflow: visible;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  flex-shrink: 0;
}

.skill-tabs button img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.skill-tabs button .tab-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg3);
}

/* tooltip */
.skill-tabs button::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8,9,13,.95);
  border: 1px solid var(--border2);
  color: var(--gold2);
  font-family: 'Philosopher', serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}

.skill-tabs button:hover::after { opacity: 1; }

.skill-tabs button:hover {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(201,168,76,.35);
  transform: translateY(-2px);
}

.skill-tabs button.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.2), 0 0 18px rgba(201,168,76,.3);
}

.skill-tabs button.active::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,.4);
  pointer-events: none;
  animation: skillRingPulse 2s ease-in-out infinite;
}

@keyframes skillRingPulse {
  0%,100% { opacity: .6; transform: scale(1); }
  50%      { opacity: .2; transform: scale(1.06); }
}

.skill-box {
  flex: 1;
  padding: 16px 18px;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  min-height: 80px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.skill-empty { color: var(--text-muted); font-style: italic; }

/* ── PANEL TABS (Kỹ Năng / Build) ── */
.panel-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 12px;
}
.pt-btn {
  padding: 6px 20px;
  font-family: 'Philosopher', serif;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  color: var(--text-muted);
  transition: color .18s, border-color .18s, background .18s;
  white-space: nowrap;
}
.pt-btn:hover {
  color: var(--text);
  border-color: rgba(201,168,76,0.35);
  background: rgba(201,168,76,0.06);
}
.pt-btn.active {
  color: var(--gold);
  border-color: rgba(201,168,76,0.6);
  background: rgba(201,168,76,0.12);
}

/* ═══════════════════════════════════════
   HOME PAGE
═══════════════════════════════════════ */
.home-hero {
  position: relative;
  min-height: calc(100vh - var(--topnav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% -8%, rgba(201,168,76,.2) 0%, transparent 62%),
    linear-gradient(180deg, rgba(0,0,0,.52) 0%, rgba(0,0,0,.62) 100%),
    url('../../etc/bg.webp') center/cover no-repeat;
}

.home-hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(201,168,76,.016) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(201,168,76,.016) 60px);
}

.home-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 6% 100% at 22% 50%, rgba(201,168,76,.08) 0%, transparent 100%),
    radial-gradient(ellipse 6% 100% at 78% 50%, rgba(201,168,76,.08) 0%, transparent 100%),
    radial-gradient(ellipse 18% 55% at 50% 0%, rgba(201,168,76,.14) 0%, transparent 100%);
}

.home-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 64px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: fadeIn .7s ease;
}

/* Corner bracket decorations */
.home-hero-content::before,
.home-hero-content::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(201,168,76,.45);
  border-style: solid;
  pointer-events: none;
}
.home-hero-content::before {
  top: 22px; left: 22px;
  border-width: 1px 0 0 1px;
}
.home-hero-content::after {
  bottom: 22px; right: 22px;
  border-width: 0 1px 1px 0;
}

/* Emblem ring around icon */
.home-hero-emblem {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: heroIconFloat 3.2s ease-in-out infinite;
}
.home-hero-emblem::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201,168,76,.45);
  border-radius: 50%;
  animation: emblemPulse 3s ease-in-out infinite;
}
.home-hero-emblem::after {
  content: '';
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 50%;
}
@keyframes emblemPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,.15); }
  50%      { box-shadow: 0 0 28px 8px rgba(201,168,76,.1); }
}

.home-hero-icon {
  font-size: 48px;
  filter: drop-shadow(0 0 18px rgba(201,168,76,.7));
  position: relative;
  z-index: 1;
}

.home-hero-icon-img {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 24px rgba(201,168,76,.45);
}

@keyframes heroIconFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.home-hero-title {
  font-family: 'Philosopher', serif;
  font-size: clamp(30px, 5.5vw, 68px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 80px rgba(201,168,76,.5), 0 2px 6px rgba(0,0,0,.7);
  letter-spacing: 5px;
  line-height: 1.1;
}

.home-hero-title span { color: var(--gold); }

/* Ornate divider with center gem */
.home-hero-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 320px;
  max-width: 72vw;
}
.home-hero-divider-line {
  flex: 1;
  height: 1px;
  display: block;
}
.home-hero-divider-line:first-child {
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.6));
}
.home-hero-divider-line:last-child {
  background: linear-gradient(90deg, rgba(201,168,76,.6), transparent);
}
.home-hero-divider-gem {
  color: var(--gold);
  font-size: 11px;
  opacity: .85;
  flex-shrink: 0;
  letter-spacing: 0;
}

.home-hero-sub {
  font-size: clamp(11px, 1.2vw, 13px);
  color: rgba(200,190,160,.75);
  letter-spacing: 3.5px;
  font-family: 'Philosopher', serif;
  text-transform: uppercase;
  max-width: 420px;
  line-height: 2;
}

.home-hero-cta {
  margin-top: 6px;
  padding: 13px 48px;
  background: transparent;
  border: 1px solid rgba(201,168,76,.7);
  color: var(--gold);
  font-family: 'Philosopher', serif;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background .25s, color .25s, box-shadow .25s;
  animation: ctaIdlePulse 2.8s ease-in-out infinite;
}
@keyframes ctaIdlePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,.12); }
  50%      { box-shadow: 0 0 20px 4px rgba(201,168,76,.1); }
}

.home-hero-cta:hover {
  background: var(--gold);
  color: #000;
  box-shadow: 0 0 34px rgba(201,168,76,.5);
  animation: none;
}

.home-hero-scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 2px;
  font-family: 'Philosopher', serif;
  text-transform: uppercase;
  animation: hintBob 2s ease-in-out infinite;
  z-index: 1;
  user-select: none;
}

@keyframes hintBob {
  0%,100% { opacity: .4; transform: translateX(-50%) translateY(0); }
  50%      { opacity: .9; transform: translateX(-50%) translateY(7px); }
}

.home-section2 {
  display: flex;
  gap: 20px;
  padding: 48px 28px 56px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  position: relative;
}

.home-section2::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .18;
}

.home-section2-label {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  padding: 0 18px;
  font-family: 'Philosopher', serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  opacity: .7;
  white-space: nowrap;
}

.home-carousel-wrap {
  flex: 1;
  min-width: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  background: var(--bg3);
}

.home-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.home-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
  display: flex;
  align-items: flex-end;
  padding: 22px;
}

.home-slide.active { opacity: 1; }

.home-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 7s ease;
}

.home-slide.active .home-slide-bg { transform: scale(1.05); }

.home-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,.78) 100%);
}

.home-slide-content { position: relative; z-index: 1; }

.home-slide-tag {
  font-family: 'Philosopher', serif;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
  opacity: .85;
}

.home-slide-name {
  font-family: 'Philosopher', serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.home-carousel-dots {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.home-carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  border: 1px solid rgba(255,255,255,.4);
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.home-carousel-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.35);
}

.home-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 230px;
  flex-shrink: 0;
}

.shortcut-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
  min-height: 90px;
}

.shortcut-item:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,.06);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.shortcut-icon { font-size: 26px; }

.shortcut-label {
  font-family: 'Philosopher', serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  opacity: .85;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }

  .sidebar { position: fixed; top: var(--topnav-h); left: 0; height: calc(100vh - var(--topnav-h)); z-index: 500; box-shadow: 4px 0 20px rgba(0,0,0,.5); }
  .sidebar.collapsed { width: 0; border-right: none; }
  .sidebar.collapsed .sidebar-toggle { display: none; }
  .mobile-sidebar-btn { display: flex !important; }

  .nav-tab .tab-label { display: none; }
  .nav-tab { padding: 0 12px; }
  .home-section2 { flex-direction: column; padding: 28px 16px 40px; }
  .home-shortcuts { width: 100%; grid-template-columns: repeat(4, 1fr); }
  .shortcut-item { min-height: 70px; padding: 12px 8px; }
  .shortcut-icon { font-size: 22px; }
  .home-carousel { aspect-ratio: 4/3; }
}

.mobile-sidebar-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--gold);
  cursor: pointer;
  font-size: 16px;
  margin-right: 8px;
}

/* ═══════════════════════════════════════
   TIMELINE
═══════════════════════════════════════ */
:root { --tl-day-w: 40px; --tl-row-h: 56px; }

.tl-outer {
  display: block !important;
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.tl-scroll { position: relative; }
.tl-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.tl-month-row {
  display: flex;
  height: 24px;
  border-bottom: 1px solid rgba(42,45,62,.5);
}
.tl-month-cell {
  font-family: 'Philosopher', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
  padding: 4px 8px;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.tl-day-row { display: flex; height: 26px; }
.tl-day-cell {
  width: var(--tl-day-w);
  flex-shrink: 0;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 26px;
  border-right: 1px solid rgba(42,45,62,.3);
  box-sizing: border-box;
}
.tl-day-cell.tl-today   { color: var(--gold); font-weight: 700; }
.tl-day-cell.tl-weekend { background: rgba(201,168,76,.03); }
.tl-body { position: relative; }
.tl-vline {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(42,45,62,.4);
  pointer-events: none;
}
.tl-vline.tl-today-col { background: rgba(201,168,76,.18); }
.tl-row-sep {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(42,45,62,.2);
  pointer-events: none;
}
.tl-now-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: rgba(255,255,255,.65);
  z-index: 10;
  pointer-events: none;
}
.tl-now-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 9px;
  color: var(--text);
  white-space: nowrap;
  font-family: monospace;
  letter-spacing: .5px;
}
.tl-event {
  position: absolute;
  height: 40px;
  top: 8px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: filter .15s, transform .15s;
  z-index: 2;
  box-sizing: border-box;
}
.tl-event:hover { filter: brightness(1.2); transform: scaleY(1.08); z-index: 5; }
.tl-event-icon { font-size: 16px; flex-shrink: 0; line-height: 1; }
.tl-event-inner { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow: hidden; }
.tl-event-name {
  font-family: 'Philosopher', serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .3px;
  color: rgba(255,255,255,.95);
}
.tl-event-cd { font-size: 10px; color: rgba(255,255,255,.82); white-space: nowrap; }

/* ═══════════════════════════════════════
   VIDEO PAGE
═══════════════════════════════════════ */
.video-page {
  padding: 32px 28px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.video-page-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.video-page-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 160px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.video-page-title {
  font-family: 'Philosopher', serif;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(201,168,76,.25);
  letter-spacing: 2px;
}

.video-page-title span { color: var(--gold); }

.video-section {
  margin-bottom: 40px;
}

.video-section-label {
  font-family: 'Philosopher', serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Featured (large) video */
.video-featured {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
  margin-bottom: 28px;
}

.video-featured:hover {
  border-color: var(--border2);
  box-shadow: 0 4px 32px rgba(201,168,76,.08);
}

.video-frame-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
}

.video-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-featured .video-meta {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
}

.video-featured .video-title {
  font-family: 'Philosopher', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: .5px;
}

.video-featured .video-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Grid of smaller videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s, transform .2s;
  animation: fadeInUp .4s ease both;
}

.video-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 24px rgba(201,168,76,.12);
  transform: translateY(-2px);
}

.video-card .video-meta {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
}

.video-card .video-title {
  font-family: 'Philosopher', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: .4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card .video-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(201,168,76,.1);
  border: 1px solid rgba(201,168,76,.25);
  color: var(--gold2);
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 10px;
  font-family: 'Philosopher', serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════
   HERO DOWNLOAD BAR
═══════════════════════════════════════ */
.hero-download {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: stretch;
  gap: 22px;
  background: rgba(8,6,4,0.82);
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: 8px;
  padding: 20px 28px;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}
.hero-download::before,
.hero-download::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--gold);
  border-style: solid;
}
.hero-download::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hero-download::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.hero-dl-icon {
  display: flex;
  align-items: stretch;
}
.hero-dl-icon img {
  width: auto;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(201,168,76,0.3);
}
.hero-dl-btns { display: flex; flex-direction: column; gap: 10px; flex: 1; }

.dl-btn-icon {
  width: 44px; height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-dl-btn {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
  padding: 0 26px;
  height: 44px;
  box-sizing: border-box;
  overflow: hidden;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 4px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  letter-spacing: .5px;
}
.hero-dl-btn:hover { background: rgba(201,168,76,0.2); border-color: var(--gold); }

.hero-dl-napthe {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  background: rgba(60,44,12,0.9);
  border: 1px solid rgba(201,168,76,0.5);
  border-radius: 6px;
  color: var(--gold2);
  font-family: 'Philosopher', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  text-align: center;
  line-height: 1.3;
  transition: all .2s;
}
.hero-dl-napthe:hover { background: rgba(201,168,76,0.25); box-shadow: 0 0 16px rgba(201,168,76,0.3); }

/* ═══════════════════════════════════════
   FLOATING SIDEBAR (RIGHT)
═══════════════════════════════════════ */
/* Outer wrapper — handles fixed position + slide transition */
.float-sidebar-outer {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 950;
  display: flex;
  align-items: center;
}
/* collapsed state is set via JS with pixel values */

.float-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  background: rgba(8,6,4,0.9);
  border: 1px solid rgba(201,168,76,0.3);
  border-right: none;
  border-radius: 14px 0 0 14px;
  padding: 16px 12px 0 12px;
  backdrop-filter: blur(14px);
  overflow: visible;
}

.float-game-logo { width: 100%; display: flex; justify-content: center; }
.float-game-logo img {
  width: 130px;
  height: 130px;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(201,168,76,0.25);
}

.float-dl-btns { display: flex; flex-direction: column; gap: 8px; }

.float-dl-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 40px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: filter .2s;
}
.float-dl-btn:hover { filter: brightness(1.3); }
.float-ios  { background: #1c1c2e; color: #e0e0ff; border: 1px solid #3a3a6e; }
.float-ch   { background: #0a2e1c; color: #6ee7a0; border: 1px solid #1a6040; }
.float-apk  { background: #1e0f2e; color: #c084fc; border: 1px solid #6b2fa0; }

/* Hình tròn nửa trong nửa ngoài đáy sidebar */
.float-napthe-wrap {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  margin-bottom: -72px;
}

.float-napthe-circle {
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,0.65);
  background: radial-gradient(circle at 40% 35%, rgba(100,75,20,0.95) 0%, rgba(12,9,3,0.98) 70%);
  box-shadow: 0 0 20px rgba(201,168,76,0.35), inset 0 0 16px rgba(201,168,76,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 128px;
  line-height: 1;
  text-align: center;
  padding-bottom: 12px;
  transition: box-shadow .2s, transform .2s;
}
.float-napthe-wrap:hover .float-napthe-circle {
  box-shadow: 0 0 32px rgba(201,168,76,0.6);
  transform: scale(1.06);
}

.float-napthe-label {
  color: var(--gold);
  font-family: 'Philosopher', serif;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(201,168,76,0.5);
}

/* Toggle tab — flex item in outer wrapper */
.float-toggle-tab {
  flex-shrink: 0;
  width: 22px;
  height: 56px;
  background: rgba(8,6,4,0.92);
  border: 1px solid rgba(201,168,76,0.3);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: #c9a84c;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(14px);
  transition: background 0.2s;
}
.float-toggle-tab:hover { background: rgba(201,168,76,0.15); }

/* ═══════════════════════════════════════
   ENHANCEMENTS — thêm bởi enhancements.js
═══════════════════════════════════════ */

/* ── TAB FADE TRANSITION ── */
.tab-page.active {
  animation: tabPageIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes tabPageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── STAGGERED CARD ANIMATION ── */
@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.char-card {
  animation: cardFadeUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: min(calc(var(--card-i, 0) * 0.032s), 0.48s);
}

/* ── RIPPLE EFFECT ── */
.char-card { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(201,168,76,0.18);
  transform: scale(0);
  animation: rippleAnim 0.5s linear;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(2.5); opacity: 0; }
}

/* ── TOAST NOTIFICATIONS ── */
#toastContainer {
  position: fixed;
  bottom: 88px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f0e8d0;
  background: rgba(20, 16, 10, 0.95);
  border: 1px solid rgba(201,168,76,0.2);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22,1,0.36,1);
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast.toast-add    { border-color: rgba(201,168,76,0.45); color: #f0d47a; }
.toast.toast-remove { border-color: rgba(180,80,80,0.4);  color: #f09090; }
.toast.toast-info   { border-color: rgba(76,160,220,0.35); color: #a0d8f0; }

@media (max-width: 640px) {
  #toastContainer { bottom: 76px; right: 12px; left: 12px; align-items: center; }
  .toast { font-size: 0.8rem; }
}

/* ── SCROLL-TO-TOP BUTTON ── */
#scrollTopBtn {
  position: fixed;
  bottom: 88px;
  left: 20px;
  z-index: 500;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(14, 10, 6, 0.9);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.7) translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22,1,0.36,1), border-color 0.18s;
  pointer-events: none;
}
#scrollTopBtn.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
#scrollTopBtn:hover {
  border-color: rgba(201,168,76,0.7);
  background: rgba(30, 22, 10, 0.95);
  box-shadow: 0 0 16px rgba(201,168,76,0.2);
}
@media (max-width: 640px) {
  #scrollTopBtn { bottom: 76px; left: 12px; width: 36px; height: 36px; font-size: 0.85rem; }
}

/* ── SHARE BUTTON IN CHAR MODAL ── */
.modal-share {
  position: absolute;
  top: 12px;
  right: 48px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
  color: #7a6a50;
  cursor: pointer;
  transition: all 0.18s;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  z-index: 5;
}
.modal-share:hover {
  color: var(--gold);
  border-color: rgba(201,168,76,0.5);
  background: rgba(201,168,76,0.1);
}

/* ── ENHANCED CARD HOVER ── */
.char-card:hover .char-avatar-circle {
  box-shadow: 0 0 0 2px rgba(201,168,76,0.4), 0 8px 32px rgba(0,0,0,0.5);
}

/* ── EVENT CARDS ── */
.ev-cards-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.ev-cards-title {
  font-family: 'Philosopher', serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  opacity: 0.8;
}
.ev-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.ev-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ev-color, var(--gold));
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s, box-shadow .2s;
  animation: cardFadeUp .3s ease both;
}
.ev-card:hover {
  border-color: var(--ev-color, var(--gold));
  box-shadow: 0 4px 20px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.04);
}
.ev-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ev-card-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.ev-card-info { flex: 1; min-width: 0; }
.ev-card-name {
  font-family: 'Philosopher', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #e8d5a3;
  line-height: 1.3;
  margin-bottom: 4px;
}
.ev-card-dates { font-size: 0.72rem; color: var(--text-muted); }

/* Status badges */
.ev-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.ev-badge-live     { background: rgba(255,60,60,.18); color: #ff6b6b; border: 1px solid rgba(255,60,60,.35); animation: livePulse 1.4s infinite; }
.ev-badge-upcoming { background: rgba(255,180,50,.12); color: #ffc845; border: 1px solid rgba(255,180,50,.3); }
.ev-badge-ended    { background: rgba(100,100,100,.1); color: #6a6a6a; border: 1px solid rgba(100,100,100,.2); }

/* Description */
.ev-card-desc { font-size: 0.78rem; color: #7a6a50; line-height: 1.65; }

/* Progress bar */
.ev-progress-wrap {
  height: 4px;
  background: rgba(255,255,255,.07);
  border-radius: 2px;
  overflow: hidden;
}
.ev-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ev-color, var(--gold)), color-mix(in srgb, var(--ev-color, var(--gold)) 60%, white));
  border-radius: 2px;
  transition: width .5s linear;
}

/* Countdown */
.ev-card-cd {
  font-size: 0.75rem;
  color: #ff8c8c;
  font-weight: 600;
}
.ev-cd-upcoming { color: #ffc845; }
.ev-cd-ended    { color: var(--text-muted); font-weight: 400; }

@media (max-width: 640px) {
  .ev-cards-grid { grid-template-columns: 1fr; }
  .ev-card { padding: 14px 14px; }
}

/* ═══════════════════════════════════════
   TIER LIST BUILDER
═══════════════════════════════════════ */
.tlb-open-btn {
  margin-top: 12px;
  padding: 8px 20px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 999px;
  color: #c9a84c;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.5px;
}
.tlb-open-btn:hover { background: rgba(201,168,76,0.2); }

/* Overlay */
.tlb-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1100;
  backdrop-filter: blur(6px);
  overflow-y: auto;
  padding: 24px 16px;
  box-sizing: border-box;
}
.tlb-modal.open { display: flex; justify-content: center; align-items: flex-start; }

.tlb-panel {
  background: #0c0904;
  border: 1px solid rgba(201,168,76,0.28);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* Header */
.tlb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(201,168,76,0.14);
  background: rgba(201,168,76,0.04);
  gap: 10px;
  flex-wrap: wrap;
}
.tlb-header-title {
  font-family: 'Philosopher', serif;
  font-size: 1.05rem;
  color: #e8d5a3;
}
.tlb-header-btns { display: flex; gap: 8px; align-items: center; }
.tlb-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(201,168,76,0.3);
  background: rgba(201,168,76,0.08);
  color: #c9a84c;
  transition: background 0.18s;
  white-space: nowrap;
}
.tlb-btn:hover { background: rgba(201,168,76,0.2); }
.tlb-btn-danger { border-color: rgba(255,80,80,0.3); color: #ff8080; background: rgba(255,80,80,0.06); }
.tlb-btn-danger:hover { background: rgba(255,80,80,0.15); }
.tlb-x {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #777; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s;
}
.tlb-x:hover { background: rgba(220,60,60,0.25); color: #fff; }

/* Tier rows */
.tlb-tiers { padding: 14px 14px 0; display: flex; flex-direction: column; gap: 5px; }
.tlb-tier-row { display: flex; gap: 5px; min-height: 70px; }
.tlb-tier-label {
  width: 46px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Philosopher', serif;
  font-size: 1.3rem; font-weight: 700; color: #fff;
  border-radius: 7px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.tlb-tier-zone {
  flex: 1;
  display: flex; flex-wrap: wrap;
  gap: 10px; align-content: flex-start;
  padding: 10px;
  border: 1.5px dashed rgba(255,255,255,0.09);
  border-radius: 7px;
  background: rgba(255,255,255,0.018);
  min-height: 174px;
  transition: background 0.15s, border-color 0.15s;
}
.tlb-tier-zone.drag-over {
  background: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.5);
}

/* Pool */
.tlb-pool-wrap { padding: 14px; }
.tlb-pool-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.15), transparent);
  margin-bottom: 14px;
}
.tlb-pool-label {
  font-size: 0.6rem; color: #7a6a50;
  letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700; margin-bottom: 8px;
}
.tlb-pool {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 10px;
  border: 1.5px dashed rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(255,255,255,0.01);
  min-height: 174px;
  transition: background 0.15s, border-color 0.15s;
}
.tlb-pool.drag-over {
  background: rgba(201,168,76,0.06);
  border-color: rgba(201,168,76,0.3);
}

/* Hero chip */
.tlb-hero {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  width: 90px;
  cursor: grab; user-select: none;
  transition: transform 0.18s;
}
.tlb-hero:hover { transform: translateY(-4px) scale(1.08); }
.tlb-hero:active { cursor: grabbing; }
.tlb-hero.dragging { opacity: 0.35; pointer-events: none; }
.tlb-hero-circle {
  width: 90px; height: 150px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(201,168,76,0.5);
  box-shadow: 0 0 10px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.3);
  background: #1a1410;
  position: relative;
  flex-shrink: 0;
}
.tlb-hero:hover .tlb-hero-circle {
  border-color: rgba(201,168,76,0.85);
  box-shadow: 0 0 14px rgba(201,168,76,0.3);
}
.tlb-hero-circle img {
  position: absolute;
  width: 100% !important; height: 100% !important;
  top: 0 !important; left: 0 !important;
  object-fit: cover; object-position: center top;
  pointer-events: none;
  transform: none !important;
}
.tlb-hero-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.tlb-hero-name {
  font-size: 0.68rem; color: #a09070;
  text-align: center; max-width: 88px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}

/* Code modal */
.tlb-code-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 1200;
  align-items: center; justify-content: center;
  padding: 20px; box-sizing: border-box;
}
.tlb-code-modal.open { display: flex; }
.tlb-code-panel {
  background: #0f0c06;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 22px;
  width: min(480px, 100%);
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.tlb-code-title {
  font-family: 'Philosopher', serif;
  color: #c9a84c; font-size: 1rem;
}
.tlb-code-sub { font-size: 0.73rem; color: #7a6a50; }
.tlb-code-panel textarea {
  width: 100%; height: 90px; box-sizing: border-box;
  background: rgba(201,168,76,0.04);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 8px; color: #e8d5a3;
  font-family: 'Courier New', monospace; font-size: 0.72rem;
  padding: 10px; resize: none; outline: none;
  word-break: break-all;
}
.tlb-code-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }


