.experience-game.page-shell--formation .turn-panel{display:flex;flex-direction:column;overflow:hidden;min-height:0}
.experience-game .turn-head{display:flex;align-items:center;gap:18px;flex:none}
.experience-game .turn-head>div{flex:1;min-width:0}
.experience-game .turn-head .phase-tabs{margin:0;width:46%;max-width:500px;flex:none}
.experience-game .turn-head .phase-tabs button{flex:1;white-space:nowrap}
.experience-game.page-shell--formation .phase-brief{display:none}
.experience-game.page-shell--formation .combo-builder.play-board{display:flex;flex-direction:column;flex:1.4;min-height:0;order:0;padding:8px 10px;margin:8px 0 0;overflow:hidden}
.play-board-heading{display:flex;justify-content:space-between;align-items:center;flex:none;height:28px;color:#f1d4a0;font-size:15px}
.play-board-heading span{font-size:11px;color:#aac7c9}.play-board-heading small{font-size:13px;margin-left:8px}
.play-row{display:flex;gap:12px;flex:1;min-height:0;container-type:size;align-items:stretch;padding:8px 4px 2px}
.play-slot{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:4px;border-radius:6px;border:1px solid #7d8a8150;background:linear-gradient(#1c304677,#0a172866);padding:4px}
.play-slot-number{position:absolute;z-index:8;top:5px;left:5px;width:23px;height:23px;display:grid;place-items:center;border:1px solid #d0ac6a;background:#493b2d;color:#f7e2b8;font:15px Georgia,serif}
.experience-game.page-shell--formation .play-slot .skill-card{width:min(100%,190px,calc((100cqh - 80px)*2/3));height:auto!important;aspect-ratio:2/3;flex:none;max-height:none!important;min-height:0!important}
.play-slot-actions,.hand-actions{display:flex;gap:4px;justify-content:center;flex:none;width:100%}
.play-slot-actions button,.hand-actions button{padding:3px 6px;min-height:25px;background:#263f4c;border:1px solid #ab9871;color:#f0d8a4;font-size:12px;cursor:pointer;white-space:nowrap}
.play-slot-actions button:disabled{opacity:.3}.play-slot .target-picks{display:flex;width:100%;gap:4px;margin:0;flex:none}.play-slot .target-picks button{flex:1;min-height:25px;font-size:12px;padding:3px}
.play-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;height:100%;color:#78949e;border:1px dashed #73877b;width:100%;font-size:16px}.play-empty small{font-size:12px;text-align:center;line-height:1.6}
.play-slot.needs-target{border-color:#f38c54}.play-slot.has-combo{border-color:#eed17d;box-shadow:inset 0 0 16px #eeb95625,0 0 12px #eeab3322}
.formation-combo{display:flex;align-items:center;gap:10px;flex:none;min-height:33px;padding:5px 9px;color:#829aa4;font-size:12px;background:#081521;overflow-x:auto;white-space:nowrap}
.formation-combo.is-active{color:#fff0b1;border:1px solid #dfb954;background:linear-gradient(90deg,#614829b0,#152b39)}
.formation-combo span{display:flex;gap:8px;align-items:center}.formation-combo strong{font-size:14px}.formation-combo small{font-size:11px;color:#cfc5a4}
.combo-triggered{animation:combo-ready .65s ease-out}@keyframes combo-ready{30%{box-shadow:0 0 24px #ffc94c88;filter:brightness(1.5)}}
.experience-game.page-shell--formation .turn-panel>.skills-section{display:flex;flex-direction:column;flex:1.2;min-height:0;overflow:hidden;order:0;margin:6px 0 0;padding:4px 8px;border:0}
.experience-game.page-shell--formation .skills-heading{flex:none;min-height:30px;margin:0 0 4px;padding-bottom:3px}.experience-game.page-shell--formation .skills-heading .eyebrow{display:none}.experience-game.page-shell--formation .skills-heading h2{margin:0;font-size:17px}
.experience-game.page-shell--formation .hand-grid{display:flex;flex:1;min-height:0;gap:12px;overflow-x:auto;overflow-y:hidden;container-type:size;align-items:flex-start;padding:3px 2px 4px}
.experience-game.page-shell--formation .hand-item{display:flex;flex-direction:column;flex:0 0 calc((100% - 48px)/5);min-width:110px;align-items:center;gap:5px}
.experience-game.page-shell--formation .hand-item .skill-card{width:min(100%,190px,calc((100cqh - 40px)*2/3));height:auto!important;aspect-ratio:2/3;max-height:none!important;min-height:0!important;flex:none}
.experience-game.page-shell--formation .hand-item .skill-body strong,.experience-game.page-shell--formation .play-slot .skill-body strong{font-size:clamp(12px,1.1vw,18px)}
.experience-game.page-shell--formation .hand-item .skill-end b,.experience-game.page-shell--formation .play-slot .skill-end b{white-space:normal;font-size:11px}
.experience-game.page-shell--formation .action-message{flex:none;margin-top:4px;min-height:0;padding:4px 8px;font-size:12px;line-height:18px}
.experience-game.page-shell--formation .main-action{flex:none;order:0;margin-top:0;padding-top:5px}.experience-game.page-shell--formation .main-action .roll-button{height:36px;min-height:36px}
.hand-empty{flex:1;min-height:0!important;padding:8px!important}.hand-empty strong{font-size:16px!important}
.page-shell--formation .skill-card{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.page-shell--formation .skill-card img{pointer-events:none}
.drag-source{opacity:.3!important}.drop-highlight{outline:2px solid #ffe080;box-shadow:0 0 20px #ffc95166!important}
.card-drag-ghost{position:fixed!important;z-index:1000!important;pointer-events:none!important;transform:translate(-50%,-50%) rotate(-4deg)!important;opacity:.95!important;box-shadow:0 10px 24px #0009!important}
@media(prefers-reduced-motion:reduce){.combo-triggered{animation:none}}
/* Short desktop windows use the same side-by-side card table to preserve art size. */
@media(min-width:900px) and (max-height:1000px){
.experience-game.page-shell--formation .turn-panel{display:grid;grid-template-columns:190px minmax(0,1fr);grid-template-rows:58px minmax(0,1fr) 26px 42px;gap:6px}
.experience-game.page-shell--formation .turn-head{grid-column:1/-1;grid-row:1}
.experience-game.page-shell--formation .turn-panel>.combo-builder.play-board{grid-column:2;grid-row:2;margin:0}
.experience-game.page-shell--formation .turn-panel>.skills-section{grid-column:1;grid-row:2;margin:0;padding:0}
.experience-game.page-shell--formation .action-message{grid-column:1/-1;grid-row:3;margin:0}
.experience-game.page-shell--formation .main-action{grid-column:1/-1;grid-row:4}
.experience-game.page-shell--formation .skills-heading .keyboard-hint{display:none}
.experience-game.page-shell--formation .hand-item{flex:0 0 100%;min-width:0}
.experience-game.page-shell--formation .hand-item .skill-card{width:min(180px,calc((100cqh - 50px)*2/3))}
}
/* On a phone, keep a paged hand column beside all four visible drop slots. */
.fixed-mobile-stage .experience-game.page-shell--formation .turn-panel{display:grid!important;grid-template-columns:148px minmax(0,1fr);grid-template-rows:27px minmax(0,1fr) 31px;gap:5px}
.fixed-mobile-stage .experience-game.page-shell--formation .turn-panel>.phase-tabs{grid-column:1/-1;grid-row:1}
.fixed-mobile-stage .experience-game.page-shell--formation .turn-panel>.combo-builder.play-board{display:flex!important;grid-column:2;grid-row:2;min-height:0;margin:0;padding:4px;flex:none}
.fixed-mobile-stage .experience-game.page-shell--formation .turn-panel>.skills-section{display:flex!important;grid-column:1;grid-row:2;min-height:0;margin:0;padding:0;flex:none}
.fixed-mobile-stage .experience-game.page-shell--formation .mobile-formation-switch,.fixed-mobile-stage .experience-game.page-shell--formation .action-message{display:none}
.fixed-mobile-stage .experience-game.page-shell--formation .main-action{grid-column:1/-1;grid-row:3;padding:0}
.fixed-mobile-stage .experience-game.page-shell--formation .main-action .roll-button{height:31px;min-height:31px;font-size:17px}
.fixed-mobile-stage .play-board-heading{height:23px;font-size:15px}.fixed-mobile-stage .play-board-heading span{display:none}
.fixed-mobile-stage .play-row{gap:4px;padding:5px 0 0}.fixed-mobile-stage .play-slot{padding:2px;gap:4px}
.fixed-mobile-stage .experience-game.page-shell--formation .play-slot .skill-card{width:min(100%,140px,calc((100cqh - 65px)*2/3));height:auto!important}
.fixed-mobile-stage .play-slot-number{width:18px;height:18px;font-size:12px;top:2px;left:2px}
.fixed-mobile-stage .play-slot-actions{flex-wrap:nowrap;gap:2px}.fixed-mobile-stage .play-slot-actions button{font-size:11px;padding:2px 4px;min-height:22px}.fixed-mobile-stage .play-slot-actions button:last-child{padding:2px}
.fixed-mobile-stage .play-slot .target-picks button{min-height:23px;font-size:12px}
.fixed-mobile-stage .formation-combo{min-height:27px;font-size:12px;padding:3px 4px;gap:5px}.fixed-mobile-stage .formation-combo strong{font-size:13px}.fixed-mobile-stage .formation-combo small{display:none}
.fixed-mobile-stage .experience-game.page-shell--formation .skills-heading{display:block;min-height:22px;height:22px}.fixed-mobile-stage .skills-heading h2{font-size:15px!important}.fixed-mobile-stage .skills-heading .keyboard-hint{display:none}
.fixed-mobile-stage .experience-game.page-shell--formation .hand-grid{overflow:hidden;display:flex;min-height:0}
.fixed-mobile-stage .experience-game.page-shell--formation .hand-item{flex:1;min-width:0;width:100%;gap:5px}
.fixed-mobile-stage .experience-game.page-shell--formation .hand-item .skill-card{width:min(120px,calc((100cqh - 65px)*2/3));height:auto!important}
.fixed-mobile-stage .hand-actions button{font-size:12px;padding:3px 4px;min-height:25px}.fixed-mobile-stage .hand-actions{gap:3px;flex-wrap:wrap}
.fixed-mobile-stage .experience-game.page-shell--formation .hand-item .skill-body strong,.fixed-mobile-stage .experience-game.page-shell--formation .play-slot .skill-body strong{font-size:14px!important;white-space:normal!important}
.fixed-mobile-stage .play-slot .skill-end .element-tag{display:none}.fixed-mobile-stage .play-empty{font-size:13px}.fixed-mobile-stage .play-empty small{font-size:11px}

.experience-game.page-shell--formation .skill-card .skill-body{top:66%;bottom:auto;left:13%;right:13%;padding:0;max-height:16%;margin:0}
.experience-game.page-shell--formation .skill-card .skill-body small{display:none}
.experience-game.page-shell--formation .skill-card .skill-body strong{line-height:1.15;letter-spacing:0;white-space:normal}
.experience-game.page-shell--formation .skill-card .skill-end{top:81%;bottom:auto;left:13%;right:13%;gap:1px;padding:0;max-height:13%}
.experience-game.page-shell--formation .skill-card .skill-end .element-tag{font-size:9px;line-height:1.1;display:block}
.experience-game.page-shell--formation .skill-card .skill-end b{font-size:11px;line-height:1.15}
.fixed-mobile-stage .experience-game.page-shell--formation .skill-card .skill-end{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px;max-height:16%}
.fixed-mobile-stage .experience-game.page-shell--formation .skill-card .skill-end .element-tag{display:inline;font-size:10px}
.fixed-mobile-stage .experience-game.page-shell--formation .skill-card .skill-end b{font-size:10px}

/* Give rules their own fixed area inside the frame, rather than hiding them. */
.experience-game.page-shell--formation .skill-card .card-art-window{inset:5% 12% 61%;background:#10202e}
.experience-game.page-shell--formation .formation-card-info{position:absolute;z-index:5;left:13%;right:13%;top:44%;bottom:14%;display:flex;flex-direction:column;align-items:stretch;gap:2px;overflow:hidden;text-align:left}
.formation-card-info>*{flex-shrink:0}
.formation-card-info strong{font:900 clamp(12px,1.15vw,18px) KaiTi,serif;color:#fff0cc;line-height:1.15;letter-spacing:0}
.formation-card-meta{color:var(--element-color);font-size:10px;line-height:1.15}
.formation-card-effect{color:#e8e4db;font-size:11px;line-height:1.3}
.formation-card-trait{color:#adc8cf;font-size:10px;line-height:1.25}
.formation-card-value{color:#ffe1a6;font-size:11px;line-height:1.2;margin-top:4px}
/* Split the existing frame at its printed divider. Its illustration opening and
   lower rules panel can then resize independently without stretching the art. */
.experience-game.page-shell--formation .skill-card:before{inset:0 0 59%;background-size:100% 151.5152%;background-position:center top}
.experience-game.page-shell--formation .skill-card:after{inset:41% 0 0;z-index:4;background:url('/src/assets/ui-v8/ninjutsu-frame.webp') center bottom/100% 294.1176% no-repeat;pointer-events:none}
.fixed-mobile-stage .experience-game.page-shell--formation .hand-item .skill-card{width:min(146px,calc((100cqh - 22px)*2/3))}
.fixed-mobile-stage .hand-actions{flex-wrap:nowrap}.fixed-mobile-stage .hand-actions button{padding:3px;min-width:0}
.fixed-mobile-stage .formation-card-info{gap:0!important;top:44%!important;bottom:14%!important}
.fixed-mobile-stage .formation-card-info strong{font-size:13px}
.fixed-mobile-stage .formation-card-meta{font-size:9px}
.fixed-mobile-stage .formation-card-effect,.fixed-mobile-stage .formation-card-trait{font-size:9px;line-height:1.1}
.fixed-mobile-stage .formation-card-value{font-size:10px;line-height:1;margin-top:0}
/* Smaller played cards show the effect and trait keyword; hand cards show the full trait. */
.fixed-mobile-stage .play-slot .formation-card-trait{display:none}
.fixed-mobile-stage .play-slot .formation-card-value{font-size:9px}
