/* ======================================================== */
/* Aurora Blade - Classic Anime Browser MMORPG Stylesheet    */
/* ======================================================== */

:root {
  --bg-dark: #0a0e17;
  --bg-card: #121824;
  --bg-card-hover: #1a2233;
  --border-gold: #c5a059;
  --border-gold-glow: #f1c40f;
  --text-primary: #ecf0f1;
  --text-muted: #8c9ba5;
  --text-gold: #f39c12;
  --text-cyan: #00e5ff;
  --text-pink: #ff6584;
  --hp-red: #e74c3c;
  --mp-blue: #3498db;
  --exp-green: #2ecc71;
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Nunito', sans-serif;
  --shadow-gold: 0 0 15px rgba(241, 196, 15, 0.35);
  --shadow-crimson: 0 0 15px rgba(231, 76, 60, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(30, 58, 95, 0.4) 0%, transparent 70%),
    radial-gradient(circle at 80% 80%, rgba(70, 20, 60, 0.25) 0%, transparent 60%);
}

body,
body * {
  color: var(--text-primary);
}

#game-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  border-left: 2px solid #1a2333;
  border-right: 2px solid #1a2333;
}

/* ======================================================== */
/* AUTH & LOGIN SCREEN                                      */
/* ======================================================== */

.auth-overlay-container {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.95);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 480px;
  max-width: 95vw;
  background: linear-gradient(180deg, #151f30 0%, #0d1421 100%);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), var(--shadow-gold);
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid #23344d;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-family: var(--font-serif);
  font-weight: 700;
  cursor: pointer;
  color: #8c9ba5;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.auth-tab.active {
  color: #f1c40f;
  border-bottom-color: #f1c40f;
}

.auth-form .form-group {
  margin-bottom: 14px;
}

/* ======================================================== */
/* TOP HEADER & HUD                                         */
/* ======================================================== */

#game-header {
  background: linear-gradient(180deg, #161f30 0%, #0d131f 100%);
  border-bottom: 2px solid var(--border-gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.game-logo {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff 0%, #f1c40f 50%, #c5a059 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 8px rgba(241, 196, 15, 0.3);
}

.logo-sub {
  font-size: 0.65rem;
  letter-spacing: 3px;
  color: #a0b2c6;
  font-weight: 700;
}

.player-hud-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 15, 25, 0.75);
  border: 1px solid #2a3b5c;
  border-radius: 8px;
  padding: 6px 14px;
}

.hud-avatar-box {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #1b263b;
  border: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.character-sprite-hud {
  width: 72%;
  height: 72%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  image-rendering: pixelated !important;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.75));
  transition: transform 0.2s ease;
}

.hud-avatar-box:hover .character-sprite-hud {
  transform: scale(1.15) rotate(6deg);
}

.hud-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 260px;
}

.hud-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.hud-name {
  font-weight: 800;
  color: #fff;
}

.hud-level-badge {
  background: #27ae60;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.hud-rebirth-badge {
  background: linear-gradient(135deg, #e67e22, #e74c3c);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulse-rebirth 2s infinite ease-in-out;
}

@keyframes pulse-rebirth {
  0%, 100% { box-shadow: 0 0 4px #e74c3c; }
  50% { box-shadow: 0 0 12px #f39c12; }
}



.town-sanctuary-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 14px;
  background: rgba(39, 174, 96, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: 8px;
  color: #a3e9b8;
  font-size: 0.85rem;
}

.town-sanctuary-status .sanctuary-icon {
  font-size: 1.2rem;
}

.hud-bar-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
}

.hud-bar-label {
  width: 24px;
  font-weight: 800;
  color: #a0b2c6;
}

.hud-bar-track {
  position: relative;
  flex: 1;
  height: 12px;
  background: #080c14;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #202b3d;
}

.hud-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.hp-fill {
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.mp-fill {
  background: linear-gradient(90deg, #2980b9, #3498db);
}

.exp-fill {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.hud-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
  color: #fff;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.online-players-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a7f3d0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.12);
  transition: all 0.2s ease;
  user-select: none;
}

.online-players-pill:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.online-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: onlinePulse 2s infinite ease-in-out;
}

@keyframes onlinePulse {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 4px #10b981;
  }
  50% {
    transform: scale(1.25);
    box-shadow: 0 0 10px #34d399, 0 0 16px rgba(52, 211, 153, 0.5);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 4px #10b981;
  }
}

.online-label {
  color: #6ee7b7;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.online-count {
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
}

.currencies-box {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.gold-item {
  color: #f1c40f;
}

.diamond-item {
  color: #00e5ff;
}

.marriage-pill {
  background: rgba(255, 105, 180, 0.15);
  border: 1px solid #ff6584;
  color: #ff9bbb;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
}

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

/* ======================================================== */
/* NAVIGATION RIBBON                                        */
/* ======================================================== */

#game-nav-ribbon {
  background: #0e1522;
  border-bottom: 1px solid #1f2c42;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 12px;
  flex-shrink: 0;
}

.nav-left, .nav-right {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-tab-btn {
  background: #151f30;
  border: 1px solid #2a3c58;
  color: #b0c4de;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-tab-btn:hover {
  background: #1e2c45;
  color: #fff;
}

.nav-tab-btn.active {
  background: linear-gradient(180deg, #243552 0%, #152238 100%);
  border-color: var(--border-gold);
  color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.2);
}

.nav-action-btn {
  background: #162033;
  border: 1px solid #23334d;
  color: #d1d9e6;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.nav-action-btn:hover {
  background: #22324f;
  border-color: var(--border-gold);
  color: #fff;
  transform: translateY(-1px);
}

kbd {
  background: #090e17;
  border: 1px solid #32435e;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.65rem;
  color: #9ab;
}

/* ======================================================== */
/* MAIN VIEWPORT                                            */
/* ======================================================== */

#game-main-viewport {
  flex: 1;
  position: relative;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
}

.hidden {
  display: none !important;
}

/* TOWN VIEW */
.town-banner {
  background: linear-gradient(135deg, rgba(20, 35, 60, 0.8) 0%, rgba(10, 20, 35, 0.9) 100%);
  border: 1px solid #2d4163;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.town-banner h2 {
  font-family: var(--font-serif);
  color: #f1c40f;
  font-size: 1.6rem;
  letter-spacing: 1px;
}

.town-banner p {
  color: #a0b2c6;
  font-size: 0.9rem;
  margin-top: 4px;
}

.town-landmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.landmark-card {
  background: linear-gradient(180deg, #151f31 0%, #0e1624 100%);
  border: 1px solid #263854;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.landmark-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-gold);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(241, 196, 15, 0.2);
}

.landmark-card.landmark-danger {
  border-color: #801818;
}

.landmark-card.landmark-danger:hover {
  border-color: #e74c3c;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(231, 76, 60, 0.35);
}

.landmark-icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.landmark-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 6px;
}

.landmark-sub {
  font-size: 0.8rem;
  color: #8c9ba5;
  margin-bottom: 14px;
  flex: 1;
}

/* ======================================================== */
/* COMBAT VIEW                                             */
/* ======================================================== */

.combat-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111a29;
  border: 1px solid #23344d;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 25;
}

.zone-selector {
  background: #090e17;
  color: #f1c40f;
  border: 1px solid #334766;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 8px;
}

.combat-controls-group {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 26;
}

.combat-arena {
  flex: 1;
  min-height: 380px;
  border-radius: 12px;
  border: 2px solid #2d4163;
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  padding: 16px 20px;
}

.combatant-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

/* Combat Player Stage & Circular Equipment Placeholders */
.combat-player-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  margin-bottom: 6px;
}

.combat-equip-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.combat-equip-row.row-top {
  margin-bottom: 0px;
}

.combat-equip-row.row-mid {
  gap: 12px;
}

.combat-equip-row.row-bot {
  margin-top: 0px;
  gap: 16px;
}

.combat-equip-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(13, 20, 33, 0.9);
  border: 3px dashed #2a3d5c;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  user-select: none;
}

.combat-equip-circle.equipped {
  border-style: solid;
  border-color: #3b5379;
  background: radial-gradient(circle, rgba(25, 38, 59, 0.95) 0%, rgba(10, 16, 26, 0.98) 100%);
}

.combat-equip-circle:hover {
  transform: scale(1.08);
  border-color: var(--border-gold);
  box-shadow: 0 0 16px rgba(241, 196, 15, 0.6);
}

.combat-equip-circle .slot-placeholder-icon {
  font-size: 2.2rem;
  opacity: 0.38;
  filter: grayscale(70%);
  transition: opacity 0.2s ease;
}

.combat-equip-circle:hover .slot-placeholder-icon {
  opacity: 0.75;
}

.combat-equip-circle .equip-item-sprite {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.85));
}

.combat-equip-circle .circle-refine-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: #090e17;
  border: 1px solid #c5a059;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  z-index: 2;
}

/* Refinement glow tiers on equipment circle placeholders */
.glow-refine-bronze {
  border-color: #c5a059 !important;
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.75), inset 0 0 6px rgba(197, 160, 89, 0.3) !important;
}

.glow-refine-silver {
  border-color: #64c8ff !important;
  box-shadow: 0 0 14px rgba(100, 200, 255, 0.8), inset 0 0 8px rgba(100, 200, 255, 0.35) !important;
}

.combat-player-class {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #38bdf8;
  margin: 1px 0 3px 0;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.combat-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 32, 50, 0.95) 0%, rgba(10, 16, 26, 0.98) 100%);
  border: 3px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 12px rgba(197, 160, 89, 0.2);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.combat-avatar:hover {
  transform: scale(1.08);
  border-color: #f1c40f;
  box-shadow: 0 0 25px rgba(241, 196, 15, 0.4), inset 0 0 16px rgba(241, 196, 15, 0.3);
}

.combatant-label {
  text-align: center;
  background: rgba(9, 14, 23, 0.85);
  border: 1px solid #293d5c;
  padding: 6px 12px;
  border-radius: 8px;
  min-width: 140px;
}

.enemy-hp-bar-track {
  width: 100%;
  height: 8px;
  background: #080c14;
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0;
  border: 1px solid #331515;
}

.enemy-hp-fill {
  height: 100%;
  background: #e74c3c;
  transition: width 0.25s ease;
}

.enemy-hp-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: #ccc;
}

.player-hp-bar-track {
  width: 100%;
  height: 8px;
  background: #080c14;
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0;
  border: 1px solid #1a3320;
}

.player-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  transition: width 0.25s ease;
}

.player-hp-fill.hp-depleted,
.hud-bar-fill.hp-fill.hp-depleted {
  background: #7f1d1d !important;
}

.player-hp-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: #a8e6cf;
}

.shake-player {
  animation: playerDamageShake 0.4s ease;
}

@keyframes playerDamageShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) scale(0.95); filter: brightness(1.8) drop-shadow(0 0 10px #e74c3c); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

.combat-avatar-dead {
  filter: grayscale(100%) brightness(0.7) drop-shadow(0 0 15px rgba(231, 76, 60, 0.8)) !important;
  border-color: #e74c3c !important;
  transform: rotate(-15deg);
  animation: deadPulse 2s infinite ease-in-out;
}

@keyframes deadPulse {
  0%, 100% { transform: rotate(-15deg) scale(1); }
  50% { transform: rotate(-15deg) scale(1.05); filter: grayscale(100%) brightness(0.8) drop-shadow(0 0 25px rgba(255, 71, 87, 0.9)); }
}

.character-sprite-combat {
  width: 54px;
  height: 54px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  image-rendering: pixelated !important;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.75));
  transition: transform 0.15s ease-out;
}

/* COMBAT AVATAR ANIMATIONS (ATTACKING & HURT / DAMAGE) */
.combat-avatar.attacking,
#combat-player-avatar.attacking,
.character-sprite-combat.attacking {
  animation: playerCombatSlash 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
}

.combat-avatar.hurt,
#combat-player-avatar.hurt,
.combat-avatar.shake-player,
#combat-player-avatar.shake-player,
.character-sprite-combat.hurt {
  animation: playerCombatHurt 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;
}

.character-sprite-fallen {
  filter: grayscale(80%) drop-shadow(0 0 10px rgba(231, 76, 60, 0.8));
}

@keyframes playerCombatSlash {
  0% {
    transform: translateX(0) scale(1) rotate(0deg);
  }
  35% {
    transform: translateX(28px) scale(1.24) rotate(12deg);
    filter: brightness(1.4) drop-shadow(0 0 16px rgba(241, 196, 15, 0.85));
    border-color: #f1c40f;
  }
  65% {
    transform: translateX(14px) scale(1.1) rotate(4deg);
  }
  100% {
    transform: translateX(0) scale(1) rotate(0deg);
  }
}

@keyframes playerCombatHurt {
  0% {
    transform: translateX(0) scale(1);
    filter: none;
  }
  20% {
    transform: translateX(-16px) scale(0.92) rotate(-12deg);
    filter: brightness(1.8) drop-shadow(0 0 18px rgba(231, 76, 60, 0.95));
    border-color: #e74c3c;
  }
  45% {
    transform: translateX(10px) rotate(6deg);
    filter: brightness(1.2);
  }
  70% {
    transform: translateX(-6px) rotate(-3deg);
  }
  100% {
    transform: translateX(0) scale(1) rotate(0deg);
    filter: none;
  }
}

/* ENEMY COMBAT ANIMATIONS */
.enemy-avatar.attacking,
#combat-enemy-avatar.attacking {
  animation: enemyCombatSlash 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
}

.enemy-avatar.hurt,
#combat-enemy-avatar.hurt,
.enemy-avatar.shake-enemy,
#combat-enemy-avatar.shake-enemy {
  animation: enemyCombatHurt 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;
}

@keyframes enemyCombatSlash {
  0% { transform: translateX(0) scale(1) rotate(0deg); }
  35% { transform: translateX(-28px) scale(1.24) rotate(-12deg); filter: brightness(1.4) drop-shadow(0 0 16px rgba(231, 76, 60, 0.85)); border-color: #e74c3c; }
  65% { transform: translateX(-14px) scale(1.1) rotate(-4deg); }
  100% { transform: translateX(0) scale(1) rotate(0deg); }
}

@keyframes enemyCombatHurt {
  0% { transform: translateX(0) scale(1); filter: none; }
  20% { transform: translateX(16px) scale(0.92) rotate(12deg); filter: brightness(1.8) drop-shadow(0 0 18px rgba(241, 196, 15, 0.95)); border-color: #f1c40f; }
  45% { transform: translateX(-10px) rotate(-6deg); filter: brightness(1.2); }
  70% { transform: translateX(6px) rotate(3deg); }
  100% { transform: translateX(0) scale(1) rotate(0deg); filter: none; }
}

/* ======================================================== */
/* DEATH / DEFEAT SCREEN STYLES                             */
/* ======================================================== */

dialog.death-dialog::backdrop {
  background: radial-gradient(circle at center, rgba(90, 10, 10, 0.85) 0%, rgba(10, 2, 2, 0.97) 100%) !important;
  animation: deathFadeIn 0.8s ease forwards;
}

.death-modal-content {
  background: linear-gradient(180deg, #2c0e0e 0%, #150505 100%) !important;
  border: 2px solid #e74c3c !important;
  box-shadow: 0 0 50px rgba(231, 76, 60, 0.7), inset 0 0 40px rgba(120, 0, 0, 0.6) !important;
  text-align: center;
}

.death-banner {
  padding: 24px 20px 16px;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid #5a1919;
}

.death-skull {
  font-size: 3.8rem;
  animation: pulseDeathSkull 1.8s infinite ease-in-out;
  margin-bottom: 8px;
}

.death-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  letter-spacing: 5px;
  color: #ff4757;
  text-shadow: 0 0 20px rgba(255, 71, 87, 0.9), 0 0 40px rgba(231, 76, 60, 0.7);
  margin-bottom: 6px;
}

.death-subtitle {
  color: #dcdde1;
  font-size: 0.95rem;
  font-style: italic;
}

.death-body {
  padding: 20px 24px;
}

.death-card {
  background: rgba(10, 0, 0, 0.65);
  border: 1px solid #501919;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 10px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.death-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.death-stat-row .label {
  color: var(--text-muted);
}

.death-hint {
  color: #a4b0be;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.death-footer {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  gap: 14px;
}

@keyframes pulseDeathSkull {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(231,76,60,0.6)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 30px rgba(255,71,87,1)); }
}

@keyframes deathFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Floating combat text */
.combat-center-clash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

.floating-combat-text {
  position: absolute;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.4rem;
  animation: float-up 1.2s forwards ease-out;
  text-shadow: 0 2px 4px #000, 0 0 8px rgba(0,0,0,0.8);
}

.floating-combat-text.damage {
  color: #ff4757;
  top: 40%;
}

.floating-combat-text.crit {
  color: #ffa502;
  font-size: 1.8rem;
  top: 35%;
}

.floating-combat-text.heal {
  color: #2ed573;
  top: 45%;
}

.floating-combat-text.buff {
  color: #1e90ff;
  font-size: 1.1rem;
  top: 30%;
}

.floating-combat-text.mp {
  color: #00d2d3;
  font-size: 1.15rem;
  top: 55%;
}

.floating-combat-text.debuff {
  color: #9b59b6;
  font-size: 1.1rem;
  top: 35%;
}

.floating-combat-text.target-player {
  left: 25%;
}

.floating-combat-text.target-enemy {
  right: 25%;
}

@keyframes float-up {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  20% { transform: translateY(-10px) scale(1.2); opacity: 1; }
  80% { transform: translateY(-40px) scale(1.0); opacity: 0.9; }
  100% { transform: translateY(-60px) scale(0.9); opacity: 0; }
}

/* Action Hotbar */
.combat-hotbar-container {
  margin-top: 10px;
  background: #0d1421;
  border: 1px solid #1f2e44;
  border-radius: 8px;
  padding: 8px 12px;
}

.hotbar-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #7f92a6;
  margin-bottom: 6px;
}

.hotbar-slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.hotbar-slot {
  background: #141f30;
  border: 1px solid #253954;
  border-radius: 6px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  color: #fff;
}

.hotbar-slot:hover {
  border-color: var(--border-gold);
  background: #1c2b42;
}

.hotbar-key {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #f1c40f;
}

.hotbar-icon {
  font-size: 1.1rem;
}

.hotbar-name {
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.hotbar-mp {
  font-size: 0.6rem;
  color: #3498db;
}

.hotbar-empty {
  font-size: 0.75rem;
  color: #556677;
}

.hotbar-slot.on-cooldown {
  opacity: 0.6;
  cursor: not-allowed;
}

.hotbar-slot.slot-casting {
  border-color: #f1c40f !important;
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.9) !important;
  transform: scale(1.06);
}

.cooldown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 900;
  color: #e74c3c;
  border-radius: 6px;
}

.hotbar-slot.no-mana {
  border-color: #8e44ad;
}

/* Combat Log */
.combat-log-container {
  margin-top: 10px;
  background: #090e17;
  border: 1px solid #1a2536;
  border-radius: 6px;
  padding: 8px 12px;
  height: 90px;
  display: flex;
  flex-direction: column;
}

.log-header {
  font-size: 0.65rem;
  font-weight: 800;
  color: #6a7d91;
  margin-bottom: 4px;
}

.log-scroll-area {
  flex: 1;
  overflow-y: auto;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-entry {
  color: #c5d1de;
}

.log-player { color: #5dade2; }
.log-enemy { color: #e74c3c; }
.log-system { color: #f1c40f; font-weight: 700; }
.log-heal { color: #2ecc71; }
.log-warning { color: #e67e22; }

/* ======================================================== */
/* FOOTER CHAT                                              */
/* ======================================================== */

#game-chat-footer {
  background: #0b111a;
  border-top: 1px solid #1c2738;
  height: 120px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-header {
  padding: 4px 12px;
  background: #111a26;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 800;
  color: #8c9ba5;
  border-bottom: 1px solid #1a2433;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scroll-behavior: smooth;
}

.chat-msg {
  line-height: 1.3;
  transition: opacity 0.2s ease;
}

.chat-msg-optimistic {
  opacity: 0.88;
}

.chat-msg-error {
  opacity: 0.65;
  text-decoration: line-through;
  color: #ff6b6b !important;
}

.chat-time {
  color: #556677;
  font-size: 0.7rem;
}

.chat-input-bar {
  display: flex;
  padding: 4px 8px;
  gap: 6px;
  background: #0f1622;
}

.chat-input-bar input {
  flex: 1;
  background: #070b12;
  border: 1px solid #223247;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* ======================================================== */
/* BUTTONS & CONTROLS                                       */
/* ======================================================== */

.btn {
  font-family: var(--font-sans);
  font-weight: 700;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.04s ease, filter 0.04s ease, background 0.08s ease, box-shadow 0.08s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #111111;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  color: #111111;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn:active {
  transform: scale(0.95) translateY(1px) !important;
  filter: brightness(1.22) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(0.5) !important;
  box-shadow: none !important;
}

.btn.btn-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn-primary {
  background: #2980b9;
  color: #fff;
}
.btn-primary:hover { background: #3498db; }

.btn-secondary {
  background: #2c3e50;
  color: #ecf0f1;
}
.btn-secondary:hover { background: #34495e; }

.btn-gold {
  background: linear-gradient(180deg, #f39c12 0%, #d35400 100%);
  color: #fff;
  border: 1px solid #f1c40f;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn-gold:hover {
  box-shadow: 0 0 12px rgba(241, 196, 15, 0.4);
}

.btn-emerald {
  background: #27ae60;
  color: #fff;
}
.btn-emerald:hover { background: #2ecc71; }

.btn-pink {
  background: #e84393;
  color: #fff;
}
.btn-pink:hover { background: #fd79a8; }

.btn-purple {
  background: #8e44ad;
  color: #fff;
}
.btn-purple:hover { background: #9b59b6; }

.btn-danger {
  background: #c0392b;
  color: #fff;
}
.btn-danger:hover { background: #e74c3c; }

.btn-xs {
  padding: 2px 6px;
  font-size: 0.7rem;
}

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

.btn-lg {
  padding: 10px 20px;
  font-size: 1rem;
}

.btn-active-glow {
  box-shadow: 0 0 15px #f1c40f;
  animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px #f1c40f; }
  50% { box-shadow: 0 0 18px #f39c12; }
}

/* ======================================================== */
/* DIALOG MODALS (NATIVE <dialog>)                          */
/* ======================================================== */

dialog.game-dialog {
  background: transparent;
  border: none;
  margin: auto;
  max-width: 95vw;
  max-height: 90vh;
  padding: 0;
  outline: none;
}

dialog::backdrop {
  background: rgba(4, 7, 12, 0.85);
  backdrop-filter: blur(4px);
}

.dialog-content {
  background: linear-gradient(180deg, #162030 0%, #0d1421 100%);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), var(--shadow-gold);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 85vh;
}

.modal-sm .dialog-content { width: 420px; }
.modal-md .dialog-content { width: 620px; }
.modal-lg .dialog-content { width: 850px; }
.modal-xl .dialog-content { width: 1100px; }

.dialog-header {
  background: #111a28;
  border-bottom: 1px solid #23344d;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-header h2, .dialog-header h3 {
  font-family: var(--font-serif);
  color: #f1c40f;
  font-size: 1.25rem;
  letter-spacing: 1px;
}

.dialog-close-btn {
  background: transparent;
  border: none;
  color: #9ab;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.dialog-close-btn:hover {
  color: #fff;
}

.dialog-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

.dialog-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ======================================================== */
/* CHARACTER CREATION STYLES                                */
/* ======================================================== */

.creation-intro {
  text-align: center;
  color: #a0b2c6;
  margin-bottom: 16px;
}

.creation-form {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1c40f;
}

.form-group input, .form-group select {
  background: #090e17;
  border: 1px solid #2a3c58;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.creation-class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.creation-class-card {
  background: #121a29;
  border: 2px solid #23344d;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.creation-class-card:hover {
  border-color: #4a6896;
  background: #192438;
}

.creation-class-card.selected {
  border-color: var(--border-gold);
  background: #1f2d47;
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

.class-card-avatar {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.class-card-title {
  display: block;
  font-size: 0.75rem;
  color: #f39c12;
  margin: 2px 0 6px;
}

.class-card-desc {
  font-size: 0.75rem;
  color: #8c9ba5;
  line-height: 1.3;
}

/* ======================================================== */
/* REFINING & FORGE GLOW AURAS                              */
/* ======================================================== */

.glow-emerald {
  box-shadow: 0 0 20px #2ecc71, inset 0 0 15px rgba(46, 204, 113, 0.4) !important;
  border-color: #2ecc71 !important;
}

.glow-sapphire {
  box-shadow: 0 0 25px #3498db, inset 0 0 20px rgba(52, 152, 219, 0.5) !important;
  border-color: #3498db !important;
}

.glow-crimson {
  box-shadow: 0 0 30px #e74c3c, inset 0 0 25px rgba(231, 76, 60, 0.6) !important;
  border-color: #e74c3c !important;
}

.glow-celestial-emerald {
  box-shadow: 0 0 35px #00ff66, 0 0 60px rgba(0, 255, 102, 0.75), inset 0 0 25px rgba(0, 255, 102, 0.6) !important;
  border-color: #00ff66 !important;
  animation: celestial-emerald-pulse 2.2s infinite ease-in-out;
}

@keyframes celestial-emerald-pulse {
  0%, 100% {
    box-shadow: 0 0 30px #00ff66, 0 0 55px rgba(0, 255, 102, 0.75), inset 0 0 20px rgba(0, 255, 102, 0.55);
    border-color: #00ff66;
    filter: drop-shadow(0 0 8px rgba(0, 255, 102, 0.6));
  }
  50% {
    box-shadow: 0 0 45px #ffffff, 0 0 85px rgba(255, 255, 255, 0.95), inset 0 0 30px rgba(255, 255, 255, 0.85);
    border-color: #ffffff;
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.95));
  }
}

.glow-celestial {
  box-shadow: 0 0 35px #f1c40f, inset 0 0 30px rgba(241, 196, 15, 0.8) !important;
  border-color: #f1c40f !important;
  animation: celestial-rainbow 3s infinite linear;
}

@keyframes celestial-rainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.glow-burning-red {
  box-shadow: 0 0 35px #ff2222, 0 0 60px rgba(255, 34, 34, 0.75), inset 0 0 25px rgba(255, 68, 68, 0.6) !important;
  border-color: #ff3333 !important;
  animation: red-burning-pulse 2.2s infinite ease-in-out;
}

@keyframes red-burning-pulse {
  0%, 100% {
    box-shadow: 0 0 30px #ff2222, 0 0 55px rgba(255, 34, 34, 0.75), inset 0 0 20px rgba(255, 68, 68, 0.55);
    border-color: #ff3333;
    filter: drop-shadow(0 0 8px rgba(255, 34, 34, 0.6));
  }
  50% {
    box-shadow: 0 0 45px #ffffff, 0 0 85px rgba(255, 255, 255, 0.95), inset 0 0 30px rgba(255, 255, 255, 0.85);
    border-color: #ffffff;
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.95));
  }
}

.glow-genesis-gold {
  box-shadow: 0 0 40px #ffd700, 0 0 75px rgba(255, 215, 0, 0.85), inset 0 0 30px rgba(255, 235, 59, 0.8) !important;
  border-color: #ffd700 !important;
  animation: genesis-gold-radiance 2.5s infinite ease-in-out;
}

@keyframes genesis-gold-radiance {
  0%, 100% {
    box-shadow: 0 0 35px #ffd700, 0 0 65px rgba(255, 215, 0, 0.75), inset 0 0 25px rgba(255, 235, 59, 0.7);
    border-color: #ffd700;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.7));
  }
  50% {
    box-shadow: 0 0 55px #ffffff, 0 0 100px rgba(255, 255, 255, 1), inset 0 0 40px rgba(255, 255, 255, 0.95);
    border-color: #ffffff;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
  }
}

.forge-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.forge-items-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forge-select-card {
  background: #111a28;
  border: 1px solid #23344d;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forge-select-card.selected {
  border-color: var(--border-gold);
  background: #19273c;
}

.anvil-display {
  background: #090e17;
  border: 2px dashed #2a3c58;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.anvil-display.anvil-emerald-green {
  background: radial-gradient(ellipse at center, rgba(0, 255, 102, 0.28) 0%, rgba(5, 35, 15, 0.9) 70%, #090e17 100%);
  border: 2px solid #00ff66 !important;
  box-shadow: 0 0 35px rgba(0, 255, 102, 0.5), inset 0 0 40px rgba(0, 255, 102, 0.25);
  animation: green-anvil-glow 2s infinite ease-in-out;
}

@keyframes green-anvil-glow {
  0%, 100% {
    border-color: #00ff66;
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.45), inset 0 0 30px rgba(0, 255, 102, 0.2);
  }
  50% {
    border-color: #ffffff;
    box-shadow: 0 0 55px rgba(255, 255, 255, 0.85), inset 0 0 50px rgba(255, 255, 255, 0.45);
  }
}

.anvil-display.anvil-rainbow {
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, rgba(20, 20, 35, 0.9) 70%, #090e17 100%);
  border: 2px solid #f1c40f !important;
  box-shadow: 0 0 35px rgba(241, 196, 15, 0.5), inset 0 0 40px rgba(155, 89, 182, 0.25);
  animation: rainbow-anvil-chroma 3s infinite linear;
}

@keyframes rainbow-anvil-chroma {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.anvil-display.anvil-burning-red {
  background: radial-gradient(ellipse at center, rgba(160, 20, 20, 0.35) 0%, rgba(35, 8, 8, 0.9) 70%, #090e17 100%);
  border: 2px solid #ff3333 !important;
  box-shadow: 0 0 35px rgba(255, 34, 34, 0.45), inset 0 0 40px rgba(255, 34, 34, 0.25);
  animation: red-anvil-heat 2s infinite ease-in-out;
}

@keyframes red-anvil-heat {
  0%, 100% {
    border-color: #ff3333;
    box-shadow: 0 0 30px rgba(255, 34, 34, 0.4), inset 0 0 30px rgba(255, 34, 34, 0.2);
  }
  50% {
    border-color: #ffffff;
    box-shadow: 0 0 55px rgba(255, 255, 255, 0.85), inset 0 0 50px rgba(255, 255, 255, 0.45);
  }
}

.anvil-display.anvil-genesis-gold {
  background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.35) 0%, rgba(45, 35, 10, 0.9) 70%, #090e17 100%);
  border: 2px solid #ffd700 !important;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.55), inset 0 0 45px rgba(255, 215, 0, 0.3);
  animation: gold-anvil-radiance 2.5s infinite ease-in-out;
}

@keyframes gold-anvil-radiance {
  0%, 100% {
    border-color: #ffd700;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.5), inset 0 0 35px rgba(255, 215, 0, 0.25);
  }
  50% {
    border-color: #ffffff;
    box-shadow: 0 0 65px rgba(255, 255, 255, 0.9), inset 0 0 50px rgba(255, 255, 255, 0.5);
  }
}

.forge-spark-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.anvil-display > *:not(.forge-spark-canvas) {
  position: relative;
  z-index: 2;
}

/* Active Aura Badges */
.forge-active-aura-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.forge-active-aura-badge.red-sparks {
  background: linear-gradient(90deg, #990000, #ff3300);
  border: 1px solid #ff4444;
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 34, 34, 0.6);
  animation: red-aura-badge-pulse 1.8s infinite alternate;
}

@keyframes red-aura-badge-pulse {
  from { box-shadow: 0 0 12px rgba(255, 34, 34, 0.5); }
  to { box-shadow: 0 0 24px rgba(255, 68, 68, 0.9); }
}

.forge-active-aura-badge.gold-sparks {
  background: linear-gradient(90deg, #b8860b, #ffd700, #ffae00);
  border: 1px solid #fff275;
  color: #1a0f00;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
  animation: gold-aura-badge-pulse 2s infinite alternate;
}

@keyframes gold-aura-badge-pulse {
  from { box-shadow: 0 0 14px rgba(255, 215, 0, 0.5); }
  to { box-shadow: 0 0 28px rgba(255, 235, 59, 1); }
}

.forge-active-aura-badge.emerald-green-glow {
  background: linear-gradient(90deg, #0b6623, #00c853, #69f0ae);
  border: 1px solid #00e676;
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.6);
  animation: green-aura-badge-pulse 1.8s infinite alternate;
}

@keyframes green-aura-badge-pulse {
  from { box-shadow: 0 0 12px rgba(0, 230, 118, 0.5); }
  to { box-shadow: 0 0 24px rgba(0, 255, 102, 0.9); }
}

.forge-active-aura-badge.red-glow-pulse {
  background: linear-gradient(90deg, #990000, #ff1744, #ff5252);
  border: 1px solid #ff5252;
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.6);
  animation: red-aura-badge-pulse 1.8s infinite alternate;
}

@keyframes red-aura-badge-pulse {
  from { box-shadow: 0 0 12px rgba(255, 23, 68, 0.5); }
  to { box-shadow: 0 0 24px rgba(255, 82, 82, 0.95); }
}

.forge-active-aura-badge.rainbow-glow {
  background: linear-gradient(90deg, #9b59b6, #3498db, #2ecc71, #f1c40f, #e74c3c);
  border: 1px solid #fff;
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.5);
  animation: rainbow-badge-shimmer 2.5s infinite linear;
}

@keyframes rainbow-badge-shimmer {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* Multi-Strike Controls */
.forge-multi-strike-box {
  background: #0d1522;
  border: 1px solid #23364f;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forge-strike-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.forge-auto-target-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed #1e2c40;
  flex-wrap: wrap;
}

.forge-target-select {
  background: #080d16;
  border: 1px solid #34495e;
  color: #f1c40f;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.forge-target-select:focus {
  border-color: #ffd700;
  outline: none;
}

/* Batch Summary & Logs */
.forge-batch-summary-card {
  background: #080d16;
  border: 1px solid #1e2c40;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 0.85rem;
}

.forge-batch-stats-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.forge-batch-stat-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}
.forge-batch-stat-badge.success { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }
.forge-batch-stat-badge.fail { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border: 1px solid #e74c3c; }
.forge-batch-stat-badge.downgrade { background: rgba(243, 156, 18, 0.2); color: #f39c12; border: 1px solid #f39c12; }
.forge-batch-stat-badge.protected { background: rgba(52, 152, 219, 0.2); color: #3498db; border: 1px solid #3498db; }

.forge-batch-logs {
  max-height: 120px;
  overflow-y: auto;
  background: #05080e;
  border: 1px solid #162234;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: monospace;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.forge-batch-logs .log-item.success { color: #2ecc71; }
.forge-batch-logs .log-item.fail { color: #8c9ba5; }
.forge-batch-logs .log-item.protected { color: #3498db; }
.forge-batch-logs .log-item.downgrade { color: #e74c3c; font-weight: bold; }

.anvil-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.glow-label {
  font-size: 0.85rem;
  font-weight: 800;
  margin-top: 4px;
}

.forge-requirements-box {
  background: #111a28;
  border: 1px solid #23344d;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.forge-charms-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.85rem;
}

.forge-btn-row {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.forge-socket-section {
  border-top: 1px solid #23344d;
  padding-top: 14px;
}

.socketed-gems-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 12px;
}

.gem-socket-slot {
  background: #0b111a;
  border: 1px solid #2a3c58;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.8rem;
}

/* Vulcan's Forge Refinement Stat Preview */
.forge-stat-preview-card {
  background: #0d1522;
  border: 1px solid #23364f;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.forge-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1a283c;
}

.preview-badge {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-gold, #f1c40f);
}

.preview-mult-pill {
  background: #1b283d;
  color: #2ecc71;
  border: 1px solid #2ecc71;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.forge-stat-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 6px 0;
}

.forge-stat-diff-table th {
  text-align: left;
  padding: 6px 8px;
  background: #080d16;
  color: #8c9ba5;
  border-bottom: 1px solid #23364f;
  font-weight: 600;
}

.forge-stat-diff-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #162234;
}

.stat-refine-bonus {
  font-size: 0.72rem;
  opacity: 0.85;
}

.stat-diff-gain {
  color: #2ecc71 !important;
  font-weight: 700;
}

.forge-aura-unlock-notice {
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.15), rgba(52, 152, 219, 0.15));
  border: 1px solid #2ecc71;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  margin-top: 8px;
}

.forge-risk-banner {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 8px 0;
  text-align: center;
}

.forge-risk-banner.safe {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid #2ecc71;
  color: #2ecc71;
}

.forge-risk-banner.moderate {
  background: rgba(241, 196, 15, 0.15);
  border: 1px solid #f1c40f;
  color: #f1c40f;
}

.forge-risk-banner.danger {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid #e74c3c;
  color: #ff7675;
}

.forge-requirements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #0b111a;
  border: 1px solid #1e2c40;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

/* ======================================================== */
/* 168 SKILLS TREE MODAL                                    */
/* ======================================================== */

.skills-modal-header {
  background: #111a28;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.skills-tier-tabs {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tier-heading {
  font-family: var(--font-serif);
  color: #f1c40f;
  border-bottom: 1px solid #23344d;
  padding-bottom: 4px;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.skills-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.skill-card {
  background: #111a28;
  border: 1px solid #223247;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-card.learned {
  border-color: #355075;
  background: #142033;
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-icon {
  font-size: 1.5rem;
}

.skill-title-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.skill-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
}

.skill-rank {
  font-size: 0.7rem;
  color: #f39c12;
}

.skill-rank.maxed {
  color: #2ecc71;
  font-weight: 700;
}

.skill-rank-maxed-tag {
  color: #2ecc71;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(46, 204, 113, 0.4);
}

.badge-skill-maxed {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.2) 0%, rgba(46, 204, 113, 0.3) 100%);
  color: #2ecc71;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #2ecc71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.35);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.skill-card.skill-card-maxed {
  border-color: rgba(46, 204, 113, 0.4);
}

.skill-desc {
  font-size: 0.75rem;
  color: #8c9ba5;
  line-height: 1.25;
  flex: 1;
}

.skill-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #6a7d91;
  border-top: 1px solid #1a273b;
  padding-top: 4px;
}

.skill-hotbar-assign {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  margin-top: 4px;
}

.skill-hotbar-assign select {
  flex: 1;
  background: #090e17;
  border: 1px solid #273852;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 4px;
}

/* ======================================================== */
/* MARRIAGE MODAL STYLES                                    */
/* ======================================================== */

.marriage-intro-banner {
  background: linear-gradient(135deg, rgba(232, 67, 147, 0.2) 0%, rgba(10, 15, 25, 0.8) 100%);
  border: 1px solid #e84393;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.candidates-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.candidate-card {
  background: #131b29;
  border: 1px solid #2a3c58;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cand-avatar {
  font-size: 2rem;
}

.cand-meta {
  font-size: 0.75rem;
  color: #ff9bbb;
}

.cand-desc {
  font-size: 0.75rem;
  color: #8c9ba5;
  margin: 4px 0;
}

.cand-vow {
  font-size: 0.75rem;
  color: #f1c40f;
  font-style: italic;
  margin-bottom: 8px;
}

.custom-partner-row {
  background: #111a28;
  border: 1px solid #23344d;
  padding: 14px;
  border-radius: 8px;
}

.custom-name-input-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.custom-name-input-group input {
  flex: 1;
  background: #080d16;
  border: 1px solid #2d4163;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
}

.married-status-card {
  text-align: center;
  padding: 16px;
}

.married-avatar {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.intimacy-meter-box {
  margin: 16px 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.intimacy-bar {
  height: 14px;
  background: #090e17;
  border: 1px solid #e84393;
  border-radius: 7px;
  overflow: hidden;
  margin-top: 6px;
}

.intimacy-fill {
  height: 100%;
  background: linear-gradient(90deg, #fd79a8, #e84393);
  transition: width 0.3s;
}

.couple-buffs-box {
  background: #131b29;
  border: 1px solid #2a3c58;
  padding: 12px;
  border-radius: 8px;
  max-width: 450px;
  margin: 0 auto 16px;
  text-align: left;
}

.marriage-actions-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Multiple Marriage Gift Giving Controls */
.marriage-gifts-section {
  margin-top: 16px;
  background: rgba(232, 67, 147, 0.08);
  border: 1px solid rgba(232, 67, 147, 0.35);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.marriage-gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.marriage-gift-card {
  background: #111a28;
  border: 1px solid #283a54;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.marriage-gift-card:hover {
  border-color: #e84393;
  box-shadow: 0 0 10px rgba(232, 67, 147, 0.2);
}

.marriage-gift-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.marriage-gift-card h5 {
  font-size: 0.9rem;
  margin: 0;
  color: #fff;
}

.marriage-gift-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
}

.marriage-gift-owned {
  font-weight: 600;
}

.marriage-gift-preview {
  font-size: 0.78rem;
  min-height: 20px;
}


/* ======================================================== */
/* CHARACTER & INVENTORY MODAL STYLES                       */
/* ======================================================== */

.char-sheet-grid {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 16px;
}

.char-visual-column {
  background: #111a28;
  border: 1px solid #23344d;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.char-portrait {
  font-size: 3.5rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-sprite-profile {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  border-radius: 50%;
  border: 2px solid var(--border-gold);
  background: #162238;
  display: inline-block;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.stats-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #1a2536;
}

.combat-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.8rem;
  background: #111a28;
  padding: 8px;
  border-radius: 6px;
}

.equipment-slots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equip-slot-row {
  background: #111a28;
  border: 1px solid #23344d;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.slot-label {
  width: 65px;
  color: #7f92a6;
  font-weight: 800;
  font-size: 0.7rem;
}

.slot-item {
  flex: 1;
  color: #fff;
  font-weight: 700;
}

.slot-item.text-gold,
.slot-item.text-cyan,
.slot-item.text-pink,
.slot-item.text-emerald,
.slot-item.text-warning,
.slot-item.text-muted {
  color: #fff;
}

.slot-empty {
  flex: 1;
  color: #fff;
  font-style: italic;
}

.inventory-details-panel h4 {
  color: #fff;
}

/* Inventory Grid */
.inventory-grid-container {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

.inventory-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  background: #090e17;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #23344d;
}

.inv-item-card {
  background: #131c2a;
  border: 1px solid #2a3d5c;
  border-radius: 6px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}

.inv-item-card:hover {
  border-color: var(--border-gold);
  background: #1a2638;
}

.inv-item-card.selected {
  border-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
}

.inv-item-icon {
  font-size: 1.5rem;
}

.inv-item-count {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.inventory-details-panel {
  background: #111a28;
  border: 1px solid #23344d;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Item rarities */
.rarity-common { color: #9d9d9d; }
.rarity-rare { color: #1eff00; }
.rarity-epic { color: #0070dd; }
.rarity-legendary { color: #a335ee; }
.rarity-mythic { color: #ff8000; }
.rarity-ascended { color: #e6cc80; text-shadow: 0 0 8px rgba(230, 204, 128, 0.6); }

/* Rebirth Sanctum Card */
.rebirth-sanctum-card {
  text-align: center;
  padding: 14px;
}

.rebirth-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.lore-text {
  font-style: italic;
  color: #b0c4de;
  margin: 10px 0 18px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.rebirth-status-box {
  background: #111a28;
  border: 1px solid #293d5c;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

/* Quests */
.quests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest-card {
  background: #111a28;
  border: 1px solid #23344d;
  border-radius: 8px;
  padding: 12px 16px;
}

.quest-card.active {
  border-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.2);
}

.quest-card.completed {
  opacity: 0.6;
}

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

.quest-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #23344d;
}

.quest-card.active .quest-badge {
  background: #f39c12;
  color: #fff;
}

.quest-desc {
  font-size: 0.8rem;
  color: #a0b2c6;
  margin-bottom: 8px;
}

/* Enhanced Quests Grimoire & Tracker */
.quest-active-hero {
  background: linear-gradient(180deg, #18253a 0%, #0f1826 100%);
  border: 2px solid var(--border-gold);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), var(--shadow-gold);
}

.quest-npc-dialogue-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(8, 14, 24, 0.7);
  border: 1px solid #23344d;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.quest-npc-avatar {
  font-size: 2.5rem;
  background: #142236;
  border: 2px solid var(--border-gold);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quest-npc-speech h5 {
  color: var(--text-gold);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.quest-npc-speech p {
  color: #c8d6e5;
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.35;
}

.quest-progress-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 12px 0;
}

.quest-progress-track {
  width: 100%;
  height: 10px;
  background: #090e18;
  border-radius: 5px;
  overflow: hidden;
  margin: 6px 0;
  border: 1px solid #1f3049;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f39c12, #f1c40f);
  transition: width 0.3s ease;
}

.quest-rewards-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.reward-pill {
  background: #101c2e;
  border: 1px solid #2c4161;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: #e1e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-quest-claim {
  background: linear-gradient(180deg, #f1c40f 0%, #d4ac0d 100%) !important;
  color: #fff !important;
  font-weight: 800 !important;
  border: none !important;
  animation: pulseGold 1.5s infinite alternate;
}

@keyframes pulseGold {
  0% { box-shadow: 0 0 10px rgba(241, 196, 15, 0.4); transform: scale(1); }
  100% { box-shadow: 0 0 25px rgba(241, 196, 15, 0.9); transform: scale(1.02); }
}

/* Floating HUD Quest Tracker */
.hud-quest-tracker {
  position: absolute;
  top: 23px;
  right: 23px;
  width: 230px;
  background: rgba(12, 18, 28, 0.90);
  border: 1px solid rgba(241, 196, 15, 0.5);
  border-radius: 8px;
  padding: 8px 12px;
  z-index: 10;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  transition: all 0.25s ease;
}

.hud-quest-tracker.collapsed {
  width: 175px;
  padding-bottom: 6px;
}

.hud-quest-tracker.collapsed .tracker-body {
  display: none;
}

.tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #23344d;
  padding-bottom: 5px;
  margin-bottom: 6px;
  gap: 4px;
}

.tracker-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-gold);
  letter-spacing: 0.5px;
}

.tracker-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tracker-toggle-btn {
  background: #152238;
  border: 1px solid #2d456b;
  color: #a0b2c6;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tracker-toggle-btn:hover {
  background: #253d63;
  color: #fff;
  border-color: #f1c40f;
}

.tracker-expand-btn {
  background: #1a2a44;
  border: 1px solid #334e75;
  color: #ccd;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.tracker-expand-btn:hover {
  background: #253d63;
  color: #fff;
}

.tracker-quest-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.tracker-quest-obj {
  font-size: 0.75rem;
  color: #9ab;
  margin-bottom: 6px;
}

.tracker-action-btn {
  width: 100%;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

/* Shop Grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.shop-item-card {
  background: #111a28;
  border: 1px solid #23344d;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.shop-item-card h5 {
  margin: 0;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.shop-item-icon {
  font-size: 2rem;
}

.shop-item-price {
  font-size: 0.8rem;
  font-weight: 700;
}

/* Shop Quantity Controls */
.shop-qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin-top: 4px;
}

.shop-qty-btn {
  background: #19273c;
  border: 1px solid #2d4163;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.shop-qty-btn:hover {
  background: #2a3d5c;
  border-color: #4a6fa5;
}

.shop-qty-input {
  width: 54px;
  height: 26px;
  background: #090e17;
  border: 1px solid #2a3d5c;
  border-radius: 4px;
  color: #f1c40f;
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0 4px;
}

.shop-qty-input::-webkit-inner-spin-button,
.shop-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.shop-preset-chips {
  display: flex;
  gap: 4px;
  justify-content: center;
  width: 100%;
  margin: 4px 0;
}

.shop-chip {
  background: #141f2f;
  border: 1px solid #283a54;
  color: #8c9ba5;
  border-radius: 3px;
  font-size: 0.7rem;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.shop-chip:hover {
  background: #1e2e46;
  color: #fff;
  border-color: #3b567d;
}

.shop-chip.active {
  background: #1e3a5f;
  color: #f1c40f;
  border-color: #f1c40f;
  font-weight: 700;
}

.shop-item-total {
  font-size: 0.78rem;
  color: #a4d8ec;
  margin: 2px 0 4px;
  font-weight: 600;
}

.shop-item-card .btn-buy {
  width: 100%;
  font-weight: 700;
}

/* Utility classes */
.text-gold { color: #f1c40f; }
.text-cyan { color: #00e5ff; }
.text-pink { color: #ff6584; }
.text-emerald { color: #2ecc71; }
.text-warning { color: #e67e22; }
.text-muted { color: #7f92a6; }

/* Shop Tabs & Selling Styles */
.shop-tabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #23344d;
  flex-wrap: wrap;
  gap: 10px;
}

.shop-tabs-group {
  display: flex;
  gap: 8px;
}

.shop-tab-btn {
  background: #151f30;
  border: 1px solid #2a3d5c;
  color: #8c9ba5;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--font-serif);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shop-tab-btn:hover {
  background: #1c2a40;
  color: var(--text-primary);
}

.shop-tab-btn.active {
  background: linear-gradient(180deg, #c5a059 0%, #997530 100%);
  color: #0d1421;
  border-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
}

.shop-gold-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

.shop-sell-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  background: #0f1623;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #1a283b;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-sell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.shop-sell-card {
  position: relative;
  background: #111a28;
  border: 1px solid #23344d;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

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

.shop-sell-card.selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.28);
}

.shop-sell-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 17px;
  height: 17px;
  accent-color: #ffd700;
  cursor: pointer;
  z-index: 2;
}

.shop-sell-card h5 {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.shop-sell-price {
  font-size: 0.8rem;
  font-weight: 700;
}

.shop-sell-btns-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.shop-empty-bag-notice {
  text-align: center;
  padding: 40px 20px;
  background: #0d1421;
  border-radius: 8px;
  border: 1px dashed #23344d;
}

.inv-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1e2c40;
  flex-wrap: wrap;
  gap: 8px;
}

.inv-gold-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

/* Diamond Shop & USD Recharge Styles */
.shop-item-card.diamond-card {
  background: linear-gradient(145deg, #0d1b2a, #0b1420);
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.12);
  position: relative;
}

.shop-item-card.diamond-card:hover {
  border-color: #00e5ff;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.25);
  transform: translateY(-2px);
}

.shop-item-card .shop-badge-exclusive {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.shop-item-diamond-price {
  color: #00e5ff;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

.shop-tab-btn.tab-diamond.active {
  background: linear-gradient(180deg, #00b4d8 0%, #0077b6 100%);
  color: #fff;
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.shop-tab-btn.tab-recharge.active {
  background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
  color: #fff;
  border-color: #2ecc71;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.5);
}

.shop-recharge-banner {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.15), rgba(46, 204, 113, 0.12), rgba(13, 27, 42, 0.9));
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.shop-recharge-banner-left h4 {
  margin: 0 0 4px 0;
  color: #00e5ff;
  font-size: 1.15rem;
}

.shop-recharge-banner-left p {
  margin: 0;
  font-size: 0.8rem;
  color: #8fa6be;
}

.shop-recharge-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #09131e;
  border: 1px solid #1f354d;
  color: #e0e6ed;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.shop-pay-badge.gcash {
  border-color: #005ce6;
  color: #00a2ff;
}

.shop-pay-badge.card {
  border-color: #f39c12;
  color: #f1c40f;
}

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

.shop-recharge-card {
  background: #0f1926;
  border: 1px solid #203550;
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.shop-recharge-card:hover {
  transform: translateY(-3px);
  border-color: #00e5ff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
}

.shop-recharge-badge-popular {
  position: absolute;
  top: -8px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

.shop-recharge-badge-best {
  position: absolute;
  top: -8px;
  background: linear-gradient(135deg, #f39c12, #d35400);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
}

.shop-recharge-icon {
  font-size: 2.2rem;
  margin-top: 4px;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

.shop-recharge-amount {
  font-size: 1.3rem;
  font-weight: 900;
  color: #00e5ff;
}

.shop-recharge-bonus {
  font-size: 0.72rem;
  color: #2ecc71;
  font-weight: 700;
  background: rgba(46, 204, 113, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.shop-recharge-price-tag {
  font-size: 1.15rem;
  font-weight: 900;
  color: #f1c40f;
  margin: 4px 0;
}

.shop-recharge-methods-preview {
  display: flex;
  gap: 5px;
  font-size: 0.7rem;
  color: #7997b5;
}

/* Payment Checkout Modal */
.checkout-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 8, 14, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.checkout-modal-card {
  background: #0d1624;
  border: 1px solid #233b59;
  border-radius: 10px;
  width: 90%;
  max-width: 480px;
  padding: 22px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1a2c42;
  padding-bottom: 10px;
}

.checkout-header h3 {
  margin: 0;
  color: #00e5ff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-order-summary {
  background: #121e30;
  border: 1px solid #1e334d;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-methods-selector {
  display: flex;
  gap: 8px;
}

.checkout-method-btn {
  flex: 1;
  padding: 10px 8px;
  background: #111d2e;
  border: 1px solid #203550;
  border-radius: 6px;
  color: #8c9ba5;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.checkout-method-btn.active {
  background: #162a45;
  border-color: #00e5ff;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.checkout-method-btn.active.gcash {
  border-color: #00a2ff;
  box-shadow: 0 0 10px rgba(0, 162, 255, 0.3);
}

.checkout-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkout-form-group label {
  font-size: 0.75rem;
  color: #8fa6be;
  font-weight: 600;
}

.checkout-form-group input {
  background: #09101a;
  border: 1px solid #1e334d;
  color: #fff;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 0.88rem;
}

.checkout-form-group input:focus {
  border-color: #00e5ff;
  outline: none;
}

.checkout-sandbox-badge {
  background: rgba(243, 156, 18, 0.15);
  border: 1px solid rgba(243, 156, 18, 0.4);
  color: #f1c40f;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ======================================================== */
/* HONORARY TITLES & ACHIEVEMENTS MODAL                     */
/* ======================================================== */

.hud-title {
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 1px 4px;
  border-radius: 4px;
}

.hud-title:hover {
  background: rgba(243, 156, 18, 0.2);
  text-shadow: 0 0 8px rgba(243, 156, 18, 0.6);
  transform: scale(1.03);
}

.titles-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #0f1724;
  border: 1px solid #23344d;
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.titles-active-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.titles-summary-label {
  color: var(--text-muted);
}

.titles-active-pill {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.titles-progress-pill {
  background: #152233;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #2a3c58;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.title-card {
  background: #0d1522;
  border: 1px solid #1e2c40;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.title-card:hover {
  transform: translateY(-2px);
  border-color: #3b5379;
}

.title-card.active {
  border-color: #f1c40f;
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.1) 0%, #0d1522 100%);
  box-shadow: 0 0 12px rgba(241, 196, 15, 0.25);
}

.title-card.unlocked {
  border-color: #2ecc71;
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, #0d1522 100%);
}

.title-card.locked {
  opacity: 0.72;
  filter: grayscale(35%);
  border-style: dashed;
}

.title-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.title-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-card-icon {
  font-size: 1.4rem;
}

.title-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.title-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background: #f39c12;
  color: #fff;
  box-shadow: 0 0 6px rgba(243, 156, 18, 0.6);
}

.badge-unlocked {
  background: #27ae60;
  color: #fff;
}

.badge-locked {
  background: #34495e;
  color: #95a5a6;
}

.title-desc {
  font-size: 0.8rem;
  color: #8fa0b5;
  line-height: 1.35;
  margin: 0;
}

.title-req-box {
  background: #090e18;
  border: 1px solid #1a273b;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title-req-box .req-label {
  color: #647d9e;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
}

.title-req-box .req-text {
  color: #d1d8e0;
}

.title-stats-preview {
  font-size: 0.78rem;
  color: #70c4ef;
  background: rgba(41, 128, 185, 0.12);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: 6px;
  padding: 5px 8px;
  font-weight: 600;
}

.title-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}



/* ==========================================================================
   CUSTOM ITEM SPRITES SYSTEM (From Spritesheet)
   ========================================================================== */
.item-sprite {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  vertical-align: middle;
  object-fit: contain;
  display: inline-block;
}

.item-sprite-xs {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  vertical-align: -2px;
}

.item-sprite-sm {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  vertical-align: -3px;
}

.item-sprite-lg {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  vertical-align: middle;
}

.item-sprite-xl {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  vertical-align: middle;
}

.inv-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-item-icon .item-sprite {
  width: 28px;
  height: 28px;
}

.slot-item {
  display: inline-flex;
  align-items: center;
}

.slot-item .item-sprite {
  width: 22px;
  height: 22px;
  margin-right: 6px;
}

.shop-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-item-icon .item-sprite {
  width: 34px;
  height: 34px;
}

.anvil-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.anvil-icon .item-sprite {
  width: 48px;
  height: 48px;
}

.gem-tag .item-sprite,
.btn-socket-gem .item-sprite,
.gem-socket-slot .item-sprite {
  width: 20px;
  height: 20px;
  margin-right: 4px;
}

.reward-pill .item-sprite {
  width: 20px;
  height: 20px;
  margin-right: 4px;
}

.forge-select-card .item-sprite {
  width: 22px;
  height: 22px;
  margin-right: 6px;
}

.log-entry .item-sprite {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin: 0 2px;
}

/* ======================================================== */
/* RAZOR-SHARP PIXEL ART RENDERING FOR ALL GAME SPRITES    */
/* ======================================================== */
img,
canvas,
.item-sprite,
.equip-item-sprite,
.character-sprite-hud,
.character-sprite-combat,
.character-sprite-profile,
.character-sprite-fallen,
.class-icon-sprite,
.combat-equip-circle img,
.combat-avatar img,
.hud-avatar-box img,
.inv-item-icon img,
.shop-item-icon img,
.anvil-icon img,
.gem-socket-slot img,
.reward-pill img,
.enemy-avatar img {
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  image-rendering: pixelated !important;
}

/* ======================================================== */
/* BATCH STAT ALLOCATION BUTTONS                            */
/* ======================================================== */
.stat-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-btn-group .btn {
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  line-height: 1.2;
  transition: transform 0.1s ease, background 0.15s ease;
}

.stat-btn-group .btn:active {
  transform: scale(0.92);
}

.btn-emerald {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: #fff;
  border: 1px solid #2ecc71;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #2ecc71 0%, #34e78a 100%);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.7);
  transform: translateY(-1px);
}

/* ======================================================== */
/* FORGE STRIKE BANNER (INLINE RESULT FEEDBACK)             */
/* ======================================================== */
.forge-strike-banner {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  margin: 10px 0 4px 0;
  text-align: center;
  transition: all 0.25s ease;
  animation: bannerPop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes bannerPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.forge-strike-banner.success {
  background: rgba(39, 174, 96, 0.25);
  border: 1px solid #2ecc71;
  color: #a8e6cf;
  box-shadow: 0 0 16px rgba(46, 204, 113, 0.35);
}

.forge-strike-banner.fail {
  background: rgba(231, 76, 60, 0.25);
  border: 1px solid #e74c3c;
  color: #ffb8b8;
  box-shadow: 0 0 16px rgba(231, 76, 60, 0.35);
}

/* ======================================================== */
/* GAME TOAST NOTIFICATION SYSTEM (NON-BLOCKING)            */
/* ======================================================== */
.game-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.game-toast {
  background: rgba(14, 22, 36, 0.98);
  border: 1px solid #3b5379;
  border-radius: 8px;
  padding: 11px 20px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-15px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: auto;
  max-width: 440px;
}

/* INVENTORY EQUIP CONFIRMATION PROMPT */
.equip-prompt-box {
  background: linear-gradient(135deg, rgba(20, 50, 35, 0.95) 0%, rgba(12, 32, 22, 0.98) 100%);
  border: 1px solid #2ecc71;
  box-shadow: 0 4px 18px rgba(46, 204, 113, 0.25);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: center;
}

.equip-prompt-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.equip-prompt-icon {
  font-size: 1.6rem;
}

.equip-prompt-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2ecc71;
  text-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.equip-prompt-msg {
  font-size: 0.85rem;
  color: #d4edda;
  line-height: 1.4;
  margin: 0;
}

.game-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.game-toast.toast-success {
  border-color: #2ecc71;
  background: linear-gradient(135deg, rgba(20, 45, 30, 0.96) 0%, rgba(10, 24, 18, 0.98) 100%);
  box-shadow: 0 4px 18px rgba(46, 204, 113, 0.35);
  color: #a8e6cf;
}

.game-toast.toast-error {
  border-color: #e74c3c;
  background: linear-gradient(135deg, rgba(50, 20, 25, 0.96) 0%, rgba(26, 10, 14, 0.98) 100%);
  box-shadow: 0 4px 18px rgba(231, 76, 60, 0.35);
  color: #ffb8b8;
}

.game-toast.toast-gold {
  border-color: #f1c40f;
  background: linear-gradient(135deg, rgba(45, 38, 15, 0.96) 0%, rgba(24, 20, 8, 0.98) 100%);
  box-shadow: 0 4px 18px rgba(241, 196, 15, 0.35);
  color: #fced96;
}

.game-toast.toast-pink {
  border-color: #ff6584;
  background: linear-gradient(135deg, rgba(55, 20, 35, 0.96) 0%, rgba(28, 10, 18, 0.98) 100%);
  box-shadow: 0 4px 18px rgba(255, 101, 132, 0.35);
  color: #ffd1dc;
}

.game-toast .toast-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.game-toast .toast-msg {
  line-height: 1.35;
}

/* ======================================================== */
/* CLICKABLE WORLD CHAT SENDERS                             */
/* ======================================================== */
.clickable-chat-name {
  cursor: pointer;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.clickable-chat-name:hover {
  color: #ffe600 !important;
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.6);
  text-decoration: underline;
}

/* ======================================================== */
/* ACCOUNT PROFILE / INSPECTION MODAL                       */
/* ======================================================== */
.profile-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(20, 32, 48, 0.8) 0%, rgba(10, 18, 28, 0.95) 100%);
  border: 1px solid #233752;
  border-radius: 8px;
  padding: 16px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.profile-avatar-box {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: radial-gradient(circle, #253954 0%, #0d1724 100%);
  border: 2px solid #f1c40f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 0 14px rgba(241, 196, 15, 0.3);
  flex-shrink: 0;
}

.profile-main-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.profile-char-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f1c40f;
  font-family: var(--font-serif);
}

.profile-username-tag {
  font-size: 0.8rem;
  color: #7997b5;
  background: rgba(14, 25, 38, 0.7);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #1d334d;
}

.profile-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.profile-badge-lvl {
  background: #193822;
  color: #2ecc71;
  border: 1px solid #27ae60;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.profile-badge-rebirth {
  background: #401d24;
  color: #ff6584;
  border: 1px solid #c0392b;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
}

.profile-badge-title {
  background: #3d3012;
  color: #f39c12;
  border: 1px solid #d35400;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.profile-cp-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 6px 14px;
  background: rgba(30, 20, 10, 0.6);
  border: 1px solid #d35400;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(211, 84, 0, 0.25);
}

.profile-cp-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #e67e22;
}

.profile-cp-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #f39c12;
  font-family: var(--font-serif);
}

.profile-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-panel {
  background: rgba(14, 23, 35, 0.85);
  border: 1px solid #1f3147;
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-panel-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #7997b5;
  border-bottom: 1px solid #1b2c40;
  padding-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
}

.profile-gear-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-gear-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 14, 22, 0.65);
  border: 1px solid #1c2c3f;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.profile-gear-slot-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #556c85;
  width: 55px;
  text-transform: uppercase;
}

.profile-gear-icon-box {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #14202e;
  border-radius: 4px;
  border: 1px solid #2c425c;
  flex-shrink: 0;
}

.profile-gear-name {
  flex: 1;
  font-weight: 700;
}

.profile-gear-refine {
  color: #e74c3c;
  font-weight: 900;
  margin-left: 4px;
}

.profile-gear-gems {
  display: flex;
  gap: 3px;
  font-size: 0.75rem;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.8rem;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #1a2839;
  padding-bottom: 3px;
}

.profile-stat-label {
  color: #8c9ba5;
}

.profile-stat-val {
  font-weight: 700;
  color: #fff;
}

.profile-marriage-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(35, 12, 22, 0.5);
  border: 1px solid #702636;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.8rem;
}

.profile-actions-bar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid #1a2738;
}

/* ======================================================== */
/* FRIENDS MODAL                                            */
/* ======================================================== */
.friends-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.friends-tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #1f3147;
  padding-bottom: 8px;
}

.friends-tab-btn {
  background: #111a28;
  border: 1px solid #23344d;
  color: #a0b2c6;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.friends-tab-btn:hover {
  background: #182538;
  color: #fff;
  border-color: #3b506d;
}

.friends-tab-btn.active {
  background: linear-gradient(180deg, #1b2c45 0%, #101c2d 100%);
  border-color: #f1c40f;
  color: #f1c40f;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.2);
}

.tab-count-badge {
  background: #23344d;
  color: #fff;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.tab-count-badge.badge-alert {
  background: #e74c3c;
  color: #fff;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.badge-pending {
  background: rgba(241, 196, 15, 0.15);
  border: 1px solid #f1c40f;
  color: #f1c40f;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.friends-search-bar {
  display: flex;
  gap: 8px;
}

.friends-search-bar input {
  flex: 1;
  background: #090e17;
  border: 1px solid #23344d;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 23, 35, 0.85);
  border: 1px solid #1f3147;
  border-radius: 6px;
  padding: 10px 14px;
  gap: 12px;
  transition: border-color 0.15s ease;
}

.friend-card:hover {
  border-color: #3b5a82;
}

.friend-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-avatar {
  width: 42px;
  height: 42px;
  background: #152233;
  border: 1px solid #2a415e;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  position: relative;
}

.friend-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  bottom: -2px;
  right: -2px;
  border: 2px solid #0f1622;
}

.friend-status-dot.online {
  background: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
}

.friend-status-dot.offline {
  background: #7f8c8d;
}

.friend-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.friend-name {
  font-weight: 800;
  color: #f1c40f;
  font-size: 0.95rem;
}

.friend-username {
  font-size: 0.75rem;
  color: #7997b5;
}

.friend-meta {
  font-size: 0.75rem;
  color: #a8b8c8;
}

.friend-actions {
  display: flex;
  gap: 6px;
}

.friends-empty-placeholder {
  text-align: center;
  padding: 35px 20px;
  color: #70859c;
  font-size: 0.9rem;
}

/* ======================================================== */
/* MESSAGING & INBOX SYSTEM                                 */
/* ======================================================== */
.inbox-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px dashed #233752;
  padding-bottom: 8px;
}

.inbox-subnav-group {
  display: flex;
  gap: 6px;
}

.inbox-subnav-btn {
  background: #0d1726;
  border: 1px solid #1f3147;
  color: #8c9ba5;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.inbox-subnav-btn:hover {
  background: #162438;
  color: #fff;
  border-color: #3b506d;
}

.inbox-subnav-btn.active {
  background: #1b2f4a;
  color: #3498db;
  border-color: #3498db;
  box-shadow: 0 0 6px rgba(52, 152, 219, 0.3);
}

.message-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 23, 35, 0.85);
  border: 1px solid #1f3147;
  border-radius: 6px;
  padding: 10px 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  gap: 12px;
}

.message-card:hover {
  background: rgba(22, 35, 54, 0.9);
  border-color: #3b5478;
}

.message-card.unread {
  border-left: 4px solid #3498db;
  background: rgba(16, 32, 53, 0.95);
  box-shadow: 0 0 8px rgba(52, 152, 219, 0.15);
}

.message-card.unread .message-subject {
  color: #fff;
  font-weight: 800;
}

.message-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #090e17;
  border: 1px solid #23344d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  position: relative;
}

.message-unread-pip {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  background: #3498db;
  border: 2px solid #090e17;
  border-radius: 50%;
  box-shadow: 0 0 6px #3498db;
}

.message-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.message-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.message-from {
  font-weight: 700;
  color: #f1c40f;
  font-size: 0.88rem;
}

.message-time {
  font-size: 0.72rem;
  color: #7997b5;
  white-space: nowrap;
}

.message-subject {
  font-size: 0.84rem;
  color: #d1d9e2;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-preview {
  font-size: 0.76rem;
  color: #8c9ba5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Compose Form */
.message-compose-card {
  background: rgba(14, 23, 35, 0.9);
  border: 1px solid #233752;
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-compose-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-compose-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a0b2c6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.message-compose-field input,
.message-compose-field textarea {
  background: #090e17;
  border: 1px solid #23344d;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
}

.message-compose-field input:focus,
.message-compose-field textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 6px rgba(52, 152, 219, 0.3);
}

.message-compose-field textarea {
  resize: vertical;
  min-height: 90px;
}

.message-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.message-char-counter {
  font-size: 0.75rem;
  color: #70859c;
}

/* Message Reader */
.message-reader-card {
  background: rgba(14, 23, 35, 0.95);
  border: 1px solid #233752;
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-reader-header {
  border-bottom: 1px solid #1f3147;
  padding-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.message-reader-subject {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f1c40f;
  margin-bottom: 6px;
}

.message-reader-meta {
  font-size: 0.8rem;
  color: #a0b2c6;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.message-reader-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #090e17;
  padding: 14px;
  border-radius: 5px;
  border: 1px solid #1a283c;
  min-height: 100px;
}

.message-reader-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}

/* ======================================================== */
/* ARENA MODAL                                              */
/* ======================================================== */
.arena-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arena-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(40, 20, 10, 0.8) 0%, rgba(18, 12, 10, 0.95) 100%);
  border: 1px solid #d35400;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 0 16px rgba(211, 84, 0, 0.25);
}

.arena-banner-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.arena-title {
  font-size: 1.35rem;
  font-family: var(--font-serif);
  color: #f39c12;
  font-weight: 800;
}

.arena-rank-badge {
  display: inline-block;
  background: #501d08;
  color: #e67e22;
  border: 1px solid #d35400;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.arena-stats-box {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
}

.arena-stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.arena-stat-item .val {
  font-size: 1.2rem;
  font-weight: 900;
  color: #f1c40f;
  font-family: var(--font-serif);
}

.arena-stat-item .lbl {
  font-size: 0.7rem;
  color: #a89078;
}

.arena-opponents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.arena-card {
  background: rgba(14, 23, 35, 0.9);
  border: 1px solid #1f3147;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

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

.arena-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.arena-card-avatar {
  width: 44px;
  height: 44px;
  background: #14202e;
  border: 1px solid #273b52;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.arena-card-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.arena-card-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.arena-card-sub {
  font-size: 0.75rem;
  color: #7997b5;
}

.arena-card-details {
  display: flex;
  justify-content: space-between;
  background: rgba(8, 14, 22, 0.6);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.arena-card-footer {
  margin-top: 4px;
}

.arena-card-footer .btn {
  width: 100%;
}

.arena-badge-registered {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid #27ae60;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.arena-badge-unregistered {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(230, 126, 34, 0.15);
  color: #e67e22;
  border: 1px solid #d35400;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.arena-register-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(58, 28, 12, 0.9) 0%, rgba(24, 14, 10, 0.95) 100%);
  border: 2px dashed #f39c12;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 4px 18px rgba(243, 156, 18, 0.18);
  gap: 16px;
}

.arena-register-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.arena-register-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 8px rgba(243, 156, 18, 0.5));
}

.arena-register-info h4 {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
  color: #f1c40f;
  font-family: var(--font-serif);
}

.arena-register-info p {
  margin: 0;
  font-size: 0.8rem;
  color: #c9b49b;
  line-height: 1.35;
}

.arena-empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 35px 20px;
  background: rgba(14, 23, 35, 0.85);
  border: 1px solid #1f3147;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.arena-empty-icon {
  font-size: 2.8rem;
  opacity: 0.8;
}

.arena-empty-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #e67e22;
  margin: 0;
}

.arena-empty-desc {
  font-size: 0.85rem;
  color: #7997b5;
  max-width: 480px;
  line-height: 1.4;
  margin: 0;
}

@media (max-width: 650px) {
  .arena-register-card {
    flex-direction: column;
    text-align: center;
  }
  .arena-register-left {
    flex-direction: column;
  }
}

/* ARENA NAVIGATION TABS */
.arena-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #1a2a40;
  padding-bottom: 6px;
  margin-top: 4px;
}

.arena-nav-tab {
  background: #0d1624;
  border: 1px solid #203550;
  color: #90a5bc;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.arena-nav-tab:hover {
  background: #142236;
  color: #fff;
  border-color: #3498db;
}

.arena-nav-tab.active {
  background: linear-gradient(135deg, #1b3858, #0e1e32);
  border-color: #f39c12;
  color: #f1c40f;
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.25);
}

/* ARENA GLOBAL RANKING LEADERBOARD */
.arena-ranking-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arena-ranking-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.arena-ranking-header th {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #a89078;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1f3147;
  text-align: left;
}

.arena-ranking-row {
  background: rgba(14, 23, 35, 0.9);
  border: 1px solid #1f3147;
  transition: all 0.2s ease;
}

.arena-ranking-row:hover {
  background: rgba(22, 36, 56, 0.95);
  border-color: #3498db;
  transform: translateY(-1px);
}

.arena-ranking-row-self {
  background: linear-gradient(90deg, rgba(243, 156, 18, 0.15), rgba(14, 23, 35, 0.95));
  border: 1px solid rgba(243, 156, 18, 0.55);
  box-shadow: 0 0 12px rgba(243, 156, 18, 0.18);
}

.arena-ranking-row td {
  padding: 10px 12px;
  vertical-align: middle;
}

.arena-ranking-row td:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.arena-ranking-row td:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.arena-rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
}

.arena-rank-medal-1 {
  background: linear-gradient(135deg, #f1c40f, #d35400);
  color: #1a0e00;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.6);
  border: 1px solid #f9e79f;
}

.arena-rank-medal-2 {
  background: linear-gradient(135deg, #ecf0f1, #95a5a6);
  color: #1a252f;
  box-shadow: 0 0 8px rgba(189, 195, 199, 0.5);
  border: 1px solid #ffffff;
}

.arena-rank-medal-3 {
  background: linear-gradient(135deg, #e67e22, #a0522d);
  color: #fff;
  box-shadow: 0 0 8px rgba(230, 126, 34, 0.5);
  border: 1px solid #edbb99;
}

.arena-rank-medal-default {
  background: #14202e;
  color: #7997b5;
  border: 1px solid #203550;
}

.arena-player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.arena-player-icon {
  font-size: 1.4rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101a28;
  border-radius: 50%;
  border: 1px solid #253b52;
}

.arena-player-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arena-player-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.arena-tag-self {
  font-size: 0.68rem;
  padding: 1px 5px;
  background: #d35400;
  color: #fff;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.arena-player-sub {
  font-size: 0.75rem;
  color: #7997b5;
}

.arena-player-title {
  font-size: 0.7rem;
  color: #e67e22;
}

.arena-self-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: rgba(243, 156, 18, 0.18);
  border: 1px solid #f39c12;
  color: #f1c40f;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

@media (max-width: 650px) {
  .arena-ranking-table th:nth-child(3),
  .arena-ranking-table td:nth-child(3),
  .arena-ranking-table th:nth-child(5),
  .arena-ranking-table td:nth-child(5) {
    display: none;
  }
}


/* ======================================================== */
/* ADVENTURER TRADING POST & PARCEL GIFTING SYSTEM          */
/* ======================================================== */
.trade-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trade-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(230, 160, 40, 0.18), rgba(20, 32, 50, 0.9));
  border: 1px solid rgba(230, 160, 40, 0.4);
  padding: 12px 18px;
  border-radius: 8px;
}

.trade-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trade-hero-icon {
  font-size: 2rem;
  background: rgba(10, 16, 26, 0.7);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(230, 160, 40, 0.3);
}

.trade-hero-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.trade-hero-sub {
  font-size: 0.8rem;
  color: #a4b8cc;
}

.trade-purse-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 16, 26, 0.8);
  border: 1px solid rgba(255, 215, 0, 0.5);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffd700;
}

.trade-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #1a2a40;
  padding-bottom: 6px;
}

.trade-nav-tab {
  background: #0d1624;
  border: 1px solid #203550;
  color: #90a5bc;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.trade-nav-tab:hover {
  background: #142236;
  color: #fff;
  border-color: #3b5b82;
}

.trade-nav-tab.active {
  background: linear-gradient(135deg, rgba(230, 160, 40, 0.25), rgba(15, 25, 40, 0.95));
  color: #ffd700;
  border-color: rgba(230, 160, 40, 0.6);
  box-shadow: 0 0 10px rgba(230, 160, 40, 0.2);
}

.trade-badge-count {
  background: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Parcel Cards */
.parcel-card {
  background: #0d1624;
  border: 1px solid #1a2a40;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.parcel-card:hover {
  border-color: rgba(230, 160, 40, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.parcel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.parcel-sender-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.parcel-sender-name {
  font-weight: 700;
  color: #e2e8f0;
}

.parcel-date {
  font-size: 0.75rem;
  color: #64748b;
}

.parcel-content-box {
  background: #080d15;
  border: 1px solid #142032;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.parcel-item-showcase {
  display: flex;
  align-items: center;
  gap: 10px;
}

.parcel-item-icon-box {
  width: 44px;
  height: 44px;
  background: #111a28;
  border: 1px solid #23354d;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.parcel-item-icon-box .item-sprite {
  width: 36px;
  height: 36px;
}

.parcel-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.parcel-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}

.parcel-gold-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.25);
}

.parcel-price-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.parcel-note {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
}

.parcel-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid #142032;
}

/* Composer */
.trade-composer-card {
  background: #0d1624;
  border: 1px solid #1a2a40;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trade-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trade-form-row label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trade-form-row input,
.trade-form-row select,
.trade-form-row textarea {
  background: #090e17;
  border: 1px solid #1f3148;
  color: #f1f5f9;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.trade-form-row input:focus,
.trade-form-row select:focus,
.trade-form-row textarea:focus {
  outline: none;
  border-color: #e6a028;
  box-shadow: 0 0 6px rgba(230, 160, 40, 0.3);
}

.trade-mode-toggle {
  display: flex;
  gap: 12px;
  background: #080d15;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #142032;
}

.trade-mode-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.trade-mode-option.active {
  background: rgba(230, 160, 40, 0.15);
  border-color: rgba(230, 160, 40, 0.5);
  color: #ffd700;
}

.trade-quick-buttons {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

