/* Afterlight's visual menus. Live labels sit beside local, static illustrations. */
@font-face { font-family:'Afterlight Display'; src:url('assets/ui/afterlight-display.woff2') format('woff2'); font-weight:700 900; font-display:swap; }
.panelhead h2,.shiphero h3,.choiceheading .ovtitle,.choicecopy h3,.effect,.primaryequip,#btnReroll { font-family:'Afterlight Display',system-ui,sans-serif; font-weight:700; }
.choiceheading .ovtitle,.choicecopy h3 { -webkit-text-stroke:.15px currentColor; }
:root { --muted:#b5cbd8; --panel:#091b28; }
.glyph { display:inline-flex; width:24px; height:24px; flex:none; vertical-align:middle; }
.glyph svg { width:100%; height:100%; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.art { display:block; aspect-ratio:1; flex:none; background-color:#071522; background-position:var(--art-x) var(--art-y); background-repeat:no-repeat; }
.art-weapons { background-image:url('assets/ui/weapons.webp'); background-size:400% 200%; }
.art-ships { background-image:var(--ships-art,url('assets/ui/ships.webp')); background-size:300% 100%; }
.art-modules { background-image:url('assets/ui/modules.webp'); background-size:300% 300%; }
.art-encounters { background-image:url('assets/ui/encounters.webp'); background-size:400% 300%; mask-image:linear-gradient(transparent,#000 5%,#000 94%,transparent); }
.shipart { display:block; width:100%; height:100%; object-fit:cover; }
.bigbtn,.midbtn { font-size:18px; letter-spacing:.025em; min-height:54px; border-radius:9px; }
.iconbtn { color:#c3deeb; width:46px; height:46px; font-size:26px; border-color:#345c70; background:#071722; }
.iconbtn .glyph { width:26px; height:26px; }
.panelnote,.flightlesson p { font-size:17px; line-height:1.55; }
.flightlesson b { font-size:21px; }
.eyebrow { font:16px/1.4 system-ui,sans-serif; letter-spacing:.04em; }
#saveWarning { font-size:16px; }
.setrow { font-size:16px; letter-spacing:0; }
.setrow select { font-size:16px; }
.sheetpanel { padding:22px; gap:20px; border-color:#284a5d; background:#081a27; }
.sheetpanel .ovtitle { font-size:30px; }
.panelhead { min-height:48px; flex:none; }
.panelhead h2 { font-size:44px; line-height:1.1; margin:0; color:#f0f7fa; letter-spacing:-.03em; }
.panelhead .iconbtn { font-size:28px; }
.panelhead h2:first-child { margin-right:auto; }
.paneltabs { gap:4px; flex:none; }
#hangarSheet .paneltabs { margin-top:-12px; }
.paneltabs button { flex:1; font-size:19px; min-height:48px; font-weight:600; padding:8px 4px; border-bottom-width:3px; }
.paneltabs [aria-pressed=true] { text-shadow:0 0 15px #59f7ff30; }
.visualsheet { padding:16px; }
.visualsheet .sheetpanel { width:min(100%,470px); height:min(94dvh,920px); max-height:none; border-radius:15px; padding:20px; gap:14px; overflow:hidden; background:radial-gradient(ellipse at 30% 35%,#0e2939,#06131f 65%); }
.visualsheet .catalog { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#2c6477 transparent; }
#hangarSheet .sheetpanel { padding-bottom:30px; }
.hangarlaunch { display:flex; gap:10px; flex:none; }
.hangarlaunch .midbtn { width:auto; padding-inline:18px; }
.hangarlaunch .bigbtn { flex:1; width:auto; padding-inline:12px; }
.wallet { padding:0; margin-left:auto; border:0; gap:6px; color:var(--gold); }
.wallet b { font:800 28px/1 system-ui,sans-serif; font-variant-numeric:tabular-nums; }
.wallet .glyph { width:27px; height:31px; }
/* One ship at a time; the selector remains visible underneath it. */
#hangarContent.shipcatalog { display:flex; flex-direction:column; gap:12px; flex:1; overflow-y:auto; }
.shiphero { position:relative; flex:1; min-height:210px; overflow:hidden; }
.shiphero .shipart { position:absolute; inset:0; object-position:center 48%; mask-image:linear-gradient(#000 80%,transparent); }
.shiphero h3 { position:absolute; bottom:0; left:0; right:0; text-align:center; font-size:32px; line-height:1.15; font-weight:850; text-transform:uppercase; text-shadow:0 2px 10px #000; letter-spacing:.01em; }
.landing-bay { position:absolute; inset:0; overflow:hidden; mask-image:linear-gradient(#000 80%,transparent); }
.landing-pad { width:100%; height:100%; object-fit:cover; object-position:center 48%; }
.docked-ship { position:absolute; width:90%; aspect-ratio:1; left:5%; top:50%; margin-top:-45%; background:var(--docked-art,url('assets/ui/docked-ships.webp')) var(--ship-x) center/300% 100% no-repeat; }
.landing-shadow { position:absolute; left:19%; top:54%; width:62%; height:25%; opacity:.65; border-radius:50%; background:radial-gradient(ellipse,#000c,transparent 70%); }
.landing-dust { position:absolute; left:9%; top:48%; width:82%; height:32%; border-radius:50%; opacity:0; pointer-events:none; filter:blur(3px); background:radial-gradient(ellipse at 35% 55%,#d8c6a34d,transparent 40%),radial-gradient(ellipse at 65% 55%,#d8c6a34d,transparent 40%),radial-gradient(ellipse,transparent 40%,#b7c6cb55 52%,transparent 66%); }
.shipstats { display:flex; justify-content:space-around; flex:none; padding:6px 0 12px; border-bottom:1px solid #2a4a5a; }
.shipstats>div { display:grid; grid-template-columns:38px auto; column-gap:8px; align-items:center; }
.shipstats>div+div { padding-left:12px; border-left:1px solid #2a4a5a; }
.shipstats .glyph { grid-row:1/3; width:38px; height:42px; color:var(--cyan); filter:drop-shadow(0 0 7px #59f7ff60); }
.shipstats b { font-size:26px; font-weight:800; line-height:1.1; }
.shipstats span:not(.glyph) { font-size:16px; color:var(--muted); }
.shipstats em, .detailstats em { font-style:normal; font-size:14px; font-weight:700; color:var(--green); margin-left:5px; white-space:nowrap; }
.catalogship { grid-column:1/-1; font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:.06em; color:var(--muted); }
.catalogship b { color:var(--text); }
.shipselectors { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; flex:none; }
.shipselectors button { min-width:0; overflow:hidden; background:#071824; border:1px solid #31566b; border-radius:10px; padding:0 0 8px; color:#d0e4f0; }
.shipthumbwindow { display:flex; justify-content:center; align-items:center; height:78px; overflow:hidden; }
.shipthumbwindow .art { height:100%; width:auto; }
.shipselectors button[aria-pressed=true] { border:2px solid var(--item); box-shadow:0 0 17px #59f7ff60,inset 0 0 18px #59f7ff20; }
.shipselectors button>span { font-size:16px; font-weight:650; display:flex; align-items:center; justify-content:center; gap:3px; min-height:22px; }
.shipselectors .glyph { width:17px; height:18px; }
.shipactions { display:flex; gap:10px; align-items:stretch; flex:none; }
.shipactions .iconbtn { width:54px; height:54px; align-self:center; }
.equipbtn { display:flex; align-items:center; justify-content:center; gap:6px; min-height:48px; font-size:17px; font-weight:750; line-height:1.2; letter-spacing:.015em; border:1px solid #3a6c82; background:#102d3e; color:#d9f4ff; border-radius:7px; }
.equipbtn:disabled { opacity:1; color:#a2bac9; background:#091c29; border-color:#244454; }
.equipbtn .glyph { width:22px; height:22px; color:var(--gold); }
.primaryequip { flex:1; margin:0; min-height:54px; font-size:20px; color:var(--cyan); border-color:var(--cyan); background:linear-gradient(0deg,#0c3546,#09212f); box-shadow:inset 0 -8px 24px #59f7ff08; }
.primaryequip:disabled { color:var(--cyan); border:2px solid var(--cyan); background:linear-gradient(#0a2634,#0c3444); box-shadow:0 0 18px #59f7ff70,inset 0 0 18px #59f7ff25; }
.primaryequip .glyph { width:29px; height:29px; color:inherit; }
/* Equipment and archive are galleries. Inspect is separate from purchase/equip. */
#hangarContent.tilecatalog { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:max-content; gap:12px; flex:1; align-content:start; }
.equipment.artitem { display:flex; padding:0; gap:0; background:#09202e; border:1px solid #315268; border-radius:10px; overflow:hidden; }
.artitem.selected { border-color:var(--item); }
.iteminspect { display:flex; flex:1; flex-direction:column; align-items:stretch; position:relative; border:0; padding:0 0 12px; text-align:left; background:transparent; color:var(--text); }
.iteminspect>.art { width:100%; }
.iteminspect>.art-modules { mask-image:linear-gradient(#000 83%,transparent 91%); }
.iteminspect h3 { font-size:21px; line-height:1.12; padding:10px 10px 0; min-height:58px; }
.iteminspect>.effect { margin:8px 10px 0; color:var(--item); font-size:16px; line-height:1.2; }
.iteminspect>.effect strong { font-size:23px; }
.iteminspect>.effectextra { margin:3px 10px 0; font:400 14px/1.3 system-ui,sans-serif; color:var(--muted); }
.iteminspect>.raritylabel { margin:8px 10px 0; font-size:13px; }
.iteminspect>.rankpips { margin:12px 10px 0; }
.iteminfo { position:absolute; top:7px; right:7px; padding:4px; border-radius:50%; background:#06131dcc; color:#c6e1ef; }
.iteminfo .glyph { width:21px; height:21px; }
.artitem>.equipbtn { border-radius:0; border-width:1px 0 0; min-height:48px; font-size:16px; }
.artitem.selected>.equipbtn { color:var(--item); background:#0d2a36; }
.artitem.selected>.equipbtn .glyph { color:inherit; }
/* Large artwork and a numerical benefit are the upgrade choice. */
#cards { background:linear-gradient(#04111b25,#04111b66 35%,#04111be8 85%),url('assets/ui/atmosphere.webp') center top/cover,#04111b; padding:68px 16px 20px; gap:18px; justify-content:flex-start; }
.choiceheading { display:flex; width:100%; max-width:430px; align-items:center; justify-content:space-between; gap:8px; }
.choiceheading .ovtitle { width:100%; font-size:clamp(25px,8.8vw,37px); letter-spacing:-.035em; font-weight:900; text-align:center; color:#f0f8fd; }
.choiceheading .iconbtn { position:absolute; top:max(14px,env(safe-area-inset-top)); right:max(14px,env(safe-area-inset-right)); width:44px; height:44px; font-size:22px; }
#cardrow { display:flex; flex-direction:column; gap:12px; width:100%; max-width:430px; flex:none; }
.card { display:grid; grid-template-columns:41% minmax(0,1fr); grid-template-rows:minmax(0,1fr); width:100%; height:clamp(164px,22dvh,200px); min-height:0; gap:0; padding:0; border:1.5px solid var(--cc); border-radius:11px; overflow:hidden; background:linear-gradient(110deg,#0a2534,#071b29); position:relative; box-shadow:inset 0 0 20px #102e3a; }
.choiceart { position:relative; display:grid; place-items:center; height:100%; overflow:hidden; background:linear-gradient(#04111b20,#04111b60),url('assets/ui/atmosphere.webp') 25% 20%/300% auto; mask-image:linear-gradient(90deg,#000 90%,transparent); }
.choiceart>.art { width:100%; transform:scale(1.2); mix-blend-mode:lighten; }
.card:hover { background:linear-gradient(110deg,#0a2534,#071b29); }
@media(hover:hover) { .card:hover { background:#103044; } }
.card .choicecopy { display:flex; flex-direction:column; align-self:center; gap:6px; padding:6px 9px 6px 12px; }
.choicerole { position:absolute; left:8px; top:8px; display:flex; align-items:center; gap:5px; color:#d1edf5; font-size:14px; font-weight:800; line-height:22px; }
.choicerole .glyph { width:20px; height:20px; color:var(--cc); }
.choiceart .rankpips { position:absolute; bottom:37px; left:8px; width:auto; }
.choiceart .choicetag { position:absolute; top:35px; left:8px; font-size:13px; }
.upmetrics { display:flex; flex-direction:column; gap:5px; width:100%; }
.upmetric { display:flex; flex-direction:column; gap:1px; }
.upmetric small { font-size:12px; line-height:1.15; color:#b4d1df; letter-spacing:.035em; overflow-wrap:anywhere; }
.upmetric>span { display:flex; align-items:baseline; gap:7px; font-size:24px; font-weight:800; line-height:1.05; font-variant-numeric:tabular-nums; white-space:nowrap; }
.statbefore { color:#b4c6d1; font-size:.8em; font-weight:600; }
.statarrow { color:#7491a2; font-size:.75em; }
.upmetric strong { color:var(--cc,var(--item,var(--cyan))); font:inherit; }
.optiondetail .upmetrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 16px; }
.optiondetail .upmetric small { font-size:15px; }
.choicecopy h3 { font-size:clamp(20px,5.7vw,25px); line-height:1.1; letter-spacing:-.035em; font-weight:900; align-self:stretch; }
.effect { display:block; font-size:26px; font-weight:850; line-height:1.15; color:var(--cc,var(--item,var(--cyan))); }
.effect strong { font:inherit; font-size:32px; }
.effectextra { font-size:20px; line-height:1.1; color:#c2e1ed; }
.choicetag { color:var(--cc); font-size:17px; font-weight:750; line-height:1; }
.card kbd { display:none; }
.rankpips { display:flex; gap:8px; width:100%; }
.rankpips i { width:16px; height:18px; position:relative; }
.rankpips i::before { content:''; position:absolute; inset:0; background:#274c61; clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%); }
.rankpips .filled::before { background:var(--cc,var(--item,var(--cyan))); opacity:.75; }
.rankpips .offered::before { background:#8fffff; }
.rankpips .offered { filter:drop-shadow(0 0 7px #59f7ff); }
.evolutioncard { border-color:var(--gold); box-shadow:inset 0 0 30px #ffd16615; }
#btnReroll { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; max-width:430px; min-height:63px; flex:none; font-size:21px; color:#d9f6ff; border-color:var(--cyan); background:linear-gradient(#092433,#0b3143); box-shadow:0 0 16px #59f7ff35,inset 0 0 15px #59f7ff15; }
#btnReroll .glyph { width:32px; height:32px; color:var(--cyan); }
#btnReroll:disabled { opacity:1; color:var(--muted); border-color:#274455; }
#btnReroll:disabled .glyph { color:var(--muted); }
/* Brief upgrade feedback: only opacity and transforms move. */
#cards { animation:upgrade-screen-in .22s ease-out both; }
.choiceheading { animation:upgrade-heading-in .28s ease-out both; }
.card { animation:upgrade-card-in .28s cubic-bezier(.2,.75,.2,1) both; }
.card:nth-child(2) { animation-delay:.04s; }
.card:nth-child(3) { animation-delay:.08s; }
.choiceart>.art { animation:upgrade-art-in .38s ease-out both; }
.card::after { content:''; position:absolute; inset:0; pointer-events:none; opacity:0; background:linear-gradient(105deg,transparent 30%,color-mix(in srgb,var(--cc) 30%,transparent) 47%,#ffffff55 50%,transparent 65%); transform:translateX(-110%); }
#cards.choosing { animation:upgrade-screen-out .22s ease-in both; }
.choosing .card { animation:upgrade-card-away .18s ease-out both; animation-delay:0s; }
.choosing .card:disabled { opacity:1; }
.choosing .card.picked { animation:upgrade-card-picked .22s ease-out both; z-index:1; }
.choosing .card.picked::after { animation:upgrade-sheen .22s ease-out both; }
@keyframes upgrade-screen-in { from { opacity:0; } to { opacity:1; } }
@keyframes upgrade-heading-in { from { opacity:0; } to { opacity:1; } }
@keyframes upgrade-card-in { from { opacity:0; transform:translateY(12px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes upgrade-art-in { from { transform:translateX(-3px) scale(1.12); } to { transform:translateX(0) scale(1.2); } }
@keyframes upgrade-screen-out { 0%,55% { opacity:1; } 100% { opacity:0; } }
@keyframes upgrade-card-away { to { opacity:.2; transform:scale(.985); } }
@keyframes upgrade-card-picked { 0% { transform:scale(1); } 20% { transform:scale(.984); } 70% { opacity:1; transform:translateY(-2px) scale(1.015); } 100% { opacity:0; transform:translateY(-5px) scale(1.015); } }
@keyframes upgrade-sheen { 0% { opacity:0; transform:translateX(-100%); } 30% { opacity:.8; } 100% { opacity:0; transform:translateX(100%); } }
/* A selected contract shows only the objective, duration and reward. */
#contractList { display:flex; flex:1; flex-direction:column; gap:16px; }
.missionmap { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; flex:none; }
.missionmap button { display:grid; place-items:center; min-height:46px; border:1px solid #335a6e; border-radius:50%; background:#0a2331; font-size:21px; color:#bad4e3; }
.missionmap [aria-pressed=true] { color:var(--cyan); border-color:var(--cyan); background:#0d3544; }
.missionmap .glyph { width:20px; height:20px; }
.missionhero { position:relative; min-height:220px; flex:1; overflow:hidden; border-radius:10px; }
.missionhero>.art { width:100%; position:absolute; top:50%; transform:translateY(-50%); }
.missionname { position:absolute; bottom:0; left:0; right:0; padding:55px 16px 12px; text-align:center; background:linear-gradient(transparent,#061521 65%); }
.missionname h3 { font-size:30px; line-height:1.1; margin-top:6px; }
.missionname>span { font-size:16px; color:var(--muted); }
.missionfacts { display:flex; justify-content:space-between; gap:12px; flex:none; }
.missionfacts>span { display:flex; gap:8px; align-items:center; font-size:20px; }
.missionfacts .glyph { width:27px; height:27px; color:var(--cyan); }
.missionreward { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 0; border-top:1px solid #294c60; flex:none; color:var(--gold); }
.missionreward>span { display:flex; align-items:center; gap:6px; font-size:23px; font-weight:750; }
.missionreward .missionstars { font-size:30px; letter-spacing:.1em; }
#archiveContent { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:max-content; gap:12px; flex:1; align-content:start; }
.archiveitem { padding:0 0 12px; border:1px solid #2b4b5f; border-radius:10px; overflow:hidden; background:#091f2c; color:#e8f5fa; text-align:left; position:relative; }
.archiveitem .art { width:100%; }
.archiveitem h3 { font-size:22px; line-height:1.15; padding:9px 12px 0; }
.archiveitem>span:not(.art):not(.glyph) { display:block; font-size:16px; line-height:1.3; padding:5px 12px 0; color:var(--muted); overflow-wrap:anywhere; -webkit-hyphens:auto; hyphens:auto; }
.archiveitem>.glyph { position:absolute; top:8px; right:8px; padding:2px; border-radius:50%; background:#081522cc; }
/* Extended information preserves stats and fiction without filling every choice. */
.detailpanel { align-items:stretch; max-height:94dvh; width:min(100%,480px); overflow:hidden; }
.detailpanel .panelhead h2 { font-size:27px; }
#detailContent { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 1px; }
#detailContent p { font-size:18px; line-height:1.55; color:#bed7e5; margin:14px 0; }
#detailContent h3 { font-size:23px; line-height:1.2; margin:16px 0 8px; }
#detailContent .detailhero { width:min(100%,300px); height:auto; margin:0 auto; aspect-ratio:1; border-radius:10px; }
.detailstats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 22px; margin:20px 0; }
.detailstats>div { border-bottom:1px solid #2d4b5e; padding-bottom:8px; }
.detailstats dt { font-size:16px; color:var(--muted); overflow-wrap:anywhere; }
.detailstats dd { font-size:26px; font-weight:750; line-height:1.4; }
.recipevisual { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:12px; border-top:1px solid #315266; }
.recipevisual>.art { width:70px; border-radius:6px; }
.recipevisual>span:not(.art) { font-size:25px; color:var(--gold); }
.recipevisual>.glyph { width:35px; height:35px; }
.optiondetail { padding:0 0 20px; margin-bottom:20px; border-bottom:1px solid #315266; }
.optiondetail>.effect { color:var(--item); }
/* A recovery reward is the focal point of the result screen. */
.resultScreen { background:radial-gradient(ellipse at 50% 38%,#123045ee,#04111bf9 65%); gap:16px; justify-content:safe center; }
.resultheading { display:flex; align-items:center; gap:12px; width:min(100%,380px); flex:none; }
.resultheading .ovtitle { flex:1; font-size:clamp(25px,7vw,33px); color:#edf8ff; }
.resultScreen .rewardline { display:flex; align-items:center; flex-direction:column; position:relative; width:min(100%,350px); color:var(--gold); font-family:inherit; }
.salvageart { width:min(100%,280px); aspect-ratio:1; mask-image:linear-gradient(transparent,#000 12%,#000 80%,transparent); }
.rewardline>strong { position:relative; margin-top:-45px; font-size:60px; font-weight:900; line-height:1; text-shadow:0 3px 20px #04111b; }
.rewardline>span:not(.art) { font-size:18px; font-weight:750; margin-top:5px; letter-spacing:.12em; }
.resultScreen .statsgrid { display:grid; grid-template-columns:1fr 1fr; width:min(100%,340px); gap:20px; font-family:inherit; }
.resultScreen .statsgrid b { font-size:34px; font-variant-numeric:tabular-nums; }
.statsgrid span { font-size:16px; }
.resultScreen .best { font-size:16px; min-height:0; flex:none; }
.resultScreen .best:empty,.unlockrow:empty { display:none; }
#contractResult { font-size:28px; color:var(--gold); letter-spacing:.1em; }
.resultScreen .menucol { max-width:380px; }
.resultScreen .menucol button { width:100%; max-width:none; }
.resultScreen .runinfo { position:static; font-size:22px; flex:none; }
.unlockrow { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.shipunlock { display:flex; align-items:center; gap:10px; font-size:18px; }
.shipunlock img { width:54px; height:54px; border-radius:6px; }
.shipunlock b { display:block; font-size:16px; color:var(--gold); }
/* The home menu uses the same equipped ship illustration. */
#startScreen { background:#05121be8; }
.flightdeck { max-width:430px; justify-content:center; }
.stationmark { font:600 16px system-ui,sans-serif; letter-spacing:.06em; }
.wordmark h1,#startScreen h1 { font-size:32px; letter-spacing:.015em; }
.wordmark p { font-size:16px; margin-top:6px; letter-spacing:.35em; }
#homeShipArtwork { width:100%; height:clamp(180px,31dvh,290px); overflow:hidden; mask-image:linear-gradient(transparent,#000 8%,#000 85%,transparent); }
#homeShipArtwork img { object-position:center 45%; }
.shipidentity { margin-top:-12px; position:relative; }
.shipidentity>span { font:16px/1.4 system-ui,sans-serif; letter-spacing:0; }
.shipidentity h2 { font-size:29px; margin:0 0 16px; }
.launchblock .bigbtn { font-size:20px; min-height:56px; }
.launchblock .secondarylaunch { font-size:16px; min-height:44px; }
.launchblock p { font-size:16px; }
.launchblock p:empty { display:none; }
.decknav { margin-top:22px; }
.decknav button { font-size:19px; gap:6px; padding:14px 3px; }
.decknav button>span { width:32px; height:32px; }
.decknav button small { display:flex; align-items:center; justify-content:center; gap:3px; font-size:16px; color:var(--gold); }
.decknav button small .glyph { width:17px; height:17px; }
.deckfoot button { font-size:16px; }
.deckfoot #bestLine { display:none; }
.deckfoot #verTag { font-size:14px; }
#controlsHint { font-size:16px; }
#controlsHint kbd { font-size:14px; }
.touched #controlsHint,.touched .kbd-only { display:none; }
@media(max-width:600px) {
  .choiceheading .ovtitle { text-align:left; }
  .choiceheading .ovtitle span { display:none; }
  .choiceheading .iconbtn { position:static; flex:none; }
  .visualsheet { padding:0; }
  .visualsheet .sheetpanel { width:100%; height:100dvh; max-height:100dvh; border:0; border-radius:0; padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
  .detailpanel { border-radius:14px 14px 0 0; }
  .overlay.resultScreen { padding:24px 18px; }
  .sheetpanel .panelnote { font-size:17px; }
}
@media(max-width:350px) {
  .card { grid-template-columns:43% minmax(0,1fr); }
  .choiceheading .ovtitle span { display:none; }
  .panelhead h2 { font-size:30px; }
  .wallet b { font-size:22px; }
  .wallet .glyph { width:21px; }
  .wallet { gap:4px; }
  .panelhead { gap:8px; }
  .paneltabs button { font-size:18px; }
  .shipstats>div { column-gap:5px; grid-template-columns:23px auto; }
  .shipstats>div+div { padding-left:7px; }
  .shipstats .glyph { width:23px; }
  .shipstats b { font-size:24px; }
  .shipselectors { gap:6px; }
  .shipselectors button>span { font-size:16px; }
  .shipselectors .glyph { width:14px; }
  .primaryequip { font-size:17px; }
  .missionmap { gap:4px; }
  .missionmap button { min-height:44px; }
  .missionfacts>span { font-size:18px; }
  .iteminspect h3 { font-size:20px; }
  .iteminspect>.effect { margin-left:8px; margin-right:8px; }
  .archiveitem h3 { font-size:20px; }
  .setrow { gap:10px; }
}
@media(hover:none) { button:hover:not(:disabled) { filter:none; } }
@media(max-height:730px) {
  #hangarSheet .sheetpanel { padding-bottom:14px; }
  #hangarSheet .paneltabs { margin-top:0; }
  .visualsheet .sheetpanel { gap:10px; }
  .shiphero { min-height:145px; }
  .shiphero h3 { font-size:28px; }
  .shipthumbwindow { height:60px; }
  #hangarContent.shipcatalog { gap:8px; }
  .shipstats { padding-bottom:8px; }
  #cards { gap:10px; padding:12px 14px; justify-content:center; }
  .choiceheading .iconbtn { position:static; }
  .choiceheading .ovtitle { font-size:26px; text-align:left; }
  .card { height:calc((100dvh - 180px) / 3); }
  #cardrow { gap:10px; }
  .card .choicecopy { gap:2px; padding:2px 6px; }
  .choicecopy h3 { font-size:19px; }
  .choicerole { left:5px; top:4px; font-size:13px; gap:3px; }
  .upmetrics { gap:3px; }
  .card .upmetric small { font-size:11px; letter-spacing:0; }
  .card .upmetric>span { font-size:21px; gap:5px; }
  .effect { font-size:18px; }
  .effect strong { font-size:24px; }
  .effectextra { font-size:18px; }
  .rankpips { gap:6px; }
  .rankpips i { width:13px; height:15px; }
  .choicetag { font-size:16px; }
  #btnReroll { min-height:48px; font-size:19px; }
  #contractList { gap:10px; }
  .missionhero { min-height:150px; }
  .missionname h3 { font-size:27px; }
  .missionreward { padding:5px 0; }
  .resultScreen { justify-content:safe center!important; gap:10px; }
  .salvageart { width:180px; }
  .rewardline>strong { font-size:46px; margin-top:-25px; }
  .resultScreen .statsgrid b { font-size:29px; }
  .resultScreen .menucol { gap:8px; }
  .resultScreen .menucol button { min-height:48px; padding:10px 12px; }
  #homeShipArtwork { height:160px; }
  .shipidentity h2 { font-size:26px; margin-bottom:12px; }
  .deckhead { margin-bottom:8px; }
  .decknav { margin-top:14px; }
  .decknav button { padding:9px 3px; font-size:17px; }
  .decknav button>span { width:26px; height:26px; }
}
@media(max-height:590px) {
  #homeShipArtwork { height:110px; }
  #startScreen .wordmark h1 { font-size:27px; }
  .wordmark p { font-size:14px; margin-top:4px; }
  .shipidentity>span { font-size:16px; }
  .shipidentity { margin-bottom:0; }
  .launchblock .bigbtn { min-height:48px; font-size:18px; }
  .decknav button { font-size:16px; }
  .deckfoot { padding:0; }
  .visualsheet .sheetpanel { padding-top:10px; padding-bottom:10px; }
  .shiphero { min-height:115px; }
  .shipthumbwindow { height:47px; }
  .shipstats { padding-top:0; }
  .missionhero { min-height:125px; }
  .choiceheading .ovtitle { font-size:24px; }
}

/* Rarity is a word and a diamond count as well as a colour. */
.raritylabel { display:block; color:#aac4ce; font-size:14px; line-height:1.25; letter-spacing:.06em; font-weight:800; }
.raritylabel[data-rarity="1"] { color:#79b7ff; }
.raritylabel[data-rarity="2"] { color:#e0a0ff; }
.choiceart .raritylabel { position:absolute; bottom:8px; left:8px; right:0; padding:5px 0; text-align:center; background:#04121bd9; border-radius:4px; }
.card[data-rarity="1"],.card[data-rarity="2"] { border-color:var(--rarity); box-shadow:inset 0 0 28px color-mix(in srgb,var(--rarity) 14%,transparent); }
.card[data-rarity="2"] .choiceart::after { content:""; position:absolute; inset:7% 5%; border:1px solid #e0a0ff66; transform:rotate(-8deg); border-radius:20%; pointer-events:none; }
@media(max-height:730px) { .choiceart .raritylabel { bottom:4px; left:4px; font-size:13px; padding:3px 0; } }

.trialbtn, .adbtn { color:#9fcaff; border-color:#517ca8; background:#163247; min-height:44px; }
/* The optional bonus shares a compact HANGAR row so FLY AGAIN and HANGAR keep their place on small phones;
   HANGAR keeps its label's width so the bonus amount fits in every language. */
.resultrow { display:flex; gap:8px; width:100%; }
.resultScreen .resultrow>button { flex:1 1 0; min-width:0; }
.resultScreen .menucol .resultrow:has(.adbtn:not(.hidden))>button { min-height:44px; padding:8px; font-size:16px; white-space:nowrap; }
.resultScreen .menucol .resultrow:has(.adbtn:not(.hidden))>:not(.adbtn) { flex:none; width:auto; padding-inline:16px; }
/* SHARE sits beside HANGAR; when the bonus takes that seat, SHARE drops to a row of its own. */
.resultrow:has(.adbtn:not(.hidden)) { flex-wrap:wrap; }
.resultScreen .menucol .resultrow:has(.adbtn:not(.hidden))>[id$=Share] { order:1; flex:1 1 100%; }
.deckfoot .supplybtn { flex:none; margin-left:auto; padding:0 14px; min-height:40px; color:#9fcaff; background:#163247; border:1px solid #517ca8; border-radius:999px; font:800 15px system-ui,sans-serif; }
.rewardpanel { text-align:center; gap:12px; }
.rewardart { width:200px; height:170px; align-self:center; }
.rewardart .art { width:100%; height:100%; }
.rewardpanel h2,.recoverypanel h2 { font:700 30px/1.05 'Afterlight Display',sans-serif; }
.rewardpanel p,.recoverypanel p { font-size:18px; line-height:1.4; }
.rewardpanel .rewardfine { font-size:16px; color:var(--muted); }
.rewardstatus { min-height:24px; font-size:16px!important; color:var(--gold); }
#recoveryScreen { background:#030f1cdd; padding:20px; }
.recoverypanel { max-width:400px; width:100%; text-align:center; display:flex; flex-direction:column; gap:12px; }
#recoveryArt { height:190px; }
#recoveryArt img { width:220px; height:220px; margin:-15px auto 0; object-fit:contain; -webkit-mask-image:radial-gradient(closest-side,#000 62%,transparent); mask-image:radial-gradient(closest-side,#000 62%,transparent); }
#recoveryTime { font:700 32px 'Afterlight Display',sans-serif; color:var(--gold); }
.recoverybenefits { display:flex; gap:12px; justify-content:center; color:#79b7ff; font-size:16px; font-weight:750; }
@media(max-height:730px) { .rewardart { height:120px; width:145px; } .rewardpanel { gap:8px; } #recoveryArt { height:135px; } #recoveryArt img { height:165px; width:165px; } .recoverypanel { gap:8px; } .recoverypanel h2 { font-size:27px; } }
@media(max-height:600px) { .rewardart { height:84px; width:100px; } .rewardpanel .rewardfine { font-size:14px; } }

/* Upgrade stakes — keep illustrated cards and UpgradeMotion's entry/confirm. */
#cardtools{display:flex;gap:10px;width:100%;max-width:430px;flex:none}
#cardtools .midbtn{flex:1;min-width:0;min-height:52px;margin:0;font:700 18px 'Afterlight Display',system-ui,sans-serif;letter-spacing:.01em}
#cardtools #btnReroll{gap:6px;max-width:none}
#cardtools #btnReroll .glyph{width:23px;height:23px}
#btnBanish{color:#c4d9e2;background:#0a202c;border-color:#476473}
#btnBanish[aria-pressed="true"]{color:#ffd166;border-color:#ffd166;background:#33291a}
#btnBanish:disabled{opacity:.5}
#banishHint{margin:0;min-height:28px;width:100%;max-width:430px;text-align:center;font-size:12px;line-height:1.3;color:#aac4ce}
.banishing #banishHint{color:#ffd166}
.banishing .card:not(.evolutioncard):not([data-kind="heal"]){border-style:dashed}
.banishing .card:not(.evolutioncard):not([data-kind="heal"])::after{content:'BANISH THIS CARD';position:absolute;right:8px;bottom:7px;padding:4px 7px;background:#382b16;color:#ffd166;font-size:10px;font-weight:700}
.card[data-grade="legendary"]{border-color:#ffd166;box-shadow:inset 0 0 25px #ffd16616,0 0 18px #ffd16618}
.card .legendarylabel{color:#ffd166;font-size:clamp(11px,3.5vw,15px)}
.evolution-mechanic{font-size:15px;line-height:1.45;color:#d5e7ef}
.surge-promise{color:#e0a0ff;font-size:10px;font-weight:700;line-height:1.3}
.cardfx-trim{position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:inset 0 0 0 1px var(--cc);animation:rarity-reveal .7s ease-out both;animation-delay:.12s}
.card:nth-child(2) .cardfx-trim{animation-delay:.22s}.card:nth-child(3) .cardfx-trim{animation-delay:.32s}
@keyframes rarity-reveal{0%{box-shadow:inset 0 0 0 1px var(--cc);opacity:.1}45%{box-shadow:inset 0 0 35px var(--cc);opacity:.7}100%{box-shadow:inset 0 0 0 1px var(--cc);opacity:1}}
#overdriveHUD{position:absolute;top:44px;left:50%;transform:translateX(-50%);width:146px;height:5px;border:1px solid #b66be4;border-radius:3px;background:#160f2b;box-shadow:0 0 8px #bf70f43d}
#overdriveHUD>span{display:block;height:100%;background:#d897ff;border-radius:2px}
#overdriveHUD>b{display:block;color:#e0a0ff;font-size:11px;letter-spacing:.07em;white-space:nowrap;text-align:center;line-height:18px}
#upgradeTimer.overdriving{top:92px}
#timer.overdriving{color:#f3dbff;animation:overdrive-pulse 1s ease-in-out infinite alternate}
@keyframes overdrive-pulse{to{text-shadow:0 0 12px #d897ff}}
.cardfx-particles{position:fixed;inset:0;z-index:47;pointer-events:none;width:100%;height:100%}
.cardfx-moment{position:fixed;z-index:40;top:16dvh;left:16px;right:16px;display:grid;justify-items:center;pointer-events:none;color:#edf8ff;text-align:center}
.cardfx-panel{pointer-events:auto;width:100%;max-width:410px;padding:15px 14px 12px;border:1px solid #ffd166;border-radius:11px;background:radial-gradient(ellipse at 50% 25%,#243c3c66,transparent 65%),linear-gradient(#03121bec,#061722f5);box-shadow:0 0 22px #ffd16618,inset 0 0 20px #ffd16609;animation:ceremony-in .2s ease-out both}
.cardfx-panel p{margin:0}.cardfx-kicker{font-size:13px;font-weight:700;letter-spacing:.14em;color:#ffd166;display:flex;align-items:center;justify-content:center;gap:10px}
.cardfx-kicker:before,.cardfx-kicker:after{content:'';height:1px;width:28px;background:#ffd16670}
.cardfx-hero{position:relative;width:170px;height:170px;margin:12px auto 6px;display:grid;place-items:center;border:1px solid #ffd16680;border-radius:50%;background:radial-gradient(circle,#b194492b,transparent 70%);box-shadow:0 0 24px #ffd16612}
.cardfx-hero>.art{width:175px;z-index:1;mix-blend-mode:lighten;transform:scale(1.12)}
.cardfx-name{font:700 34px/1.05 'Afterlight Display',system-ui,sans-serif;letter-spacing:-.03em;margin:7px 0 4px;text-wrap:balance}
.cardfx-grade{font-size:14px;color:#ffd166;font-weight:700;letter-spacing:.18em}
.cardfx-equipped{font-size:14px;line-height:1.35;color:#edf8ff;font-weight:700;margin-top:9px!important}
.cardfx-lineage{font-size:10px;letter-spacing:.08em;color:#8faab8;margin-top:3px!important}
.cardfx-description{font-size:14px;line-height:1.4;margin:8px auto 10px!important;max-width:280px;color:#d6e8ef}
.cardfx-boost{display:grid;gap:2px;color:#e0a0ff;border:1px solid #bd77e67a;border-radius:5px;background:#281b3980;padding:7px 8px;animation:cardfx-overdrive 1s ease-in-out infinite alternate}
.cardfx-boost strong{font:700 11px/1.4 'Afterlight Display',system-ui,sans-serif;letter-spacing:.05em}.cardfx-boost span{font-size:10px;line-height:1.35;color:#bfa8ca}
.cardfx-dismiss.primaryequip{margin:10px 0 0;min-height:52px;width:100%;flex:none;font:700 15px 'Afterlight Display',system-ui,sans-serif;letter-spacing:.06em}
.reward-moment #resumeHint{top:79%;z-index:41}
.reward-moment #resumeHint>span{box-shadow:0 0 20px #59f7ff40}
.cardfx-chest .cardfx-name{color:#ffe19b;font-size:30px;margin:16px 0 5px}
.cardfx-subtitle{font-size:11px;letter-spacing:.08em;color:#b4cdda}
.cardfx-loot{display:grid;gap:9px;margin:19px 0 14px}
.cardfx-item{display:grid;grid-template-columns:94px minmax(0,1fr);align-items:center;text-align:left;min-height:86px;border:1px solid var(--loot);border-radius:8px;overflow:hidden;background:#071826}
.cardfx-loot-art{overflow:hidden;align-self:stretch;display:grid;place-items:center;background:#10242e}.cardfx-loot-art>.art{width:110px;mix-blend-mode:lighten}
.cardfx-loot-copy{padding:8px 10px}.cardfx-loot-grade{font-size:10px;letter-spacing:.1em;color:var(--loot);font-weight:700}
.cardfx-loot-copy h3{font:700 18px/1.15 'Afterlight Display',system-ui,sans-serif;margin:4px 0;color:#eaf6ff}
.cardfx-loot-copy p{font-size:12px;color:#b8d1de;line-height:1.3}
.cardfx-item.is-current{box-shadow:inset 0 0 18px #ffd16620,0 0 10px #ffd16630;border-color:#ffd166}
.cardfx-applied{font-size:12px;letter-spacing:.07em;color:#ffd166;font-weight:700}
@keyframes ceremony-in{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}
@keyframes cardfx-overdrive{to{box-shadow:0 0 11px #d897ff4d}}
@media(max-width:600px){#cards{padding-top:max(32px,5dvh);gap:12px}.card{height:clamp(145px,21dvh,185px)}}
@media(max-height:730px){#cards{padding:12px 14px;gap:8px}.card{height:calc((100dvh - 172px)/3)}#cardtools .midbtn{font-size:16px;min-height:48px}#banishHint{font-size:10px;min-height:24px}.evolution-mechanic{font-size:12px;line-height:1.35}.cardfx-moment{top:6dvh}.cardfx-panel{padding:10px 12px}.cardfx-hero{width:100px;height:100px;margin:6px auto}.cardfx-hero>.art{width:105px}.cardfx-name{font-size:27px}.cardfx-equipped{font-size:12px;margin-top:5px!important}.cardfx-description{font-size:12px;margin:4px auto 6px!important}.cardfx-lineage{margin-top:2px!important;font-size:9px}.cardfx-grade{font-size:11px}.cardfx-boost{padding:4px 6px}.cardfx-boost strong{font-size:10px}.cardfx-boost span{font-size:9px}.cardfx-dismiss.primaryequip{margin-top:7px}.cardfx-loot{gap:7px;margin:12px 0}.cardfx-item{min-height:68px;grid-template-columns:75px minmax(0,1fr)}.cardfx-loot-art>.art{width:85px}.cardfx-chest .cardfx-name{font-size:25px;margin-top:10px}.cardfx-loot-copy h3{font-size:16px}}
@media(prefers-reduced-motion:reduce){.cardfx-panel,.cardfx-trim,.cardfx-boost,#timer.overdriving{animation:none!important}}
#cardtools .midbtn{padding:8px 6px;font-size:16px;white-space:nowrap}
@media(max-width:360px){#cardtools .midbtn{font-size:15px;letter-spacing:0}#cardtools #btnReroll{gap:4px}#cardtools #btnReroll .glyph{width:20px;height:20px}}
.cardfx-item{height:86px;min-height:0}.cardfx-loot-art{height:84px;min-height:0}.cardfx-loot-art>.art{width:94px;height:94px}
.reward-moment #objectiveLine{bottom:calc(26px + env(safe-area-inset-bottom,0px));font-size:9px}
@media(max-height:730px){.cardfx-item{height:68px}.cardfx-loot-art{height:66px}.cardfx-loot-art>.art{width:75px;height:75px}}
.cardfx-moment.is-reduced .cardfx-panel,.cardfx-moment.is-reduced .cardfx-boost{animation:none!important}
@media(max-height:730px){.card{height:calc((100dvh - 196px)/3)}.cardfx-chest .cardfx-item{height:60px}.cardfx-chest .cardfx-loot-art{height:58px}.cardfx-chest .cardfx-loot-copy{padding:4px 8px}.cardfx-chest .cardfx-loot-copy h3{font-size:14px;margin:3px 0}.cardfx-chest .cardfx-loot-copy p{font-size:10px}.cardfx-chest .cardfx-loot-grade{font-size:9px}}
.cardfx-hero{border:0;box-shadow:none}
.cardfx-aperture{position:absolute;inset:-10px;width:calc(100% + 20px);height:calc(100% + 20px);filter:drop-shadow(0 0 3px #ffd16625)}
.cardfx-hero>.art{mask-image:radial-gradient(ellipse,#000 48%,#000b 61%,transparent 75%);-webkit-mask-image:radial-gradient(ellipse,#000 48%,#000b 61%,transparent 75%)}
.cardfx-item.is-current{border-color:var(--loot);box-shadow:inset 0 0 14px var(--loot-glow),0 0 8px var(--loot-glow)}
@media(max-height:730px){.card[data-kind="wsurge"] .surge-promise{display:none}}
/* Settings expose short choices directly; header and exit stay above the scroll. */
#settingsSheet .settings-panel{align-items:stretch;gap:0;padding:20px;max-height:calc(100dvh - max(20px,env(safe-area-inset-top,0px)));overflow:hidden}
#settingsTitle{font-size:32px}
#settingsSheet .panelhead{margin-bottom:12px}
#settingsSheet .panelhead .iconbtn{background:none;border:0;color:var(--cyan)}
.settings-scroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#345c70 transparent;padding:2px 3px}
.settings-section{padding:12px 0;border-top:1px solid #29404e}
.settings-section:first-child{border-top:0;padding-top:0}
.settings-section h3{font-size:12px;line-height:20px;font-weight:650;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
#settingsSheet .setrow{min-height:44px;gap:12px;font-size:15px}
.volume-row{display:grid;grid-template-columns:110px minmax(50px,1fr) 36px}
#settingsSheet input[type=range]{width:100%;max-width:none;height:44px;accent-color:var(--cyan)}
.volume-row output{font:12px ui-monospace,monospace;color:var(--muted);text-align:right}
.setting-choice{border:0;min-width:0;padding:0;margin:0 0 10px}
.setting-choice legend{padding:0;margin-bottom:6px;font-size:15px;line-height:20px}
.setting-segments{display:flex;border:1px solid #345c70;border-radius:7px}
.setting-segments label{position:relative;display:flex;flex:1;min-width:0}
.setting-segments label+label{border-left:1px solid #345c70}
.setting-segments input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.setting-segments span{display:flex;align-items:center;justify-content:center;flex:1;min-height:44px;padding:6px;font-size:14px;line-height:1.2;text-align:center;pointer-events:none}
.setting-segments label:first-child span{border-radius:6px 0 0 6px}.setting-segments label:last-child span{border-radius:0 6px 6px 0}
.setting-segments input:checked+span{background:var(--cyan);color:#071019;font-weight:650}
.setting-segments input:focus-visible+span{outline:2px solid var(--gold);outline-offset:3px;z-index:1}
#setLang .setting-segments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:#345c70}
#setLang .setting-segments label{border:0;background:#051723}#setLang .setting-segments label:first-child{grid-column:1/-1}
.settings-footer{flex:none;padding-top:10px;border-top:1px solid var(--line);text-align:center}
.settings-footer p{font-size:12px;color:var(--muted);margin:0 0 10px}
#settingsSheet .settings-footer .bigbtn{width:100%;max-width:none;min-height:48px;font-size:16px}
#settingsSheet #btnAdPrivacy{width:100%;font-size:14px;margin-bottom:12px}
.flight-loadout h3{margin:16px 0 8px;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.loadout-entry{display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);color:var(--item)}
.loadout-entry>svg{width:30px;height:30px;flex:none}.loadout-entry>div{min-width:0}
.loadout-entry b{display:block;font-size:15px;line-height:1.4;color:var(--text);overflow-wrap:anywhere}
.loadout-entry small{display:block;font-size:12px;line-height:1.5;color:var(--muted)}
@media(max-width:350px){#settingsSheet .settings-panel{padding:16px 14px}#settingsTitle{font-size:29px}.volume-row{grid-template-columns:97px minmax(45px,1fr) 32px}#settingsSheet .setrow{gap:8px;font-size:14px}.setting-segments span{font-size:12px}}
@media(max-width:600px){#settingsSheet .settings-panel{padding-bottom:max(16px,env(safe-area-inset-bottom,0px));border-radius:18px 18px 0 0}}

/* Ten weapon levels use two rows inside the existing card art column. */
.choiceart .rankpips[data-max="10"] { display:grid; grid-template-columns:repeat(5,12px); gap:3px 6px; }
.choiceart .rankpips[data-max="10"] i { width:12px; height:13px; }
@media(max-height:590px) {
  .card[data-kind="wup"], .card[data-kind="mastery"] { grid-template-columns:35% minmax(0,1fr); }
  .card[data-kind="wup"] .choicecopy, .card[data-kind="mastery"] .choicecopy { gap:0; padding:1px 6px; }
  .card[data-kind="wup"] .choicecopy h3, .card[data-kind="mastery"] .choicecopy h3 { font-size:17px; line-height:1.05; }
  .card[data-kind="wup"] .upmetric>span, .card[data-kind="mastery"] .upmetric>span { font-size:18px; }
  .card[data-kind="wup"] .evolution-mechanic, .card[data-kind="mastery"] .evolution-mechanic { font-size:11px; line-height:1.2; }
}

/* Weapon choices and recovered salvage share an illustrated action card. */
#cards { padding:max(clamp(20px,4dvh,38px),env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); gap:14px; }
#cardrow { max-width:430px; gap:10px; flex:0 1 auto; min-height:0; overflow-y:auto; }
.card.upgradecard { display:block; height:clamp(112px,calc((100dvh - 195px)/3),205px); min-height:105px; flex:0 1 auto; border:1px solid var(--cc); border-radius:0; background:#061421; }
.upgradecard { position:relative; overflow:hidden; text-align:left; }
.upgradecard { clip-path:polygon(7px 0,calc(100% - 7px) 0,100% 7px,100% calc(100% - 7px),calc(100% - 7px) 100%,7px 100%,0 calc(100% - 7px),0 7px); }
.upgradecard::before { content:''; position:absolute; inset:1px; z-index:2; pointer-events:none; border:0; background:linear-gradient(135deg,transparent 42%,var(--cc) 44%,var(--cc) 55%,transparent 57%) top left,linear-gradient(225deg,transparent 42%,var(--cc) 44%,var(--cc) 55%,transparent 57%) top right,linear-gradient(315deg,transparent 42%,var(--cc) 44%,var(--cc) 55%,transparent 57%) bottom right,linear-gradient(45deg,transparent 42%,var(--cc) 44%,var(--cc) 55%,transparent 57%) bottom left; background-size:12px 12px; background-repeat:no-repeat; }
.upgradecard .cardfx-trim { animation:none; box-shadow:none; }
.card.upgradecard:focus-visible { outline:2px solid var(--gold); outline-offset:-6px; }
.upgradecard .choiceart { position:absolute; inset:0; width:100%; height:100%; margin:0; mask-image:none; -webkit-mask-image:none; background:#061421; overflow:hidden; }
.upgradecard .choiceart::after { display:none; }
.weapon-preview { position:absolute; inset:0; display:block; width:100%; height:100%; contain:strict; }
.upgradecard .choicecopy { position:absolute; inset:0; width:100%; height:100%; align-self:stretch; display:flex; flex-direction:column; justify-content:space-between; gap:0; padding:0; min-width:0; pointer-events:none; }
.card.upgradecard[data-rarity="2"] { box-shadow:inset 0 0 5px #d799ff25; border-width:1px; }
.weapon-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:6px; padding:10px 11px 19px; background:linear-gradient(#03121cec,#03121c99 60%,transparent); }
.upgradecard .choicecopy h3 { margin:0; font-size:clamp(16px,5.1vw,23px); line-height:1.1; color:#edf9ff; overflow-wrap:anywhere; text-shadow:0 2px 4px #000; }
.upgradecard .raritylabel { flex:none; margin:0; font-size:10px; line-height:1.4; color:var(--rarity,var(--loot,#c9dce3)); white-space:nowrap; }
.upgradecard .raritylabel.legendarylabel { color:#ffd166; }
.upgrade-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:36px; padding:5px 10px; text-shadow:0 1px 4px #020912,0 0 8px #020912; }
.upgrade-footer>strong,.upgrade-footer>.choicetag { padding:3px 0; background:linear-gradient(100deg,#03131ee6,#03131e99 85%,#03131e00); }
.weapon-benefit { display:flex; align-items:center; gap:7px; color:#effaff; font:700 clamp(12px,3.5vw,16px)/1.2 'Afterlight Display',system-ui,sans-serif; }
.weapon-benefit>.glyph { width:23px; height:23px; flex:none; color:var(--cc); }
.upgradecard .choicetag { flex:none; color:#dceff5; font-size:11px; line-height:1.3; white-space:nowrap; }
.upgradecard .module-stage { display:grid; place-items:center; background:radial-gradient(ellipse at 50% 55%,color-mix(in srgb,var(--cc) 20%,#071827),#05121d 70%); }
.module-scene { display:block; width:100%; height:100%; background-image:url('assets/ui/module-scenes.webp'); background-size:300% 300%; background-position:var(--scene-x) var(--scene-y); }
.illustrated-loadout>img,.illustrated-loadout>.module-scene { width:100px; height:64px; object-fit:cover; flex:none; border:1px solid var(--line); }
.pause-actions { width:min(330px,calc(100vw - 40px)); gap:9px; }
.pause-actions>button { display:flex; align-items:center; gap:15px; width:100%; min-height:60px; padding:10px 16px; text-align:left; }
.pause-actions>button>span:last-child { min-width:0; overflow-wrap:anywhere; }
.pause-actions small { display:block; margin-top:3px; color:var(--muted); font:12px/1.3 ui-monospace,monospace; letter-spacing:0; }
.pause-actions .pause-icon { display:grid; place-items:center; width:35px; flex:none; color:var(--cyan); }
.pause-icon .glyph { width:29px; height:29px; }
#btnQuit .pause-icon { color:var(--gold); }
#btnResume .pause-icon,#btnResume small { color:inherit; }
@media(max-height:650px){#pauseScreen{gap:8px;padding-top:18px;padding-bottom:18px;overflow-y:auto}.pause-actions{gap:6px}.pause-actions>button{min-height:48px;padding:7px 14px}.pause-actions small{font-size:10px}#pauseSummary{font-size:11px}}
@media(max-height:450px) and (orientation:landscape){.pause-actions{display:grid;grid-template-columns:1fr 1fr;width:min(580px,calc(100vw - 40px))}.pause-actions>button:first-child{grid-column:1/-1}}
.cardfx-moment { inset:0; padding:20px 16px; display:flex; align-items:center; justify-content:center; background:#020b13e6; pointer-events:auto; }
.reward-moment #resumeHint { visibility:hidden; }
.cardfx-panel { display:flex; flex-direction:column; max-height:100%; width:430px; max-width:100%; padding:18px 14px 14px; overflow-y:auto; overscroll-behavior:contain; }
.cardfx-chest .cardfx-name { font-size:27px; margin:10px 0 5px; }
.cardfx-loot { overflow-y:auto; min-height:0; flex:1 1 auto; margin:16px 0; padding:1px; }
.cardfx-item.upgradecard { display:block; height:clamp(126px,21dvh,180px); min-height:126px; flex:none; border-color:var(--loot); }
.cardfx-item .choicecopy { padding:0; }
.cardfx-item .choicecopy h3 { font-size:18px; }
.cardfx-item .weapon-benefit { font-size:13px; }
.cardfx-item .raritylabel { font-size:9px; }
.cardfx-item .choicetag { font-size:10px; }
.cardfx-dismiss.primaryequip { flex-shrink:0; }
.cardfx-hero { width:100%; height:auto; aspect-ratio:2; margin:12px 0; overflow:hidden; border:1px solid #ffd16666; border-radius:6px; }
@media(max-height:730px) {
  #cards { gap:10px; padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); overflow-y:auto; }
  .card.upgradecard { height:clamp(105px,calc((100dvh - 218px)/3),180px); }
  .weapon-heading { padding:8px 9px 15px; }
  .cardfx-moment { padding:12px; }
  .cardfx-panel { padding:12px; }
  .cardfx-loot { margin:10px 0; }
  .cardfx-hero { height:auto; width:100%; }
}
@media(max-width:350px) {
  .upgradecard .choicecopy h3 { font-size:16px; }
  .upgradecard .raritylabel { font-size:8px; }
  .weapon-benefit { font-size:12px; gap:5px; }
  .weapon-benefit>.glyph { width:19px; height:19px; }
  .upgradecard .choicetag { font-size:9px; }
  .upgrade-footer { padding:4px 8px; min-height:30px; }
  .cardfx-item .choicecopy h3 { font-size:15px; }
  .cardfx-item .weapon-benefit { font-size:11px; }
}

/* Rarity is a persistent power grade; evolution is a separate firing pattern. */
.raritylabel[data-rarity="3"] { color:#ffd166; }
.upgradecard .rarity-power { color:var(--muted); font-size:11px; font-weight:800; white-space:nowrap; }
.upgradecard .weapon-grade { flex:none; display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.upgradecard[data-kind="wswap"] .weapon-benefit { font-size:clamp(10px,3vw,13px); }

/* Garage research reuses the illustrated catalogue and its detail sheet. */
#hangarSheet .paneltabs button{font-size:clamp(14px,3.7vw,18px);line-height:1.15}
.researchsummary{display:block;margin:8px 10px 12px;font:11px/1.4 ui-monospace,monospace;color:var(--muted)}
.moduleportrait{display:block;width:100%;aspect-ratio:1;flex:none}
.artitem>.improvebtn{color:var(--cyan);background:#102f3c}
.sheet-backdrop { pointer-events:none; }
.sheet-backdrop .sheetpanel { opacity:1; transform:none; }
.research-sheet { padding:0; justify-content:flex-end; background:#020912aa; }
.research-sheet .detailpanel { position:relative; width:min(100%,480px); min-height:min(80dvh,658px); max-height:94dvh; padding:20px 12px max(24px,env(safe-area-inset-bottom)); gap:0; border-radius:14px 14px 0 0; background:radial-gradient(ellipse at 50% 65%,#0e394b55,transparent 75%),linear-gradient(120deg,#081f2c,#061722); }
.research-sheet .panelhead { position:absolute; right:20px; top:20px; width:44px; min-height:44px; z-index:2; }
.research-sheet .panelhead h2 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.research-sheet .panelhead .iconbtn { width:44px; height:44px; font:400 28px/1 system-ui,sans-serif; }
.research-sheet .detailpanel>.midbtn { display:none; }
.researchbody { padding-inline:8px; font-family:system-ui,sans-serif; font-weight:400; letter-spacing:0; font-variant-numeric:tabular-nums; }
.researchhead { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; padding-right:58px; margin-bottom:2px; color:var(--muted); font-size:15px; }
.researchwallet { display:flex; align-items:center; gap:5px; color:var(--gold); }
.researchwallet b { font-size:22px; font-weight:600; }
.researchwallet .glyph { width:24px; height:26px; }
.researchhero { width:calc(100% + 16px); margin-inline:-8px; height:clamp(165px,26dvh,235px); border:1px solid var(--cc); background:#061421; }
.researchhero>img,.researchhero>.module-scene { display:block; width:100%; height:100%; object-fit:cover; }
#detailContent .researchhero h3 { position:absolute; inset:0 0 auto; margin:0; padding:9px 12px 28px; font:500 22px/1.2 system-ui,sans-serif; letter-spacing:0; color:var(--text); background:linear-gradient(#03121ce6,#03121c70 60%,transparent); text-shadow:0 1px 3px #000; }
.research-sweep { position:absolute; inset:0; pointer-events:none; opacity:0; background:linear-gradient(105deg,transparent 20%,#ffffff35 50%,transparent 80%); }
.researchmetrics { margin-top:14px; border-top:1px solid var(--line); }
.researchmetric { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px; border-bottom:1px solid var(--line); }
.researchmetric>span:first-child { color:var(--muted); font-size:15px; }
.researchmetric small { display:block; margin-top:3px; font:400 12px/1.35 system-ui,sans-serif; }
.researchmetric:has(small) { min-height:56px; }
.researchvalues { display:grid; grid-template-columns:1fr 24px 1.6fr; align-items:center; gap:10px; width:61%; flex:none; white-space:nowrap; }
.researchbefore { color:var(--muted); font-size:18px; }
.researcharrow { color:var(--muted); font-size:20px; }
.researchvalues strong { min-width:max-content; text-align:right; font-size:28px; font-weight:600; color:var(--cc); }
.researchmetric.maxed strong { grid-column:1/-1; }
#detailContent .researchqualifier { margin:5px 0 0; font:400 12px/1.35 system-ui,sans-serif; color:var(--muted); }
.researchtabs { display:flex; gap:16px; margin-top:8px; border-bottom:1px solid var(--line); }
.researchtabs button { min-width:80px; min-height:46px; padding:8px 4px; color:var(--muted); border:0; border-bottom:2px solid transparent; background:none; font-size:16px; font-weight:500; }
.researchtabs [aria-pressed=true] { color:var(--cyan); border-bottom-color:var(--cyan); }
.researchtabs+.researchmetrics { margin-top:0; border-top:0; }
.researchtabs+.researchmetrics .researchmetric { min-height:62px; }
.researchrank { display:flex; align-items:center; gap:12px; margin:20px 0; }
.researchrank>span:first-child { flex:none; font-size:13px; color:var(--muted); }
.researchrank .rankpips { flex:1; display:flex; gap:3px; margin:0; }
.researchrank .rankpips i { flex:1; width:auto; height:16px; border-radius:2px; border:1px solid #34596b; background:#112b39; clip-path:none; box-shadow:none; }
.researchrank .rankpips i::before { display:none; }
.researchrank .rankpips .filled { background:var(--cc); border-color:var(--cc); }
.researchrank .rankpips .offered { background:transparent; border-color:var(--cc); box-shadow:inset 0 0 0 1px var(--cc); filter:none; animation:none; }
.researchbuy { position:relative; display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:56px; padding:11px 16px; border:0; border-radius:0; background:var(--cyan); color:var(--text); font:500 21px/1.2 system-ui,sans-serif; clip-path:polygon(9px 0,calc(100% - 9px) 0,100% 9px,100% calc(100% - 9px),calc(100% - 9px) 100%,9px 100%,0 calc(100% - 9px),0 9px); transition:background .15s,transform .12s; }
.researchaction { filter:drop-shadow(0 2px 5px #59f7ff24); }
.researchaction:has(:disabled) { filter:none; }
.researchbuy::before { content:''; position:absolute; inset:2px; background:radial-gradient(ellipse at 50% 100%,#23627280,transparent 65%),linear-gradient(110deg,#0b2b3b,#0d3544 60%,#092936); clip-path:polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px),0 8px); }
.researchbuy:not(:disabled)::after { content:''; position:absolute; bottom:0; left:49%; right:49%; height:3px; background:#e8ffff; box-shadow:0 0 8px 3px #59f7ffb0; }
.researchbuy>span { position:relative; }
.researchbuy:active:not(:disabled) { transform:scale(.98); background:#164653; }
.researchbuy:focus-visible { outline:2px solid var(--gold); outline-offset:-6px; }
.researchbuy:disabled { opacity:1; color:var(--muted); background:#34596b; font-size:18px; }
.researchprice { display:flex; align-items:center; justify-content:center; gap:5px; width:34%; min-width:106px; align-self:stretch; padding-left:12px; border-left:1px solid #3a697b; }
.researchprice .glyph { color:var(--gold); }
#detailContent .researchscope { font:400 12px/1.4 system-ui,sans-serif; color:var(--muted); margin:12px 0 0; }
#detailContent .researchshort { font:400 13px/1.4 system-ui,sans-serif; color:var(--gold); margin:8px 0 0; }
#detailContent .researchstatus { font:400 12px/1.4 system-ui,sans-serif; color:var(--cyan); margin:8px 0 0; }
.researchstatus:empty { display:none; }
.researchbody[data-busy] .researchbuy { cursor:wait; }
.research-success .researchbefore,.research-success .researchmetric.maxed strong { color:var(--cc); animation:research-value .48s ease-out; }
.research-success .research-sweep { animation:research-sweep .54s ease-out; }
.research-success .rankpips .rank-gained { animation:research-rank .54s ease-out; }
.research-success .researchbuy { animation:research-button .48s ease-out; }
@keyframes research-value { from { transform:translateY(7px); opacity:.35; } to { transform:translateY(0); opacity:1; } }
@keyframes research-sweep { 0% { transform:translateX(-100%); opacity:0; } 30% { opacity:1; } 100% { transform:translateX(100%); opacity:0; } }
@keyframes research-rank { 40% { transform:scaleY(1.3); filter:brightness(1.7); } }
@keyframes research-button { 0% { transform:scale(.98); } 35% { background:#205264; } 100% { transform:scale(1); } }
@media(max-width:350px) {
  .iteminspect>.effectextra { margin-inline:8px; }
  .research-sheet .detailpanel { padding:14px 6px max(18px,env(safe-area-inset-bottom)); }
  .research-sheet .panelhead { top:14px; right:14px; }
  .researchvalues { width:64%; gap:8px; grid-template-columns:1fr 20px 1.6fr; }
  .researchvalues strong { font-size:25px; }
  .researchbefore { font-size:16px; }
  .researchmetric>span:first-child { font-size:13px; }
  .researchrank { gap:8px; }
}
@media(max-height:650px) {
  .researchhero { height:150px; }
  .researchhead { margin-bottom:10px; }
  .researchrank { margin-block:12px; }
  .researchmetric { min-height:43px; }
}

.artitem>.trialbtn{font-size:13px;line-height:1.3;padding:10px 6px}.trialnotice{color:#a4caff;border-bottom:1px solid var(--line);padding-bottom:12px}

/* Lantern uses the same hangar art, surface colors and controls as flight preparation. */
.home-project{display:flex;align-items:center;gap:10px;width:100%;padding:11px 12px;margin:0 0 14px;text-align:left;background:#0a202b;border:1px solid #315468;border-radius:9px;color:var(--cyan)}
.home-project>span:nth-child(2){display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}
.home-project small{font-size:10px;letter-spacing:.08em;color:var(--muted)}
.home-project b{font-size:16px;color:#f0f7fa;line-height:1.2}
.home-project em{font-size:12px;font-style:normal;color:#b5cbd8;line-height:1.3}
.home-project.project-ready{border-color:#ae9151}.home-project.project-ready small{color:var(--gold)}
#startScreen:has(.home-project) #homeShipArtwork{height:clamp(135px,24dvh,240px)}
#projectsSheet .projects-panel{gap:0;background:#06141e}
#projectsTitle{font-size:38px;letter-spacing:-.025em}
#projectsSheet .panelhead{min-height:56px;margin-bottom:12px}
#projectsSheet .panelhead .iconbtn{border-radius:50%;width:44px;height:44px;min-width:44px;background:transparent;border-color:#335061}
#projectScroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#31566a transparent;margin:0 -4px;padding:0 4px 4px}
.project-hero{position:relative;height:clamp(140px,26dvh,220px);overflow:hidden;margin-bottom:12px;background:#06141e;border-radius:8px}
.project-hero img{object-position:center 45%;mask-image:linear-gradient(#000 60%,transparent 100%)}
.project-hero>div{position:absolute;bottom:10px;left:12px;right:12px;text-shadow:0 2px 8px #021019}
.project-hero small{color:var(--gold);font-size:11px;letter-spacing:.06em;font-weight:700}
.project-hero h3{font-size:21px;line-height:1.2;margin-top:4px;color:#eef6fa}
.project-list{display:flex;flex-direction:column;gap:10px}
.lantern-project{border:1px solid #284555;border-radius:8px;background:#0a1b27;overflow:hidden}
.lantern-project.selected{border-color:var(--cyan);background:#081e2a;box-shadow:inset 0 0 16px #59f7ff08}
.lantern-project.restored{border-color:#547267}
.project-select{display:flex;gap:12px;align-items:center;width:100%;text-align:left;border:0;background:transparent;padding:12px 13px;color:#a8c6d6;min-height:64px}
.project-number{font:700 27px 'Afterlight Display',system-ui,sans-serif;color:#9bb9ce;width:40px;flex:none}
.selected .project-number{color:#d7f1fb}
.project-select>.glyph{color:#78b9cc;width:25px;height:25px;margin-left:auto}
.project-select>span:nth-child(2){flex:1;min-width:0}
.project-select b{display:block;color:#eef6fa;font-size:16px;line-height:1.25}
.project-select small{display:block;font-size:11px;line-height:1.45;margin-top:5px;color:#bad0dc}
.project-selected{align-self:flex-start;font-size:10px;font-weight:700;color:var(--cyan);padding:5px 7px;border:1px solid #356d7c;border-radius:5px;margin-top:1px}
.project-body{padding:0 13px 12px}
.project-body p{font-size:13px;line-height:1.5;color:#c1d6e1}
.project-body .project-counts{color:#f2f8fc;font-size:14px;margin:3px 0 6px 52px}
.project-body progress{appearance:none;display:block;width:calc(100% - 52px);height:6px;border:0;border-radius:3px;overflow:hidden;background:#1a394b;color:var(--cyan);margin:0 0 10px 52px}
.project-body progress::-webkit-progress-bar{background:#1a394b}
.project-body progress::-webkit-progress-value{background:var(--cyan)}
.project-body progress::-moz-progress-bar{background:var(--cyan)}
.project-prize{border-top:1px solid #294451;padding-top:9px}
.project-prize>p{font-size:11px;font-weight:700;letter-spacing:.035em;color:var(--gold)}
.project-preview{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:6px}
.project-preview>div{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0}
.project-preview .art{width:72px;background-color:transparent}
.project-preview b{font-size:12px;line-height:1.35;text-align:center;color:#eef6fa}
.project-footer{flex:none;border-top:1px solid #315061;padding-top:12px;margin-top:14px}
.project-footer p{font-size:11px;color:#adc1cf;line-height:1.45;margin-bottom:12px;text-align:left}
.project-footer #projectStatus{color:var(--gold);font-size:13px}
.project-footer #projectStatus:empty{display:none}
.project-footer .bigbtn{width:100%;max-width:none;font-size:18px;min-height:52px}
.project-rewards{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.project-reward{width:100%;display:flex;align-items:center;gap:10px;background:#0a2330;border:1px solid #597a85;border-radius:6px;padding:6px 8px;text-align:left;color:#d7e8ed;min-height:70px}
.project-reward>.art{width:54px}.project-reward>span:nth-child(2){flex:1;min-width:0}.project-reward b{font-size:13px}.project-reward small{display:block;font-size:10px;color:var(--gold);margin-top:5px;line-height:1.4}.project-reward>.glyph{width:20px;color:var(--cyan)}
.project-trials{margin-top:20px}.project-trials h3{font-size:19px;color:#eff8fc}.project-trials p{font-size:13px;color:#adc6d5;line-height:1.5;margin:7px 0 12px}
.trial-entry{display:flex;align-items:center;gap:9px;width:100%;padding:8px 0;border:0;border-bottom:1px solid #284555;background:transparent;text-align:left;color:var(--cyan)}
.trial-entry>.art{width:52px}.trial-entry>span:nth-child(2){flex:1}.trial-entry b{color:#e4f0f6;font-size:13px}.trial-entry small{display:block;font-size:10px;color:#b5cbd8;margin-top:4px}
.weapon-experience{font-size:10px;line-height:1.4;color:#bdd3de;letter-spacing:.035em;text-align:center;padding:6px 2px 1px}
.weapon-record{padding:14px 0;border-block:1px solid #315061;margin:12px 0 20px}.weapon-record h3{font-size:20px}.weapon-record ul{list-style:none;padding:0;margin:13px 0;display:grid;grid-template-columns:1fr 1fr;gap:10px}.weapon-record li{display:flex;align-items:center;gap:6px;color:#a9bdc9;font-size:13px}.weapon-record li .glyph{width:18px;height:18px}.weapon-record li.recorded{color:#77e8d3}.weapon-record p{font-size:14px;line-height:1.5}.weapon-record button{margin-top:14px}
.trial-brief-art{display:flex;justify-content:center;gap:10px}.trial-brief-art>.art{width:40%}
.lantern-result{width:min(100%,380px);padding:12px;border:1px solid #34596a;border-radius:9px;background:#0a2330;flex:none}
.lantern-result p{font-size:13px;line-height:1.5;color:#c5dce7}.lantern-result p>b{display:block;color:var(--cyan);font-size:12px;margin-bottom:4px}.lantern-result p>span{display:block}.lantern-result .midbtn{margin-top:10px;min-height:44px;width:100%;font-size:14px}.flight-discoveries{margin-top:9px;color:#ffd166!important;font-size:11px!important}.lantern-result:empty{display:none}
.resultScreen .trial-result-art{width:150px}.resultScreen:has(.trial-result-art) .rewardline strong{font-size:25px;text-align:center}.resultScreen:has(.trial-result-art) .rewardline>span{font-size:14px;line-height:1.4;text-align:center}
#projectLine{position:absolute;left:16px;right:16px;bottom:calc(128px + env(safe-area-inset-bottom,0px));color:#a5d6dc;font-size:10px;line-height:1.4;letter-spacing:.02em;text-transform:uppercase;text-shadow:0 1px 4px #000}
#projectLine:empty{display:none}
@media(max-width:350px){.home-project{gap:7px;padding:9px}.home-project b{font-size:14px}.home-project small{font-size:9px}#projectsTitle{font-size:32px}.project-select{padding:12px 10px;gap:8px}.project-number{font-size:23px;width:28px}.project-select b{font-size:13px}.project-selected{font-size:9px;padding:4px}.project-body{padding:0 10px 12px}.project-body .project-counts{margin-left:36px;font-size:12px}.project-body progress{margin-left:36px;width:calc(100% - 36px)}.project-preview b{font-size:11px}.project-footer .bigbtn{font-size:16px}}
@media(max-height:730px){#startScreen:has(.home-project) #homeShipArtwork{height:130px}.home-project{margin-bottom:10px}.project-hero{height:140px}.lantern-result{padding:9px}.lantern-result p{font-size:12px}.resultScreen .rewardline .salvageart{width:120px}.resultScreen .trial-result-art{width:105px}}
@media(max-height:450px){#projectsSheet .panelhead{min-height:44px;margin-bottom:8px}#projectsTitle{font-size:28px}.project-hero{height:115px}.project-footer{padding-top:8px;margin-top:8px}.project-footer p{margin-bottom:6px}.project-footer .bigbtn{min-height:44px}}
@media(prefers-reduced-motion:reduce){.home-project,.lantern-project,.project-select,.project-reward{transition:none}}
/* Keep the launch header reachable when the new project row makes the deck taller than the viewport. */
.next-goal{display:flex;align-items:center;gap:10px;width:min(100%,380px);flex:none;text-align:left}
.next-goal p,.launchblock .next-goal p{flex:1;min-width:0;font-size:12px;line-height:1.4;color:var(--muted);margin:0;text-align:left;overflow-wrap:anywhere}
.next-goal b{color:var(--text);font-weight:600}.next-goal .midbtn{width:auto;min-height:44px;padding:8px 10px;font-size:12px;flex:none}
#homeGoal{width:100%;margin-bottom:12px}
#startScreen .flightdeck{flex-shrink:0}
.resultScreen:has(.lantern-result:not(:empty)) .salvageart{width:clamp(110px,22dvh,190px)}
/* A flight-record board and a next goal on one results screen: tighten the stats cells and the goal button so the actions stay above the fold. */
.overlay.resultScreen:has(.result-records:not(:empty)):has(.next-goal:not(.hidden)) .statsgrid>div{padding:10px}
.overlay.resultScreen:has(.result-records:not(:empty)):has(.next-goal:not(.hidden)) .next-goal .midbtn{min-height:44px;padding-top:8px;padding-bottom:8px}
.resultScreen:has(.result-records:not(:empty)):has(.next-goal:not(.hidden)) .lantern-result{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:7px}
.resultScreen:has(.result-records:not(:empty)):has(.next-goal:not(.hidden)) .lantern-result p{flex:1;font-size:11px;line-height:1.3}
.resultScreen:has(.result-records:not(:empty)):has(.next-goal:not(.hidden)) .lantern-result .midbtn{width:110px;margin:0;font-size:11px;padding:6px;min-height:44px}
.resultScreen:has(.result-records:not(:empty)):has(.next-goal:not(.hidden)) .lantern-result .flight-discoveries{flex-basis:100%;margin:0}
@media(max-height:620px){
  .resultScreen:has(.lantern-result:not(:empty)){gap:8px}
  .resultScreen:has(.lantern-result:not(:empty)) .salvageart{width:96px}
  .resultScreen:has(.next-goal:not(.hidden)) .salvageart{width:48px}
  .overlay.resultScreen:has(.next-goal:not(.hidden)) .statsgrid>div{padding:6px 10px}
  .overlay.resultScreen:has(.next-goal:not(.hidden)) .statsgrid b{font-size:24px}
  .overlay.resultScreen:has(.next-goal:not(.hidden)) :is(.next-goal,.lantern-result) .midbtn{min-height:44px;padding-top:8px;padding-bottom:8px}
  .resultScreen:has(.lantern-result:not(:empty)) .rewardline:has(.salvageart)>strong{font-size:36px}
  .resultScreen:has(.next-goal:not(.hidden)) .rewardline:has(.salvageart)>strong{font-size:30px}
  .resultScreen:has(.result-save-status:not(.hidden)){gap:6px}
  .resultScreen:has(.result-save-status:not(.hidden)) .salvageart{width:80px}
}
/* While a save waits for retry, records give way so RETRY, FLY AGAIN and HANGAR stay on screen. */
.resultScreen.save-retry .statsgrid,.resultScreen.save-retry #winWeaponSummary,.resultScreen.save-retry #overWeaponSummary{display:none}

/* Visual first-flight briefing: one pictogram, one headline, one line per lesson. */
#tutorialSheet.visual .sheetpanel { gap:12px; padding:20px 22px max(24px,env(safe-area-inset-bottom)); }
#tutorialSheet.visual .eyebrow { font-size:12px; letter-spacing:.08em; }
#tutorialSheet.visual h2 { font-size:26px; line-height:1.15; }
.flightlesson.visual { width:100%; gap:0; }
.flightlesson.visual section { display:grid; grid-template-columns:80px minmax(0,1fr); gap:4px 18px; align-items:center; padding:10px 0; }
.flightlesson.visual section+section { border-top:1px solid var(--line); }
.flightlesson.visual h3 { font-size:22px; line-height:1.2; font-weight:700; color:var(--text); }
.flightlesson.visual p { grid-column:1/-1; font-size:14px; line-height:1.45; margin:0; color:var(--muted); }
.lessonicon { display:block; width:80px; height:80px; color:var(--cyan); }
.lessonicon text { fill:currentColor; stroke:none; font:650 11px system-ui,sans-serif; }
.lessonicon.salvage,.lesson-gold { color:var(--gold); }
.lesson-core { color:var(--cyan); }
.lesson-danger { color:var(--red); }
@media (max-width:350px),(max-height:650px) {
  #tutorialSheet.visual .sheetpanel { gap:10px; padding:18px 18px max(22px,env(safe-area-inset-bottom)); }
  .flightlesson.visual section { grid-template-columns:72px minmax(0,1fr); gap:4px 16px; padding:8px 0; }
  .lessonicon { width:72px; height:72px; }
  .flightlesson.visual h3 { font-size:20px; }
  .flightlesson.visual p { font-size:12.5px; }
}
/* Personal flight logs reuse the hangar sheet and the result screen's type. */
.deckfoot #bestLine{display:block;order:3;flex-basis:100%;max-width:none;text-align:left;font-size:11px;line-height:1.4;font-variant-numeric:tabular-nums}
#statsSheet .records-panel{align-items:stretch;width:min(100%,470px);max-height:94dvh;overflow:hidden;gap:14px;padding:20px}
#recordsTitle{font-size:32px}
.record-lifetime{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));text-align:center;padding-bottom:12px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
.record-lifetime b{display:block;font-size:23px}.record-lifetime span{display:block;margin-top:4px;font-size:10px;color:var(--muted);letter-spacing:.06em}
.record-ships{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:none}
.record-ships button{min-height:54px;padding:7px 3px;border:1px solid #345c70;border-radius:7px;background:#0b2331;font-size:15px;font-weight:650;color:#e7f1f4}
.record-ships button small{display:flex;align-items:center;justify-content:center;gap:3px;margin-top:5px;font-size:9px;font-weight:400;color:var(--muted)}
.record-ships .glyph{width:12px;height:12px}.record-ships .locked{color:#a1b3be;background:#081722;border-color:#29404e}
.record-ships [aria-pressed=true]{border-color:var(--cyan);color:var(--cyan)}
#recordsScroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#345c70 transparent;padding:0 2px;border-bottom:1px solid var(--line);margin-bottom:-6px}
#recordBoard h3,#recordContracts h3{font-family:inherit;font-size:12px;line-height:1.5;letter-spacing:.07em;color:#d4e6ef;margin:0 0 8px}
#recordBoard h3{display:flex;align-items:baseline;justify-content:space-between;gap:8px}#recordBoard h3 small{font-size:10px;font-weight:400;color:var(--muted);letter-spacing:0}
.flight-records{list-style:none;padding:0;margin:0;font-variant-numeric:tabular-nums;text-align:left}
.flight-record{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:3px 8px;align-items:center;padding:6px 8px;border-bottom:1px solid #29404e;color:#e7f1f4}
.record-rank{grid-row:1/4;color:#c3d9e5;font-family:inherit;font-size:20px;font-weight:750;line-height:1.2;font-variant-numeric:tabular-nums;text-align:center}
.record-reading{grid-column:2/-1;display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.record-reading strong{font-size:20px;font-weight:750}.record-reading strong small{font-size:9px;font-weight:400;color:var(--muted)}.record-reading>span{font-size:16px}
.record-build{grid-column:2/-1;font-size:10px;line-height:1.5;color:#b5cbd8;letter-spacing:.015em}
.record-glyphs{grid-column:2;display:flex;gap:5px;color:#a5c4d2}.record-glyphs .glyph{width:17px;height:17px}
.flight-record time{font-size:9px;color:#9bb3c2;text-align:right}
.flight-record.current{position:relative;background:#102e3c}.flight-record.current::before{content:'';position:absolute;left:0;top:5px;bottom:5px;width:2px;background:var(--cyan)}.current .record-rank,.current .record-build{color:var(--cyan)}
.record-empty{padding:12px 0 4px;font-size:15px;line-height:1.6;color:#bed3df}
.record-assisted{display:grid;gap:5px;padding:14px 0;margin:6px 0 0;border-bottom:1px solid var(--line);font-size:12px;line-height:1.4;color:#b5cbd8;font-variant-numeric:tabular-nums}
.record-assisted b{font-size:10px;letter-spacing:.06em;color:#cad7de}
.contract-record{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 2px;border-bottom:1px solid var(--line)}.contract-record:last-child{border-bottom:0}
.contract-record b{font-size:14px;font-weight:600}.contract-record small{display:block;margin-top:4px;color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
.contract-record>span{color:#b5cbd8;font-size:15px;letter-spacing:.08em;white-space:nowrap}
#recordLegacy{font-size:11px;line-height:1.5;color:var(--muted);margin-top:14px}#recordLegacy:empty{display:none}
#btnStatsDone{flex:none;width:100%;max-width:none;min-height:48px;font-size:16px}
.resultScreen .result-records{width:min(100%,380px);text-align:left;color:var(--text);background:#091d29;border:1px solid #345466;border-radius:8px;padding:12px 10px}
.record-headline{font-size:15px;font-weight:750;line-height:1.4;letter-spacing:.015em}.record-headline.new-record{color:var(--gold)}
.record-subline{font-size:12px;line-height:1.5;color:#bacfda;margin-top:3px;font-variant-numeric:tabular-nums}
.mini-board{margin-top:10px}.mini-board .flight-record{grid-template-columns:24px minmax(0,1fr) auto;padding:7px 8px;gap:3px 8px}
.mini-board .flight-record:last-child,.mini-board .flight-record:has(+.current){border-bottom-color:transparent}.mini-board .current{border-radius:4px;outline:1px solid #345466;outline-offset:-1px}
.mini-board .record-rank{grid-row:1/3;font-size:18px}.mini-board .record-reading{grid-column:2/-1}.mini-board .record-reading strong{font-size:16px}.mini-board .record-reading>span{font-size:13px}
.mini-board .record-build{grid-column:2;font-size:9px}.mini-board .record-glyphs{grid-column:3;grid-row:2;gap:3px}.mini-board .glyph{width:13px;height:13px}
.result-records:has(.new-record) .current{background:#292819;outline-color:#75643b}.result-records:has(.new-record) .current::before{background:var(--gold)}.result-records:has(.new-record) .current .record-rank,.result-records:has(.new-record) .current .record-build{color:var(--gold)}
.resultScreen:has(.result-records:not(:empty)){gap:10px}.resultScreen:has(.result-records:not(:empty)) .salvageart{width:110px}
.resultScreen:has(.result-records:not(:empty)) .rewardline>strong{font-size:40px;margin-top:-24px}
.resultScreen:has(.result-records:not(:empty)) .rewardline>span:not(.art){font-size:13px}
.resultScreen:has(.result-records:not(:empty)) .statsgrid b{font-size:28px}.resultScreen:has(.result-records:not(:empty)) .statsgrid span{font-size:12px}
.resultScreen:has(.result-records:not(:empty)) .panelnote:not(#contractResult){font-size:12px;line-height:1.4}
.recoverypanel #recoveryRecordNote{font-size:14px;color:#b5cbd8}
@media(max-height:700px){.result-records .mini-board{display:none}.resultScreen .result-records{padding:8px 10px}.resultScreen:has(.result-records:not(:empty)) .salvageart{width:70px}.resultScreen:has(.result-records:not(:empty)) .rewardline>strong{font-size:32px}.record-headline{font-size:13px}#statsSheet .records-panel{gap:10px}}
@media(max-width:350px){#statsSheet .records-panel{padding:16px 12px}.record-reading strong{font-size:18px}.record-ships button{font-size:14px}.record-build{font-size:9px}.flight-record{column-gap:6px;padding-inline:5px}.record-glyphs{gap:3px}.record-glyphs .glyph{width:15px;height:15px}.record-headline{font-size:13px}}
#hud:has(#recordChip:not(.hidden)) #overdriveHUD{top:56px}
/* Make room for the flight log while keeping the banked reward and actions visible. */
.resultScreen:has(.result-records:not(:empty)) .rewardline{flex-direction:row;justify-content:center;gap:10px}
.resultScreen:has(.result-records:not(:empty)) .rewardline .salvageart{width:56px}
.resultScreen:has(.result-records:not(:empty)) .rewardline>strong{margin:0}
.resultScreen:has(.result-records:not(:empty)) .rewardline>span:not(.art){margin:0}
@media(max-height:700px){
  .overlay.resultScreen:has(.result-records:not(:empty)){padding:14px 18px;gap:6px}
  .resultScreen:has(.result-records:not(:empty)) .resultheading .ovtitle{font-size:25px}
  .resultScreen:has(.result-records:not(:empty)) .rewardline .salvageart{width:44px}
  .resultScreen:has(.result-records:not(:empty)) .shipunlock{gap:6px;font-size:13px}
  .resultScreen:has(.result-records:not(:empty)) .shipunlock img{width:30px;height:30px}
  .resultScreen:has(.result-records:not(:empty)) .shipunlock b{font-size:10px}
  .resultScreen:has(.result-records:not(:empty)) .statsgrid b{font-size:25px;margin-bottom:2px}
  .resultScreen:has(.result-records:not(:empty)) .lantern-result{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:7px}
  .resultScreen:has(.result-records:not(:empty)) .lantern-result p{flex:1;font-size:11px;line-height:1.3}
  .resultScreen:has(.result-records:not(:empty)) .lantern-result .midbtn{width:110px;margin:0;font-size:11px;padding:6px;min-height:44px}
  .resultScreen:has(.result-records:not(:empty)) .lantern-result .flight-discoveries{flex-basis:100%;margin:0}
  .resultScreen:has(.result-records:not(:empty)) .menucol{gap:6px}
  .resultScreen:has(.result-records:not(:empty)) .menucol button{min-height:44px;padding:8px 12px;font-size:16px}
  .resultScreen:has(.result-records:not(:empty)) #contractResult{font-size:22px;line-height:1.2}
}
