/* =====================================================================
   Designer refresh, 12 November 2026
   Production adaptation of the designer's "what changed" handover:
   dark nav in light mode, one category hero, SVG flags, dock Contents sheet,
   phone-menu theme switch, homepage carousel, caption spacing fix.
   Loaded after space.css and space-production.css.
   ===================================================================== */

/* ---------- Light theme: the nav bar, menu, search panel and passport strip stay dark ---------- */
html[data-theme="light"] body[data-playful] .site-header .site-logo__img{content:url('/assets/img/crash-games-logo.svg')!important}
html[data-theme="light"] body[data-playful] .site-header{border-bottom-color:#2B2B2B}
html[data-theme="light"] body[data-playful] .fp-launch{
 --void:#0C0C0C;--surface:#141414;--surface-2:#1C1C1C;--line:#2B2B2B;--line-strong:#6B6B6B;
 --text:#EDEDED;--text-2:#ABABAB;--accent-text:var(--yellow);--chrome-bg:#0C0C0C;color-scheme:dark;
 background:#0C0C0C;color:#EDEDED;box-shadow:0 0 0 100vmax #0C0C0C;clip-path:inset(0 -100vmax);border-bottom-color:#2B2B2B}
html[data-theme="light"] body[data-playful] .fp-launch :is(strong,small,span,b){color:inherit}
html[data-theme="light"] body[data-playful] .fp-launch small{color:#ABABAB}

/* ---------- Visually hidden text never takes up a line (table captions added ~30px) ---------- */
.sr-only{position:absolute!important}

/* ---------- One hero for category pages ---------- */
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x){
 position:relative;isolation:isolate;overflow:hidden;min-height:0!important;margin:0!important;
 padding:28px 0 40px!important;border:0!important;border-bottom:1px solid var(--line)!important;text-align:left!important;
 background:radial-gradient(ellipse 55% 110% at 88% 0%,rgba(255,224,0,.10),transparent 70%),var(--dark-canvas)!important;color:var(--text)}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x)::before,
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x)::after{display:none!important}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x)>.container{text-align:left!important;position:relative;z-index:1}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) .breadcrumb{margin:0 0 28px!important;padding:0!important;justify-content:flex-start}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) h1{
 font:800 clamp(34px,4.2vw,54px)/1.02 var(--font-display)!important;text-transform:uppercase;letter-spacing:0!important;
 color:var(--yellow)!important;-webkit-text-fill-color:var(--yellow)!important;text-shadow:0 0 28px rgba(255,224,0,.38)!important;
 text-align:left!important;margin:0 0 12px!important;max-width:none!important;text-wrap:balance}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) h1 .cg-flag{height:.62em;width:auto;margin:0 .22em .08em 0;vertical-align:middle;border-radius:2px}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) :is(.h1-meta,.h1-meta>div){display:flex!important;flex-wrap:wrap;align-items:center;justify-content:flex-start!important;gap:4px 16px;margin:0!important;padding:0!important}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) .h1-meta{margin:0 0 16px!important}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) :is(.h1-stamp,.byline,.cg-editorial-byline,.cg-people-stamp){
 display:inline-flex!important;align-items:center;gap:6px;background:none!important;border:0!important;border-radius:0!important;
 padding:0!important;margin:0!important;font:400 13px/20px var(--font-body)!important;color:var(--text-2)!important;box-shadow:none!important}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) .h1-stamp svg{display:none}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) .h1-stamp+.cg-editorial-byline{margin-left:16px!important}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) :is(.byline,.cg-editorial-byline) a{color:var(--text)!important;-webkit-text-fill-color:var(--text)!important;text-decoration:underline;text-underline-offset:3px}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) :is(.hero__sub,.cg-cat-hero__intro){
 font:400 16px/1.6 var(--font-body)!important;color:var(--text)!important;max-width:640px!important;margin:0!important;text-align:left!important}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) .cg-cat-hero__intro+.cg-cat-hero__intro{margin-top:10px!important}
@media(max-width:640px){
 html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x){padding:20px 0 28px!important}
 html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) .breadcrumb{margin-bottom:22px!important}
 html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) h1{font-size:clamp(30px,8.6vw,38px)!important}
}
/* the section that follows a category hero starts closer */
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x)+.section{padding-top:32px}

/* ---------- Flags ---------- */
body[data-playful] img.cg-flag{display:inline-block;width:22px;height:auto;aspect-ratio:4/3;vertical-align:-2px;margin-right:8px;border-radius:2px;box-shadow:0 0 0 1px rgba(255,255,255,.12)}
html[data-theme="light"] body[data-playful] img.cg-flag{box-shadow:0 0 0 1px rgba(0,0,0,.12)}
body[data-playful] .card__flag img.cg-flag{width:32px;margin:0}
body[data-playful] .cg-card-more{display:block;margin-top:14px;font:800 14px/1 var(--font-display);text-transform:uppercase;letter-spacing:.04em;color:var(--text-2)}
body[data-playful] a.card:hover .cg-card-more{color:var(--accent-text)}

/* ---------- Launchpad dock with Contents ---------- */
html[data-theme] body[data-playful] .fp-dock-item{min-width:76px;padding:10px 16px}
@media(max-width:640px){html[data-theme] body[data-playful] .fp-dock-item{min-width:0;padding:10px 4px}}
.cg-contents-sheet{position:fixed;z-index:95;left:50%;bottom:92px;transform:translateX(-50%);width:min(380px,calc(100vw - 32px));
 max-height:min(60vh,520px);overflow:auto;background:var(--surface);color:var(--text);border:1px solid var(--line-strong);border-radius:6px;
 box-shadow:0 18px 48px rgba(0,0,0,.45);padding:16px 8px 8px}
.cg-contents-sheet[hidden]{display:none}
.cg-contents-sheet__title{margin:0 12px 8px;font:800 13px/1 var(--font-display);letter-spacing:.08em;text-transform:uppercase;color:var(--text-2)}
.cg-contents-sheet ol{list-style:none;margin:0;padding:0}
.cg-contents-sheet button{display:block;width:100%;text-align:left;background:none;border:0;border-radius:4px;color:var(--text);
 font:500 15px/1.35 var(--font-body);padding:11px 12px;min-height:44px;cursor:pointer}
.cg-contents-sheet button:hover{background:var(--surface-2);color:var(--yellow)}
.cg-contents-sheet button:focus-visible{outline:2px solid var(--yellow);outline-offset:-2px}
@media(max-width:640px){.cg-contents-sheet{bottom:calc(76px + env(safe-area-inset-bottom));width:calc(100vw - 24px)}}
@media(prefers-reduced-motion:no-preference){.cg-contents-sheet:not([hidden]){animation:cg-sheet .2s var(--ease-in)}}
@keyframes cg-sheet{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}

/* ---------- Phones: theme switch lives in the menu beside My shelf ---------- */
@media(max-width:640px){html[data-theme] body[data-playful] .site-header .theme-toggle{display:none!important}}
html[data-theme] body[data-playful] .mobile-nav .cg-menu-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:16px}
html[data-theme] body[data-playful] .mobile-nav .cg-menu-actions .cg-control{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;
 font:800 15px/1 var(--font-display);text-transform:uppercase;letter-spacing:.03em}
html[data-theme] body[data-playful] .mobile-nav .cg-menu-actions svg{width:18px;height:18px}

/* ---------- Homepage featured-games carousel ---------- */
html[data-theme] body[data-playful] .cg-carousel .cg-game-shelf{
 display:flex!important;flex-wrap:nowrap;gap:20px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;
 --slide:min(760px,64%);padding:4px calc((100% - var(--slide))/2) 6px!important;margin:0 calc(-1 * var(--cg-bleed,0px));grid-template-columns:none!important}
html[data-theme] body[data-playful] .cg-carousel .cg-game-shelf::-webkit-scrollbar{display:none}
html[data-theme] body[data-playful] .cg-carousel .cg-tile-wrap{position:relative;flex:0 0 var(--slide);scroll-snap-align:center;opacity:.55;transition:opacity .35s var(--ease-ui)}
html[data-theme] body[data-playful] .cg-carousel .cg-tile-wrap.is-active{opacity:1}
html[data-theme] body[data-playful] .cg-carousel .cg-game-tile{position:relative;display:grid;grid-template-columns:1fr auto;grid-template-rows:1fr auto;height:100%;
 aspect-ratio:2.35/1;border:0!important;
 background:linear-gradient(90deg,var(--tint-l,#1C1C1C) 0%,var(--tint-l,#1C1C1C) 22%,var(--tint-r,#1C1C1C) 78%,var(--tint-r,#1C1C1C) 100%)!important;
 clip-path:polygon(0 0,calc(100% - var(--cut)) 0,100% var(--cut),100% 100%,0 100%)}
html[data-theme] body[data-playful] .cg-carousel .cg-game-tile__image{position:absolute;inset:0;aspect-ratio:auto;background:transparent;border:0;display:flex;justify-content:center}
html[data-theme] body[data-playful] .cg-carousel .cg-game-tile__image img{width:auto;height:100%;max-width:none;object-fit:contain;transform:none!important}
html[data-theme] body[data-playful] .cg-carousel .cg-game-tile::after{content:"";position:absolute;inset:0;background:linear-gradient(to top,rgba(0,0,0,.72),rgba(0,0,0,0) 46%);pointer-events:none}
html[data-theme] body[data-playful] .cg-carousel .cg-game-tile :is(h3,p,.cg-tile-cta){position:relative;z-index:1}
html[data-theme] body[data-playful] .cg-carousel .cg-game-tile h3{grid-column:1;grid-row:2;align-self:end;margin:0 0 20px 24px;font:800 30px/1 var(--font-display);text-transform:uppercase;color:#fff!important;-webkit-text-fill-color:#fff}
html[data-theme] body[data-playful] .cg-carousel .cg-game-tile p{position:absolute;top:16px;right:20px;margin:0;font:800 14px/1 var(--font-display);letter-spacing:.06em;text-transform:uppercase;color:#fff!important;text-shadow:0 1px 6px rgba(0,0,0,.6)}
html[data-theme] body[data-playful] .cg-carousel .cg-tile-cta{grid-column:2;grid-row:2;align-self:end;margin:0 20px 18px 0;display:inline-flex;align-items:center;min-height:40px;padding:0 16px;
 background:var(--yellow);color:#000;font:800 15px/1 var(--font-display);letter-spacing:.04em;text-transform:uppercase;
 clip-path:polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,0 100%)}
html[data-theme] body[data-playful] .cg-carousel .cg-game-tile:hover .cg-tile-cta{background:var(--yellow-hi)}
html[data-theme] body[data-playful] .cg-carousel .cg-save-dot{z-index:2}
.cg-carousel__bar{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:16px}
.cg-carousel__dots{display:flex;gap:8px;align-items:center}
html[data-theme] body[data-playful] .cg-carousel__dot{position:relative;width:8px;height:8px;min-height:0;padding:0;border:0;border-radius:4px;background:var(--line-strong);color:var(--text);cursor:pointer;overflow:hidden;transition:width .3s var(--ease-ui)}
html[data-theme] body[data-playful] .cg-carousel__dot::before{content:"";position:absolute;inset:-18px -4px}
html[data-theme] body[data-playful] .cg-carousel__dot[aria-current="true"]{width:40px;background:var(--line-strong)}
/* dots carry no visible text; colour set only so contrast probes read a valid pair */
html[data-theme] body[data-playful] .cg-carousel__dot span{position:absolute;inset:0;width:0;background:var(--accent-text);color:var(--bg)}
html[data-theme] body[data-playful] .cg-carousel__dot[aria-current="true"] span{width:100%}
html[data-theme] body[data-playful] .cg-carousel.is-playing .cg-carousel__dot.is-run span{width:0;animation:cg-dot var(--cg-dwell,5000ms) linear forwards}
@keyframes cg-dot{from{width:0}to{width:100%}}
html[data-theme] body[data-playful] .cg-carousel__pause{width:36px;height:36px;min-height:0;padding:0;display:inline-flex;align-items:center;justify-content:center;
 border:1px solid var(--line-strong);border-radius:50%;background:transparent;color:var(--text);cursor:pointer}
html[data-theme] body[data-playful] .cg-carousel__pause:hover{border-color:var(--accent-text)}
html[data-theme] body[data-playful] .cg-carousel__pause svg{width:16px;height:16px}
html[data-theme] body[data-playful] :is(.cg-carousel__dot,.cg-carousel__pause):focus-visible{outline:2px solid var(--accent-text);outline-offset:3px}
html[data-theme] body[data-playful] .cg-carousel+.cg-home-search,html[data-theme] body[data-playful] .cg-carousel .cg-home-search{margin-top:28px}

/* phones: tall, narrow tiles with a top-to-bottom gradient sampled from the artwork */
@media(max-width:640px){
 html[data-theme] body[data-playful] .cg-carousel .cg-game-shelf{--slide:68%;gap:12px}
 html[data-theme] body[data-playful] .cg-carousel .cg-game-tile{aspect-ratio:3/4;grid-template-columns:1fr;grid-template-rows:1fr auto auto;
  background:linear-gradient(180deg,var(--tint-t,#1C1C1C) 0%,var(--tint-t,#1C1C1C) 12%,var(--tint-b,#1C1C1C) 62%,var(--tint-b,#1C1C1C) 100%)!important}
 html[data-theme] body[data-playful] .cg-carousel .cg-game-tile__image{inset:12% 0 auto 0;height:auto;aspect-ratio:4/3}
 html[data-theme] body[data-playful] .cg-carousel .cg-game-tile__image img{width:100%;height:auto}
 html[data-theme] body[data-playful] .cg-carousel .cg-game-tile h3{grid-row:2;margin:0 14px 10px;font-size:22px;text-align:center}
 html[data-theme] body[data-playful] .cg-carousel .cg-game-tile p{left:0;right:0;top:12px;text-align:center;font-size:12px}
 html[data-theme] body[data-playful] .cg-carousel .cg-tile-cta{grid-column:1;grid-row:3;justify-self:center;margin:0 0 16px}
}
@media(prefers-reduced-motion:reduce){
 html[data-theme] body[data-playful] .cg-carousel .cg-tile-wrap{transition:none}
 html[data-theme] body[data-playful] .cg-carousel__dot{transition:none}
}
html[data-theme="light"] body[data-playful] .cg-carousel__dot{color:#000}
/* light: initials thumbnail keeps dark ink when its suggestion row is highlighted */
html[data-theme="light"] body[data-playful] .cg-suggestions__option:is(:hover,[aria-selected="true"]) .cg-suggestions__thumbnail{color:#2B2B2B!important}
/* studio label clears the save button (top-left) */
@media(min-width:641px){html[data-theme] body[data-playful] .cg-carousel .cg-game-tile p{position:absolute!important;left:auto!important;right:26px!important;top:18px!important;max-width:calc(100% - 96px);text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transform:none!important}}
@media(max-width:640px){html[data-theme] body[data-playful] .cg-carousel .cg-game-tile p{position:absolute!important;left:54px!important;right:12px!important;top:16px!important;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transform:none!important}}
/* hero column lines up with the page column (and clears the ship gutter at 1100px+) */
@media(min-width:1100px){html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x)>.container{max-width:min(1240px,calc(100vw - 256px))!important}}
/* catalogue stamp reads like the other heroes' "Content updated" line */
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) .h1-stamp{text-transform:none!important;letter-spacing:0!important}
html[data-theme] body[data-playful] main .hero.cg-cat-hero:not(#cg-x) :is(.h1-meta,.h1-stamp,.cg-people-stamp,.byline){margin-bottom:14px!important}
/* illustration wells match the recoloured charcoal art (tools/recolour_editorial_art.py) */
html[data-theme] body[data-playful] .cg-flight-art:not(#cg-x){background:#141414!important}
html[data-theme] body[data-playful] .cg-editorial-art:not(#cg-x),html[data-theme] body[data-playful] .cg-editorial-art:not(#cg-x) img{background:#141414!important}
/* tables: every line of table text sits below the 16px body size (numbers, ranks, names, links and buttons included) */
html[data-theme] body[data-playful] main table:not(#cg-x) :is(td,th) :is(a:not(.btn),strong,b,span.sl-wtp__brand){font-size:inherit!important}
html[data-theme] body[data-playful] main table:not(#cg-x) :is(td.num,.sl-wtp__score,.cg-ppc-rank){font-size:15px!important;font-weight:800}
html[data-theme] body[data-playful] main table:not(#cg-x) :is(.btn,.cg-code-btn){font-size:14px!important}
html[data-theme] body[data-playful] main table:not(#cg-x) :is(.btn,.cg-code-btn){min-height:44px}
