@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;900&family=Press+Start+2P&display=swap');

:root {
  --bg-main: #140c08;
  --bg-card: #25160e;
  --bg-card-hover: #362015;
  --bg-surface: #1a0f0a;
  --bg-parchment: #ebdcb7;
  --bg-parchment-slot: #d8be92;
  
  --border-wood: #54341f;
  --border-wood-dark: #382012;
  --border-gold: #c68a4c;
  --banner-jade: #4ea876;
  --banner-jade-dark: #1b452f;
  
  --primary: #48bb78;
  --primary-glow: rgba(72, 187, 120, 0.4);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.4);
  --success: #10b981;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --mana: #3b82f6;
  --mana-glow: rgba(59, 130, 246, 0.4);
  
  --text-main: #faebd7;
  --text-muted: #c9b097;
  --text-dim: #8c735d;
  --text-dark: #362215;
  
  --font-retro: 'Press Start 2P', monospace;
  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius: 6px;
  --shadow-main: 0 8px 24px rgba(0, 0, 0, 0.8);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* CraftPix RPG Tabletop Wood Background */
body {
  background-color: #140c08;
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(94, 53, 29, 0.5) 0%, transparent 65%),
    radial-gradient(circle at 80% 85%, rgba(45, 24, 13, 0.7) 0%, transparent 60%),
    linear-gradient(rgba(0, 0, 0, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.25) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 16px 16px, 16px 16px;
  color: var(--text-main);
  font-family: var(--font-ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

/* Pixel Typography Utilities */
.pixel-title {
  font-family: var(--font-retro);
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: #fbbf24;
  text-shadow: 2px 2px 0px #180c06, 0 0 8px var(--accent-glow);
}

.pixel-text {
  font-family: var(--font-retro);
  font-size: 0.72rem;
  line-height: 1.5;
}

/* Header & Top Bar - Heavy Carved Oak Beam */
.top-header {
  background: linear-gradient(180deg, #2c1b12 0%, #1a0f0a 100%);
  border-bottom: 2px solid #5a351f;
  box-shadow: inset 0 1px 0 #8a5734, 0 6px 18px rgba(0, 0, 0, 0.85);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 70px;
}

.logo-area {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.header-logo-img {
  height: 58px;
  max-width: 360px;
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.9));
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.2s ease;
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  z-index: 2;
  position: relative;
}

/* Two-Column Main Game Layout */
.game-layout-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}

.main-content-column {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Persistent Hero Sidebar */
.hero-persistent-sidebar {
  background: linear-gradient(180deg, #24140b 0%, #160c07 100%);
  border: 2px solid #5a351f;
  border-top-color: #8a5734;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 0 #0d0603, 0 8px 18px rgba(0, 0, 0, 0.75);
  position: sticky;
  top: 75px;
  z-index: 20;
}

.hero-portrait-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-portrait-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 208px;
  background: radial-gradient(circle at 50% 50%, #1a0f0a 0%, #090503 100%);
  border: 2px solid #b45309;
  border-top-color: #fde68a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.95), 0 4px 10px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.hero-identity-box {
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

.sidebar-hero-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 2px #000;
  margin: 0;
}

.sidebar-hero-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sidebar Stat Meters */
.sidebar-stat-meter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.meter-val {
  color: var(--text-dim);
  font-weight: 800;
  font-size: 0.75rem;
}

.sidebar-bar-hp, .sidebar-bar-mp, .sidebar-bar-exp {
  height: 12px;
  background: #090503;
  border: 1px solid #331d10;
  border-radius: 4px;
}

.sidebar-stats-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #5a351f, transparent);
  margin: 6px 0;
}

.hud-logout-btn {
  background: linear-gradient(180deg, #301311 0%, #1c0a09 100%);
  border: 2px solid #7f1d1d;
  border-top-color: #f87171;
  border-bottom-color: #450a0a;
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 
    inset 0 0 0 2px #150605, 
    inset 0 0 0 3px #5c1414;
  text-shadow: 1px 1px 2px #000;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-logout-btn:hover {
  background: linear-gradient(180deg, #421815 0%, #260d0b 100%);
  color: #ffffff;
  border-color: #dc2626;
  border-top-color: #fca5a5;
  border-bottom-color: #7f1d1d;
  box-shadow: 
    inset 0 0 0 2px #1a0807, 
    inset 0 0 0 3px #991b1b;
}

.hud-logout-btn:active {
  background: linear-gradient(180deg, #150605 0%, #2b0e0c 100%);
  box-shadow: 
    inset 0 0 0 2px #0d0303, 
    inset 0 0 0 3px #450a0a;
}

.discreet-btn,
#btn-toggle-audio {
  background: linear-gradient(180deg, #241712 0%, #150d09 100%);
  border: 2px solid #5a3821;
  border-top-color: #8c5d35;
  border-bottom-color: #382012;
  color: #c9a776;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  outline: none;
  transform: none !important;
  box-shadow: 
    inset 0 0 0 2px #180f0c, 
    inset 0 0 0 3px #6e462a;
}

.discreet-btn:hover,
#btn-toggle-audio:hover {
  background: linear-gradient(180deg, #342017 0%, #1c110c 100%);
  color: #f5e0b8;
  border-color: #a46d3e;
  border-top-color: #d1975e;
  border-bottom-color: #5a3821;
  transform: none !important;
  box-shadow: 
    inset 0 0 0 2px #1c110c, 
    inset 0 0 0 3px #9d683e;
}

.discreet-btn:active,
#btn-toggle-audio:active {
  background: linear-gradient(180deg, #180f0a 0%, #241712 100%);
  transform: none !important;
  box-shadow: 
    inset 0 0 0 2px #120b08, 
    inset 0 0 0 3px #5a3821;
}

.discreet-btn:focus,
.discreet-btn:focus-visible,
#btn-toggle-audio:focus,
#btn-toggle-audio:focus-visible,
button:focus,
button:focus-visible {
  outline: none !important;
}

.lucide-icon,
.lucide,
svg.lucide {
  width: 18px;
  height: 18px;
  stroke: #c9a776 !important;
  stroke-width: 2.2;
  display: block;
  transition: stroke 0.18s ease;
}

.discreet-btn:hover .lucide-icon,
.discreet-btn:hover .lucide,
.discreet-btn:hover svg.lucide,
#btn-toggle-audio:hover .lucide-icon,
#btn-toggle-audio:hover .lucide,
#btn-toggle-audio:hover svg.lucide {
  stroke: #f5e0b8 !important;
}

.status-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-badge.gold {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.status-badge.level {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.3);
}

.discreet-btn {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #334155;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 0 #020617;
}

.discreet-btn:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: var(--text-main);
  border-color: #64748b;
  transform: translateY(-1px);
}

/* Main Layout */
.app-container {
  max-width: 1480px;
  width: 96%;
  margin: 0 auto;
  padding: 16px 12px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* The Tower - Medieval Carved Navigation Tabs & Buttons */
.nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 2px solid #4a2e1c;
  padding-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #6e462a #140c08;
}

.nav-tabs::-webkit-scrollbar {
  height: 6px;
}

.nav-tabs::-webkit-scrollbar-track {
  background: #140c08;
}

.nav-tabs::-webkit-scrollbar-thumb {
  background: #6e462a;
  border-radius: 3px;
}

.tab-btn {
  background: linear-gradient(180deg, #241712 0%, #150d09 100%);
  border: 2px solid #5a3821;
  border-top-color: #8c5d35;
  border-bottom-color: #382012;
  border-radius: 4px;
  color: #c9a776;
  padding: 10px 18px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    inset 0 0 0 2px #180f0c, 
    inset 0 0 0 3px #6e462a, 
    0 3px 6px rgba(0, 0, 0, 0.75);
  text-shadow: 1px 1px 2px #000;
  white-space: nowrap;
  position: relative;
}

.tab-btn:hover {
  background: linear-gradient(180deg, #342017 0%, #1c110c 100%);
  color: #f5e0b8;
  border-color: #a46d3e;
  border-top-color: #d1975e;
  border-bottom-color: #5a3821;
  box-shadow: 
    inset 0 0 0 2px #1c110c, 
    inset 0 0 0 3px #9d683e, 
    0 4px 10px rgba(0, 0, 0, 0.85),
    0 0 10px rgba(217, 119, 6, 0.25);
}

.tab-btn:active {
  box-shadow: 
    inset 0 0 0 2px #120b08, 
    inset 0 0 0 3px #5a3821, 
    0 2px 4px rgba(0, 0, 0, 0.6);
}

.tab-btn.active {
  background: linear-gradient(180deg, #3c2417 0%, #22130b 100%);
  border: 2px solid #d97706;
  border-top-color: #fde68a;
  border-bottom-color: #92400e;
  color: #fde047;
  box-shadow: 
    inset 0 0 0 2px #1a0f09, 
    inset 0 0 0 3px #d97706, 
    inset 0 0 12px rgba(245, 158, 11, 0.35), 
    0 4px 12px rgba(0, 0, 0, 0.9), 
    0 0 14px rgba(245, 158, 11, 0.45);
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.7), 1px 1px 2px #000;
}

/* View Containers */
.view-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-panel.active {
  display: block;
}

/* Grid & Layout System */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

/* Clean Adventure Map (Seamless without border box) */
.vertical-stage-map {
  position: relative;
  width: 100%;
  max-width: 700px;
  height: 480px;
  margin: 10px auto 30px auto;
  background: transparent;
  border: none;
  overflow: visible;
  box-shadow: none;
}

.map-svg-trail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.map-road-clean-dash {
  stroke: rgba(251, 191, 36, 0.55);
  stroke-width: 1.2;
  stroke-dasharray: 2.5, 2.5;
  stroke-linecap: round;
  fill: none;
}

/* Stage Node: Direct Pixel Art Building with Badges */
.stage-node-wrapper {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stage-node-wrapper:hover {
  transform: translate(-50%, -52%) scale(1.12);
}

.stage-node-time-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 12;
}

.stage-node-building-box {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.7));
  transition: all 0.2s ease;
  z-index: 11;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.4) 70%, transparent 100%);
  border-radius: 50%;
}

.stage-node-building-box img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  image-rendering: pixelated;
}

.stage-node-wrapper.current .stage-node-building-box {
  filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.8));
}

.stage-node-wrapper.dungeon .stage-node-building-box {
  background: radial-gradient(circle, rgba(20, 83, 45, 0.95) 0%, rgba(20, 83, 45, 0.5) 70%, transparent 100%);
  border: 2px solid #22c55e;
  filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.75));
}

.stage-node-wrapper.locked {
  opacity: 1;
  filter: grayscale(1);
}

.stage-node-wrapper.locked .stage-node-building-box {
  background: radial-gradient(circle, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 70%, transparent 100%);
}

.stage-node-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.92);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 4px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  z-index: 12;
}

/* Walking Hero Pin */
.hero-map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 25;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: heroBounce 1s infinite alternate ease-in-out;
  transition: left 0.4s linear, top 0.4s linear;
}

.hero-pin-bubble {
  background: var(--accent);
  color: #000;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  box-shadow: 0 0 15px var(--accent-glow);
  white-space: nowrap;
  margin-bottom: 2px;
}

.hero-pin-sprite {
  font-size: 1.6rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: linear-gradient(180deg, #24140b 0%, #160c07 100%);
  border: 2px solid #5a351f;
  border-top-color: #8a5734;
  border-radius: 8px;
  box-shadow: 0 4px 0 #0d0603, 0 8px 18px rgba(0, 0, 0, 0.75);
  padding: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-header {
  background: linear-gradient(180deg, #2e1a10 0%, #1c0e08 100%);
  border-bottom: 2px solid #5a351f;
  border-top: 1px solid rgba(253, 186, 116, 0.15);
  padding: 12px 20px;
  min-height: 76px;
  box-sizing: border-box;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title,
.modern-header-title {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: 0.3px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc,
.modern-header-desc {
  font-family: var(--font-ui);
  font-size: 13px;
  color: #fed7aa;
  font-weight: 500;
  line-height: 1.35;
  margin: 3px 0 0 0;
}

.card > div:not(.card-header),
.card > p,
.card > form {
  padding: 16px;
}

.card > p {
  padding-bottom: 0;
}

/* The Tower - Action Buttons based on Tab Standard */
.btn {
  background: linear-gradient(180deg, #241712 0%, #150d09 100%);
  border: 2px solid #5a3821;
  border-top-color: #8c5d35;
  border-bottom-color: #382012;
  border-radius: 4px;
  color: #c9a776;
  padding: 9px 18px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    inset 0 0 0 2px #180f0c, 
    inset 0 0 0 3px #6e462a;
  text-shadow: 1px 1px 2px #000;
  white-space: nowrap;
  position: relative;
}

.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #342017 0%, #1c110c 100%);
  color: #f5e0b8;
  border-color: #a46d3e;
  border-top-color: #d1975e;
  border-bottom-color: #5a3821;
  box-shadow: 
    inset 0 0 0 2px #1c110c, 
    inset 0 0 0 3px #9d683e;
}

.btn:active:not(:disabled) {
  background: linear-gradient(180deg, #180f0a 0%, #241712 100%);
  box-shadow: 
    inset 0 0 0 2px #120b08, 
    inset 0 0 0 3px #5a3821;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.85);
  box-shadow: none;
}

/* Primary / Accent Action Buttons (Gold Theme like Tab Active) */
.btn-primary,
.btn-accent {
  background: linear-gradient(180deg, #3c2417 0%, #22130b 100%);
  border: 2px solid #d97706;
  border-top-color: #fde68a;
  border-bottom-color: #92400e;
  color: #fde047;
  box-shadow: 
    inset 0 0 0 2px #1a0f09, 
    inset 0 0 0 3px #d97706;
  text-shadow: 1px 1px 2px #000;
}

.btn-primary:hover:not(:disabled),
.btn-accent:hover:not(:disabled) {
  background: linear-gradient(180deg, #4d2f1f 0%, #2c190f 100%);
  color: #ffffff;
  border-color: #f59e0b;
  border-top-color: #fef08a;
  border-bottom-color: #b45309;
  box-shadow: 
    inset 0 0 0 2px #1c110c, 
    inset 0 0 0 3px #f59e0b;
}

.btn-primary:active:not(:disabled),
.btn-accent:active:not(:disabled) {
  background: linear-gradient(180deg, #1f1109 0%, #341f14 100%);
  box-shadow: 
    inset 0 0 0 2px #120b08, 
    inset 0 0 0 3px #92400e;
}

/* Danger Buttons (Ruby / Crimson Theme) */
.btn-danger {
  background: linear-gradient(180deg, #301311 0%, #1c0a09 100%);
  border: 2px solid #7f1d1d;
  border-top-color: #f87171;
  border-bottom-color: #450a0a;
  color: #fca5a5;
  box-shadow: 
    inset 0 0 0 2px #150605, 
    inset 0 0 0 3px #5c1414;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #421815 0%, #260d0b 100%);
  color: #ffffff;
  border-color: #dc2626;
  border-top-color: #fca5a5;
  border-bottom-color: #7f1d1d;
  box-shadow: 
    inset 0 0 0 2px #1a0807, 
    inset 0 0 0 3px #991b1b;
}

.btn-danger:active:not(:disabled) {
  background: linear-gradient(180deg, #150605 0%, #2b0e0c 100%);
  box-shadow: 
    inset 0 0 0 2px #0d0303, 
    inset 0 0 0 3px #450a0a;
}

/* Outline / Discreet Buttons */
.btn-outline {
  background: linear-gradient(180deg, #1c130f 0%, #110b08 100%);
  border: 2px solid #4a2e1b;
  border-top-color: #6e462a;
  border-bottom-color: #29180e;
  color: #a88d6c;
  box-shadow: 
    inset 0 0 0 2px #120b08, 
    inset 0 0 0 3px #3d2417;
}

.btn-outline:hover:not(:disabled) {
  background: linear-gradient(180deg, #281a13 0%, #170d09 100%);
  color: #e2cca6;
  border-color: #6e462a;
  border-top-color: #8c5d35;
  border-bottom-color: #382012;
  box-shadow: 
    inset 0 0 0 2px #160e0a, 
    inset 0 0 0 3px #5a3821;
}

.btn-outline:active:not(:disabled) {
  background: linear-gradient(180deg, #0e0705 0%, #180f0b 100%);
  box-shadow: 
    inset 0 0 0 2px #0a0503, 
    inset 0 0 0 3px #2d1a10;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.82rem;
}

.btn-md {
  padding: 9px 18px;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1.02rem;
}

/* Modal Close Button (Square Tab-Frame with Crossed X) */
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  background: linear-gradient(180deg, #241712 0%, #150d09 100%);
  border: 2px solid #5a3821;
  border-top-color: #8c5d35;
  border-bottom-color: #382012;
  border-radius: 4px;
  box-shadow: 
    inset 0 0 0 2px #180f0c, 
    inset 0 0 0 3px #6e462a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
}

.modal-close-btn::before,
.modal-close-btn::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 2.5px;
  background: #c9a776;
  border-radius: 1px;
  box-shadow: 0 1px 0 #180f0c;
  transition: all 0.18s ease;
}

.modal-close-btn::before {
  transform: rotate(45deg);
}

.modal-close-btn::after {
  transform: rotate(-45deg);
}

.modal-close-btn:hover {
  background: linear-gradient(180deg, #342017 0%, #1c110c 100%);
  border-color: #a46d3e;
  border-top-color: #d1975e;
  border-bottom-color: #5a3821;
  box-shadow: 
    inset 0 0 0 2px #1c110c, 
    inset 0 0 0 3px #9d683e;
}

.modal-close-btn:hover::before,
.modal-close-btn:hover::after {
  background: #f5e0b8;
}

.modal-close-btn:active {
  background: linear-gradient(180deg, #180f0a 0%, #241712 100%);
  box-shadow: 
    inset 0 0 0 2px #120b08, 
    inset 0 0 0 3px #5a3821;
}

/* Progress Bars */
.progress-bar-container {
  background: #090a10;
  border: 2px solid #1e293b;
  border-radius: 6px;
  height: 16px;
  width: 100%;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 999px;
  position: relative;
}

.progress-fill.hp {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 10px var(--danger-glow);
}

.progress-fill.mp {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  box-shadow: 0 0 10px var(--mana-glow);
}

.progress-fill.exp {
  background: linear-gradient(90deg, #8b5cf6, #c084fc);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
}

/* Character Sheet View - CraftPix Pedestal & Parchment */
.char-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #180f0a;
  border: 2px solid #3d2315;
  border-radius: 6px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.avatar-canvas {
  image-rendering: pixelated;
  background: radial-gradient(circle, #3d2315 0%, #160c07 100%);
  border: 3px solid #7e4f30;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.9), inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #180f0a;
  border: 2px solid #3d2315;
  border-radius: 4px;
  margin-bottom: 6px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #eedcbe;
}

.stat-val-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-value {
  font-family: var(--font-retro);
  font-size: 0.85rem;
  color: #fde047;
  text-shadow: 1px 1px 0 #000;
}

.add-stat-btn {
  background: linear-gradient(180deg, #3c2417 0%, #22130b 100%);
  border: 2px solid #d97706;
  border-top-color: #fde68a;
  border-bottom-color: #92400e;
  color: #fde047;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 0 0 1px #1a0f09, 
    inset 0 0 0 2px #d97706;
  transition: all 0.15s ease;
  outline: none;
}

.add-stat-btn:hover {
  background: linear-gradient(180deg, #4d2f1f 0%, #2c190f 100%);
  color: #ffffff;
  border-color: #f59e0b;
  border-top-color: #fef08a;
  box-shadow: 
    inset 0 0 0 1px #1c110c, 
    inset 0 0 0 2px #f59e0b;
}

.add-stat-btn:active {
  background: linear-gradient(180deg, #1f1109 0%, #341f14 100%);
  box-shadow: 
    inset 0 0 0 1px #120b08, 
    inset 0 0 0 2px #92400e;
}

/* Inventory & Equipment View - CraftPix Inset Slots */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.equip-slot {
  background: #180f0a;
  border: 2px dashed #4a2d1b;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.equip-slot:hover {
  border-color: #48bb78;
  background: #24150d;
}

/* Full Body Paperdoll Container & Overlay Slots */
.paperdoll-container {
  position: relative;
  width: 360px;
  height: 440px;
  margin: 10px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.paperdoll-hero-img {
  width: 350px;
  height: 420px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.95));
  z-index: 2;
  user-select: none;
  pointer-events: none;
}

.paperdoll-pedestal-shadow {
  position: absolute;
  top: 392px;
  left: 50%;
  transform: translateX(-50%);
  width: 175px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 45%, transparent 75%);
  z-index: 1;
}

.paperdoll-slot {
  position: absolute;
  width: 50px;
  height: 50px;
  padding: 2px;
  box-sizing: border-box;
  background: rgba(32, 19, 12, 0.96);
  backdrop-filter: blur(4px);
  border: 2px solid #6c4127;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.85), inset 0 0 6px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  overflow: hidden;
}

.paperdoll-slot .slot-icon {
  font-size: 1.4rem;
  line-height: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.paperdoll-slot .slot-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Grayscale silhouette placeholder icons when slot is empty (Bright & No Hover Changes) */
.paperdoll-slot .slot-placeholder-img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: grayscale(100%) brightness(1.3) contrast(1.15);
  opacity: 0.82;
  pointer-events: none;
}

.paperdoll-slot.filled .slot-placeholder-img {
  display: none;
}

/* Inventory grid decoupling so left side is independent */
#view-inventory .grid-2 {
  align-items: start;
}

/* Specific Slot Positions over the Character's Body (10 Slots Exact Layout) */
.slot-pos-helmet {
  top: 55px;
  left: 50%;
  transform: translateX(-50%);
}

.slot-pos-amulet {
  top: 55px;
  right: 26px;
}

.slot-pos-ring1 {
  top: 125px;
  left: 26px;
}

.slot-pos-ring2 {
  top: 125px;
  right: 26px;
}

.slot-pos-armor {
  top: 148px;
  left: 50%;
  transform: translateX(-50%);
}

.slot-pos-gloves {
  top: 195px;
  left: 26px;
}

.slot-pos-weapon {
  top: 265px;
  left: 26px;
}

.slot-pos-off_hand {
  top: 265px;
  right: 26px;
}

.slot-pos-pants {
  top: 250px;
  left: 50%;
  transform: translateX(-50%);
}

.slot-pos-boots {
  top: 338px;
  left: 50%;
  transform: translateX(-50%);
}

/* Paperdoll Filled Slots, Inventory Icons & Tooltip Icons with Dynamic Rarity Gradients */
.paperdoll-slot.filled.common, .item-card-icon.common, .tooltip-icon-box.common {
  background: radial-gradient(circle at 50% 50%, #2a374a 0%, #0d131f 90%);
  border-color: #64748b;
  box-shadow: 0 3px 0 #334155;
}

.paperdoll-slot.filled.uncommon, .item-card-icon.uncommon, .tooltip-icon-box.uncommon {
  background: radial-gradient(circle at 50% 50%, #065f46 0%, #021a14 90%);
  border-color: #22c55e;
  box-shadow: 0 3px 0 #15803d, 0 0 10px rgba(34, 197, 94, 0.3);
}

.paperdoll-slot.filled.rare, .item-card-icon.rare, .tooltip-icon-box.rare {
  background: radial-gradient(circle at 50% 50%, #1e40af 0%, #081229 90%);
  border-color: #3b82f6;
  box-shadow: 0 3px 0 #1d4ed8, 0 0 12px rgba(59, 130, 246, 0.4);
}

.paperdoll-slot.filled.epic, .item-card-icon.epic, .tooltip-icon-box.epic {
  background: radial-gradient(circle at 50% 50%, #6b21a8 0%, #160626 90%);
  border-color: #a855f7;
  box-shadow: 0 3px 0 #7e22ce, 0 0 14px rgba(168, 85, 247, 0.5);
}

.paperdoll-slot.filled.legendary, .item-card-icon.legendary, .tooltip-icon-box.legendary {
  background: radial-gradient(circle at 50% 50%, #b45309 0%, #260a02 90%);
  border-color: #f59e0b;
  box-shadow: 0 3px 0 #b45309, 0 0 18px rgba(245, 158, 11, 0.6);
}

.paperdoll-slot.filled.mythic, .item-card-icon.mythic, .tooltip-icon-box.mythic {
  background: radial-gradient(circle at 50% 50%, #9f1239 0%, #24030c 90%);
  border-color: #f43f5e;
  box-shadow: 0 3px 0 #9f1239, 0 0 20px rgba(244, 63, 94, 0.65);
}

.item-card-icon {
  width: 44px;
  height: 44px;
  padding: 3px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3d2315;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
}

.item-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Global RPG Floating Item Tooltip */
.rpg-item-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  background: linear-gradient(180deg, #25160e 0%, #140a06 100%);
  border: 2px solid #5a351f;
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 220px;
  max-width: 300px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-ui);
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
}

.tooltip-icon-box {
  width: 44px;
  height: 44px;
  padding: 3px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3d2315;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
}

.tooltip-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.tooltip-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.tooltip-title {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.2;
}

.tooltip-rarity {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.tooltip-stats {
  font-size: 0.78rem;
  color: #eedcbe;
  line-height: 1.4;
}

.tooltip-passive {
  font-size: 0.74rem;
  color: #4ade80;
  font-weight: 700;
}

.tooltip-footer {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
  margin-top: 2px;
}

.item-badge-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

/* Tavern & Chat View - CraftPix Tavern Ledger */
.chat-container, .chat-box {
  display: flex;
  flex-direction: column;
  height: 380px;
  background: #140b07;
  border: 2px solid #4a2d1b;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: radial-gradient(circle at 50% 50%, #1e110a 0%, #120804 100%);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: #120804;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #54341f;
  border-radius: 3px;
}

.chat-msg {
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
  color: #eedcbe;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.chat-msg.system {
  color: #fde047;
  font-style: italic;
  font-size: 0.82rem;
  background: rgba(253, 224, 71, 0.08);
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 3px solid #eab308;
}

.chat-user {
  font-weight: 800;
  color: #60a5fa;
}

.chat-time {
  font-size: 0.72rem;
  color: #8c735d;
  margin-left: 4px;
}

/* Chat Input Bar */
.chat-input-bar, .chat-input-area {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #2b1a10 0%, #1a0f0a 100%);
  border-top: 2px solid #4a2d1b;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.5);
  align-items: center;
}

.chat-input-bar input, .chat-input {
  flex: 1;
  background: #0f0804;
  border: 2px solid #3d2315;
  border-radius: 4px;
  color: #faebd7;
  padding: 9px 12px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input-bar input:focus, .chat-input:focus {
  border-color: #48bb78;
  background: #140b06;
  box-shadow: 0 0 8px rgba(72, 187, 120, 0.35);
}

.chat-input-bar input::placeholder {
  color: #785a44;
}

/* Online Players List */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.player-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #180f0a;
  border: 2px solid #3d2315;
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.04);
}

.player-list-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Character Creation Selection Cards */
.gender-select-card, .class-select-card {
  background: linear-gradient(180deg, #1f120a 0%, #120905 100%) !important;
  border: 2px solid #5a351f !important;
  border-top-color: #7a482b !important;
  border-radius: 6px !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 2px 0 #0d0603 !important;
}

.gender-select-card:hover, .class-select-card:hover {
  background: linear-gradient(180deg, #2a180e 0%, #180d07 100%) !important;
  border-color: #8c5733 !important;
  border-top-color: #b87647 !important;
}

.gender-select-card.selected, .class-select-card.selected {
  background: linear-gradient(180deg, #382012 0%, #1e1008 100%) !important;
  border: 2px solid #d97706 !important;
  border-top-color: #fde68a !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3), 0 2px 0 #0d0603 !important;
}

/* Battle Arena View (Combat) */
.combat-view-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.4s ease;
}

.combat-arena {
  background: #0d0f17 url('/assets/backgrounds/default.png') center bottom / cover no-repeat;
  border: 2px solid #5a351f;
  border-top-color: #8a5734;
  border-radius: 8px;
  width: 100%;
  aspect-ratio: 1200 / 500;
  min-height: 320px;
  max-height: 480px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px 40px 0px 40px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 4px 0 #0d0603, 0 8px 18px rgba(0, 0, 0, 0.75);
  image-rendering: pixelated;
}

.combat-ground {
  display: none;
}

/* Fighter Pod & Ground Alignment (Ajuste manual da altura do chão de Batalha aqui) */
.fighter-pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  width: 220px;
  position: relative;
  margin-bottom: 25px; /* <-- Alinhado exatamente aos 30px da viagem (20px margem + 10px baseline do canvas) */
}

.fighter-sprite-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 180px;
  height: auto;
  width: 100%;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fighter-sprite-wrapper canvas {
  width: auto;
  height: auto;
  image-rendering: pixelated;
}

.fighter-sprite-wrapper.attacking {
  animation: attackLunge 0.3s ease;
}

.fighter-sprite-wrapper.hit {
  animation: hitShake 0.4s ease;
}

@keyframes attackLunge {
  0% { transform: translateX(0); }
  50% { transform: translateX(40px) scale(1.1); }
  100% { transform: translateX(0); }
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  25% { transform: translateX(-12px); filter: brightness(2) drop-shadow(0 0 10px #ef4444); }
  50% { transform: translateX(12px); }
  75% { transform: translateX(-6px); }
}

.floating-damage {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-retro);
  font-size: 1.2rem;
  font-weight: 900;
  color: #f87171;
  text-shadow: 2px 2px 0 #000;
  animation: floatUp 1.2s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: 100;
}

.floating-damage.crit {
  color: #fbbf24;
  font-size: 1.5rem;
  text-shadow: 2px 2px 0 #000, 0 0 12px var(--accent-glow);
}

.floating-damage.heal {
  color: #34d399;
  font-size: 1.3rem;
}

.floating-damage.dodge {
  color: #94a3b8;
  font-size: 1rem;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -15px) scale(1.2); }
  80% { opacity: 1; transform: translate(-50%, -35px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55px) scale(0.8); }
}

.turn-indicator-banner {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 18, 29, 0.9);
  border: 1px solid var(--border-highlight);
  border-radius: 20px;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-retro);
  font-size: 0.8rem;
  color: #fbbf24;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  z-index: 20;
}

/* Combat Actions Dock */
.combat-actions-dock {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.action-buttons-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.skill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  position: relative;
}

.skill-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.skill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.skill-cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-retro);
  font-size: 1.1rem;
  color: #f87171;
}

/* Combat Log */
.combat-log-card {
  background: linear-gradient(180deg, #24140b 0%, #160c07 100%);
  border: 2px solid #5a351f;
  border-top-color: #8a5734;
  border-radius: 8px;
  box-shadow: 0 4px 0 #0d0603, 0 8px 18px rgba(0, 0, 0, 0.75);
  height: 140px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.combat-log-item {
  padding: 2px 0;
}

.combat-log-item.critical {
  color: #fbbf24;
  font-weight: 700;
}

.combat-log-item.heal {
  color: #34d399;
}

.combat-log-item.debuff {
  color: #c084fc;
}

.combat-log-item.dodge {
  color: #94a3b8;
}

/* Modal Windows - The Tower Standard */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 6, 4, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: linear-gradient(180deg, #24140b 0%, #160c07 100%);
  border: 2px solid #5a351f;
  border-top-color: #8a5734;
  border-radius: 8px;
  box-shadow: 0 6px 0 #0d0603, 0 16px 40px rgba(0, 0, 0, 0.95);
  padding: 24px;
  width: 90%;
  max-width: 480px;
  animation: modalScale 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: linear-gradient(180deg, #24140b 0%, #160c07 100%);
  border: 2px solid #5a351f;
  border-top-color: #8a5734;
  border-radius: 8px;
  box-shadow: 0 4px 0 #0d0603, 0 8px 20px rgba(0, 0, 0, 0.8);
  padding: 10px 16px;
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.success { border-left: 4px solid #48bb78; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #3b82f6; }
.toast.warning { border-left: 4px solid #f59e0b; }

@keyframes toastIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .combat-arena { height: 260px; padding: 10px; }
  .fighter-pod { width: 140px; }
}

/* Overworld Stage Map Container - 100% Full Width Edge-to-Edge */
#overworld-map-card,
.overworld-map-card {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 0 20px 0 !important;
  background: linear-gradient(180deg, #24140b 0%, #160c07 100%) !important;
  border: 2px solid #5a351f !important;
  border-top-color: #8a5734 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 0 #0d0603, 0 8px 18px rgba(0, 0, 0, 0.75) !important;
}

#overworld-map-card #tower-map-nodes.vertical-stage-map,
#tower-map-nodes.vertical-stage-map {
  width: 100% !important;
  min-width: 100% !important;
  display: block !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  background: #120904 !important;
}

#overworld-map-card img.overworld-map-bg-img,
img.overworld-map-bg-img {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* Live Exploration & Travel Viewport */
#overworld-map-card #tower-map-nodes.live-exploration-viewport,
#tower-map-nodes.live-exploration-viewport,
.live-exploration-viewport {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 1200 / 500 !important;
  min-height: 320px !important;
  max-height: 480px !important;
  border-radius: 0 0 6px 6px !important;
  overflow: hidden !important;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.85) !important;
  animation: fadeIn 0.4s ease !important;
  box-sizing: border-box !important;
  background-color: #0d0f17 !important;
  background-size: cover !important;
  background-position: center bottom !important;
  background-repeat: no-repeat !important;
  image-rendering: pixelated !important;
  line-height: normal !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Live Hero Stage (Ajuste manual da altura do chão de Viagem/Exploração aqui) */
.exploration-hero-stage {
  position: absolute;
  bottom: 30px; /* <-- AJUSTE AQUI: Altura do herói em relação à estrada do cenário de viagem */
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.exploration-hero-stage canvas {
  width: auto;
  height: auto;
  image-rendering: pixelated;
  animation: walkBounce 0.4s infinite alternate ease-in-out;
}

@keyframes walkBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.exploration-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(13, 15, 26, 0.92) 0%, rgba(13, 15, 26, 0.6) 75%, transparent 100%);
  padding: 10px 18px 14px 18px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exploration-bar-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fef08a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Overworld Interactive Nodes & Lucide Map Pin */
.overworld-map-wrapper {
  position: relative;
  width: 100%;
  line-height: 0;
  display: block;
}

.map-node-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

/* Floating Lucide Map-Pin Indicator (Você Está Aqui) - Clean floating text & icon */
.map-player-pin-indicator {
  position: absolute;
  top: -22px;
  left: 48%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.9);
  animation: pinFloat 0.5s infinite alternate ease-in-out;
  pointer-events: none;
  z-index: 25;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.95));
}

.map-player-pin-indicator svg,
.map-player-pin-indicator i,
.player-pin-lucide {
  width: 14px !important;
  height: 14px !important;
  stroke: #ef4444 !important; /* <-- Cor Vermelha do Pin */
  fill: rgba(239, 68, 68, 0.3) !important; /* Preenchimento translúcido opcional */
  display: inline-block !important;
  vertical-align: middle !important;
}

@keyframes pinFloat {
  0% { transform: translate(-50%, 0); }
  100% { transform: translate(-50%, -6px); }
}

.map-node-badge {
  background: linear-gradient(180deg, #2c1b12 0%, #180f0c 100%);
  border: 2px solid #6e462a;
  border-top-color: #a77045;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #140c08, 0 4px 12px rgba(0, 0, 0, 0.9);
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #faebd7;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.map-node-name {
  line-height: 1.2;
}

.map-node-pin:hover .map-node-badge {
  border-color: #f59e0b;
  border-top-color: #fbbf24;
  box-shadow: inset 0 0 0 1px #140c08, 0 0 16px rgba(245, 158, 11, 0.6);
  color: #ffffff;
}

.map-node-pin.current-location .map-node-badge {
  border-color: #22c55e;
  border-top-color: #4ade80;
  box-shadow: inset 0 0 0 1px #052e16, 0 0 14px rgba(34, 197, 94, 0.55);
  color: #86efac;
}

/* Boss Chamber Style */
.map-node-pin.node-type-boss .map-node-badge {
  border-color: #7f1d1d;
  border-top-color: #ef4444;
  color: #fca5a5;
}

.map-node-pin.node-type-boss:hover .map-node-badge {
  border-color: #ef4444;
  border-top-color: #f87171;
  box-shadow: inset 0 0 0 1px #450a0a, 0 0 16px rgba(239, 68, 68, 0.6);
  color: #ffffff;
}

/* Secret Dungeon Style */
.map-node-pin.node-type-dungeon .map-node-badge {
  border-color: #581c87;
  border-top-color: #a855f7;
  color: #d8b4fe;
}

.map-node-pin.node-type-dungeon:hover .map-node-badge {
  border-color: #a855f7;
  border-top-color: #c084fc;
  box-shadow: inset 0 0 0 1px #2e1065, 0 0 16px rgba(168, 85, 247, 0.6);
  color: #ffffff;
}
