/* =========================================================
   #199 phone menus, direction A ("barra de mando"), part 1:
   bottom bar (portrait) / left rail (landscape), home with the next run and one big PLAY,
   HQ reached from the bar. Only when main.js sets html[data-nav=bar] (touch or a window
   1000px wide or less); desktop keeps the classic main menu untouched.
   Bar sizes are CSS px, not game units: touch targets must stay >= 44px on every phone.
   ========================================================= */
html:not([data-nav=bar]) .bar-only{display:none !important;}
#screen:not([data-state=title]) .title-only{display:none !important;}

#ui{--nav-h:64px; --nav-w:84px;}

/* ---------------------------------------------------------- the bar */
.nav-bar{display:none;}
/* shown on the menus it leads between, while the game sits on its menus (never in a run, pause or end screen) */
html[data-nav=bar] #screen[data-state=title] #ui:is([data-screen=title], [data-screen=progression], [data-screen=board]) .nav-bar{display:grid;}
.nav-bar{
  position:absolute; z-index:4; left:0; right:0; bottom:0; height:var(--nav-h);
  grid-template-columns:repeat(5, minmax(0, 1fr)); align-items:stretch;
  pointer-events:auto; isolation:isolate; touch-action:manipulation;
}
/* the metal reaches under the home indicator / beside the notch; the buttons stay inside the safe area (#ui) */
.nav-bar::before{
  content:""; position:absolute; z-index:-1; top:0;
  left:calc(-1 * env(safe-area-inset-left, 0px)); right:calc(-1 * env(safe-area-inset-right, 0px)); bottom:calc(-1 * env(safe-area-inset-bottom, 0px));
  background:linear-gradient(180deg, rgba(255,226,190,.06), transparent 6px), linear-gradient(180deg, #1d1a19, #0b0908);
  box-shadow:inset 0 1px 0 rgba(255,226,190,.12), 0 -6px 16px rgba(0,0,0,.6);
}
.nav-bar::after{
  content:""; position:absolute; z-index:-1; top:-4px; height:4px;
  left:calc(-1 * env(safe-area-inset-left, 0px)); right:calc(-1 * env(safe-area-inset-right, 0px));
  background:repeating-linear-gradient(-45deg, var(--hazard) 0 4px, #15110b 4px 8px);
  box-shadow:0 1px 0 #050404;
}
.nav-bar button{
  position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
  min-width:44px; min-height:44px; padding:6px 2px 4px; color:#a8957d; outline:none;
}
.nav-bar .nb-ic{display:block; flex:none; width:30px; height:28px; background:center / contain no-repeat; image-rendering:pixelated; filter:drop-shadow(0 2px 0 #000);}
.nav-bar .nb-suits{background-image:var(--ic-helmet);}
.nav-bar .nb-arsenal{background-image:var(--ic-arsenal); width:40px; height:32px; margin:-2px 0;}
.nav-bar .nb-shop{background-image:var(--ic-shop); width:36px; height:32px; margin:-2px 0;}
.nav-bar .nb-hall{background-image:var(--ic-hall);}
.nav-bar .nb-label{
  display:block; max-width:100%; overflow:hidden; white-space:nowrap; padding:2px 1px 0;
  font:13px/1 var(--FD); letter-spacing:.05em; text-transform:uppercase; text-shadow:0 1px 0 #000;
}
.nav-bar button.on{color:var(--gold);}
.nav-bar button.on .nb-label{text-shadow:0 1px 0 #000, 0 0 8px rgba(255,190,60,.45);}
.nav-bar button:not(.nb-home).on::before{content:""; position:absolute; top:0; left:22%; right:22%; height:3px; background:var(--gold); box-shadow:0 0 8px rgba(255,190,60,.6);}
.nav-bar button:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
@media (hover:hover){ .nav-bar button:hover{color:var(--bone);} .nav-bar button.on:hover{color:var(--gold);} }
.nav-bar button:active .nb-ic{transform:translateY(1px);}
/* Home: the raised red key in the middle of the bar */
.nav-bar .nb-home{color:var(--bone);}
.nav-bar .nb-house{
  width:54px; height:50px; margin-top:-26px;
  background:var(--ic-house) center / 26px auto no-repeat, linear-gradient(180deg, rgba(255,220,160,.35) 0, transparent 3px), linear-gradient(180deg, #d8321a 0%, #9a1309 45%, #5a0604 100%);
  box-shadow:inset 0 1px 0 rgba(255,200,150,.5), inset 0 -2px 0 rgba(40,0,0,.7), 0 0 0 1px #1c0201, 0 4px 10px rgba(0,0,0,.6);
  clip-path:polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  filter:none; image-rendering:pixelated;
}
.nav-bar .nb-home.on .nb-label{color:#fff1df;}
.nav-bar .nb-badge{
  position:absolute; top:3px; left:calc(50% + 9px); min-width:20px; height:20px; padding:3px 4px 0;
  font:14px/1 var(--FD); color:#1a0d05; text-align:center; background:var(--gold); box-shadow:0 0 0 1px #000, 0 0 8px rgba(255,190,60,.5);
}
.nav-bar .nb-badge[hidden]{display:none;}

/* landscape: a rail on the left, beside the notch */
html[data-orient=landscape] .nav-bar{top:0; bottom:0; right:auto; width:var(--nav-w); height:auto; grid-template-columns:none; grid-template-rows:repeat(5, minmax(0, 1fr));}
html[data-orient=landscape] .nav-bar::before{top:calc(-1 * env(safe-area-inset-top, 0px)); right:0; box-shadow:inset -1px 0 0 rgba(255,226,190,.1), 6px 0 16px rgba(0,0,0,.6);}
html[data-orient=landscape] .nav-bar::after{top:calc(-1 * env(safe-area-inset-top, 0px)); bottom:calc(-1 * env(safe-area-inset-bottom, 0px)); left:auto; right:-4px; width:4px; height:auto;}
html[data-orient=landscape] .nav-bar button{gap:4px; padding:2px;}
html[data-orient=landscape] .nav-bar .nb-house{margin-top:0; width:48px; height:42px;}
html[data-orient=landscape] .nav-bar button:not(.nb-home).on::before{top:18%; bottom:18%; left:0; right:auto; width:3px; height:auto;}

/* screens with the bar keep their content clear of it */
html[data-nav=bar] #screen[data-state=title] #ui:is([data-screen=title], [data-screen=progression], [data-screen=board]) > :is(#title, #progression, #board){padding-bottom:calc(var(--nav-h) + 30px) !important;}   /* + the raised Home key */
html[data-nav=bar][data-orient=landscape] #screen[data-state=title] #ui:is([data-screen=title], [data-screen=progression], [data-screen=board]) > :is(#title, #progression, #board){
  padding-bottom:8px !important; padding-left:calc(var(--nav-w) + 12px) !important;
  /* one game unit, measured on the width the rail leaves */
  --u:min(calc((100cqw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - var(--nav-w) - 12px) / 640), calc((100cqh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / 360));
}
html[data-nav=bar][data-orient=landscape] #screen[data-state=title] #ui:is([data-screen=title], [data-screen=progression], [data-screen=board]) > .profile-chip{left:calc(var(--nav-w) + 12px);}

/* the bar replaces Back on the screens it leads to (Escape still goes home); Saves, opened from Settings, keeps it */
html[data-nav=bar] #screen[data-state=title] #ui[data-screen=progression] #progression:not([data-page=saves]) .hq-foot .back-btn,
html[data-nav=bar] #screen[data-state=title] #ui[data-screen=board] #board > .row-btns{display:none;}
/* HQ: the two rows of tabs go; Suits carries Stages and Missions as sub-tabs */
html[data-nav=bar] #progression #progressionTabs{display:none !important;}
#hqSubTabs{display:none;}
html[data-nav=bar] #progression:is([data-page=suits], [data-page=stages], [data-page=missions]) #hqSubTabs{display:grid;}
.hq-subtabs{grid-template-columns:repeat(3, minmax(0, 1fr)); gap:4px; flex:1 1 auto; min-width:0; margin:0;}
.hq-subtabs .tab{display:flex; align-items:center; justify-content:center; gap:7px; min-width:0; min-height:44px; padding:4px 6px 2px; clip-path:none; white-space:nowrap;}
.hq-subtabs .tab > span{min-width:0; overflow:hidden;}
.hq-subtabs .st-ic{flex:none; width:20px; height:18px; background:center / contain no-repeat; image-rendering:pixelated;}
.hq-subtabs .st-suits{background-image:var(--ic-helmet);}
.hq-subtabs .st-stages{background-image:var(--ic-portal);}
.hq-subtabs .st-missions{background-image:var(--ic-missions);}

/* ---------------------------------------------------------- home */
html[data-nav=bar] #title :is(.tagline, .menu, .title-keys, .title-release, #langBtn){display:none !important;}
html[data-nav=bar] #title{justify-content:flex-start; gap:12px;}
html[data-nav=bar] #title > .logo{order:1; margin-top:auto;}
html[data-nav=bar] #title > .next-run{order:2;}
html[data-nav=bar] #title > .best-line{order:3; margin-top:0; margin-bottom:auto;}
html[data-nav=bar] #title > .home-play{order:4; margin-top:auto; margin-bottom:0;}
html[data-nav=bar][data-orient=portrait] #title .logo-doom{font-size:max(calc(var(--u) * 100), 96px);}
html[data-nav=bar][data-orient=portrait] #title .logo::after{top:calc(var(--u) * 58);}
html[data-nav=bar][data-orient=portrait] #title .logo-surv{font-size:max(calc(var(--u) * 22), 24px);}
/* the best-run strip: one line under the card, wraps rather than cutting */
html[data-nav=bar] #title .best-line{max-width:min(100%, 420px);}

.home-top{position:absolute; z-index:3; top:calc(var(--u) * 10); right:calc(var(--u) * 12); display:flex; align-items:center; gap:8px; pointer-events:auto;}
.home-souls{
  display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:3px 12px 0;
  font:22px/1 var(--FD); letter-spacing:.03em; color:var(--ice); white-space:nowrap;
  background:#0a1316; box-shadow:inset 0 0 0 1px #2f4a57, 0 1px 0 rgba(255,255,255,.06);
}
.home-soul{flex:none; width:16px; height:16px; margin-top:-3px; background:var(--soul) center / contain no-repeat; filter:drop-shadow(0 0 4px rgba(120,210,255,.6));}
.home-gear{
  flex:none; width:48px; height:48px; outline:none; touch-action:manipulation;
  background:var(--ic-gear) center / 28px auto no-repeat, linear-gradient(#45474b, #1d1e20);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 0 rgba(0,0,0,.6), 0 0 0 1px #050404;
  image-rendering:pixelated;
}
.home-gear:focus-visible{box-shadow:inset 0 0 0 2px var(--gold), 0 0 0 1px #050404;}
.home-gear:active{transform:translateY(1px);}
/* the chip and the souls + settings group share the top band */
html[data-nav=bar] #ui[data-screen=title] > .profile-chip{max-width:min(46%, calc(100% - var(--u) * 24 - 196px));}

.next-run{
  position:relative; overflow:hidden; isolation:isolate; display:flex; flex-direction:column; align-items:stretch; gap:6px;
  width:min(100%, 420px); min-height:150px; padding:6px 12px 12px 14px; text-align:left; cursor:var(--cursor-sight), pointer;
  background:#0f0b0a; box-shadow:inset 0 0 0 1px #4a3d34, 0 0 0 1px #050404, 0 6px 14px rgba(0,0,0,.6); pointer-events:auto; touch-action:manipulation;
}
.nr-art{position:absolute; z-index:-2; inset:0; width:100%; height:100%; object-fit:cover; object-position:right center; image-rendering:pixelated;}
.next-run::before{content:""; position:absolute; z-index:-1; inset:0; background:linear-gradient(90deg, rgba(12,8,7,.94) 0, rgba(12,8,7,.72) 48%, rgba(12,8,7,.12) 100%), linear-gradient(0deg, rgba(12,8,7,.55), transparent 45%);}
.nr-head{display:flex; align-items:center; gap:8px; min-height:44px;}
.nr-eyebrow{flex:1 1 auto; min-width:0; font:14px/1.1 var(--FT); letter-spacing:.14em; text-transform:uppercase; color:var(--bone-dim); text-shadow:0 1px 0 #000;}
.nr-change{
  flex:none; display:inline-flex; align-items:center; gap:7px; min-height:44px; margin-right:-6px; padding:3px 6px 0;
  font:17px/1 var(--FD); letter-spacing:.06em; text-transform:uppercase; color:var(--gold); text-shadow:0 1px 0 #000; outline:none;
}
.nr-change i{width:9px; height:13px; margin-top:-3px; background:var(--ic-chevron) center / contain no-repeat; image-rendering:pixelated;}
.nr-change:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
.next-run:active{filter:brightness(1.15);}
.nr-stage{font:24px/1.05 var(--FD); letter-spacing:.04em; text-transform:uppercase; color:#fff1df; text-shadow:0 2px 0 #000, 0 0 10px rgba(0,0,0,.8); overflow-wrap:anywhere;}
.nr-chips{display:flex; flex-wrap:wrap; gap:8px; margin-top:auto;}
.nr-chip{
  display:inline-flex; align-items:center; gap:7px; min-height:36px; padding:3px 10px 0; white-space:nowrap;
  font:17px/1 var(--FD); letter-spacing:.04em; text-transform:uppercase; color:var(--bone);
  background:rgba(8,5,4,.86); box-shadow:inset 0 0 0 1px #4a3d34;
}
.nr-skulls{display:flex; gap:4px; margin-top:-3px;}
.nr-skulls i{width:19px; height:16px; background:var(--skull-dim) center / contain no-repeat;}
.nr-skulls i.on{background-image:var(--skull-red); filter:drop-shadow(0 0 3px rgba(255,60,20,.7));}
.nr-ic{flex:none; width:18px; height:18px; margin-top:-3px; background:center / contain no-repeat; image-rendering:pixelated;}
.nr-clock{background-image:var(--ic-clock);}
.nr-bolt{background-image:var(--ic-bolt);}
.nr-suit{flex:none; width:28px; height:28px; margin:-4px -2px -2px -4px; image-rendering:pixelated;}

.home-play{width:min(100%, 420px); min-height:72px; gap:16px; font-size:max(34px, calc(var(--u) * 26)); --notch:10px; pointer-events:auto;}
.home-play .play-ic{flex:none; width:26px; height:26px; margin-top:-3px; background:var(--ic-play) center / contain no-repeat; image-rendering:pixelated; filter:drop-shadow(0 2px 0 #3a0300);}

/* landscape home: logo and record on the left, the card over PLAY on the right */
html[data-nav=bar][data-orient=landscape] #title:not(.hidden){
  display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); grid-template-rows:minmax(0, 1fr) auto;
  grid-template-areas:"logo card" "best play"; align-items:center; column-gap:16px; row-gap:10px;
  padding-top:max(60px, calc(var(--u) * 52)) !important; padding-right:12px !important;
}
html[data-nav=bar][data-orient=landscape] #title > .logo{grid-area:logo; margin:0; align-self:center;}
html[data-nav=bar][data-orient=landscape] #title > .next-run{grid-area:card; justify-self:stretch; width:auto; align-self:end;}
html[data-nav=bar][data-orient=landscape] #title > .best-line{grid-area:best; margin:0; justify-self:center; align-self:center;}
html[data-nav=bar][data-orient=landscape] #title > .home-play{grid-area:play; width:auto; justify-self:stretch; min-height:60px; margin:0;}
html[data-nav=bar][data-orient=landscape] #title .logo-doom{font-size:max(calc(var(--u) * 84), 80px); margin-bottom:-8px;}
html[data-nav=bar][data-orient=landscape] #title .logo::after{top:calc(var(--u) * 50);}
html[data-nav=bar][data-orient=landscape] #title .logo-surv{font-size:max(calc(var(--u) * 20), 20px);}
html[data-nav=bar][data-orient=landscape] .next-run{min-height:0;}
html[data-nav=bar][data-orient=landscape] .nr-stage{font-size:22px;}

/* ---------------------------------------------------------- settings: what left the main menu */
.set-links{display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:8px;}
.set-links .btn{gap:10px; min-height:48px; font-size:max(17px, var(--fs-ctl));}
.set-links .sl-ic{flex:none; width:20px; height:20px; margin-top:-3px; background:center / contain no-repeat; image-rendering:pixelated;}
.set-links .sl-book{background-image:var(--ic-book);}
.set-links .sl-floppy{background-image:var(--ic-floppy);}
.set-release{margin-top:4px; text-align:center; font:max(13px, var(--fs-label))/1.2 var(--FT); letter-spacing:.1em; text-transform:uppercase; color:#8a7766;}
.set-release:empty{display:none;}

/* HQ and Hall: the profile chip stays on Home (and Settings > account); the pages get its band back */
html[data-nav=bar] #screen[data-state=title] #ui:is([data-screen=progression], [data-screen=board]) > .profile-chip{display:none;}
html[data-nav=bar][data-orient=portrait] #screen[data-state=title] #ui:is([data-screen=progression], [data-screen=board]) > :is(#progression, #board){padding-top:calc(var(--u) * 10) !important;}

/* thumb-sized controls inside the HQ pages the bar leads to (their layout is unchanged; part 3 redraws them) */
html[data-nav=bar] #progression .progression-body :is([data-action=arsenalFilter], [data-action=mode], .hq-saves .btn){min-height:44px;}
html[data-nav=bar] #progression .progression-body .hq-modes{height:auto;}

/* =========================================================
   #199 part 2: run setup in one screen, the end-of-run report, the bottom sheet
   ========================================================= */
/* ---------------------------------------------------------- run setup ("Partida") */
html[data-nav=bar] #runSetup > :not(#setupM){display:none !important;}
html[data-nav=bar] #screen #ui > #runSetup{padding:8px 12px 10px !important; gap:0; justify-content:flex-start; overflow-y:auto; overflow-x:hidden;}
html[data-nav=bar] #ui[data-screen=runSetup] > .profile-chip{display:none;}
.setup-m{display:flex; flex-direction:column; gap:10px; width:100%; max-width:460px; flex:1 0 auto; text-align:left;}
.sm-left, .sm-right{display:flex; flex-direction:column; gap:10px; min-width:0;}
.sm-right{flex:1 0 auto;}
.sm-head{display:flex; align-items:center; gap:12px; min-height:52px;}
.sm-back{
  flex:none; width:52px; height:48px; outline:none; touch-action:manipulation;
  background:linear-gradient(#45474b, #1d1e20); box-shadow:inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 0 rgba(0,0,0,.6), 0 0 0 1px #050404;
  clip-path:polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.sm-back i{display:block; width:24px; height:20px; margin:auto; background:var(--ic-back) center / contain no-repeat; image-rendering:pixelated;}
.sm-back:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
.sm-title{font:32px/1 var(--FD); letter-spacing:.05em; text-transform:uppercase; color:var(--ember); text-shadow:0 2px 0 #3a0300, 0 0 12px rgba(255,120,40,.45); padding-top:4px;}
/* stage carousel */
.sm-stage{position:relative; overflow:hidden; isolation:isolate; aspect-ratio:2 / 1; max-height:210px; touch-action:pan-y; box-shadow:0 0 0 2px var(--gold), 0 0 0 3px #050404, 0 0 14px rgba(255,190,60,.2);}
.sm-stage.is-locked{box-shadow:0 0 0 2px #5a4a3c, 0 0 0 3px #050404;}
.sm-art{position:absolute; z-index:-2; inset:0; width:100%; height:100%; object-fit:cover; image-rendering:pixelated;}
.sm-stage.is-locked .sm-art{filter:grayscale(.85) brightness(.45);}
.sm-arrow{position:absolute; top:calc(50% - 40px); width:48px; height:56px; z-index:2; outline:none; touch-action:manipulation; background:rgba(8,5,4,.55);}
.sm-arrow i{display:block; width:16px; height:22px; margin:auto; background:var(--gold); filter:drop-shadow(0 2px 0 #000);}
.sm-prev{left:0;} .sm-prev i{clip-path:polygon(100% 0, 0 50%, 100% 100%);}
.sm-next{right:0;} .sm-next i{clip-path:polygon(0 0, 100% 50%, 0 100%);}
.sm-arrow:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
/* the name and figures sit on their own dark plate, never straight on bright art */
.sm-plate{position:absolute; left:0; right:0; bottom:0; display:flex; flex-direction:column; gap:3px; padding:22px 8px 6px 14px; background:linear-gradient(180deg, transparent, rgba(8,5,4,.86) 34%, rgba(8,5,4,.94));}
.sm-mods{display:flex; align-items:center; gap:5px; font:15px/1 var(--FD); color:var(--bone-dim); white-space:nowrap;}
.sm-mods .sm-ic{width:15px; height:14px;}
.sm-mods .sm-ic + *{margin-right:6px;}
.sm-stage-row{display:flex; align-items:center; gap:6px; min-width:0;}
.sm-stage-name{flex:1 1 auto; min-width:0; font:24px/1.05 var(--FD); letter-spacing:.04em; text-transform:uppercase; color:#fff1df; text-shadow:0 2px 0 #000; overflow-wrap:anywhere;}
.sm-need{display:flex; align-items:center; gap:6px; font:15px/1.2 var(--FT); color:var(--gold);}
.sm-dots{display:flex; justify-content:center; gap:10px;}
.sm-dot{width:16px; height:16px; background:#2a2421; box-shadow:inset 0 0 0 1px #4a3d34;}
.sm-dot.on{background:var(--gold); box-shadow:0 0 6px rgba(255,190,60,.5);}
.sm-dot.locked{background:#1a1514 var(--lock) center / 8px auto no-repeat;}
.sm-dot.locked.on{background:var(--gold) var(--lock) center / 8px auto no-repeat;}
/* blocks: difficulty, duration, suit */
.sm-block{display:flex; flex-direction:column; gap:6px;}
.sm-label{display:flex; align-items:center; gap:6px; min-height:22px; font:14px/1 var(--FT); letter-spacing:.14em; text-transform:uppercase; color:var(--bone-dim);}
.sm-label b{color:var(--gold); letter-spacing:.06em; font-family:var(--FD); font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0;}
.sm-label .sm-info{margin:-12px -6px -12px auto;}
.sm-seg{display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0, 1fr); gap:4px; padding:3px; background:#060404; box-shadow:inset 0 0 0 1px #000, 0 0 0 1px #3c3530;}
.sm-seg button{display:flex; align-items:center; justify-content:center; gap:8px; min-height:52px; padding:3px 6px 0; color:#8a7766; background:#151313; outline:none; touch-action:manipulation; font:24px/1 var(--FD);}
.sm-seg button.on{color:#fff1dc; background:linear-gradient(#c22a12, #5a0704); box-shadow:inset 0 1px 0 rgba(255,200,150,.45);}
.sm-seg button:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
.sm-seg button:disabled{cursor:var(--cursor-sight), default;}
.sm-seg button.is-locked{color:#6b5a50;}
.sm-skulls{display:flex; gap:3px;}
.sm-skulls i{width:22px; height:19px; background:var(--skull-dim) center / contain no-repeat;}
.sm-skulls i.on{background-image:var(--skull-red); filter:drop-shadow(0 0 3px rgba(255,60,20,.7));}
.sm-diff.on .sm-skulls i:not(.on){background-image:var(--skull-dim); filter:brightness(1.6);}
.sm-diff-name{text-align:center; font:15px/1.2 var(--FT); color:var(--bone-dim);}
.sm-diff-name b{font:17px/1 var(--FD); letter-spacing:.05em; text-transform:uppercase; color:#fff1df;}
.sm-ic{display:inline-block; flex:none; width:20px; height:20px; background:center / contain no-repeat; image-rendering:pixelated; vertical-align:-3px;}
.sm-clock{background-image:var(--ic-clock);} .sm-bolt{background-image:var(--ic-bolt);} .sm-heart{background-image:var(--ic-heart);}
.sm-skull{background-image:var(--skull-red);} .sm-lock{background-image:var(--ic-lock-gold); width:14px; height:18px;} .sm-i-info{background-image:var(--ic-info);}
.sm-note{display:flex; align-items:flex-start; gap:7px; font:15px/1.25 var(--FT); color:var(--bone-dim);}
.sm-note .sm-lock{margin-top:1px;}
.sm-ability{color:var(--gold);}
/* a locked suit's requirements can run long: two lines here (one in landscape), all of it behind the suit's (i) */
.sm-note span{display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;}
button.sm-info{flex:none; display:grid; place-items:center; width:44px; height:44px; outline:none; touch-action:manipulation; border-radius:0;}
button.sm-info .sm-ic{width:22px; height:22px;}
button.sm-info:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
.sm-suits{display:grid; grid-template-columns:repeat(6, minmax(44px, 1fr)); gap:6px;}
html[data-nav=bar][data-orient=landscape] .sm-suits{gap:4px;}
.sm-suit{position:relative; display:grid; place-items:center; min-height:56px; aspect-ratio:1 / 1.12; outline:none; touch-action:manipulation; background:#1a1615; box-shadow:inset 0 0 0 1px #3b322c;}
.sm-suit canvas{width:88%; height:auto; aspect-ratio:1; image-rendering:pixelated;}
.sm-suit.on{box-shadow:inset 0 0 0 3px var(--gold), 0 0 10px rgba(255,190,60,.35);}
.sm-suit:focus-visible{box-shadow:inset 0 0 0 3px var(--ember);}
.sm-suit-lock{position:absolute; right:4px; bottom:4px; width:13px; height:16px; background:var(--ic-lock-gold) center / contain no-repeat; image-rendering:pixelated;}
.sm-buy .btn{width:100%; min-height:48px;}
.sm-go{margin-top:auto; position:sticky; bottom:0; z-index:3; width:100%; min-height:68px; gap:16px; font-size:max(32px, calc(var(--u) * 24)); --notch:10px;}
.sm-go .play-ic{flex:none; width:24px; height:24px; margin-top:-3px; background:var(--ic-play) center / contain no-repeat; image-rendering:pixelated;}
/* landscape: carousel on the left, choices and START on the right */
html[data-nav=bar][data-orient=landscape] .setup-m{display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); grid-template-rows:auto 1fr; column-gap:18px; row-gap:8px; max-width:900px;}
html[data-nav=bar][data-orient=landscape] .sm-head{grid-column:1; grid-row:1;}
html[data-nav=bar][data-orient=landscape] .sm-left{grid-column:1; grid-row:2;}
html[data-nav=bar][data-orient=landscape] .sm-right{grid-column:2; grid-row:1 / span 2; gap:6px;}
html[data-nav=bar][data-orient=landscape] .sm-seg button{min-height:46px;}
html[data-nav=bar][data-orient=landscape] .sm-suit{min-height:46px; aspect-ratio:auto;}
html[data-nav=bar][data-orient=landscape] .sm-suit canvas{width:auto; height:44px;}
html[data-nav=bar][data-orient=landscape] .sm-go{min-height:58px;}
html[data-nav=bar][data-orient=landscape] .sm-stage{max-height:none;}
html[data-nav=bar][data-orient=landscape] .sm-note span{-webkit-line-clamp:1;}
html[data-nav=bar][data-orient=landscape] .sm-right{gap:4px;}
html[data-nav=bar][data-orient=landscape] .sm-block{gap:4px;}
html[data-nav=bar][data-orient=landscape] .sm-label{min-height:18px;}
html[data-nav=bar][data-orient=landscape] .sm-seg button{min-height:44px;}
html[data-nav=bar][data-orient=landscape] .sm-suit{min-height:44px;}
html[data-nav=bar][data-orient=landscape] .sm-suit canvas{height:42px;}

/* ---------------------------------------------------------- end of run ("Fin de partida") */
html[data-nav=bar] .end-screen > :is(.row-btns, .end-sub){display:none !important;}
html[data-nav=bar] .end-screen:not(.hidden){overflow-y:auto; overflow-x:hidden; justify-content:flex-start; gap:10px; padding:8px 12px 10px !important;}
html[data-nav=bar] .end-screen :is(.end-body, .report){display:contents;}
html[data-nav=bar] .end-screen .report::before{display:none;}
html[data-nav=bar] .end-screen > *, html[data-nav=bar] .end-screen .report > *, html[data-nav=bar] .end-screen .end-body > .rank-panel{width:100%; max-width:460px; margin-left:auto; margin-right:auto; flex:none;}
html[data-nav=bar] .end-screen > .end-title{order:0; margin:4px auto 2px; font-size:max(48px, calc(var(--u) * 46)); width:auto;}
html[data-nav=bar] .end-screen > .victory-rays{width:auto; max-width:none;}
html[data-nav=bar] .end-screen .report > .report-status{order:1; margin-top:0; margin-bottom:0; text-align:center;}
html[data-nav=bar] .end-screen .report > .score-line{order:2;}
html[data-nav=bar] .end-screen .report > .big-stats{order:3;}
html[data-nav=bar] .end-screen .report > p:not(.report-status){order:4; margin:0 auto; text-align:center; font:14px/1.25 var(--FT); color:var(--bone-dim);}
html[data-nav=bar] .end-screen .report > .arsenal{order:5;}
html[data-nav=bar] .end-screen .report > .end-best{order:6; margin-top:0; padding-top:0; text-align:center; font-size:13px;}
html[data-nav=bar] .end-screen .end-body > .rank-panel{order:7;}
html[data-nav=bar] .end-screen > .end-actions{order:8;}
/* score: the one number that matters, big */
html[data-nav=bar] .end-screen .score-line{display:flex; flex-direction:column; align-items:center; gap:8px; margin-top:0; padding:12px 10px 14px;}
html[data-nav=bar] .end-screen .score-line .l{font-size:15px; letter-spacing:.16em;}
html[data-nav=bar] .end-screen .score-line > span:last-child{display:flex; flex-direction:column; align-items:center; gap:10px;}
html[data-nav=bar] .end-screen .score-line .v{font-size:56px;}
html[data-nav=bar] .end-screen .score-line .new{margin:0; font-size:16px; padding:5px 10px 2px;}
/* totals: four tiles with an icon each */
html[data-nav=bar] .end-screen .big-stats{grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; margin:0 auto;}
html[data-nav=bar] .end-screen .big-stat{display:flex; flex-direction:column; align-items:center; gap:5px; padding:12px 6px 10px; background:linear-gradient(180deg, #221e1c, #151211); box-shadow:inset 0 0 0 1px #3b322c, 0 0 0 1px #050404;}
html[data-nav=bar] .end-screen .big-stat::before{content:""; width:28px; height:26px; background:center / contain no-repeat; image-rendering:pixelated;}
html[data-nav=bar] .end-screen .big-stat:nth-child(1)::before{background-image:var(--ic-clock);}
html[data-nav=bar] .end-screen .big-stat:nth-child(2)::before{background-image:var(--skull-red);}
html[data-nav=bar] .end-screen .big-stat:nth-child(3)::before{background-image:var(--ic-up);}
html[data-nav=bar] .end-screen .big-stat:nth-child(4)::before{background-image:var(--soul); width:22px;}
html[data-nav=bar] .end-screen .big-stat .v{font-size:30px;}
html[data-nav=bar] .end-screen .big-stat .l{font-size:13px; margin-top:0;}
/* damage per weapon: name, bar, total (the DPS / kills / time columns stay on desktop) */
html[data-nav=bar] .end-screen .arsenal{margin:0 auto;}
html[data-nav=bar] .end-screen :is(.ars-head, .ars-row){grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);}
html[data-nav=bar] .end-screen .ars-head > :nth-child(n+3), html[data-nav=bar] .end-screen .ars-row > :is(.ars-dps, .ars-k, .ars-t){display:none;}
html[data-nav=bar] .end-screen .ars-head{font-size:13px; color:var(--ember);}
html[data-nav=bar] .end-screen .ars-row{min-height:36px; font-size:15px;}
html[data-nav=bar] .end-screen .ars-n b{font-size:15px;}
html[data-nav=bar] .end-screen .ars-n em, html[data-nav=bar] .end-screen .ars-n small{font-size:12px;}
html[data-nav=bar] .end-screen .ars-d b{font-size:15px; min-width:44px;}
html[data-nav=bar] .end-screen .ars-ic{width:24px; height:24px;} html[data-nav=bar] .end-screen .ars-ic canvas{width:20px; height:20px;}
/* ranking: one line, the lock (or a tick once the server has it) and an (i) holding the explanation */
html[data-nav=bar] .end-screen .rank-panel{display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; gap:6px 8px; min-height:0; padding:6px 4px 6px 12px; overflow:visible; max-height:none;}
html[data-nav=bar] .end-screen .rank-panel::before{display:none;}
html[data-nav=bar] .end-screen .rank-panel > :is(.panel-label, .rank-msg, .preview){display:none;}
html[data-nav=bar] .end-screen .rank-phases{flex:1 1 0; min-width:0; margin:0;}
html[data-nav=bar] .end-screen .rank-phase{display:flex; align-items:center; gap:10px; padding:0; background:none; box-shadow:none;}
html[data-nav=bar] .end-screen .rank-phase > :is(.rp-l, .rp-v, .rp-b){display:none;}
html[data-nav=bar] .end-screen .rank-phase::before{content:""; flex:none; width:16px; height:20px; background:var(--ic-lock-gold) center / contain no-repeat; image-rendering:pixelated;}
html[data-nav=bar] .end-screen .rank-phase[data-tone=ok]::before{background-image:var(--ic-check); width:18px;}
html[data-nav=bar] .end-screen .rank-phase .rp-s{font:15px/1.25 var(--FT); color:var(--bone);}
html[data-nav=bar] .end-screen .rank-phase.err .rp-s{color:#ff8a6a;}
html[data-nav=bar] .end-screen .rank-public{order:3; flex:1 1 100%; margin:0; justify-content:flex-end;}
html[data-nav=bar] .end-screen .rank-public > .rank-msg{display:none;}
html[data-nav=bar] .end-screen .rank-public .btn{min-height:44px; flex:1 1 auto;}
html[data-nav=bar] .end-screen .rank-public:not(:has(.btn, .name-form)){display:none;}
.rank-info{flex:none; display:grid; place-items:center; width:44px; height:44px; outline:none; touch-action:manipulation;}
.rank-info i{width:22px; height:22px; background:var(--ic-info) center / contain no-repeat; image-rendering:pixelated;}
.rank-info:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
/* the two actions in the thumb zone: Home as an icon, Again (or Keep fighting) three quarters wide */
.end-actions{display:grid; grid-template-columns:1fr 3fr; gap:10px; position:sticky; bottom:0; z-index:3; margin-top:auto !important; padding-top:6px; pointer-events:auto;}
.end-actions .btn{min-height:68px;}
.end-home i{display:block; width:34px; height:30px; background:var(--ic-house-plain) center / contain no-repeat; image-rendering:pixelated;}
.end-again{gap:14px; padding-left:22px; padding-right:22px; font-size:max(30px, calc(var(--u) * 22)); --notch:10px;}
.ea-ic{flex:none; width:28px; height:26px; margin-top:-3px; background:center / contain no-repeat; image-rendering:pixelated;}
.ea-retry{background-image:var(--ic-retry);} .ea-bolt{background-image:var(--ic-bolt);}
/* landscape: title, score and totals on the left; weapons, ranking and the actions on the right */
/* left: title, score and totals in flow; right: the weapons on top, ranking and the actions pinned to the bottom corner */
html[data-nav=bar][data-orient=landscape] .end-screen:not(.hidden){display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow:row dense; align-content:start; column-gap:18px; row-gap:6px;}
html[data-nav=bar][data-orient=landscape] .end-screen > *, html[data-nav=bar][data-orient=landscape] .end-screen .report > *, html[data-nav=bar][data-orient=landscape] .end-screen .end-body > .rank-panel{grid-column:1; max-width:none;}
html[data-nav=bar][data-orient=landscape] .end-screen > .end-title{font-size:44px; margin:0 auto;}
html[data-nav=bar][data-orient=landscape] .end-screen .report > .score-line{padding:8px 10px 10px; gap:4px;}
html[data-nav=bar][data-orient=landscape] .end-screen .score-line .v{font-size:40px;}
html[data-nav=bar][data-orient=landscape] .end-screen .big-stats{grid-template-columns:repeat(4, minmax(0, 1fr)); gap:6px;}
html[data-nav=bar][data-orient=landscape] .end-screen .big-stat{padding:8px 4px 6px;}
html[data-nav=bar][data-orient=landscape] .end-screen .big-stat .v{font-size:24px;}
html[data-nav=bar][data-orient=landscape] .end-screen .report > .arsenal{grid-column:2; grid-row:1 / span 6; align-self:start; max-height:calc(100% - 200px); overflow-y:auto; overscroll-behavior:contain;}
html[data-nav=bar][data-orient=landscape] .end-screen .ars-rows{max-height:none;}
html[data-nav=bar][data-orient=landscape] .end-screen .end-body > .rank-panel, html[data-nav=bar][data-orient=landscape] .end-screen > .end-actions{position:absolute; right:12px; width:calc(50% - 21px); margin:0 !important;}
html[data-nav=bar][data-orient=landscape] .end-screen > .end-actions{bottom:10px;}
html[data-nav=bar][data-orient=landscape] .end-screen .end-body > .rank-panel{bottom:80px;}
html[data-nav=bar][data-orient=landscape] .end-actions .btn{min-height:58px;}

/* ---------------------------------------------------------- bottom sheet: the long texts, one tap away */
.sheet{position:absolute; inset:0; z-index:20; display:flex; align-items:flex-end; justify-content:center; pointer-events:auto;}
.sheet[hidden]{display:none;}
.sheet-back{position:absolute; inset:calc(-1 * env(safe-area-inset-top, 0px)) calc(-1 * env(safe-area-inset-right, 0px)) calc(-1 * env(safe-area-inset-bottom, 0px)) calc(-1 * env(safe-area-inset-left, 0px)); background:rgba(3,2,2,.72);}
.sheet-panel{position:relative; display:flex; flex-direction:column; width:min(100%, 520px); max-height:78%; padding:6px 6px 14px 16px; text-align:left; animation:sheetUp .18s ease-out;}
@keyframes sheetUp{from{transform:translateY(24px); opacity:0;} to{transform:none; opacity:1;}}
.sheet-head{display:flex; align-items:center; gap:8px; min-height:48px;}
.sheet-title{flex:1 1 auto; min-width:0; font:24px/1.05 var(--FD); letter-spacing:.04em; text-transform:uppercase; color:var(--ember); overflow-wrap:anywhere;}
.sheet-x{flex:none; display:grid; place-items:center; width:48px; height:48px; outline:none;}
.sheet-x i{width:18px; height:16px; background:var(--ic-close) center / contain no-repeat; image-rendering:pixelated;}
.sheet-x:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
.sheet-body{overflow-y:auto; overscroll-behavior:contain; touch-action:pan-y; padding-right:10px; display:flex; flex-direction:column; gap:8px; font:16px/1.3 var(--FT); color:var(--bone);}
.sheet-body p, .sheet-body li{font:16px/1.3 var(--FT);}
.sheet-body .sh-lead{color:var(--gold);}
.sheet-body .sh-need{color:var(--gold);}
.sheet-body ul{margin:0 0 0 18px;}
.sheet-body .eyebrow{font-size:13px; margin-top:4px;}
.sheet-body .rank-sheet{display:flex; flex-direction:column; gap:8px;}
.sheet-body .rank-public .btn{min-height:44px;}
html[data-orient=landscape] .sheet-panel{max-height:92%;}

/* ---------------------------------------------------------- part 1 review: home card text never straight on bright art */
.nr-change{background:rgba(8,5,4,.88); box-shadow:inset 0 0 0 1px #6e5226; margin-right:-4px; padding:3px 10px 0;}
.nr-stage{align-self:flex-start; max-width:100%; padding:4px 8px 1px; margin-left:-8px; background:rgba(8,5,4,.8);}
/* short phones (iPhone SE and smaller): a flatter stage card and slimmer rows keep START off the suits */
@media (max-height:700px){
  html[data-nav=bar][data-orient=portrait] .sm-stage{aspect-ratio:2.5 / 1;}
  html[data-nav=bar][data-orient=portrait] .sm-seg button{min-height:46px;}
  html[data-nav=bar][data-orient=portrait] .setup-m{gap:6px;}
  html[data-nav=bar][data-orient=portrait] .sm-head{min-height:48px;}
  html[data-nav=bar][data-orient=portrait] .sm-go{min-height:60px;}
}
.end-again{white-space:nowrap;}
html[data-nav=bar][data-orient=landscape] .end-again{font-size:26px; gap:10px; padding-left:14px; padding-right:14px;}

/* =========================================================
   #199 part 3: inner layouts of Suits, Arsenal, Upgrades, Hall and Settings (phones)
   ========================================================= */
/* ---------------------------------------------------------- HQ and Hall headers: the page name on the left, the account on the right */
html[data-nav=bar] #screen[data-state=title] :is(#progression, #board) > .screen-head{justify-content:flex-start; padding-right:56px; min-height:48px;}
html[data-nav=bar] #screen[data-state=title] :is(#progression, #board) > .screen-head .hazard{display:none;}
html[data-nav=bar] #screen[data-state=title] :is(#progression, #board) > .screen-head .screen-title{text-align:left; text-transform:uppercase; font-size:max(30px, calc(var(--u) * 26));}
/* the profile chip comes back as an avatar button in the corner: the account is one tap away from every bar page */
html[data-nav=bar] #screen[data-state=title] #ui:is([data-screen=progression], [data-screen=board]) > .profile-chip{display:flex; left:auto; right:12px; top:calc(var(--u) * 10); max-width:none; min-height:48px; padding:3px;}
html[data-nav=bar] #screen[data-state=title] #ui:is([data-screen=progression], [data-screen=board]) > .profile-chip .pc-text{display:none;}
html[data-nav=bar] #screen[data-state=title] #ui:is([data-screen=progression], [data-screen=board]) > .profile-chip .pc-avatar{width:42px; height:42px;}
html[data-nav=bar][data-orient=landscape] #screen[data-state=title] #ui:is([data-screen=progression], [data-screen=board]) > .profile-chip{top:6px; left:auto;}

/* ---------------------------------------------------------- Suits: portrait grid with a status strip, the sheet under it */
html[data-nav=bar] #progression .suit-tile{padding:6px 6px 0; gap:0; justify-content:flex-end; min-height:96px;}
html[data-nav=bar] #progression .suit-tile .suit-name{display:none;}
html[data-nav=bar] #progression .suit-tile .suit-portrait{flex:1 1 auto; width:100%; max-height:84px; object-fit:contain;}
html[data-nav=bar] #progression .suit-tile .suit-tag{align-self:stretch; justify-content:center; margin:0 -6px; min-height:26px; padding:4px 4px 1px; font-size:16px; letter-spacing:.02em; overflow:visible;}
html[data-nav=bar] #progression .suit-tile .suit-tag.tag-cost{font-size:0; gap:5px; color:var(--ice); background:rgba(6,4,4,.85);}
html[data-nav=bar] #progression .suit-tile .suit-tag.tag-cost::before{content:""; width:14px; height:14px; background:var(--soul) center / contain no-repeat;}
html[data-nav=bar] #progression .suit-tile .suit-tag.tag-cost::after{content:attr(data-short); font:17px/1 var(--FD); letter-spacing:.02em;}
html[data-nav=bar] #progression .suit-tile .suit-tag.tag-locked{font-size:0; background:rgba(6,4,4,.85); box-shadow:none;}
html[data-nav=bar] #progression .suit-tile .suit-tag.tag-locked::before{width:12px; height:16px;}
html[data-nav=bar] #progression .suit-tile .suit-tag.tag-equipped{font-size:0; background:rgba(20,60,20,.8); box-shadow:none;}
html[data-nav=bar] #progression .suit-tile .suit-tag.tag-equipped::before{content:""; width:20px; height:14px; background:var(--ic-check) center / contain no-repeat; image-rendering:pixelated;}
html[data-nav=bar] #progression .suit-dossier{gap:8px; padding:12px;}
html[data-nav=bar] #progression .suit-head{grid-template-columns:72px minmax(0, 1fr) auto;}
html[data-nav=bar] #progression .suit-body > :is(.suit-desc, .suit-weapon-row, .suit-stats){display:none;}
html[data-nav=bar] #progression .suit-body .suit-ability{display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden;}
html[data-nav=bar] #progression .suit-body .suit-needs{display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;}
html[data-nav=bar] #progression .suit-confirm{min-height:56px; font-size:max(24px, var(--fs-btn));}
.suit-info{flex:none; display:grid; place-items:center; width:48px; height:48px; outline:none; background:linear-gradient(#45474b, #1d1e20); box-shadow:inset 0 1px 0 rgba(255,255,255,.25), 0 0 0 1px #050404;}
.suit-info i{width:22px; height:22px; background:var(--ic-info) center / contain no-repeat; image-rendering:pixelated;}
.suit-info:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}

/* ---------------------------------------------------------- Arsenal: status filters as icons with counts, a grid of icon tiles */
.hq-ars-filters{display:flex; gap:6px; flex-wrap:nowrap;}
.hq-af{display:inline-flex; align-items:center; justify-content:center; gap:7px; min-width:56px; min-height:48px; padding:3px 12px 0; outline:none; font:18px/1 var(--FD); letter-spacing:.04em; text-transform:uppercase; color:var(--bone-dim); background:#151313; box-shadow:inset 0 0 0 1px #3b322c;}
.hq-af.on{color:#fff1dc; box-shadow:inset 0 0 0 2px var(--gold);}
.hq-af:focus-visible{box-shadow:inset 0 0 0 2px var(--ember);}
.hq-af b{color:inherit; font-weight:normal;}
.hq-af span{white-space:nowrap;}
.hq-af i{width:16px; height:16px; margin-top:-3px; background:center / contain no-repeat; image-rendering:pixelated;}
.hq-af-available i{background-image:var(--soul);}
.hq-af-owned i{background-image:var(--ic-check); width:18px;}
.hq-af-locked i{background-image:var(--ic-lock-gold); width:13px;}
.hq-ars-grid{display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:6px;}
html[data-orient=landscape] .hq-ars-grid{grid-template-columns:repeat(auto-fill, minmax(72px, 1fr));}
.hq-at{position:relative; display:grid; place-items:center; aspect-ratio:1 / .9; min-height:56px; outline:none; touch-action:manipulation; background:#1a1615; box-shadow:inset 0 0 0 1px #3b322c;}
.hq-at.is-owned{box-shadow:inset 0 0 0 1px #3d5a35;}
.hq-at.is-available{box-shadow:inset 0 0 0 2px var(--gold);}
.hq-at.is-short{box-shadow:inset 0 0 0 1px #6e5226;}
.hq-at:focus-visible{box-shadow:inset 0 0 0 3px var(--ember);}
.hq-at .hq-icon{width:62%; height:auto; aspect-ratio:1; background:none; box-shadow:none;}
.hq-at.is-locked .hq-icon canvas{filter:brightness(0); opacity:.55;}
.hq-at-ok, .hq-at-lock{position:absolute; right:5px; bottom:5px; background:center / contain no-repeat; image-rendering:pixelated;}
.hq-at-ok{width:16px; height:12px; background-image:var(--ic-check);}
.hq-at-lock{width:11px; height:14px; background-image:var(--ic-lock-gold); opacity:.8;}
.hq-at-price{position:absolute; left:4px; right:4px; bottom:4px; display:flex; align-items:center; justify-content:center; gap:4px; padding:3px 2px 0; font:15px/1 var(--FD); color:var(--ice); background:rgba(6,4,4,.85);}
.hq-at-price.short{color:#a8957d;}
.hq-at-price .hq-soul{width:11px; height:11px; margin-top:-3px;}
.hq-at-new{position:absolute; left:3px; top:3px; padding:2px 4px 0; font:11px/1 var(--FD); letter-spacing:.05em; text-transform:uppercase; color:#140c02; background:var(--gold);}
.sheet-body .sh-item{display:flex; align-items:center; gap:12px;}
.sheet-body .sh-item .hq-icon{width:56px; height:56px;}
.sheet-body .sh-buy{min-height:56px; width:100%; font-size:22px;}
.sheet-body .sh-owned{color:#bfe8b0; font-family:var(--FD); text-transform:uppercase; letter-spacing:.06em;}
.sheet-body .hq-unlock{margin:0;}
.sheet-body .hq-reqs{margin:0; list-style:none;}

/* ---------------------------------------------------------- Upgrades: icon, pips, the next effect and the price; refund stays two steps */
html[data-nav=bar] #progression[data-page=shop] .hq-intro .hq-hint{display:none;}
html[data-nav=bar] #progression[data-page=shop] .hq-intro{justify-content:flex-end;}
html[data-nav=bar] #progression .hq-refund{min-height:48px;}
html[data-nav=bar] #progression .hq-up .hq-desc{display:none;}
html[data-nav=bar] #progression .hq-up .hq-head{display:grid; grid-template-columns:40px minmax(0, 1fr); grid-template-areas:"ic name" "ic rank"; align-items:center; gap:4px 10px;}
html[data-nav=bar] #progression .hq-up .hq-head:not(:has(.hq-up-ic)){grid-template-areas:"name name" "rank rank";}
html[data-nav=bar] #progression .hq-up .hq-up-ic{grid-area:ic; width:40px; height:40px; background:none; box-shadow:none;}
html[data-nav=bar] #progression .hq-up .hq-name{grid-area:name; min-width:0; overflow-wrap:break-word; hyphens:auto;}
html[data-nav=bar] #progression .hq-up .hq-rank{grid-area:rank; margin-left:0; justify-self:start;}
html[data-nav=bar] #progression .hq-up .hq-rank b{display:none;}
html[data-nav=bar] #progression .hq-up .hq-pips i{width:10px; height:7px;}
html[data-nav=bar] #progression .hq-up .hq-buy{min-height:48px;}
html[data-nav=bar] #progression .hq-confirm .btn{min-height:52px;}

/* ---------------------------------------------------------- Hall: skulls for the difficulty, two rows of filters, your row pinned */
html[data-nav=bar] #board .board-panel .tabs .tab{font-size:0; min-height:52px;}
html[data-nav=bar] #board .board-panel .tabs .tab::before{content:""; display:block; width:78px; height:22px; margin:auto;
  background:var(--sk1, var(--skull-red)) 0 50% / 24px 21px no-repeat, var(--sk2, var(--skull-dim)) 27px 50% / 24px 21px no-repeat, var(--sk3, var(--skull-dim)) 54px 50% / 24px 21px no-repeat;}
html[data-nav=bar] #board .board-panel .tabs .tab[data-diff=normal]{--sk2:var(--skull-red);}
html[data-nav=bar] #board .board-panel .tabs .tab[data-diff=nightmare]{--sk2:var(--skull-red); --sk3:var(--skull-red);}
html[data-nav=bar] #board .bf-main{display:grid; grid-template-columns:minmax(0, 1fr) auto; grid-template-areas:"season more" "mode mode"; gap:6px;}
html[data-nav=bar] #board .bf-main > .bf-season{grid-area:season;} html[data-nav=bar] #board .bf-main > .bf-mode{grid-area:mode;} html[data-nav=bar] #board .bf-main > .bf-more{grid-area:more; justify-self:stretch; min-height:48px; white-space:nowrap;}
html[data-nav=bar] #board .board-filters .bf > .eyebrow{position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;}
html[data-nav=bar] #board .board-filters .pick-label, html[data-nav=bar] #board .board-filters .seg button{white-space:nowrap;}
html[data-nav=bar] #board .board-filters .pick, html[data-nav=bar] #board .board-filters .seg{min-height:48px;}
html[data-nav=bar] #board .board-filters.legacy .bf-main{grid-template-areas:"season" "mode"; grid-template-columns:minmax(0, 1fr);}
html[data-nav=bar] #board .board-list .brow.me{position:sticky; bottom:0; z-index:2; background:linear-gradient(90deg, #5a1408, #2a0704); box-shadow:inset 0 0 0 2px #ff5a2a;}

/* ---------------------------------------------------------- Settings: 48px rows, switches, thumb-sized sliders */
html[data-nav=bar] #settings .set-row{min-height:52px; padding:2px 0; box-shadow:0 1px 0 rgba(255,226,190,.06);}
html[data-nav=bar] #settings .set-label{font-size:max(16px, var(--fs-ctl)); line-height:1.15;}
html[data-nav=bar] #settings .set-hint{display:none;}
.set-info{flex:none; display:grid; place-items:center; width:44px; height:44px; margin:0 -6px 0 auto; outline:none;}
.set-info i{width:20px; height:20px; background:var(--ic-info) center / contain no-repeat; image-rendering:pixelated;}
.set-info:focus-visible{box-shadow:inset 0 0 0 2px var(--gold);}
/* an On/Off pair becomes one switch (ui.js flips it on any tap); both buttons stay for keyboards and screen readers */
html[data-nav=bar] #settings .seg[data-key]:has(> button:nth-child(2):last-child){position:relative; flex:none; display:block; width:88px; height:44px; padding:0; background:#0b0807; box-shadow:inset 0 0 0 2px #3c3530; cursor:var(--cursor-sight), pointer;}
html[data-nav=bar] #settings .seg[data-key]:has(> button:nth-child(2):last-child) > button{position:absolute; top:0; bottom:0; width:50%; min-width:0; padding:0; font-size:0; background:none; box-shadow:none;}
html[data-nav=bar] #settings .seg[data-key]:has(> button:nth-child(2):last-child) > button:first-child{left:0;}
html[data-nav=bar] #settings .seg[data-key]:has(> button:nth-child(2):last-child) > button:last-child{right:0;}
html[data-nav=bar] #settings .seg[data-key]:has(> button:nth-child(2):last-child)::before{content:""; position:absolute; inset:4px; background:#1d1918; transition:background .12s;}
html[data-nav=bar] #settings .seg[data-key]:has(> button[data-v=on].on)::before{background:linear-gradient(#c22a12, #5a0704);}
html[data-nav=bar] #settings .seg[data-key]:has(> button:nth-child(2):last-child)::after{content:""; position:absolute; top:7px; bottom:7px; left:7px; width:34px; background:linear-gradient(#5d6066, #2e3033); box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 0 0 1px #050404; transition:transform .12s;}
html[data-nav=bar] #settings .seg[data-key]:has(> button[data-v=on].on)::after{transform:translateX(40px); background:linear-gradient(#fff1df, #c9b89c);}
html[data-nav=bar] #settings .seg[data-key]:has(> button:nth-child(2):last-child):focus-within{box-shadow:inset 0 0 0 2px var(--gold);}
html[data-nav=bar] #settings .seg:not(:has(> button:nth-child(2):last-child)) button{min-height:44px;}
html[data-nav=bar] #settings .range{flex:1 1 auto; justify-content:flex-end; min-width:0;}
html[data-nav=bar] #settings input[type=range]{flex:1 1 auto; min-width:120px; max-width:220px; height:44px; background-size:100% 14px; background-position:center; background-repeat:no-repeat; box-shadow:none;}
html[data-nav=bar] #settings input[type=range]::-webkit-slider-thumb{width:20px; height:36px;}
html[data-nav=bar] #settings input[type=range]::-moz-range-thumb{width:20px; height:36px;}
html[data-nav=bar] #settings .range-val{width:30px; font-size:20px;}
html[data-nav=bar] #settings :is(.set-btn, .lang-pick, .set-links .btn){min-height:48px;}
html[data-nav=bar] #settings .settings-panel{gap:2px;}

/* ---------------------------------------------------------- leftovers: short phones in run setup */
@media (max-height:700px){
  html[data-nav=bar][data-orient=portrait] .sm-stage{aspect-ratio:2.9 / 1;}
  html[data-nav=bar][data-orient=portrait] .sm-dots{display:none;}
  html[data-nav=bar][data-orient=portrait] .sm-suit{min-height:48px; aspect-ratio:auto;}
  html[data-nav=bar][data-orient=portrait] .sm-suit canvas{width:auto; height:46px;}
  html[data-nav=bar][data-orient=portrait] .sm-note span{-webkit-line-clamp:1;}
}
html[data-nav=bar] #settings .settings-panel{width:min(100%, 560px);}
/* a long setting name wraps onto two lines beside its control instead of pushing the control under it */
html[data-nav=bar] #settings .set-row{flex-wrap:nowrap;}
html[data-nav=bar] #settings .set-row > .set-label{flex:1 1 auto; min-width:0; overflow-wrap:break-word;}
html[data-nav=bar] #board .bf-main > .bf-mode{justify-self:stretch;} html[data-nav=bar] #board .bf-main > .bf-mode .seg{width:100%;}
/* portrait Hall: the list scrolls inside its panel (not the page), so your row can stay pinned at its foot */
html[data-nav=bar][data-orient=portrait] #screen[data-state=title] #ui[data-screen=board] > #board{overflow:hidden;}
html[data-nav=bar][data-orient=portrait] #board .board-panel{flex:1 1 auto; min-height:0;}
html[data-nav=bar][data-orient=portrait] #board .board-panel > .board-list{flex:1 1 auto; min-height:0; overflow-y:auto;}
