/* v1.50.0: the game setup fits one normal phone screen (docs/CI-TIERS.md aside, design: Slipwoo "Játék beállítása" mock-ups).
   Loaded last: shorter theme card, size stones drawn as proportional boards, a green-to-red manual difficulty scale,
   an opaque Play button in every state and the bar for "no connection" / "download failed". */
body[data-ui-context="shell"] .free-setup{padding-top:calc(8px + env(safe-area-inset-top));padding-bottom:calc(10px + env(safe-area-inset-bottom))}
body[data-ui-context="shell"] .free-setup-card{gap:8px}
body[data-ui-context="shell"] .theme-choice-panel .theme-cinema{min-height:clamp(150px,calc(25 * var(--udvh)),230px)}
body[data-ui-context="shell"] .theme-cinema .theme-preview-label{bottom:12px}
body[data-ui-context="shell"] .theme-cinema .theme-preview-label strong{font-size:clamp(20px,calc(6 * var(--uvw)),28px)}
body[data-ui-context="shell"] .theme-cinema .theme-preview-label p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:12px;margin:2px 0 0}
body[data-ui-context="shell"] .theme-choice-title{margin:0}
body[data-ui-context="shell"] .theme-carousel-nav{min-height:40px}
body[data-ui-context="shell"] .theme-carousel-nav .theme-nav{width:40px;height:40px;min-height:40px}
body[data-ui-context="shell"] .range-control-block+.range-control-block{margin-top:8px}
body[data-ui-context="shell"] .range-control-title{margin-bottom:4px;font-size:15px}
/* the size block: title on the left, the chosen size on the right */
body[data-ui-context="shell"] .range-control-block:not(.challenge-block){display:grid;grid-template-columns:auto 1fr;align-items:baseline;column-gap:10px}
body[data-ui-context="shell"] .range-control-block:not(.challenge-block) #quickSize{grid-column:1/-1}
body[data-ui-context="shell"] .difficulty-range-value{margin:0 0 4px;font-size:13px}
body[data-ui-context="shell"] #sizeRangeValue{text-align:right}
body[data-ui-context="shell"] .difficulty-control-head{margin-bottom:6px}
body[data-ui-context="shell"] .selection-mode button{min-height:32px;padding:5px 12px}
.discrete-range{min-height:0}
.discrete-range .range-point{min-height:44px;gap:5px;padding:4px 0 2px}
/* sizes: a board drawn to scale (columns x rows), 4 px per cell */
.size-range .range-track{display:none}
.size-range .range-point::before{--c:5;--r:5;width:calc(var(--c) * 4px);height:calc(var(--r) * 4px);border-radius:3px;
 background:linear-gradient(to right,var(--sw-card) 1px,transparent 1px) 0 0/4px 4px,linear-gradient(to bottom,var(--sw-card) 1px,transparent 1px) 0 0/4px 4px,color-mix(in srgb,var(--fu-sky) 55%,var(--sw-card));box-shadow:none;transform:none}
.size-range .range-point:nth-child(1)::before{--c:3;--r:3}.size-range .range-point:nth-child(2)::before{--c:4;--r:4}.size-range .range-point:nth-child(3)::before{--c:5;--r:5}
.size-range .range-point:nth-child(4)::before{--c:5;--r:6}.size-range .range-point:nth-child(5)::before{--c:5;--r:7}.size-range .range-point:nth-child(6)::before{--c:5;--r:8}
.size-range .range-point{justify-content:flex-end}
.size-range .range-point[aria-pressed="true"]::before{background:linear-gradient(to right,var(--sw-card) 1px,transparent 1px) 0 0/4px 4px,linear-gradient(to bottom,var(--sw-card) 1px,transparent 1px) 0 0/4px 4px,var(--fu-sky)}
.size-range .range-point.range-endpoint::before{transform:none;box-shadow:0 0 0 2px var(--sw-card),0 0 0 4px var(--fu-sky)}
/* manual difficulty: nine bands from green to red, no repeat; chosen = full colour, others faded */
.difficulty-range .range-point{--stone:#2fb67c}
.difficulty-range .range-point:nth-child(1){--stone:#2fb67c}.difficulty-range .range-point:nth-child(2){--stone:#52bd6e}.difficulty-range .range-point:nth-child(3){--stone:#7fc45a}
.difficulty-range .range-point:nth-child(4){--stone:#a9c94a}.difficulty-range .range-point:nth-child(5){--stone:#d3c846}.difficulty-range .range-point:nth-child(6){--stone:#f0b93f}
.difficulty-range .range-point:nth-child(7){--stone:#f29a3a}.difficulty-range .range-point:nth-child(8){--stone:#ec7340}.difficulty-range .range-point:nth-child(9){--stone:#e04848}
.difficulty-range .range-point::before{width:100%;max-width:30px}
.difficulty-range .range-point[aria-pressed="false"]::before{opacity:.45}
.difficulty-range .range-fill{background:linear-gradient(90deg,#2fb67c,#d3c846,#e04848)!important}
body[data-ui-context="shell"] .challenge-description{min-height:0;font-size:12px;line-height:1.35}
.challenge-boosts{margin-top:4px}
/* Play: always opaque; the label and colour follow the state of the theme */
body[data-ui-context="shell"] .free-play-launch{min-height:52px}
#freeSetupPlay.is-blocked,#freeSetupPlay:disabled{opacity:1}
#freeSetupPlay:disabled{background:linear-gradient(165deg,#8a9aa3,#6b7b84);border-color:#a9b6bd;cursor:not-allowed}
#freeSetupPlay[data-state="download"],#freeSetupPlay[data-state="downloading"]{background:linear-gradient(165deg,#2f7fd0,#1f5da0);border-color:#7db5ee}
/* download state: the Play label and, under it, the size or the progress (two short lines, so no language needs a longer button text) */
#freeSetupPlay[data-state="download"],#freeSetupPlay[data-state="downloading"]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;line-height:1.15}
#freeSetupPlay .play-sub{display:block;font-size:12px;font-weight:600;letter-spacing:0;text-transform:none;opacity:.92}
#freeSetupPlay[data-state="login"]{background:linear-gradient(165deg,#7a63b8,#5a4a8a);border-color:#b3a3e0}
#freeSetupPlay[data-state="other"]{background:linear-gradient(165deg,#6b7b84,#4f5d65);border-color:#a9b6bd}
/* no connection / failed download: what is wrong + the way out right on the screen */
.theme-state-bar{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:12px;border:1px solid var(--sw-button-border);background:var(--sw-soft);color:var(--sw-text);font-size:12.5px;line-height:1.35}
.theme-state-bar[hidden]{display:none}
.theme-state-bar span{flex:1;min-width:0}
.theme-state-retry{flex:none;min-height:36px;padding:0 14px;border-radius:999px;border:1px solid var(--sw-button-border);background:var(--sw-button);color:var(--sw-text);font-weight:700;font-size:13px}
.theme-state-retry:focus-visible{outline:2px solid var(--sw-accent);outline-offset:2px}
@media(max-height:700px){body[data-ui-context="shell"] .theme-choice-panel .theme-cinema{min-height:130px}}

/* v1.50.8: the three parts (theme, size, difficulty) are three soft cards; the free height of a tall phone goes first into the theme picture
   (up to the whole artwork, 900x700, so it is not cropped), then into the gaps. On a very small screen the content scrolls and Play stays at the bottom. */
body[data-ui-context="shell"] .free-setup{grid-template-rows:minmax(100%,auto)}
body[data-ui-context="shell"] .free-setup-card{min-height:100%;container-type:inline-size;--setup-gap:clamp(8px,calc((100 * var(--udvh) - 700px) / 11),15px);gap:var(--setup-gap)}
body[data-ui-context="shell"] .free-quick{display:contents}
body[data-ui-context="shell"] .range-control-block+.range-control-block{margin-top:0}
body[data-ui-context="shell"] .theme-choice-panel,
body[data-ui-context="shell"] .range-control-block{background:color-mix(in srgb,var(--sw-soft) 85%,transparent);border-radius:18px;padding:10px 12px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sw-text) 9%,transparent)}
/* the theme card takes the free height; its picture stops at the artwork's own shape (the card is 24 px narrower than the setup card, the rest of it is --theme-extras) */
body[data-ui-context="shell"] .theme-choice-panel{--theme-extras:112px;flex:1 1 auto;display:flex;flex-direction:column;justify-content:space-between;
 max-height:calc((100cqw - 24px) * 700 / 900 + var(--theme-extras))}
body[data-ui-context="shell"] .theme-choice-panel .theme-cinema{flex:1 1 auto;max-height:calc((100cqw - 24px) * 700 / 900)}
body[data-ui-context="shell"] .free-play-launch{margin-top:auto}
/* the bar of Play: content that scrolls under it fades out instead of showing through (shadow layers, so the button itself stays opaque) */
body[data-ui-context="shell"] .free-play-launch{box-shadow:0 5px 0 var(--fu-play-base),0 10px 20px #B53A2833,0 0 0 9px color-mix(in srgb,var(--sw-card) 94%,transparent),0 -10px 14px 6px color-mix(in srgb,var(--sw-card) 94%,transparent)}
/* a low screen: tighter cards, so that the usual phones (from about 700 px) still fit one screen */
@media(max-height:700px){
 body[data-ui-context="shell"] .theme-choice-panel,body[data-ui-context="shell"] .range-control-block{padding:7px 10px;border-radius:15px}
 body[data-ui-context="shell"] .theme-choice-panel{--theme-extras:96px}
}
