/* Ergonomic pass, loaded last: same riso palette and puzzle shapes, tighter hierarchy so
   each page keeps its main action in view and its tools within reach. */
:root{--header-h:76px}
html{scroll-padding-top:calc(var(--header-h) + 16px)}
:where(a,button,input,select,summary,[tabindex]):focus-visible{outline:3px solid var(--blue);outline-offset:3px}

/* Home: the hero scales with the viewport height so "Find a game" stays above the fold. */
@media(min-width:1101px){
 #arena-view .arena-entry{align-items:center;padding-top:clamp(8px,2.5vh,28px)}
 #arena-view .welcome h1{font-size:clamp(44px,min(6vw,8.2vh),100px);margin:14px 0 18px}
 #arena-view .arena-showcase{align-self:center;margin-top:0}
}
.site-overview{margin-top:48px;border-top:0}
.site-guide-links{gap:8px;filter:drop-shadow(5px 5px 0 var(--ink))}
.site-guide-links>a{min-height:150px;padding:28px 56px 28px 40px;box-shadow:none;border-radius:22px}
.site-guide-links>a:nth-child(1){background:var(--sky)}
.site-guide-links>a:nth-child(2){background:var(--orange)}
.site-guide-links>a:nth-child(3){background:var(--cream)}
.site-guide-links strong{font-size:22px;text-transform:uppercase;font-stretch:115%;line-height:1}
.site-guide-links>a:hover{background-image:linear-gradient(#ffffff2e,#ffffff2e)}
:is(.site-guide-links,.guide-steps) .jig-tile.jig-tile{border:var(--jk) solid transparent!important;margin:calc(var(--jk)*-1)!important;border-radius:0!important;background-clip:border-box!important;box-shadow:none!important}

/* Catalog: search and categories stay pinned while browsing; every tile names its artwork. */
#catalog-view .hub-heading{margin-bottom:8px}
#catalog-view .catalog-filters{position:sticky;top:var(--header-h);z-index:20;margin:0 -20px;padding:12px 20px 2px;background:var(--y) url(/grain.svg)}
#catalog-view .catalog-tools{align-items:flex-end;margin:0 0 12px}
#catalog-view .catalog-tools>label:first-child{flex:1 1 320px}
#catalog-view .catalog-tools>span{padding-bottom:12px;font-family:var(--mono);font-size:12px;color:var(--ink)}
#catalog-view .category-pills{margin-bottom:12px}
#catalog-view .catalog-tile .puzzle-card-entry{position:relative}
#catalog-view .catalog-caption{position:absolute;left:calc(var(--jk,0px) + 10px);bottom:calc(var(--jk,0px)*1.8 + 8px);max-width:calc(100% - var(--jk,0px)*2 - 20px);padding:6px 10px;border-radius:8px;background:var(--ink);color:var(--cream);font:800 12px/1.3 var(--font);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:0;pointer-events:none}
#catalog-view .catalog-tile:is(:hover,:focus-within) .catalog-caption{opacity:1}
@media(hover:none){#catalog-view .catalog-caption{opacity:1}}

/* Rankings: title beside its mark, tabs aligned with the board instead of floating mid-page. */
#rankings-view .world-heading{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;margin-bottom:22px}
#rankings-view .world-heading h1{font-size:clamp(34px,min(4.8vw,8.5vh),76px);margin:10px 0 12px}
#rankings-view .world-tabs{margin:0 0 18px}

/* Boosters: refresh joins the tab row so the pack name and opening hint fit on screen. */
#boosters-view #booster-status:empty{margin:0}
@media(min-width:901px){
 #boosters-view .booster-heading{margin-bottom:14px}
 #boosters-view .booster-filter{position:relative;z-index:1;width:max-content;height:46px;margin:-46px 0 0 auto;align-items:center}
 #boosters-view .booster-recharge{margin-top:10px}
}

/* Guides: a short hero with a cut-out piece, then the explanations as interlocking steps. */
.guide-page:has(.guide-hero){max-width:1120px!important;width:100%}
.guide-hero{position:relative;padding:8px min(34%,340px) 8px 0;min-height:260px}
.guide-hero:before,.guide-hero:after{content:"";position:absolute;top:50%;right:min(4%,40px);width:min(26%,250px);aspect-ratio:1;-webkit-mask:url(/piece.svg) center/contain no-repeat;mask:url(/piece.svg) center/contain no-repeat;transform:translateY(-50%) rotate(-9deg)}
.guide-hero:before{background:var(--ink);translate:10px 10px}
.guide-hero:after{background:var(--pink)}
.guide-hero:has(a[href="/#catalog"]):after{background:var(--blue)}
.guide-hero:has(a[href="/#boosters"]):after{background:var(--teal)}
.guide-hero h1{text-transform:uppercase;line-height:.95;font-stretch:125%;text-shadow:4px 4px 0 var(--pink)}
.guide-hero p:not(.eyebrow){font-size:18px;line-height:1.6;max-width:620px}
.guide-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:44px 0 10px;counter-reset:step;filter:drop-shadow(5px 5px 0 var(--ink))}
.guide-step{padding:30px 30px 30px 44px;border-radius:22px;background:var(--cream);color:var(--ink)}
.guide-step:nth-child(2){background:var(--sky)}
.guide-step:nth-child(3){background:var(--teal)}
.guide-step:before{counter-increment:step;content:"0" counter(step);display:block;margin-bottom:14px;font:700 13px var(--mono)}
.guide-page .guide-step h2{margin:0 0 12px;font-size:20px;line-height:1.1;text-transform:uppercase;font-stretch:115%}
.guide-page .guide-step p{margin:0;font-size:15px;line-height:1.65}

/* Legal: every page reachable from a pinned index, the text set on a paper sheet. */
.legal-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:32px;align-items:start;margin-top:18px}
.legal-nav{position:sticky;top:calc(var(--header-h) + 20px);display:flex;flex-direction:column;gap:4px;margin:0;padding:0;border:0}
.legal-nav a{display:flex;align-items:center;min-height:42px;padding:8px 16px;border-radius:999px;color:var(--ink)!important;text-decoration:none!important;font-weight:700;font-size:14px}
.legal-nav a:hover{background:#16120D14}
.legal-nav a[aria-current=page]{background:var(--ink);color:var(--y)!important;box-shadow:3px 3px 0 var(--pink)}
.legal-sheet{position:relative;min-width:0;padding:clamp(24px,4vw,52px);border-radius:22px;background:var(--cream);filter:drop-shadow(6px 6px 0 var(--ink))}
.legal-sheet:before{content:"";position:absolute;top:-17px;left:64px;width:40px;height:40px;border-radius:50%;background:var(--cream)}
.guide-page .legal-sheet h1{margin-top:0;text-transform:uppercase;line-height:.92;font-stretch:125%;font-size:clamp(30px,3.6vw,52px);text-shadow:4px 4px 0 var(--pink)}
.legal-sheet>h2:first-of-type{margin-top:28px}

@media(max-width:1100px){#catalog-view .catalog-filters{margin:0 -16px;padding-inline:16px}}
@media(max-width:850px){
 .guide-hero{padding-right:0;min-height:0}
 .guide-hero:before,.guide-hero:after{display:none}
 .guide-steps{grid-template-columns:1fr;gap:16px;filter:none}
 .guide-step{box-shadow:5px 5px 0 var(--ink)}
 .legal-layout{grid-template-columns:1fr;gap:20px}
 .legal-nav{position:static;flex-flow:row wrap;gap:6px}
 .legal-nav a{min-height:36px;padding:6px 12px;font-size:13px;white-space:nowrap;background:#16120D12}
}
@media(max-width:700px){
 #rankings-view .world-heading h1{font-size:clamp(28px,8.5vw,40px)}
 #catalog-view .category-pills{flex-wrap:nowrap;overflow-x:auto;margin-inline:-16px;padding:2px 16px 8px;scrollbar-width:none}
 #catalog-view .category-pills>*{flex:none}
}

/* ===== Critique pass: socket-safe buttons, a 11–12px legibility floor, larger hit areas. ===== */
/* The left socket of every puzzle button eats 11px: reserve it the way the right knob reserves 14px. */
:is(.button,.account-button,.header-credits,.profile-tabs button,.world-tabs button,.category-pill,.piece-presets button,.auth-switch button,.provider-button,.settings-nav-button,.sidebar-resume,.tableau-finish-chip,.collection-pagination button,.timer-option,.lang-trigger):not(.text-button):not(.nav-button){--bl:10px}

.app-layout .eyebrow{font-size:11px!important}
#arena-view .matchmaking-button small{font-size:11px}
#arena-view .arena-features span{font-size:12px}
#arena-view .rules-grid .rule-number{font-size:11px}
#catalog-view #credits-button{min-height:32px;font-size:13px}
#rankings-view .small-copy{font-size:12px}
.booster-wallet-chip span,#booster-refresh,#booster-topup{font-size:12px!important}
.pack-footnote{font-size:12px!important}
.pack-dots{gap:12px}
.pack-dots button{position:relative}
.pack-dots button:after{content:"";position:absolute;inset:-12px -6px}
#profile-view .profile-shortcut small{font-size:12px}
#profile-view .account-state{font-size:11px}
.empty-state-link{color:inherit!important;font-weight:800;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
#shop-view .shop-card .shop-label{font-size:12px!important}
#shop-view :is(.point-wallet,.shop-points) :is(span,small){font-size:11px}
.page-footer :is(.footer-publisher a,.footer-contact){display:inline-block;padding-block:8px}
.guide-page>.text-button{display:inline-flex;align-items:center;min-height:40px;font-size:13px}

/* Sign-in: while Google and ChatGPT are "coming soon", the working form comes first. */
.auth-content:not(:has(#auth-provider-panel .provider-button:not(:disabled))){display:flex;flex-direction:column}
.auth-content:not(:has(#auth-provider-panel .provider-button:not(:disabled))) #auth-provider-panel{order:1;margin-top:26px;opacity:.7}
.auth-content:not(:has(#auth-provider-panel .provider-button:not(:disabled))) .auth-method-divider{display:none}
#auth-dialog .auth-story li{font-size:13px}
#auth-dialog .auth-story-note{font-size:12px}
#auth-dialog .provider-status{font-size:10px}
#auth-dialog :is(.small-copy,#auth-form small,#auth-form label button){font-size:12px}
#auth-dialog .auth-recover-link{font-size:13px}

/* 404: the missing piece is drawn as the empty socket it left behind. */
.guide-hero.not-found:before{display:none}
#page-content .guide-hero.not-found:after{background:#16120D26}
.not-found-links{display:flex;flex-wrap:wrap;gap:10px;margin-top:6px}
.not-found-links a{display:inline-flex;align-items:center;min-height:44px;padding:0 18px;border-radius:999px;background:#16120D12;color:var(--ink);font-weight:800;text-decoration:none}
.not-found-links a:hover{background:var(--ink);color:var(--y)}

@media(max-width:700px){
 #boosters-view .booster-tabs{flex-wrap:nowrap;overflow-x:auto;margin-inline:-16px;padding:2px 16px 8px;scrollbar-width:none}
 #boosters-view .booster-tabs>*{flex:none}
}

/* ===== Colour pass: no ink-faced buttons, so the side of every raised piece shows. ===== */
:root,#arena-view .arena-entry .welcome,.ink-text,#shop-view .shop-card,.collection-tableau{--btn-bg:var(--pink);--btn-fg:var(--ink)}
#profile-view .profile-hero{--btn-bg:var(--blue);--btn-fg:var(--cream)}
/* Header: one colour per control. */
.header .navigation-toggle.icon-button{background:var(--y)!important;color:var(--ink)!important}
.header .header-credits{background:var(--pink)!important;color:var(--ink)!important}
.header .account-button{background:var(--blue)!important;color:var(--cream)!important}
/* Tabs and toggles: the chosen one is a pushed-in blue piece, the others raised cream pieces. */
:is(.profile-tabs button,.auth-switch button,.world-tabs button):is(.current,[aria-selected=true]){background:var(--blue)!important;color:var(--cream)!important}
:is(.profile-tabs button,.auth-switch button,.world-tabs button):not(.current,[aria-selected=true]){background:var(--cream)!important;color:var(--ink)!important}
:is(.profile-tabs button,.auth-switch button,.world-tabs button).current:not(:disabled){--pz-p:calc(var(--pz-d) - 1px)}
.pack-arrow,.pack-arrow:hover{background:var(--cream)!important;color:var(--ink)!important}
.app-layout .category-pill{--cat:#2152FF;--cat-fg:#FFF3D6}

/* ===== Rankings: no ink panel, the board sits on the yellow ground. ===== */
#rankings-view #world-panel{background:transparent!important;padding:8px 0 0!important;border-radius:0;--text:var(--ink);--muted:#4E3F1B;--amber:var(--ink);--bg:var(--y);--panel:var(--cream);--panel-light:#FFEDB1;--border:var(--ink);--btn-bg:var(--pink);--btn-fg:var(--ink);--sh:var(--ink);color:var(--ink)}
#rankings-view #world-panel :is(.world-rules,.world-labels,.small-copy,.world-puzzle p){color:var(--ink)!important}
#rankings-view #world-panel .world-puzzle,#rankings-view #world-panel .empty-state{background:var(--cream)!important;color:var(--ink);border-radius:0;box-shadow:6px 6px 0 var(--ink)}
#rankings-view .world-row:not(.world-labels,[data-rank="1"],[data-rank="2"],[data-rank="3"]),#rankings-view .world-row:not(.world-labels,[data-rank="1"],[data-rank="2"],[data-rank="3"]):nth-child(even){background:var(--cream);color:var(--ink);border-radius:0}
#rankings-view .world-row:not([data-rank="1"],[data-rank="2"],[data-rank="3"]) :is(strong,small,span){color:var(--ink)}
#rankings-view .world-score strong{color:var(--ink)}

/* ===== Favourite: a drawn star instead of the text glyph; yellow when chosen. ===== */
.app-layout .favorite-button{font-size:0!important;color:transparent!important}
.app-layout .favorite-button::before{content:"";width:28px;height:28px;background:url(/icons/star.svg) center/contain no-repeat;transition:transform .2s cubic-bezier(.2,1.6,.4,1)}
.app-layout .favorite-button:hover::before{transform:scale(1.14)}
.app-layout .favorite-button[aria-pressed=true]::before{background-image:url(/icons/star-filled.svg);transform:scale(1.08)}

/* ===== Catalogue search: a full-width field, filters on the line below. ===== */
#catalog-view .catalog-tools{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px 24px;margin:8px 0 18px!important}
#catalog-view .catalog-tools>label:first-child{grid-column:1/-1;max-width:none!important;display:flex;flex-direction:column;gap:10px;font-family:var(--mono);font-size:12px;letter-spacing:.08em;text-transform:uppercase}
#catalog-view #catalog-search{box-sizing:border-box;width:100%;height:62px;padding:0 22px 0 58px;border:0!important;border-radius:6px;background:var(--cream) url(/icons/search.svg) 20px 50%/24px no-repeat;box-shadow:6px 6px 0 var(--ink);color:var(--ink);font:600 18px var(--font);letter-spacing:0;text-transform:none}
#catalog-view #catalog-search::placeholder{color:#16120D;opacity:.6}
#catalog-view #catalog-search:focus{outline:3px solid var(--blue);outline-offset:4px}
#catalog-view .catalog-tools>span{padding:0!important;justify-self:end}

/* ===== Booster packs: each collection has its own colour, front and back. ===== */
.booster-packet{--pack-c:#FFF3D6;--pack-fg:#16120D}
.booster-packet[data-pack-category="Peintures"]{--pack-c:#FF2E63}
.booster-packet[data-pack-category="Paysages"]{--pack-c:#2152FF;--pack-fg:#FFF3D6}
.booster-packet[data-pack-category="Fleurs & natures mortes"]{--pack-c:#FF5B22}
.booster-packet[data-pack-category="Animaux"]{--pack-c:#27D0A3}
.booster-packet[data-pack-category="Japon & estampes"]{--pack-c:#A8E0FA}
.booster-packet .packet-choice{color:var(--pack-fg);background:linear-gradient(110deg,color-mix(in srgb,var(--pack-c) 80%,#16120D),var(--pack-c) 34%,color-mix(in srgb,var(--pack-c) 62%,#fff) 47%,var(--pack-c) 58%,color-mix(in srgb,var(--pack-c) 80%,#fff) 84%,color-mix(in srgb,var(--pack-c) 80%,#16120D))}
.booster-packet .packet-choice :is(.packet-edition,.packet-label,.packet-count){color:var(--pack-fg)}
.booster-packet .packet-back{background:var(--pack-c) url(/grain.svg)}
#auth-dialog .button.primary,dialog .button.primary{background:var(--pink)!important;color:var(--ink)!important}
#rankings-view #world-panel :is(.world-list,.world-empty,.world-empty h2,.world-empty p){color:var(--ink)!important}
#rankings-view #world-panel .world-empty{background:var(--cream);box-shadow:6px 6px 0 var(--ink);padding:40px 24px;margin-top:8px}
.booster-packet .packet-choice .packet-brand{color:var(--pack-fg)}

/* ===== Language picker: a cream puzzle piece with the flag, opening a two-column flag menu. ===== */
.lang-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;overflow:hidden}
.app-layout .header .header-language,.header .header-language{display:flex!important;align-items:center;margin:0;padding:0;border:0;background:none;font-size:0;position:relative}
.lang-picker{position:relative;font-size:14px;line-height:1}
.lang-trigger{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 12px 0 16px;background:var(--cream);color:var(--ink);font:700 13px var(--mono);letter-spacing:.06em;cursor:pointer}
.header .lang-trigger{background:var(--cream)!important;color:var(--ink)!important}
.lang-flag{display:block;flex:none;width:24px;height:16px;object-fit:cover;border-radius:2px;box-shadow:none}
.lang-globe{background:var(--blue) url(/icons/globe.svg) center/12px no-repeat}
.lang-menu{position:absolute;z-index:200;top:calc(100% + 14px);right:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;width:min(390px,calc(100vw - 24px));max-height:min(72vh,540px);overflow:auto;margin:0;padding:10px;list-style:none;background:var(--cream);border-radius:6px;box-shadow:8px 8px 0 var(--ink);color:var(--ink);text-align:start}
.lang-menu[hidden]{display:none}
.lang-picker.up .lang-menu{top:auto;bottom:calc(100% + 14px)}
.lang-menu:focus{outline:none}
.lang-option{display:flex;align-items:center;gap:10px;min-height:44px;padding:6px 10px;border-radius:4px;cursor:pointer;font:700 15px/1.2 var(--font);letter-spacing:0}
.lang-option.lang-auto{grid-column:1/-1;margin-bottom:6px;border-radius:4px 4px 0 0;box-shadow:inset 0 -2px 0 var(--ink)}
.lang-option .lang-note{margin-inline-start:auto;font:700 13px var(--mono);letter-spacing:.06em}
.lang-option.lang-auto .lang-note{font-family:var(--font);font-weight:500;letter-spacing:0}
.lang-option.active,.lang-option:hover{background:var(--y);color:var(--ink)}
.lang-option[aria-selected=true]{background:var(--blue);color:var(--cream)}
.lang-option[aria-selected=true] .lang-flag{box-shadow:0 0 0 1.5px var(--cream)}
.lang-menu:focus-visible .lang-option.active{outline:3px solid var(--pink);outline-offset:-3px}
@media(max-width:700px){
 .header .lang-code{display:none}
 .header .lang-trigger{padding:0 6px 0 14px;min-height:36px}
 .header .lang-menu{position:fixed;top:68px;left:12px;right:12px;width:auto}
}

/* ===== Footer: a cream sheet with a jigsaw top edge, a blue call to action and five columns. ===== */
.page-footer.site-footer,.app-layout .page-footer.site-footer{position:relative;display:block;margin-top:72px;padding:0 clamp(16px,4vw,56px) 28px!important;background:var(--cream)!important;color:var(--ink)!important;border:0!important}
.site-footer::before{content:"";position:absolute;left:0;right:0;top:-15px;height:16px;background:radial-gradient(circle 15px at 50% 100%,var(--cream) 14.5px,transparent 15px) 24px 0/88px 16px repeat-x;pointer-events:none}
.sf-inner{max-width:1200px;margin:0 auto}
.sf-cta{display:flex;align-items:center;justify-content:space-between;gap:20px 32px;flex-wrap:wrap;transform:translateY(-36px);margin-bottom:-8px;padding:28px 36px;background:var(--blue);color:var(--cream);box-shadow:8px 8px 0 var(--ink)}
.sf-cta p{margin:6px 0 0;font-size:16px;color:var(--cream)}
.sf-cta .sf-cta-title{margin:0;font-weight:900;font-stretch:125%;font-size:clamp(24px,3vw,36px);line-height:1;letter-spacing:-.01em;text-transform:uppercase;text-shadow:3px 3px 0 var(--ink)}
.sf-cta .sf-cta-button{min-height:58px;font-size:17px;text-decoration:none}
.sf-grid{display:grid;grid-template-columns:minmax(220px,1.5fr) repeat(4,minmax(130px,1fr));gap:36px 28px;padding:12px 0 36px}
.sf-brand{display:inline-flex;align-items:center;gap:12px;color:var(--ink)!important;text-decoration:none;font-weight:900;font-stretch:125%;font-size:26px;letter-spacing:-.01em}
.sf-brand img{display:block;width:48px;height:42px}
.sf-tagline{margin:14px 0 10px;font-size:15px;line-height:1.5;max-width:28ch;color:var(--ink)}
.sf-mail{display:inline-block;margin-bottom:24px;color:var(--ink)!important;font-weight:700;text-decoration:underline;text-underline-offset:3px}
.sf-language{display:flex;flex-direction:column;align-items:flex-start;gap:10px;font:700 13px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink)}
.sf-col h2{margin:6px 0 16px;font:700 13px var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--ink)}
.sf-col ul{display:grid;gap:12px;margin:0;padding:0;list-style:none}
.sf-col a{color:var(--ink)!important;font-size:15px;font-weight:600;text-decoration:none;background:linear-gradient(var(--pink),var(--pink)) 0 100%/0 3px no-repeat;transition:background-size .2s}
.sf-col a:hover,.sf-col a:focus-visible{background-size:100% 3px}
.sf-bottom{display:flex;flex-wrap:wrap;align-items:center;gap:10px 28px;padding-top:22px;background:linear-gradient(90deg,var(--ink) 50%,transparent 0) top/12px 2px repeat-x;font:500 14px var(--mono);color:var(--ink)}
.sf-bottom small{font:inherit;color:var(--ink)!important}
.sf-bottom a{color:var(--ink)!important;font-weight:700}
.sf-bottom .sf-top{margin-inline-start:auto;text-decoration:none}
.sf-bottom .sf-top::after{content:" ↑"}
@media(max-width:980px){.sf-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sf-identity{grid-column:1/-1}}
@media(max-width:520px){.sf-cta{padding:22px 20px}.sf-cta .sf-cta-button{width:100%}.sf-grid{gap:28px 18px}.sf-bottom .sf-top{margin-inline-start:0}}
.app-layout>.page-footer.site-footer,.page-footer.site-footer{z-index:1!important}
.site-footer .sf-identity .sf-language{display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;margin:0!important;color:var(--ink)!important;text-align:start}
.site-footer .sf-identity .sf-mail{font:700 15px var(--font)!important;color:var(--ink)!important}
.site-footer .lang-menu{left:0;right:auto}
.lang-menu,.lang-menu *{text-transform:none;letter-spacing:0}
.lang-menu .lang-note{letter-spacing:.06em}

/* ===== Navigation: every section is its own coloured piece; the open one is pushed in. ===== */
.app-sidebar .nav-button{--nav-c:var(--cream);--nav-fg:var(--ink);background:var(--nav-c)!important;color:var(--nav-fg)!important}
.app-sidebar .nav-button[data-view=arena]{--nav-c:var(--pink)}
.app-sidebar .nav-button[data-view=catalog]{--nav-c:var(--blue);--nav-fg:var(--cream)}
.app-sidebar .nav-button[data-view=boosters]{--nav-c:var(--y)}
:is(.app-sidebar .nav-button).current.current.current{--pz-p:calc(var(--pz-d) - 1px)}
@media(min-width:701px){.app-sidebar nav .nav-button+.nav-button,.app-sidebar .nav-button+.nav-button{margin-top:10px}}

/* ===== Account: an edge piece (flat right side, socket on the left) holding the player's avatar. ===== */
.header .account-button{--pk:0px;display:inline-flex!important;align-items:center;gap:10px;width:auto!important;height:auto!important;min-width:0!important;min-height:48px;padding:0 18px 0 22px!important;border-radius:0!important;font:800 14px var(--font)!important;
 -webkit-mask:linear-gradient(#000 0 0) 0 100%/100% calc(100% - var(--pz-p)) no-repeat,radial-gradient(circle 9px at 2px var(--pz-face),#0000 calc(100% - .5px),#000),radial-gradient(circle 9px at 2px var(--pz-base),#0000 calc(100% - .5px),#000)!important;-webkit-mask-composite:source-in,source-over!important;
 mask:linear-gradient(#000 0 0) 0 100%/100% calc(100% - var(--pz-p)) no-repeat,radial-gradient(circle 9px at 2px var(--pz-face),#0000 calc(100% - .5px),#000),radial-gradient(circle 9px at 2px var(--pz-base),#0000 calc(100% - .5px),#000)!important;mask-composite:intersect,add!important}
.header .account-button::after{
 -webkit-mask:linear-gradient(#000 0 0),radial-gradient(circle 9px at 2px var(--pz-face),#0000 calc(100% - .5px),#000),linear-gradient(#000 0 0) 0 var(--pz-p)/100% calc(100% - var(--pz-d)) no-repeat!important;-webkit-mask-composite:source-out,source-in!important;
 mask:linear-gradient(#000 0 0),radial-gradient(circle 9px at 2px var(--pz-face),#0000 calc(100% - .5px),#000),linear-gradient(#000 0 0) 0 var(--pz-p)/100% calc(100% - var(--pz-d)) no-repeat!important;mask-composite:subtract,intersect!important}
.account-avatar{display:grid;place-items:center;flex:none;width:36px;height:36px;padding:2px 0 0 1px;background:var(--cream);color:var(--ink);font:900 12px var(--font);letter-spacing:0;-webkit-mask:url(/piece.svg) center/contain no-repeat;mask:url(/piece.svg) center/contain no-repeat}
.account-avatar svg{width:18px;height:18px}
.account-avatar[data-color=pink]{background:var(--pink)}
.account-avatar[data-color=teal],.account-avatar[data-color=lime]{background:var(--teal)}
.account-avatar[data-color=blue]{background:var(--sky)}
.account-avatar[data-color=violet]{background:var(--y)}
.account-label{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:520px){.header .account-button{padding:0 12px 0 20px!important}.header .avatar-button .account-label,.header .guest-account-button .account-avatar{display:none}}
@media(max-width:520px){.header .guest-account-button .account-label{max-width:86px;white-space:normal;font-size:12px;line-height:1.15;text-align:center}}
@media(min-width:521px){.header .guest-account-button .account-label{max-width:none;overflow:visible;text-overflow:clip}}
@media(max-width:380px){
 .app-layout .header .guest-account-button{width:56px!important;min-height:44px;padding:0 8px 0 14px!important;justify-content:center}
 .header .guest-account-button .account-label{display:none}
 .header .guest-account-button::before{content:"";display:block;flex:none;width:20px;height:20px;background:currentColor;-webkit-mask:url(/icons/user.svg) center/contain no-repeat;mask:url(/icons/user.svg) center/contain no-repeat}
 .app-sidebar .nav-button span{font-size:9px;letter-spacing:-.02em}
 .app-sidebar .nav-button[data-view=rankings]{flex-grow:1.5}
}

/* ===== Classic puzzle page: one screen, the preview with its cut on the left, title and settings on the right. ===== */
#setup-view[data-mode=classic] .prepare-settings>h2,#setup-view[data-mode=classic] .prepare-art-tag{display:none!important}
#setup-view[data-mode=classic] .prepare-art-heading{justify-content:flex-end;width:100%;margin:0}
#setup-view[data-mode=classic] .prepare-art{display:flex;align-items:center;justify-content:center;width:100%!important;max-width:100%;min-height:0;padding:12px;background:var(--cream)!important;border:0!important;border-radius:0!important;box-shadow:8px 8px 0 var(--ink)!important;line-height:0}
.prepare-image-frame{position:relative;display:flex;justify-content:center;max-width:100%;min-width:0}
#setup-view[data-mode=classic] .prepare-art img{display:block;width:auto!important;max-width:100%;height:auto!important;max-height:min(780px,calc(100dvh - 220px));min-height:0;object-fit:contain;border-radius:0!important;filter:none}
#prepare-cuts{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#prepare-cuts .shadow{fill:none;stroke:var(--ink);stroke-opacity:.5;stroke-width:4px}
#prepare-cuts .line{fill:none;stroke:var(--cream);stroke-width:1.6px}
.prepare-cut-label{margin:16px 0 0;font:700 13px var(--mono);letter-spacing:.08em;text-transform:uppercase;text-align:center;color:var(--ink)}
#setup-view[data-mode=classic]{width:100%;max-width:1680px;margin-inline:auto;min-width:0}
#setup-view[data-mode=classic] #setup-form{gap:18px;filter:none!important}
#setup-view[data-mode=classic] #setup-form>:is(.form-grid,.classic-options){padding:0!important;background:transparent!important}
#setup-view[data-mode=classic] #setup-form>.form-grid{display:flex!important;flex-direction:column-reverse;gap:12px}
#setup-view[data-mode=classic] .piece-count-setting{display:flex!important;flex-direction:row!important;align-items:center;justify-content:space-between;gap:16px;font-weight:700;font-size:14px;color:var(--ink)}
#setup-view[data-mode=classic] #setup-form #setup-pieces{width:150px!important;min-width:0;min-height:46px;margin:0;padding:10px 14px!important;background:var(--cream)!important;box-shadow:3px 3px 0 var(--ink)!important;border-radius:0;font-size:16px}
#setup-view[data-mode=classic] .piece-presets{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0!important}
#setup-view[data-mode=classic] .piece-presets button{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:64px;width:auto!important}
.piece-presets button strong{font-weight:900;font-stretch:125%;font-size:22px;line-height:1}
.piece-presets button small{font:700 12px var(--mono);letter-spacing:.06em;text-transform:uppercase}
#setup-view .piece-presets button[aria-pressed=true]{background:var(--blue)!important}
#setup-view .piece-presets button[aria-pressed=true] *{color:var(--cream)!important}
#setup-view .piece-presets button[aria-pressed=false]{background:var(--cream)!important}
#setup-view[data-mode=classic] #setup-form>.classic-options{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0!important}
#setup-view[data-mode=classic] #setup-form .setting-switch{display:grid;grid-template-columns:20px minmax(0,1fr) 64px;gap:10px;min-width:0;min-height:112px;padding:16px!important;border:0!important;border-radius:0!important;background:var(--cream)!important;box-shadow:3px 3px 0 var(--ink)!important;-webkit-mask:none!important;mask:none!important;clip-path:none!important}
#setup-view[data-mode=classic] #setup-form .setting-switch::after{content:none}
#setup-view[data-mode=classic] .setting-switch>span{font-size:14px;line-height:1.4;font-weight:700}
#setup-view[data-mode=classic] .setting-switch strong{font-weight:700}
#setup-view[data-mode=classic] .setting-switch small{font-size:12px!important;line-height:1.5;margin-top:6px}
#setup-view[data-mode=classic] #setup-form .setting-switch input[type=checkbox]{width:64px!important;height:38px!important;margin:0!important;box-shadow:0 3px 0 #2A231B!important}
#setup-view[data-mode=classic] #setup-form :is(input,select):focus-visible{outline:3px solid var(--blue)!important;outline-offset:4px}
#setup-view[data-mode=classic] .setting-switch:has(input:focus-visible){outline:3px solid var(--blue);outline-offset:4px}
#setup-view[data-mode=classic] :is(.piece-presets button,#setup-submit):focus-visible{box-shadow:inset 0 0 0 3px var(--blue)!important}
#setup-view[data-mode=classic] #setup-form #setup-rules{margin:0!important;font-size:14px!important;line-height:1.65}
#setup-view[data-mode=classic] #setup-form #setup-submit{margin-top:6px;min-height:60px;font-size:18px}
#setup-view[data-mode=classic] #setup-form #setup-error{margin:0;padding:12px 16px;background:var(--cream);color:#B3123E!important;font-size:14px;line-height:1.5}
#setup-view[data-mode=classic] .prepare-settings{position:static;min-width:0;border:0}
#setup-view[data-mode=classic] .prepare-heading{min-width:0;display:block}
#setup-view[data-mode=classic] #prepare-image-credit{color:var(--ink);font-size:15px;line-height:1.5}
#setup-view[data-mode=classic] #prepare-image-details{display:flex;flex-wrap:wrap;gap:8px 16px;margin-top:10px;color:var(--ink);font-size:13px;line-height:1.5}
#setup-view[data-mode=classic] #prepare-image-details a{color:inherit;text-underline-offset:4px}
#setup-view[data-mode=classic] .puzzle-records-menu{--text:var(--ink);--muted:#4E3F1B;--lime:#0B6E52;background:var(--cream);color:var(--ink);margin:24px 0 0;padding:0 20px;box-shadow:3px 3px 0 var(--ink);border-radius:0}
#setup-view[data-mode=classic] .puzzle-records-menu>summary{align-items:center;padding:16px 0;min-height:54px;font-size:14px}
#setup-view[data-mode=classic] .puzzle-records-menu>summary>span:last-child{font-size:0}
#setup-view[data-mode=classic] .puzzle-records-menu>summary>span:last-child::after{content:'+';font:700 22px var(--mono)}
#setup-view[data-mode=classic] .puzzle-records-menu[open]>summary>span:last-child::after{content:'−'}
#setup-view[data-mode=classic] .puzzle-records-menu .puzzle-records-content{padding:0 0 16px}
#setup-view[data-mode=classic] .puzzle-records-menu :is(.record-format,[role=status],.record-player,.record-time,.record-rank,.text-button){color:var(--ink);font-size:13px;line-height:1.6}
#setup-view[data-mode=classic] .puzzle-records-menu ol:empty{display:none}
#setup-view[data-mode=classic] .puzzle-records-menu .text-button{min-height:44px;text-decoration:underline;text-underline-offset:4px}
@media(min-width:901px){
 #setup-view[data-mode=classic]{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);grid-template-areas:"back back" "stage head" "stage settings";grid-template-rows:auto auto 1fr;column-gap:clamp(28px,3.5vw,64px);row-gap:22px;align-content:start}
 #setup-view[data-mode=classic]>.prepare-back{grid-area:back;justify-self:start;margin:0!important}
 #setup-view[data-mode=classic]>.prepare-heading{grid-area:head;margin:0!important;padding:0!important}
 #setup-view[data-mode=classic]>.prepare-layout{display:contents}
 #setup-view[data-mode=classic] .prepare-stage{grid-area:stage;align-self:start;display:flex;flex-direction:column;align-items:center;gap:20px;margin:0;padding:0;background:none;min-width:0}
 #setup-view[data-mode=classic] .prepare-settings{grid-area:settings;min-width:0;margin:0}
 #setup-view[data-mode=classic] .prepare-heading h1{font-size:clamp(36px,3.7vw,66px)!important;line-height:1.02;margin:16px 0;letter-spacing:-.035em;overflow-wrap:anywhere}
}
@media(min-width:901px) and (max-width:1150px){#setup-view[data-mode=classic] .piece-presets{grid-template-columns:repeat(2,minmax(0,1fr))}#setup-view[data-mode=classic] #setup-form>.classic-options{grid-template-columns:minmax(0,1fr)}#setup-view[data-mode=classic] #setup-form .setting-switch{min-height:90px}}
@media(max-width:900px){#setup-view[data-mode=classic] .prepare-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:32px}#setup-view[data-mode=classic] .prepare-stage{min-width:0}#setup-view[data-mode=classic] .prepare-art-heading{margin-bottom:14px}#setup-view[data-mode=classic] .prepare-art img{max-height:480px}#setup-view[data-mode=classic] .prepare-heading h1{font-size:clamp(30px,6.5vw,48px)!important;line-height:1.05;margin:14px 0;overflow-wrap:anywhere}#setup-view[data-mode=classic] .piece-presets{grid-template-columns:repeat(2,minmax(0,1fr))}#setup-view[data-mode=classic] #setup-form>.classic-options{grid-template-columns:minmax(0,1fr)}}
#setup-view #setup-form #setup-submit{background:var(--pink)!important;color:var(--ink)!important}
#setup-view .puzzle-records-menu summary,#setup-view .puzzle-records-menu summary *{color:var(--ink)!important;font-weight:700}

/* ===== Lobby form: its group shadow doubles bare text, so the loose fields sit on cream cards too. ===== */
#setup-view:not([data-mode=classic]) #setup-form>.classic-options{display:none!important}

/* ===== Account pages (profile, credits, shop): one calm cream sheet, ink text, pink only for the main action, blue for what is selected. ===== */
.app-layout :is(#profile-view,#credits-view,#shop-view){box-sizing:border-box;width:auto;max-width:1120px;margin:20px auto 56px!important;padding:36px 40px 44px!important;background:var(--cream)!important;box-shadow:10px 10px 0 var(--ink)!important;border-radius:0!important;--text:var(--ink);--muted:#4E3F1B;--amber:var(--ink);--bg:var(--cream);--btn-bg:var(--pink);--btn-fg:var(--ink);--sh:var(--ink);color:var(--ink)}
:is(#profile-view,#credits-view,#shop-view) .jig-group{filter:none!important}
:is(#profile-view,#credits-view,#shop-view) .jig-tile.jig-tile.jig-tile{clip-path:none!important;-webkit-mask:none!important;mask:none!important;margin:0!important;border:0!important}
:is(#profile-view,#credits-view,#shop-view) .eyebrow{display:none!important}
:is(#profile-view,#credits-view,#shop-view) :is(h1,#credits-title){margin:0!important;font-weight:900;font-stretch:125%;font-size:40px!important;line-height:1!important;text-transform:uppercase;text-shadow:none!important;color:var(--ink)!important}
:is(#profile-view,#credits-view,#shop-view) :is(h2,.account-section-title){font:700 13px var(--mono)!important;letter-spacing:.08em!important;text-transform:uppercase;color:var(--ink)!important;margin:0 0 12px!important}
:is(#profile-view,#credits-view,#shop-view) .empty-state{background:transparent!important;box-shadow:none!important;background-color:rgba(22,18,13,.06)!important;border-radius:4px!important;color:var(--ink)!important;font-size:15px!important}
:is(#profile-view,#credits-view,#shop-view) :is(p,span,small,strong,h3,label){color:var(--ink)}

/* Profile: identity line with the key numbers, then the tabs. */
#profile-view #account-email-verification{background:transparent!important;box-shadow:none!important;background-color:rgba(22,18,13,.06)!important;border-radius:4px;padding:16px 20px!important;margin:0 0 24px!important;display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px}
#profile-view #account-email-verification :is(h2,p){margin:0!important}
#profile-view #account-email-verification p{flex:1 1 280px;font-size:14px}
#profile-view .profile-hero{min-height:0!important;padding:0!important;margin:0!important;background:transparent!important;box-shadow:none!important;border:0!important;display:flex!important;align-items:center;gap:24px;flex-wrap:wrap}
#profile-view .profile-hero .profile-cover{display:none!important}
#profile-view .profile-hero .profile-avatar{width:96px!important;height:96px!important;flex:none;font-size:30px!important;box-shadow:none!important}
#profile-view .profile-identity{flex:1 1 320px;min-width:0;display:flex;flex-direction:column;gap:6px;padding:0!important}
#profile-view .profile-identity #profile-handle{display:block!important;order:2;margin:0;padding:0;background:none!important;color:var(--ink)!important;font:600 15px var(--font)!important;letter-spacing:0;text-transform:none}
#profile-view .profile-identity #profile-name{order:1}
#profile-view .profile-identity #profile-bio{order:3;margin:0;font-size:15px}
#profile-view .profile-identity .profile-account-state{order:4;align-self:flex-start;background:none!important;color:var(--ink)!important;padding:0!important;font:700 13px var(--mono)}
#profile-view .profile-hero-actions{display:flex!important;flex-direction:row!important;gap:12px;flex-wrap:wrap}
#profile-view .profile-hero-actions .button.primary{background:var(--pink)!important;color:var(--ink)!important}
#profile-view .profile-hero-actions .button.primary *{color:var(--ink)!important}
#profile-view .profile-shortcuts{display:none!important}
#profile-view .profile-stats{display:flex!important;flex-wrap:wrap;gap:12px 44px!important;margin:28px 0 0!important;padding:22px 0 0!important;background:linear-gradient(90deg,var(--ink) 50%,transparent 0) top/12px 2px repeat-x!important}
#profile-view .profile-stats .profile-stat.jig-tile.jig-tile{display:flex!important;flex-direction:column-reverse;gap:4px;padding:0!important;background:transparent!important;box-shadow:none!important;min-height:0!important;width:auto!important}
#profile-view .profile-stats .profile-stat:is(:nth-child(2),:nth-child(3)){display:none!important}
#profile-view .profile-stats .profile-stat svg{display:none}
#profile-view .profile-stats .profile-stat strong{font-weight:900!important;font-stretch:125%;font-size:32px!important;line-height:1}
#profile-view .profile-stats .profile-stat span{font:700 13px var(--mono)!important;letter-spacing:.08em;text-transform:uppercase}
#profile-view .profile-tabs{margin:28px 0 24px!important;padding:0 0 20px!important;box-shadow:inset 0 -2px 0 var(--ink)}
#profile-view .section-heading p{display:none}

/* Credits: the balance first, one main action, then short rows. */
.app-layout #credits-view{max-width:880px}
#credits-view .credit-dialog-note{display:none!important}
#credits-view .credit-wallet{display:flex!important;align-items:flex-end;gap:16px 48px!important;flex-wrap:wrap;margin:22px 0 8px!important}
#credits-view .credit-wallet-card.jig-tile.jig-tile{display:flex!important;flex-direction:column-reverse;gap:4px;padding:0!important;min-height:0!important;width:auto!important;background:transparent!important;box-shadow:none!important}
#credits-view .credit-wallet-card span{font:700 13px var(--mono)!important;letter-spacing:.08em;color:var(--ink)!important}
#credits-view .credit-wallet-card .credit-wallet-value{font-weight:900;font-stretch:125%;font-size:72px!important;line-height:.95;color:var(--ink)!important}
#credits-view .credit-wallet-card.is-points .credit-wallet-value{font-size:36px!important}
#credits-view .credit-actions,#credits-view .credit-earn-grid{display:flex!important;flex-direction:column;gap:0;margin:16px 0 0!important}
#credits-view .credit-card.jig-tile.jig-tile{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 24px;padding:24px 0!important;min-height:0!important;width:100%!important;max-width:none!important;background:linear-gradient(90deg,var(--ink) 50%,transparent 0) top/12px 2px repeat-x!important;box-shadow:none!important;color:var(--ink)!important}
#credits-view .credit-card>*{grid-column:1}
#credits-view .credit-card>:is(.button,form){grid-column:2;grid-row:1/span 3;align-self:center}
#credits-view .credit-card h2{font:800 20px var(--font)!important;letter-spacing:0!important;text-transform:none!important;margin:0!important}
#credits-view .credit-card .credit-card-kicker{font:700 13px var(--mono)!important;color:var(--ink)!important}
#credits-view .credit-card>p{display:none!important}
#credits-view .credit-card.is-refill .button{background:var(--pink)!important;color:var(--ink)!important}
#credits-view .credit-reserve{display:flex;gap:6px}
#credits-view .credit-reserve i{width:18px!important;height:24px!important;opacity:1!important;border-radius:3px;-webkit-mask:none!important;mask:none!important;background:transparent!important;box-shadow:none;background-color:rgba(22,18,13,.06)}
#credits-view .credit-reserve i.on{background:var(--pink)!important}
#credits-view .credit-card.is-convert form{display:flex!important;align-items:flex-end;gap:12px;flex-wrap:wrap}
#credits-view .credit-card.is-convert form label{font-size:12px}
#credits-view .credit-card.is-soon{display:none!important}
#credits-view .credit-earn{margin-top:28px!important;padding-top:24px;background:linear-gradient(90deg,var(--ink) 50%,transparent 0) top/12px 2px repeat-x}
#credits-view .credit-earn-card.jig-tile.jig-tile{display:flex!important;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px!important;margin:0 0 10px!important;min-height:0!important;width:auto!important;background:transparent!important;box-shadow:none!important;background-color:rgba(22,18,13,.06)!important;border-radius:4px}
#credits-view .credit-earn-card .credit-card-kicker{font:600 16px var(--font)!important;letter-spacing:0!important;text-transform:none!important;color:var(--ink)!important}
#credits-view .credit-earn-card strong{order:2;font:700 15px var(--mono)!important;color:var(--ink)!important}
#credits-view .credit-earn-card p{display:none!important}

/* Shop: the live preview on the left, filters and items on the right. */
.app-layout #shop-view:not([hidden]){display:grid!important;grid-template-columns:300px minmax(0,1fr);grid-template-areas:"head head" "intro filters" "intro grid";gap:22px 36px;align-items:start}
#shop-view>*{min-width:0}
#shop-view .shop-heading{grid-area:head;display:flex!important;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:0!important;padding:0!important;background:none!important}
#shop-view .shop-heading p:not(.eyebrow){margin:8px 0 0;font-size:16px}
#shop-view .point-wallet{background:transparent!important;box-shadow:none!important;padding:0!important;text-align:right;color:var(--ink)!important;min-height:0!important}
#shop-view .point-wallet span{font:700 13px var(--mono)!important;color:var(--ink)!important}
#shop-view .point-wallet strong{font-weight:900;font-stretch:125%;font-size:40px!important;color:var(--ink)!important}
#shop-view .point-wallet small{display:none!important}
#shop-view .shop-intro{grid-area:intro;position:sticky;top:96px;display:flex!important;flex-direction:column;gap:14px;margin:0!important}
#shop-view .shop-intro>.jig-tile:not(#shop-preview){display:none!important}
#shop-view #shop-preview{display:flex!important;flex-direction:column;align-items:flex-start;gap:12px;padding:20px!important;min-height:0!important;width:auto!important;background-color:transparent!important;box-shadow:none!important;background-color:rgba(22,18,13,.06)!important;border-radius:4px}
#shop-view #shop-preview .profile-avatar{width:80px!important;height:80px!important}
#shop-view #shop-filters{grid-area:filters;margin:0!important}
#shop-view #shop-grid{grid-area:grid;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0!important}
#shop-view .shop-card.jig-tile.jig-tile{display:flex!important;flex-direction:column;gap:8px;padding:14px!important;min-height:0!important;width:auto!important;background:transparent!important;box-shadow:none!important;background-color:rgba(22,18,13,.06)!important;border-radius:4px}
#shop-view .shop-card .shop-sample{width:100%!important;height:84px!important;border-radius:3px;background:rgba(22,18,13,.05)!important}
#shop-view .shop-card h3{margin:0;font-size:16px}
#shop-view .shop-card .shop-label{margin:0;font:700 13px var(--mono);letter-spacing:.06em}
#shop-view .shop-card .button{width:100%;margin-top:auto}
#shop-view .shop-card .button.primary{background:var(--cream)!important;color:var(--ink)!important}
#shop-view .shop-card .button.primary:hover{background:var(--pink)!important}
@media(max-width:900px){
 .app-layout :is(#profile-view,#credits-view,#shop-view){margin:12px 12px 40px!important;padding:24px 18px 30px!important}
 .app-layout #shop-view{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "intro" "filters" "grid"}
 #shop-view .shop-intro{position:static}
 #shop-view #shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #credits-view .credit-card{grid-template-columns:minmax(0,1fr)}
 #credits-view .credit-card>:is(.button,form){grid-column:1;grid-row:auto}
}
#profile-view .trophy-card.jig-tile.jig-tile{box-shadow:none!important;background-color:rgba(22,18,13,.06)!important;border-radius:4px;background:transparent!important}
#shop-view .shop-intro>:not(#shop-preview){display:none!important}
:is(#shop-view .shop-intro,#shop-view #shop-grid,#credits-view .credit-wallet,#credits-view .credit-actions,#credits-view .credit-earn-grid,#profile-view .profile-stats,#profile-view .profile-shortcuts){filter:none!important}

/* ===== Each view fills the screen, so the footer only appears once you scroll. ===== */
.app-layout>main.main:not([hidden]):not(#profile-view,#credits-view,#shop-view){min-height:calc(100vh - 88px);min-height:calc(100svh - 88px);box-sizing:border-box}

/* ===== Type pass: body text in Archivo at a wider cut (same family as the titles, easier to read small), and no text under 13px. ===== */
.app-layout,.app-layout :is(button,input,select,textarea){font-stretch:108%}
.app-layout :is(h1,h2,h3,.eyebrow,.mono,code,kbd){font-stretch:inherit}
.app-layout .eyebrow{font-size:13px!important;letter-spacing:.08em}
.app-layout :is(.button,.text-button,.profile-tabs button,.world-tabs button,.auth-switch button,.timer-option,.piece-presets button,.collection-pagination button){font-size:15px!important}
.app-layout .category-pill{font-size:15px!important}
.app-layout .category-pill small{font-size:13px!important}
.app-layout :is(.small-copy,.world-rules,.booster-lead,.pack-footnote,.pack-instruction,.booster-countdown,#catalog-count,.catalog-caption,.shop-label,#shop-preview-title,.profile-account-state,.packet-back-label,.form-message,.empty-state){font-size:15px!important;line-height:1.5}
#rankings-view .world-empty :is(p,small){font-size:16px!important}
.app-layout label{font-size:15px}
.app-layout .showcase-label{font-size:12px!important}
.app-layout .arena-entry small,.app-layout .welcome small{font-size:14px!important}
.booster-packet :is(.packet-count,.packet-edition){font-size:10px!important}
#boosters-view .booster-stock span,#boosters-view .booster-wallet-chip{font-size:14px!important}

/* ===== Puzzles page: title and upload on one line, search with its filters, vivid categories. ===== */
#catalog-view .hub-heading{display:flex!important;align-items:flex-end;justify-content:space-between;gap:16px 32px;flex-wrap:wrap;margin-bottom:22px!important}
#catalog-view .hub-heading>div{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:16px;row-gap:10px;flex:1 1 520px}
#catalog-view .hub-heading>div>:is(.eyebrow,h1){flex-basis:100%;margin:0!important}
#catalog-view .hub-heading h1{font-size:clamp(40px,5vw,64px)!important;line-height:.95!important}
#catalog-view .hub-heading>div>p{margin:0!important;font-size:17px!important}
#catalog-view .hub-heading #credits-button{padding:0!important;min-height:0!important;font-weight:700;color:var(--ink)!important;text-decoration:underline;text-underline-offset:3px}
#catalog-view .catalog-tools{grid-template-columns:minmax(0,1fr) auto auto!important;align-items:end!important;gap:14px 24px!important}
#catalog-view .catalog-tools>label:first-child{grid-column:1!important}
#catalog-view .catalog-tools>.catalog-favorites{min-height:56px;display:flex!important;align-items:center;gap:10px;font-size:16px!important;font-weight:700}
#catalog-view .catalog-tools>span{align-self:center;font-size:15px!important}
#catalog-view #catalog-search{height:58px}
.app-layout .category-pill.category-pill:not([aria-pressed=true]){background:var(--cat)!important;color:var(--cat-fg)!important}
.app-layout .category-pill.category-pill:not([aria-pressed=true]) *{color:var(--cat-fg)!important}
.app-layout .category-pill[aria-pressed=true]{font-weight:900}
@media(max-width:760px){#catalog-view .catalog-tools{grid-template-columns:minmax(0,1fr) auto!important}#catalog-view .catalog-tools>label:first-child{grid-column:1/-1!important}}
#catalog-view .hub-heading>div>.eyebrow{flex-basis:auto!important;margin-right:100%!important}
#catalog-view .catalog-tools>span{align-self:end!important;padding-bottom:18px!important}
#catalog-view .catalog-tools>.catalog-favorites{align-self:end}
#boosters-view #booster-refresh,#boosters-view #booster-topup{font-size:15px!important}
#shop-view .shop-card p.shop-label,#credits-view .credit-card label,#catalog-view .catalog-tools>label:first-child,#boosters-view .booster-stock span,.site-footer .sf-language span{font-size:14px!important}
#arena-view .welcome :is(span,small),#arena-view .showcase-label{font-size:14px!important}
.app-layout :is(.hub-heading,.world-heading,.booster-heading) p:not(.eyebrow){font-size:17px!important;line-height:1.45}

/* ===== Sign-in page: a blue story panel with a puzzle assembling on a loop, the form on the yellow ground. ===== */
#auth-dialog .auth-story{position:relative;background:var(--blue)!important;color:var(--cream)!important;justify-content:space-between!important;gap:20px}
#auth-dialog .auth-story::before{content:"";position:absolute;right:-110px;top:-110px;width:380px;height:380px;background:var(--cream);opacity:.12;-webkit-mask:url(/piece.svg) center/contain no-repeat;mask:url(/piece.svg) center/contain no-repeat;animation:auth-turn 26s linear infinite;pointer-events:none}
@keyframes auth-turn{to{transform:rotate(360deg)}}
#auth-dialog .auth-story :is(h2,p,li,span,.auth-story-note){color:var(--cream)!important}
#auth-dialog .auth-story h2{font-size:clamp(30px,3vw,42px)!important;text-shadow:4px 4px 0 var(--ink)}
#auth-dialog .auth-story p,#auth-dialog .auth-story li{font-size:17px!important}
#auth-dialog .auth-story .auth-story-note{display:none}
#auth-dialog .auth-art.auth-board.auth-board{width:320px!important;height:240px!important;transform:scale(1.2)!important;transform-origin:center!important;margin:70px auto 60px!important;background:repeating-linear-gradient(90deg,#FFF3D633 0 2px,transparent 2px 80px),repeating-linear-gradient(0deg,#FFF3D633 0 2px,transparent 2px 80px)!important;box-shadow:inset 0 0 0 2px #FFF3D666}
#auth-dialog .auth-board-piece{filter:drop-shadow(0 6px 0 var(--ink))!important}
#auth-dialog .auth-board-piece.placed{filter:drop-shadow(0 2px 0 rgba(22,18,13,.6))!important}
#auth-dialog .auth-board-piece img{width:320px!important;height:240px!important;object-fit:cover}
#auth-dialog .auth-board-done{position:absolute;z-index:5;top:-30px;right:-34px;padding:8px 12px;background:var(--pink);color:var(--ink)!important;box-shadow:4px 4px 0 var(--ink);border-radius:3px;font:700 15px var(--mono);letter-spacing:.06em;text-transform:uppercase;transform:rotate(-6deg)}
#auth-dialog .auth-board-done[hidden]{display:none}
#auth-dialog .auth-board-count{align-self:flex-start;display:inline-block!important;margin:0 auto!important;padding:6px 12px;border-radius:4px;box-shadow:inset 0 0 0 2px var(--cream);color:var(--cream)!important;font-size:14px!important}
/* The form: Google first, then the tabs; ChatGPT is gone. */
#auth-dialog .auth-content{display:flex!important;flex-direction:column}
#auth-dialog #auth-provider-panel{order:0!important;margin:6px 0 4px!important;padding:0 0 22px!important;background:linear-gradient(var(--ink),var(--ink)) bottom/100% 2px no-repeat!important}
#auth-dialog #auth-provider-panel .provider-button{width:100%}
#auth-dialog #auth-provider-note{font-size:14px!important;margin-top:10px}
#auth-dialog .provider-chatgpt{display:none!important}
/* "Back to the site" instead of a close cross: this is a page, not a popup. */
#auth-dialog .auth-close.auth-close{width:auto!important;height:auto!important;padding:10px 16px!important;background:var(--cream)!important;color:var(--ink)!important;box-shadow:4px 4px 0 var(--ink);border-radius:3px;font:700 14px var(--mono)!important;letter-spacing:.04em;line-height:1}
#auth-dialog .auth-close.auth-close:hover{background:var(--y)!important}
@media(max-width:900px){
 #auth-dialog .auth-story{gap:8px}
 #auth-dialog .auth-story::before{width:220px;height:220px;right:-80px;top:-80px}
 #auth-dialog .auth-art.auth-board.auth-board{transform:scale(.82)!important;margin:30px auto 10px!important}
 #auth-dialog .auth-story :is(p,ul){display:none}
 #auth-dialog .auth-close.auth-close{top:14px;right:14px}
}
#auth-dialog .auth-art.auth-board.auth-board{transform:scale(1)!important;margin:110px auto 90px!important}#auth-dialog .auth-board-count{margin-top:10px!important}@media(max-width:900px){#auth-dialog .auth-art.auth-board.auth-board{transform:scale(.8)!important;margin:70px auto 40px!important}}

/* ===== Lobby page (#setup, battle): one centred card, four settings in view, the rest folded away, no big picture. ===== */
#setup-view[data-mode=battle]{max-width:700px!important;margin-inline:auto!important}
#setup-view[data-mode=battle] .prepare-heading h1{font-size:clamp(40px,5vw,56px)!important;line-height:.95}
#setup-view[data-mode=battle] #prepare-image-credit,#setup-view[data-mode=battle] .prepare-stage,#setup-view[data-mode=battle] .prepare-settings>h2,#setup-view[data-mode=battle] .battle-image-note,#setup-view[data-mode=battle] .setting-switch:has(#setup-competition){display:none!important}
#setup-view[data-mode=battle] .prepare-layout{display:block!important;margin-top:18px}
#setup-view[data-mode=battle] #setup-form{display:flex!important;flex-direction:column;gap:0!important;padding:26px 30px 24px;background:var(--cream);box-shadow:10px 10px 0 var(--ink);border-radius:4px;filter:none!important}
#setup-view[data-mode=battle] #setup-form>.form-grid{display:contents!important}
#setup-view[data-mode=battle] #setup-form :is(label,fieldset,.setup-mode-choice,.setup-more-toggle,#setup-time,#setup-rules).jig-tile,#setup-view[data-mode=battle] #setup-form :is(label,fieldset){clip-path:none!important;-webkit-mask:none!important;mask:none!important}
#setup-view[data-mode=battle] #setup-form :where(#setup-name-label,.setup-mode-choice,.setting-switch,.setup-categories,label.battle-setting,.piece-count-setting,#setup-time,#setup-rules){order:20;display:flex;flex-direction:row!important;align-items:center;justify-content:space-between;gap:10px 18px;flex-wrap:wrap;margin:0!important;padding:16px 0!important;background:linear-gradient(90deg,var(--ink) 50%,transparent 0) top/12px 2px repeat-x!important;box-shadow:none!important;border:0!important;font-weight:800;font-size:17px;color:var(--ink)!important}
#setup-view[data-mode=battle] #setup-form>#setup-name-label{order:1;background:none!important;padding-top:0!important}
#setup-view[data-mode=battle] #setup-form .setup-mode-choice{order:2;justify-content:flex-end}
#setup-view[data-mode=battle] #setup-form .setup-mode-choice::before{content:attr(aria-label);margin-right:auto;font-weight:800;font-size:17px}
#setup-view[data-mode=battle] #setup-form label:has(#setup-players){order:3}
#setup-view[data-mode=battle] #setup-form label:has(#setup-bots-enabled){order:4}
#setup-view[data-mode=battle] #setup-form .setup-more-toggle{order:5}
#setup-view[data-mode=battle] #setup-form .piece-count-setting{order:6}
#setup-view[data-mode=battle] #setup-form .setup-categories{order:7;display:block}
#setup-view[data-mode=battle] #setup-form label:has(#setup-bot-mode){order:8}
#setup-view[data-mode=battle] #setup-form #setup-bots-label{order:9}
#setup-view[data-mode=battle] #setup-form label:has(#setup-bot-difficulty){order:10}
#setup-view[data-mode=battle] #setup-form label:has(#setup-public){order:11}
#setup-view[data-mode=battle] #setup-form #setup-time{order:30;font:700 14px var(--mono)!important;letter-spacing:.04em;justify-content:center}
#setup-view[data-mode=battle] #setup-form #setup-rules{order:31;background:none!important;padding:0 0 12px!important;font-weight:500;font-size:14px!important;text-align:center;justify-content:center}
#setup-view[data-mode=battle] #setup-form #setup-submit{order:40;width:100%;margin-top:4px}
#setup-view[data-mode=battle] #setup-form #setup-error{order:41}
#setup-view[data-mode=battle] #setup-form:not(.show-more) :is(.piece-count-setting,.setup-categories,label:has(#setup-bot-mode),#setup-bots-label,label:has(#setup-bot-difficulty),label:has(#setup-public)){display:none!important}
#setup-view[data-mode=battle] #setup-form .setting-switch :is(small,span>small){display:block;margin-top:3px;font-weight:500;font-size:14px}
#setup-view[data-mode=battle] #setup-form .setting-switch>svg,#setup-view[data-mode=battle] #setup-form .setup-categories legend{display:none}
#setup-view[data-mode=battle] #setup-form #setup-name-label>small{flex-basis:100%;font-weight:500;font-size:14px}
#setup-view[data-mode=battle] #setup-form :is(select,#setup-bots,#setup-nickname){width:auto!important;min-width:0;height:46px;box-shadow:none!important;border:0!important;border-radius:4px!important;background:var(--cream)!important;font:700 16px var(--font)!important;padding:0 12px!important}
#setup-view[data-mode=battle] #setup-form #setup-nickname{flex:1 1 220px;max-width:300px}
#setup-view[data-mode=battle] #setup-form #setup-bots{width:84px!important}
/* Friendly / ranked as two pieces; the chosen one pressed in blue. */
#setup-view .setup-mode-choice{gap:12px}
#setup-view .setup-mode-choice .button{min-height:46px;font-size:16px!important}
#setup-view .setup-mode-choice .button[aria-pressed=true]{background:var(--blue)!important;color:var(--cream)!important}
#setup-view .setup-mode-choice .button[aria-pressed=false]{background:var(--cream)!important;color:var(--ink)!important}
/* The seat stepper: − and + face each other around the number. */
.seat-stepper{display:inline-flex;align-items:center;gap:10px}
#setup-form .seat-stepper #setup-players{width:64px!important;height:44px;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;text-align:center;font:900 28px var(--font)!important;font-stretch:125%!important;-moz-appearance:textfield;appearance:textfield}
.seat-stepper #setup-players::-webkit-inner-spin-button,.seat-stepper #setup-players::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.seat-stepper .seat-step{width:58px!important;min-width:0!important;min-height:44px;padding:0 0 0 8px!important;font-size:22px!important;font-weight:900!important;background:var(--cream)!important;color:var(--ink)!important}
.seat-stepper .seat-step.pz-flip{padding:0 8px 0 0!important}
/* Mirrored piece: knob on the left, socket on the right. */
.app-layout .pz-flip.pz-flip{border-right:0!important;border-left:var(--pk) solid transparent!important;-webkit-mask:radial-gradient(circle 9px at calc(100% - 2px) var(--pz-face),#0000 calc(100% - .5px),#000),radial-gradient(circle 9px at calc(100% - 2px) var(--pz-base),#0000 calc(100% - .5px),#000),linear-gradient(#0000 var(--pz-face),#000 0 var(--pz-base),#0000 0) 0 0/18px 100% no-repeat,radial-gradient(circle 9px at 9px var(--pz-base),#000 calc(100% - .5px),#0000),radial-gradient(circle 9px at 9px var(--pz-face),#000 calc(100% - .5px),#0000),linear-gradient(#000 0 0) 100% 100%/calc(100% - var(--pk)) calc(100% - var(--pz-p)) no-repeat!important;-webkit-mask-composite:source-in,source-in,source-over,source-over,source-over!important;mask:radial-gradient(circle 9px at calc(100% - 2px) var(--pz-face),#0000 calc(100% - .5px),#000),radial-gradient(circle 9px at calc(100% - 2px) var(--pz-base),#0000 calc(100% - .5px),#000),linear-gradient(#0000 var(--pz-face),#000 0 var(--pz-base),#0000 0) 0 0/18px 100% no-repeat,radial-gradient(circle 9px at 9px var(--pz-base),#000 calc(100% - .5px),#0000),radial-gradient(circle 9px at 9px var(--pz-face),#000 calc(100% - .5px),#0000),linear-gradient(#000 0 0) 100% 100%/calc(100% - var(--pk)) calc(100% - var(--pz-p)) no-repeat!important;mask-composite:intersect,intersect,add,add,add!important}
.app-layout .pz-flip.pz-flip::after{inset:calc(var(--pz-p)*-1) calc(var(--bl)*-1) calc(var(--pz-p) - var(--pz-d)) calc(var(--pk)*-1)!important;-webkit-mask:linear-gradient(#000 0 0),radial-gradient(circle 9px at calc(100% - 2px) var(--pz-face),#0000 calc(100% - .5px),#000),radial-gradient(circle 9px at 9px var(--pz-face),#000 calc(100% - .5px),#0000),linear-gradient(#000 0 0) 100% var(--pz-p)/calc(100% - var(--pk)) calc(100% - var(--pz-d)) no-repeat!important;-webkit-mask-composite:source-out,source-in,source-over!important;mask:linear-gradient(#000 0 0),radial-gradient(circle 9px at calc(100% - 2px) var(--pz-face),#0000 calc(100% - .5px),#000),radial-gradient(circle 9px at 9px var(--pz-face),#000 calc(100% - .5px),#0000),linear-gradient(#000 0 0) 100% var(--pz-p)/calc(100% - var(--pk)) calc(100% - var(--pz-d)) no-repeat!important;mask-composite:subtract,intersect,add!important}
/* "More options": a plain text toggle between the main settings and the folded ones. */
#setup-view[data-mode=battle] .setup-more-toggle:not([hidden]){display:flex!important;align-items:center;justify-content:space-between;width:100%;padding:16px 0!important;border:0;background:linear-gradient(90deg,var(--ink) 50%,transparent 0) top/12px 2px repeat-x;color:var(--ink);font:800 16px var(--font);cursor:pointer;text-align:left}
#setup-view .setup-more-toggle::after{content:"+";font:900 22px var(--font);transition:transform .2s}
#setup-view .setup-more-toggle[aria-expanded=true]::after{transform:rotate(45deg)}
#setup-view .setup-more-toggle:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
/* Rocker switches: an ink housing with a pink rocker tipped towards the pressed side (I = on, O = off). */
#setup-form .setting-switch input[type=checkbox].setting-switch-input,#setup-form .setting-switch input[type=checkbox]{appearance:none!important;flex:none;position:relative!important;width:84px!important;height:46px!important;margin:0 0 4px!important;padding:0!important;border:0!important;border-radius:7px!important;background:var(--ink)!important;box-shadow:0 4px 0 #2A231B!important;cursor:pointer;perspective:140px;transition:none}
#setup-form .setting-switch input[type=checkbox]::after{content:"";position:absolute;inset:5px;border-radius:4px;background:linear-gradient(90deg,#FF7C9B 0%,#FF4A78 46%,#B3123E 50%,#D41B4C 100%);box-shadow:inset 0 2px 0 rgba(255,243,214,.55),inset 0 -3px 0 rgba(22,18,13,.35);transform:rotateY(-16deg);transition:transform .14s ease-out}
#setup-form .setting-switch input[type=checkbox]::before{content:"I\00a0\00a0\00a0\00a0\00a0O"!important;position:absolute!important;z-index:1;inset:0!important;width:auto!important;height:auto!important;display:flex;align-items:center;justify-content:center;border-radius:0!important;background:none!important;color:var(--cream);font:700 17px var(--mono);letter-spacing:0;transform:none!important;pointer-events:none;text-shadow:0 1px 0 rgba(22,18,13,.45)}
#setup-form .setting-switch input[type=checkbox]:checked::after{background:linear-gradient(90deg,#D41B4C 0%,#B3123E 50%,#FF4A78 54%,#FF7C9B 100%);transform:rotateY(16deg)}
#setup-form .setting-switch input[type=checkbox]:active:not(:disabled)::after{transform:rotateY(0deg)}
#setup-form .setting-switch input[type=checkbox]:focus-visible{outline:3px solid var(--blue)!important;outline-offset:4px}
#setup-form .setting-switch input[type=checkbox]:disabled{opacity:.4;cursor:not-allowed}
@media(max-width:700px){#setup-view[data-mode=battle] #setup-form{padding:20px 16px 18px}#setup-view[data-mode=battle] #setup-form #setup-nickname{max-width:none}}
#setup-view[data-mode=battle] #setup-form .setting-switch>span>span{font-weight:800;font-size:17px!important}

/* ===== Cleanup pass: no ink borders, no focus frame on fields, visible buttons on cream, centred sign-in story. ===== */
.app-layout :is(input,select,textarea){border-color:transparent!important}
.app-layout :is(input,select,textarea):focus,.app-layout :is(input,select,textarea):focus-visible,#auth-dialog :is(input,select):focus,.pzl-pre:focus-within{outline:none!important;box-shadow:none!important}
#catalog-view #catalog-search:focus{box-shadow:6px 6px 0 var(--ink)!important}
/* Lobby form: buttons are yellow on the cream card so they never disappear. */
#setup-view #setup-form :is(.seat-step,.setup-mode-choice .button[aria-pressed=false]){background:var(--y)!important;color:var(--ink)!important}
#setup-view #setup-form :is(select,#setup-bots,#setup-nickname){background:var(--y)!important}
/* Rocker: I and O sit nearer the middle of the rocker. */
#setup-form .setting-switch input[type=checkbox]::before{content:"I\00a0\00a0\00a0O"!important}
/* Booster carousel: the previous arrow is a mirrored piece, like the lobby − button. */
#boosters-view #booster-previous{padding-left:0!important;padding-right:8px!important}
/* Sign-in story: logo at the top, then the title, then the puzzle in the middle; nothing below. */
#auth-dialog .auth-story{align-items:center!important;justify-content:center!important;text-align:center}
#auth-dialog .auth-story :is(p,ul,.auth-story-note){display:none!important}
#auth-dialog .auth-story h2{order:1;margin:0!important}
#auth-dialog .auth-story .auth-art{order:2}
#auth-dialog .auth-story .auth-board-count{order:3;align-self:center!important;margin:0!important}
#auth-dialog .auth-story .auth-brand{order:0}
.app-layout .lang-flag{box-shadow:none!important}
#catalog-view input#catalog-search{border:0!important}
.app-layout.app-layout :is(#profile-view,#credits-view,#shop-view){box-shadow:10px 10px 0 var(--ink)!important}
#credits-view .credit-reserve i.credit-reserve-slot,#credits-view .credit-reserve i{box-shadow:none!important;background:rgba(22,18,13,.14)!important}
#credits-view .credit-reserve i.on{background:var(--pink)!important}
#credits-view .credit-earn-card.jig-tile.jig-tile.jig-tile{box-shadow:none!important;background:rgba(22,18,13,.06)!important}
#auth-dialog .auth-close.auth-close.auth-close{box-shadow:4px 4px 0 var(--ink)!important}
#auth-dialog .provider-status{border:0!important;background:rgba(22,18,13,.08);padding:3px 6px;border-radius:3px}
#auth-dialog .auth-art.auth-board.auth-board{margin:64px auto 54px!important}#auth-dialog .auth-story{gap:8px!important}
