/* Event prototype, scoped to preserve battle, shop and event result screens. */
body.event-mode{background:#030a0d;overflow:hidden}
body.event-mode #app{display:block;width:min(100%,440px);max-width:440px;height:100vh;height:100dvh;min-height:0;margin:0 auto;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);overflow:hidden;overflow:clip;background:none;isolation:isolate}
body.event-mode #app::before,body.event-mode #app::after{display:none}
.ev-stage{--ink:var(--ui-ink);color:var(--bone);line-height:normal;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;padding:0;border:0;min-height:0}
.ev-stage,.ev-stage *,.ev-stage *::before,.ev-stage *::after{box-sizing:border-box}
.ev-stage *{font-family:var(--serif)!important}
.ev-stage button{appearance:none;margin:0;border-radius:0;min-width:0;min-height:0;letter-spacing:normal;text-shadow:none;line-height:normal;touch-action:manipulation;color:inherit}
/* ===== stratum themes (shared with route screen) ===== */
.ev-stage[data-s="1"]{--glow:rgba(168,228,124,.55);--pane:linear-gradient(170deg,rgba(18,34,16,.9),rgba(8,20,10,.92));--rim:rgba(168,228,124,.5);--txt:#e4ecd8;--tint:linear-gradient(180deg,rgba(6,18,8,.78),rgba(6,18,8,.35) 30%,rgba(6,18,8,.75) 60%,rgba(4,12,6,.96))}
.ev-stage[data-s="2"]{--glow:rgba(121,232,255,.55);--pane:linear-gradient(170deg,rgba(6,34,52,.86),rgba(3,18,32,.92));--rim:rgba(160,230,255,.55);--txt:#e2f3f8;--tint:linear-gradient(180deg,rgba(2,16,28,.78),rgba(2,20,34,.3) 30%,rgba(2,16,28,.72) 60%,rgba(2,10,18,.96))}
.ev-stage[data-s="3"]{--glow:rgba(190,230,255,.6);--pane:linear-gradient(170deg,rgba(210,230,255,.16),rgba(20,28,60,.72));--rim:rgba(230,245,255,.7);--txt:#eef4fb;--tint:linear-gradient(180deg,rgba(8,12,30,.78),rgba(8,12,30,.3) 30%,rgba(8,12,30,.7) 60%,rgba(4,6,18,.96))}
.ev-stage[data-s="4"]{--glow:rgba(255,160,190,.55);--pane:linear-gradient(170deg,rgba(58,16,34,.86),rgba(28,6,18,.92));--rim:rgba(255,190,210,.55);--txt:#f7e8ee;--tint:linear-gradient(180deg,rgba(30,6,18,.74),rgba(30,6,18,.25) 30%,rgba(30,6,18,.7) 60%,rgba(16,4,10,.96))}

.ev-stage{position:relative;width:min(100%,440px);height:100%;margin:0 auto;overflow:hidden;overflow:clip;isolation:isolate;display:flex;flex-direction:column}
.ev-bg{position:absolute;inset:0;z-index:-3;background:#000 var(--bgimg) 50% 30%/cover}
.ev-bg::after{content:"";position:absolute;inset:0;background:var(--tint)}
/* run bar */
.ev-runbar{position:relative;z-index:2;display:flex;align-items:center;gap:10px;padding:8px 12px 4px;font-size:12px;color:#c9d3d4;flex:none;text-shadow:0 1px 3px rgba(0,0,0,.7)}
.ev-runbar .ev-fl b{font-family:var(--num)!important;font-style:italic;font-weight:800;font-size:20px;color:#fff}.ev-runbar .ev-fl{white-space:nowrap}
.ev-runbar .ev-hp{flex:1;display:flex;flex-direction:column;gap:3px;min-width:0}
.ev-runbar .ev-hp span{display:flex;justify-content:space-between;font-size:11px}
.ev-runbar .ev-hp span b{font-family:var(--num)!important;font-style:italic;font-weight:800;font-size:15px;color:#fff}
.ev-runbar .ev-hp i{display:block;height:4px;background:rgba(0,0,0,.5);transform:skewX(-30deg);position:relative;overflow:hidden}
.ev-runbar .ev-hp i::after{content:"";position:absolute;inset:0 18% 0 0;background:linear-gradient(90deg,#3fb3c9,#b5f3ff)}
.ev-gold{white-space:nowrap}.ev-gold b{font-family:var(--num)!important;font-style:italic;font-weight:800;font-size:22px;color:var(--gold)}.ev-gold small{font-family:var(--num)!important;font-style:italic;color:var(--gold)}

/* heading */
.ev-head{flex:none;padding:8px 16px 0;position:relative}
.ev-eyebrow{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:800;letter-spacing:.16em;color:var(--ac)}
.ev-eyebrow svg{width:18px;height:18px;color:var(--ac);filter:drop-shadow(0 0 6px var(--glow))}
.ev-eyebrow b{font-family:var(--num)!important;font-style:italic;font-weight:800;letter-spacing:.24em}
.ev-chain{display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:3px 12px 3px 8px;font-size:11px;font-weight:800;letter-spacing:.08em;color:var(--ink);background:var(--ac2);clip-path:polygon(0 0,calc(100% - 8px) 0,100% 50%,calc(100% - 8px) 100%,0 100%)}
.ev-chain i{display:flex;gap:3px}.ev-chain i b{width:7px;height:7px;transform:rotate(45deg);border:1px solid var(--ink)}.ev-chain i b.ev-on{background:var(--ink)}
.ev-head h1{margin:6px 0 0;font-size:24px;font-weight:800;letter-spacing:.06em;line-height:1.3;color:#fff;text-shadow:0 2px 12px rgba(0,0,0,.8)}

/* story pane */
.ev-scene{flex:1 1 auto;min-height:12px}
.ev-story{position:relative;flex:none;max-height:40vh;margin:0 14px 0;padding:12px 16px 12px 18px;background:var(--pane);overflow:hidden;
  box-shadow:inset 0 0 0 1px var(--rim),inset 0 0 0 4px rgba(0,0,0,.25),0 10px 20px rgba(0,0,0,.45);clip-path:polygon(0 0,calc(100% - 14px) 0,100% 14px,100% 100%,14px 100%,0 calc(100% - 14px))}
.ev-stage[data-s="3"] .ev-story{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.ev-story::before{content:"";position:absolute;left:8px;top:12px;bottom:12px;width:2px;background:linear-gradient(var(--ac),transparent)}
.ev-story p{margin:0;font-size:13.5px;line-height:1.9;color:var(--txt);white-space:pre-line}
.ev-story p::first-letter{font-size:1.5em;font-weight:800;color:var(--ac)}
.ev-story .ev-orn{position:absolute;right:6px;bottom:6px;width:54px;height:54px;color:var(--ac);opacity:.35;pointer-events:none}
.ev-story .ev-orn2{position:absolute;right:6px;top:6px;width:26px;height:26px;color:var(--ac);opacity:.7;pointer-events:none}
.ev-stage.ev-in .ev-story{animation:ev-rise2 .5s cubic-bezier(.2,.9,.3,1) both}
@keyframes ev-rise2{from{opacity:0;transform:translateY(10px)}}

/* choices */
.ev-choices{flex:none;display:flex;flex-direction:column;gap:7px;margin:10px 14px 0}
.ev-ch{position:relative;display:flex;align-items:center;gap:10px;border:0;padding:8px 12px 8px 8px;cursor:pointer;text-align:left;background:rgba(4,10,14,.78);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12),inset 3px 0 0 var(--ac);clip-path:polygon(0 0,calc(100% - 12px) 0,100% 50%,calc(100% - 12px) 100%,0 100%);transition:transform .2s,filter .2s,background .2s}
.ev-stage.ev-in .ev-ch{animation:ev-rise2 .45s cubic-bezier(.2,.9,.3,1) both}
.ev-stage.ev-in .ev-ch:nth-child(2){animation-delay:.06s}.ev-stage.ev-in .ev-ch:nth-child(3){animation-delay:.12s}.ev-stage.ev-in .ev-ch:nth-child(4){animation-delay:.18s}
.ev-ch .ev-md{position:relative;flex:none;width:34px;height:34px;display:grid;place-items:center;color:#fff}
.ev-ch .ev-md::before{content:"";position:absolute;inset:0;background:color-mix(in srgb,var(--mc) 55%,#0a1014);box-shadow:0 0 0 1px var(--mc),0 0 10px color-mix(in srgb,var(--mc) 50%,transparent)}
.ev-stage[data-s="1"] .ev-ch .ev-md::before{border-radius:50%;box-shadow:0 0 0 1.5px #2a2112,0 0 0 3px var(--mc)}
.ev-stage[data-s="2"] .ev-ch .ev-md::before{border-radius:50%;background:radial-gradient(circle at 32% 28%,rgba(255,255,255,.6),color-mix(in srgb,var(--mc) 40%,transparent) 35%,rgba(4,30,50,.8) 75%);box-shadow:0 0 0 1px var(--mc)}
.ev-stage[data-s="3"] .ev-ch .ev-md::before{clip-path:polygon(25% 3%,75% 3%,100% 50%,75% 97%,25% 97%,0 50%)}
.ev-stage[data-s="4"] .ev-ch .ev-md::before{border-radius:50% 50% 50% 50% / 60% 60% 40% 40%;transform:rotate(45deg) scale(.86);border-radius:0 50% 50% 50%}
.ev-ch .ev-md svg{position:relative;width:17px;height:17px}
.ev-ch .ev-tx{flex:1;min-width:0}
.ev-ch .ev-tx b{display:block;font-size:14.5px;font-weight:800;letter-spacing:.04em;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ev-chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.ev-chip{display:inline-flex;align-items:center;gap:3px;padding:1px 7px;font-size:10.5px;font-weight:800;line-height:1.5;color:var(--cc);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--cc) 60%,transparent);background:color-mix(in srgb,var(--cc) 12%,transparent)}
.ev-chip b{font-family:var(--num)!important;font-weight:700;font-size:12px}
.ev-ch.ev-sel{background:color-mix(in srgb,var(--ac) 16%,rgba(4,10,14,.85));box-shadow:inset 0 0 0 1.5px var(--ac),inset 3px 0 0 var(--ac),0 0 16px var(--glow);transform:translateX(4px)}
.ev-choices.ev-has .ev-ch:not(.ev-sel){filter:brightness(.6) saturate(.7)}
.ev-ch:disabled{filter:grayscale(1) brightness(.5);cursor:default}
.ev-ch .ev-lock{flex:none;font-size:10px;color:#aab}

/* detail + go */
.ev-detail{flex:none;margin:9px 14px 0;min-height:34px;padding:6px 12px;font-size:11.5px;line-height:1.5;color:#d3dbdd;background:rgba(0,0,0,.4);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);transition:opacity .2s}
.ev-detail.ev-empty{opacity:.55}
.ev-foot{flex:none;display:flex;padding:10px 14px 14px}
.ev-go{position:relative;flex:1;height:56px;border:0;padding:0;background:none;cursor:pointer;color:var(--ink)}
.ev-go .ev-sh{position:absolute;inset:6px -2px -6px 8px;background:var(--coral);clip-path:polygon(18px 0,100% 0,calc(100% - 18px) 100%,0 100%)}
.ev-go .ev-face{position:absolute;inset:0 6px 6px 0;display:flex;align-items:center;justify-content:center;gap:10px;background:var(--bone);overflow:hidden;clip-path:polygon(18px 0,100% 0,calc(100% - 18px) 100%,0 100%);transition:transform .12s}
.ev-go .ev-t{font-weight:800;font-size:16px;letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:80%}
.ev-go .ev-chev{display:flex}.ev-go .ev-chev i{width:7px;height:7px;border-top:2.5px solid var(--coral);border-right:2.5px solid var(--coral);transform:rotate(45deg);margin-left:-1px;animation:ev-chev 1.1s infinite}
.ev-go .ev-chev i:nth-child(2){animation-delay:.15s}.ev-go .ev-chev i:nth-child(3){animation-delay:.3s}
@keyframes ev-chev{0%,100%{opacity:.3}50%{opacity:1}}
.ev-go:disabled{cursor:default}.ev-go:disabled .ev-face{background:rgba(207,199,180,.5)}.ev-go:disabled .ev-sh{background:rgba(90,106,112,.6)}.ev-go:disabled .ev-chev{display:none}
.ev-go:not(:disabled) .ev-face::after{content:"";position:absolute;top:0;bottom:0;width:30%;left:-40%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent);transform:skewX(-20deg);animation:ev-sheen 2.2s ease-in-out infinite}
@keyframes ev-sheen{0%{left:-40%}60%,100%{left:130%}}
.ev-go:active:not(:disabled) .ev-face{transform:translate(5px,5px)}

.ev-pop{position:absolute;z-index:40;left:50%;top:40%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:6px;pointer-events:none;animation:ev-pop 1.6s ease-out forwards}
.ev-pop b{font-family:var(--num)!important;font-style:italic;font-weight:800;font-size:40px;text-shadow:3px 3px 0 rgba(0,0,0,.6)}
.ev-pop small{font-size:13px;font-weight:800;padding:3px 12px;color:var(--ink);background:var(--ac)}
@keyframes ev-pop{0%{opacity:0;transform:translate(-50%,-30%) scale(1.4)}15%{opacity:1;transform:translate(-50%,-50%) scale(1)}75%{opacity:1}100%{opacity:0;transform:translate(-50%,-70%)}}



.ev-stage button:focus-visible{outline:2px solid #fff;outline-offset:2px}
@media (max-height:720px){.ev-head h1{font-size:20px}.ev-story p{font-size:12.5px;line-height:1.7}.ev-ch{padding:6px 10px 6px 6px}.ev-ch .ev-md{width:30px;height:30px}.ev-ch .ev-tx b{font-size:13.5px}.ev-choices{gap:5px;margin-top:8px}.ev-detail{margin-top:6px;min-height:0}.ev-foot{padding:8px 14px 10px}}
@media (prefers-reduced-motion:reduce){.ev-stage *{animation:none!important;transition:none!important}}

.ev-runbar .ev-hp i::after{inset:0;right:calc(100% - var(--event-hp,100%))}
/* Only the text area can scroll when an unusually long story must fit a small screen. */
.ev-story{flex:0 1 auto;min-height:76px;display:flex;flex-direction:column}
.ev-story p{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--ac) transparent;position:relative;z-index:1;touch-action:pan-y}
.ev-pop{width:90%;text-align:center}
.ev-pop>b{font-size:clamp(22px,7vw,40px)}
.ev-pop small{max-width:100%}
.ev-stage button:focus-visible{outline:2px solid var(--ac);outline-offset:-3px}
.ev-stage button:disabled{opacity:1}
.ev-stage .ev-go{color:var(--ink)}
.ev-stage .ev-go:disabled{color:var(--ink);filter:none}
/* Give the story the former scenery gap and the retired fourth-choice space. */
.ev-scene{flex:none;height:clamp(16px,3vh,28px);min-height:16px}
.ev-story{flex:1 1 auto;max-height:none;padding:16px 18px 16px 20px}
.ev-story p{font-size:16px;line-height:1.9}
.ev-story p span{font:inherit!important}
@media(max-height:720px){.ev-scene{height:14px;min-height:14px}.ev-story{padding:12px 16px 12px 18px}.ev-story p{font-size:15px;line-height:1.8}}
