/* =========================
   GAME LAB – CLEAN LAYOUT
   ========================= */

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* =========================
   HEADER
   ========================= */

.game-header {
  min-height: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.game-header-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 16px;
  box-sizing: border-box;
}

.game-back {
  position: absolute;
  left: 16px;
  text-decoration: none;
}

.game-header-controls {
  position: absolute;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-title {
  margin: 0;
  font-size: 20px;
  line-height: 1;
}

/* =========================
   MAIN / STAGE
   ========================= */

.game-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px 24px;
  box-sizing: border-box;
  position: relative;
}

/* =========================
   AUTH OVERLAY
   ========================= */

#auth {
  position: fixed;
  inset: 56px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(5, 10, 18, 0.45);
  z-index: 300;
  pointer-events: auto;
}

#auth[hidden] {
  display: none !important;
}

#auth-container {
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

#auth-container h2 {
  margin: 0 0 4px;
  color: #fff;
}

.auth-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-view-hidden {
  display: none;
}

#auth-container input,
#auth-container button {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: 10px;
  font: inherit;
}

#auth-container input {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #fff;
}

#auth-container button {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
}

.auth-switch {
  margin: 0;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  text-align: center;
}

.auth-link-btn {
  display: inline;
  width: auto;
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: #8bc5ff;
  cursor: pointer;
  text-decoration: underline;
}

#auth-status {
  min-height: 20px;
  margin: 0;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
}

.game-stage-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-stage {
  position: relative;
  width: min(1400px, calc(100vw - 40px));
  height: min(900px, calc(100vh - 110px));
  aspect-ratio: 16 / 9;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  z-index: 1;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
}

/* =========================
   GLOBAL HUD
   ========================= */

#hud-global {
  position: fixed;
  inset: 56px 0 0 0;
  pointer-events: none;
  z-index: 50;
}

#hud-global > * {
  pointer-events: auto;
}

#hud-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hud-panel {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  min-width: 280px;
}

.hud-section-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hud-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* =========================
   FLOATING PANELS
   ========================= */

.hud-floating {
  position: absolute;
  width: 240px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 10px 12px 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  user-select: none;
  z-index: 110;
}

#player-panel {
  left: 12px;
  top: 96px;
}

.hud-bar-fill.xp-bar {
  background: linear-gradient(90deg, rgb(60,60,220), rgb(120,120,255));
}

#target-panel {
  right: 12px;
  top: 96px;
}

.hud-drag-handle {
  cursor: grab;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hud-name {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hud-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}

.hud-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgb(40,170,60), rgb(70,220,90));
  transition: width 120ms linear;
}

.target-bar {
  background: linear-gradient(90deg, rgb(180,50,50), rgb(240,80,80));
}

.hud-value {
  margin-top: 8px;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  font-weight: 600;
}

/* =========================
   HOTBAR
   ========================= */

   .hud-hotbar-panel {
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    padding: 10px 12px 12px;
   }


.hud-hotbar {
  display: flex;
  gap: 10px;
}

.hotbar-btn {
  min-width: 92px;
  height: 58px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.hotbar-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
}

.hotbar-key {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hotbar-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.hotbar-disabled {
  opacity: 0.45;
}

/* =========================
   STAGE HUD
   ========================= */

#hud-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

#hud-stage > * {
  pointer-events: auto;
}
/* =========================
   Quest Tracker
   ========================= */

.quest-tracker {
  position: fixed;
  top: 120px;
  right: 40px;
  z-index: 200;

  width: 260px;

  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;

  color: white;
  font-family: system-ui;
  font-size: 14px;

  user-select: none;
  pointer-events: auto;
}

.quest-tracker.hidden {
  display: none;
}

.quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 6px 10px;

  background: rgba(255,255,255,0.08);
  cursor: move;
}

.quest-body {
  padding: 10px;
}

#questTitle {
  font-weight: 700;
  margin-bottom: 4px;
}

#questDesc {
  opacity: 0.8;
  margin-bottom: 8px;
}

#questProgress {
  margin-bottom: 4px;
}

#questReward {
  opacity: 0.8;
}

#questClose {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}
