/* Terra V1.5.0: readable low-angle dock projection and local result banners. */
.legion-game.mode-formal .world-reserve-pages{
  width:96px;min-width:96px;height:132px;bottom:clamp(64px,8.6%,95px);
  transform:perspective(620px) rotateX(29deg) rotateY(6deg) rotateZ(1deg)!important;
  transform-origin:center bottom;
  grid-template-rows:40px 26px 40px;gap:3px;padding:7px;
  border:1px solid #8de0dfdb;border-radius:10px;
  box-shadow:0 8px 0 #0a2530,0 13px 22px #04161ccb,0 0 22px #5cd5cf55;
}
.legion-game.mode-formal .world-reserve-pages button{
  width:78px;min-width:78px;height:38px;min-height:38px;border-radius:8px;font-size:25px;
}
.legion-game.mode-formal .world-reserve-page-number{
  font-size:14px;min-width:78px;line-height:24px;
}
.legion-game.mode-formal .lane-result-toast{
  position:absolute;top:30%;left:50%;transform:translateX(-50%);z-index:46;
  width:min(510px,78vw);padding:23px 30px;border-left:4px solid #74e7bb;
  background:linear-gradient(90deg,#0b3438ed,#0d292bb4 75%,transparent);
  color:#e9fffa;pointer-events:none;animation:terra150-lane-fade .21s ease-out both;
  filter:drop-shadow(0 5px 14px #091b22a0);
}
.legion-game.mode-formal .lane-result-toast.lost{border-left-color:#f18286;background:linear-gradient(90deg,#431c26ee,#341f29b7 75%,transparent)}
.lane-result-toast[hidden]{display:none!important}
.lane-result-toast strong{display:block;font:700 clamp(26px,3vw,42px)/1.2 'Microsoft YaHei',sans-serif;letter-spacing:.09em}
.lane-result-toast small{display:block;margin-top:12px;font:13px 'Microsoft YaHei',sans-serif;color:#b8e5dc}
@keyframes terra150-lane-fade{from{opacity:0;transform:translate(-47%,-12px)}to{opacity:1;transform:translate(-50%,0)}}
/* Empty-defense arrival card: invitation, not a conventional battle start. */
.legion-game.mode-formal .phase-cinematic.mode-unopposed .phase-cinematic-content:before{
 content:'☞';display:block;font-size:44px;line-height:1.3;color:#a7e7d7;text-shadow:0 0 18px #59d9ba8c;
}
/* This indicator is debug-only; do not show a separate blue-gate transfer box. */
.legion-game.mode-formal .gate-transfer-status{display:none!important}
@media(max-width:920px){.legion-game.mode-formal .world-reserve-pages{width:78px;min-width:78px;height:120px;grid-template-rows:34px 24px 34px}}
/* The short victory/defeat card replaces the old persistent completion strip in formal play. */
.legion-game.mode-formal .combat-complete-status{display:none!important}
/* V1.5.1: reserve capacity is a non-modal warning on the front-left apron.
   It never captures input and stays below the shop shade/drawer. */
.legion-game.mode-formal .reserve-capacity-alert[hidden]{display:none!important}
.legion-game.mode-formal .reserve-capacity-alert{
  position:absolute;left:clamp(18px,2.2vw,36px);bottom:clamp(106px,12.5vh,132px);z-index:31;
  display:flex;align-items:center;gap:10px;min-width:190px;max-width:min(270px,42vw);
  box-sizing:border-box;padding:9px 13px 9px 10px;border:1px solid #d9a65b;
  border-left:3px solid #ffc36c;border-radius:5px;
  background:linear-gradient(110deg,#392b1feF,#1d2529e8 82%);
  color:#ffe6bd;box-shadow:0 4px 16px #0009,0 0 15px #f0a94a24;
  pointer-events:none;backdrop-filter:blur(5px);
  animation:terra150-capacity-pulse 2.8s ease-in-out infinite;
}
.legion-game.mode-formal .reserve-capacity-mark{
  display:grid;place-items:center;flex:0 0 25px;width:25px;height:25px;border-radius:50%;
  border:1px solid #ffd08a;background:#7a4b24;color:#fff0cf;
  font:900 17px/1 Consolas,monospace;text-shadow:0 0 8px #ffc36c;
}
.legion-game.mode-formal .reserve-capacity-copy{display:grid;gap:3px;min-width:0}
.legion-game.mode-formal .reserve-capacity-copy strong{font-size:12px;letter-spacing:.7px;color:#ffe4b7}
.legion-game.mode-formal .reserve-capacity-copy small{font-size:9px;line-height:1.35;color:#d9c4a3;white-space:normal}
.legion-game.mode-formal .reserve-capacity-count{font:700 10px Consolas,monospace;color:#ffd28c}
@keyframes terra150-capacity-pulse{0%,100%{box-shadow:0 4px 16px #0009,0 0 10px #f0a94a16}50%{box-shadow:0 4px 18px #000b,0 0 19px #f0a94a45}}
@media(prefers-reduced-motion:reduce){.legion-game.mode-formal .reserve-capacity-alert{animation:none}}
@media(max-width:760px){.legion-game.mode-formal .reserve-capacity-alert{left:10px;bottom:92px;min-width:0;padding:7px 9px}.legion-game.mode-formal .reserve-capacity-copy small{max-width:150px}}
.legion-game.mode-formal .reserve-capacity-toast[hidden]{display:none!important}
.legion-game.mode-formal .reserve-capacity-toast{
  position:absolute;left:clamp(18px,2.2vw,36px);bottom:clamp(164px,19vh,198px);z-index:32;
  display:flex;align-items:center;gap:10px;max-width:min(310px,48vw);box-sizing:border-box;
  padding:10px 14px;border:1px solid #efb66d;border-left:3px solid #ffc56d;border-radius:5px;
  background:linear-gradient(110deg,#4a3020f5,#20282ceF 88%);color:#fff0d3;
  box-shadow:0 5px 20px #000b,0 0 18px #efa84a35;pointer-events:none;
  animation:terra150-capacity-toast .16s ease-out both;
}
.legion-game.mode-formal .reserve-capacity-toast>span:first-child{font-size:20px;color:#ffd07e;text-shadow:0 0 10px #f3a94e}
.legion-game.mode-formal .reserve-capacity-toast>span:last-child{display:grid;gap:3px}
.legion-game.mode-formal .reserve-capacity-toast strong{font-size:12px;letter-spacing:.4px}
.legion-game.mode-formal .reserve-capacity-toast small{font-size:9px;line-height:1.4;color:#e6cba6}
@keyframes terra150-capacity-toast{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.legion-game.mode-formal .reserve-capacity-toast{animation:none}}
/* V1.5.3: a visible, actionable overflow tray for borrowed duel mercenaries.
   It replaces the passive capacity badge only while recovered units exist. */
.legion-game.mode-formal .reserve-capacity-alert.has-recovery{
  max-width:min(360px,48vw);max-height:34vh;overflow-y:auto;pointer-events:auto;
  scrollbar-width:thin;scrollbar-color:#a27a45 #211d19;
}
.legion-game.mode-formal .reserve-capacity-alert.has-recovery .reserve-capacity-copy small{
  display:flex;flex-wrap:wrap;gap:4px 7px;align-items:baseline;
}
.legion-game.mode-formal .reserve-recovery-items{display:grid;gap:5px;margin-top:5px;max-height:19vh;overflow-y:auto;overscroll-behavior:contain}
.legion-game.mode-formal .reserve-recovery-item{
  display:grid;grid-template-columns:minmax(65px,1fr) auto auto;align-items:center;gap:5px;
  padding:4px 5px;border:1px solid #a77e4d66;border-radius:4px;background:#171d20b8;
}
.legion-game.mode-formal .reserve-recovery-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:#fff0d3}
.legion-game.mode-formal .reserve-recovery-item button{
  min-height:23px;padding:2px 7px;border:1px solid #c5a06b;border-radius:4px;
  background:#3a3023;color:#ffe6bb;font-size:9px;font-weight:700;cursor:pointer;white-space:nowrap;
}
.legion-game.mode-formal .reserve-recovery-item button:first-of-type{border-color:#80b9aa;background:#203b38;color:#d9fff1}
.legion-game.mode-formal .reserve-recovery-item button:disabled{opacity:.42;cursor:not-allowed}
.legion-game.mode-formal .reserve-recovery-item button:hover:not(:disabled){filter:brightness(1.2)}
@media(max-width:760px){.legion-game.mode-formal .reserve-capacity-alert.has-recovery{max-width:min(92vw,340px);max-height:30vh}}

/* V1.6.6t: pager controls face the camera; keep raised mechanical edge. */
.legion-game.mode-formal .world-reserve-pages{
 transform:none!important;transform-origin:center center!important;
 box-shadow:0 6px 0 #0a2530,0 12px 22px #04161ccb,0 0 22px #5cd5cf55!important;
}
.legion-game.mode-formal .world-reserve-pages button,
.legion-game.mode-formal .world-reserve-page-number{transform:none!important}
