/* Face-Off card (battle-prep-view.js): the picture beside the math before a guardian or boss battle.
   Guardians stand in the spot's painted battle place; the player's Wonderkin stands on the warm side.
   Sizes follow the card's own height, so it fits tall laptops, short sideways phones and small upright phones. */
.face-column{display:flex;flex-direction:column;min-width:0}
.face-column .scene-caption{flex:none}
.face-off{--bar:42px;position:relative;flex:1 1 auto;min-height:300px;overflow:hidden;isolation:isolate;border:1px solid #bfae86;border-radius:18px;background:#2b4a57;font-family:'DM Sans',system-ui,sans-serif}
.face-bg{position:absolute;inset:0;z-index:-2}
.face-bg svg{width:100%;height:100%;display:block}
.face-off:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(200deg,#1c3f5199,#24475a59 60%,#1c3f5133)}
.face-mine{position:absolute;inset:0;z-index:0;overflow:hidden;background:linear-gradient(150deg,#fff6d8,#ffe29a 55%,#f9bf63);clip-path:polygon(0 47%,100% 34%,100% 100%,0 100%)}
.face-mine i{position:absolute;width:200%;aspect-ratio:1;left:-60%;top:10%;background:repeating-conic-gradient(from 0deg,#ffffff7a 0 9deg,#fff0 9deg 18deg);-webkit-mask:radial-gradient(circle,#000 0,#0000 62%);mask:radial-gradient(circle,#000 0,#0000 62%)}
.face-off:after{content:"";position:absolute;inset:0;z-index:1;background:#fffdf0;clip-path:polygon(0 47%,100% 34%,100% 35.2%,0 48.2%)}
.face-foes{position:absolute;z-index:2;top:4.5%;right:10px;height:34%;aspect-ratio:30/17}
.face-foe{position:absolute;aspect-ratio:1;filter:drop-shadow(0 5px 5px #0b202059)}
.face-foe>*,.face-hero>*{display:block;width:100%;height:100%}
.foes-3 .f0{height:92%;right:18%;top:0}.foes-3 .f1{height:56%;right:62%;top:36%;z-index:1}.foes-3 .f2{height:56%;right:-2%;top:41%;z-index:1}
.foes-2 .f0{height:78%;right:36%;top:8%}.foes-2 .f1{height:78%;right:-3%;top:16%;z-index:1}
.foes-1 .f0{height:96%;right:20%;top:0}
.face-hero{position:absolute;z-index:3;left:0;bottom:38px;height:47%;aspect-ratio:1;filter:drop-shadow(0 6px 5px #7a4b1359)}
.face-hero>*{animation:bob 3.3s ease-in-out infinite}
.face-plate{position:absolute;z-index:4;line-height:1.15;min-width:0}
.face-plate small{display:block;font-size:9.5px;font-weight:700;letter-spacing:1.5px;margin-bottom:3px}
.face-plate strong{display:block;font:600 21px/1.1 Outfit,system-ui,sans-serif;overflow-wrap:anywhere}
.face-plate strong i{font-style:normal;font-weight:400;opacity:.8}
.face-plate em{font-style:normal;font-size:13px}
.face-chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;align-items:center}
.face-off .type-chip,.face-level{font:700 11px/1 'DM Sans',system-ui,sans-serif;letter-spacing:.3px;text-transform:none;border:0;border-radius:999px;padding:5px 9px}
.face-off .type-chip{background:color-mix(in srgb,var(--type) 88%,#1a1a1a);color:#fff;text-shadow:0 1px 0 #0003}
.face-level{background:#3d2a08;color:#ffe9a8}
.face-plate.them{left:18px;top:18px;max-width:152px;color:#dbe9ee;text-shadow:0 1px 3px #0b2020b3}
.face-plate.them strong{color:#fff}
.boss .face-plate.them{max-width:164px}.boss .face-plate.them strong{font-size:17px;line-height:1.15}
.face-plate.me{right:18px;bottom:60px;max-width:46%;text-align:right;color:#5c3d0c}
.face-plate.me strong{font-size:28px;color:#3d2a08}
.face-plate.me .face-chips{justify-content:flex-end}
.face-bench{margin-top:14px;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:2px}
.face-bench span{width:46px;height:46px;border-radius:50%;background:#fffdf0b3;box-shadow:inset 0 0 0 1.5px #c99b3f80;display:grid;place-items:center;overflow:hidden}
.face-bench span>*{width:40px;height:40px}
.face-bench em{flex-basis:100%;font-size:11.5px;color:#7a5a1c;margin-top:4px}
.face-vs{position:absolute;z-index:5;left:50%;top:40.6%;width:60px;height:60px;border-radius:50%;background:#173f37;border:3px solid #fff6d4;box-shadow:0 0 0 3px #173f37,0 6px 14px #0b202066;display:grid;place-items:center;transform:translate(-50%,-50%) rotate(-8deg)}
.face-vs b{font:700 22px/1 Outfit,system-ui,sans-serif;color:#ffd34f;letter-spacing:.5px}
.face-ready{position:absolute;left:0;right:0;bottom:0;z-index:6;height:var(--bar);display:flex;align-items:center;gap:10px;padding:0 18px;background:#173f37;color:#fff6d4}
.face-ready>span{font-size:9px;font-weight:700;letter-spacing:1.6px;color:#cfe0d2;white-space:nowrap}
.face-ready .encounter-progress{flex:1;display:flex;gap:4px;margin:0}
.face-ready .encounter-progress span{flex:1;width:auto;height:11px;border-radius:6px;background:#ffffff26;box-shadow:inset 0 0 0 1px #ffffff26;transition:background .3s,box-shadow .3s}
.face-ready .encounter-progress span.filled{background:linear-gradient(180deg,#ffe58a,#f2b632);box-shadow:0 0 8px #ffc93cb3}
.face-ready .encounter-progress span:not(.filled):first-child,.face-ready .encounter-progress span.filled+span:not(.filled){box-shadow:inset 0 0 0 1.5px #ffe58a}
.face-count{font:600 15px Outfit,system-ui,sans-serif;color:#ffd96a;white-space:nowrap}
.celebrate .face-hero{animation:face-cheer .6s ease}
.celebrate .face-foes{animation:face-flinch .45s ease}
@keyframes face-cheer{0%,100%{transform:none}35%{transform:translateY(-9%) rotate(-3deg)}65%{transform:translateY(-3%) rotate(2deg)}}
@keyframes face-flinch{0%,100%{transform:none}30%{transform:translateX(3%)}60%{transform:translateX(-2%)}}
/* Narrow two-column screens (tablets): the card is slim, so the extras go and the guardians shrink a little. */
@media(min-width:621px) and (max-width:900px){
 .face-bench,.face-plate small{display:none}
 .face-foes{height:29%}
 .face-plate.them{left:14px;top:14px;max-width:38%}
 .face-plate strong,.boss .face-plate.them strong{font-size:16px}.face-plate.me strong{font-size:22px}
 .face-plate em{font-size:11.5px}
 .face-off .type-chip,.face-level{font-size:10px;padding:4px 7px}
 .face-plate.me{right:14px;bottom:56px}
 .face-vs{width:50px;height:50px}.face-vs b{font-size:19px}
 .face-ready{padding:0 14px;gap:8px}
}
/* Short wide screens (a phone held sideways): the whole card stays in view above the fold. */
@media(min-width:621px) and (max-height:560px){
 .face-off{--bar:34px;flex:none;min-height:180px;height:calc(100dvh - 150px)}
 .face-plate.them{max-width:56%}.face-plate.them em{display:none}
 .face-plate.them strong,.boss .face-plate.them strong{font-size:15px}
 .face-off .type-chip,.face-level{font-size:9px;padding:3px 6px}.face-chips{gap:3px}
 .face-hero{bottom:30px}
 .face-bench,.face-plate small{display:none}
 .face-plate strong{font-size:17px}.face-plate.me strong{font-size:20px}
 .face-plate em{font-size:11.5px}
 .face-plate.them{left:12px;top:10px}.face-plate.me{right:12px;bottom:44px}
 .face-vs{width:46px;height:46px}.face-vs b{font-size:17px}
 .face-ready{padding:0 12px}.face-count{font-size:13px}
 .face-column .scene-caption{display:none}
}
/* Phones held upright: a banner above the question, split left and right. */
@media(max-width:620px){
 .face-off{--bar:32px;flex:none;min-height:0;height:clamp(120px,23.5dvh,200px)}
 .face-mine{clip-path:polygon(0 0,57% 0,43% 100%,0 100%)}
 .face-mine i{left:-70%;top:-60%}
 .face-off:after{clip-path:polygon(57% 0,58.6% 0,44.6% 100%,43% 100%)}
 .face-hero{left:4px;bottom:30px;height:calc(100% - 62px)}
 .face-plate small,.face-plate em,.face-bench,.face-plate.me .type-chip{display:none}
 .face-plate.me{left:11px;right:auto;top:9px;bottom:auto;max-width:46%;display:flex;align-items:center;gap:5px;text-align:left}
 .face-plate.me strong{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .face-plate.me .face-chips{margin:0;flex:none}
 .face-plate.them{left:auto;right:10px;top:8px;max-width:46%;text-align:right}
 .face-plate.them strong{font-size:14px}
 .boss .face-plate.them{max-width:44%}.boss .face-plate.them strong{font-size:12px}
 .face-plate.them .face-chips{justify-content:flex-end;gap:3px;margin-top:3px}
 .face-off .type-chip,.face-level{font-size:9px;padding:3px 6px}
 .face-level{font-size:10px;padding:4px 8px}
 .face-foes{top:auto;right:6px;bottom:34px;height:calc(100% - 84px);aspect-ratio:3/2}
 .foes-3 .f0{height:88%;right:19%;top:auto;bottom:4%}.foes-3 .f1{height:52%;right:68%;top:auto;bottom:0}.foes-3 .f2{height:52%;right:-3%;top:auto;bottom:-2%}
 .foes-2 .f0{height:82%;right:42%;top:auto;bottom:2%}.foes-2 .f1{height:82%;right:-3%;top:auto;bottom:0}
 .foes-1 .f0{height:96%;right:18%;top:auto;bottom:0}
 .face-vs{left:50.5%;top:47%;width:40px;height:40px}.face-vs b{font-size:15px}
 .face-ready{padding:0 14px}
 .face-ready .encounter-progress span{height:9px}
 .face-count{font-size:13px}
}
/* Very short upright phones: a slimmer banner so the helper link stays on screen. */
@media(max-width:620px) and (max-height:600px){
 .face-off{height:104px}
 .face-hero{bottom:28px;height:calc(100% - 50px)}
 .face-foes{height:calc(100% - 56px)}
 .face-plate.them .face-chips{display:none}
 .face-vs{width:34px;height:34px}.face-vs b{font-size:13px}
}
@media(max-width:350px){
 .face-plate.me strong,.face-plate.them strong{font-size:13px}.boss .face-plate.them strong{font-size:11px}
 .face-off .type-chip{font-size:8px;padding:3px 5px}
 .face-ready>span{letter-spacing:1px}
}
@media(prefers-reduced-motion:reduce){.face-hero>*,.celebrate .face-hero,.celebrate .face-foes{animation:none}.face-ready .encounter-progress span{transition:none}}
