:root {
  --bg-dark: #0b0f19;
  --panel-bg: rgba(15, 22, 38, 0.92);
  --border-glow: rgba(255, 196, 86, 0.38);
  --gold: #ffc456;
  --red: #ff4757;
  --green: #2ed573;
  --blue: #38bdf8;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  touch-action: none;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* Punicon Virtual Joystick */
#punicon-ring {
  position: fixed;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px solid rgba(255, 196, 86, 0.72);
  background: rgba(255, 196, 86, 0.12);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 25;
}

#punicon-knob {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe09e, #f59e0b);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.75);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Radial Hold Charge Ring */
#charge-ring {
  position: fixed;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 26;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

#charge-fill {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(#38bdf8 0deg, transparent 0deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
}

#charge-label {
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 1px 4px #000;
  z-index: 1;
}

/* Damage Numbers */
#damage-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

.dmg-float {
  position: absolute;
  font-weight: 800;
  font-size: 20px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.92);
  transform: translate(-50%, -50%);
  animation: floatUp 0.85s ease-out forwards;
  white-space: nowrap;
}

.dmg-crit { color: #ffd32a; font-size: 26px; }
.dmg-weak { color: #38bdf8; font-size: 25px; }
.dmg-resist { color: #94a3b8; font-size: 17px; }
.dmg-player { color: #ff4757; font-size: 22px; }
.dmg-heal { color: #2ed573; font-size: 22px; }
.dmg-magi { color: #ff9f43; font-size: 28px; }
.dmg-special { color: #f472b6; font-size: 27px; }
.dmg-just { color: #38bdf8; font-size: 24px; letter-spacing: 0.5px; }

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.9); }
  25% { opacity: 1; transform: translate(-50%, -88%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -155%) scale(0.95); }
}

/* Top Boss HUD */
#boss-hud {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, 90vw);
  background: rgba(10, 14, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 12px;
  backdrop-filter: blur(6px);
  z-index: 30;
  pointer-events: none;
}

.boss-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-weight: 700;
  font-size: 14px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  background: #3b82f6;
  color: #fff;
}

.rank-A { background: #f97316; }
.rank-S { background: #06b6d4; }
.rank-SS { background: linear-gradient(135deg, #ec4899, #eab308); }

.elem-badge {
  font-size: 14px;
}

#boss-hp-text {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.boss-bar-track {
  height: 13px;
}

.stagger-bar-track {
  height: 6px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.12s linear;
}

.boss-hp-fill {
  background: linear-gradient(90deg, #dc2626, #f97316);
}

.stagger-fill {
  width: 0%;
  background: linear-gradient(90deg, #eab308, #fef08a);
}

.boss-status {
  margin-top: 4px;
  font-size: 12px;
  color: #fca5a5;
  min-height: 15px;
  text-align: center;
  font-weight: 700;
}

/* Field Banner */
#field-hud {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}

.field-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid rgba(46, 213, 115, 0.45);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.warp-btn {
  border: none;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #fff;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Top Right Controls */
#top-controls {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 40;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-btn, .pill-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.icon-btn:hover, .pill-btn:hover {
  border-color: var(--gold);
}

#buff-bar {
  position: fixed;
  top: 128px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 30;
  pointer-events: none;
  flex-wrap: wrap;
  justify-content: center;
}

.buff-pill {
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid #38bdf8;
  color: #e0f2fe;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* Bottom Player HUD - Right-Thumb Ergonomic */
#player-hud {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  z-index: 30;
  pointer-events: none;
}

.player-left-panel {
  max-width: 280px;
  flex: 1;
}

.player-stats {
  background: rgba(10, 14, 24, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
}

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

.heat-row {
  margin-top: 5px;
}

.stat-label {
  font-weight: 800;
  font-size: 11px;
  color: var(--green);
  min-width: 30px;
}

.heat-label {
  color: #fb923c;
}

.hp-track, .heat-track { flex: 1; height: 9px; }
.hp-fill { background: linear-gradient(90deg, #16a34a, #4ade80); }
.heat-fill {
  width: 0%;
  background: linear-gradient(90deg, #f97316, #facc15);
}

.stat-num {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 54px;
  text-align: right;
}

.weapon-badge {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right-Thumb Cluster */
.right-thumb-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
}

#weapon-swap-bar {
  display: flex;
  gap: 6px;
}

.swap-btn {
  width: 42px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swap-btn.active {
  border-color: var(--gold);
  background: rgba(255, 196, 86, 0.22);
  box-shadow: 0 0 10px rgba(255, 196, 86, 0.4);
}

.thumb-action-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

#magi-bar {
  display: flex;
  gap: 6px;
}

.magi-btn {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.1s, border-color 0.2s;
}

.magi-btn.ready {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(255, 196, 86, 0.55);
}

.magi-btn:active {
  transform: scale(0.93);
}

.magi-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.65), rgba(234, 88, 12, 0.45));
  transition: height 0.15s;
}

.magi-icon { font-size: 20px; z-index: 1; }
.magi-name { font-size: 9px; font-weight: 700; z-index: 1; max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.magi-key {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  color: var(--text-muted);
}

.dodge-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.6);
  background: rgba(15, 23, 42, 0.92);
  color: #e0f2fe;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.dodge-btn small { font-size: 10px; }
.dodge-btn:active { transform: scale(0.92); }

#control-hint {
  position: fixed;
  top: 12px;
  left: 12px;
  background: rgba(10, 14, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 20;
}

/* Overlays & Hub */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 50;
}

.hub-card {
  width: min(920px, 97vw);
  max-height: 92vh;
  background: var(--panel-bg);
  border: 1px solid var(--border-glow);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
}

.hub-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hub-title-row h1 {
  font-size: 20px;
  color: var(--gold);
}

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

.currency-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.currency-pill {
  background: rgba(255, 196, 86, 0.14);
  border: 1px solid rgba(255, 196, 86, 0.45);
  color: var(--gold);
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.ticket-pill {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
}

.hub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(255, 196, 86, 0.18);
  border-color: var(--gold);
  color: var(--gold);
}

.tab-panel {
  display: none;
  overflow-y: auto;
  padding-right: 4px;
}

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

.hunt-mode-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.section-title {
  font-size: 13px;
  color: var(--gold);
  margin: 8px 0 8px;
}

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

.item-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.item-card.equipped {
  border-color: var(--gold);
  background: rgba(255, 196, 86, 0.09);
}

.item-card.rare-boss {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.08);
}

.item-card h3 {
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.item-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.item-stats {
  font-size: 12px;
  color: #cbd5e1;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  border: none;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
}

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

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.gacha-banner {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gacha-result-banner {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 196, 86, 0.16);
  border: 1px solid rgba(255, 196, 86, 0.45);
  color: #fef08a;
  font-size: 12px;
}

.slots-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.slot-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 196, 86, 0.35);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  font-size: 12px;
}

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

.mat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Result Modal */
.result-card {
  width: min(440px, 92vw);
  background: var(--panel-bg);
  border: 1px solid var(--border-glow);
  border-radius: 18px;
  padding: 22px;
  text-align: center;
}

.result-card h2 {
  font-size: 26px;
  margin-bottom: 6px;
}

.loot-box {
  margin: 14px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
}

.result-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 640px) {
  #control-hint { display: none; }
  #top-controls { top: 8px; right: 8px; gap: 4px; }
  #top-controls .icon-btn, #top-controls .pill-btn { padding: 4px 7px; font-size: 11px; }
  #boss-hud, #field-hud { top: 48px; }
  .field-banner { padding: 5px 10px; font-size: 11px; gap: 6px; }
  .warp-btn { padding: 4px 8px; font-size: 11px; }
  #player-hud { left: 8px; right: 8px; bottom: 8px; gap: 6px; }
  .player-left-panel { min-width: 0; max-width: 162px; }
  .player-stats { padding: 6px 8px; }
  .stat-label { min-width: 24px; font-size: 10px; }
  .stat-num { min-width: 36px; font-size: 10px; }
  .weapon-badge { font-size: 10px; }
  .right-thumb-cluster { gap: 5px; }
  #magi-bar { gap: 4px; }
  .thumb-action-row { gap: 5px; }
  .magi-btn { width: 44px; height: 44px; border-radius: 11px; }
  .magi-icon { font-size: 17px; }
  .magi-name { font-size: 8px; max-width: 40px; }
  .dodge-btn { width: 50px; height: 50px; font-size: 16px; }
  .potion-btn { width: 42px; height: 42px; font-size: 15px; }
  .swap-btn { width: 34px; height: 30px; font-size: 14px; }
  .lobby-quick-bar { gap: 4px; }
  .quick-station-btn { padding: 6px 8px; font-size: 11px; }
  #lobby-hud { padding: 76px 8px 10px; }
  .lobby-pill { padding: 4px 8px; font-size: 11px; }
}

/* Town Lobby HUD */
#lobby-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 28;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 50px 12px 14px;
}

.lobby-top-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  pointer-events: auto;
}

.lobby-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 196, 86, 0.4);
  color: var(--text-main);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.elem-pill {
  cursor: pointer;
  border-color: #38bdf8;
  color: #e0f2fe;
}

.interact-btn {
  pointer-events: auto;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  border: 2px solid #fef08a;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.55);
  animation: pulseInteract 1.2s ease-in-out infinite;
}

@keyframes pulseInteract {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.lobby-quick-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  pointer-events: auto;
}

.quick-station-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text-main);
  border-radius: 12px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.quick-station-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Potion Button in Battle */
.potion-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(74, 222, 128, 0.65);
  background: rgba(15, 23, 42, 0.92);
  color: #dcfce7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.potion-btn small { font-size: 10px; }
.potion-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Element Grid in Magi/Element Tab */
.element-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
}

.elem-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 9px 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text-main);
  transition: border-color 0.15s, background 0.15s;
}

.elem-card.active {
  border-color: var(--gold);
  background: rgba(255, 196, 86, 0.14);
  box-shadow: 0 0 12px rgba(255, 196, 86, 0.3);
}

.elem-card-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 3px;
}

.elem-card-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Combo Counter & Dummy DPS */
#combo-hud {
  position: fixed;
  top: 148px;
  left: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(239, 68, 68, 0.22));
  border: 1px solid rgba(255, 196, 86, 0.6);
  color: #fde047;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 30;
}

#dummy-dps-banner {
  position: fixed;
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  pointer-events: none;
  z-index: 30;
}

.dmg-weak { color: #fbbf24; font-size: 23px; }
.dmg-resist { color: #94a3b8; font-size: 16px; }

.guide-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.danger-btn {
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-weight: 700;
  cursor: pointer;
}
.danger-btn:hover {
  background: rgba(239, 68, 68, 0.35);
}

/* Top-Left Quest Tracker & Top-Right Live Minimap */
#quest-tracker {
  position: fixed;
  top: 58px;
  left: 14px;
  z-index: 26;
  background: rgba(10, 14, 24, 0.78);
  border: 1px solid rgba(255, 196, 86, 0.35);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 11.5px;
  line-height: 1.45;
  max-width: 235px;
  backdrop-filter: blur(6px);
  cursor: pointer;
}

#minimap-wrap {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

#minimap-canvas {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 2px solid rgba(255, 196, 86, 0.65);
  background: rgba(8, 12, 22, 0.84);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
}

#minimap-label {
  font-size: 10px;
  font-weight: 700;
  color: #fde047;
  background: rgba(10, 14, 24, 0.8);
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 196, 86, 0.35);
}

/* Diablo-Style Bottom RPG Dock & Globes */
#player-hud {
  justify-content: center;
}

#rpg-dock {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
}

.rpg-globe {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(30, 41, 59, 0.9), #070b14 82%);
  border: 2.5px solid rgba(255, 196, 86, 0.72);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.75), inset 0 0 12px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  flex: 0 0 auto;
}

.globe-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  transition: height 0.15s ease-out;
}

.hp-globe-fill {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 48%, #7f1d1d 100%);
  box-shadow: 0 -4px 14px rgba(239, 68, 68, 0.6);
}

.mana-globe-fill {
  height: 0%;
  background: linear-gradient(180deg, #67e8f9 0%, #0284c7 48%, #1e3a8a 100%);
  box-shadow: 0 -4px 14px rgba(56, 189, 248, 0.6);
}

.globe-sheen {
  position: absolute;
  top: 7px;
  left: 12px;
  width: 24px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(-28deg);
  pointer-events: none;
}

.globe-info {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 4px #000, 0 0 6px #000;
}

.globe-info small {
  font-size: 9.5px;
  font-weight: 800;
  opacity: 0.9;
  letter-spacing: 0.6px;
}

.globe-info span {
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
}

.rpg-center-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(10, 14, 24, 0.84);
  border: 1px solid rgba(255, 196, 86, 0.32);
  border-radius: 14px;
  padding: 6px 10px;
  backdrop-filter: blur(6px);
}

@media (max-width: 720px) {
  #quest-tracker {
    top: 96px;
    left: 8px;
    max-width: 155px;
    font-size: 10px;
    padding: 5px 7px;
  }
  #minimap-wrap {
    top: 86px;
    right: 8px;
  }
  #minimap-canvas {
    width: 82px;
    height: 82px;
  }
  .rpg-globe {
    width: 58px;
    height: 58px;
  }
  .globe-info small { font-size: 8px; }
  .globe-info span { font-size: 9.5px; }
  #rpg-dock { gap: 5px; }
  .rpg-center-bar { padding: 4px 6px; }
}
