:root{--bg:#050912;--panel:#101a2c;--line:#2f5870;--cyan:#47e6f3;--lime:#b8ff49;--pink:#ff6aaf;--text:#eaf7ff;--muted:#b6c9d1}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:radial-gradient(circle at 50% -20%,#1c3450,#050912 65%);color:var(--text);font-family:system-ui,Segoe UI,sans-serif}button,a{font:inherit}button{cursor:pointer}button:disabled{opacity:.42;cursor:default}.shell{max-width:1450px;margin:auto;padding:10px max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom))}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px}.topbar h1{font-size:clamp(22px,4vw,35px);letter-spacing:.12em;color:var(--lime);text-shadow:0 0 16px #6fff3e;margin:0;line-height:1}.topbar small{color:var(--muted)}.back,.small-button,.actions button,.crew,.weapon,.primary,.secondary{border:1px solid var(--line);background:#132339;color:var(--text);border-radius:10px;padding:9px 12px;text-decoration:none;font-weight:700}.back{white-space:nowrap}.small-button{min-width:42px}.hud{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:8px 0}.hud>div{background:#0c1727;border:1px solid #30506c;border-radius:9px;padding:7px;text-align:center;color:var(--muted);font-size:12px;font-weight:800;letter-spacing:.09em}.hud b{display:block;color:var(--cyan);font-size:20px}.play-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:10px}.ship-panel,.command-panel{background:rgba(10,21,36,.92);border:1px solid #2b5468;border-radius:14px;padding:8px;box-shadow:0 12px 38px #0007}.ship-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;padding:0 5px;color:var(--lime);font-size:14px;font-weight:700}.ship-panel canvas{display:block;width:100%;height:auto;aspect-ratio:900/640;touch-action:manipulation;background:#06111b;border-radius:10px;border:1px solid #375f72;image-rendering:pixelated}.system-strip{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;margin-top:7px}.system-strip>div{font-size:11px;text-align:center;color:var(--muted);border-radius:6px;background:#162335;padding:5px 2px}.system-strip b{display:block;color:var(--cyan)}.system-strip .danger b{color:#ff7897}.command-panel{max-height:calc(100dvh - 102px);overflow:auto}.command-panel h2{color:var(--cyan);letter-spacing:.08em;font-size:15px;margin:5px 0 7px}.crew-list,.weapon-list{display:grid;gap:5px}.crew,.weapon{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;background:#10243a;min-height:44px}.crew.selected,.weapon.selected{border-color:var(--lime);box-shadow:inset 0 0 0 1px var(--lime)}.crew.dead{opacity:.42}.portrait{width:33px;height:33px;flex:none;background-repeat:no-repeat;image-rendering:pixelated;background-size:800% 200%}.portrait.pet{background-size:400% 200%}.crew span:last-child,.weapon span:last-child{display:flex;justify-content:space-between;align-items:center;gap:6px;flex:1}.crew small,.weapon small{color:var(--muted);font-size:11px}.hint{color:var(--muted);font-size:12px;line-height:1.3;margin:7px 1px 13px}.actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:13px 0}.actions button{font-size:12px;min-height:41px}.actions #jumpBtn{grid-column:1/-1;background:#44781f;border-color:#a9fb49;color:white;font-size:18px;letter-spacing:.15em}.actions #jumpBtn:disabled{background:#1b3242;border-color:#38546a}.event-log{height:95px;overflow:auto;padding:8px;border:1px solid #254658;border-radius:8px;background:#071423;font-size:12px;line-height:1.4;color:var(--muted)}.event-log div:first-child{color:var(--lime)}.overlay{position:fixed;inset:0;z-index:10;display:grid;place-items:center;background:rgba(2,7,13,.92);padding:13px}.intro-card{width:min(100%,490px);max-height:96dvh;overflow:auto;background:linear-gradient(#142b3c,#0c1728);border:2px solid #6eae72;border-radius:20px;padding:16px 22px;text-align:center;box-shadow:0 0 45px #65da5980}.intro-card .family-art{display:block;width:190px;height:125px;object-fit:contain;margin:0 auto -8px}.intro-card h2{font-size:34px;color:var(--lime);letter-spacing:.12em;margin:3px}.intro-card p{color:var(--text);line-height:1.35}.intro-card ul{text-align:left;color:var(--muted);padding-left:22px;line-height:1.45;font-size:14px}.intro-card button{display:block;width:100%;margin:8px auto;padding:13px}.primary{background:linear-gradient(#b8ff49,#72c827);color:#0c230c;border-color:#caff79;font-size:17px}.secondary{background:#14283a}.exit-link{display:inline-block;color:var(--cyan);margin:7px}.hidden{display:none!important}@media(max-width:800px){.play-layout{grid-template-columns:1fr}.command-panel{max-height:none}.crew-list{grid-template-columns:repeat(2,1fr)}.weapon-list{grid-template-columns:repeat(2,1fr)}.system-strip{grid-template-columns:repeat(3,1fr)}.hint{margin-bottom:7px}}@media(max-width:450px){.shell{padding:7px}.topbar h1{font-size:22px}.topbar small{font-size:10px}.hud b{font-size:16px}.hud>div{font-size:10px}.crew,.weapon{font-size:12px}.crew small,.weapon small{font-size:10px}.ship-toolbar{font-size:12px}.intro-card{padding:12px 15px}.intro-card h2{font-size:27px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
.toolbar-buttons{display:flex;flex-wrap:wrap;justify-content:flex-end;max-width:100%;gap:5px}.mobile-only,.drawer-head{display:none}
@media(max-width:800px){.mobile-only,.drawer-head{display:flex}.command-panel{position:fixed;z-index:8;left:7px;right:7px;bottom:max(7px,env(safe-area-inset-bottom));max-height:min(74dvh,550px);overflow:auto;transform:translateY(calc(100% + 20px));pointer-events:none;transition:transform .18s ease;box-shadow:0 14px 42px #000a}body.commands-open .command-panel{transform:translateY(0);pointer-events:auto;box-shadow:0 0 0 100vmax #0009,0 14px 42px #000a}.drawer-head{align-items:center;justify-content:space-between;color:var(--lime);margin-bottom:6px}.ship-toolbar{flex-wrap:wrap}.ship-toolbar #shipStatus{flex:1;min-width:120px}body.playing .skarades-profile-bar{display:none!important}}
@media(prefers-reduced-motion:reduce){.command-panel{transition:none}}

.weapon-icon{width:38px;height:38px;flex:none;background-image:url('assets/ship-infestation/weapons-snes.png');background-repeat:no-repeat;background-size:400% 100%;image-rendering:pixelated}

.portrait,.portrait.pet{background-size:300% 100%}

.ship-panel canvas{aspect-ratio:900/512}
.ship-panel{min-width:0}
.ship-map-viewport{width:100%;max-width:100%;min-width:0;overflow:auto;overscroll-behavior:contain;border:1px solid #375f72;border-radius:10px;background:#06111b;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.ship-map-viewport canvas{border:0;border-radius:0;touch-action:none;user-select:none}
.ship-map-viewport{height:min(54dvh,512px)}
.map-zoom-controls{display:flex;align-items:center;gap:3px;white-space:nowrap}
.map-zoom-controls output{min-width:4ch;text-align:center;font-size:17px;color:var(--cyan)}
.map-zoom-controls .small-button{min-width:40px;min-height:40px;padding:3px 7px}
@media(max-width:800px){.play-layout{grid-template-columns:minmax(0,1fr)}}
@media(max-width:900px){.ship-map-viewport{height:min(54dvh,420px)}.ship-map-viewport canvas{width:900px;max-width:none;height:512px}}
.intro-card .orientation-tip{display:none;font-size:13px!important;line-height:1.2!important;color:var(--lime)}
.intro-art{display:flex;justify-content:center;align-items:center;height:110px;margin:0 auto -8px}
.intro-figure{display:block;width:100px;height:100px;flex:none;background-repeat:no-repeat;image-rendering:pixelated}
.intro-figure.captain,.intro-figure.medic{background-image:url('assets/ship-infestation/crew-snes.png');background-size:300% 100%}
.intro-figure.captain{background-position:0% center}
.intro-figure.medic{background-position:100% center}
.intro-figure.alien{background-image:url('assets/ship-infestation/aliens-snes.png');background-size:400% 100%;background-position:66.667% center}
@media(max-width:650px) and (orientation:portrait){.intro-card .orientation-tip{display:block}}
@media(orientation:landscape) and (max-height:500px){
  html,body{height:100%;overflow:hidden}
  body .skarades-profile-bar{display:none!important}
  .shell{width:100%;max-width:none;height:100dvh;margin:0;padding:4px max(4px,env(safe-area-inset-right)) 4px max(4px,env(safe-area-inset-left));display:grid;grid-template-columns:minmax(0,1fr) clamp(200px,29vw,280px);grid-template-rows:32px 43px minmax(0,1fr);gap:4px}
  .play-layout{display:contents}
  .ship-panel{grid-column:1;grid-row:1/4;min-width:0;min-height:0;display:flex;flex-direction:column;justify-content:center;overflow:hidden;padding:4px}
  .ship-toolbar{min-height:30px;padding:0 3px;font-size:11px;flex-wrap:nowrap}
  .ship-toolbar #shipStatus{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ship-map-viewport{height:auto;min-height:0;flex:1}
  .ship-map-viewport canvas{width:900px;height:512px;max-width:none;align-self:auto;flex:none}
  .system-strip{width:100%;grid-template-columns:repeat(6,minmax(0,1fr));gap:2px;margin-top:3px}
  .system-strip>div{font-size:8px;padding:2px 1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .system-strip b{display:inline;margin-left:2px}
  .topbar{grid-column:2;grid-row:1;min-width:0;min-height:0;gap:3px}
  .topbar h1{font-size:16px;letter-spacing:.04em;white-space:nowrap}
  .topbar small{display:none}
  .topbar .back,.topbar .small-button{padding:5px 6px;min-width:29px;font-size:11px}
  .hud{grid-column:2;grid-row:2;min-width:0;min-height:0;gap:2px;margin:0}
  .hud>div{padding:3px 1px;font-size:8px;letter-spacing:0}
  .hud b{font-size:15px}
  .command-panel{grid-column:2;grid-row:3;position:static;left:auto;right:auto;bottom:auto;min-width:0;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto;transform:none;pointer-events:auto;padding:5px;transition:none}
  body.commands-open .command-panel{transform:none;box-shadow:0 12px 38px #0007}
  .mobile-only,.drawer-head{display:none}
  .command-panel h2{font-size:12px;margin:2px 0 4px}
  .crew-list{grid-template-columns:1fr;gap:3px}
  .weapon-list{grid-template-columns:1fr;gap:3px}
  .crew,.weapon{min-width:0;min-height:32px;padding:3px;font-size:10px;gap:3px}
  .portrait,.weapon-icon{width:26px;height:26px}
  .crew small,.weapon small{font-size:8px}
  .hint{display:none}
  .actions{margin:6px 0;gap:3px}
  .actions button{min-height:30px;padding:3px;font-size:10px}
  .actions #jumpBtn{font-size:14px}
  .event-log{height:60px;font-size:10px;padding:4px}
  .overlay{padding:4px}
  .intro-card{width:min(100%,700px);max-height:calc(100dvh - 8px);padding:7px 12px}
  .intro-art{height:58px;margin:0 auto -4px}
  .intro-figure{width:60px;height:58px}
  .intro-card h2{font-size:22px;margin:0}
  .intro-card p{font-size:12px!important;line-height:1.2!important;margin:3px 0}
  .intro-card ul{display:grid;grid-template-columns:1fr 1fr;gap:0 12px;font-size:10px;line-height:1.2;margin:4px 0}
  .intro-card button{padding:6px;margin:3px auto;font-size:13px}
  .exit-link{margin:2px;font-size:11px}
}

/* Larger menu and display text; the ship map keeps its own scrolling size. */
.topbar small{font-size:20px}
.back,.small-button{font-size:20px}
.hud>div{font-size:24px;letter-spacing:0}
.hud b{font-size:28px}
.ship-toolbar{font-size:24px;line-height:1.2}
.system-strip>div{font-size:24px;line-height:1.2}
.system-strip b{font-size:24px}
.command-panel h2{font-size:26px}
.crew,.weapon{min-height:70px;font-size:22px}
.portrait,.weapon-icon{width:48px;height:48px}
.crew span:last-child,.weapon span:last-child{min-width:0;flex-direction:column;align-items:flex-start;gap:1px}
.crew small,.weapon small{font-size:21px;line-height:1.2}
.command-panel .hint{font-size:22px!important;line-height:1.25}
.actions button{font-size:22px;min-height:56px}
.event-log{height:150px;font-size:20px}
.drawer-head{font-size:22px}
.intro-card{width:min(100%,720px)}
.intro-card p{font-size:20px!important;line-height:1.3!important}
.intro-card ul{font-size:20px;line-height:1.3}
.intro-card .orientation-tip{font-size:20px!important}
.intro-card button,.exit-link{font-size:20px}
.turn-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,auto);gap:3px 14px;margin:8px 0;padding:10px 14px;background:#142738;border:2px solid var(--lime);border-radius:12px;font-size:21px;line-height:1.2}
.turn-panel strong{font-size:24px;color:var(--lime)}
.turn-panel span{min-width:0;overflow-wrap:anywhere}
.turn-panel #selectedCrewText{color:var(--cyan)}
.turn-panel button{grid-column:2;grid-row:1/4;font-size:21px;min-height:52px;align-self:center;white-space:normal}
@media(max-width:800px){
  .hud{grid-template-columns:repeat(2,minmax(0,1fr))}
  .crew-list,.weapon-list{grid-template-columns:1fr}
  .turn-panel{grid-template-columns:1fr;font-size:20px}
  .turn-panel button{grid-column:1;grid-row:auto}
}
@media(orientation:landscape) and (max-height:500px){
  .shell{grid-template-columns:minmax(0,1fr) minmax(260px,38vw);grid-template-rows:32px 94px auto minmax(0,1fr)}
  .ship-panel{grid-row:1/5}
  .turn-panel{grid-column:2;grid-row:3;margin:0;padding:5px;gap:3px;font-size:20px;line-height:1.1}
  .turn-panel strong{font-size:20px}
  .turn-panel button{font-size:20px;min-height:44px;padding:5px;line-height:1.1}
  .command-panel{grid-row:4}
  .topbar .back,.topbar .small-button{font-size:17px}
  .hud{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}
  .hud>div{font-size:20px;padding:1px;line-height:1}
  .hud b{font-size:22px}
  .ship-toolbar{min-height:58px;flex-wrap:wrap;align-content:center;font-size:20px}
  .ship-toolbar #shipStatus{flex-basis:100%;min-width:0}
  .toolbar-buttons{margin-left:auto}
  .ship-toolbar .small-button{font-size:18px;padding:4px 8px}
  .system-strip{display:flex;flex:none;gap:3px;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap}
  .system-strip>div{flex:0 0 132px;font-size:20px;padding:3px}
  .system-strip b{font-size:20px}
  .command-panel h2{font-size:25px}
  .crew,.weapon{min-height:70px;font-size:22px}
  .crew small,.weapon small{font-size:20px}
  .actions button{font-size:20px}
  .event-log{font-size:20px;height:130px}
  .intro-card p{font-size:18px!important}
  .intro-card ul{font-size:18px;line-height:1.2}
  .intro-card button,.exit-link{font-size:18px}
}
/* Reserve room for crew controls on short landscape phones without shrinking text. */
@media(orientation:landscape) and (max-height:400px){
  .shell{grid-template-rows:32px 60px auto minmax(0,1fr)}
  .hud>div{display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}
  .hud b{display:inline}
  .turn-panel{grid-template-columns:minmax(0,1fr) auto;gap:3px 6px}
  .turn-panel #phaseText{grid-column:1;grid-row:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .turn-panel #crewReadyText{grid-column:2;grid-row:1;white-space:nowrap}
  .turn-panel #selectedCrewText{grid-column:1/-1;grid-row:2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .turn-panel button{grid-column:1/-1;grid-row:3}
}

/* Keep values inline and put crew information into two readable rows. */
.hud>div{display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.hud b{display:inline}
.ship-status{margin:6px 0;color:var(--lime);font-size:20px;font-weight:700;line-height:1.2;white-space:normal;overflow-wrap:anywhere}
.crew span.crew-info{display:flex;flex-direction:column;align-items:stretch;gap:1px;min-width:0}
.crew-name-row,.crew-detail-row{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;min-width:0}
.crew-name-row b,.crew-room{min-width:0;overflow-wrap:anywhere}
.crew-hp,.crew-budget{flex:none;white-space:nowrap}
.crew-budget{color:var(--lime)!important;font-weight:800}
.crew-controls{display:flex;align-items:center;gap:5px;margin-bottom:4px}
.crew-controls h2{flex:1;min-width:0;margin-bottom:0}
.crew-controls .undo-move{flex:none;min-height:44px;padding:4px 7px;font-size:16px;white-space:nowrap}
.crew-controls .undo-move[hidden]{display:none}
.crew-list{max-height:clamp(180px,52dvh,390px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}

/* Outline the artwork itself, leaving the ship and list backgrounds visible. */
.ship-map-viewport canvas,.portrait,.weapon-icon{image-rendering:auto}
.crew,.weapon,.crew.selected,.weapon.selected{border:0;border-radius:0;background:transparent;box-shadow:none}
.portrait{filter:drop-shadow(1px 0 0 #ffe36a) drop-shadow(-1px 0 0 #ffe36a) drop-shadow(0 1px 0 #ffe36a) drop-shadow(0 -1px 0 #ffe36a)}
.weapon-icon{filter:drop-shadow(1px 0 0 #ff6878) drop-shadow(-1px 0 0 #ff6878) drop-shadow(0 1px 0 #ff6878) drop-shadow(0 -1px 0 #ff6878)}
.weapon-icon{--weapon-size:48px;--weapon-span:484;--weapon-x:298;--weapon-y:386.5;width:var(--weapon-size);height:var(--weapon-size);background-size:calc(var(--weapon-size) * 2172 / var(--weapon-span)) calc(var(--weapon-size) * 724 / var(--weapon-span));background-position:calc(var(--weapon-size) * (0.5 - var(--weapon-x) / var(--weapon-span))) calc(var(--weapon-size) * (0.5 - var(--weapon-y) / var(--weapon-span)))!important}
.weapon:nth-child(2) .weapon-icon{--weapon-span:412;--weapon-x:819;--weapon-y:375}
.weapon:nth-child(3) .weapon-icon{--weapon-span:383;--weapon-x:1348;--weapon-y:360.5}
.weapon:nth-child(4) .weapon-icon{--weapon-span:495;--weapon-x:1878.5;--weapon-y:378.5}
@media(orientation:landscape){.weapon-icon{--weapon-size:40px}}
.crew.selected b{color:#ffe36a}
.weapon.selected b{color:#ff6878}
.crew:focus-visible,.weapon:focus-visible{outline:2px solid var(--cyan);outline-offset:-2px}

/* The same landscape arrangement covers phones, tablets, and desktop windows. */
@media(orientation:landscape){
  html,body{height:100%;overflow:hidden}
  body .skarades-profile-bar{display:none!important}
  .shell{width:100%;max-width:none;height:100dvh;margin:0;padding:4px max(4px,env(safe-area-inset-right)) 4px max(4px,env(safe-area-inset-left));display:grid;grid-template-columns:minmax(0,1fr) clamp(260px,36vw,440px);grid-template-rows:44px auto auto minmax(0,1fr);gap:4px}
  .play-layout{display:contents}
  .topbar{grid-column:1;grid-row:1;min-width:0;min-height:0;gap:6px}
  .topbar h1{font-size:20px;letter-spacing:.04em;white-space:nowrap}
  .topbar small{display:none}
  .topbar .back,.topbar .small-button{min-height:40px;min-width:40px;padding:4px 7px;font-size:17px}
  .hud{grid-column:2;grid-row:1;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));min-width:0;min-height:0;gap:2px;margin:0}
  .hud>div{display:flex;align-items:center;justify-content:center;gap:5px;padding:1px;font-size:20px;line-height:1;letter-spacing:0;white-space:nowrap}
  .hud b{display:inline;font-size:22px}
  .ship-status{grid-column:1/-1;grid-row:2;margin:0;padding:2px 4px;min-height:0;max-height:3.95em;overflow:auto;white-space:normal;text-overflow:clip;font-size:20px;line-height:1.25}
  .turn-panel{grid-column:2;grid-row:3;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;margin:0;padding:3px 5px;gap:0 5px;border-width:1px;min-width:0;font-size:20px;line-height:1.1}
  .turn-panel #phaseText{grid-column:1;grid-row:1;font-size:20px;white-space:normal;overflow:visible;text-overflow:clip}
  .turn-panel #crewReadyText{grid-column:1;grid-row:2;white-space:nowrap}
  .turn-panel #selectedCrewText{display:none}
  .turn-panel button{grid-column:2;grid-row:1/3;min-height:44px;min-width:102px;align-self:center;padding:4px 6px;font-size:20px;line-height:1.1;white-space:nowrap}
  .ship-panel{grid-column:1;grid-row:3/5;position:relative;display:flex;flex-direction:column;justify-content:flex-start;min-width:0;min-height:0;overflow:hidden;padding:4px}
  .ship-toolbar{position:absolute;z-index:2;top:8px;right:10px;min-height:0;padding:3px;border-radius:10px;background:#071423e8;flex-wrap:nowrap;font-size:20px}
  .toolbar-buttons{margin:0;gap:4px;flex-wrap:nowrap}
  .ship-toolbar .small-button{min-height:40px;padding:3px 7px;font-size:18px}
  .ship-map-viewport{height:auto;min-height:0;flex:1}
  .ship-map-viewport canvas{width:900px;height:512px;max-width:none;flex:none}
  .system-strip{display:flex;flex:none;gap:3px;margin-top:3px;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap}
  .system-strip>div{flex:0 0 auto;padding:3px 7px;font-size:20px;line-height:1.2}
  .system-strip b{display:inline;margin-left:4px;font-size:20px}
  .command-panel{grid-column:2;grid-row:4;position:static;min-width:0;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto;transform:none;pointer-events:auto;padding:4px;transition:none}
  body.commands-open .command-panel{transform:none;box-shadow:0 12px 38px #0007}
  .mobile-only,.drawer-head{display:none}
  .command-panel h2{font-size:20px;letter-spacing:0;margin:0 0 4px;line-height:1.2}
  .crew-list,.weapon-list{grid-template-columns:1fr;gap:3px}
  .crew,.weapon{min-width:0;min-height:58px;padding:3px 5px;gap:6px;font-size:22px}
  .portrait,.weapon-icon{width:40px;height:40px}
  .crew small,.weapon small{font-size:20px;line-height:1.2}
  .hint{display:none}
  .actions{margin:6px 0;gap:3px}
  .actions button{min-height:44px;padding:4px;font-size:20px}
  .event-log{height:130px;padding:4px;font-size:20px}
}

/* Six-slot team selection, with a scrolling roster and a visible launch button. */
.intro-card.choosing{width:min(1100px,100%);height:min(760px,96dvh);display:flex;flex-direction:column;overflow:hidden;padding:12px 16px}
.choosing .intro-art,.choosing .orientation-tip{display:none}
.choosing h2{font-size:26px;margin:0}
.choosing #overlayText{font-size:18px!important;margin:4px 0;flex:none}
.team-setup{display:flex;flex-direction:column;flex:1;min-height:0;text-align:left}
.team-setup[hidden]{display:none}
.team-picker-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none}
.team-picker-bar strong{color:var(--lime);font-size:20px}
.intro-card .team-picker-bar button{width:auto;margin:4px 0;padding:8px 12px;font-size:18px;min-height:44px}
.team-tip{color:var(--muted);font-size:16px!important;line-height:1.2!important;margin:3px 0 7px;min-height:1.2em;flex:none}
.team-roster{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;overflow-y:auto;min-height:0;align-content:start;padding:3px;overscroll-behavior:contain}
.intro-card button.team-card{display:flex;align-items:center;gap:8px;width:100%;min-height:90px;margin:0;padding:7px;border:1px solid #435c6b;border-radius:6px;background:#152737;color:var(--text);text-align:left;font-size:17px}
.team-card.chosen{border-color:var(--lime)!important;background:#304733!important;box-shadow:inset 0 0 0 1px var(--lime)}
.team-card:focus-visible{outline:2px solid var(--cyan);outline-offset:-3px}
.team-card .portrait{width:40px;height:48px;flex:none}
.team-card>span:last-child{display:flex;flex-direction:column;min-width:0;gap:3px}
.team-card small{font-size:14px;line-height:1.15;color:var(--muted)}
.team-card.chosen b{color:var(--lime)}
.choosing #overlayButton{flex:none;min-height:44px;margin:8px 0 2px;padding:9px;font-size:19px}
.choosing .exit-link{font-size:16px;margin:3px;flex:none}
@media(max-width:700px){.team-roster{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(orientation:landscape) and (max-height:500px){
  .intro-card.choosing{height:98dvh;padding:5px 10px}
  .choosing h2{font-size:20px}
  .choosing #overlayText{font-size:16px!important;margin:2px 0}
  .team-roster{grid-template-columns:repeat(4,minmax(0,1fr))}
  .intro-card button.team-card{min-height:84px;font-size:15px;gap:4px;padding:4px}
  .team-card small{font-size:13px}
  .team-card .portrait{width:32px;height:42px}
  .team-tip{font-size:14px!important}
  .choosing #overlayButton{margin-top:4px;padding:4px}
  .choosing .exit-link{margin:1px;font-size:14px}
}
