/* ══ ALLIANCE WAREHOUSE SOLUTIONS — 3D world UI ══ */
#world-wrap [hidden] { display: none !important; }
#world-wrap { position: fixed; inset: 0; z-index: 2000; background: #201D1E; overflow: hidden; }
#world-canvas { width: 100%; height: 100%; display: block; touch-action: none; }

/* Loading */
#world-loading {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #201D1E; color: #fff; text-align: center; padding: 24px;
  transition: opacity 0.5s ease;
}
#world-loading.done { opacity: 0; pointer-events: none; }
.world-loading__title {
  font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 18px;
}
.world-loading__bar {
  width: min(360px, 70vw); height: 6px; background: rgba(255,255,255,0.12);
  border-radius: 3px; overflow: hidden;
}
.world-loading__bar i {
  display: block; height: 100%; width: 0%;
  background: #9D1D20; transition: width 0.3s ease;
}
#world-tip { margin-top: 18px; font-size: 13px; color: rgba(255,255,255,0.45); font-family: 'DM Sans', sans-serif; }

/* HUD */
#world-hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; font-family: 'DM Sans', sans-serif; }
#world-hud > * { pointer-events: auto; }
#hud-exit {
  position: absolute; top: 16px; left: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(32,29,30,0.85); color: #fff; text-decoration: none;
  font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 10px 16px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15);
}
#hud-exit:hover { background: rgba(157,29,32,0.9); }
#hud-objective {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(32,29,30,0.85); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; border-radius: 8px; padding: 10px 20px; text-align: center; max-width: min(480px, 84vw);
}
.hud-objective__title {
  font-family: 'Oswald', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: #C33F44; margin-bottom: 2px;
}
#hud-objective-text { font-size: 13px; }
#hud-objective-count { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }
#hud-minimap {
  position: absolute; left: 16px; bottom: 16px;
  background: rgba(32,29,30,0.85); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
}
#hud-hints {
  position: absolute; right: 16px; bottom: 16px;
  background: rgba(32,29,30,0.85); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75); border-radius: 8px; padding: 10px 14px; font-size: 12px;
}
.hud-key {
  display: inline-block; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px; padding: 1px 7px; font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 600;
  color: #fff; letter-spacing: 0.05em;
}
#hud-prompt {
  position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: rgba(32,29,30,0.92); border: 1px solid #9D1D20; color: #fff;
  border-radius: 8px; padding: 10px 18px; font-size: 14px; white-space: nowrap;
}
#hud-tour {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  background: #9D1D20; color: #fff; border: none; cursor: pointer;
  font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 11px 18px; border-radius: 6px;
}
#hud-tour:hover { background: #6E1316; }
#hud-toast {
  position: absolute; left: 50%; top: 84px; transform: translateX(-50%);
  background: rgba(157,29,32,0.95); color: #fff; border-radius: 8px; padding: 12px 22px;
  font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  animation: toast-in 0.25s ease; white-space: nowrap; max-width: 90vw;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Inspector panel */
#world-panel {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 25;
  width: min(420px, 92vw);
  background: rgba(32,29,30,0.96); color: #fff;
  border-left: 3px solid #9D1D20;
  padding: 56px 28px 28px; overflow-y: auto;
  font-family: 'DM Sans', sans-serif;
  animation: panel-in 0.25s ease;
}
@keyframes panel-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
#world-panel-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 30px; line-height: 1; cursor: pointer;
}
#world-panel-close:hover { color: #fff; }
.wp-kicker {
  font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: #C33F44; margin-bottom: 6px;
}
#world-panel h2 {
  font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 700; text-transform: uppercase;
  line-height: 1.15; margin: 0 0 14px;
}
#wp-body { font-size: 14px; line-height: 1.7; color: rgba(255,255,255,0.75); margin-bottom: 18px; }
#wp-specs { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
#wp-specs td {
  font-size: 12.5px; padding: 7px 4px; border-bottom: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75); vertical-align: top;
}
#wp-specs td:first-child {
  font-family: 'Oswald', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: rgba(255,255,255,0.5); white-space: nowrap; padding-right: 14px;
}
.wp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wp-actions .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 12px 18px; border-radius: 6px; text-decoration: none; cursor: pointer; border: 2px solid transparent;
}
.wp-actions .btn--primary { background: #9D1D20; color: #fff; }
.wp-actions .btn--primary:hover { background: #6E1316; }
.wp-actions .btn--secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.wp-actions .btn--secondary:hover { border-color: #fff; }
.wp-tour-nav {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.12);
}
.wp-tour-nav button {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff;
  font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 600; text-transform: uppercase;
  padding: 9px 14px; border-radius: 6px; cursor: pointer;
}
.wp-tour-nav button:hover { background: rgba(157,29,32,0.6); }
#wp-tour-step { font-size: 12px; color: rgba(255,255,255,0.5); }
#wp-tour-exit { margin-left: auto; }

/* Mobile joystick */
#world-joystick {
  position: absolute; left: 24px; bottom: 24px; z-index: 22;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(32,29,30,0.5); border: 2px solid rgba(255,255,255,0.25);
}
#world-joystick-nub {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(157,29,32,0.85); border: 2px solid rgba(255,255,255,0.5);
}

/* Fallback */
#world-fallback {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #201D1E; color: #fff; text-align: center; padding: 32px;
  font-family: 'DM Sans', sans-serif;
}
#world-fallback h1 { font-family: 'Oswald', sans-serif; font-size: 26px; text-transform: uppercase; margin-bottom: 12px; }
#world-fallback p { max-width: 460px; font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.65); }
#world-fallback .btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600; text-transform: uppercase;
  padding: 12px 20px; border-radius: 6px; text-decoration: none;
}
#world-fallback .btn--primary { background: #9D1D20; color: #fff; }
#world-fallback .btn--white { background: #fff; color: #2E2A2B; }

@media (max-width: 767px) {
  #hud-hints { display: none; }
  #hud-objective { top: 64px; padding: 8px 14px; }
  #hud-minimap { width: 150px; height: 123px; }
  #hud-tour { padding: 9px 13px; font-size: 11px; }
  #world-panel { width: 100vw; border-left: none; border-top: 3px solid #9D1D20; top: auto; max-height: 62vh; }
}
