/* =========================
   HUD
========================= */
#hudSection{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px;
  border-radius:var(--radius);
  border:2px solid var(--ui-border);
  background:var(--panel-gradient);
  min-width:220px;
}
#hudSection button,
#optionsSection button {
  width: 100%;
  min-height: 44px;
  background: var(--window-surface-soft, rgba(18, 22, 34, 0.92)) !important;
  border: 1px solid var(--window-border, rgba(245, 158, 11, 0.35)) !important;
  color: var(--window-text, #f8fafc) !important;
  border-radius: var(--window-radius-sm, 10px) !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

#hudSection button:hover,
#optionsSection button:hover:not(#openShopBtn):not(#exitDungeonBtn) {
  border-color: var(--window-accent, #f59e0b) !important;
  color: #ffffff !important;
  background: var(--window-accent-soft, rgba(245, 158, 11, 0.18)) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--window-accent-soft, rgba(245, 158, 11, 0.25)) !important;
}

@media (min-width: 1025px) {
  #hudSection {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 8px;
    overflow-y: auto;
  }

  #hudSection button {
    min-height: 48px;
    margin: 0;
  }
}
#hudShortcutHint,
#optionsShortcutHint{margin:0;font-size:0.9rem;color:#d7ccb4;line-height:1.35;}
#optionsShortcutHint{margin-top:auto;}

#hud{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#hud > div{
  background:linear-gradient(180deg,#1d1813,#15110d);
  border:1px solid #5f4827;
  border-radius:10px;
  padding:8px;
  color:#e5dcc9;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:0.95rem;
}

.statsCard{
  width:min(560px, calc(100vw - 24px));
  max-height:85vh;
  display:flex;
  flex-direction:column;
  overflow:hidden !important;
}

.statsCard .overlayCardHeader{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
  gap:8px 12px;
  padding:14px 16px 10px;
}

.statsCard .overlayCardHeader > div{
  min-width:0;
  display:grid;
  gap:4px;
}

.statsCard .overlayCardHeader h2{
  font-size:clamp(0.98rem,1.3vw,1.3rem);
  line-height:1.08;
}

.statsCard .overlayCardHeader p{
  font-size:clamp(0.7rem,0.85vw,0.84rem);
  line-height:1.28;
  max-width:42ch;
}

#closeStatsPanelBtn{
  min-height:32px !important;
  padding:6px 12px !important;
  border-radius:8px !important;
  font-size:0.7rem !important;
  line-height:1 !important;
  align-self:start;
  justify-self:end;
}

.overlayStatsGrid{
  flex:1;
  overflow-y:auto;
  min-height:0;
  padding:0 16px 16px;
}

.statItem{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  background:#1d1813;
  border:1px solid #5f4827;
  border-radius:14px;
  font-size:0.84rem;
}
.statItem span{margin-left:auto;color:var(--ui-gold);font-weight:bold}

.xpBarContainer{
  grid-column:1 / -1;
  display:block !important;
  margin-top:6px !important;
  margin-bottom:8px !important;
  padding:10px 12px;
  background:#1d1813;
  border:1px solid #5f4827;
  border-radius:14px;
}

#hud > .xpBarContainer{
  display:grid !important;
  gap:7px;
  align-items:stretch;
  justify-content:initial;
  min-height:72px;
}

.xpBarHeader{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:7px;
}

.xpBarBadge{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:20px;
  padding:0 8px;
  border-radius:999px;
  background:linear-gradient(180deg,#7a5a23,#4f3916);
  border:1px solid rgba(216,180,106,0.5);
  color:#fff0c8;
  font-size:0.68rem;
  font-weight:700;
  letter-spacing:0.08em;
}

.xpBarLabel{
  color:#d7ccb4;
  font-size:0.82rem;
  font-weight:600;
}

.xpBarOuter{
  width:100%;
  background:#0d0a07;
  border:1.5px solid #d8b46a;
  border-radius:999px;
  height:16px;
  overflow:hidden;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:inset 0 3px 8px rgba(0,0,0,0.85), 0 2px 4px rgba(0,0,0,0.5);
}

.xpBarInner{
  background:linear-gradient(90deg,#1b7ba9,#3498db,#00d2ff);
  height:100%;
  width:0%;
  transition:width 0.4s cubic-bezier(0.1,0.8,0.2,1);
  position:absolute;
  left:0;
  top:0;
  box-shadow:0 0 10px rgba(52,152,219,0.6);
}

.xpBarGloss{
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 100%);
  pointer-events:none;
  z-index:1;
}

.xpBarValue{
  position:relative;
  font-size:0.68rem;
  font-weight:700;
  color:#ffffff;
  text-shadow:0 1px 3px #000, 0 0 5px #000, 0 0 8px #000;
  z-index:2;
  font-family:'Outfit', 'Inter', monospace;
  letter-spacing:0.03em;
}

.statItem--allocatable{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:8px;
}

.statItem--allocatable > span{
  margin-left:0;
}

.statAllocGroup{
  display:flex !important;
  align-items:center !important;
  gap:3px !important;
  flex:0 0 auto;
  justify-content:flex-start;
  background:linear-gradient(180deg, rgba(34,24,15,0.96), rgba(20,14,9,0.96)) !important;
  border:1px solid rgba(221, 190, 118, 0.45) !important;
  padding:2px 3px !important;
  border-radius:999px !important;
  min-height:auto !important;
}

.statAllocInput{
  width:32px !important;
  height:24px !important;
  text-align:center;
  background:transparent !important;
  border:none !important;
  border-radius:0 !important;
  color:#fff !important;
  font-size:0.78rem !important;
  padding:0 2px !important;
  appearance:textfield;
  -moz-appearance:textfield;
}

.statAllocInput::-webkit-outer-spin-button,
.statAllocInput::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

.statAllocGroup .statPlusBtn{
  width:24px;
  height:24px;
  border:none;
  border-left:1px solid rgba(221, 190, 118, 0.32);
  border-radius:999px;
  background:transparent;
}

/* =========================
   OPTIONS
========================= */
#optionsSection{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px;
  border-radius:var(--radius);
  border:2px solid var(--ui-border);
  background:var(--panel-gradient);
  align-items:stretch;
}

