/* ===========================================================
   ALMA · "art déco bordó y oro"
   Tokens: diseño/tokens.css · Componentes: diseño/componentes.css
   =========================================================== */
:root {
  /* Fondos */
  --bg: #14070d;
  --bg-deep: #0b0507;
  --surface: #23101a;
  --surface-2: #1d0b14;
  --surface-ink: #0e0708;
  --line: #4a2738;
  --line-soft: #3a1d2b;

  /* Texto */
  --text: #f7e9ee;
  --cream: #f6e6d0;
  --cream-2: #ecd9c0;
  --muted: #c9a9b6;
  --muted-2: #a88595;

  /* Oro */
  --gold: #e9c27a;
  --gold-line: #c9a25e;
  --gold-soft: #f6dca0;
  --gold-ghost: #d9b77a;
  --gold-dim: #b48d5c;

  /* Bordó */
  --wine-1: #6e1b2e;
  --wine-2: #3b0a15;
  --card-wine: radial-gradient(circle at 50% 38%, #5c1526, #2a070f 85%);
  --card-black: radial-gradient(circle at 50% 42%, #241417, #0b0607 82%);

  /* Estados */
  --stop: #e5384b;
  --stop-text: #ff9aa5;

  --lvl: #f2b35b;

  --font-deco: 'Cinzel', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-btn: 14px;
  --radius-card: 20px;
  --radius-sheet: 30px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

/* Nivel actual (body) y nivel puntual ([data-lv]): color, texto y las 3 capas de la llama (--f1 exterior, --f2 media, --f3 núcleo).
   El mazo tiene 5 niveles; el 5 "Pasión Sin Límites" usa el magenta de Pasión. El 6 queda por si vuelve. */
body[data-level="1"] { --lvl: #f2b35b; --f1: #e0892a; --f2: #f2b35b; --f3: #ffe7b0; }  /* Chispa */
body[data-level="2"] { --lvl: #f28aa5; --f1: #d9577e; --f2: #f28aa5; --f3: #ffd9e3; }  /* Conexión */
body[data-level="3"] { --lvl: #ff8a3d; --f1: #e2601c; --f2: #ff8a3d; --f3: #ffd2a8; }  /* Seducción */
body[data-level="4"] { --lvl: #ff4d4d; --f1: #c7262e; --f2: #ff4d4d; --f3: #ffc2b0; }  /* Fuego */
body[data-level="5"] { --lvl: #e8457c; --f1: #b51f5c; --f2: #e8457c; --f3: #ffc6da; }  /* Pasión Sin Límites */
body[data-level="6"] { --lvl: #a65bff; --f1: #6e2fc4; --f2: #a65bff; --f3: #e6d2ff; }

/* Color de cada jugador (§4.5). --turno lo fija render() con body[data-turno] */
:root { --ella: #ff7eb6; --el: #6fbaff; --turno: var(--gold); }
body[data-turno="ella"] { --turno: var(--ella); }
body[data-turno="el"] { --turno: var(--el); }

[data-lv="1"] { --c: #f2b35b; --c-text: #f7c47e; --f1: #e0892a; --f2: #f2b35b; --f3: #ffe7b0; }
[data-lv="2"] { --c: #f28aa5; --c-text: #f7a6bb; --f1: #d9577e; --f2: #f28aa5; --f3: #ffd9e3; }
[data-lv="3"] { --c: #ff8a3d; --c-text: #ffa871; --f1: #e2601c; --f2: #ff8a3d; --f3: #ffd2a8; }
[data-lv="4"] { --c: #ff4d4d; --c-text: #ff8a8a; --f1: #c7262e; --f2: #ff4d4d; --f3: #ffc2b0; }
[data-lv="5"] { --c: #e8457c; --c-text: #f27fa4; --f1: #b51f5c; --f2: #e8457c; --f3: #ffc6da; }
[data-lv="6"] { --c: #a65bff; --c-text: #c497ff; --f1: #6e2fc4; --f2: #a65bff; --f3: #e6d2ff; }

/* Llama de nivel (símbolo #i-llama, proporción 3:4) */
.llama { width: 18px; height: 24px; flex-shrink: 0; overflow: visible; }
.llama.off { opacity: .3; filter: grayscale(.5); }
.flame-num { position: relative; display: grid; place-items: center; flex-shrink: 0; }
.flame-num .llama { width: 30px; height: 40px; }
.flame-num b { position: absolute; top: 50%; left: 0; right: 0; margin-top: -2px; text-align: center; font-weight: 800; font-size: 12px; color: #2a0f1c; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg-deep); }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }

.ico { width: 18px; height: 18px; flex-shrink: 0; }
.ico.sm { width: 12px; height: 12px; }
.ico.md { width: 20px; height: 20px; }
.grow { flex-grow: 1; }

/* Brillo de fondo: color del nivel al 26 % (no en pantallas con foto) */
.glow {
  position: fixed; left: 50%; top: -160px; transform: translateX(-50%);
  width: 630px; height: 640px; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lvl) 26%, transparent), transparent 72%);
  transition: background .8s;
}
body[data-screen="gate"] .glow, body[data-screen="home"] .glow { display: none; }
body[data-screen="setup"] .glow, body[data-screen="rules"] .glow {
  top: -220px; height: 560px;
  background: radial-gradient(closest-side, rgb(232 69 124 / .16), transparent 72%);
}
body[data-screen="end"] .glow { top: -140px; background: radial-gradient(closest-side, color-mix(in srgb, var(--lvl) 24%, transparent), transparent 72%); }

.screen {
  position: relative; z-index: 1;
  min-height: 100dvh;
  max-width: 520px; margin: 0 auto;
  padding: calc(16px + var(--safe-t)) 20px calc(24px + var(--safe-b));
  display: flex; flex-direction: column;
}

/* ---------- Divisores y emblemas ---------- */
.diamond { display: block; width: 6px; height: 6px; background: var(--gold-line); transform: rotate(45deg); flex-shrink: 0; }
.divider { display: flex; align-items: center; justify-content: center; gap: 10px; }
.divider::before, .divider::after { content: ""; width: 44px; height: 1px; background: var(--gold-line); }
.divider.lvl::before, .divider.lvl::after { width: 34px; }
.divider.lvl .diamond { background: var(--lvl); }

.emblem { width: 70px; height: 70px; overflow: visible; }
.emblem path { fill: none; stroke: var(--gold-line); stroke-width: 1.2; }
.emblem path.em-fill { fill: rgb(20 7 13 / .55); }
.emblem path.em-inner { stroke-width: .7; opacity: .7; }
.emblem text { font: 700 30px var(--font-serif); fill: var(--gold); }

/* ---------- Botones ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 0 16px; border-radius: var(--radius-btn);
  border: 1px solid rgb(201 162 94 / .45); background: var(--surface-ink); color: var(--cream-2);
  font: 600 14px var(--font-ui); text-align: center;
  transition: transform .08s, filter .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  min-height: 56px; border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, var(--wine-1), var(--wine-2)); color: var(--gold-soft);
  font: 700 15px var(--font-deco); letter-spacing: .14em;
  box-shadow: inset 0 0 0 3px var(--wine-2), inset 0 0 0 4px rgb(201 162 94 / .5), 0 12px 30px rgb(0 0 0 / .45);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn.ghost { border: 0; background: transparent; color: var(--gold-ghost); font: 600 14px var(--font-deco); letter-spacing: .1em; }
.btn.outline { background: transparent; font-size: 15px; min-height: 52px; border-radius: 16px; }
.btn.gold {
  min-height: 56px; border: 0; border-radius: 16px; color: #2a0f1c;
  background: linear-gradient(180deg, #f3d595, #c69a52);
  font: 700 14px var(--font-deco); letter-spacing: .1em;
  box-shadow: inset 0 0 0 3px #e2bd78, inset 0 0 0 4px rgb(42 15 28 / .45), 0 12px 30px rgb(233 194 122 / .25);
}
.btn.timer { border-color: rgb(233 194 122 / .55); background: rgb(233 194 122 / .1); color: #f5d9a3; font-weight: 700; }
.btn.danger { justify-content: flex-start; gap: 14px; min-height: 56px; border-radius: 18px; border-color: rgb(229 56 75 / .45); background: transparent; color: var(--stop-text); font-weight: 700; font-size: 15px; }
.btn.primary .ico { width: 18px; height: 18px; }

.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  border: 1px solid rgb(201 162 94 / .45); background: var(--surface-ink); color: var(--cream-2);
}
:where(.btn, .icon-btn, .level-chip, .card.back, .stop-btn, .btn-continue, .levels-pick button, .menu-item, input):focus-visible,
:where(.mode, .segmented label, .toggle, .consent):focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }

.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row-2:has(> :only-child), .row-2:not(:has(> :nth-child(2):not([hidden]))) { grid-template-columns: 1fr; }
.note { text-align: center; font-size: 12px; color: var(--muted-2); }

/* ---------- Pantallas con foto y marco (Acceso, Inicio) ---------- */
/* El fondo propio hace que el tinte (mix-blend-mode: color) se mezcle con oscuro y no con transparente */
.framed { padding: 0; overflow: hidden; background: var(--bg); }
.screen-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; fill: none; }
.screen-frame .f1 { stroke: var(--gold-line); stroke-width: 1; opacity: .8; }
.screen-frame .f2 { stroke: var(--gold-line); stroke-width: .6; opacity: .45; }
.screen-frame .f3 { fill: var(--gold-line); }
.framed-body {
  position: relative; z-index: 3; flex: 1; min-height: 100dvh;
  padding: calc(44px + var(--safe-t)) 36px calc(46px + var(--safe-b));
  display: flex; flex-direction: column;
}

.hero-photo { position: absolute; inset: 0 0 auto; height: 76%; overflow: hidden; z-index: 0; }
.hero-photo img { /* foto v2: sujeto centrado, a todo el ancho desde 30 px, fundido arriba */
  position: absolute; left: 0; top: 30px; width: 100%; height: calc(100% - 30px);
  object-fit: cover; object-position: 50% 18%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14%);
  filter: grayscale(1) contrast(1.12) brightness(.9); opacity: .85;
}
.hero-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 1; mix-blend-mode: color;
  background: linear-gradient(165deg, #8a2238 0%, #3b0a15 55%, #14070d 100%);
}
.hero-photo::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(180deg, rgb(20 7 13 / .35) 0%, transparent 18%, transparent 42%, rgb(20 7 13 / .88) 74%, var(--bg) 100%),
    radial-gradient(ellipse 90% 75% at 45% 32%, transparent 45%, rgb(20 7 13 / .9) 100%);
}
#home .hero-photo { height: 66%; }
#home .hero-photo img { opacity: .5; filter: grayscale(1) contrast(1.08) brightness(.85) blur(.6px); } /* sin espejar */
#home .hero-photo::before { background: linear-gradient(200deg, #8a2238 0%, #3b0a15 60%, #14070d 100%); }
#home .hero-photo::after {
  background:
    linear-gradient(180deg, rgb(20 7 13 / .5) 0%, rgb(20 7 13 / .15) 25%, rgb(20 7 13 / .7) 60%, var(--bg) 100%),
    radial-gradient(ellipse 85% 70% at 55% 30%, transparent 35%, rgb(20 7 13 / .92) 100%);
}

.kicker-pill {
  align-self: center; display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px;
  border: 1px solid rgb(201 162 94 / .6); border-radius: 999px; background: rgb(20 7 13 / .55);
  font: 700 11px/1 var(--font-deco); letter-spacing: .24em; color: var(--gold);
}
.kicker-pill .diamond { width: 4px; height: 4px; }

.hero-text { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.hero-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 26px; }
.home-body { padding-top: calc(70px + var(--safe-t)); padding-bottom: calc(44px + var(--safe-b)); }
#home .hero-actions { gap: 10px; }

.title { margin: 0; display: flex; flex-direction: column; gap: 4px; font: italic 500 26px/1.1 var(--font-serif); color: var(--cream); }
.title span {
  display: block; font: normal 700 58px/1 var(--font-deco); letter-spacing: .18em; padding-left: .18em;
  color: var(--gold); text-shadow: 0 2px 30px rgb(0 0 0 / .6), 0 0 40px rgb(233 194 122 / .2);
}
.title.small { font-size: 24px; gap: 2px; }
.title.small span { font-size: 50px; text-shadow: 0 2px 30px rgb(0 0 0 / .6); }
.lead { max-width: 290px; font-size: 14px; line-height: 1.6; color: #d9c2bd; text-wrap: pretty; }
.level-bars { display: flex; gap: 9px; }
.level-bars .llama { width: 16px; height: 21px; }
.deco-caption { font: 600 11px var(--font-deco); letter-spacing: .22em; color: var(--gold-dim); }

.saved {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 16px;
  background: rgb(14 7 8 / .82); border: 1px solid rgb(201 162 94 / .45);
}
.saved-info { flex-grow: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.saved-kicker { font: 700 10px var(--font-deco); letter-spacing: .2em; white-space: nowrap; color: var(--gold); }
.saved-info b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.saved-meta .llama { width: 11px; height: 15px; }
.btn-continue {
  height: 48px; padding: 0 12px; flex-shrink: 0; border-radius: 12px;
  border: 1px solid rgb(233 194 122 / .6); background: rgb(233 194 122 / .1); color: #f5d9a3;
  font: 700 12px var(--font-deco); letter-spacing: .06em; display: flex; align-items: center; gap: 7px;
}
#home .btn:not(.primary) { background: rgb(14 7 8 / .6); }

/* ---------- Barras ---------- */
.bar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 28px; }
.bar h2 { margin: 0; text-align: center; font: 600 26px var(--font-serif); }
.bar .icon-btn { color: var(--text); }

/* ---------- Preparación ---------- */
.sections { display: flex; flex-direction: column; gap: 28px; }
.sections section { display: flex; flex-direction: column; gap: 12px; }
.step { margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: 16px; font-weight: 700; }
.step span { font: 700 22px var(--font-serif); color: var(--gold); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
/* Él y Ella con su color de turno, para que se entienda la relación con la pantalla de juego */
.field.el { color: var(--el); }
.field.ella { color: var(--ella); }
.field.el input:focus { border-color: var(--el); }
.field.ella input:focus { border-color: var(--ella); }
.field input {
  height: 50px; width: 100%; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: 600 16px var(--font-ui);
}
.field input::placeholder { color: #8f6c7b; }
.step-help { margin-top: -4px; font-size: 12px; line-height: 1.45; color: var(--muted-2); }
.player { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gender { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.gender label { position: relative; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.gender input { position: absolute; opacity: 0; pointer-events: none; }
.gender label:has(input:checked) { background: #2a1418; box-shadow: inset 0 0 0 1px var(--gold-line); color: var(--gold-soft); }
.gender label:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.field input:focus { border-color: var(--gold); outline: none; }

.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 132px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.mode input { position: absolute; opacity: 0; pointer-events: none; }
/* Medallón del modo: doble anillo (oro + color del modo) */
.medallion {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: var(--mc);
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--mc) 28%, transparent), color-mix(in srgb, var(--mc) 5%, transparent) 70%), #160810;
  box-shadow: inset 0 0 0 1px rgb(201 162 94 / .75), inset 0 0 0 4px #160810, inset 0 0 0 5px color-mix(in srgb, var(--mc) 50%, transparent),
    0 6px 18px rgb(0 0 0 / .35), 0 0 22px color-mix(in srgb, var(--mc) 12%, transparent);
}
.medallion .ico { width: 30px; height: 30px; }
.mode b { font-size: 15px; }
.mode small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.mode > span { display: flex; flex-direction: column; gap: 3px; }
.mode .check { display: none; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-line); color: var(--bg); place-items: center; }
.mode .check .ico { width: 12px; height: 12px; color: var(--bg); }
.mode:has(input:checked) { border: 1.5px solid var(--gold-line); background: #2a1418; }
.mode:has(input:checked) small { color: #d9b9c5; }
.mode:has(input:checked) .check { display: grid; }

.levels-pick { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 6px; }
.levels-pick button {
  height: 64px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent);
  font-size: 15px; font-weight: 800;
}
.levels-pick button { gap: 4px; }
.levels-pick button.on { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); box-shadow: 0 6px 20px color-mix(in srgb, var(--c) 25%, transparent); }
.levels-pick button.off { border: 1px dashed var(--line); background: transparent; color: #8f6c7b; }
.levels-pick button.off .llama { opacity: .3; filter: grayscale(.5); }
.level-desc { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.level-desc b { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--c-text); }
.level-desc b .llama { width: 14px; height: 19px; }
.level-desc span { font-size: 13px; line-height: 1.5; color: var(--muted); }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.segmented label { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 12px; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented b { font-size: 14px; }
.segmented small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.segmented label:has(input:checked) { background: #34162a; box-shadow: inset 0 0 0 1px var(--gold-line); }
.segmented label:has(input:checked) small { color: #d9b9c5; }

.switches { display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.toggle { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--line-soft); }
.toggle > span { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.toggle b { font-size: 14px; }
.toggle small { font-size: 12px; line-height: 1.4; color: var(--muted); }
input.sw {
  appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0; cursor: pointer;
  width: 46px; height: 28px; border-radius: 999px; background: var(--line-soft); border: 1px solid #5a3346; position: relative;
}
input.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s; }
input.sw:checked { background: var(--wine-1); border-color: var(--gold-line); }
input.sw:checked::after { transform: translateX(18px); background: var(--gold-soft); }

.rule-stop.extra-care { border-color: rgb(233 194 122 / .45); background: rgb(233 194 122 / .08); font-weight: 600; color: #f5d9a3; }
.rule-stop.extra-care .ico { color: var(--gold); }
/* Nivel extra opcional en Preparación */
.extra-toggle b { display: flex; align-items: center; gap: 8px; }
.extra-toggle b .llama { width: 14px; height: 19px; }
.extra-toggle em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--muted-2); }
.segmented.intensities { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 12px 12px; }
.segmented.intensities label:has(input:checked) { background: color-mix(in srgb, var(--c, #a65bff) 18%, #34162a); }

.consent {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 16px; cursor: pointer;
  border: 1px solid rgb(233 194 122 / .55); background: rgb(233 194 122 / .07);
}
.consent > span { display: flex; flex-direction: column; gap: 4px; }
.consent b { font-size: 15px; color: #f5d9a3; }
.consent small { font-size: 13px; line-height: 1.5; color: #d9c2a0; }
input.ck {
  appearance: none; -webkit-appearance: none; margin: 1px 0 0; flex-shrink: 0; cursor: pointer;
  width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--gold-line); background: transparent;
  display: grid; place-items: center;
}
input.ck:checked { background: var(--gold-line); }
input.ck:checked::after {
  content: ""; width: 7px; height: 12px; margin-top: -3px;
  border: solid var(--bg); border-width: 0 2.6px 2.6px 0; transform: rotate(45deg);
}
.start { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }

/* ---------- Reglas ---------- */
.rules { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.rules h3 { margin: 16px 0 0; font: 600 24px var(--font-serif); color: var(--text); }
.gold-card { padding: 20px; border-radius: 20px; border: 1px solid var(--gold-line); background: var(--surface); display: flex; flex-direction: column; gap: 14px; }
.gold-card h3 { margin: 0; color: var(--gold); }
.rule-stop { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgb(229 56 75 / .55); background: rgb(229 56 75 / .14); font-weight: 700; font-size: 14px; line-height: 1.4; }
.rule-stop .ico { width: 22px; height: 22px; }
.num-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.num-list li { display: flex; gap: 14px; font-size: 14px; line-height: 1.5; color: #e2cfd6; }
.num-list li::before { content: attr(data-n); font: 700 17px/1.3 var(--font-serif); color: var(--gold); min-width: 10px; }
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-row { display: flex; gap: 14px; padding: 14px; border-radius: 14px; background: var(--surface); }
.info-row .ico-box { width: 36px; height: 36px; border-radius: 10px; background: rgb(233 194 122 / .12); color: var(--gold); display: grid; place-items: center; flex-shrink: 0; }
.info-row div { display: flex; flex-direction: column; gap: 2px; }
.info-row b { font-size: 15px; }
.info-row span { font-size: 13px; line-height: 1.45; color: var(--muted); }
.level-list { display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line-soft); background: var(--surface); overflow: hidden; }
.level-list > div { display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.level-list > div + div { border-top: 1px solid var(--line-soft); }
.lv-circle { width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #2a0f1c; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.level-list b { font-size: 15px; display: block; }
.level-list > div > div span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bullets li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.5; color: #e2cfd6; }
.bullets li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.bullets b { color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles > div { padding: 14px; border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.tiles b { font-size: 14px; }
.tiles span { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.rules p.plain { font-size: 14px; line-height: 1.55; color: #e2cfd6; }

/* ---------- Juego ---------- */
.game-bar { display: grid; grid-template-columns: auto 1fr 44px; align-items: center; gap: 10px; }
.level-chip {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--lvl) 60%, transparent);
  background: color-mix(in srgb, var(--lvl) 14%, var(--surface)); font-weight: 700; font-size: 14px;
}
.level-chip .llama { width: 14px; height: 19px; }
.dots { display: flex; justify-content: center; align-items: center; gap: 9px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.done { background: var(--c); }
.dots i.max { outline: 1.5px solid var(--muted); outline-offset: 3px; }
.dots i.locked { opacity: .35; }

/* ---------- Color del turno (§4.5): rosa Ella, azul Él, dorado los dos o sin género ---------- */
.turn { position: relative; margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.turn::before { /* halo del color del turno detrás del nombre */
  content: ""; position: absolute; left: 50%; top: 50%; width: 300px; height: 170px; transform: translate(-50%, -45%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--turno) 24%, transparent), transparent 75%);
  pointer-events: none; z-index: -1; transition: background .6s;
}
.turn-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--turno) 55%, transparent); background: color-mix(in srgb, var(--turno) 14%, transparent);
  font: 700 11px/1 var(--font-deco); letter-spacing: .22em; padding-left: calc(14px + .22em); color: var(--turno);
  transition: color .6s, border-color .6s, background .6s;
}
.turn-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--turno); box-shadow: 0 0 8px var(--turno); }
.turn-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.turn-name {
  font: 700 50px/1.05 var(--font-serif); color: #fff7fa; text-align: center;
  text-shadow: 0 0 26px color-mix(in srgb, var(--turno) 70%, transparent); transition: text-shadow .6s;
}
.turn.both .turn-name { font-size: 40px; }
/* Tinte de toda la pantalla de juego */
#game::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--turno) 60%, transparent), inset 0 0 90px color-mix(in srgb, var(--turno) 24%, transparent);
  transition: box-shadow .6s;
}
#game > * { position: relative; z-index: 1; }
.mods {
  margin: 8px auto 0; display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%;
  padding: 7px 14px; border-radius: 999px; background: rgb(233 194 122 / .12); border: 1px solid rgb(233 194 122 / .4);
  color: #f5d9a3; font-size: 13px;
}
.mods .ico { width: 15px; height: 15px; }

.table { flex: 1; display: grid; place-items: center; padding: 18px 0; perspective: 1200px; }
.card {
  position: relative; height: min(56dvh, 445px); width: auto; max-width: 100%; aspect-ratio: 5 / 7;
  border-radius: var(--radius-card); border: 0;
}
.card .frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.card > :not(.frame) { position: relative; }

.card.back {
  padding: 13% 10% 11%; color: var(--cream);
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--lvl) 14%, #1d1013), #0b0607 82%);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  box-shadow: 0 24px 60px rgb(0 0 0 / .6), 0 0 70px color-mix(in srgb, var(--lvl) 18%, transparent);
  animation: breathe 3.4s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: translateY(-5px); } }
.back-label { font: 600 11px var(--font-deco); letter-spacing: .32em; padding-left: .32em; color: var(--gold-line); }
.back-center { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.back-center .emblem { width: 74px; height: 74px; }
.back-center .emblem path { stroke-width: 1; }
.back-logo { font: 700 44px/1 var(--font-deco); letter-spacing: .16em; padding-left: .16em; color: var(--gold); text-shadow: 0 0 24px rgb(233 194 122 / .25); }
.back-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.back-text { font-weight: 700; font-size: 15px; }
.back-count { font-size: 12px; color: #b9997a; }

.card.face {
  padding: 12% 10.5% 10.5%; color: var(--cream);
  background: var(--card-wine);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgb(0 0 0 / .6);
  animation: flip .45s cubic-bezier(.2, .8, .2, 1);
}
.card.face[data-tipo="comodin"] { background: var(--card-black); box-shadow: 0 24px 60px rgb(0 0 0 / .6), 0 0 60px rgb(233 194 122 / .12); }
@keyframes flip { from { transform: rotateY(90deg) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.card-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.card-type { display: flex; align-items: center; justify-content: center; gap: 10px; font: 700 12px var(--font-deco); letter-spacing: .3em; padding-left: .3em; color: var(--gold); text-transform: uppercase; }
.card-type::before, .card-type::after { content: ""; width: 5px; height: 5px; background: var(--gold-line); transform: rotate(45deg); }
.card-level { display: flex; align-items: center; justify-content: center; gap: 6px; font: 10px var(--font-deco); letter-spacing: .2em; color: #c4a07a; text-transform: uppercase; }
.card-level::before, .card-foot i { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--lvl)); flex-shrink: 0; }
.card-main { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.card-text { padding: 12px 0; text-align: center; text-wrap: balance; font: 600 27px/1.25 var(--font-serif); }
.card-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.card-help { text-align: center; font-size: 12.5px; line-height: 1.45; color: #dcbfae; text-wrap: pretty; }
.card-foot { display: flex; align-items: center; justify-content: center; gap: 10px; font: 10px var(--font-deco); letter-spacing: .2em; color: var(--gold-dim); text-transform: uppercase; text-align: center; }
.card-foot { white-space: nowrap; }
.card-foot::before, .card-foot::after { content: ""; flex: 0 1 28px; min-width: 8px; height: 1px; background: #8f6d43; }
.card.face { overflow: hidden; }
.card.face.tight .card-help { display: none; }
.comodin-body { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.comodin-icon { width: 76px; height: 76px; border-radius: 50%; border: 1px solid rgb(233 194 122 / .5); background: rgb(233 194 122 / .08); display: grid; place-items: center; color: var(--gold); }
.comodin-icon .ico { width: 34px; height: 34px; }
.comodin-name { font: italic 600 46px/1 var(--font-serif); color: var(--gold); }
.comodin-desc { font: 600 24px/1.3 var(--font-serif); text-wrap: balance; }

.actions { display: flex; flex-direction: column; gap: 10px; }
.actions-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.actions-row .btn { min-height: 50px; padding: 0 6px; gap: 6px; font-size: 13px; }
.actions-row .btn .ico { width: 16px; height: 16px; }
/* Sin temporizador ni penitencia: Listo y Cambiar en una sola fila */
.actions.simple { display: grid; grid-template-columns: 1fr 120px; }
.actions.simple .actions-row { display: contents; }
.actions.simple .btn { min-height: 56px; border-radius: 16px; font-size: 14px; }
.actions.simple .btn.primary { border-radius: 14px; }

.stops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.stop-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px;
  border: 1.5px solid var(--stop); background: rgb(229 56 75 / .1); font-size: 13px;
}
.stop-btn b { letter-spacing: .06em; color: var(--stop-text); }
.stop-btn span { color: var(--muted); }
.stop-btn:disabled { border-style: dashed; border-color: #5a3346; background: transparent; opacity: .55; cursor: not-allowed; }
.stop-btn:disabled b, .stop-btn:disabled span { color: var(--muted-2); }
.stop-btn:disabled .ico { color: #8f6c7b; }
.stops.big .stop-btn { min-height: 56px; border-radius: 16px; gap: 10px; }
.stops.big .stop-btn .ico { width: 22px; height: 22px; }
.stops.big .stop-btn .lbl { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.stops.big .stop-btn b { font-size: 14px; }
.stops.big .stop-btn span { font-size: 12px; }
.stop-btn .lbl { display: contents; }

/* ---------- Hoja inferior ---------- */
dialog {
  margin: auto auto 0; width: 100%; max-width: 520px; max-height: 92dvh; border: 0; border-top: 1px solid var(--line);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; background: #1f0d16; color: var(--text);
  padding: 12px 22px calc(28px + var(--safe-b)); overflow: auto;
}
dialog::backdrop { background: rgb(8 2 5 / .74); backdrop-filter: blur(2px); }
dialog[open] { animation: sheet .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet { from { transform: translateY(100%); } }
.dlg-body { display: flex; flex-direction: column; gap: 20px; outline: none; }
.dlg-body::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
.dlg-head { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 6px; }
.dlg-head h3 { margin: 0; font: 700 32px/1.1 var(--font-serif); }
.dlg-head h3 em { color: var(--c-text); }
.dlg-head p { font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 320px; }
.dlg-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); background: rgb(233 194 122 / .1); border: 1px solid rgb(233 194 122 / .4); }
.dlg-icon .ico { width: 26px; height: 26px; }
.dlg-icon.red { color: var(--stop-text); background: rgb(229 56 75 / .12); border-color: rgb(229 56 75 / .45); }
.lv-step { display: flex; align-items: center; gap: 12px; color: var(--muted-2); }
.lv-step > svg { width: 28px; height: 16px; }
.lv-step .flame-num .llama { width: 34px; height: 44px; }
.lv-step .flame-num b { font-size: 14px; margin-top: 0; }
.flame-num.big .llama { width: 52px; height: 68px; filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--c) 55%, transparent)); }
.lv-step .flame-num.big b, .dlg-head > .flame-num.big b { font-size: 20px; margin-top: 2px; }
.dlg-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgb(233 194 122 / .08); font-size: 13px; line-height: 1.45; color: #e3cfa9; }
.dlg-note .ico { color: var(--gold); }
.dlg-actions { display: flex; flex-direction: column; gap: 8px; }

.menu-title { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 0; }
.menu-title h3 { margin: 0; font: 700 28px var(--font-serif); }
.menu-title span { font-size: 13px; color: var(--muted-2); }
.menu-list { display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-soft); overflow: hidden; }
.menu-item { min-height: 60px; padding: 8px 16px; border: 0; background: transparent; display: flex; align-items: center; gap: 14px; text-align: left; }
.menu-item + .menu-item { border-top: 1px solid var(--line-soft); }
.menu-item .ico-box { width: 36px; height: 36px; border-radius: 10px; background: rgb(233 194 122 / .12); color: var(--gold); display: grid; place-items: center; flex-shrink: 0; }
.menu-item .ico-box.lvl { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c-text); }
.menu-item span:last-child { display: flex; flex-direction: column; }
.menu-item b { font-size: 15px; }
.menu-item small { font-size: 12px; color: var(--muted); }
dialog:has(.menu-list) { padding-inline: 16px; }
dialog:has(.menu-list) .dlg-body { gap: 14px; }

/* ---------- STOP (rojo a propósito) ---------- */
/* Con foto (.has-photo): mano de hombre o mujer según quién lo usó, mismo tratamiento que Acceso.
   Sin género elegido: octógono grande sobre el resplandor rojo. */
.stop-overlay {
  position: fixed; inset: 0; z-index: 50; overflow: hidden;
  padding: calc(44px + var(--safe-t)) 36px calc(44px + var(--safe-b));
  display: flex; flex-direction: column; color: #fff;
  background: radial-gradient(closest-side at 50% 42%, rgb(229 56 75 / .38), transparent 100%) no-repeat 50% 0 / 160% 80%, #2a050c;
  animation: fade .2s;
}
.stop-overlay.has-photo { background: var(--bg); }
.stop-overlay > :not(.stop-photo, .screen-frame) { position: relative; z-index: 3; }
.screen-frame.red .f1 { stroke: var(--stop); opacity: .7; }
.screen-frame.red .f2 { stroke: var(--stop); opacity: .4; }
.screen-frame.red .f3 { fill: var(--stop); }
.stop-photo { display: none; position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: min(100%, 520px); height: 66%; overflow: hidden; z-index: 0; isolation: isolate; background: var(--bg); }
.has-photo .stop-photo { display: block; }
.stop-photo img {
  position: absolute; left: -5%; top: 40px; width: 110%; height: calc(100% - 40px);
  object-fit: cover; object-position: 50% 30%;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 48%, #000 45%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 48%, #000 45%, transparent 100%);
  filter: grayscale(1) contrast(1.18) brightness(.9); opacity: .8;
}
.stop-photo::before { content: ""; position: absolute; inset: 0; z-index: 1; mix-blend-mode: color; background: linear-gradient(165deg, #8a2238 0%, #3b0a15 55%, #14070d 100%); }
.stop-photo::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(180deg, rgb(20 7 13 / .35) 0%, transparent 18%, transparent 48%, rgb(20 7 13 / .88) 78%, var(--bg) 100%),
    radial-gradient(ellipse 90% 75% at 50% 40%, transparent 45%, rgb(20 7 13 / .9) 100%);
}
.stop-pill {
  align-self: center; display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px;
  border: 1px solid rgb(255 154 165 / .55); border-radius: 999px; background: rgb(20 7 13 / .55);
  font: 700 11px/1 var(--font-deco); letter-spacing: .22em; color: #ffb3bc;
}
.stop-pill .diamond { width: 4px; height: 4px; background: var(--stop); }
.stop-center { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px; text-align: center; }
.stop-overlay:not(.has-photo) .stop-center { justify-content: center; }
.stop-sign { width: 180px; height: 180px; position: relative; display: grid; place-items: center; margin-bottom: 14px; }
.stop-sign svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stop-sign span { position: relative; font: 700 40px var(--font-deco); letter-spacing: .08em; padding-left: .08em; }
.has-photo .stop-sign { display: none; }
.stop-word { display: none; align-items: center; gap: 14px; }
.has-photo .stop-word { display: flex; }
.stop-word svg { width: 40px; height: 40px; flex-shrink: 0; }
.stop-word span { font: 700 60px/1 var(--font-deco); letter-spacing: .14em; padding-left: .14em; text-shadow: 0 2px 30px rgb(0 0 0 / .6), 0 0 40px rgb(229 56 75 / .45); }
#stop-who { margin: 0; font: italic 600 30px/1.1 var(--font-serif); color: #ffe3e7; }
.stop-sub { max-width: 300px; font-size: 15px; line-height: 1.55; color: #f2b9c1; text-wrap: balance; }
.stop-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 472px; margin: 28px auto 0; }
.btn.stop-main { min-height: 56px; border: 0; border-radius: 14px; background: #fff; color: #8f1426; font: 700 15px var(--font-deco); letter-spacing: .12em; box-shadow: 0 12px 30px rgb(0 0 0 / .45); }
.btn.stop-alt { min-height: 52px; border-radius: 14px; border-color: rgb(255 208 214 / .5); background: rgb(20 7 13 / .5); color: #ffe3e7; font-size: 15px; }
.stop-note { margin-top: 4px; text-align: center; font-size: 12px; color: #e8a3ad; }

/* ---------- Temporizador ---------- */
.timer-overlay {
  position: fixed; inset: 0; z-index: 50; padding: calc(56px + var(--safe-t)) 24px calc(32px + var(--safe-b));
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lvl) 22%, transparent), transparent 72%) no-repeat 50% 80px / 630px 600px, var(--bg);
  animation: fade .2s;
}
.timer-context { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.timer-kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.timer-text { font-size: 15px; line-height: 1.45; color: var(--muted); max-width: 300px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ring-wrap { flex-grow: 1; position: relative; display: grid; place-items: center; width: 260px; }
.ring { position: absolute; width: 260px; height: 260px; top: 50%; left: 0; margin-top: -130px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line-soft); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--lvl); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 326.73; transition: stroke-dashoffset .25s linear; }
.timer-num { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.timer-num span { font: 700 84px/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer-num small { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.timer-overlay.done .timer-num span { font-size: 52px; color: var(--gold); animation: pulse .6s 3; }
.timer-actions { width: 100%; max-width: 472px; }
.timer-actions .btn { min-height: 56px; border-radius: 16px; font-size: 15px; }
#timer-close { background: transparent; }
@keyframes pulse { 50% { transform: scale(1.12); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Fin ---------- */
.end-body { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding-top: 40px; }
.end-emblem {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #5a1f3a, #1c0912 70%);
  box-shadow: 0 0 0 1px rgb(233 194 122 / .45), 0 0 0 8px rgb(233 194 122 / .06), 0 18px 50px rgb(232 69 124 / .3);
  font: 700 48px var(--font-serif); color: var(--gold);
}
.end-title { margin: 0; font: italic 600 46px/1 var(--font-serif); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.stat { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.stat > b { font: 700 40px/1 var(--font-serif); color: var(--gold); }
.stat-dots { display: flex; gap: 4px; }
.stat-dots .llama { width: 15px; height: 20px; }
.stat em { font-style: normal; font-weight: 700; color: var(--c-text); }
.end-line { font: italic 500 22px/1.35 var(--font-serif); color: #ecd3dc; max-width: 290px; }
.end-prendas { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px;
  border: 1px solid rgb(201 162 94 / .55); background: rgb(233 194 122 / .07); text-align: left; }
.end-prendas p { font: 600 17px/1.35 var(--font-serif); color: var(--cream); }
.end-prendas b { font: 700 11px var(--font-deco); letter-spacing: .14em; color: var(--gold); text-transform: uppercase; display: block; margin-bottom: 2px; }
/* La hoja de prenda final tiene varias opciones largas: texto a la izquierda, sin mayúsculas */
#dlg .dlg-actions .btn.outline { justify-content: flex-start; text-align: left; height: auto; min-height: 48px; padding: 10px 14px; line-height: 1.35; }
.end-actions { display: flex; flex-direction: column; gap: 10px; }
.end-actions .ghost { min-height: 52px; font-size: 15px; }

/* ---------- Inicio: Ajustes (⋯ arriba a la derecha, dentro del marco) ---------- */
.home-settings { position: absolute; top: calc(30px + var(--safe-t)); right: 30px; z-index: 4; background: rgb(14 7 8 / .6); }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .field input { height: 48px; }
.login-msg { min-height: 1.3em; font-size: 13px; color: var(--stop-text); text-align: center; }

/* ---------- Inicio: Salir ---------- */
.btn-exit {
  align-self: center; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 14px; background: transparent; color: var(--gold-ghost);
  font: 600 13px var(--font-deco); letter-spacing: .12em; margin-top: -2px;
}
.btn-exit .ico { width: 16px; height: 16px; }

/* ---------- Oferta de instalación (hoja inferior) ---------- */
dialog:has(.offer) { background: linear-gradient(180deg, #24101a, #170910); border-top-color: rgb(201 162 94 / .55); box-shadow: 0 -20px 60px rgb(0 0 0 / .6); }
.dlg-body-inner { display: flex; flex-direction: column; gap: 20px; }
.offer-head { display: flex; align-items: center; gap: 16px; }
.offer-head svg { width: 68px; height: 68px; flex-shrink: 0; border-radius: 16px; box-shadow: 0 10px 30px rgb(0 0 0 / .5), 0 0 0 1px rgb(201 162 94 / .35); }
.offer-head div { display: flex; flex-direction: column; gap: 4px; }
.offer-kicker { font: 700 10px var(--font-deco); letter-spacing: .22em; color: var(--gold-line); }
.offer-head h3 { margin: 0; font: 700 clamp(24px, 7.4vw, 30px)/1.05 var(--font-serif); }
.offer-lead { font-size: 15px; line-height: 1.55; color: #d9c2bd; text-wrap: pretty; }
.offer-list { display: flex; flex-direction: column; border-radius: 16px; background: rgb(14 7 8 / .7); border: 1px solid var(--line-soft); }
.offer-list > div { display: flex; align-items: center; gap: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.4; }
.offer-list > div + div { border-top: 1px solid #2c1520; }
.offer-list svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--gold); }
.offer-list span span { color: var(--muted); }
.offer-steps { margin: 0; padding: 0; list-style: none; counter-reset: paso; display: flex; flex-direction: column; border-radius: 16px; background: rgb(14 7 8 / .7); border: 1px solid var(--line-soft); }
.offer-steps li { counter-increment: paso; display: flex; align-items: center; gap: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.4; }
.offer-steps li + li { border-top: 1px solid #2c1520; }
.offer-steps li::before { content: counter(paso); font: 700 20px var(--font-serif); color: var(--gold); min-width: 14px; }
.offer-steps svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--gold); margin-left: auto; }
.offer .dlg-actions { gap: 6px; }
.offer .btn.ghost { min-height: 46px; font-size: 13px; }

/* ---------- Instalando (pantalla completa) ---------- */
.installing {
  position: fixed; inset: 0; z-index: 55; overflow: hidden; background: var(--bg);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(44px + var(--safe-t)) 36px calc(40px + var(--safe-b));
  animation: fade .3s;
}
.installing > :not(.inst-photo, .screen-frame) { position: relative; z-index: 3; }
.inst-photo { position: absolute; inset: 0; overflow: hidden; z-index: 0; isolation: isolate; background: var(--bg); }
.inst-kb { position: absolute; inset: 0; transform-origin: 50% 40%; animation: kenburns 16s ease-in-out infinite alternate; }
.inst-kb img {
  position: absolute; left: 50%; transform: translateX(-50%); top: 20px; width: min(100%, 520px); height: 76%;
  object-fit: cover; object-position: 50% 40%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 70%, transparent 100%);
  filter: grayscale(1) contrast(1.15) brightness(.85); opacity: .6;
}
.inst-photo::before { content: ""; position: absolute; inset: 0; z-index: 1; mix-blend-mode: color; background: linear-gradient(165deg, #8a2238 0%, #3b0a15 55%, #14070d 100%); }
.inst-photo::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(180deg, rgb(20 7 13 / .4) 0%, rgb(20 7 13 / .1) 20%, rgb(20 7 13 / .55) 62%, var(--bg) 92%),
    radial-gradient(ellipse 90% 70% at 50% 40%, rgb(20 7 13 / .15) 30%, rgb(20 7 13 / .92) 100%);
}
.inst-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px;
  border: 1px solid rgb(201 162 94 / .6); border-radius: 999px; background: rgb(20 7 13 / .55);
  font: 700 11px/1 var(--font-deco); letter-spacing: .24em; color: var(--gold);
}
.inst-pill .diamond { width: 4px; height: 4px; }
.inst-stage { width: 240px; height: 280px; margin-top: auto; flex-shrink: 0; }
.inst-halo { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--f2) 53%, transparent), transparent 68%); animation: glow 2.4s ease-in-out infinite; transition: background .9s; }
.inst-flame { position: absolute; left: 54px; top: 90px; width: 132px; height: 176px; overflow: visible; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--f2) 53%, transparent)); transition: filter .9s; }
.inst-flame path { transition: fill .9s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.inst-flame .fl-o { fill: var(--f1); animation: flick 1.6s ease-in-out infinite; }
.inst-flame .fl-m { fill: var(--f2); animation: flick 1.1s ease-in-out -.4s infinite; }
.inst-flame .fl-c { fill: var(--f3); animation: flickCore .8s ease-in-out infinite; }
.inst-embers { position: absolute; inset: 0; pointer-events: none; }
.ember { position: absolute; top: 270px; border-radius: 50%; opacity: 0; animation: rise ease-out infinite; }
.inst-levels { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin-top: 10px; }
.inst-levels .llama { width: 21px; height: 28px; transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1), filter .6s ease; opacity: .2; transform: translateY(6px) scale(.8); filter: grayscale(.8); }
.inst-levels .llama.on { opacity: 1; transform: none; filter: drop-shadow(0 0 8px var(--f2)); }
.inst-phrases { position: relative; width: 100%; height: 96px; margin-top: 22px; flex-shrink: 0; }
.inst-phrases p {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  font: italic 600 32px/1.15 var(--font-serif); color: var(--cream); text-wrap: balance; text-shadow: 0 2px 20px rgb(0 0 0 / .6);
  opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease;
}
.inst-phrases p.past { transform: translateY(-14px); }
.inst-phrases p.on { opacity: 1; transform: none; }
.inst-bottom { width: 100%; max-width: 448px; margin-top: auto; min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; }
.inst-progress { display: flex; flex-direction: column; gap: 14px; padding: 0 12px 30px; }
.inst-track { height: 3px; border-radius: 3px; background: rgb(201 162 94 / .18); overflow: hidden; }
.inst-bar { height: 100%; width: 0; border-radius: 3px; box-shadow: 0 0 12px rgb(246 220 160 / .6); transition: width .25s linear; background: linear-gradient(90deg, #a87a35, #f6dca0, #a87a35); background-size: 200px 100%; animation: shimmer 1.6s linear infinite; }
.inst-meta { display: flex; justify-content: space-between; font: 11px var(--font-deco); letter-spacing: .2em; color: var(--gold-dim); }
.inst-done { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.inst-done p { font-size: 14px; color: #d9c2bd; text-align: center; }
.inst-done .inst-hint { font-size: 12px; color: var(--muted-2); min-height: 1.4em; }
@keyframes kenburns { from { transform: scale(1) translateY(0); } to { transform: scale(1.09) translateY(-14px); } }
@keyframes flick { 0%, 100% { transform: scale(1, 1) skewX(0); } 20% { transform: scale(1.03, .96) skewX(2deg); } 45% { transform: scale(.97, 1.05) skewX(-2deg); } 70% { transform: scale(1.02, .99) skewX(1deg); } }
@keyframes flickCore { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.92, 1.08); } 60% { transform: scale(1.06, .94); } }
@keyframes glow { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes rise { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--dx), -300px) scale(.3); opacity: 0; } }
@keyframes shimmer { from { background-position: -200px 0; } to { background-position: 200px 0; } }

/* ---------- Hasta pronto ---------- */
#bye { background: #0f060a; padding: 0; overflow: hidden; animation: fade .6s; }
body[data-screen="bye"] { background: #0f060a; }
body[data-screen="bye"] .glow { display: none; }
.bye-frame { opacity: .45; }
.bye-frame .f2 { display: none; }
.bye-body { position: relative; z-index: 3; flex: 1; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: calc(60px + var(--safe-t)) 40px calc(56px + var(--safe-b)); }
.bye-center { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; position: relative; }
.bye-center::before { content: ""; position: absolute; left: 50%; top: 48px; width: 300px; height: 300px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgb(201 162 94 / .10), transparent 70%); z-index: -1; }
.bye-emblem { width: 96px; height: 96px; margin-bottom: 12px; animation: respira 4s ease-in-out infinite; }
@keyframes respira { 50% { transform: scale(1.05); opacity: .8; } }
.bye-emblem path { stroke-width: 1; }
.bye-emblem path.em-inner { stroke-width: .6; opacity: .6; }
.bye-title { margin: 0; font: italic 500 46px/1 var(--font-serif); color: var(--cream); }
.bye-divider::before, .bye-divider::after { width: 36px; background: #8f6d43; }
.bye-divider .diamond { width: 5px; height: 5px; }
.bye-sub { font-size: 14px; line-height: 1.55; color: var(--muted-2); }
.btn.bye-back { min-height: 52px; background: transparent; color: var(--gold-ghost); font: 600 13px var(--font-deco); letter-spacing: .14em; max-width: 472px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 60;
  background: #1f0d16; border: 1px solid rgb(201 162 94 / .45); padding: 10px 16px; border-radius: 12px;
  max-width: calc(100vw - 32px); text-align: center; font-size: 14px; animation: fade .2s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-height: 680px) {
  .turn-name { font-size: 36px; }
  .turn.both .turn-name { font-size: 30px; }
  .turn { gap: 4px; margin-top: 6px; }
  .card { height: min(50dvh, 445px); }
  .card-text { font-size: 21px; padding: 6px 0; }
  .comodin-name { font-size: 34px; }
  .comodin-desc { font-size: 19px; }
  .comodin-icon { width: 54px; height: 54px; }
  .comodin-icon .ico { width: 26px; height: 26px; }
  .card-help { font-size: 11.5px; }
  .card-bottom { gap: 6px; }
  .back-center { gap: 10px; }
  .back-center .emblem { width: 54px; height: 54px; }
  .back-logo { font-size: 34px; }
  .table { padding: 10px 0; }
  .title span { font-size: 46px; }
  .title.small span { font-size: 40px; }
  .framed-body { padding-top: calc(28px + var(--safe-t)); padding-bottom: calc(30px + var(--safe-b)); }
  .home-body { padding-top: calc(40px + var(--safe-t)); }
  .hero-text { gap: 10px; }
  .hero-actions { margin-top: 16px; }
  .ring-wrap, .ring { width: 220px; }
  .ring { height: 220px; margin-top: -110px; }
  .timer-num span { font-size: 64px; }
  .stop-sign { width: 140px; height: 140px; }
  .stop-sign span { font-size: 30px; }
  .stop-word span { font-size: 46px; }
  .stop-overlay { padding-top: calc(30px + var(--safe-t)); padding-bottom: calc(28px + var(--safe-b)); }
  .stop-actions { margin-top: 18px; }
}
