/* Adventure (real-time, one hero) and Explore (turn-based hero team). Full-screen, glossy, pseudo-3D. */
body.adv-full, body.exp-full { overflow: hidden; }
body.adv-full .demo-flag, body.exp-full .demo-flag { display: none; }
body.adv-full .dock, body.adv-full .rankbar, body.adv-full .topbar, body.exp-full .dock, body.exp-full .rankbar, body.exp-full .topbar { display: none; }
body.adv-full .layout, body.exp-full .layout { padding: 0; } body.adv-full main, body.exp-full main { padding: 0; max-width: none; margin: 0; }
.adv { position: fixed; inset: 0; z-index: 60; background: #4fbf4a; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.adv-cv { width: 100%; height: 100%; display: block; }
.adv-top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: max(.5rem, env(safe-area-inset-top)) .7rem .6rem; background: linear-gradient(rgba(8,16,60,.85), rgba(8,16,60,0)); }
.adv-wave { flex: 1; color: #fff; text-shadow: 0 2px 0 #0a1236; max-width: 260px; } .adv-wave b { font-family: var(--serif); } .adv-wave .bar { margin-top: 3px; } .adv-wave .bar i { background: linear-gradient(90deg, #35e0ff, #3d8bff); }
.adv-ctl { display: flex; gap: .5rem; }
.adv-b { min-width: 48px; height: 48px; border-radius: 14px; border: 3px solid #0a1236; background: linear-gradient(#5b8eff, #1e46b8); color: #fff; font-weight: 800; font-size: 1.1rem; cursor: pointer; box-shadow: 0 0 0 2px #ffd34d, 0 4px 0 rgba(0,0,0,.5); } .adv-b.on { background: linear-gradient(#ffd34d, #e0861a); color: #2a1200; } .adv-b:active { transform: translateY(3px); }
.adv-hp { position: absolute; left: 50%; transform: translateX(-50%); width: min(260px, 70vw); bottom: calc(112px + env(safe-area-inset-bottom)); text-align: center; color: #fff; text-shadow: 0 2px 0 #0a1236; } .adv-hp small { font-weight: 800; font-size: .72rem; }
.adv-skills { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 1.4rem; }
.adv-skill { position: relative; width: 84px; height: 84px; border-radius: 50%; cursor: pointer; overflow: hidden; border: 4px solid #0a1236; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 70%); color: #fff; box-shadow: 0 0 0 3px #ffd34d, 0 6px 0 rgba(0,0,0,.5); font-family: var(--serif); }
.adv-skill span { display: block; font-size: 2.1rem; font-weight: 800; line-height: 1; text-shadow: 0 2px 0 rgba(0,0,0,.5); } .adv-skill small { font-family: var(--sans); font-weight: 800; font-size: .68rem; }
.adv-skill .cdm { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.6); } .adv-skill:disabled { filter: grayscale(.5); } .adv-skill:active:not(:disabled) { transform: translateY(4px); }
.adv-paused { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6,10,40,.7); text-align: center; color: #fff; } .adv-paused h2 { font-size: 2.4rem; text-shadow: 0 3px 0 #0a1236; }
@media (orientation: landscape) and (max-height: 520px) { .adv-hp { bottom: 10px; left: 14px; transform: none; text-align: left; } .adv-skills { left: auto; right: 14px; flex-direction: column; gap: .6rem; bottom: 14px; } .adv-skill { width: 66px; height: 66px; } .adv-skill span { font-size: 1.6rem; } .adv-hp { top: 56px; } }

/* ---- Explore: heroes at the bottom, enemies at the top, on a tilted battlefield ---- */
.exp { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: linear-gradient(#7ad7ff 0%, #bfe9ff 18%, #5fc65a 19%); overflow: hidden; user-select: none; -webkit-user-select: none; }
.exp-sky { position: absolute; left: 0; right: 0; top: 0; height: 22%; background: linear-gradient(#58b6ff, #cdeeff); } .exp-sky::after { content: ""; position: absolute; left: 50%; top: 18%; width: 90px; height: 90px; border-radius: 50%; transform: translateX(-50%); background: radial-gradient(circle at 35% 30%, #ffd9a0, #ff8a3d); box-shadow: 0 0 40px rgba(255,170,80,.9); }
.exp-ground { position: absolute; left: -20%; right: -20%; top: 14%; bottom: -10%; transform-origin: 50% 0; transform: perspective(700px) rotateX(52deg); background: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 3px, transparent 3px 60px), repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 3px, transparent 3px 60px), radial-gradient(ellipse at 50% 50%, #8fe06a, #3fa84a 80%); border-top: 6px solid #2a8a3a; }
.exp-top { position: relative; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: max(.5rem, env(safe-area-inset-top)) .7rem .3rem; color: #fff; text-shadow: 0 2px 0 #0a1236; }
.exp-turn { font-family: var(--serif); font-weight: 800; background: rgba(8,16,60,.8); border: 2px solid #ffd34d; border-radius: 99px; padding: .15rem .9rem; }
.exp-retreat { position: absolute; z-index: 6; right: 10px; top: 45%; }
.exp-field { position: relative; z-index: 3; flex: 1; min-height: 0; }
.slot3 { position: absolute; width: 0; height: 0; }
.slot3 .ring { position: absolute; left: 0; top: 0; width: var(--w); height: calc(var(--w) * .38); transform: translate(-50%, -22%); border-radius: 50%; border: 4px dashed rgba(255,255,255,.55); background: rgba(255,255,255,.12); }
.slot3.sel .ring { border: 4px solid #ffd34d; background: rgba(255,211,77,.3); box-shadow: 0 0 24px #ffd34d; animation: breathe 1.4s ease-in-out infinite; }
.slot3.tgt .ring { border: 4px solid #ff3b3b; background: rgba(255,59,59,.28); box-shadow: 0 0 24px #ff3b3b; animation: breathe .9s ease-in-out infinite; cursor: pointer; }
.fig3 { position: absolute; left: 0; bottom: 0; width: var(--w); transform: translate(-50%, 20%); text-align: center; cursor: pointer; }
.fig3 .sp svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 6px rgba(0,0,0,.45)); animation: idle 2.6s ease-in-out infinite; }
.fig3 .sp img { width: 100%; height: calc(var(--w) * 1.4); object-fit: contain; display: block; filter: drop-shadow(0 12px 6px rgba(0,0,0,.45)); animation: idle 2.6s ease-in-out infinite; }
.fig3.dead { opacity: .25; filter: grayscale(1); pointer-events: none; }
.fig3 .lv { position: absolute; left: 4%; top: -4%; width: 30px; height: 30px; border-radius: 50%; background: #ffd34d; color: #2a1200; font-weight: 800; display: grid; place-items: center; border: 3px solid #0a1236; font-size: .85rem; z-index: 2; }
.fig3 .nm { font-size: .7rem; font-weight: 800; color: #fff; text-shadow: 0 1px 0 #0a1236, 0 0 4px #0a1236; margin-top: -2px; white-space: nowrap; }
.fig3 .hp { height: 9px; width: 80%; margin: 2px auto 0; border: 2px solid #0a1236; border-radius: 6px; background: rgba(0,0,0,.55); overflow: hidden; } .fig3 .hp i { display: block; height: 100%; background: linear-gradient(#6fe36f, #2f9a3a); transition: width .4s; } .fig3.foe .hp i { background: linear-gradient(#ff7a55, #c8321b); }
.exp-skills { position: relative; z-index: 5; display: flex; justify-content: center; gap: .7rem; padding: .3rem .6rem; min-height: 86px; }
.exp-skill { position: relative; min-width: 84px; max-width: 120px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: .35rem; cursor: pointer; color: #fff; font-weight: 800; border: 4px solid #0a1236; border-radius: 16px 22px 16px 20px; background: linear-gradient(#ff6a47, #c8321b); box-shadow: 0 0 0 2px #ffd34d, 0 5px 0 rgba(0,0,0,.5); text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.exp-skill.alt { background: linear-gradient(#4b78bf, #1d3466); } .exp-skill.heal { background: linear-gradient(#4fd37a, #1e8a45); } .exp-skill .g { font-family: var(--serif); font-size: 1.7rem; line-height: 1; } .exp-skill b { font-size: .75rem; text-align: center; line-height: 1.1; } .exp-skill small { font-size: .62rem; opacity: .9; }
.exp-skill:disabled { filter: grayscale(.8) brightness(.7); } .exp-skill:active:not(:disabled) { transform: translateY(4px); }
.exp-cards { position: relative; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .4rem .6rem calc(.6rem + env(safe-area-inset-bottom)); background: linear-gradient(rgba(8,16,60,0), rgba(8,16,60,.9) 30%); }
.hcard { position: relative; display: flex; align-items: center; gap: .4rem; padding: .3rem; cursor: pointer; color: #fff; border: 3px solid #0a1236; border-radius: 14px 18px 14px 16px; background: linear-gradient(#3b66cc, #17327f); box-shadow: 0 0 0 2px #6fa0ff, 0 4px 0 rgba(0,0,0,.5); text-align: left; font: inherit; }
.hcard.sel { box-shadow: 0 0 0 3px #ffd34d, 0 0 18px #ffd34d, 0 4px 0 rgba(0,0,0,.5); transform: translateY(-6px); } .hcard.done { filter: grayscale(.6) brightness(.8); } .hcard.dead { filter: grayscale(1) brightness(.5); pointer-events: none; }
.hcard .pt { width: 48px; height: 48px; border-radius: 10px; border: 2px solid #0a1236; background: linear-gradient(#3a64c8, #1a3586); display: grid; place-items: center; font-family: var(--serif); font-size: 1.4rem; font-weight: 800; overflow: hidden; flex: 0 0 auto; } .hcard .pt img { width: 100%; height: 100%; object-fit: cover; }
.hcard b { display: block; font-size: .7rem; line-height: 1.1; } .hcard .hp { height: 7px; margin-top: 3px; border: 2px solid #0a1236; border-radius: 5px; background: rgba(0,0,0,.5); overflow: hidden; width: 100%; } .hcard .hp i { display: block; height: 100%; background: linear-gradient(#6fe36f, #2f9a3a); }
.hcard .ok { position: absolute; right: -6px; top: -8px; width: 24px; height: 24px; border-radius: 50%; background: #35c46a; color: #fff; display: grid; place-items: center; font-size: .9rem; border: 2px solid #0a1236; }
.exp-hint { position: absolute; z-index: 6; left: 0; right: 0; top: 38%; text-align: center; font-family: var(--serif); font-weight: 800; font-size: 1.1rem; color: #fff; text-shadow: 0 2px 0 #0a1236; pointer-events: none; }
@media (orientation: landscape) and (max-height: 520px) { .exp-skills { min-height: 64px; } .exp-skill { min-width: 70px; padding: .15rem; } .exp-skill small { display: none; } .hcard .pt { width: 36px; height: 36px; } .exp-cards { padding-bottom: .3rem; } }

/* painted hero figures (cut out of the art pipeline sprite sheet) */
.fig3 .sp img.cut { width: 70%; height: auto; margin: 0 auto; filter: drop-shadow(0 14px 8px rgba(0,0,0,.5)); }
.herostage .fig { height: auto; max-height: 100%; width: auto; max-width: 90%; }

.exp-pick { position: relative; z-index: 3; max-width: 900px; margin: 0 auto; padding: 1rem 16px 2rem; }
body.exp-full .exp-pick { padding-top: max(1rem, env(safe-area-inset-top)); }

.fig3 .lv:empty { display: none; }

/* hero figure idle: breathing and sway (anchored at the feet) */
.hero-idle { transform-origin: 50% 100%; animation: heroBreath 3.4s ease-in-out infinite; }
@keyframes heroBreath { 0%, 100% { transform: translateY(0) scale(1, 1) rotate(0deg); } 30% { transform: translateY(-3px) scale(1.012, 1.03) rotate(.7deg); } 65% { transform: translateY(-1px) scale(1.004, 1.012) rotate(-.7deg); } }
.fig3 .sp img.cut, .fig3 .sp svg { animation: none; }

.hero-idle { animation: heroBreath 3.4s ease-in-out infinite !important; }

/* painted pose frames are uncropped squares (all poses share one scale), so size them up a little */
.fig3 .sp img.cut.framed { width: 96%; max-width: none; margin-left: 2%; height: auto; }
.herostage .fig.framed { max-height: 118%; max-width: none; }
