/* ================================
   BASE
================================ */

:root {
  --bg0: #0f1013;
  --bg1: #15161c;
  --accentR: rgba(255, 90, 110, 0.1);
  --accentB: rgba(120, 160, 255, 0.08);
  --chat-shift: 220px;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  color: white;
  background:
    radial-gradient(1200px 700px at 65% 15%, var(--accentR), transparent 60%),
    radial-gradient(900px 700px at 20% 85%, var(--accentB), transparent 55%),
    radial-gradient(1400px 900px at 50% 40%, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.75) 100%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image:
    repeating-linear-gradient(0deg,
      rgba(255, 255, 255, 0.06) 0px,
      rgba(255, 255, 255, 0.06) 1px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0) 4px
    );
  z-index: 0;
}

.hidden {
  display: none;
}


#appLayout {
  position: relative;
  z-index: 1;
  height: 100%;
}

#chatStage,
.chat-stage,
#app,
#root,
main {
  height: 100%;
}

#chatContainer {
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

body.inventory-open #chatContainer {
  transform: none;
}

body.inventory-open #dojo-ui {
  transform: translateX(calc(-1 * var(--chat-shift)));
  transition: transform 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform;
}

body.inventory-closing #dojo-ui {
  transition: transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

body:not(.inventory-open) #dojo-ui {
  transform: none;
}

.nav-inventory {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.nav-audio {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.audio-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(260px, 72vw);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 10, 20, 0.82);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.audio-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 600;
}

.audio-control + .audio-control {
  margin-top: 10px;
}

.audio-control input[type="range"] {
  width: 100%;
  accent-color: #ff6f86;
}


.audio-popover--mobile {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  width: auto;
  max-width: 520px;
  margin: 0 auto;
  z-index: 9999;
  border-radius: 16px;
  background: rgba(16, 10, 20, 0.94);
}

#top-bar {
  z-index: 20000;
}

.nav-inventory #inventoryDropdown,
.nav-inventory #inventory-dropdown {
  top: calc(100% + 10px) !important;
  z-index: 15000;
}

.inventory-dropdown {
  position: absolute;
  top: calc(100% + 10px) !important;
  left: 0;
  width: 360px;
  max-width: 92vw;
  z-index: 15000;

  background: linear-gradient(
    180deg,
    rgba(18, 12, 22, 0.88) 0%,
    rgba(10, 8, 12, 0.86) 100%
  );
  border: 1px solid rgba(255, 105, 180, 0.25);
  border-radius: 16px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 24px rgba(255, 105, 180, 0.12);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  padding: 10px;

  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;

  transition:
    max-height 850ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 260ms ease,
    transform 520ms ease;
}

.inventory-panel {
  padding: 8px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.inventory-open #btn-inventario {
  box-shadow:
    0 0 0 1px rgba(255, 105, 180, 0.35) inset,
    0 10px 30px rgba(255, 105, 180, 0.12);
}

body.inventory-open .inventory-dropdown {
  max-height: min(72vh, 640px);
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.inventory-content {
  max-height: calc(min(72vh, 640px) - 52px);
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 22px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 105, 180, 0.35) rgba(255, 255, 255, 0.06);
}

.inventory-dropdown.is-loading .inventory-content {
  opacity: 0;
  transform: translateY(-6px);
}

.inventory-dropdown.is-loaded .inventory-content {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 320ms ease, transform 420ms ease;
}

.inventory-content::-webkit-scrollbar {
  width: 10px;
}

.inventory-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.inventory-content::-webkit-scrollbar-thumb {
  background: rgba(255, 105, 180, 0.28);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.35);
}

.inventory-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 105, 180, 0.4);
}

/* Asegurar que elementos clave respeten .hidden aunque haya reglas posteriores */
.top-bar.hidden,
.mobile-menu-overlay.hidden,
.hamburger.hidden,
#mobile-menu-overlay.hidden,
#hamburger-btn.hidden,
#top-bar.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ================================
   FONDOS Y CAPAS DEL DOJO
================================ */

.layer-wood,
.layer-shoji,
.layer-pattern {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  transition: transform 0.05s ease-out;
  animation: none;
  z-index: -3;
}

.layer-wood {
  display: none;
}

.layer-shoji {
  background:
    radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    repeating-linear-gradient(to right, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 40px);
  background-size: 3px 3px, 4px 4px, 40px 40px, 40px 40px;
  mix-blend-mode: soft-light;
  opacity: 0.28;
  z-index: -2.5;
}

.layer-pattern {
  background-image:
    radial-gradient(circle at 0 0, rgba(255,255,255,0.04) 0, transparent 40%),
    radial-gradient(circle at 100% 0, rgba(255,255,255,0.04) 0, transparent 40%),
    radial-gradient(circle at 0 100%, rgba(255,255,255,0.04) 0, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(255,255,255,0.04) 0, transparent 40%);
  mix-blend-mode: overlay;
  opacity: 0.4;
  animation: patternMove 40s linear infinite;
  z-index: -2;
}

@keyframes patternMove {
  from { transform: translateY(0); }
  to { transform: translateY(-80px); }
}

/* ================================
   CONTENEDOR GENERAL
================================ */

.container {
  width: 100%;
  max-width: none;
  margin: auto;
  height: 100dvh;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

#dojo-ui {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.chat-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 28px;
  height: 100%;
}

.yumiko-side {
  width: 320px;
  min-width: 280px;
  max-width: 360px;
  height: 760px;
  position: relative;
  pointer-events: none;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

.yumiko-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 280ms ease;
  will-change: opacity, transform;
}

.yumiko-img.is-active {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1023px) {
  .yumiko-side {
    display: none;
  }

  .chat-stage {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yumiko-img {
    transition: none;
  }
}

/* ================================
   LOGIN — ESTILOS SEPARADOS
================================ */

#auth-container {
  background: rgba(0,0,0,0.35);
  padding: 22px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  width: 100%;
  max-width: 360px;
  margin: 0 auto 25px auto;
  text-align: center;
  box-sizing: border-box;
}

#auth-container input[type="email"],
#auth-container input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
}

#auth-container button {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s ease;
  box-sizing: border-box;
}

#btn-register {
  background: #c0392b;
  color: white;
}

#btn-register:hover {
  background: #e74c3c;
}

#btn-login {
  background: #2980b9;
  color: white;
}

#btn-login:hover {
  background: #3498db;
}

/* ================================
   HEADER (AVATAR + TÍTULO)
================================ */

img.avatar-header {
  display: none !important;
  pointer-events: none !important;
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.avatar-header {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
}

.title {
  font-size: 34px;
  font-weight: bold;
  color: #f7f3e9;
  text-shadow: 0 0 6px rgba(255, 240, 220, 0.25);
}

.title-cinematic {
  opacity: 0;
  transform: translateY(-12px);
  animation: titleReveal 1.6s ease forwards;
  animation-delay: 1.2s;
}

.subtitle {
  text-align: center;
  margin-bottom: 20px;
  opacity: 0;
  animation: subtitleZen 2.4s ease forwards;
  animation-delay: 2s;
}

/* ================================
   CHAT
================================ */

.chat-frame-wrap {
  width: min(680px, 92vw);
  margin: 0 auto 14px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.chat-messages-area {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
}

.chat-composer-area {
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  padding: 0;
}

.chat-box {
  position: relative;
  background: rgba(10, 8, 12, 0.86);
  flex: 1 1 auto;
  min-height: 0;
  padding: 15px;
  padding-right: 21px;
  border-radius: 12px;
  overflow-y: auto;
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 105, 180, 0.25);
  box-shadow: 0 0 28px rgba(255, 0, 0, 0.28);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 90, 130, 0.75) rgba(0, 0, 0, 0.25);
  scrollbar-gutter: stable;
}

.chat-box::-webkit-scrollbar {
  width: 8px;
}

.chat-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(255, 120, 160, 0.95),
    rgba(255, 60, 110, 0.75)
  );
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 10px rgba(255, 90, 130, 0.25);
}

.chat-box::-webkit-scrollbar-thumb:hover {
  box-shadow: 0 0 14px rgba(255, 90, 130, 0.45);
  background: linear-gradient(
    180deg,
    rgba(255, 150, 185, 0.98),
    rgba(255, 70, 125, 0.85)
  );
}

.chat-box::-webkit-scrollbar-corner {
  background: transparent;
}

#chat-container,
#chatMessages,
.chat-messages,
.chat-box {
  overflow-y: auto;
}

/* Fondo fijo de Yumiko detrás del chat */
#yumiko-bg {
  position: absolute;
  inset: 0;
  background-image: url('/varios/yumiko/yumikochat.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

/* Asegura que el chat esté por encima del fondo */
.chat-box {
  position: relative;
  z-index: 10;
}

/* ===============================
   YUMIKO RETURN NUDGES / TOASTS
=============================== */
.yumiko-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(17, 12, 26, 0.92);
  color: #f7f3e9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 14px 46px 14px 18px;
  max-width: min(560px, calc(100vw - 32px));
  font-size: 0.95rem;
  line-height: 1.4;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: pointer;
}

.yumiko-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.yumiko-toast--hide {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

.yumiko-toast__text {
  white-space: pre-line;
}

.yumiko-toast__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #f7f3e9;
  font-size: 18px;
  line-height: 28px;
  cursor: pointer;
}

.yumiko-toast__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 640px) {
  .yumiko-toast {
    bottom: 16px;
    padding: 12px 40px 12px 16px;
    font-size: 0.9rem;
  }
}


/* ================================
   MENSAJES
================================ */

.message {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  animation: fadeIn 0.3s ease;
}

/* Safety net: ocultar avatares legacy que usen avatar-small */
img.avatar-small {
  display: none !important;
}

.bubble {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 70%;
  line-height: 1.4;
}

.user .bubble {
  background: #ff4d4d;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.bot .bubble {
  background: rgba(255, 255, 255, 0.14);
  border-left: 3px solid #ff4d4d;
  border-bottom-left-radius: 4px;
}

.yumiko-bubble {
  transform-origin: left center;
  will-change: clip-path, transform, filter, opacity;
}

.yumiko-enter {
  animation: yumikoReveal 3.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wa-audio {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(6, 6, 6, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  min-width: min(100%, 340px);
}

.wa-play {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: #ff4d4d;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.wa-play:hover {
  background: #ff3838;
}

.wa-play:active {
  transform: scale(0.95);
}

.wa-wave {
  position: relative;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.wa-bars {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.wa-bars span {
  flex: 1 1 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  min-height: 4px;
}

.wa-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 77, 77, 0.4);
  pointer-events: none;
}

.wa-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff4d4d;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.wa-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 11px;
  line-height: 1.05;
  color: rgba(247, 243, 233, 0.85);
  min-width: 38px;
}

.wa-audio audio {
  display: none;
}

@keyframes yumikoReveal {
  0% {
    clip-path: inset(0 100% 0 0 round 12px);
    transform: translateX(-10px);
    filter: blur(4px);
    opacity: 0.75;
  }
  70% {
    clip-path: inset(0 8% 0 0 round 12px);
    transform: translateX(0);
    filter: blur(1px);
    opacity: 0.95;
  }
  100% {
    clip-path: inset(0 0 0 0 round 12px);
    transform: translateX(0);
    filter: blur(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yumiko-enter {
    animation-duration: 0.01s;
  }
}

/* ================================
   INPUT DEL CHAT
================================ */

.input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

#user-input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 16px;
  box-sizing: border-box;
}


#send-btn {
  padding: 12px 20px;
  background: #ff4d4d;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

#send-btn:hover {
  background: #ff1a1a;
}

/* ================================
   BOTONES EXTRA
================================ */

.extra-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.extra-buttons button {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.75);
  color: #f7f3e9;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
}

.extra-buttons button:hover {
  background: rgba(255, 77, 77, 0.85);
  color: white;
  border-color: white;
}

/* ================================
   EFECTOS (GLOW, AURA, PARTÍCULAS)
================================ */

.glow-yumiko,
.particles-anime,
.aura-yumiko {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glow-yumiko {
  background: radial-gradient(circle at 50% 50%, rgba(255,80,80,0.25), transparent 70%);
  z-index: 8;
}

.particles-anime {
  z-index: 7;
  background-image: radial-gradient(circle, rgba(255,80,80,0.12) 1px, transparent 1px);
  background-size: 4px 4px;
  animation: particlesFloat 60s linear infinite;
}

.aura-yumiko {
  z-index: 6;
  background: radial-gradient(circle at center, rgba(255, 60, 60, 0.18), transparent 70%);
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.6s ease;
}

/* ================================
   TOP BAR (DESKTOP)
================================ */

.top-bar {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  z-index: 20000;
  padding: 4px;
  border-radius: 20px;
  background: rgba(10, 6, 12, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(92vw, 860px);
  padding: 8px;
  border-radius: 18px;
}

.nav-actions::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(20, 10, 20, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 0;
}

.top-btn {
  position: relative;
  z-index: 1;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.top-btn-primary {
  background: linear-gradient(180deg, #ff6f86, #ff5f79);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 22px rgba(255, 95, 121, 0.2);
}

.yumiko-100-btn {
  background: linear-gradient(180deg, #7f6dff, #5a47f0);
  border-color: rgba(179, 170, 255, 0.7);
}

.top-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.top-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.top-btn:focus-visible {
  outline: 2px solid rgba(255, 136, 164, 0.92);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(255, 111, 134, 0.25), 0 10px 20px rgba(0, 0, 0, 0.28);
}

.top-btn.active,
.mobile-menu-btn.active {
  background: rgba(255, 95, 121, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 190, 208, 0.35), 0 10px 24px rgba(255, 95, 121, 0.28);
}

/* ================================
   HAMBURGER BUTTON (MOBILE)
================================ */

.hamburger {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 26px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 10001;
}

.hamburger div {
  width: 100%;
  height: 4px;
  background: rgba(255, 80, 80, 0.9);
  border-radius: 4px;
}

/* ================================
   MOBILE MENU OVERLAY
================================ */

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
}

.mobile-menu-drawer {
  width: 260px;
  max-width: 80%;
  background: rgba(0,0,0,0.85);
  border-left: 1px solid rgba(255,255,255,0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu-drawer {
  transform: translateX(0);
}

.mobile-menu-btn {
  padding: 12px 16px;
  background: rgba(255, 80, 80, 0.85);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s ease;
}

.mobile-menu-btn.logout {
  background: rgba(255, 50, 50, 0.9);
}

.mobile-menu-btn:hover {
  background: rgba(255, 120, 120, 1);
}
.inventory-close-btn,
.inventory-close {
  padding: 10px 16px;
  background: rgba(255, 105, 180, 0.14);
  border: 1px solid rgba(255, 105, 180, 0.25);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;
  transition: transform 120ms ease, background 120ms ease;
}

.inventory-close-btn:hover,
.inventory-close:hover {
  background: rgba(255, 105, 180, 0.22);
  transform: translateY(-1px);
}

/* ================================
   RESPONSIVE — MOBILE
================================ */

@media (max-width: 1023px) {
  :root {
    --chat-shift: 0px;
  }

  body.inventory-open #chatContainer,
  body.inventory-open #dojo-ui {
    transform: none;
  }

  .inventory-dropdown {
    position: fixed;
    top: var(--header-height, 64px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: unset;
    z-index: 15000;
  }

  .inventory-panel {
    border-radius: 14px;
    z-index: 10005;
  }

  /* Ocultar top bar en mobile */
  .top-bar {
    display: none !important;
  }

  .nav-actions {
    gap: 8px;
    padding: 7px;
    max-width: 100%;
  }

  /* Mostrar botón hamburguesa en mobile */
  .hamburger {
    display: flex !important;
  }
}
/* ================================
   INVENTARIO LATERAL — ITEMS
================================ */

.inv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
}

.inv-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}

.inv-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.inv-nombre {
  font-weight: 600;
  font-size: 15px;
}

.inv-detalle {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 480px) {
  .inv-img {
    width: 48px;
    height: 48px;
  }

  .inv-nombre {
    font-size: 14px;
  }

  .inv-detalle {
    font-size: 12px;
  }
}


/* ================================
   RESPONSIVE — TABLET
================================ */

@media (max-width: 768px) {
  .container {
    width: 100%;
    padding-top: 0;
  }

  .title {
    font-size: 1.8rem;
    text-align: center;
  }

  .subtitle {
    font-size: 1rem;
  }

  .avatar-header {
    width: 64px;
    height: 64px;
  }

  .chat-box {
    padding: 10px;
    font-size: 0.95rem;
  }

  .bubble {
    max-width: 85%;
    font-size: 0.9rem;
    padding: 10px 14px;
  }

  .extra-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .extra-buttons button {
    width: 100%;
  }
}

/* ================================
   RESPONSIVE — MÓVILES PEQUEÑOS
================================ */

@media (max-width: 480px) {
  .title {
    font-size: 1.5rem;
  }

  .bubble {
    font-size: 0.85rem;
  }

}


/* ================================
   INVENTARIO — BOTÓN USAR FONDO (solo index)
================================ */
.inv-use-btn{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,77,77,0.85);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}
.inv-use-btn:hover{
  transform: scale(1.02);
  background: rgba(255,120,120,1);
}

/* ================================
   AUDIOS CTA LABELS
================================ */
.audios-label--mobile {
  display: none;
}

@media (max-width: 640px) {
  .audios-label--desktop {
    display: none;
  }

  .audios-label--mobile {
    display: inline;
  }
}

/* ================================
   ENTRY CHOICE MODAL
================================ */
.choice-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 8, 15, 0.65);
  backdrop-filter: blur(8px);
}

.choice-overlay.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.choice-card {
  width: min(520px, 100%);
  position: relative;
  border-radius: 22px;
  padding: 28px 24px 24px;
  background: linear-gradient(145deg, rgba(28, 16, 32, 0.95), rgba(43, 18, 20, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 124, 124, 0.12) inset;
  text-align: center;
}

.choice-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.choice-close:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.2);
}

.choice-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: #ffffff;
  text-shadow: 0 4px 14px rgba(255, 90, 90, 0.28);
}

.choice-subtitle {
  margin: 10px 0 22px;
  color: rgba(255, 241, 241, 0.85);
  font-size: 1rem;
}

.choice-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.choice-btn:hover {
  transform: translateY(-1px);
}

.choice-btn-primary {
  background: linear-gradient(135deg, rgba(255, 90, 90, 0.96), rgba(255, 116, 137, 0.95));
  box-shadow: 0 12px 28px rgba(255, 80, 120, 0.28);
}

.choice-btn-primary:hover {
  box-shadow: 0 16px 30px rgba(255, 80, 120, 0.35);
}

.choice-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.choice-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 520px) {
  .choice-overlay {
    padding: 16px;
  }

  .choice-card {
    padding: 24px 18px 20px;
    border-radius: 18px;
  }
}


.page-transition {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease;
}

.page-transition.is-active {
  opacity: 1;
}

.page-transition-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(255,170,210,.22), transparent 60%),
    radial-gradient(900px 700px at 80% 20%, rgba(170,205,255,.20), transparent 55%),
    radial-gradient(900px 700px at 50% 90%, rgba(210,190,255,.18), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(252,248,255,1) 100%);
}

.runner {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: auto;
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.30));
}

.page-transition.is-active .runner {
  opacity: 1;
  animation: runnerCenterToRight 1300ms cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes runnerCenterToRight {
  0% { transform: translate(-50%, -50%) translate3d(0px, 10px, 0); }
  100% { transform: translate(-50%, -50%) translate3d(760px, -22px, 0); }
}

@media (max-width: 768px) {
  .runner { width: 180px; top: 60%; }

  @keyframes runnerCenterToRight {
    0% { transform: translate(-50%, -50%) translate3d(0px, 10px, 0); }
    100% { transform: translate(-50%, -50%) translate3d(420px, -18px, 0); }
  }
}

@media (prefers-reduced-motion: reduce){
  .page-transition.is-active .runner{ animation: none; opacity: 1; }
}
