/* game.css - Giao Diện Tu Tiên Web Client Chuẩn Xianxia */
:root {
  --bg-dark: #100d17;
  --bg-card: rgba(31, 25, 35, 0.9);
  --bg-card-hover: rgba(49, 38, 48, 0.97);
  --border-gold: rgba(201, 169, 102, 0.36);
  --border-gold-bright: #e8c978;
  --gold: #d8b66d;
  --cyan: #7bd3c0;
  --jade: #62bd98;
  --purple: #a88ad1;
  --crimson: #e36c69;
  --text-main: #f5efe4;
  --text-muted: #b2a99c;
  --font-title: 'Noto Serif', 'Be Vietnam Pro', serif;
  --font-body: 'Be Vietnam Pro', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
button, .nav-item, .slot-item, .class-card { user-select: none; }

body {
  background-color: var(--bg-dark);
  background-image: radial-gradient(ellipse at 15% -10%, rgba(125, 83, 113, 0.2), transparent 42%),
    radial-gradient(ellipse at 92% 12%, rgba(57, 120, 105, 0.16), transparent 36%),
    linear-gradient(145deg, #100d17 0%, #15111b 52%, #0b1014 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Canvas hạt bụi linh khí nền */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* App Layout */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(17, 14, 22, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 8px var(--cyan));
}

.brand-title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #f1c40f, #e67e22);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Profile Section in Header */
.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  padding: 5px 14px;
  border-radius: 40px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.avatar-box {
  position: relative;
  width: 40px;
  height: 40px;
}

.avatar-box img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.realm-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulseAura 2.5s infinite ease-in-out;
}

@keyframes pulseAura {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-name {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
}

.class-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-weight: 700;
}

.realm-badge {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 12px;
  background: rgba(241, 196, 15, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(241, 196, 15, 0.4);
  font-weight: 700;
}

.exp-bar-container {
  position: relative;
  width: 180px;
  height: 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.exp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

/* Currencies & Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.currency-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.curr-icon { font-size: 16px; }

.curr-val {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

.curr-label {
  font-size: 10px;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
  transform: scale(1.08);
}

/* Navigation Tabs */
.app-nav {
  display: flex;
  align-items: center;
  background: rgba(10, 15, 29, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-item:hover {
  color: #fff;
}

.nav-item.active {
  color: #f0d28d;
  border-bottom-color: var(--gold);
  background: linear-gradient(180deg, rgba(216, 182, 109, 0.13), rgba(216, 182, 109, 0.015));
}

.nav-icon { font-size: 16px; }

/* Main Content Area */
.app-main {
  flex: 1;
  padding: 20px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
.dtd-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 20px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-out;
}
.tab-pane.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Common Cards */
.card {
  background: linear-gradient(145deg, rgba(35, 28, 39, 0.95), rgba(23, 25, 31, 0.94));
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* 1. ĐỘNG PHỦ (Nhân vật & Stats) */
.dongphu-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
}

.character-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 240px;
  margin-bottom: 16px;
}

.character-visual img {
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.3));
}

.breakthrough-box {
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.realm-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.realm-title {
  font-family: var(--font-title);
  font-size: 22px;
  color: #fbbf24;
  margin-top: 4px;
}

.btn-breakthrough {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #475569, #334155);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  cursor: not-allowed;
  transition: all 0.3s;
}

.btn-breakthrough.ready {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #000;
  border-color: #fef08a;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.6);
  cursor: pointer;
  animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
  from { transform: scale(1); filter: drop-shadow(0 0 8px #fde047); }
  to { transform: scale(1.02); filter: drop-shadow(0 0 18px #eab308); }
}

.breakthrough-tip {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.dongphu-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-icon { font-size: 16px; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-val { font-size: 13px; font-weight: 800; color: #fff; margin-left: auto; }

.combat-power-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
}
.cp-label { font-size: 10px; font-weight: 800; color: #fbbf24; }
.cp-val { font-size: 15px; font-weight: 900; color: #fef08a; }

.cancan-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cancan-title { font-size: 13px; color: #fff; }
.cancan-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* 2. TRANG BỊ & FORGE */
.trangbi-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.slot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 105px;
  user-select: none;
}

.slot-item:hover, .slot-item.active {
  border-color: var(--gold);
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.slot-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s;
}
.slot-item:hover .slot-img {
  transform: scale(1.1);
}

.slot-empty-icon {
  font-size: 32px;
  opacity: 0.35;
  margin-bottom: 6px;
}

.slot-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--cyan);
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.slot-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-refine {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  font-weight: 900;
  color: #fbbf24;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 5px;
  border-radius: 4px;
}

.slot-empty {
  border: 1px dashed rgba(255, 255, 255, 0.15) !important;
  background: rgba(0, 0, 0, 0.2) !important;
}

.forge-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.forge-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
}

.forge-tab-btn.active {
  background: rgba(241, 196, 15, 0.15);
  color: #fbbf24;
}

.forge-content { display: none; }
.forge-content.active { display: block; }

.enhance-info-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.enhance-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

/* 3. KỸ NĂNG */
.kynang-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.skills-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.skill-slot-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
}

.skill-slot-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 6px;
}

.skills-list-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 4. DỊ HỎA */
.dihoa-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
}

.dihoa-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.flames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.flame-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.flame-card:hover {
  border-color: #f97316;
  transform: translateY(-2px);
}

/* Phẩm Cấp Vật Phẩm (Tiers Glow & Accent) */
.tier-TIEN, .tier-5 {
  border-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45), inset 0 0 8px rgba(239, 68, 68, 0.2) !important;
}
.tier-TIEN .inv-name, .tier-TIEN .slot-name, .tier-TIEN .shop-item-name {
  color: #f87171 !important;
  font-weight: 800;
}

.tier-THIEN, .tier-4 {
  border-color: #f59e0b !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45), inset 0 0 8px rgba(245, 158, 11, 0.2) !important;
}
.tier-THIEN .inv-name, .tier-THIEN .slot-name, .tier-THIEN .shop-item-name {
  color: #fbbf24 !important;
  font-weight: 800;
}

.tier-DIA, .tier-3 {
  border-color: #a855f7 !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35), inset 0 0 6px rgba(168, 85, 247, 0.15) !important;
}
.tier-DIA .inv-name, .tier-DIA .slot-name, .tier-DIA .shop-item-name {
  color: #c084fc !important;
  font-weight: 700;
}

.tier-HUYEN, .tier-2 {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3), inset 0 0 6px rgba(6, 182, 212, 0.15) !important;
}
.tier-HUYEN .inv-name, .tier-HUYEN .slot-name, .tier-HUYEN .shop-item-name {
  color: #38bdf8 !important;
  font-weight: 700;
}

.tier-HOANG, .tier-1 {
  border-color: #10b981 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2) !important;
}
.tier-HOANG .inv-name, .tier-HOANG .slot-name, .tier-HOANG .shop-item-name {
  color: #34d399 !important;
}

/* 5. TAB TÚI ĐỒ (Inventory) */
.inventory-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  color: #fff;
  background: rgba(51, 65, 85, 0.8);
}
.filter-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.inventory-summary {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.inventory-summary { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.inventory-merge-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:8px 12px; border:1px solid rgba(220,190,120,.26); background:rgba(11,18,17,.72); border-radius:5px; color:#e5d5ad; font-size:12px; }
.inventory-merge-toolbar.hidden { display:none; }
.inventory-merge-toolbar .btn { padding:7px 12px; font-size:12px; }
.inventory-merge-toolbar .btn:disabled { opacity:.5; cursor:not-allowed; }
.inv-slot.merge-selected { outline:2px solid #d8bd77; outline-offset:1px; box-shadow:0 0 18px rgba(216,189,119,.28); }
.inv-merge-order { position:absolute; top:5px; left:5px; z-index:2; padding:2px 5px; background:rgba(10,14,15,.88); border:1px solid rgba(216,189,119,.48); color:#f0d990; border-radius:3px; font-size:9px; font-weight:800; }

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  background: rgba(15, 23, 42, 0.5);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 320px;
}

.inv-slot {
  aspect-ratio: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.inv-slot:hover {
  transform: translateY(-3px) scale(1.03);
  background: rgba(30, 41, 59, 0.95);
  z-index: 10;
}

.inv-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s;
}
.item-icon-fallback { align-items:center; justify-content:center; font-size:28px; line-height:1; }
.item-icon-fallback.hidden { display:none; }
.inv-icon.item-icon-fallback { display:flex; }
.inv-icon.item-icon-fallback.hidden { display:none; }
.modal-icon-img.item-icon-fallback { display:flex; }
.shop-item-img.item-icon-fallback { display:flex; }
.inv-slot:hover .inv-icon {
  transform: scale(1.1);
}

.inv-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: #e2e8f0;
}
.inv-qty {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 5px;
  border-radius: 4px;
}
.inv-lock {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 11px;
}
.inv-equipped-tag {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 1px 4px;
  border-radius: 4px;
}
.modal-icon-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

/* 6. VƯỢT ẢI */
.vuotai-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chapters-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 6px;
}

.chapter-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.chapter-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--cyan);
  color: var(--cyan);
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.stage-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  transition: all 0.2s;
}

.stage-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.stage-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.stage-desc { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; }

.vuotai-arena-card {
  background: rgba(10, 15, 29, 0.95);
  border: 1px solid var(--cyan);
}

.combat-fighters {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
}

.fighter { width: 40%; text-align: center; }
.fighter-name { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.fighter-hp-bar { height: 10px; background: rgba(0, 0, 0, 0.6); border-radius: 6px; overflow: hidden; }
.hp-fill { height: 100%; background: #22c55e; transition: width 0.3s; }
.vs-badge { font-family: var(--font-title); font-size: 22px; font-weight: 900; color: #ef4444; }

.arena-logs-box {
  max-height: 240px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  font-family: monospace;
}

/* 6. ĐĂNG TIÊN ĐÀI */
.dtd-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dtd-stat-box {
  background: rgba(0, 0, 0, 0.35);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}
.dtd-label { font-size: 11px; color: var(--text-muted); display: block; }

.opponents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.opponent-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

/* 7. LINH ĐIỀN & LUYỆN ĐAN */
.linhdien-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.garden-plots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.plot-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.plot-card.ready { border-color: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.3); }
.plot-card.locked { opacity: 0.5; }

.cauldron-flame-buff {
  background: rgba(234, 88, 12, 0.15);
  border: 1px solid rgba(234, 88, 12, 0.4);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #fdba74;
  margin-bottom: 14px;
}

/* 8. TÔNG MÔN & NHIỆM VỤ & SHOP */
.tongmon-container, .nhiemvu-layout, .shop-layout {
  max-width: 1000px;
  margin: 0 auto;
}

.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.shop-item-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s;
}

.shop-item-card:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.9);
}

.shop-img-box {
  width: 68px;
  height: 68px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.shop-item-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.shop-item-name {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.shop-item-price {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Beast & Flame & Boss & Sect Enhanced Media */
.flame-img, .beast-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  margin-bottom: 6px;
}

.flame-active-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.6));
  animation: floatFlame 3s ease-in-out infinite alternate;
}
@keyframes floatFlame {
  0% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.5)); }
  100% { transform: translateY(-6px) scale(1.04); filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.8)); }
}

.beast-active-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
  margin-bottom: 8px;
}

.sect-banner-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.boss-artwork-img {
  max-width: 260px;
  max-height: 180px;
  object-fit: contain;
  margin: 0 auto 14px auto;
  display: block;
  filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.5));
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 14px;
  text-align: left;
}
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.form-select, .form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}
.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--cyan);
}

/* Utility */
.hidden {
  display: none !important;
}

/* Auth / Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95) 0%, rgba(2, 6, 23, 0.98) 100%);
  backdrop-filter: blur(16px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 24px;
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(2, 132, 199, 0.15);
}

.login-badge {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 2px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.login-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.login-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-step-guide {
  padding: 16px 18px;
  border: 1px solid rgba(212, 175, 93, 0.28);
  border-radius: 12px;
  background: rgba(212, 175, 93, 0.07);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
}
.login-step-guide b { color: #f5d78e; }
.login-step-guide code { color: #f5d78e; font-weight: 800; }

.btn-discord {
  background: #5865F2;
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4);
}
.btn-discord:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(88, 101, 242, 0.6);
}

.divider {
  position: relative;
  text-align: center;
  margin: 8px 0;
}
.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.divider span {
  position: relative;
  background: #1e293b;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.code-login-box {
  display: flex;
  gap: 8px;
}
.code-login-box input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
}
.code-login-box input:focus {
  outline: none;
  border-color: var(--cyan);
}

.login-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.login-tip code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fbbf24;
}

/* Class Selection */
.class-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.class-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.class-card input {
  display: none;
}
.class-card:hover {
  background: rgba(2, 132, 199, 0.15);
  border-color: var(--cyan);
}
.class-card.active, .class-card:has(input:checked) {
  background: rgba(2, 132, 199, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}
.class-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.class-name {
  font-weight: 800;
  color: #fff;
  font-size: 14px;
  margin-bottom: 4px;
}
.class-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Item Action Modal */
.item-modal {
  max-width: 460px;
}
.item-modal-body {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.item-modal-icon {
  font-size: 48px;
  width: 76px;
  height: 76px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.item-modal-info {
  flex: 1;
}
.item-modal-tier {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fbbf24;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.item-modal-title {
  font-family: var(--font-title);
  font-size: 20px;
  color: #fff;
  margin-bottom: 4px;
}
.item-modal-type {
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 6px;
  font-weight: 700;
}
.item-modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.item-modal-qty {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}
.item-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 30px;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

.modal-title {
  font-family: var(--font-title);
  font-size: 20px;
  color: #fbbf24;
  margin-bottom: 14px;
}

.modal-body-scroll {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #277d69, #205849);
  color: #fff;
  border: 1px solid rgba(123, 211, 192, 0.72);
  box-shadow: 0 4px 15px rgba(32, 112, 91, 0.28);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-2px); }

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}
.btn-secondary:hover { background: rgba(51, 65, 85, 0.9); }

.btn-danger {
  background: rgba(239, 68, 68, 0.8);
  border: 1px solid #ef4444;
  color: #fff;
}

.btn-large {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.highlight { color: #fbbf24; }
.empty-tip { color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px; }

/* Toast */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.95);
  border-left: 4px solid var(--cyan);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out;
}
.toast.success { border-left-color: var(--jade); }
.toast.error { border-left-color: var(--crimson); }
.toast.gold { border-left-color: var(--gold); }

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

/* Responsive */
@media (max-width: 900px) {
  .dongphu-grid, .trangbi-layout, .kynang-layout, .dihoa-layout, .linhdien-layout {
    grid-template-columns: 1fr;
  }
}

/* Xianxia polish, keyboard focus and compact screens */
.card {
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 238, 197, 0.035);
  backdrop-filter: blur(10px);
}
.card-title, .realm-title, .modal-title { color: #e9c879; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 11px;
  color: #9ae0bd;
  background: rgba(46, 120, 87, 0.2);
  border: 1px solid rgba(107, 194, 147, 0.34);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.status-pill.error { color: #ffaaa0; background: rgba(163, 57, 55, 0.2); border-color: rgba(227, 108, 105, 0.5); }
.btn-breakthrough.ready {
  background: linear-gradient(135deg, #d7b363, #a7823e);
  color: #1b1710;
  border-color: #f1d694;
  box-shadow: 0 0 20px rgba(215, 179, 99, 0.35);
}
.btn:disabled, button:disabled { cursor: wait; opacity: 0.62; transform: none; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid #9ce2cd;
  outline-offset: 3px;
}
.app-nav { scrollbar-width: thin; scrollbar-color: rgba(216, 182, 109, 0.45) transparent; }
.skip-link {
  position: fixed; left: 12px; top: 10px; z-index: 3000;
  padding: 10px 14px; transform: translateY(-160%);
  color: #17130d; background: #e8c978; border-radius: 9px; font-weight: 900;
}
.skip-link:focus { transform: translateY(0); }
.nav-item { min-height: 48px; }
.nav-item.active .nav-icon { filter: drop-shadow(0 0 7px rgba(232, 201, 120, 0.55)); }
input, select, textarea, .form-select {
  color-scheme: dark;
  accent-color: var(--jade);
}
.modal-card, .login-card {
  background: linear-gradient(145deg, rgba(36, 28, 39, 0.98), rgba(18, 20, 27, 0.98));
  border-color: rgba(216, 182, 109, 0.72);
}
.login-overlay { background: radial-gradient(ellipse at 50% 30%, rgba(60, 46, 65, 0.8), rgba(9, 11, 17, 0.98) 72%); }

@media (max-width: 900px) {
  .app-header { flex-wrap: wrap; padding: 10px 14px; }
  .header-left { flex: 1 1 180px; }
  .header-center { order: 3; flex: 1 1 100%; justify-content: flex-start; border-radius: 14px; }
  .header-right { flex: 1 1 auto; justify-content: flex-end; gap: 7px; }
  .app-nav { padding: 0 8px; }
  .nav-item { min-height: 46px; padding: 10px 12px; }
  .app-main { padding: 16px; }
  .dtd-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { background-attachment: scroll; }
  .app-header { gap: 8px; padding: 9px 10px; }
  .brand { gap: 7px; }
  .brand-icon { font-size: 22px; }
  .brand-title { font-size: 14px; letter-spacing: 1.4px; }
  .brand-sub { font-size: 9px; }
  .header-center { padding: 6px 9px; gap: 9px; }
  .avatar-box { width: 34px; height: 34px; }
  .player-name { font-size: 12px; }
  .player-name-row { gap: 5px; flex-wrap: wrap; }
  .class-tag, .realm-badge { font-size: 9px; }
  .exp-bar-container { width: min(62vw, 230px); }
  .header-right { width: 100%; justify-content: space-between; }
  .currency-badge { flex: 1; justify-content: center; padding: 5px 7px; gap: 4px; }
  .curr-label { display: none; }
  .curr-val { font-size: 12px; }
  .header-controls { margin-left: auto; }
  .btn-icon { width: 38px; height: 38px; }
  .nav-item { gap: 5px; padding: 10px 11px; font-size: 12px; }
  .nav-icon { font-size: 15px; }
  .app-main { padding: 11px; }
  .card { padding: 15px; border-radius: 14px; }
  .card-header { align-items: flex-start; gap: 9px; }
  .card-title { font-size: 14px; letter-spacing: 0.5px; }
  .stats-grid { gap: 8px; }
  .stat-item { padding: 9px 8px; gap: 6px; }
  .stat-label { font-size: 10px; }
  .stat-val { font-size: 12px; }
  .slots-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .slot-item { min-height: 88px; padding: 9px 4px; }
  .slot-img { width: 40px; height: 40px; }
  .modal-overlay { padding: 8px; align-items: flex-end; }
  .modal-card { max-height: 92dvh; overflow-y: auto; padding: 21px 16px; border-radius: 18px 18px 10px 10px; }
  .login-overlay { align-items: center; padding: 12px; }
  .login-card { padding: 24px 18px; }
  .item-modal-body { gap: 10px; }
  .item-modal-actions .btn { flex: 1 1 130px; min-height: 42px; }
  .btn { min-height: 42px; }
  .toast { max-width: calc(100vw - 32px); padding: 11px 14px; }
  #toastContainer { top: 10px; right: 10px; left: 10px; align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Immersive cultivation UI refresh */
:root {
  --bg-dark: #0a0e12;
  --bg-card: rgba(20, 27, 29, 0.94);
  --bg-card-hover: rgba(28, 39, 37, 0.98);
  --border-gold: rgba(197, 164, 100, 0.26);
  --border-gold-bright: #e7c77e;
  --gold: #d5b46e;
  --jade: #70c6a2;
  --cyan: #9acdbb;
  --text-main: #f3eee3;
  --text-muted: #a9aaa0;
}

body {
  background-image:
    radial-gradient(ellipse at 50% -22%, rgba(150, 117, 68, .18), transparent 48%),
    radial-gradient(ellipse at 4% 38%, rgba(38, 116, 92, .14), transparent 34%),
    radial-gradient(ellipse at 100% 72%, rgba(65, 88, 96, .12), transparent 36%),
    linear-gradient(155deg, #0b1012 0%, #101719 48%, #0b0e12 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .18;
  background-image: linear-gradient(rgba(231, 199, 126, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 199, 126, .02) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.app-header {
  padding: 12px clamp(14px, 3vw, 42px);
  background: rgba(10, 15, 17, .88);
  border-bottom-color: rgba(210, 177, 111, .22);
  box-shadow: 0 12px 42px rgba(0, 0, 0, .34);
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(224, 194, 130, .52);
  border-radius: 50%;
  color: #f2d899;
  background: radial-gradient(circle, rgba(202, 164, 89, .2), rgba(35, 48, 42, .22));
  box-shadow: inset 0 0 16px rgba(224, 194, 130, .12), 0 0 20px rgba(85, 143, 117, .16);
}
.brand-title { background-image: linear-gradient(110deg, #f3e1ad, #c8a969 55%, #93bea5); }
.header-center {
  border-radius: 16px;
  border-color: rgba(210, 177, 111, .19);
  background: linear-gradient(115deg, rgba(31, 41, 38, .84), rgba(24, 29, 31, .76));
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.realm-ring { border-color: var(--jade); box-shadow: 0 0 12px rgba(112, 198, 162, .72); }
.exp-bar-container { height: 10px; border-color: rgba(255,255,255,.09); }
.exp-bar-fill { background: linear-gradient(90deg, #388d70, #83c99d 74%, #e0cb8e); }
.class-tag { color: #9bd0b1; background: rgba(61, 133, 99, .17); border-color: rgba(112, 198, 162, .27); }
.realm-badge { color: #f0d89f; background: rgba(170, 132, 64, .16); border-color: rgba(221, 185, 110, .3); }
.currency-badge { border-color: rgba(210, 177, 111, .17); background: rgba(24, 31, 31, .82); }
.btn-icon { background: rgba(39, 52, 48, .72); border-color: rgba(190, 179, 148, .2); }

.app-nav {
  position: sticky;
  top: 66px;
  z-index: 90;
  gap: 4px;
  padding: 7px clamp(12px, 2.3vw, 34px);
  background: rgba(13, 19, 20, .9);
  border-bottom: 1px solid rgba(210, 177, 111, .17);
  box-shadow: 0 9px 28px rgba(0, 0, 0, .2);
  scrollbar-width: thin;
  scrollbar-color: rgba(190, 159, 100, .42) transparent;
}
.app-nav::-webkit-scrollbar { display: block; height: 4px; }
.app-nav::-webkit-scrollbar-thumb { background: rgba(190, 159, 100, .42); border-radius: 9px; }
.nav-item {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
}
.nav-item.active {
  color: #f3d998;
  border-color: rgba(206, 175, 111, .3);
  background: linear-gradient(130deg, rgba(139, 109, 58, .2), rgba(54, 107, 82, .15));
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 4px 14px rgba(0,0,0,.12);
}
.nav-item.active .nav-icon { filter: drop-shadow(0 0 7px rgba(226, 193, 124, .55)); }
.nav-icon { font-size: 15px; }

.app-main { max-width: 1520px; padding: clamp(14px, 2.4vw, 34px); }
.tab-pane { animation-duration: .24s; }
.card {
  position: relative;
  overflow: hidden;
  padding: clamp(17px, 2vw, 25px);
  border-radius: 18px;
  border-color: rgba(191, 164, 109, .24);
  background: linear-gradient(145deg, rgba(27, 35, 34, .96), rgba(18, 24, 27, .96) 74%);
  box-shadow: 0 20px 56px rgba(0,0,0,.23), inset 0 1px rgba(245, 230, 194, .055);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220, 191, 128, .38), transparent);
  pointer-events: none;
}
.card-title { color: #e6ca8b; letter-spacing: .06em; }
.card-header { gap: 12px; }
.card-character { background: radial-gradient(ellipse at 50% 22%, rgba(86, 128, 100, .2), transparent 46%), linear-gradient(150deg, #1c2825, #141b1e 72%); }
.character-visual { min-height: 265px; }
.character-visual img { max-height: 255px; filter: drop-shadow(0 10px 28px rgba(102, 196, 149, .25)); }
.visual-aura { background: radial-gradient(ellipse, rgba(137, 186, 139, .18), transparent 70%); }
.breakthrough-box, .cancan-box, .stat-item, .skill-slot-card, .skill-row,
.inventory-header, .inventory-grid, .enhance-info-box, .dihoa-display,
.opponent-card, .dtd-stat-box, .plot-card, .stage-card, .combat-unit-status {
  background: rgba(8, 14, 15, .42);
  border-color: rgba(205, 185, 135, .14);
}
.stat-item { min-height: 48px; border-radius: 11px; }
.stat-item:hover { border-color: rgba(112, 198, 162, .34); background: rgba(36, 69, 55, .2); }
.combat-power-badge { background: rgba(167, 130, 65, .14); border-color: rgba(218, 182, 107, .32); }
.cp-label { color: #d6bd82; }
.cp-val { color: #f1dfb0; }
.activity-hub {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid rgba(197, 164, 100, .25);
  border-radius: 19px;
  background:
    radial-gradient(ellipse at 88% 18%, rgba(158, 123, 61, .16), transparent 33%),
    radial-gradient(ellipse at 10% 120%, rgba(58, 143, 106, .2), transparent 48%),
    linear-gradient(115deg, rgba(23, 34, 32, .96), rgba(17, 25, 27, .96));
  box-shadow: 0 18px 46px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.05);
}
.activity-hub::after {
  content: "☯";
  position: absolute;
  right: 2.5%;
  top: -65px;
  color: rgba(225, 197, 134, .035);
  font-size: 230px;
  line-height: 1;
  pointer-events: none;
}
.activity-hub-heading { position: relative; z-index: 1; display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.eyebrow { color: #aeca9c; font-size: 10px; letter-spacing: .2em; font-weight: 900; }
.activity-hub-heading h2 { margin-top: 5px; color: #f0e5cd; font-family: var(--font-title); font-size: clamp(17px, 2vw, 23px); letter-spacing: .01em; }
.activity-live { display: inline-flex; align-items: center; gap: 8px; color: #bbcab8; font-size: 11px; white-space: nowrap; }
.activity-live i { width: 7px; height: 7px; border-radius: 50%; background: #78c89a; box-shadow: 0 0 12px #78c89a; animation: livePulse 2s infinite; }
@keyframes livePulse { 50% { opacity: .45; box-shadow: 0 0 3px #78c89a; } }
.activity-hub-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.activity-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  text-align: left;
  color: var(--text-main);
  border: 1px solid rgba(197, 164, 100, .17);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(41, 52, 47, .82), rgba(24, 32, 32, .84));
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.activity-card:hover { transform: translateY(-3px); border-color: rgba(219, 190, 126, .5); background: linear-gradient(145deg, rgba(55, 72, 61, .92), rgba(28, 41, 38, .92)); }
.activity-symbol { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; color: #e2ca91; border: 1px solid rgba(217, 188, 123, .23); border-radius: 12px; background: rgba(152, 124, 68, .13); font-size: 20px; }
.activity-copy { display: grid; gap: 3px; min-width: 0; }
.activity-copy strong { font-size: 13px; }
.activity-copy small { overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-arrow { margin-left: auto; color: rgba(229, 208, 159, .62); font-size: 17px; }

.btn { border-radius: 10px; letter-spacing: .01em; }
.btn-primary { color: #f4efdf; border-color: rgba(131, 204, 164, .46); background: linear-gradient(130deg, #397d62, #285747); box-shadow: 0 7px 20px rgba(35, 103, 75, .19), inset 0 1px rgba(255,255,255,.09); }
.btn-primary:hover { filter: brightness(1.13); box-shadow: 0 9px 24px rgba(35, 103, 75, .28); }
.btn-secondary { color: #e4ddcb; border-color: rgba(210, 190, 144, .2); background: rgba(45, 54, 51, .72); }
.btn-secondary:hover { background: rgba(61, 76, 66, .82); border-color: rgba(210, 190, 144, .38); }
.btn-danger { background: linear-gradient(135deg, #914a43, #693932); border-color: rgba(225, 132, 113, .52); }
.form-select, .form-input, .code-login-box input { background: rgba(7, 12, 14, .72); border-color: rgba(207, 187, 143, .19); }
.form-select:focus, .form-input:focus, .code-login-box input:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(112, 198, 162, .1); }
.filter-btn, .chapter-btn { background: rgba(28, 39, 37, .78); border-color: rgba(205, 185, 135, .19); }
.filter-btn.active, .chapter-btn.active { color: #e7d29f; background: rgba(61, 113, 83, .38); border-color: rgba(112, 198, 162, .46); box-shadow: inset 0 0 20px rgba(80, 147, 108, .08); }
.inv-slot, .slot-item, .shop-item-card, .flame-card { background: linear-gradient(145deg, rgba(33, 43, 41, .92), rgba(19, 26, 28, .96)); border-color: rgba(204, 184, 137, .18); }
.inv-slot:hover, .slot-item:hover, .slot-item.active, .shop-item-card:hover, .flame-card:hover { background: linear-gradient(145deg, rgba(48, 68, 55, .95), rgba(23, 36, 34, .98)); border-color: rgba(112, 198, 162, .55); }
.login-overlay { background: radial-gradient(ellipse at 50% 30%, rgba(51, 81, 66, .55), rgba(8, 13, 15, .98) 72%); }
.login-card { background: linear-gradient(145deg, rgba(29, 42, 37, .97), rgba(14, 21, 23, .98)); border-color: rgba(217, 188, 123, .54); }
.modal-card { background: linear-gradient(145deg, rgba(28, 40, 36, .99), rgba(14, 20, 22, .99)); }
.toast { background: rgba(17, 27, 25, .97); border: 1px solid rgba(209, 187, 137, .18); border-left: 4px solid var(--cyan); }

/* Cinematic, readable battle replay */
.vuotai-arena-card { border-color: rgba(196, 151, 79, .42); background: linear-gradient(145deg, rgba(18, 26, 26, .98), rgba(12, 18, 21, .98)); }
.arena-battlefield {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  justify-content: space-around;
  min-height: 320px;
  overflow: hidden;
  margin: 0 0 14px;
  border: 1px solid rgba(200, 173, 118, .27);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 51% 93%, rgba(130, 111, 70, .27), transparent 35%),
    radial-gradient(ellipse at 18% 50%, rgba(52, 137, 107, .26), transparent 36%),
    radial-gradient(ellipse at 83% 42%, rgba(150, 65, 56, .2), transparent 33%),
    linear-gradient(180deg, #111e23 0%, #1a2a2a 55%, #171c1b 100%);
}
.battlefield-moon { position: absolute; z-index: -2; top: 28px; left: calc(50% - 50px); width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle at 38% 35%, #eee6cf, #b5b499 56%, rgba(148, 173, 156, .08) 73%); opacity: .58; box-shadow: 0 0 60px rgba(199, 211, 177, .18); }
.battlefield-moon::after { content: ""; position: absolute; inset: -32px; border: 1px solid rgba(219, 201, 151, .16); border-radius: 50%; }
.battlefield-stars { position: absolute; top: 25px; left: 0; right: 0; color: rgba(236, 216, 164, .54); text-align: center; letter-spacing: 1.2em; font-size: 12px; }
.battlefield-mist { position: absolute; z-index: -1; left: -10%; width: 120%; height: 100px; opacity: .23; filter: blur(18px); background: linear-gradient(90deg, transparent, rgba(175, 201, 179, .32), transparent); animation: mistDrift 12s ease-in-out infinite alternate; }
.mist-one { bottom: 37px; }.mist-two { bottom: 80px; opacity: .13; animation-delay: -6s; animation-duration: 17s; }
@keyframes mistDrift { from { transform: translateX(-4%) scaleX(.95); } to { transform: translateX(4%) scaleX(1.08); } }
.battle-actor { position: relative; z-index: 1; display: flex; width: 35%; min-height: 270px; align-items: end; justify-content: center; }
.battle-actor img { position: relative; z-index: 1; max-width: 100%; height: 242px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 14px 22px rgba(0,0,0,.5)); }
.battle-actor-player { transform: translateX(10px); }
.battle-actor-enemy { transform: translateX(-10px); }
.enemy-spirit { position: relative; z-index: 1; display: grid; place-items: center; width: 175px; height: 210px; padding-bottom: 13px; font-size: clamp(78px, 12vw, 132px); filter: drop-shadow(0 0 24px rgba(217, 87, 63, .58)); }
.actor-aura { position: absolute; bottom: 31px; width: 185px; height: 155px; border-radius: 50%; background: radial-gradient(ellipse, rgba(88, 194, 142, .28), transparent 68%); filter: blur(8px); animation: auraBreathe 3.2s ease-in-out infinite; }
.battle-actor-enemy .actor-aura { background: radial-gradient(ellipse, rgba(204, 68, 57, .31), transparent 68%); }
@keyframes auraBreathe { 50% { opacity: .55; transform: scale(.9); } }
.actor-ground-seal { position: absolute; bottom: 18px; width: 170px; height: 37px; border: 1px solid rgba(209, 191, 132, .5); border-radius: 50%; background: radial-gradient(ellipse, rgba(212, 183, 112, .15), transparent 70%); box-shadow: 0 0 24px rgba(112, 198, 162, .19); }
.battle-actor-enemy .actor-ground-seal { border-color: rgba(221, 119, 88, .48); box-shadow: 0 0 24px rgba(202, 78, 58, .19); }
.actor-caption { position: absolute; z-index: 3; bottom: 4px; max-width: 90%; overflow: hidden; color: #f3e7ca; font-size: 12px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 2px 5px #000; }
.battle-center-seal { position: absolute; z-index: 2; left: 50%; top: 53%; display: grid; place-items: center; width: 54px; height: 54px; transform: translate(-50%, -50%); color: #ecd69c; font-size: 25px; }
.battle-center-seal::before, .battle-center-seal::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(232, 205, 144, .36); transform: rotate(45deg); }
.battle-center-seal::after { inset: 8px; border-color: rgba(112, 198, 162, .28); transform: rotate(0); }
.battle-center-seal i { position: absolute; left: 50%; width: 1px; height: 120px; background: linear-gradient(transparent, rgba(228, 197, 124, .44), transparent); }
.battlefield-vignette { position: absolute; z-index: 2; inset: 0; pointer-events: none; box-shadow: inset 0 0 55px rgba(0,0,0,.4); }
.battle-flash { position: absolute; z-index: 4; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 50% 50%, rgba(248, 234, 184, .46), transparent 40%); }
.battle-flash.is-active { animation: flashBurst .42s ease-out; }
@keyframes flashBurst { 0% { opacity: .9; } 100% { opacity: 0; } }
.battle-actor.is-attacking.battle-actor-player { animation: playerLunge .42s cubic-bezier(.2,.7,.25,1); }
.battle-actor.is-attacking.battle-actor-enemy { animation: enemyLunge .42s cubic-bezier(.2,.7,.25,1); }
@keyframes playerLunge { 38% { transform: translateX(64px) translateY(-8px) scale(1.045); filter: brightness(1.28); } 100% { transform: translateX(10px); } }
@keyframes enemyLunge { 38% { transform: translateX(-64px) translateY(-8px) scale(1.045); filter: brightness(1.32); } 100% { transform: translateX(-10px); } }
.battle-actor.is-hit { animation: actorHit .32s ease-out; }
@keyframes actorHit { 20% { transform: translateX(-12px) rotate(-2deg); filter: brightness(1.8) sepia(.24); } 55% { transform: translateX(10px) rotate(2deg); } 100% { filter: none; } }
.actor-damage { position: absolute; z-index: 6; top: 24%; left: 50%; opacity: 0; color: #ffce94; font-size: 26px; font-weight: 1000; white-space: nowrap; text-shadow: 0 2px 4px #190d0b, 0 0 15px #ff5138; pointer-events: none; }
.actor-damage.is-visible { animation: damageFloat .82s ease-out forwards; }
@keyframes damageFloat { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.72); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.12); } 100% { opacity: 0; transform: translate(-50%, -45px) scale(1); } }
.combat-status-row { display: grid; grid-template-columns: minmax(0,1fr) 48px minmax(0,1fr); align-items: center; gap: 12px; margin: 0 0 16px; }
.combat-unit-status { padding: 10px 12px; border: 1px solid rgba(205,185,135,.16); border-radius: 11px; }
.combat-unit-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 9px; color: var(--text-muted); letter-spacing: .09em; }
.combat-unit-label strong { color: #e5dfcf; font-size: 10px; letter-spacing: 0; }
.fighter-hp-bar { height: 9px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.08); border-radius: 99px; }
.hp-fill { border-radius: inherit; background: linear-gradient(90deg, #438b67, #9bcc85); transition: width .44s cubic-bezier(.2,.7,.2,1); }
.enemy-hp-fill { background: linear-gradient(90deg, #a4413c, #e28c5b); }
.combat-round-indicator { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(218,190,127,.26); border-radius: 50%; color: #b8c0ae; background: rgba(8,14,15,.55); }
.combat-round-indicator span { font-size: 7px; letter-spacing: .12em; }
.combat-round-indicator strong { color: #f0d79c; font-size: 12px; line-height: 1; }
.arena-log-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 2px 8px; color: #d9c58f; font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.arena-logs-box { max-height: 230px; border: 1px solid rgba(205,185,135,.12); background: rgba(5,10,12,.54); color: #c8c8bc; font-family: var(--font-body); font-size: 12px; }
.battle-log-line { padding: 7px 9px; border-bottom: 1px solid rgba(255,255,255,.045); animation: logReveal .2s ease-out both; }
.battle-log-line.turn-start { color: #e2ca8f; font-weight: 900; text-align: center; letter-spacing: .08em; }
.battle-log-line.victory { color: #a6ddb1; font-weight: 900; }
.battle-log-placeholder { color: #9aa397; text-align: center; padding: 12px; }
@keyframes logReveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.arena-header { align-items: center; }
.arena-header .card-title { margin: 0; }
.battle-overlay-mode {
  position: fixed;
  z-index: 1300;
  inset: 3dvh auto auto 50%;
  width: min(1080px, calc(100vw - 34px));
  max-height: 94dvh;
  margin: 0;
  overflow: auto;
  transform: translateX(-50%);
  box-shadow: 0 0 0 100vmax rgba(2, 6, 7, .82), 0 28px 100px rgba(0,0,0,.65), inset 0 1px rgba(255,255,255,.06);
  animation: battleModalEnter .26s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes battleModalEnter { from { opacity: 0; transform: translate(-50%, 12px) scale(.985); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.battle-overlay-mode .arena-battlefield { min-height: clamp(260px, 38vh, 390px); }
.battle-overlay-mode .battle-actor { min-height: clamp(230px, 35vh, 330px); }
.battle-overlay-mode .battle-actor img { height: clamp(195px, 32vh, 300px); }
.battle-overlay-mode .enemy-spirit { height: clamp(195px, 32vh, 300px); }
.battle-overlay-mode .arena-logs-box { max-height: min(24vh, 230px); }
.boss-card { background: radial-gradient(ellipse at 83% 18%, rgba(134, 50, 43, .17), transparent 42%), linear-gradient(145deg, rgba(27,35,34,.97), rgba(16,21,23,.98)); }
.boss-artwork-img { max-width: 320px; max-height: 230px; border-radius: 14px; }
.boss-artwork-img.boss-is-attacking { animation: bossImpact .48s ease-in-out; }

/* Treasure pavilion: readable economy, distinct pools and clear reward rarity. */
.tambao-container { width: min(1180px, 100%); margin: 0 auto; display: grid; gap: 22px; }
.treasure-hero { position: relative; isolation: isolate; overflow: hidden; min-height: 205px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(24px, 5vw, 48px); border: 1px solid rgba(218,185,112,.48); border-radius: 20px; background: radial-gradient(ellipse at 78% 50%, rgba(141,108,47,.23), transparent 42%), linear-gradient(125deg, rgba(25,22,29,.98), rgba(20,27,26,.94)); box-shadow: inset 0 0 46px rgba(213,177,105,.06), 0 16px 50px rgba(0,0,0,.22); }
.treasure-hero::after { content: ''; position: absolute; z-index: -1; inset: 0; opacity: .18; background: repeating-linear-gradient(135deg, transparent 0 36px, rgba(226,205,156,.12) 37px, transparent 38px 78px); mask-image: linear-gradient(90deg, transparent 22%, #000); }
.treasure-hero-copy { max-width: 650px; }
.treasure-eyebrow { color: #d8b66d; font-size: 10px; font-weight: 900; letter-spacing: .2em; }
.treasure-hero h2 { margin: 8px 0; color: #f2dfb3; font-family: var(--font-title); font-size: clamp(28px, 4vw, 44px); letter-spacing: .08em; }
.treasure-hero p { max-width: 520px; color: #c1b7a6; font-size: 14px; line-height: 1.6; }
.treasure-wallet { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 19px; }
.treasure-wallet span { padding: 8px 12px; border: 1px solid rgba(215,188,124,.22); border-radius: 999px; background: rgba(6,8,9,.42); color: #d9d0bf; font-size: 12px; }
.treasure-wallet b { color: #f0dfba; font-variant-numeric: tabular-nums; }
.treasure-hero-art { position: relative; flex: 0 0 170px; width: 170px; height: 140px; display: grid; place-items: center; }
.treasure-orbit { position: absolute; border: 1px solid rgba(221,192,121,.42); border-radius: 50%; transform: rotate(-25deg); }
.orbit-a { width: 160px; height: 65px; animation: treasureOrbit 10s linear infinite; }
.orbit-b { width: 125px; height: 110px; border-color: rgba(125,211,192,.3); transform: rotate(48deg); animation: treasureOrbit 14s linear infinite reverse; }
.treasure-orb { display: grid; place-items: center; width: 70px; height: 70px; border: 1px solid #e9ce8c; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff0bf, #b7934d 46%, #3c3023 80%); box-shadow: 0 0 30px rgba(232,201,120,.55), 0 0 90px rgba(159,126,56,.24); color: #fff1c9; font-size: 29px; animation: treasurePulse 2.4s ease-in-out infinite; }
@keyframes treasureOrbit { to { transform: rotate(335deg); } }
@keyframes treasurePulse { 50% { scale: 1.08; filter: brightness(1.24); } }
.gacha-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.gacha-card { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0,1fr) 150px; grid-template-rows: auto 1fr auto auto; gap: 12px 14px; padding: 22px; border-radius: 18px; background: linear-gradient(145deg, rgba(32,29,35,.98), rgba(19,22,23,.98)); border: 1px solid rgba(202,174,111,.33); box-shadow: 0 14px 32px rgba(0,0,0,.19); transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.gacha-card:hover { transform: translateY(-3px); border-color: rgba(226,197,126,.7); box-shadow: 0 18px 38px rgba(0,0,0,.27); }
.gacha-card::before { content: ''; position: absolute; width: 180px; height: 180px; right: -86px; top: -100px; border-radius: 50%; background: rgba(117,166,141,.13); filter: blur(10px); pointer-events: none; }
.ttt-card { border-color: rgba(193,151,88,.42); background: linear-gradient(145deg, rgba(39,31,29,.98), rgba(23,21,23,.98)); }
.gacha-card-header { grid-column: 1; grid-row: 1; position: relative; z-index: 1; }
.gacha-tag { display: inline-flex; padding: 5px 9px; border: 1px solid rgba(125,211,192,.33); border-radius: 999px; color: #9dd9c4; background: rgba(66,131,108,.12); font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.gacha-tag.premium { color: #f0cd83; border-color: rgba(222,182,100,.4); background: rgba(169,125,51,.13); }
.gacha-title { margin-top: 11px; color: #f3e5c7; font-family: var(--font-title); font-size: 20px; }
.gacha-desc { margin-top: 6px; max-width: 340px; color: #b9b0a3; font-size: 12px; line-height: 1.5; }
.gacha-altar { position: relative; grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: center; display: grid; place-items: center; width: 154px; aspect-ratio: 1.586; border: 1px solid rgba(224,197,133,.62); border-radius: 12px; background: radial-gradient(circle, rgba(165,128,60,.17), rgba(0,0,0,.04) 68%); box-shadow: 0 0 24px rgba(208,169,90,.11); }
.gacha-altar::before,.gacha-altar::after { content: ''; position: absolute; z-index: 1; inset: 5px; border: 1px solid rgba(223,198,141,.22); border-radius: 8px; pointer-events: none; }
.gacha-altar::after { inset: -5px; border-color: rgba(125,211,192,.2); }
.gacha-altar img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; filter: saturate(.86) drop-shadow(0 0 14px rgba(219,183,94,.28)); animation: altarFloat 3.6s ease-in-out infinite; }
.altar-seal { position: absolute; z-index: 2; bottom: 7px; right: 1px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(239,211,148,.65); border-radius: 50%; background: #1a1918; box-shadow: 0 0 14px rgba(218,181,92,.25); }
@keyframes altarFloat { 50% { transform: translateY(-6px) rotate(2deg); } }
.pool-jackpot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 11px 13px; border: 1px solid rgba(125,211,192,.19); border-radius: 11px; background: rgba(5,9,9,.43); }
.pool-jackpot > span { color: #a9b7a9; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.pool-jackpot strong { color: #a9e0c5; font-size: 17px; font-variant-numeric: tabular-nums; }
.premium-jackpot { border-color: rgba(219,184,109,.22); }
.premium-jackpot strong { color: #f2d38e; }
.premium-jackpot small { flex-basis: 100%; color: #c5af7b; font-size: 10px; }
.gacha-buttons { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.btn-gacha { min-height: 43px; border: 1px solid rgba(112,193,157,.39); border-radius: 10px; background: linear-gradient(135deg, #286b53, #1e493e); color: #e9f4e8; font-weight: 800; transition: filter .2s, transform .2s, opacity .2s; }
.btn-gacha.highlight { background: linear-gradient(135deg, #41896a, #28614e); }
.btn-gacha.premium { border-color: rgba(222,187,111,.38); background: linear-gradient(135deg, #745129, #463522); color: #fff0ca; }
.btn-gacha.premium.highlight { background: linear-gradient(135deg, #9b7136, #634522); }
.btn-gacha:not(:disabled):hover { filter: brightness(1.16); transform: translateY(-1px); }
.btn-gacha:disabled { cursor: not-allowed; opacity: .42; filter: grayscale(.3); }
.gacha-history { padding: 19px; border: 1px solid rgba(202,174,111,.23); border-radius: 16px; background: rgba(24,22,26,.85); }
.treasure-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.treasure-section-heading h3 { margin-top: 4px; color: #eee1c4; font-family: var(--font-title); font-size: 17px; }
.treasure-section-heading > span { color: #bca874; font-size: 11px; }
.gacha-history-list { display: grid; gap: 7px; }
.gacha-history-row { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 12px; border: 1px solid rgba(210,196,169,.12); border-left: 2px solid rgba(171,166,155,.5); border-radius: 9px; background: rgba(5,7,8,.24); }
.gacha-history-row.tier-HUYEN { border-left-color: #639fce; }.gacha-history-row.tier-DIA { border-left-color: #a383c8; }.gacha-history-row.tier-THIEN,.gacha-history-row.tier-TIEN,.gacha-history-row.tier-JACKPOT { border-left-color: #e0bc70; }
.history-item-icon { flex: 0 0 31px; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: rgba(206,187,135,.1); font-size: 17px; }
.history-item-details { display: grid; min-width: 0; gap: 2px; flex: 1; }.history-item-details strong { overflow: hidden; color: #e9e0d2; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.history-item-details small { color: #a69d90; font-size: 10px; }
.history-item-quantity { color: #cbb77e; font-size: 11px; font-weight: 800; }
.gacha-results { position: relative; padding: 22px; border-color: rgba(232,201,120,.5); border-radius: 17px; background: radial-gradient(ellipse at 50% -10%, rgba(160,123,52,.19), transparent 57%), rgba(24,22,26,.97); box-shadow: 0 18px 55px rgba(0,0,0,.3); }
.gacha-spin-overlay { position: fixed; z-index: 1400; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(5,7,8,.88); backdrop-filter: blur(9px); animation: spinOverlayIn .22s ease-out both; }
.gacha-spin-overlay.hidden { display: none; }
.gacha-spin-panel { width: min(780px, 100%); overflow: hidden; padding: 8px; border: 1px solid rgba(225,194,118,.58); border-radius: 16px; background: #100d14; box-shadow: 0 0 65px rgba(197,154,72,.17); text-align: center; }
.gacha-spin-panel img { display: block; width: 100%; max-height: min(65vh, 490px); object-fit: contain; border-radius: 10px; }
.gacha-spin-panel span { display: block; padding: 10px 8px 7px; color: #e8d6a9; font-family: var(--font-title); font-size: 13px; letter-spacing: .04em; }
@keyframes spinOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.results-heading { text-align: center; margin-bottom: 17px; }.results-title { margin-top: 5px; color: #f4dfaa; font-family: var(--font-title); font-size: 21px; }.results-heading p { margin-top: 5px; color: #b8ad9b; font-size: 12px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin-bottom: 17px; }
.gacha-reward-card { position: relative; display: grid; justify-items: center; align-content: start; gap: 7px; min-width: 0; min-height: 155px; padding: 12px 9px; overflow: hidden; border: 1px solid rgba(210,196,169,.2); border-radius: 12px; background: linear-gradient(155deg, rgba(44,41,42,.96), rgba(22,24,25,.96)); animation: rewardReveal .42s cubic-bezier(.16,.76,.3,1) both; animation-delay: var(--reveal-delay, 0ms); }
.gacha-reward-card.tier-HUYEN { border-color: rgba(100,164,214,.5); }.gacha-reward-card.tier-DIA { border-color: rgba(169,131,206,.56); box-shadow: inset 0 0 18px rgba(150,105,199,.09); }.gacha-reward-card.tier-THIEN,.gacha-reward-card.tier-TIEN { border-color: rgba(231,195,106,.7); box-shadow: inset 0 0 24px rgba(220,174,82,.1); }.gacha-reward-card.is-jackpot { border-color: #f3d46f; box-shadow: 0 0 26px rgba(235,194,77,.22), inset 0 0 24px rgba(220,174,82,.13); }
@keyframes rewardReveal { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.gacha-reward-art { display: grid; place-items: center; width: 69px; height: 69px; border-radius: 13px; background: radial-gradient(circle, rgba(204,181,127,.17), rgba(12,14,15,.5)); color: #e7d3a5; font-size: 31px; }.gacha-reward-art img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0,0,0,.4)); }
.reward-tier-label { color: #bcb3a5; font-size: 9px; font-weight: 900; letter-spacing: .13em; }.tier-HUYEN .reward-tier-label { color: #8bc4ee; }.tier-DIA .reward-tier-label { color: #c1a0e2; }.tier-THIEN .reward-tier-label,.tier-TIEN .reward-tier-label,.is-jackpot .reward-tier-label { color: #f0d181; }
.gacha-reward-name { width: 100%; display: -webkit-box; overflow: hidden; color: #eee4d0; font-size: 11px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gacha-reward-flags { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; color: #b9ae9a; font-size: 9px; }
@media (max-width: 780px) { .gacha-grid { grid-template-columns: 1fr; }.gacha-card { grid-template-columns: minmax(0,1fr) 118px; padding: 17px; }.gacha-altar { width: 118px; }.gacha-altar img { width: 100%; height: 100%; }.treasure-hero-art { flex-basis: 110px; width: 110px; scale: .8; margin-inline: -16px; }.treasure-hero { min-height: 0; padding: 22px 19px; }.results-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 420px) { .gacha-card { grid-template-columns: minmax(0,1fr) 85px; gap: 10px; padding: 14px; }.gacha-altar { width: 85px; }.gacha-altar img { width: 100%; height: 100%; }.altar-seal { width: 25px; height: 25px; font-size: 12px; }.gacha-title { font-size: 16px; }.gacha-desc { font-size: 10px; }.gacha-tag { font-size: 8px; }.treasure-hero-art { flex-basis: 67px; width: 67px; scale: .58; margin: 0 -24px 0 -8px; }.treasure-hero p { font-size: 12px; }.treasure-wallet { gap: 5px; }.treasure-wallet span { padding: 6px 8px; font-size: 10px; }.btn-gacha { padding: 7px 5px; font-size: 10px; }.results-grid { gap: 7px; }.gacha-reward-card { min-height: 143px; padding: 9px 7px; } }
@media (prefers-reduced-motion: reduce) { .treasure-orbit,.treasure-orb,.gacha-altar img,.gacha-reward-card { animation: none !important; } }

/* Tầm Bảo: turn the utility panel into a playable celestial location. */
#tab-tambao { position: relative; isolation: isolate; overflow: hidden; background: #080a12; }
#tab-tambao::before { content: ""; position: absolute; z-index: -2; inset: 0; background: radial-gradient(ellipse at 50% 10%, rgba(92,91,154,.2), transparent 48%), linear-gradient(180deg,#0b0d18 0%,#11101a 52%,#090b11 100%); }
.tambao-world { position: relative; width: min(1380px,100%); min-height: 100%; padding: 18px clamp(12px,3vw,38px) 34px; overflow: hidden; }
.treasure-scene { position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 680px; overflow: hidden; pointer-events: none; background: linear-gradient(180deg,rgba(10,12,23,.15),rgba(10,12,20,.35) 58%,#0b0d14 100%); }
.scene-moon { position:absolute; top:66px; left:calc(50% - 75px); width:150px; height:150px; border-radius:50%; background:radial-gradient(circle at 38% 35%,#fff6d9 0%,#dbd6d1 24%,#9494ab 53%,rgba(92,92,124,.08) 72%); opacity:.68; box-shadow:0 0 50px rgba(192,196,244,.32),0 0 150px rgba(137,133,213,.21); animation:moonBreathe 7s ease-in-out infinite; }
.scene-moon::after { content:""; position:absolute; inset:-34px; border:1px solid rgba(230,221,186,.13); border-radius:50%; box-shadow:0 0 0 14px rgba(230,221,186,.025),0 0 0 31px rgba(230,221,186,.025); }
.scene-mountain { position:absolute; left:-6%; right:-6%; bottom:112px; height:220px; clip-path:polygon(0 75%,10% 48%,18% 68%,31% 22%,39% 54%,51% 10%,64% 57%,75% 26%,86% 65%,94% 39%,100% 61%,100% 100%,0 100%); }
.mountain-back { bottom:150px; opacity:.48; background:linear-gradient(180deg,#4a4a68,#1a1d30 75%); filter:drop-shadow(0 0 20px #7877a2); }
.mountain-front { height:165px; opacity:.88; background:linear-gradient(180deg,#292b40,#10131e 83%); }
.scene-gate { position:absolute; bottom:180px; left:50%; width:212px; height:145px; transform:translateX(-50%); border:2px solid rgba(211,181,114,.44); border-bottom:0; border-radius:105px 105px 0 0; box-shadow:0 0 30px rgba(197,162,94,.17), inset 0 0 22px rgba(197,162,94,.09); opacity:.72; }
.scene-gate::before { content:""; position:absolute; inset:15px 15px 0; border:1px solid rgba(212,189,138,.38); border-bottom:0; border-radius:92px 92px 0 0; }
.scene-gate::after { content:""; position:absolute; left:50%; top:24px; bottom:0; width:1px; background:linear-gradient(rgba(245,215,148,.5),rgba(206,178,120,.06)); }
.scene-gate span { position:absolute; top:39px; left:50%; transform:translateX(-50%); color:#f0d99e; font-family:serif; font-size:42px; text-shadow:0 0 22px #f3db9c; }
.scene-pillars { position:absolute; bottom:145px; width:13px; height:125px; border:1px solid rgba(197,166,105,.38); background:linear-gradient(90deg,rgba(63,51,52,.85),rgba(161,117,71,.38),rgba(44,39,48,.8)); box-shadow:0 0 24px rgba(196,154,94,.12); }
.pillar-left { left:calc(50% - 139px); }.pillar-right { right:calc(50% - 139px); }
.scene-ground-rune { position:absolute; bottom:-115px; left:50%; width:min(900px,100vw); aspect-ratio:1; border:1px solid rgba(213,187,126,.24); border-radius:50%; transform:translateX(-50%); box-shadow:0 0 0 22px rgba(213,187,126,.035),0 0 0 58px rgba(213,187,126,.025),inset 0 0 80px rgba(136,158,219,.09); }
.scene-ground-rune::before,.scene-ground-rune::after { content:""; position:absolute; inset:9%; border:1px solid rgba(154,184,217,.2); border-radius:50%; transform:rotate(45deg) scaleY(.42); }
.scene-ground-rune::after { transform:rotate(-45deg) scaleY(.42); }
.scene-ground-glow { position:absolute; bottom:0; left:20%; right:20%; height:160px; background:radial-gradient(ellipse,rgba(158,150,232,.22),transparent 69%); filter:blur(15px); }
.scene-particle { position:absolute; bottom:80px; width:4px; height:4px; border-radius:50%; background:#f5d98e; box-shadow:0 0 12px 3px rgba(255,213,117,.75); animation:spiritRise 6s linear infinite; }
.particle-one{left:16%;animation-delay:-1s}.particle-two{left:29%;animation-delay:-4s}.particle-three{left:43%;animation-delay:-2s}.particle-four{left:61%;animation-delay:-5s}.particle-five{left:77%;animation-delay:-3s}.particle-six{left:88%;animation-delay:-.5s}
@keyframes spiritRise { 0%{transform:translateY(90px) scale(.5);opacity:0} 15%{opacity:.9} 85%{opacity:.7} 100%{transform:translateY(-490px) translateX(35px) scale(1.2);opacity:0} }
@keyframes moonBreathe { 50%{transform:scale(1.035);filter:brightness(1.12)} }
.treasure-hero { min-height:176px; margin:12px auto 0; border:1px solid rgba(224,195,130,.57); border-radius:3px; background:linear-gradient(100deg,rgba(10,12,21,.92),rgba(18,17,30,.78) 60%,rgba(10,12,21,.86)); box-shadow:0 20px 50px rgba(0,0,0,.38),inset 0 0 30px rgba(208,179,115,.055); }
.treasure-hero::before { content:""; position:absolute; inset:7px; border:1px solid rgba(224,195,130,.16); pointer-events:none; }
.treasure-eyebrow { color:#e4c67c; }
.treasure-hero h2 { color:#f1dfb6; text-shadow:0 2px 18px rgba(235,199,125,.25); }
.treasure-hero-art { filter:drop-shadow(0 0 18px rgba(224,195,130,.36)); }
.treasure-orbit { border-color:rgba(227,199,137,.48); box-shadow:0 0 20px rgba(192,156,89,.12); }
.treasure-orb { background:radial-gradient(circle at 36% 30%,#fff2c8,#bf9855 38%,#4f3d50 72%); box-shadow:0 0 34px rgba(233,197,109,.62),0 0 95px rgba(173,125,219,.35); color:#fff0bd; }
.treasure-altar-stage { position:relative; padding:14px clamp(10px,2.8vw,34px) 28px; border:1px solid rgba(218,186,117,.24); background:linear-gradient(180deg,rgba(13,14,24,.73),rgba(10,12,18,.92)); box-shadow:0 24px 60px rgba(0,0,0,.25); }
.treasure-altar-stage::before,.treasure-altar-stage::after { content:""; position:absolute; width:36px; height:36px; border-color:#d4b36f; border-style:solid; opacity:.85; }
.treasure-altar-stage::before { top:-1px; left:-1px; border-width:2px 0 0 2px; }.treasure-altar-stage::after { right:-1px; bottom:-1px; border-width:0 2px 2px 0; }
.stage-heading { display:flex; align-items:center; gap:16px; margin:0 auto 17px; color:#e7cd8d; font-family:var(--font-title); font-size:12px; font-weight:900; letter-spacing:.12em; }
.stage-heading i { flex:1; height:1px; background:linear-gradient(90deg,rgba(216,186,119,.45),transparent); }.stage-heading small { color:#a9a19b; font-family:var(--font-body); font-size:10px; font-weight:600; letter-spacing:.04em; }
.gacha-grid { position:relative; gap:clamp(12px,2vw,26px); }
.gacha-card { min-height:238px; grid-template-columns:minmax(0,1fr) 180px; padding:clamp(17px,2.3vw,30px); border:1px solid rgba(195,174,129,.4); border-radius:3px; background:linear-gradient(115deg,rgba(14,15,23,.97),rgba(24,21,31,.92)); box-shadow:0 16px 40px rgba(0,0,0,.36),inset 0 0 45px rgba(160,150,207,.035); }
.gacha-card::after { content:""; position:absolute; inset:6px; border:1px solid rgba(215,190,139,.11); pointer-events:none; }
.gacha-card:hover { transform:translateY(-3px); box-shadow:0 18px 42px rgba(0,0,0,.48),0 0 26px rgba(214,182,111,.13); }
.gacha-card[data-pool-card="LINH_THACH"] { border-top:2px solid #78b7a2; }.gacha-card[data-pool-card="TIEN_THIEN_THACH"] { border-top:2px solid #d9b66c; }
.gacha-card-header { align-self:center; }.gacha-tag { border-radius:2px; }.gacha-title { font-size:clamp(17px,2vw,25px); letter-spacing:.035em; }.gacha-desc { font-size:12px; }
.gacha-altar { width:min(100%,180px); aspect-ratio:1.18; border-radius:2px; box-shadow:0 0 30px rgba(209,169,84,.2); }
.gacha-altar::before { inset:5px; border-radius:0; }.gacha-altar::after { inset:-7px; border-radius:0; }
.gacha-altar img { border-radius:0; filter:saturate(1.12) contrast(1.06) drop-shadow(0 0 18px rgba(219,183,94,.38)); }
.altar-seal { width:35px;height:35px; border-radius:50%; background:rgba(10,12,18,.84); box-shadow:0 0 22px rgba(239,205,120,.6); }
.pool-jackpot { border:1px solid rgba(117,183,155,.19); border-radius:2px; background:linear-gradient(90deg,rgba(75,135,106,.1),rgba(0,0,0,.18)); }
.premium-jackpot { border-color:rgba(218,181,99,.22); background:linear-gradient(90deg,rgba(160,120,49,.12),rgba(0,0,0,.18)); }
.btn-gacha { position:relative; z-index:2; min-height:46px; border-radius:2px; text-transform:uppercase; letter-spacing:.025em; box-shadow:inset 0 1px rgba(255,255,255,.09),0 6px 14px rgba(0,0,0,.22); }
.gacha-history { border-radius:3px; background:rgba(12,14,21,.9); box-shadow:0 16px 38px rgba(0,0,0,.24); }
.gacha-history-row { border-radius:2px; background:rgba(18,20,28,.76); }
.gacha-results { border-radius:3px; background:linear-gradient(145deg,rgba(15,15,24,.98),rgba(29,24,35,.98)); }
@media(max-width:780px) { .treasure-scene{height:780px}.treasure-hero{margin-top:0}.stage-heading{flex-wrap:wrap;gap:8px}.stage-heading i{min-width:30px}.stage-heading small{width:100%;padding-left:2px}.gacha-card{grid-template-columns:minmax(0,1fr) 130px}.gacha-altar{width:130px} }
@media(max-width:420px) { .tambao-world{padding-inline:8px}.treasure-hero{gap:2px}.treasure-hero-art{opacity:.7}.treasure-wallet{max-width:260px}.treasure-altar-stage{padding:12px 8px 18px}.gacha-card{grid-template-columns:minmax(0,1fr) 88px;min-height:205px}.gacha-altar{width:88px}.stage-heading{font-size:10px}.scene-moon{top:96px;width:110px;height:110px;left:calc(50% - 55px)} }
@media(prefers-reduced-motion:reduce) { .scene-moon,.scene-particle{animation:none!important}.scene-particle{display:none} }

/* Shared game-wide visual language: immersive cultivation HUD and artifact panels. */
:root { --world-ink:#090d12; --world-panel:rgba(18,24,25,.94); --world-jade:#79c7a4; --world-gold:#dec17d; --world-line:rgba(205,184,132,.23); }
body { background-color:#090d12; background-image:radial-gradient(ellipse at 50% -10%,rgba(45,83,70,.2),transparent 46%),linear-gradient(180deg,#0a1113,#090d12 46%,#0a0d12); }
#particleCanvas { opacity:.23; }
.app-layout { background:transparent; }
.app-header { position:sticky; top:0; z-index:500; border-bottom:1px solid rgba(206,184,128,.24); background:linear-gradient(100deg,rgba(12,20,20,.97),rgba(16,20,24,.96)); box-shadow:0 8px 28px rgba(0,0,0,.28); backdrop-filter:blur(16px); }
.brand-icon { filter:drop-shadow(0 0 10px rgba(230,189,98,.5)); }
.brand-title { color:#ecd9a8; letter-spacing:.09em; text-shadow:0 0 18px rgba(212,174,97,.16); }
.brand-sub { color:#8eab9b; letter-spacing:.19em; }
.avatar-box { border:1px solid rgba(218,187,111,.75); box-shadow:0 0 0 3px rgba(218,187,111,.08),0 0 19px rgba(95,188,145,.16); }
.realm-ring { border-color:rgba(131,212,173,.65); }
.player-name { color:#f0e5cb; }.realm-badge,.class-tag { border:1px solid rgba(207,181,116,.24); background:rgba(164,128,57,.13); color:#e2c982; }
.exp-bar-container { border:1px solid rgba(120,199,159,.2); background:rgba(2,8,9,.75); }.exp-bar-fill { background:linear-gradient(90deg,#367a5a,#8ad7ad,#d5d28a); box-shadow:0 0 12px rgba(100,206,149,.4); }
.currency-badge { border:1px solid rgba(203,181,126,.19); background:linear-gradient(135deg,rgba(25,35,32,.94),rgba(14,21,22,.94)); box-shadow:inset 0 1px rgba(255,255,255,.03); }
.currency-badge .curr-val { color:#f1e1bd; font-variant-numeric:tabular-nums; }
.btn-icon { border:1px solid rgba(208,184,127,.18); background:rgba(25,33,31,.74); }
.app-nav { z-index:450; border-bottom:1px solid rgba(202,182,131,.23); background:rgba(13,19,20,.94); box-shadow:0 8px 24px rgba(0,0,0,.2); backdrop-filter:blur(14px); scrollbar-color:rgba(127,177,146,.42) transparent; }
.nav-item { position:relative; border-radius:3px; color:#a9b3aa; transition:color .18s,background .18s,transform .18s; }
.nav-item:hover { color:#e7d6a8; background:rgba(117,150,117,.1); transform:translateY(-1px); }
.nav-item.active { color:#f0d48e; background:linear-gradient(180deg,rgba(139,111,52,.16),rgba(71,100,74,.12)); }
.nav-item.active::after { content:""; position:absolute; left:16%; right:16%; bottom:0; height:2px; background:linear-gradient(90deg,transparent,#e0bd6e,transparent); box-shadow:0 0 11px rgba(227,191,104,.48); }
.app-main { width:min(1600px,100%); margin:0 auto; padding:clamp(12px,2vw,28px); }
.tab-pane.active { animation:realmEntry .28s ease-out both; }
@keyframes realmEntry { from{opacity:.45;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }
.card,.activity-hub,.activity-card,.boss-card,.ranking-card,.bicanh-card,.shop-card,.tongmon-card,.nhiemvu-card,.garden-card,.alchemy-card,.linhthu-active-card,.linhthu-vault-card,.paper-doll-card,.equipment-forge-card,.kynang-equipped-card,.kynang-library-card,.dihoa-active-card,.dihoa-vault-card,.dtd-profile-card,.dtd-opponents-card,.vuotai-map-card,.vuotai-arena-card { border:1px solid var(--world-line); border-radius:5px; background:linear-gradient(145deg,rgba(21,30,29,.96),rgba(14,20,22,.97)); box-shadow:0 14px 34px rgba(0,0,0,.2),inset 0 1px rgba(255,255,255,.025); }
.card:hover { border-color:rgba(199,181,130,.34); }
.card-title,.section-title,.tab-title { color:#e8d7ad; letter-spacing:.035em; }
.card-header,.section-header { border-color:rgba(203,183,133,.14); }
.btn { border-radius:4px; transition:transform .16s ease,filter .16s ease,box-shadow .16s ease; }
.btn:not(:disabled):hover { transform:translateY(-1px); filter:brightness(1.1); }
.btn-primary { border:1px solid rgba(128,207,164,.39); background:linear-gradient(135deg,#317a59,#24543f); box-shadow:inset 0 1px rgba(255,255,255,.1),0 5px 16px rgba(20,80,53,.17); }
.btn-secondary { border:1px solid rgba(205,184,132,.22); background:linear-gradient(135deg,rgba(43,56,50,.96),rgba(27,38,36,.96)); }
.btn-danger { border-color:rgba(207,101,81,.4); background:linear-gradient(135deg,#8c4237,#582e2e); }
.form-input,.form-select,input,select,textarea { border-color:rgba(193,180,144,.22); background-color:rgba(8,14,15,.78); color:#e9e2d2; }
.form-input:focus,.form-select:focus,input:focus,select:focus,textarea:focus { border-color:rgba(120,200,159,.7); box-shadow:0 0 0 3px rgba(96,179,134,.12); }
.inv-slot,.slot-item,.shop-item-card,.flame-card,.skill-card,.equipment-card,.item-card { border:1px solid rgba(199,181,134,.17); border-radius:4px; background:linear-gradient(145deg,rgba(28,39,37,.98),rgba(15,23,24,.98)); }
.inv-slot:hover,.slot-item:hover,.slot-item.active,.shop-item-card:hover,.flame-card:hover,.skill-card:hover,.equipment-card:hover,.item-card:hover { border-color:rgba(117,204,157,.54); box-shadow:0 0 18px rgba(93,182,130,.11); }
.activity-hub { position:relative; overflow:hidden; background:radial-gradient(ellipse at 90% 0%,rgba(188,153,79,.13),transparent 35%),linear-gradient(140deg,rgba(29,39,34,.97),rgba(14,20,22,.98)); }
.activity-hub::after { content:""; position:absolute; inset:7px; border:1px solid rgba(219,191,129,.09); pointer-events:none; }
.activity-card { border-radius:4px; background:linear-gradient(110deg,rgba(28,43,37,.96),rgba(20,28,28,.96)); }
.activity-card:hover { border-color:rgba(222,192,123,.52); box-shadow:0 8px 22px rgba(0,0,0,.2),0 0 18px rgba(201,168,99,.09); }
.activity-live i { box-shadow:0 0 9px currentColor; }
.modal-overlay { backdrop-filter:blur(8px); background:rgba(3,7,8,.79); }
.modal-card { border:1px solid rgba(216,187,117,.47); border-radius:5px; background:linear-gradient(145deg,rgba(24,34,31,.99),rgba(12,18,20,.995)); box-shadow:0 28px 90px rgba(0,0,0,.62),inset 0 0 30px rgba(199,164,91,.04); }
.modal-title { color:#edd9a9; }
.toast { border-radius:4px; box-shadow:0 8px 24px rgba(0,0,0,.28); }
.tab-pane h2,.tab-pane h3 { text-wrap:balance; }
::selection { color:#0c1712; background:#a3d9b6; }
@media(max-width:760px) { .app-header{position:sticky}.app-main{padding:12px 10px}.app-nav{box-shadow:0 5px 18px rgba(0,0,0,.24)}.currency-badge{border-radius:4px}.card{border-radius:4px} }
@media(prefers-reduced-motion:reduce) { .tab-pane.active{animation:none} }
.battle-beast-companion { position:absolute; z-index:3; left:26%; bottom:36px; display:flex; flex-direction:column; align-items:center; width:clamp(68px,10vw,112px); color:#d7edbe; font-size:10px; font-weight:900; text-align:center; text-shadow:0 2px 5px #050807; filter:drop-shadow(0 0 14px rgba(116,205,150,.38)); animation:beastHover 2.8s ease-in-out infinite; }
.battle-beast-companion.hidden { display:none; }.battle-beast-companion img { width:100%; height:clamp(62px,9vw,100px); object-fit:contain; }.battle-beast-companion span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.enemy-beast-companion { left:auto; right:26%; color:#f0c9a5; filter:drop-shadow(0 0 14px rgba(230,117,85,.38)); animation-delay:-1.1s; }
@keyframes beastHover { 50% { transform:translateY(-6px) scale(1.03); } }
.bicanh-mode-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; width:min(900px,100%); margin:0 auto; }
.bicanh-mode-card { display:grid; grid-template-columns:48px minmax(0,1fr); align-items:center; gap:5px 12px; padding:18px; border:1px solid rgba(199,181,134,.32); background:linear-gradient(145deg,rgba(24,38,34,.94),rgba(13,20,22,.97)); box-shadow:0 14px 32px rgba(0,0,0,.22); }
.bicanh-mode-card b { display:block; color:#ead8a9; font-family:var(--font-title); font-size:13px; letter-spacing:.05em; }.bicanh-mode-card small { display:block; margin-top:5px; color:#adb4a8; font-size:11px; line-height:1.5; }.mode-emblem { grid-row:span 2; display:grid; place-items:center; width:45px;height:45px; border:1px solid rgba(220,190,120,.32); border-radius:50%; background:radial-gradient(circle,rgba(212,181,100,.2),rgba(0,0,0,.2)); font-size:23px; }.bicanh-mode-card .btn { grid-column:1/-1; width:100%; margin-top:10px; }
.normal-mode { border-top:2px solid #d0a956; }.advanced-mode { border-top:2px solid #ac7fe0; background:linear-gradient(145deg,rgba(40,29,47,.94),rgba(15,18,25,.97)); }.advanced-mode .mode-emblem { border-color:rgba(173,129,218,.44); box-shadow:0 0 20px rgba(143,94,198,.14); }
.linhthu-layout { align-items:stretch; }.linhthu-active-card { min-height:300px; background:radial-gradient(ellipse at 50% 32%,rgba(83,142,107,.18),transparent 50%),linear-gradient(145deg,rgba(23,38,31,.98),rgba(13,20,21,.98)); }.linhthu-display { display:grid; justify-items:center; align-content:center; min-height:240px; text-align:center; }.beast-active-img { width:clamp(116px,15vw,180px); height:clamp(116px,15vw,180px); border:1px solid rgba(208,184,116,.48); border-radius:50%; padding:10px; background:radial-gradient(circle,rgba(170,198,133,.19),rgba(8,14,13,.72)); box-shadow:0 0 0 7px rgba(208,184,116,.045),0 0 34px rgba(109,191,132,.18); animation:beastHover 3s ease-in-out infinite; }.beasts-grid { align-items:stretch; }.beasts-grid .opponent-card { min-height:190px; border-radius:4px; background:linear-gradient(145deg,rgba(26,39,34,.97),rgba(13,19,21,.98)); }.beasts-grid .beast-img { width:90px;height:90px; object-fit:contain; filter:drop-shadow(0 4px 14px rgba(112,202,147,.25)); }
.ranking-list:empty::before { content:"Đang truyền dữ liệu Thiên Bảng…"; display:block; padding:26px; color:#aeb7aa; text-align:center; }.ranking-card .rank-tab-buttons { display:flex; flex-wrap:wrap; gap:8px; }
@media(max-width:680px) { .bicanh-mode-grid { grid-template-columns:1fr; gap:10px; }.battle-beast-companion { left:17%;bottom:29px;width:62px; }.enemy-beast-companion { left:auto;right:17%; }.beasts-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.ranking-card .card-header { align-items:flex-start;gap:12px;flex-direction:column; } }
@media(prefers-reduced-motion:reduce) { .battle-beast-companion,.beast-active-img{animation:none} }
/* Rebuilt game shell: persistent cultivation HUD, expedition sidebar, full-size realm view. */
@media(min-width:1101px) {
  .app-layout { display:grid; grid-template-columns:236px minmax(0,1fr); grid-template-rows:auto minmax(calc(100vh - 76px),1fr); align-items:stretch; }
  .app-header { grid-column:1/-1; grid-row:1; min-height:76px; padding:9px clamp(16px,2vw,30px); }
  .app-nav { grid-column:1; grid-row:2; position:sticky; top:76px; align-self:start; display:flex; flex-direction:column; width:236px; height:calc(100vh - 76px); padding:18px 12px 24px; overflow-x:hidden; overflow-y:auto; border-right:1px solid rgba(204,184,132,.22); border-bottom:0; }
  .nav-item { display:flex; align-items:center; justify-content:flex-start; gap:12px; flex:0 0 auto; min-height:47px; padding:0 14px; text-align:left; }
  .nav-item .nav-icon { width:25px; text-align:center; font-size:17px; }
  .nav-item .nav-label { font-size:12px; white-space:nowrap; }
  .nav-item.active::after { left:0; top:20%; right:auto; bottom:20%; width:2px; height:auto; background:linear-gradient(180deg,transparent,#e0bd6e,transparent); }
  .nav-item:nth-child(1),.nav-item:nth-child(6),.nav-item:nth-child(8),.nav-item:nth-child(12),.nav-item:nth-child(15) { margin-top:13px; border-top:1px solid rgba(202,182,131,.12); padding-top:8px; }
  .app-main { grid-column:2; grid-row:2; width:100%; min-width:0; max-width:none; padding:clamp(16px,2vw,32px); }
  .tab-pane.active { min-height:calc(100vh - 116px); }
}
.app-header { display:grid; grid-template-columns:minmax(165px,.8fr) minmax(260px,1.2fr) auto; }
.header-right { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; }
.header-center { min-width:0; justify-self:center; }.player-name-row { flex-wrap:wrap; }
.card { position:relative; overflow:hidden; }
.card::before { content:""; position:absolute; top:0; left:14px; right:14px; height:1px; background:linear-gradient(90deg,transparent,rgba(214,191,131,.24),transparent); pointer-events:none; }
.card-title { font-family:var(--font-title); }
.activity-hub { padding:clamp(18px,2.4vw,34px); }
.activity-hub-heading h2 { font-family:var(--font-title); color:#f0e1bf; }
.tab-pane > :first-child:not(.tambao-world) { width:min(1380px,100%); margin-inline:auto; }
.tab-pane:not(#tab-tambao) .card { animation:cardArrival .34s ease-out both; }
.tab-pane:not(#tab-tambao) .card:nth-child(2) { animation-delay:35ms; }
.tab-pane:not(#tab-tambao) .card:nth-child(3) { animation-delay:70ms; }
@keyframes cardArrival { from{opacity:.6;transform:translateY(7px)} to{opacity:1;transform:translateY(0)} }
.dtd-profile-card,.bicanh-lobby,.boss-card,.ranking-card { padding:clamp(16px,2vw,28px); }
.ranking-list .card { background:linear-gradient(100deg,rgba(28,42,36,.98),rgba(15,22,24,.98)); }
.inventory-grid,.shop-items-grid,.beasts-grid,.stages-grid { gap:12px; }
.inventory-grid > *, .shop-items-grid > *, .beasts-grid > *, .stages-grid > * { min-width:0; }
@media(max-width:1100px) {
  .app-layout { display:flex; flex-direction:column; }
  .app-header { display:flex; }
  .app-nav { position:sticky; top:0; width:100%; height:auto; flex-direction:row; }
  .nav-item { justify-content:center; }
  .app-main { width:100%; }
}
@media(max-width:760px) { .app-header { display:flex; flex-wrap:wrap; justify-content:space-between; }.header-center { order:3; flex:1 1 100%; justify-self:stretch; }.header-right { margin-left:auto; }.brand-sub { display:none; } }
@media(prefers-reduced-motion:reduce) { .tab-pane:not(#tab-tambao) .card{animation:none} }
@keyframes bossImpact { 20% { transform: translateX(-8px) scale(1.025); filter: brightness(1.55) drop-shadow(0 0 32px rgba(238,95,56,.85)); } 55% { transform: translateX(7px); } }

@media (max-width: 1000px) {
  .activity-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-nav { top: 60px; }
}
@media (max-width: 640px) {
  .app-nav { top: 0; }
  .activity-hub { padding: 16px 13px; margin-bottom: 13px; }
  .activity-hub-heading { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .activity-hub-heading h2 { font-size: 17px; }
  .activity-hub-grid { gap: 7px; }
  .activity-card { gap: 8px; padding: 10px 8px; border-radius: 12px; }
  .activity-symbol { width: 33px; height: 33px; flex-basis: 33px; font-size: 17px; }
  .activity-copy strong { font-size: 11px; }
  .activity-copy small { font-size: 9px; }
  .activity-arrow { display: none; }
  .arena-battlefield { min-height: 258px; border-radius: 12px; }
  .battle-actor { width: 40%; min-height: 230px; }
  .battle-actor img { height: 192px; }
  .enemy-spirit { width: 120px; height: 180px; font-size: 82px; }
  .actor-aura { width: 125px; height: 116px; }
  .actor-ground-seal { width: 120px; }
  .battle-center-seal { width: 42px; height: 42px; font-size: 19px; }
  .battle-actor-player { transform: translateX(5px); }
  .battle-actor-enemy { transform: translateX(-5px); }
  @keyframes playerLunge { 38% { transform: translateX(35px) translateY(-5px) scale(1.035); filter: brightness(1.28); } 100% { transform: translateX(5px); } }
  @keyframes enemyLunge { 38% { transform: translateX(-35px) translateY(-5px) scale(1.035); filter: brightness(1.32); } 100% { transform: translateX(-5px); } }
  .combat-status-row { grid-template-columns: minmax(0,1fr) 38px minmax(0,1fr); gap: 6px; }
  .combat-unit-status { padding: 8px 7px; }
  .combat-unit-label { flex-direction: column; gap: 3px; font-size: 8px; }
  .combat-unit-label strong { font-size: 9px; }
  .combat-round-indicator { width: 34px; height: 34px; }
  .arena-logs-box { max-height: 190px; font-size: 11px; }
  .battle-overlay-mode { inset: 7px 7px auto; width: auto; max-height: calc(100dvh - 14px); transform: none; padding: 13px; border-radius: 15px; }
  @keyframes battleModalEnter { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
  .battle-overlay-mode .arena-battlefield { min-height: 238px; }
  .battle-overlay-mode .battle-actor { min-height: 210px; }
  .battle-overlay-mode .battle-actor img { height: 178px; }
  .battle-overlay-mode .enemy-spirit { height: 165px; }
}

@media (prefers-reduced-motion: reduce) {
  .battlefield-mist, .actor-aura, .activity-live i { animation: none !important; }
  .battle-actor.is-attacking, .battle-actor.is-hit, .actor-damage.is-visible, .battle-flash.is-active { animation: none !important; }
  .battle-overlay-mode { animation: none !important; }
}
