/* ============================================================
   Story Engine — Modo Historia fullscreen 2026-05-12
   Prefix: se-* (story engine)
   ============================================================ */

.se-host {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a0408;
  color: #f3e8d5;
  font-family: 'Inter', sans-serif;
  --se-gold:       #ffc857;
  --se-gold-deep:  #d4a020;
  --se-crimson:    #b41e2e;
  --se-crimson-soft: #ff7a8a;
  --se-bg-1:       rgba(20, 8, 12, 0.94);
  --se-bg-2:       rgba(12, 4, 8, 0.98);
  --se-border:     rgba(212, 175, 55, 0.40);
  animation: seHostFadeIn 0.4s ease-out;
}
@keyframes seHostFadeIn { from { opacity: 0; } to { opacity: 1; } }

.se-screen {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #0a0408;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: seSceneIn 0.45s cubic-bezier(.2,.9,.3,1);
}
@keyframes seSceneIn {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}
.se-screen-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 100% at 50% 50%, transparent 0%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0.92) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.72) 100%);
  pointer-events: none;
}

/* Botón salir global */
.se-exit-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  border: 1px solid var(--se-border);
  color: var(--se-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 20;
  transition: background .15s, transform .15s;
}
.se-exit-btn:hover { background: rgba(180,30,50,0.35); transform: scale(1.08); }

/* Botones genéricos */
.se-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--se-border);
  background: rgba(0,0,0,0.6);
  color: var(--se-gold);
  border-radius: 11px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s ease;
}
.se-btn:hover:not(:disabled) {
  background: rgba(180,30,50,0.20);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}
.se-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.se-btn-primary {
  background: linear-gradient(180deg, #ffd991 0%, #d4a020 60%, #8a5a0a 100%);
  color: #2a1700;
  border-color: rgba(255,200,87,0.7);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 0 18px rgba(255,200,87,0.30);
}
.se-btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffe6a8 0%, #e6b03e 60%, #a67213 100%);
}

/* ============================================================
   LOADING / ERROR
   ============================================================ */
.se-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
}
.se-loading-rune {
  font-size: 60px;
  color: var(--se-gold);
  animation: seRuneSpin 2.4s linear infinite;
  filter: drop-shadow(0 0 18px rgba(255,200,87,0.5));
}
@keyframes seRuneSpin { to { transform: rotate(360deg); } }
.se-loading-text { color: var(--se-gold); font-family: 'Cinzel', serif; letter-spacing: 0.10em; }

.se-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 22px; text-align: center;
}
.se-error i { font-size: 56px; color: var(--se-crimson-soft); }
.se-error h2 { font-family: 'Cinzel', serif; color: var(--se-gold); margin: 0; }
.se-error p { color: var(--se-text-dim); max-width: 360px; }

/* ============================================================
   CHAPTER SELECT
   ============================================================ */
.se-screen-select {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(180,30,50,0.20), transparent 70%),
    linear-gradient(180deg, #160810 0%, #0a0408 100%);
  overflow-y: auto;
  padding: 60px 24px 24px;
}
.se-select-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.se-select-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.30em;
  color: var(--se-crimson-soft);
  margin-bottom: 10px;
}
.se-select-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 900;
  background: linear-gradient(180deg, #ffeac0, #ffd24a, #b8860b);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin: 0 0 10px;
  text-shadow: 0 0 30px rgba(255,200,87,0.35);
}
.se-select-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: rgba(243,232,213,0.78);
  margin: 0 auto 26px;
  max-width: 580px;
  line-height: 1.5;
}
.se-chapters-list { display: flex; flex-direction: column; gap: 12px; }
.se-chapter-card {
  background: linear-gradient(180deg, var(--se-bg-1), var(--se-bg-2));
  border: 1px solid var(--se-border);
  border-radius: 14px;
  padding: 18px;
  text-align: left;
  transition: transform .15s, border-color .15s;
}
.se-chapter-card:hover {
  transform: translateY(-2px);
  border-color: var(--se-gold);
}
.se-chapter-card.is-completed {
  border-color: rgba(95,214,132,0.45);
  background: linear-gradient(180deg, rgba(20,30,18,0.92), rgba(10,18,10,0.96));
}
.se-chapter-num {
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  letter-spacing: 0.20em;
  color: var(--se-crimson-soft);
  margin-bottom: 4px;
}
.se-chapter-title {
  font-family: 'Cinzel', serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--se-gold);
  margin-bottom: 6px;
}
.se-chapter-intro {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: rgba(243,232,213,0.78);
  line-height: 1.4;
  margin-bottom: 12px;
}
.se-chapter-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.se-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.se-chip.is-done { background: rgba(95,214,132,0.20); border: 1px solid rgba(95,214,132,0.5); color: #5fd684; }

/* ============================================================
   CINEMATIC VIDEO
   ============================================================ */
.se-screen-cinematic {
  background: #000;
  align-items: center;
  justify-content: center;
}
.se-cinematic-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
  background: #000;
}
/* Overlay negro para fade-in al iniciar + fade-out al terminar.
   Arranca con is-active (negro) y al hacer .remove('is-active') desvanece. */
.se-cinematic-fade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.9s ease-out;
  z-index: 6;
}
.se-cinematic-fade.is-active { opacity: 1; }
.se-cinematic-fade:not(.is-active) { opacity: 0; }

.se-cinematic-narration {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(14px, 2.5vw, 20px);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.95);
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.55));
  border-radius: 12px;
  z-index: 5;
}
/* Botón "Saltar" sutil en esquina */
.se-cinematic-skip {
  position: absolute;
  bottom: 22px;
  right: 22px;
  z-index: 10;
  font-size: 12px !important;
  padding: 8px 14px !important;
  letter-spacing: 0.08em !important;
  background: rgba(0,0,0,0.5) !important;
  color: rgba(255,255,255,0.65) !important;
  border-color: rgba(255,255,255,0.18) !important;
  box-shadow: none !important;
}
.se-cinematic-skip:hover { color: #fff !important; background: rgba(0,0,0,0.75) !important; }
.se-btn-ghost {
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.2);
  box-shadow: none;
}

/* ============================================================
   DIALOGUE — estilo videojuego JRPG: portrait grande + texto al costado
   ============================================================ */
.se-screen-dialogue,
.se-screen-choice {
  justify-content: flex-end;
}
.se-screen-narration {
  justify-content: center !important;
  align-items: center !important;
}

/* Stage = layout principal del diálogo */
.se-dlg-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  min-height: 100%;
  padding: 24px 28px;
  pointer-events: none;
}
.se-dlg-stage > * { pointer-events: auto; }

/* Portrait con frame ornamental — tamaño medio, no fullscreen */
.se-dlg-portrait-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3/4;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background:
    linear-gradient(135deg, rgba(255,200,87,0.18) 0%, rgba(180,30,50,0.12) 50%, rgba(255,200,87,0.18) 100%),
    rgba(0,0,0,0.55);
  border: 2px solid var(--se-gold);
  border-radius: 14px;
  box-shadow:
    0 18px 50px rgba(0,0,0,0.7),
    0 0 32px rgba(255,200,87,0.28),
    inset 0 0 28px rgba(0,0,0,0.45);
  animation: seDlgPortraitIn 0.55s cubic-bezier(.2,.85,.3,1);
}
/* Esquinas ornamentales del frame */
.se-dlg-portrait-wrap::before,
.se-dlg-portrait-wrap::after {
  content: '';
  position: absolute;
  width: 26px; height: 26px;
  border: 2px solid var(--se-gold);
  pointer-events: none;
}
.se-dlg-portrait-wrap::before {
  top: -8px; left: -8px;
  border-right: none; border-bottom: none;
  border-top-left-radius: 14px;
}
.se-dlg-portrait-wrap::after {
  bottom: -8px; right: -8px;
  border-left: none; border-top: none;
  border-bottom-right-radius: 14px;
}
@keyframes seDlgPortraitIn {
  from { opacity: 0; transform: translateX(-30px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}
.se-dlg-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 10px;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.7));
}
.se-dlg-portrait-placeholder {
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--se-gold);
  font-size: 100px;
}

/* Caja de texto a la derecha */
.se-dlg-body {
  position: relative;
  background: linear-gradient(180deg, rgba(8,4,8,0.78), rgba(8,4,8,0.92));
  border: 1px solid var(--se-border);
  border-radius: 14px;
  padding: 22px 26px 22px;
  align-self: center;
  justify-self: start;
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55);
  animation: seDlgBodyIn 0.5s 0.15s both cubic-bezier(.2,.85,.3,1);
}
@keyframes seDlgBodyIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.se-dlg-name {
  font-family: 'Cinzel', serif;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffeac0, #ffd24a, #b8860b);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 2px 14px rgba(0,0,0,0.85);
  margin-bottom: 12px;
}
.se-dlg-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(17px, 2.6vw, 22px);
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.95);
  margin-bottom: 16px;
  min-height: 80px;
  user-select: none;
  transition: opacity .15s ease;
}
.se-dlg-caret {
  display: inline-block;
  color: var(--se-gold);
  font-weight: normal;
  animation: seDlgCaret 0.9s steps(2, end) infinite;
  margin-left: 2px;
}
@keyframes seDlgCaret { 50% { opacity: 0; } }

.se-dlg-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.se-dlg-progress {
  font-size: 12px;
  letter-spacing: 0.10em;
  color: rgba(243,232,213,0.55);
  font-family: 'Cinzel', serif;
}

/* Mobile: portrait arriba mediano, texto abajo, stack vertical */
@media (max-width: 720px) {
  .se-dlg-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-items: start;
    padding: 14px 14px;
    gap: 14px;
  }
  .se-dlg-portrait-wrap {
    width: 200px;
    max-width: 60vw;
    aspect-ratio: 3/4;
    justify-self: center;
    margin-top: 30px;
  }
  .se-dlg-body { padding: 16px 18px 20px; }
  .se-dlg-text { min-height: 110px; }
}

/* ============================================================
   NARRATION — Ken Burns bg + ornate frame + typewriter
   ============================================================ */
/* .se-screen-narration: la regla position:absolute viene del .se-screen base
   y la centrado del bloque anterior (justify/align center !important).
   Solo agregamos padding + bg fallback. */
/* Background fullscreen con animación Ken Burns (zoom + pan sutil) */
.se-narr-bg {
  position: absolute;
  inset: -2%;
  background-size: cover;
  background-position: center;
  background-color: #0a0408;
  z-index: 0;
  animation: seNarrKenBurns 22s ease-in-out infinite alternate;
}
@keyframes seNarrKenBurns {
  0%   { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.14) translate(-2%, -1%); }
}
.se-narr-vignette {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse 75% 65% at 50% 50%, transparent 0%, rgba(0,0,0,0.45) 60%, rgba(0,0,0,0.92) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 30%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* Frame con texto centrado y esquinas ornamentales */
.se-narr-frame {
  position: relative;
  z-index: 3;
  max-width: 720px;
  width: 100%;
  padding: 36px 38px 32px;
  background: linear-gradient(180deg, rgba(14,8,10,0.86), rgba(8,4,6,0.92));
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: 6px;
  box-shadow:
    0 30px 70px rgba(0,0,0,0.7),
    0 0 40px rgba(255,200,87,0.18),
    inset 0 0 30px rgba(180,30,50,0.10);
  text-align: center;
  animation: seNarrFrameIn 0.7s cubic-bezier(.2,.85,.3,1);
}
@keyframes seNarrFrameIn {
  from { opacity: 0; transform: scale(0.93) translateY(20px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
/* 4 esquinas ornamentales en L invertida */
.se-narr-corner {
  position: absolute;
  width: 28px; height: 28px;
  pointer-events: none;
  border: 2px solid var(--se-gold);
  box-shadow: 0 0 10px rgba(255,200,87,0.35);
}
.se-narr-corner-tl { top: -8px; left: -8px;  border-right: none; border-bottom: none; }
.se-narr-corner-tr { top: -8px; right: -8px; border-left: none;  border-bottom: none; }
.se-narr-corner-bl { bottom: -8px; left: -8px;  border-right: none; border-top: none; }
.se-narr-corner-br { bottom: -8px; right: -8px; border-left: none;  border-top: none; }
/* Divider decorativo arriba del texto */
.se-narr-frame::before {
  content: '◆';
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  color: var(--se-gold);
  font-size: 10px;
  letter-spacing: 0.5em;
  opacity: 0.7;
}

.se-narr-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(17px, 2.6vw, 22px);
  line-height: 1.65;
  color: #f3e8d5;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
  min-height: 100px;
  margin: 14px 0 22px;
  user-select: none;
}
.se-narration-next {
  animation: seBtnPulse 2.4s ease-in-out infinite;
}
@keyframes seBtnPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 0 18px rgba(255,200,87,0.30); }
  50%      { box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 0 30px rgba(255,200,87,0.55); }
}

@media (max-width: 720px) {
  .se-narr-frame { padding: 28px 22px 26px; }
  .se-narr-text { min-height: 140px; }
}

/* ============================================================
   CHOICE
   ============================================================ */
.se-choice-box {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(8,4,8,0.0), rgba(8,4,8,0.95) 30%);
  padding: 24px 24px 32px;
  text-align: center;
}
.se-choice-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.20em;
  color: var(--se-crimson-soft);
  background: rgba(180,30,50,0.18);
  border: 1px solid rgba(180,30,50,0.5);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.se-choice-prompt {
  font-family: 'Cinzel', serif;
  font-size: clamp(18px, 3.2vw, 24px);
  color: var(--se-gold);
  margin: 0 auto 18px;
  max-width: 580px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.92);
}
.se-choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}
.se-choice-option {
  background: linear-gradient(180deg, var(--se-bg-1), var(--se-bg-2));
  border: 1px solid var(--se-border);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: all .15s ease;
  color: #fff;
}
.se-choice-option:hover:not(:disabled) {
  border-color: var(--se-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 0 18px rgba(255,200,87,0.20);
}
.se-choice-option:disabled { opacity: 0.5; cursor: not-allowed; }
.se-choice-label {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--se-gold);
  margin-bottom: 4px;
}
.se-choice-hint {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13.5px;
  color: rgba(243,232,213,0.72);
}

/* ============================================================
   COMBAT — Rediseño inmersivo 2026-05-12
   Layout: bg fullscreen + vignette · enemy arena top · player bar mid
            · action bar bottom · log overlay esquina derecha
   ============================================================ */
.se-screen-combat {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: 0;
  gap: 0;
  background-size: cover;
  background-position: center;
}
/* Vignette para inmersión */
.se-bg-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 50%, transparent 0%, rgba(0,0,0,0.55) 75%, rgba(0,0,0,0.95) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Combat title strip */
.se-combat-title {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px 10px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--se-gold);
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
  animation: seCombatTitleIn 0.5s cubic-bezier(.2,.85,.3,1);
}
@keyframes seCombatTitleIn {
  from { opacity: 0; transform: translateY(-10px); letter-spacing: 0.4em; }
  to   { opacity: 1; transform: translateY(0);    letter-spacing: 0.22em; }
}
.se-combat-title > i { font-size: 18px; }
.se-combat-turn-pill {
  font-size: 11px;
  letter-spacing: 0.10em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,200,87,0.18);
  border: 1px solid rgba(255,200,87,0.5);
  color: #fff;
}

/* ============== ENEMIES ARENA ============== */
.se-enemies-arena {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 16px 20px;
}
.se-enemies-arena.is-single { gap: 0; }

.se-mob {
  position: relative;
  width: clamp(150px, 22vw, 220px);
  cursor: pointer;
  transition: transform .25s ease, opacity .3s ease, filter .3s ease;
  animation: seMobIn 0.5s cubic-bezier(.2,.85,.3,1) both;
}
.se-mob:nth-child(1) { animation-delay: 0.10s; }
.se-mob:nth-child(2) { animation-delay: 0.22s; }
.se-mob:nth-child(3) { animation-delay: 0.34s; }
@keyframes seMobIn {
  from { opacity: 0; transform: translateY(-22px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.se-mob:hover:not(.is-dead) { transform: translateY(-4px); }
.se-mob.is-dead {
  opacity: 0.35;
  filter: grayscale(1);
  pointer-events: none;
}
.se-mob.is-boss-mob { width: clamp(190px, 32vw, 290px); }

/* Mob frame con marco ornamental */
.se-mob-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.55);
  border: 2px solid rgba(180,30,50,0.55);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.7),
    inset 0 0 22px rgba(180,30,50,0.30);
  margin-bottom: 8px;
}
.se-mob.is-boss-mob .se-mob-frame {
  border-color: var(--se-crimson-soft);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.75),
    0 0 30px rgba(180,30,50,0.45),
    inset 0 0 28px rgba(180,30,50,0.35);
}
.se-mob.is-target .se-mob-frame {
  border-color: var(--se-gold);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.75),
    0 0 36px rgba(255,200,87,0.55),
    inset 0 0 22px rgba(255,200,87,0.20);
}
.se-mob-portrait {
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center top;
  transition: transform .3s ease;
}
.se-mob:hover .se-mob-portrait { transform: scale(1.05); }

/* Target ring animado */
.se-mob-target-ring {
  position: absolute;
  inset: -6px;
  border: 2px solid var(--se-gold);
  border-radius: 18px;
  pointer-events: none;
  animation: seTargetRing 1.6s ease-in-out infinite;
}
@keyframes seTargetRing {
  0%, 100% { transform: scale(1);    opacity: 0.85; box-shadow: 0 0 16px rgba(255,200,87,0.45); }
  50%      { transform: scale(1.04); opacity: 1;    box-shadow: 0 0 28px rgba(255,200,87,0.75); }
}

.se-mob-dead-overlay {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
  color: #ff8898;
  font-size: 64px;
}

/* Floating damage numbers */
.se-mob-damage-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.se-dmg-float {
  position: absolute;
  top: 30%; left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px #000, 0 0 14px rgba(255,92,124,0.7);
  pointer-events: none;
  animation: seDmgFloat 1.4s ease-out forwards;
}
.se-dmg-float.is-crit {
  font-size: 38px;
  color: #ffd24a;
  text-shadow: 0 2px 10px #000, 0 0 18px rgba(255,200,87,0.8);
}
@keyframes seDmgFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.7); }
  20%  { opacity: 1; transform: translateX(-50%) translateY(-20px) scale(1.1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-80px) scale(1); }
}

.se-mob-name {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--se-gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.92);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.se-mob-hp-bar {
  position: relative;
  height: 11px;
  background: rgba(0,0,0,0.75);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,200,87,0.30);
  margin-bottom: 2px;
}
.se-mob-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #5fd684 0%, #ffaa50 60%, #ff5c7c 100%);
  transition: width .45s ease;
}
.se-mob-hp-text {
  text-align: center;
  font-size: 10.5px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  font-family: 'Cinzel', serif;
}
.se-mob-hp-sep { opacity: 0.5; margin: 0 1px; }

/* ============== PLAYER BAR (mid) ============== */
.se-player-bar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 0 auto;
  padding: 12px 18px;
  max-width: 720px;
  width: calc(100% - 32px);
  background: linear-gradient(180deg, rgba(20,12,4,0.92), rgba(8,4,2,0.96));
  border: 1px solid var(--se-gold);
  border-radius: 13px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.55), 0 0 22px rgba(255,200,87,0.18);
}
.se-player-bar-name {
  display: flex; align-items: center; gap: 7px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--se-gold);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.se-player-bar-name i { font-size: 16px; }
.se-player-bars-stack {
  display: flex; flex-direction: column; gap: 5px;
  min-width: 0;
}
.se-player-hp-bar,
.se-player-mp-bar {
  position: relative;
  height: 18px;
  background: rgba(0,0,0,0.65);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--se-border);
}
.se-player-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #5fd684 0%, #ffaa50 70%, #ff5c7c 100%);
  transition: width .45s ease;
}
.se-player-mp-fill {
  height: 100%;
  background: linear-gradient(90deg, #4cc4ff 0%, #b884ff 100%);
  transition: width .45s ease;
}
.se-player-bar-text {
  position: absolute;
  top: 50%; left: 12px;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  font-family: 'Cinzel', serif;
}
.se-player-bar-text i { font-size: 13px; }
.se-player-hp-bar .se-player-bar-text i { color: #ff8898; }
.se-player-mp-bar .se-player-bar-text i { color: #6cd4ff; }

/* ============== ACTION BAR (bottom JRPG-style) ============== */
.se-action-bar {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.55) 30%, rgba(0,0,0,0.92) 100%);
}
.se-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 96px;
  padding: 11px 12px 9px;
  background: linear-gradient(180deg, rgba(28,14,18,0.92), rgba(14,6,10,0.98));
  border: 2px solid var(--se-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .18s ease;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.se-action::after {
  /* shimmer top */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,200,87,0.45), transparent);
}
.se-action:hover:not(:disabled):not(.is-disabled) {
  transform: translateY(-3px);
  border-color: var(--se-gold);
  box-shadow: 0 8px 20px rgba(0,0,0,0.65), 0 0 22px rgba(255,200,87,0.30);
}
.se-action:active:not(:disabled):not(.is-disabled) { transform: translateY(-1px); }
.se-action.is-disabled, .se-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.se-action > i {
  font-size: 26px;
  color: var(--se-gold);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.85));
}
.se-action-basic { border-color: rgba(255,122,138,0.45); }
.se-action-basic > i { color: #ff8898; }
.se-action.is-ult {
  border-color: rgba(184,132,255,0.55);
  background: linear-gradient(180deg, rgba(40,18,52,0.92), rgba(20,8,28,0.98));
}
.se-action.is-ult > i { color: #d6b6ff; }
.se-action-name {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.se-action-meta {
  font-size: 10.5px;
  color: rgba(255,255,255,0.78);
  display: inline-flex; align-items: center; gap: 3px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.02em;
}
.se-action-meta i { font-size: 11px; }
.se-action-meta .ph-flask, .se-action-meta i.ph-fill.ph-flask { color: #4cc4ff; }
.se-action-meta .ph-clock-countdown, .se-action-meta i.ph-fill.ph-clock-countdown { color: #ffaa50; }

/* ============== COMBAT LOG (overlay esquina derecha) ============== */
.se-combat-log-panel {
  position: absolute;
  top: 60px; right: 12px;
  z-index: 4;
  width: clamp(180px, 22vw, 260px);
  max-height: 280px;
  background: rgba(8,4,8,0.78);
  border: 1px solid var(--se-border);
  border-radius: 11px;
  backdrop-filter: blur(8px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.se-combat-log-head {
  padding: 7px 12px;
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--se-gold);
  border-bottom: 1px solid var(--se-border);
  background: rgba(0,0,0,0.45);
}
.se-combat-log-body {
  flex: 1;
  padding: 8px 12px 10px;
  overflow-y: auto;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.35) transparent;
}
.se-combat-log-body::-webkit-scrollbar { width: 4px; }
.se-combat-log-body::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.35); border-radius: 2px; }

.se-combat-log {
  position: relative;
  z-index: 2;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--se-border);
  border-radius: 11px;
  padding: 8px 12px;
  max-height: 130px;
  overflow-y: auto;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.se-log-line { color: rgba(243,232,213,0.75); }
.se-log-line.is-player { color: #6cd4ff; }
.se-log-line.is-crit { color: #ffaa50; font-weight: 700; }
.se-log-line.is-enemy { color: #ff8898; }
.se-log-line.is-system { color: var(--se-gold); font-style: italic; }
.se-log-line.is-skill { color: #d6b6ff; }
.se-log-line.is-skill-crit { color: #ffd24a; font-weight: 700; }
.se-log-line.is-heal { color: #5fd684; }
.se-log-line b { color: #fff; }

/* Combat end (win/defeat) */
.se-combat-end {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 22px;
  text-align: center;
}
.se-combat-end-icon {
  font-size: 80px;
  color: var(--se-gold);
  filter: drop-shadow(0 0 20px rgba(255,200,87,0.50));
  animation: seWinIcon 1.6s ease-in-out infinite;
}
.se-combat-end-icon.is-defeat {
  color: var(--se-crimson-soft);
  filter: drop-shadow(0 0 20px rgba(255,92,124,0.45));
}
@keyframes seWinIcon {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
.se-combat-end-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(26px, 6vw, 40px);
  background: linear-gradient(180deg, #ffeac0, #d4a020);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin: 0;
}
.se-combat-end-title.is-defeat {
  background: linear-gradient(180deg, #ff8898, #b41e2e);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.se-combat-end-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(15px, 2.4vw, 18px);
  color: rgba(243,232,213,0.86);
  max-width: 540px;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}

/* ============================================================
   REWARD — pantalla de loot (NPC giver + items animados)
   ============================================================ */
.se-screen-reward {
  background-size: cover;
  background-position: center;
  align-items: center;
  justify-content: center;
}
.se-reward-stage {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 32px;
  max-width: 920px;
  width: calc(100% - 40px);
  align-items: center;
  padding: 32px 24px;
  animation: seRewardStageIn 0.6s cubic-bezier(.2,.85,.3,1);
}
@keyframes seRewardStageIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Giver (NPC que entrega) */
.se-reward-giver {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: seDlgPortraitIn 0.7s cubic-bezier(.2,.85,.3,1);
}
.se-reward-giver-img {
  width: 220px;
  height: 280px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--se-gold);
  border-radius: 12px;
  background: rgba(0,0,0,0.55);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.7),
    0 0 28px rgba(255,200,87,0.30);
}
.se-reward-giver-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--se-gold);
  letter-spacing: 0.06em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

/* Panel principal con items */
.se-reward-panel {
  background: linear-gradient(180deg, rgba(14,8,10,0.92), rgba(8,4,6,0.96));
  border: 1px solid var(--se-gold);
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 28px rgba(255,200,87,0.18);
}
.se-reward-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.20em;
  color: var(--se-gold);
  background: rgba(255,200,87,0.14);
  border: 1px solid rgba(255,200,87,0.45);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.se-reward-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  background: linear-gradient(180deg, #ffeac0, #ffd24a, #b8860b);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin: 0 0 12px;
  text-shadow: 0 0 18px rgba(255,200,87,0.30);
}
.se-reward-intro {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 15.5px;
  color: rgba(243,232,213,0.86);
  line-height: 1.5;
  margin: 0 0 18px;
}
.se-reward-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.se-reward-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(40,24,12,0.85), rgba(20,12,6,0.96));
  border: 1px solid rgba(212,175,55,0.40);
  border-radius: 11px;
  opacity: 0;
  animation: seRewardItemIn 0.5s cubic-bezier(.2,.85,.3,1) forwards;
}
@keyframes seRewardItemIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.se-reward-item.is-gold {
  border-color: var(--se-gold);
  box-shadow: 0 0 18px rgba(255,200,87,0.25);
}
.se-reward-item-ic {
  width: 46px; height: 46px;
  border-radius: 11px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(212,175,55,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--se-gold);
  flex-shrink: 0;
}
.se-reward-item.is-gold .se-reward-item-ic { color: #ffd24a; }
.se-reward-item-name {
  font-family: 'Cinzel', serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.se-reward-item-qty {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--se-gold);
  font-weight: 700;
  margin-top: 2px;
}
.se-reward-claim {
  width: 100%;
  justify-content: center;
  animation: seBtnPulse 2.4s ease-in-out infinite;
}

@media (max-width: 720px) {
  .se-reward-stage { grid-template-columns: 1fr; gap: 18px; }
  .se-reward-giver { flex-direction: row; align-items: center; gap: 12px; }
  .se-reward-giver-img { width: 90px; height: 110px; }
  .se-reward-panel { padding: 18px 18px; }
}

/* ============================================================
   CHAPTER END
   ============================================================ */
.se-screen-end {
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, rgba(255,200,87,0.15), transparent 70%),
    linear-gradient(180deg, #160810 0%, #0a0408 100%);
  align-items: center; justify-content: center;
  padding: 60px 22px;
}
.se-end-inner {
  max-width: 640px;
  text-align: center;
}
.se-end-icon {
  font-size: 64px;
  color: var(--se-gold);
  filter: drop-shadow(0 0 18px rgba(255,200,87,0.45));
  margin-bottom: 12px;
}
.se-end-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.30em;
  color: var(--se-crimson-soft);
  margin-bottom: 8px;
}
.se-end-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(24px, 5vw, 36px);
  background: linear-gradient(180deg, #ffeac0, #d4a020);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin: 0 0 16px;
}
.se-end-summary {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(243,232,213,0.86);
  margin: 0 0 18px;
}
.se-end-teaser {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(180,30,50,0.15);
  border: 1px solid rgba(180,30,50,0.45);
  color: var(--se-crimson-soft);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.10em;
  margin-bottom: 20px;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 720px) {
  .se-screen-select { padding: 50px 16px 20px; }
  .se-chapter-card { padding: 14px; }
  .se-dialogue-box, .se-narration-box, .se-choice-box { padding: 18px 16px 22px; }
  .se-npc-portrait { width: 52px; height: 52px; }
  .se-npc-name { font-size: 17px; }
  .se-screen-combat { padding: 56px 12px 12px; gap: 8px; }
  .se-enemy { width: clamp(100px, 30vw, 140px); padding: 8px; }
  .se-enemy-name { font-size: 11px; }
  .se-player-info { min-width: 0; max-width: 100%; }
  .se-combat-log { max-height: 100px; font-size: 11.5px; }
}
