/* =====================================================================
   GAMIFY · GLASS (2026-10-26) — one material, five layers, no blur.
   ---------------------------------------------------------------------
   An Apple style glass look for the whole app, built WITHOUT backdrop blur
   (blur smears on phones, costs battery and was asked to go). The glass
   reads as glass from three things instead:
     1. a fill that is a little lighter at the top than at the bottom,
     2. a lit rim: a 1px gradient edge, bright top left, fading, then a
        softer bounce light bottom right,
     3. a one pixel sheen just inside the top edge.
   Anything that floats over CONTENT (the tab bar, sheets, toasts) uses the
   near solid version, so text never shows through it.

   THE FIVE LAYERS (low to high). Every surface takes exactly one, so what
   is on top always looks on top:
     0 backdrop   the sky (body::before) and its clouds or stars
     1 surface    cards and rows that sit on the sky             --e1
     2 raised     the hero card, primary buttons                 --e2
     3 chrome     the tab bar, corner buttons, toasts            --e3
     4 sheet      modals, sheets, the tutorial, the reward card  --e4
   Scrims sit between 3 and 4 and are tinted, never blurred.

   Loaded LAST: after redesign.css on the shell (index.html), and right
   after skin.css on the game pages, so it re-dresses without re-laying
   out. Every colour is a token and every token has a night / skin value.
   Motion: the screen and page transitions at the end of this file, all
   off under prefers-reduced-motion.
   ===================================================================== */

/* ---- 1. constants -------------------------------------------------- */
:root{
  --gl-ease:cubic-bezier(.2,.8,.2,1);       /* arrivals */
  --gl-spring:cubic-bezier(.34,1.32,.64,1); /* a small overshoot for things that land */
  --gl-leave:cubic-bezier(.4,0,1,1);        /* departures */
  --gl-press:.97;                           /* how far a glass control sinks */
  --gl-gloss:rgba(255,255,255,.26);         /* the lit band across a primary button */
  /* named layers for the z-index numbers the app already uses */
  --z-backdrop:-1; --z-page:1; --z-chrome:40; --z-scrim:50; --z-sheet:81;
}

/* ---- 1b. type ------------------------------------------------------------
   Nunito (SIL Open Font License, app/fonts/OFL.txt), bundled so it works
   offline: a rounded, clean display face for titles, questions, labels and
   numbers. Body text and course text in tiles stay in the system face.
   The Parlor keeps its serif. */
@font-face{font-family:"Gamify Display";src:url("fonts/nunito-latin.woff2") format("woff2");font-weight:500 1000;font-style:normal;font-display:swap;
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{--font-display:"Gamify Display",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}
:root[data-skin="parlor"] body{--font-display:Georgia,"Times New Roman",serif}
/* the shell: the same face for the wordmark, titles, buttons and numbers */
body.shell :is(.g-wordmark,.wordmark,.screen-title,#homeHero h1,.home-classes h2,.pair-sets h3,.g-btn,.btn,.nav-tile,.hero-ring span,.acct-btn .a-txt,.stat-chip .v,.lvl-num,.cls-open b.g-clamp2,.bg-sheet h2,.modal h2,.tut-card h2,.tut-go){font-family:var(--font-display)}
body.shell :is(.screen-title,#homeHero h1,.home-classes h2,.bg-sheet h2,.modal h2,.tut-card h2){font-weight:900;letter-spacing:-.012em}
body.shell .g-wordmark{font-weight:1000;letter-spacing:.16em}
body.shell :is(.g-btn,.btn,.tut-go){font-weight:900;letter-spacing:.005em}
body.shell .nav-tile{font-weight:900;letter-spacing:.02em}
body.shell .cls-open b.g-clamp2{font-weight:900;letter-spacing:-.005em}
body.shell :is(.stat-chip .v,.hero-ring span){font-variant-numeric:tabular-nums;font-weight:1000}
body.shell :is(.g-label,.stat-chip .k,.cap){letter-spacing:.12em}

/* ---- 2. the material: light glass (sky, sunset, meadow, lavender, Sky Deck) */
body{
  --gl-rgb:255,255,255;                 /* glass tint, as r,g,b */
  --gl-top:.97; --gl-bot:.93;           /* fill at the top and bottom edge: near solid, so the backdrop never shows through a card */
  --gl-rim:rgba(255,255,255,.98);       /* lit edge, top left */
  --gl-rim-mid:rgba(255,255,255,.16);   /* the sides */
  --gl-rim-2:rgba(255,255,255,.62);     /* bounce light, bottom right */
  --gl-sheen:rgba(255,255,255,.95);     /* one pixel inside the top edge */
  --gl-shade:12,30,48;                  /* shadow colour, as r,g,b */
  --gl-scrim:rgba(8,22,40,.44);         /* behind a sheet */
  --gl-well-rgb:255,255,255; --gl-well-top:.34; --gl-well-bot:.20;   /* a table tray */
  --gl-well-edge:rgba(255,255,255,.62); --gl-well-sheen:rgba(255,255,255,.85);
}
/* night shell, night theme */
body.shell[data-bg="night"],:root[data-theme="night"] body.shell{
  --gl-rgb:46,52,106; --gl-top:.97; --gl-bot:.93;
  --gl-rim:rgba(255,255,255,.40); --gl-rim-mid:rgba(255,255,255,.05); --gl-rim-2:rgba(255,255,255,.16);
  --gl-sheen:rgba(255,255,255,.16); --gl-shade:0,0,0; --gl-scrim:rgba(3,5,16,.62);
}
/* game table skins */
:root[data-skin="sky"] body{
  --gl-shade:4,16,46; --gl-scrim:rgba(4,16,46,.56);
  --gl-well-rgb:6,22,62; --gl-well-top:.18; --gl-well-bot:.30;   /* smoked glass on the blue table */
  --gl-well-edge:rgba(255,255,255,.24); --gl-well-sheen:rgba(255,255,255,.34);
}
:root[data-skin="neon"] body{
  --gl-rgb:22,28,62; --gl-top:.95; --gl-bot:.90;
  --gl-rim:rgba(62,230,255,.55); --gl-rim-mid:rgba(255,255,255,.06); --gl-rim-2:rgba(255,79,216,.34);
  --gl-sheen:rgba(255,255,255,.14); --gl-shade:0,0,0; --gl-scrim:rgba(4,6,18,.66);
  --gl-well-rgb:255,255,255; --gl-well-top:.06; --gl-well-bot:.02;
  --gl-well-edge:rgba(255,255,255,.14); --gl-well-sheen:rgba(62,230,255,.30);
}
:root[data-skin="parlor"] body{
  --gl-rgb:14,44,33; --gl-top:.94; --gl-bot:.88;
  --gl-rim:rgba(226,192,106,.62); --gl-rim-mid:rgba(244,236,217,.06); --gl-rim-2:rgba(226,192,106,.26);
  --gl-sheen:rgba(244,236,217,.14); --gl-shade:0,0,0; --gl-scrim:rgba(4,14,10,.6);
  --gl-well-rgb:0,0,0; --gl-well-top:.14; --gl-well-bot:.22;
  --gl-well-edge:rgba(176,141,63,.45); --gl-well-sheen:rgba(244,236,217,.16);
}
/* derived on the same element, so a night or skin value above flows through */
body{
  --gl-rim-line:linear-gradient(150deg,var(--gl-rim) 0%,var(--gl-rim-mid) 32%,var(--gl-rim-mid) 66%,var(--gl-rim-2) 100%);
  --glass:linear-gradient(180deg,rgba(var(--gl-rgb),var(--gl-top)),rgba(var(--gl-rgb),var(--gl-bot))) padding-box,var(--gl-rim-line) border-box;
  /* fully opaque: anything over content must hide it (with no blur, even 2% would let text ghost through) */
  --glass-solid:linear-gradient(180deg,rgb(var(--gl-rgb)),color-mix(in oklab,rgb(var(--gl-rgb)) 95%,rgb(var(--gl-shade)))) padding-box,var(--gl-rim-line) border-box;
  --gl-in:inset 0 1px 0 var(--gl-sheen),inset 0 -1px 0 rgba(var(--gl-rgb),.20);
  /* each layer: a hairline ring (the edge), a contact shadow, then a cast shadow that grows with height */
  --e1:0 0 0 .5px rgba(var(--gl-shade),.12),0 1px 2px rgba(var(--gl-shade),.10),0 6px 16px -6px rgba(var(--gl-shade),.30);
  --e2:0 0 0 .5px rgba(var(--gl-shade),.12),0 2px 4px rgba(var(--gl-shade),.10),0 14px 30px -10px rgba(var(--gl-shade),.38);
  --e3:0 0 0 .5px rgba(var(--gl-shade),.14),0 3px 6px rgba(var(--gl-shade),.12),0 20px 40px -12px rgba(var(--gl-shade),.44);
  --e4:0 0 0 .5px rgba(var(--gl-shade),.16),0 4px 10px rgba(var(--gl-shade),.14),0 32px 70px -14px rgba(var(--gl-shade),.56);
  --gl-btn:linear-gradient(180deg,var(--gl-gloss),rgba(255,255,255,0) 52%),linear-gradient(90deg,var(--accent),var(--accent2));
  --gl-btn-shadow:inset 0 1px 0 rgba(255,255,255,.55),inset 0 -2px 0 rgba(var(--gl-shade),.10),0 1px 1px rgba(var(--gl-shade),.14),0 8px 18px -8px color-mix(in oklab,var(--accent2) 85%,transparent);
}

/* ---- 2b. highlight colours (Jay, 2026-10-26: small touches of colour that break up the blue) -----------------------------
   Gold is the trim: hairlines, short rules, the star count. Aqua (--hl-1), violet (--hl-2) and pink (--hl-3) are the accents;
   every game wears one of them (engine.js sets data-hl, which sets --game-hl). Small doses only: rails, marks, rules, icons,
   confetti. Never a big fill, never the only signal. Pink and aqua sit away from the red and green that mean wrong and right.
   The -text versions are mixed toward the page ink, so a heading in an accent reads on a dark table and on a light one. */
body{--hl-gold:#d9a21b;--hl-1:#14a394;--hl-2:#7c5cf0;--hl-3:#e0569b}
:root[data-theme="night"] body,body.shell[data-bg="night"]{--hl-gold:#ffd166;--hl-1:#3fd6c6;--hl-2:#b9a3ff;--hl-3:#ff8fc8}
:root[data-skin="sky"] body{--hl-gold:#ffd34d;--hl-1:#3fe0cf;--hl-2:#c3a6ff;--hl-3:#ff8fc8}
:root[data-skin="neon"] body{--hl-gold:#ffd166;--hl-1:#3ee6ff;--hl-2:#a78bfa;--hl-3:#ff4fd8}
:root[data-skin="parlor"] body{--hl-gold:#e2c06a;--hl-1:#6fc2b2;--hl-2:#c99ad0;--hl-3:#ec9a74}
body{
  --hl-gold-text:color-mix(in oklab,var(--hl-gold) 70%,var(--page-ink,var(--ink)));
  --hl-1-text:color-mix(in oklab,var(--hl-1) 70%,var(--page-ink,var(--ink)));
  --hl-2-text:color-mix(in oklab,var(--hl-2) 70%,var(--page-ink,var(--ink)));
  --hl-3-text:color-mix(in oklab,var(--hl-3) 70%,var(--page-ink,var(--ink)));
  --game-hl:var(--hl-1);--game-hl-text:var(--hl-1-text);
}
[data-hl="1"]{--game-hl:var(--hl-1);--game-hl-text:var(--hl-1-text)}
[data-hl="2"]{--game-hl:var(--hl-2);--game-hl-text:var(--hl-2-text)}
[data-hl="3"]{--game-hl:var(--hl-3);--game-hl-text:var(--hl-3-text)}

/* ---- 3. layer 0, the backdrop (shell) ---------------------------------
   A lit sky with depth, on a fixed layer so it never scrolls or stretches
   (iOS ignores background-attachment: fixed). Back to front:
     the sky      a vertical gradient, a soft white glow top left, a warm
                  sunlit glow top right, a faint luminous floor
     the horizon  a bank of pale clouds along the bottom (body.shell::after)
     the clouds   cumulus shapes drifting at three depths (shell.js sets
                  .far, .mid, .near: smaller, paler and slower further back)
   All of it stays quiet: the cards in front are solid with a defined edge,
   so the line between background and foreground is always clear (Jay,
   2026-10-26). Colours are tokens; the shapes are masks, so each
   background tints them itself. No blur anywhere. */
:root{
  --cloud-shape:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 90'%3E%3Cg fill='black'%3E%3Ccircle cx='60' cy='60' r='28'/%3E%3Ccircle cx='102' cy='44' r='38'/%3E%3Ccircle cx='148' cy='54' r='30'/%3E%3Ccircle cx='182' cy='66' r='22'/%3E%3Ccircle cx='32' cy='70' r='18'/%3E%3Crect x='30' y='62' width='164' height='26' rx='13'/%3E%3C/g%3E%3C/svg%3E");
  --bank-shape:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 200'%3E%3Cg fill='black' opacity='.5'%3E%3Ccircle cx='0' cy='100' r='55'/%3E%3Ccircle cx='90' cy='82' r='50'/%3E%3Ccircle cx='190' cy='96' r='58'/%3E%3Ccircle cx='300' cy='80' r='52'/%3E%3Ccircle cx='410' cy='94' r='56'/%3E%3Ccircle cx='520' cy='100' r='55'/%3E%3Crect x='0' y='100' width='520' height='100'/%3E%3C/g%3E%3Cg fill='black'%3E%3Ccircle cx='40' cy='152' r='46'/%3E%3Ccircle cx='140' cy='138' r='52'/%3E%3Ccircle cx='250' cy='152' r='44'/%3E%3Ccircle cx='350' cy='136' r='50'/%3E%3Ccircle cx='460' cy='150' r='48'/%3E%3Ccircle cx='560' cy='152' r='46'/%3E%3Crect x='0' y='152' width='520' height='48'/%3E%3C/g%3E%3C/svg%3E");
}
body.shell{
  --sky-glow:rgba(255,255,255,.42);
  --sky-warm:rgba(255,238,204,.34);
  --sky-floor:rgba(255,255,255,.20);
  --sky-deep:color-mix(in oklab,var(--bg1) 86%,#0b2a52);
  --sky:radial-gradient(85% 52% at 10% -6%,var(--sky-glow),rgba(255,255,255,0) 64%),
        radial-gradient(62% 40% at 98% -6%,var(--sky-warm),rgba(255,255,255,0) 64%),
        radial-gradient(120% 46% at 50% 108%,var(--sky-floor),rgba(255,255,255,0) 62%),
        linear-gradient(176deg,var(--bg2) 0%,color-mix(in oklab,var(--bg2) 42%,var(--bg1)) 38%,var(--bg1) 74%,var(--sky-deep) 100%);
  --cloud-top:#ffffff;
  --cloud-bot:color-mix(in oklab,#ffffff 82%,var(--bg2));
  --bank-top:color-mix(in oklab,#ffffff 74%,var(--bg2));
  --bank-bot:color-mix(in oklab,#ffffff 62%,var(--bg1));
  --bank-strength:.5;
  background:var(--bg1);
}
body.shell[data-bg="sunset"]{--sky-deep:color-mix(in oklab,var(--bg1) 84%,#5a1840);--sky-warm:rgba(255,214,168,.42)}
body.shell[data-bg="meadow"]{--sky-deep:color-mix(in oklab,var(--bg1) 84%,#0d4a3a);--sky-warm:rgba(255,246,196,.34)}
body.shell[data-bg="lavender"]{--sky-deep:color-mix(in oklab,var(--bg1) 84%,#2c2470);--sky-warm:rgba(255,224,240,.32)}
body.shell[data-bg="night"]{
  --sky-glow:rgba(124,108,255,.30);
  --sky-floor:rgba(86,104,220,.20);
  --sky-deep:#080a1a;
  --bank-top:#2a2f66; --bank-bot:#161a3e; --bank-strength:.55;
  --sky:radial-gradient(1.5px 1.5px at 12% 18%,#fff 60%,transparent),radial-gradient(1px 1px at 70% 12%,#fff 60%,transparent),
        radial-gradient(1.5px 1.5px at 42% 38%,#fff 60%,transparent),radial-gradient(1px 1px at 86% 46%,#fff 60%,transparent),
        radial-gradient(1px 1px at 22% 72%,#fff 60%,transparent),radial-gradient(1.5px 1.5px at 62% 84%,#fff 60%,transparent),
        radial-gradient(1px 1px at 92% 90%,#fff 60%,transparent),radial-gradient(1px 1px at 34% 8%,#fff 60%,transparent),
        radial-gradient(1px 1px at 56% 62%,rgba(255,255,255,.7) 60%,transparent),radial-gradient(1px 1px at 6% 52%,rgba(255,255,255,.7) 60%,transparent),
        radial-gradient(80% 50% at 92% -10%,var(--sky-glow),transparent 66%),
        radial-gradient(120% 46% at 50% 110%,var(--sky-floor),transparent 62%),
        linear-gradient(176deg,var(--bg2) 0%,var(--bg1) 72%,var(--sky-deep) 100%);
  background:var(--bg1);
}
body.shell::before{content:"";position:fixed;inset:0;z-index:var(--z-backdrop);pointer-events:none;background:var(--sky)}
/* the horizon: a two row cloud bank along the bottom, the back row half as strong */
body.shell::after{content:"";position:fixed;left:0;right:0;bottom:0;height:200px;z-index:var(--z-backdrop);pointer-events:none;
  background:linear-gradient(180deg,var(--bank-top),var(--bank-bot));opacity:var(--bank-strength);
  -webkit-mask:var(--bank-shape) left bottom/520px 200px repeat-x;mask:var(--bank-shape) left bottom/520px 200px repeat-x}
/* the drifting clouds: a crisp cumulus, lit from above, at three depths */
body.shell .cloud{filter:none;border-radius:0;opacity:.5;
  background:linear-gradient(180deg,var(--cloud-top) 48%,var(--cloud-bot));
  -webkit-mask:var(--cloud-shape) center/100% 100% no-repeat;mask:var(--cloud-shape) center/100% 100% no-repeat}
body.shell .cloud::before,body.shell .cloud::after{content:none}
body.shell .cloud.far{opacity:.3}
body.shell .cloud.mid{opacity:.48}
body.shell .cloud.near{opacity:.66}
body.shell .cloud.dim{opacity:.28}
#splash{background:var(--sky)}
#splash::before,#splash::after{filter:none;border-radius:0;background:linear-gradient(180deg,var(--cloud-top) 48%,var(--cloud-bot));
  -webkit-mask:var(--cloud-shape) center/100% 100% no-repeat;mask:var(--cloud-shape) center/100% 100% no-repeat}
#splash::before{height:74px}
#splash::after{height:50px}

/* ---- 4. layers 1 and 2, surfaces on the sky (shell) -------------------- */
body.shell :is(.g-card,.shell-card,.game-tile,.topic-tile,.car-empty,.archived-group,.big-tile,.stat-chip,.bg-auto,.g-btn.ghost){
  background:var(--glass);border:1px solid transparent;box-shadow:var(--gl-in),var(--e1)}
body.shell :is(.shell-card,.car-empty),body.shell #homeHero.g-hero{box-shadow:var(--gl-in),var(--e2)}
body.shell #homeHero.g-hero{background:var(--glass);border:1px solid transparent;border-radius:26px}
/* a row lifts a little under the pointer, sinks under the finger */
body.shell :is(.g-card.cls-row,.game-tile,.big-tile){transition:transform .18s var(--gl-ease),box-shadow .18s var(--gl-ease)}
@media (hover:hover) and (pointer:fine){
  body.shell :is(.g-card.cls-row,.game-tile,.big-tile):hover{transform:translateY(-1px);box-shadow:var(--gl-in),var(--e2)}
}
body.shell :is(.g-card.cls-row,.game-tile,.big-tile):active{transform:scale(.985)}
/* class badges and the today ring get the same lit edge as the glass */
body.shell .g-cls{border:1px solid rgba(255,255,255,.5);box-shadow:inset 0 1px 0 rgba(255,255,255,.55),inset 0 -2px 0 rgba(var(--gl-shade),.10),0 2px 6px -2px rgba(var(--gl-shade),.30)}
body.shell .g-dot.today{box-shadow:0 0 0 3px color-mix(in oklab,var(--accent2) 22%,transparent)}
/* hairlines inside glass are lighter than the old edge so the card reads as one piece */
body.shell .archived-row{border-top-color:rgba(var(--gl-shade),.08)}

/* ---- 5. buttons ---------------------------------------------------------
   Primary actions are lit candy: the accent gradient with a gloss band on
   top, a crisp inner bottom edge and a warm cast shadow (layer 2). */
:is(.btn:not(.ghost),.g-btn:not(.ghost),.g-play,.play-btn,.tut-go,.tut-co-btn.is-primary,.pr-chip.on){
  background:var(--gl-btn);border-color:transparent;box-shadow:var(--gl-btn-shadow)}
:is(.btn,.g-btn,.g-play,.play-btn,.g-icon-btn,.acct-btn,.tut-go,.tut-co-btn,.tut-skip){
  transition:transform var(--press-ms,100ms) var(--gl-ease),box-shadow .2s var(--gl-ease),filter .2s}
:is(.btn,.g-btn,.g-play,.play-btn,.g-icon-btn,.acct-btn,.tut-go,.tut-co-btn,.tut-skip):active:not(:disabled){transform:scale(var(--gl-press))}
@media (hover:hover) and (pointer:fine){
  :is(.btn:not(.ghost),.g-btn:not(.ghost),.g-play,.play-btn):hover:not(:disabled){filter:brightness(1.04) saturate(1.05);transform:translateY(-1px)}
  body.shell .gear-btn:hover{transform:rotate(20deg)}
}
/* layer 3: the corner controls float, so they use the solid glass */
body.shell :is(.g-icon-btn,.acct-btn),body .tut-skip{
  background:var(--glass-solid);border:1px solid transparent;box-shadow:var(--gl-in),var(--e2)}
/* the wordmark never breaks onto two lines on a 375px phone */
#screen-home .g-wordmark{white-space:nowrap}

/* ---- 6. layer 3, the tab bar --------------------------------------------
   Solid glass (content scrolls under it). The current tab is a lit pill
   that SLIDES from tab to tab: shell.js measures the current tile and sets
   --ni-x, --ni-y, --ni-w, --ni-h, then adds .ni-ready. Without that (no JS,
   first paint) the current tile keeps its own fill, so nothing is lost. */
body.shell .bottom-nav.g-nav{background:var(--glass-solid);border:1px solid transparent;box-shadow:var(--gl-in),var(--e3);isolation:isolate}
body.shell .g-nav::before{content:"";position:absolute;left:0;top:0;z-index:-1;pointer-events:none;
  width:var(--ni-w,0);height:var(--ni-h,0);transform:translate(var(--ni-x,0),var(--ni-y,0));
  border-radius:var(--radius);background:var(--gl-btn);box-shadow:var(--gl-btn-shadow);opacity:0}
body.shell .g-nav.ni-ready::before{opacity:1}
body.shell .g-nav.ni-anim::before{transition:transform .46s var(--gl-spring),width .46s var(--gl-spring),height .46s var(--gl-spring)}
body.shell .g-nav.ni-ready .nav-tile.current{background:transparent;box-shadow:none}
body.shell .g-nav .nav-tile{transition:color .2s var(--gl-ease),transform var(--press-ms,100ms) var(--gl-ease)}
body.shell .g-nav .nav-tile:active{transform:scale(.94)}
body.shell .g-nav .nav-tile .nico{transition:transform .32s var(--gl-spring)}
body.shell .g-nav .nav-tile.current .nico{transform:translateY(-1px) scale(1.08)}

/* ---- 7. layer 4, sheets, modals, toasts and the tutorial ----------------
   A scrim (tinted, never blurred) fades in, then the sheet lands on top. */
body.shell .modal-veil,body.shell .bg-veil{background:var(--gl-scrim);-webkit-backdrop-filter:none;backdrop-filter:none}
body.shell .modal-veil.show,body.shell .bg-veil.show{animation:glFade .2s var(--gl-ease) both}
body.shell .modal,body.shell .bg-sheet,.tut-card,.tut-coach{background:var(--glass-solid);border:1px solid transparent;box-shadow:var(--gl-in),var(--e4)}
body.shell .modal-veil.show .modal{animation:glSheetIn .38s var(--gl-spring) both}
body.shell .bg-sheet{border-bottom:0}
body.shell .bg-sheet.show{animation:glRise .42s var(--gl-spring) both}
body.shell .bg-pick i{border-color:rgba(var(--gl-shade),.10);box-shadow:inset 0 1px 0 rgba(255,255,255,.5),var(--e1)}
body.shell .bg-pick[aria-pressed="true"] i{border-color:var(--accent2);box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 0 0 3px color-mix(in oklab,var(--accent2) 28%,transparent),var(--e1)}
body.shell .undo-toast{box-shadow:var(--e3)}
.tut-coach{animation:glRise .42s var(--gl-spring) both}
.tut-card{border-radius:26px}

@keyframes glFade{from{opacity:0}to{opacity:1}}
@keyframes glSheetIn{from{opacity:0;transform:translateY(10px) scale(.94)}to{opacity:1;transform:none}}
@keyframes glRise{from{opacity:0;translate:0 40px}to{opacity:1;translate:0 0}}

/* ---- 8. the game table (skin.css pieces, every game page) --------------- */
/* HUD pills and the corner buttons: glass chips */
.hud .pill,.pr-act,.pr-chip:not(.on){background:var(--glass);border:1px solid transparent;box-shadow:var(--gl-in),var(--e1)}
a.back,.skin-btn,.back-btn{background:var(--glass-solid);border:1px solid transparent;box-shadow:var(--gl-in),var(--e2);
  -webkit-backdrop-filter:none;backdrop-filter:none}
a.back,.skin-btn{transition:transform var(--press-ms,100ms) var(--gl-ease)}
/* layering: the corner buttons are chrome (layer 3), so a sheet and its scrim (Options, the reward card, the notice) cover them
   instead of the buttons floating on top (they sat at 9999). The tap feedback layers (+N chips, the wrong wash, confetti) stay
   above everything because they never take a tap. */
a.back,.skin-btn{z-index:var(--z-chrome)}
a.back:active,.skin-btn:active{transform:scale(var(--gl-press))}
/* the tray a board sits in: clear glass over the table, lit rim, a little depth inside */
/* (a translucent fill cannot sit on a gradient border: the border layer would show through the whole tray, so its rim is
   drawn with inset light lines instead) */
.g-well,.g-tray{
  background:linear-gradient(180deg,rgba(var(--gl-well-rgb),var(--gl-well-top)),rgba(var(--gl-well-rgb),var(--gl-well-bot)));
  border:1px solid var(--gl-well-edge);-webkit-backdrop-filter:none;backdrop-filter:none;
  box-shadow:inset 0 1px 0 var(--gl-well-sheen),inset 0 -1px 0 rgba(255,255,255,.07),inset 0 16px 30px -20px rgba(var(--gl-shade),.55),var(--e2)}
/* cards on the table: a crisp edge and a contact shadow under the soft one */
:root[data-skin="sky"] .g-face{box-shadow:inset 0 -2px 0 rgba(var(--gl-shade),.06),var(--card-shadow)}
/* scrims and the sheets on them */
.skin-veil,.win.g-win{-webkit-backdrop-filter:none;backdrop-filter:none}
.skin-veil{background:var(--gl-scrim)}
.win.g-win{background:color-mix(in oklab,var(--bg1) 86%,transparent)}
.win.g-win.show{animation:glFade .24s var(--gl-ease) both}
.skin-sheet,.g-win .g-panel{
  background:linear-gradient(var(--panel-bg),var(--panel-bg)) padding-box,var(--gl-rim-line) border-box;
  border:1px solid transparent;box-shadow:inset 0 1px 0 var(--gl-sheen),var(--e4)}
.skin-sheet{border-bottom:0}
.win.g-win.show .g-panel{animation:glSheetIn .42s var(--gl-spring) both}
/* a light from the top left on the Sky Deck table, the same sun as the shell sky */
:root[data-skin="sky"] body:not(.shell){background:
  radial-gradient(85% 45% at 8% -8%,rgba(255,255,255,.20),rgba(255,255,255,0) 62%),
  radial-gradient(120% 120% at 50% 0%,var(--bg2),var(--bg1) 70%);background-color:var(--bg1)}

/* ---- 9. transitions ------------------------------------------------------
   a) Tab to tab, and into Uploads: shell.js adds .scr-in to the screen that
      just opened, with --scr-dx set to +1 or -1 by direction (right of the
      old tab slides in from the right). Its blocks arrive in a quick stagger.
      The DOM switch itself stays instant: nothing waits on the motion. */
.screen.scr-in :is(.home-wrap,.screen-inner) > *{animation:glScrIn .44s var(--gl-ease) backwards}
.screen.scr-in :is(.home-wrap,.screen-inner) > :nth-child(2){animation-delay:.03s}
.screen.scr-in :is(.home-wrap,.screen-inner) > :nth-child(3){animation-delay:.06s}
.screen.scr-in :is(.home-wrap,.screen-inner) > :nth-child(4){animation-delay:.09s}
.screen.scr-in :is(.home-wrap,.screen-inner) > :nth-child(5){animation-delay:.12s}
.screen.scr-in :is(.home-wrap,.screen-inner) > :nth-child(n+6){animation-delay:.15s}
@keyframes glScrIn{from{opacity:0;transform:translateX(calc(var(--scr-dx,0) * 28px)) translateY(8px) scale(.985)}to{opacity:1;transform:none}}

/* b) Shell to game and back: a cross page view transition (Safari 18.2+,
      Chrome 126+; older browsers simply load the page). Into a game the
      shell sinks back and the table rises up to meet you; back to Menu the
      table drops away and the shell settles forward. The rules for both
      directions live here because the NEW page runs the transition. */
@view-transition{navigation:auto}
::view-transition-group(root){animation-duration:.46s}
/* arriving on a game page (no .shell body) */
:root:not(:has(body.shell))::view-transition-old(root){animation:glPageSink .34s var(--gl-leave) both}
:root:not(:has(body.shell))::view-transition-new(root){animation:glPageRise .5s var(--gl-ease) both}
/* arriving back on the shell */
:root:has(body.shell)::view-transition-old(root){animation:glPageDrop .32s var(--gl-leave) both}
:root:has(body.shell)::view-transition-new(root){animation:glPageSettle .46s var(--gl-ease) both}
@keyframes glPageSink{to{opacity:0;transform:scale(.92);filter:brightness(.8)}}
@keyframes glPageRise{from{opacity:0;transform:translateY(36px) scale(1.04)}to{opacity:1;transform:none}}
@keyframes glPageDrop{to{opacity:0;transform:translateY(40px) scale(.96)}}
@keyframes glPageSettle{from{opacity:0;transform:scale(1.04)}to{opacity:1;transform:none}}

/* ---- 10. reduced motion: the information stays, the movement goes ------- */
@media (prefers-reduced-motion:reduce){
  .screen.scr-in :is(.home-wrap,.screen-inner) > *,
  body.shell .modal-veil.show .modal,body.shell .bg-sheet.show,.tut-coach,
  .win.g-win.show .g-panel,.win.g-win.show,body.shell .modal-veil.show,body.shell .bg-veil.show{animation:none}
  body.shell .g-nav.ni-anim::before{transition:none}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none !important}
}
