/* Identical title and control slots on Home, Free Play and all three games. */
.studioTopbar.studioTopbar{display:grid;width:100%;max-width:none;margin:0;grid-template-columns:minmax(0,1fr) 40px 72px 40px;gap:8px;align-items:center;justify-content:stretch;flex:0 0 56px;height:56px;min-height:56px;padding:7px 20px;border:0}
.studioTopbar.studioTopbar .brand{grid-column:1;grid-row:1;justify-self:start;display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;margin:0;padding:0;font-size:27px;line-height:1.2;letter-spacing:2px}
html[lang=en] .studioTopbar.studioTopbar .brand{font-size:30px;letter-spacing:0}
.studioTopbar .brand>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.studioTopbar.studioTopbar .brand .mark{display:block!important}
.studioTopbar.studioTopbar :is(#sound,#soundToggle){grid-column:2;grid-row:1}
.studioTopbar.studioTopbar :is(#menuBtn,#settings,.homeSettings){grid-column:4;grid-row:1}
.studioTopbar.studioTopbar :is(.roundBtn,.gearBtn,.homeSettings){display:grid;place-items:center;position:relative;justify-self:center;width:40px;height:40px;min-width:40px;min-height:40px;margin:0;padding:0;border:0;background:transparent;box-shadow:none}
.studioTopbar.studioTopbar :is(.pbCompact,.homeLink){grid-column:3;grid-row:1;justify-self:stretch;align-self:center;width:100%;min-width:0;max-width:none;margin:0;padding:0}
.studioTopbar.studioTopbar .pbCompact a,.studioTopbar.studioTopbar .homeLink{display:grid;place-items:center;width:100%;min-height:36px;padding:6px 10px;font:13px/1.2 var(--studioFont,serif);letter-spacing:0}
.studioTopbar.studioTopbar :is(.prop-menu,.prop-sound,.homeGear,.gearArt){display:block;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:60px;height:40px;min-width:60px;margin:0;flex:none;background-size:300% 300%}
@media(max-width:600px){
 .studioTopbar.studioTopbar{grid-template-columns:minmax(0,1fr) 0 52px 34px;gap:4px;padding:3px 8px;flex-basis:46px;height:46px;min-height:46px}
 .studioTopbar.studioTopbar .brand,html[lang=en] .studioTopbar.studioTopbar .brand{font-size:22px;gap:6px;letter-spacing:0}
 .studioTopbar.studioTopbar :is(#sound,#soundToggle){display:none}
 .studioTopbar.studioTopbar :is(.roundBtn,.gearBtn,.homeSettings){width:34px;height:34px;min-width:34px;min-height:34px}
 .studioTopbar.studioTopbar :is(.prop-menu,.homeGear,.gearArt){width:48px;height:32px;min-width:48px}
 .studioTopbar.studioTopbar .pbCompact a,.studioTopbar.studioTopbar .homeLink{min-height:34px;padding:5px;font-size:12px}
}

/* The complete story and continuation action share the artwork's centre. */
.cultureCard .cultureTitle{color:#173e47!important;text-shadow:none!important}
@media(min-width:601px){
 .arcade #classicResult{justify-content:center}
 .bloomSwap.swap-won .swapSide{grid-template-rows:minmax(0,1fr) 22px;gap:8px}
 .bloomSwap.swap-won .completion{position:relative;inset:auto;display:flex;align-items:center;justify-content:center;width:100%;height:100%;max-height:none;padding:0;overflow:hidden}
 .bloomSwap.swap-won .completion .winPanel{display:flex;flex-direction:column;justify-content:center;width:100%;height:auto;max-height:100%;min-height:0;padding:0;overflow:visible;pointer-events:auto}
 .rings-won .ringStudio .result:not([hidden]){justify-content:center;padding:104px 0}
 .rings-won #result>.cultureCard{max-height:calc(var(--result-art-height,600px) - 76px)}
}
@media(min-width:601px) and (max-height:590px){
 .rings-won .ringStudio .result:not([hidden]){padding:80px 0}
}

/* Nested artwork occupies one cell, without inherited page row numbers. */
.swapViewport>.frame,.ringViewport>.hoop{grid-area:1 / 1}

/* Reference inspection and collection use the same compact studio actions. */
.bloomSwap #swapPreviewDialog{position:fixed;inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);margin:0;width:min(94vw,900px,calc(var(--play-height,100dvh) - 80px));max-width:94vw;max-height:calc(var(--play-height,100dvh) - 24px);padding:52px 0 0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
.bloomSwap #swapPreviewDialog::backdrop{background:#102731c9;backdrop-filter:blur(4px)}
.bloomSwap #swapPreviewDialog .close{position:absolute;top:0;right:0;width:44px;height:44px;min-height:44px;padding:0;border:1px solid #c8af76;border-radius:50%;background:#183d46;color:#fff0cf}
.bloomSwap #swapPreviewImage{display:block;width:100%;max-height:calc(var(--play-height,100dvh) - 100px);object-fit:contain;border:1px solid #d3ba83}
.ringStudio .tools{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:600px){
 /* All three games reserve the same 96px result and 56px toolbar before fitting art. */
 .bloomSwap main,.ringStudio>main{padding:0 8px;grid-template-rows:22px 30px 25px minmax(0,1fr) 96px 56px;gap:2px;grid-template-columns:minmax(0,1fr)}
 .bloomSwap .level,.ringStudio .ribbon{grid-row:1;line-height:22px;margin:0;font-size:11px}
 .bloomSwap h1,.ringStudio h1{grid-row:2}
 .bloomSwap .stats,.ringStudio .hud{grid-row:3;margin:0;padding:0 5px;font-size:11px}
 .bloomSwap .swapViewport,.ringStudio .ringViewport{grid-row:4}
 .bloomSwap .swapSide{display:contents}
 .bloomSwap .dots,.ringStudio .progressText,.ringStudio .progressRail{display:none}
 .arcade.is-playing #game{padding:0;grid-template-rows:22px 30px minmax(0,1fr);gap:2px}
 .arcade .playLayout{padding:0 8px}
 .arcade .table{grid-template-rows:20px 3px minmax(0,1fr) 25px 69px 56px;gap:2px}
 .arcade #tray{height:69px;padding:4px 12px}
 .arcade .pieceTile{width:60px;height:60px;min-height:60px}
 .arcade #classicResult,.bloomSwap .completion,.bloomSwap .completion .winPanel,.ringStudio .result:not([hidden]){height:96px;min-height:0;max-height:96px;margin:0;padding:0;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:0;width:100%;max-width:none;overflow:visible}
 .arcade #classicResult{grid-row:4/6;align-self:end}
 .bloomSwap .completion{grid-row:5;align-self:stretch}
 .bloomSwap .notice{grid-row:5;margin:0;align-self:center}
 .ringStudio .result:not([hidden]){grid-row:5;align-self:stretch;inset:auto}
 .ringStudio .ringControls{grid-row:5;align-self:start;height:36px;margin:0;gap:6px}
 .ringStudio .ringControls button{width:34px;height:34px;min-height:34px;font-size:14px}
 .ringStudio .turnControls{grid-row:5;align-self:end;height:60px;min-height:0;margin:0 3px}
 .ringStudio .turnControls p{font-size:11px;line-height:1.35}
 .rings-won .ringStudio .ringControls{display:none}
 #classicResult>.cultureCard,.winPanel>.cultureCard,.rings-won #result>.cultureCard{display:flex;justify-content:center;align-items:center;flex:0 0 44px!important;height:44px;min-height:44px;margin:0;padding:0;background:none;border:0;box-shadow:none}
 #classicResult .cultureRead,.winPanel .cultureRead,.rings-won #result .cultureRead{width:auto;min-width:0;max-width:100%;height:44px;min-height:44px;padding:4px 14px;border:0;background:none;color:#ffedcf;box-shadow:none;font:12px/1.2 var(--studioFont,serif);text-decoration:underline;text-underline-offset:3px}
 .arcade #classicResult>.bloomNext,.bloomSwap .completion .winPanel>.bloomNext,.rings-won .ringStudio #result>#next{height:52px;min-height:52px;margin:0 auto;max-width:320px;width:100%;font-size:22px}
 .arcade .unifiedToolbar,.bloomSwap .unifiedToolbar,.ringStudio .tools{grid-row:6;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;gap:2px;width:100%;max-width:500px;height:56px;min-height:0;margin:0 auto;padding:0 4px}
 .arcade .unifiedToolbar{grid-row:6}
 .ringStudio .tools{grid-template-columns:repeat(3,minmax(0,1fr))}
 .arcade .unifiedToolbar>button,.bloomSwap .unifiedToolbar>button,.ringStudio .tools>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-height:44px;height:56px;min-width:0;width:100%;padding:0 1px;border:0;border-radius:0;background:none;box-shadow:none;color:#fff0cf;font:11px/1.2 var(--studioFont,serif);font-weight:400;text-shadow:0 1px 3px #392515;letter-spacing:0}
 .arcade .unifiedToolbar>button>.prop,.bloomSwap .unifiedToolbar>button>.prop,.ringStudio .tools>button>.toolArt{width:51px;height:34px;min-width:0;flex:none}
 .bloomSwap .unifiedToolbar .toolLabel{line-height:16px}
 .bloomSwap .unifiedToolbar small{min-width:17px;height:17px;font-size:10px}
 .bloomSwap .unifiedToolbar>button:disabled,.arcade .unifiedToolbar>button:disabled{background:none;box-shadow:none;opacity:.45;color:#fff0cf;border:0}
 .bloomSwap .unifiedToolbar>button[aria-pressed=true]{background:none;box-shadow:none;color:#ffe2a1}
 .bloomSwap .unifiedToolbar>button[aria-pressed=true]:after{display:none}
 .cultureBody{padding:2px 20px 22px;font-size:16px;line-height:1.6}
 .cultureBody h2{font-size:25px}.cultureChapter h3{font-size:21px}
 .cultureDialog .cultureOriginal{font-size:19px!important;line-height:1.7!important}
}

/* A compact mode pill stays within the mobile ribbon. */
@media(max-width:600px){
 .ringStudio .ribbon .modeBtn{display:inline-flex;align-items:center;justify-content:center;align-self:center;flex:none;min-width:0;height:24px;min-height:24px;margin:0;padding:0 9px;border-radius:12px;font:11px/1 var(--studioFont,serif)}
}

/* Hint stays visible after choosing the first tile; no change to board geometry. */
.bloomSwap .tile.hinted{outline:0;z-index:6;overflow:visible}
.bloomSwap .tile.hinted::before{content:'';position:absolute;inset:3px;border:4px solid #ffdc66;box-shadow:0 0 0 2px #162d3b,inset 0 0 0 2px #162d3b;pointer-events:none;z-index:1;animation:bloomHintGlow 1.25s ease-in-out 3}
.bloomSwap .tile .hintMark{position:absolute;right:7px;top:7px;z-index:2;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:2px solid #ffdc66;border-radius:5px;background:#15343e;color:#ffed9a;font:700 22px/1 Arial,sans-serif;box-shadow:0 2px 5px #0007;pointer-events:none}
@keyframes bloomHintGlow{50%{border-color:#fff9d4;box-shadow:0 0 0 2px #162d3b,inset 0 0 0 2px #162d3b,0 0 9px #ffe58c}}
@media(max-width:600px){.bloomSwap .tile.hinted::before{inset:2px;border-width:3px}.bloomSwap .tile .hintMark{top:5px;right:5px;width:23px;height:23px;font-size:18px}}
@media(prefers-reduced-motion:reduce){.bloomSwap .tile.hinted::before{animation:none}}
