:root{color-scheme:dark;font-family:Tahoma,Arial,sans-serif;background:#0c1724;color:#edf8ff}*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
button{font:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:2px solid #f2cf7a;outline-offset:2px}
.page{height:100vh;height:100dvh;max-width:940px;margin:0 auto;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:6px;padding:max(4px,env(safe-area-inset-top)) max(7px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left));overflow:hidden}
.topbar{min-height:28px;display:flex;align-items:center;justify-content:space-between;gap:6px}
.brand{display:flex;align-items:baseline;gap:9px;min-width:0}.brand strong{font:bold 19px Arial,sans-serif;letter-spacing:1px}.brand span{font-size:10px;white-space:nowrap;color:#96bfcc}
.statuspill{border:1px solid #2a6570;border-radius:99px;color:#95d7c9;font-size:10px;padding:5px 8px;white-space:nowrap}.statuspill[data-error=true]{color:#ff9e9e;border-color:#9c5d5d}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;min-height:47px}.metric{background:#142b3d;border:1px solid #2c4d61;border-radius:9px;min-width:0;padding:5px 7px;display:flex;flex-direction:column;align-items:start;justify-content:space-between}.metric span{font-size:10px;color:#9db8c8;white-space:nowrap}.metric strong{font-size:clamp(12px,3vw,16px);white-space:nowrap;direction:ltr;max-width:100%;overflow:hidden;text-overflow:ellipsis}#power[data-active=true]{color:#87e3bb}
.game{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:5px;padding:7px;background:#13283a;border:1px solid #2d4e61;border-radius:13px;overflow:hidden}.sectionTitle{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:20px}.sectionTitle strong{font-size:13px;white-space:nowrap}.sectionTitle span{color:#9cc4ce;font-size:10px;text-align:left;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.canvasWrap{min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;background:#102537;border:1px solid #31576e;border-radius:10px;overflow:hidden}canvas{display:block;max-width:100%;max-height:100%;width:auto;height:auto;aspect-ratio:700/540;object-fit:contain;touch-action:none}
.controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;min-height:40px}.controls button,.tabs button,#sell{min-height:40px;border:1px solid #4b8a94;border-radius:9px;background:#167b80;color:#fff;padding:7px 4px;font-weight:bold;font-size:clamp(11px,2.9vw,14px)}.controls button.secondary{background:#29485b}.controls button.quiet{background:#1c3244;border-color:#4a687b}.controls button[aria-pressed=false]{opacity:.64}.controls button[aria-pressed=true]{box-shadow:inset 0 0 0 2px #90cfc6}button:disabled{opacity:.45;cursor:not-allowed}
.bottom{display:grid;grid-template-rows:34px minmax(0,1fr);height:100px;min-width:0;min-height:0;border:1px solid #2f5064;border-radius:12px;background:#13283a;overflow:hidden}.tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:3px 5px 0}.tabs button{min-height:29px;height:29px;background:#1a3448;font-size:12px;border-color:#35586a;border-radius:8px 8px 3px 3px}.tabs button[aria-selected=true]{background:#277a84;color:#fff;border-color:#60caba}
.tabPanel{min-height:0;display:flex;flex-direction:column;justify-content:center;gap:5px;padding:3px 10px 8px}.tabPanel[hidden]{display:none}#state{font-size:11px;color:#c9e3ee;line-height:1.3;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.progressRow{display:flex;align-items:center;gap:7px;min-width:0;white-space:nowrap;font-size:10px;color:#b6cfdb}.progressRow progress{flex:1;min-width:35px;height:13px;accent-color:#65d8b7}.progressRow strong{color:#fff}
#contractPanel{flex-direction:row;align-items:center;justify-content:space-between;gap:12px}.contractInfo{white-space:nowrap;font-size:12px;color:#c9e0e9}#sell{min-width:120px;min-height:36px;padding:6px 12px}
@media(max-height:620px){.page{gap:3px;padding-top:2px;padding-bottom:2px}.topbar{min-height:23px}.brand strong{font-size:16px}.metrics{min-height:36px}.metric{padding:2px 6px}.game{padding:4px;gap:3px}.sectionTitle{min-height:16px}.controls{min-height:32px}.controls button{min-height:32px;padding:3px}.bottom{height:77px;grid-template-rows:27px minmax(0,1fr)}.tabs button{min-height:23px;height:23px}.tabPanel{padding:1px 8px 4px;gap:2px}}
@media(max-width:340px){.brand span{display:none}.statuspill{font-size:9px;padding:3px 5px}.metric{padding:4px}.sectionTitle span{font-size:9px}}