@charset "UTF-8";
/* Every value comes from the device safe area. Variables also make deterministic
   inset fixtures possible on desktop; no handset or viewport detection in JS. */
:root {
  --r3-safe-top:env(safe-area-inset-top,0px);
  --r3-safe-right:env(safe-area-inset-right,0px);
  --r3-safe-bottom:env(safe-area-inset-bottom,0px);
  --r3-safe-left:env(safe-area-inset-left,0px);
}
html { scroll-padding-top:var(--r3-safe-top); scroll-padding-bottom:var(--r3-safe-bottom); }
#app { padding:var(--r3-safe-top) max(20px,var(--r3-safe-right)) var(--r3-safe-bottom) max(20px,var(--r3-safe-left)); }
#battle-screen { --safe-top:var(--r3-safe-top); --safe-bottom:var(--r3-safe-bottom); }
#battle-screen .battle-status {
  padding:calc(8px + var(--r3-safe-top)) max(12px,var(--r3-safe-right)) 9px max(12px,var(--r3-safe-left));
  height:calc(67px + var(--r3-safe-top));
}
#battle-screen .territory-track { top:calc(66px + var(--r3-safe-top)); }
#battle-screen .battle-heading { top:calc(81px + var(--r3-safe-top)); left:max(14px,var(--r3-safe-left)); max-width:calc(100% - 145px - var(--r3-safe-left) - var(--r3-safe-right)); }
#battle-screen .map-caption { top:calc(103px + var(--r3-safe-top)); left:max(14px,var(--r3-safe-left)); }
#battle-screen .battle-scoreboard { top:calc(82px + var(--r3-safe-top)); right:max(10px,var(--r3-safe-right)); }
#battle-screen .dispatch-panel {
  height:calc(var(--dock-height) + var(--r3-safe-bottom));
  padding-left:max(14px,var(--r3-safe-left)); padding-right:max(14px,var(--r3-safe-right));
  padding-bottom:calc(10px + var(--r3-safe-bottom));
}
#battle-screen .minimap-panel { left:max(12px,var(--r3-safe-left)); bottom:calc(var(--dock-height) + 30px + var(--r3-safe-bottom)); }
#battle-screen .map-controls { right:max(12px,var(--r3-safe-right)); bottom:calc(var(--dock-height) + 64px + var(--r3-safe-bottom)); }
#battle-screen .map-legend { bottom:calc(var(--dock-height) + 10px + var(--r3-safe-bottom)); }
#battle-screen .tactics-drawer { right:max(12px,var(--r3-safe-right)); bottom:calc(var(--dock-height) + 10px + var(--r3-safe-bottom)); max-width:calc(100% - 24px - var(--r3-safe-left) - var(--r3-safe-right)); }
.tactics-content { max-width:calc(100vw - 24px - var(--r3-safe-left) - var(--r3-safe-right)); max-height:calc(100dvh - 310px - var(--r3-safe-top) - var(--r3-safe-bottom)); }
#battle-screen .battle-message { top:calc(77px + var(--r3-safe-top)); max-width:min(calc(100% - 32px - var(--r3-safe-left) - var(--r3-safe-right)),440px); }
.tutorial-card { left:max(14px,var(--r3-safe-left)); }
.modal-backdrop { padding:max(24px,var(--r3-safe-top)) max(18px,var(--r3-safe-right)) max(24px,var(--r3-safe-bottom)) max(18px,var(--r3-safe-left)); }
.result-card,.rules-card { max-height:calc(100dvh - max(24px,var(--r3-safe-top)) - max(24px,var(--r3-safe-bottom))); }
.pause-overlay { padding:var(--r3-safe-top) var(--r3-safe-right) var(--r3-safe-bottom) var(--r3-safe-left); }

/* Fast launch compression, a two-stage capture burst, and the existing resource
   production bonus each have their own silhouette. These nodes never take input. */
.r3-feedback { position:absolute; width:100px; height:90px; transform:translate(-50%,-50%) scale(var(--feedback-scale,1)); pointer-events:none; color:#fff3b9; z-index:22; }
.r3-feedback b { position:absolute; left:50%; top:-23px; transform:translateX(-50%); white-space:nowrap; font-size:15px; color:#205c4d; text-shadow:0 1px #fffbed,1px 0 #fffbed,-1px 0 #fffbed,0 -1px #fffbed; animation:r3-feedback-label 1.2s ease-out both; }
.r3-shockwave { position:absolute; inset:27px 10px 18px; border:4px solid currentColor; border-radius:50%; box-shadow:0 0 0 3px #285d4933,0 0 18px #f7e69faa; animation:r3-shockwave .65s cubic-bezier(.12,.65,.25,1) both; }
.r3-streak { position:absolute; left:48px; top:37px; width:4px; height:21px; border-radius:4px; background:currentColor; box-shadow:0 0 5px #fff3bf; transform-origin:50% 50%; animation:r3-streak .5s ease-out both; --sx:32px; --sy:-24px; --sr:40deg; }
.r3-streak-b { --sx:-32px; --sr:-40deg; }
.r3-streak-c { --sx:22px; --sy:16px; --sr:120deg; animation-delay:.035s; }
.r3-streak-d { --sx:-22px; --sy:16px; --sr:-120deg; animation-delay:.035s; }
.r3-dispatch { color:#d3f4ca; }
.r3-dispatch b { font-size:13px; }
.r3-capture { color:#ffe9a3; }
.r3-capture .r3-shockwave { border-width:5px; animation-duration:1s; }
.r3-capture b { animation-duration:1.5s; }
.effect-capture.player .combat-label { display:none; }
.r3-production { color:#b8e5a1; }
.r3-production .r3-shockwave { border-width:2px; animation-delay:.25s; animation-duration:1.15s; }
.r3-production .r3-streak { height:15px; --sy:-52px; animation-delay:.3s; animation-duration:.8s; }
.r3-production b { top:115px; font-size:13px; padding:4px 8px; border-radius:7px; background:#f6ffe8f5; box-shadow:0 2px 8px #24472d25; animation-duration:2.2s; animation-delay:.15s; }
.r3-muster .squad-formation { animation:r3-muster .36s ease-out both; }
#map-world .building.just-captured .building-art { animation:r3-town-claim .75s cubic-bezier(.2,.8,.25,1) both; }
.world-paused .r3-feedback *,.world-paused .r3-muster .squad-formation { animation-play-state:paused!important; }
@keyframes r3-shockwave { 0% { opacity:0; scale:.15; } 14% { opacity:1; } 100% { opacity:0; scale:1.6; } }
@keyframes r3-streak { 0% { opacity:0; transform:translate(0,0) rotate(var(--sr)) scaleY(.4); } 15% { opacity:1; } 100% { opacity:0; transform:translate(var(--sx),var(--sy)) rotate(var(--sr)) scaleY(.2); } }
@keyframes r3-feedback-label { 0% { opacity:0; translate:0 10px; scale:.8; } 16% { opacity:1; scale:1.09; } 30%,68% { opacity:1; scale:1; } 100% { opacity:0; translate:0 -20px; } }
@keyframes r3-muster { 0% { opacity:.5; scale:.75 1.2; } 45% { opacity:1; scale:1.12 .9; } 100% { scale:1; } }
@keyframes r3-town-claim { 0% { transform:scale(.9,.65); filter:brightness(1.8); } 25% { transform:translateY(-6px) scale(1.12,1.18); filter:brightness(1.4); } 52% { transform:scale(1.06,.94); } 75% { transform:scale(.98,1.03); } 100% { transform:none; filter:none; } }

@media(max-width:700px) {
  #app { padding-left:max(16px,var(--r3-safe-left)); padding-right:max(16px,var(--r3-safe-right)); }
  .selection-launch { padding-bottom:calc(14px + var(--r3-safe-bottom)); }
  .trait-toast { bottom:calc(var(--dock-height) + 70px + var(--r3-safe-bottom)); }
}
@media(max-width:360px) {
  #app { padding-left:max(12px,var(--r3-safe-left)); padding-right:max(12px,var(--r3-safe-right)); }
  #battle-screen .battle-status { display:grid; grid-template-columns:minmax(26px,1fr) minmax(26px,.75fr) 48px 136px; gap:4px; padding-left:max(8px,var(--r3-safe-left)); padding-right:max(8px,var(--r3-safe-right)); }
  .battle-status .status-stat,.battle-status .battle-clock { min-width:0; }
  .battle-status .status-stat b { max-width:100%; overflow:hidden; text-overflow:ellipsis; }
  .battle-status .battle-utilities { gap:2px; }
  #battle-screen .dispatch-panel { padding-left:max(10px,var(--r3-safe-left)); padding-right:max(10px,var(--r3-safe-right)); }
  #battle-screen .dispatch-actions .ratio-buttons button { padding:0; font-size:20px; }
  #battle-screen .dispatch-actions .ratio-buttons button>span { font-size:9px; }
}
@media(max-width:700px) and (orientation:portrait) {
  .tutorial-card { left:calc(124px + var(--r3-safe-left)); right:calc(70px + var(--r3-safe-right)); bottom:calc(var(--dock-height) + 28px + var(--r3-safe-bottom)); }
}
@media(max-width:360px) and (orientation:portrait) {
  .tutorial-card { left:calc(110px + var(--r3-safe-left)); right:calc(68px + var(--r3-safe-right)); bottom:calc(var(--dock-height) + 20px + var(--r3-safe-bottom)); }
}
@media(min-width:1000px) {
  #battle-screen .battle-status { padding-left:max(28px,var(--r3-safe-left)); padding-right:max(28px,var(--r3-safe-right)); }
  #battle-screen .battle-scoreboard { top:calc(94px + var(--r3-safe-top)); right:max(24px,var(--r3-safe-right)); }
  #battle-screen .minimap-panel { left:max(24px,var(--r3-safe-left)); bottom:calc(30px + var(--r3-safe-bottom)); }
  #battle-screen .map-controls { right:max(24px,var(--r3-safe-right)); bottom:calc(30px + var(--r3-safe-bottom)); }
  #battle-screen .tactics-drawer { right:calc(50% - 280px); bottom:calc(var(--dock-height) + 12px + var(--r3-safe-bottom)); }
  .tutorial-card { top:calc(174px + var(--r3-safe-top)); left:max(24px,var(--r3-safe-left)); }
}
@media(max-height:520px) and (orientation:landscape) {
  #battle-screen .battle-status { height:calc(57px + var(--r3-safe-top)); padding-top:calc(5px + var(--r3-safe-top)); padding-bottom:5px; }
  #battle-screen .territory-track { top:calc(56px + var(--r3-safe-top)); }
  #battle-screen .battle-heading { top:calc(67px + var(--r3-safe-top)); left:max(12px,var(--r3-safe-left)); max-width:calc(100% - 260px - var(--r3-safe-left) - var(--r3-safe-right)); }
  #battle-screen .map-caption { top:calc(91px + var(--r3-safe-top)); }
  #battle-screen .battle-scoreboard { top:calc(68px + var(--r3-safe-top)); }
  #battle-screen .dispatch-panel { width:min(560px,calc(100% - 230px - var(--r3-safe-left) - var(--r3-safe-right))); padding:9px 12px calc(7px + var(--r3-safe-bottom)); }
  #battle-screen .minimap-panel { bottom:calc(12px + var(--r3-safe-bottom)); }
  #battle-screen .map-controls { top:calc(68px + var(--r3-safe-top)); bottom:auto; right:calc(138px + max(12px,var(--r3-safe-right))); }
  #battle-screen .tactics-drawer { bottom:calc(12px + var(--r3-safe-bottom)); }
  .tactics-content { max-height:calc(100dvh - 131px - var(--r3-safe-top) - var(--r3-safe-bottom)); }
  #battle-screen .battle-message { top:calc(65px + var(--r3-safe-top)); }
  .tutorial-card { top:calc(129px + var(--r3-safe-top)); left:max(12px,var(--r3-safe-left)); }
  .trait-toast { right:calc(156px + var(--r3-safe-right)); bottom:calc(18px + var(--r3-safe-bottom)); }
}
@media(prefers-reduced-motion:reduce) {
  .r3-feedback .r3-shockwave,.r3-feedback .r3-streak { display:none; }
  .r3-feedback b { animation:none; opacity:1; }
  .r3-muster .squad-formation,#map-world .building.just-captured .building-art { animation:none; }
}
