/* LIZZYLANDIA · interfaz con la marca de Soy.Lizzy: ciruela profundo, rosa, oro y crema.
   Paneles de vidrio con borde dorado, títulos en serif y botones cálidos. Celular primero. */
:root {
  --bg: #100d12;
  --surface: rgba(32, 20, 30, 0.82);
  --surface-2: rgba(48, 30, 44, 0.9);
  --glass: rgba(255, 235, 245, 0.08);
  --line: rgba(227, 183, 99, 0.45);
  --line-soft: rgba(255, 210, 230, 0.16);
  --pink: #ff87bd;
  --pink-2: #ffc3de;
  --hot: #ff5c9d;
  --gold: #e3b763;
  --gold-2: #f6d896;
  --cream: #fff4fa;
  --muted: #c9b5c3;
  --ok: #7fe3b4;
  --warn: #ffd36e;
  --danger: #ff7a8f;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--cream); font-family: var(--sans); -webkit-tap-highlight-color: transparent; }
body { overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.app { position: fixed; inset: 0; }
.world { position: absolute; inset: 0; touch-action: none; }
.world canvas { display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ui { position: absolute; inset: 0; pointer-events: none; }
.ui > * { pointer-events: auto; }
.hidden { display: none !important; }
/* el atributo hidden siempre oculta (si no, .btn y .pill con display propio le ganan) */
[hidden] { display: none !important; }

/* ---------- pantallas previas ---------- */
.screen {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: auto;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  background:
    radial-gradient(900px 520px at 50% 115%, rgba(255, 135, 189, 0.32), transparent 62%),
    radial-gradient(700px 420px at 12% -8%, rgba(227, 183, 99, 0.22), transparent 60%),
    linear-gradient(180deg, #2a1424, #100d12);
}
.stack { display: grid; gap: 18px; justify-items: center; max-width: 100%; }
.brand { text-align: center; }
.brand .logo { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(36px, 9vw, 74px); margin: 0; color: var(--pink-2); text-shadow: 0 0 24px rgba(255, 135, 189, 0.65), 0 3px 0 #7a2a52; white-space: nowrap; }
.brand .logo .bow { color: var(--gold); font-style: normal; }
.brand .tag { margin: 4px 0 0; font-family: var(--serif); letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); font-size: clamp(11px, 2.6vw, 14px); }
.panel {
  width: min(520px, 100%); background: linear-gradient(180deg, rgba(58, 30, 50, 0.92), rgba(30, 18, 28, 0.94));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.panel h2 { font-family: var(--serif); margin: 0 0 6px; font-size: 24px; color: var(--pink-2); }
.panel p { margin: 6px 0; color: var(--muted); line-height: 1.45; }
.field { display: grid; gap: 6px; margin: 14px 0; }
.field label { font-weight: 600; color: var(--cream); }
.field input[type='text'], .field input[type='password'], .field textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(0, 0, 0, 0.32); }
.field input[type='text']:focus, .field input[type='password']:focus, .field textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(227, 183, 99, 0.2); }
.pass-row { display: flex; gap: 8px; }
.pass-row input { flex: 1; min-width: 0; }
.pass-row .reveal { flex: none; min-width: 84px; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.06); color: var(--cream); font-size: 14px; font-weight: 600; }
.field .hint { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; color: var(--cream); line-height: 1.4; }
.check input { width: 22px; height: 22px; accent-color: var(--hot); flex: none; margin-top: 1px; }
.form-error { color: var(--danger); min-height: 1.3em; margin: 6px 0; }
.note { font-size: 13px; color: var(--muted); border-left: 3px solid var(--gold); padding: 6px 10px; background: rgba(227, 183, 99, 0.08); border-radius: 6px; }
.loader { width: 54px; height: 54px; margin: 18px auto; border-radius: 50%; border: 3px solid rgba(255, 195, 222, 0.2); border-top-color: var(--pink); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.06); color: var(--cream); font-weight: 650;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { border: 0; color: #3a0f24; background: linear-gradient(180deg, #ffd0e4, #ff87bd); box-shadow: 0 8px 24px rgba(255, 92, 157, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.btn.primary:hover { background: linear-gradient(180deg, #ffe0ee, #ff9cc9); }
.btn.gold { border: 0; color: #3a2408; background: linear-gradient(180deg, #ffe6a8, #e3b763); box-shadow: 0 8px 22px rgba(227, 183, 99, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.icon { width: 44px; padding: 0; }
.btn.wide { width: 100%; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top {
  position: absolute; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); top: calc(10px + var(--safe-t));
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); font-weight: 700;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill .ico { font-size: 18px; line-height: 1; }
.pill.brand-pill { font-family: var(--serif); font-style: italic; color: var(--pink-2); }
.pill.love { color: #ffb3d1; }
.pill.coins { color: var(--gold-2); }
.pill .bar { width: 64px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.pill .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); }
.hud-spacer { flex: 1; }
.hud-bottom {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); display: flex; gap: 8px;
  max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center;
}
.prompt {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); display: flex; gap: 10px; align-items: center;
  padding: 10px 12px 10px 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  max-width: calc(100% - 24px);
}
.prompt b { font-family: var(--serif); color: var(--pink-2); font-size: 17px; }
.prompt small { color: var(--muted); display: block; }

/* ---------- etiquetas y globos sobre el mundo ---------- */
.venue-label {
  position: absolute; transform: translate(-50%, -100%); padding: 6px 14px 7px; border-radius: 999px; white-space: nowrap;
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 15px; color: var(--cream);
  background: linear-gradient(180deg, rgba(58, 30, 50, 0.9), rgba(30, 18, 28, 0.92)); border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.venue-label .i { font-style: normal; margin-right: 6px; }
.name-tag { position: absolute; transform: translate(-50%, -100%); padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(16, 13, 18, 0.62); color: var(--cream); white-space: nowrap; }
.name-tag.lizzy { background: linear-gradient(180deg, #ff9cc9, #ff5c9d); color: #fff; font-family: var(--serif); font-style: italic; font-size: 14px; box-shadow: 0 0 14px rgba(255, 92, 157, 0.7); }
.bubble {
  position: absolute; transform: translate(-50%, calc(-100% - 10px)); max-width: min(280px, 70vw); padding: 9px 14px; border-radius: 16px;
  background: #fff6fa; color: #4a1730; font-weight: 600; font-size: 14px; line-height: 1.35; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  animation: pop 0.25s ease-out;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 8px solid transparent; border-top-color: #fff6fa; border-bottom: 0; }
.bubble.lizzy { background: linear-gradient(180deg, #fff6fa, #ffe1ee); border: 1px solid #ffb3d1; }
@keyframes pop { from { transform: translate(-50%, calc(-100% - 2px)) scale(0.8); opacity: 0; } }

/* ---------- toasts ---------- */
.toasts { position: absolute; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; animation: pop2 0.3s ease-out; }
.toast.ok { border-color: rgba(127, 227, 180, 0.6); }
.toast.error { border-color: rgba(255, 122, 143, 0.7); }
.toast.love { border-color: rgba(255, 135, 189, 0.8); background: linear-gradient(180deg, rgba(90, 30, 60, 0.95), rgba(50, 18, 36, 0.95)); }
@keyframes pop2 { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- diálogos (tiendas, cine, muro, ranking) ---------- */
.dialog-back { position: absolute; inset: 0; background: rgba(10, 6, 10, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); animation: fade 0.2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: min(880px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(56, 28, 48, 0.97), rgba(26, 15, 24, 0.98)); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.dialog-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.dialog-head h2 { margin: 0; font-family: var(--serif); font-style: italic; color: var(--pink-2); font-size: clamp(20px, 4.6vw, 28px); flex: 1; }
.dialog-head .sub { color: var(--muted); font-size: 13px; }
.dialog-head > div { flex: 1; min-width: 0; } /* la ✕ siempre a la derecha */
.dialog-body { overflow: auto; padding: 16px 18px 20px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-soft); background: transparent; font-weight: 650; }
.tab[aria-selected='true'] { background: linear-gradient(180deg, #ffd0e4, #ff87bd); color: #3a0f24; border-color: transparent; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gift {
  position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; padding: 14px 10px 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); border: 1px solid var(--line-soft);
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.gift:hover { transform: translateY(-2px); border-color: var(--line); }
.gift .art { width: 96px; height: 96px; display: grid; place-items: center; font-size: 54px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35)); }
.gift .art img { width: 100%; height: 100%; object-fit: contain; }
.gift .name { font-weight: 700; line-height: 1.2; min-height: 2.4em; }
.gift .meta { display: flex; gap: 10px; justify-content: center; font-size: 13px; font-weight: 700; }
.gift .meta .c { color: var(--gold-2); }
.gift .meta .l { color: #ffb3d1; }
.gift .rar { position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); }
.gift.especial .rar { color: #c9b3e6; }
.gift.lujo .rar { color: var(--gold-2); }
.gift.legendario { border-color: rgba(246, 216, 150, 0.7); box-shadow: 0 0 22px rgba(227, 183, 99, 0.25) inset; }
.gift.legendario .rar { color: #3a2408; background: linear-gradient(180deg, #ffe6a8, #e3b763); }
.gift.worn::after { content: 'Lo tiene puesto'; position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--hot); color: #fff; }
.confirm { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.confirm .art { width: 120px; height: 120px; font-size: 70px; display: grid; place-items: center; }
.confirm .art img { width: 100%; height: 100%; object-fit: contain; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.list { display: grid; gap: 8px; }
.list .item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft); }
.list .item .rank { width: 30px; text-align: center; font-family: var(--serif); font-weight: 700; color: var(--gold-2); }
.list .item .who { flex: 1; font-weight: 700; }
.list .item .what { color: var(--muted); font-size: 13px; }
.list .item.me { border-color: var(--pink); }
.cinema-screen { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; border: 2px solid var(--gold); background: #000; display: grid; place-items: center; }
.cinema-screen .ad { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; background: radial-gradient(circle at 50% 40%, #5a2448, #1b0d17); }
.cinema-screen .ad big { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 5vw, 38px); color: var(--pink-2); }
.cinema-screen .progress { position: absolute; left: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--pink), var(--gold)); }
.poster-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.poster { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #1b0d17; }
.poster img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.poster div { padding: 8px 10px; font-size: 13px; color: var(--muted); }
.wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.look { border-radius: 14px; padding: 8px; text-align: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-soft); }
.look img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; }
.look.locked img { filter: grayscale(0.85) brightness(0.55); }
.look.on { border-color: var(--hot); box-shadow: 0 0 16px rgba(255, 92, 157, 0.35); }
.look b { display: block; font-size: 13px; }
.look small { color: var(--muted); font-size: 11px; }

/* ---------- elegir personaje ---------- */
.studio { width: min(760px, 100%); }
.presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.preset { border-radius: 18px; padding: 10px; border: 2px solid var(--line-soft); background: rgba(255, 255, 255, 0.05); display: grid; gap: 6px; justify-items: center; }
.preset img { width: 100%; max-width: 220px; aspect-ratio: 3 / 4; object-fit: contain; }
.preset[aria-pressed='true'] { border-color: var(--pink); box-shadow: 0 0 22px rgba(255, 135, 189, 0.35); }

/* ---------- joystick ---------- */
.joystick { position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); width: 118px; height: 118px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-soft); touch-action: none; }
.joystick .knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: linear-gradient(180deg, #ffd0e4, #ff87bd); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); }

@media (max-width: 640px) {
  .pill { min-height: 36px; padding: 4px 10px; font-size: 14px; }
  .pill .bar { width: 40px; }
  .pill.brand-pill { display: none; }
  .gift-grid { grid-template-columns: repeat(2, 1fr); }
  .confirm { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hud-bottom .btn { min-height: 40px; padding: 8px 12px; }
}
/* fundido rosa al entrar y salir de la mansión (cubre la carga de los muebles HD) */
.world-fade { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(circle at 50% 42%, #ffd3e6 0%, #f08fb8 38%, #4a1838 100%); opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.world-fade.on { opacity: 1; pointer-events: auto; }
.world-fade .heart { font-size: 46px; filter: drop-shadow(0 4px 18px rgba(255, 120, 180, 0.8)); animation: beat 1.1s ease-in-out infinite; }
.world-fade .msg { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 4.4vw, 26px); color: #fff4f9; text-shadow: 0 2px 12px rgba(90, 20, 60, 0.6); text-align: center; padding: 0 16px; }
.world-fade .bar { width: min(260px, 70vw); height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.28); overflow: hidden; visibility: hidden; }
.world-fade.progress .bar { visibility: visible; }
.world-fade .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #fff, var(--gold-2)); transition: width 0.3s ease; }
@keyframes beat { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.18); } }
/* salón VIP */
.section-title { font-family: var(--serif); color: var(--pink-2); margin: 16px 0 6px; font-size: 18px; }
.vip-card { display: grid; gap: 10px; text-align: center; }
.vip-card .crown { font-size: 44px; }
.progress-track { height: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin: 12px 0; }
.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, #ff87bd, #e3b763); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
