/* Packman: everything on the game's page but how a shape and its face are painted, which is in faces.css. */
:root{
  --bg:#FFF4DE; --dot:rgba(43,33,64,.09);
  --ink:#2B2140; --text:#2B2140; --mut:#7A6F90;
  --card:#FFFFFF; --bin:#FFFFFF; --wash:rgba(43,33,64,.06);
  --coral:#FF6B6B; --sun:#FFC93C; --mint:#3DDBB4; --sky:#4DA8FF; --grape:#9B7BFF; --pink:#FF8FCB; --tang:#FF9F45;
  --face:#2B2140; --bad:#E5263A; --win:#C9F7E6; --around:#2F3A5C;
  --rim:#2B2140;   /* the line round the box, and round the pips that count what is in it: it has to show against the page, so it is pale on a dark one */
  --f:"Fredoka", ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bw:2.5px; --pop:cubic-bezier(.34,1.56,.64,1);
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#1F1A30; --dot:rgba(255,244,222,.07);
    --ink:#0D0A17; --text:#FFF4DE; --mut:#A99FC4;
    --card:#2E2746; --bin:#4A4070; --wash:rgba(255,244,222,.08);
    --win:#255E55; --rim:#B9AEE6;
  }
}
/* The chapter of powers is played at night, whatever the theme: a dark sky with stars, and a gold-rimmed box. */
body.powers{
  --bg:#221A4E; --ink:#0D0A17; --text:#FFF4DE; --mut:#B9AEE6; --rim:#B9AEE6; --dot:rgba(255,244,222,.07);
  --card:#2E2563; --bin:#40358A; --wash:rgba(255,244,222,.09); --win:#2E7D6E;
  background-image:radial-gradient(rgba(255,255,255,.6) 1px, transparent 1.5px), radial-gradient(rgba(255,201,60,.55) 1.4px, transparent 2px), radial-gradient(rgba(255,255,255,.28) 1px, transparent 1.5px);
  background-size:53px 47px, 131px 113px, 29px 31px; background-position:0 0, 40px 60px, 13px 17px;
}
body.powers .bin-fill{stroke:#FFC93C}
/* The chapter of twists is played on squared paper, whatever the theme and whether or not the level has powers:
   pale green, ruled in fine squares with a heavier line every fifth, the shapes outlined in dark green and the box rimmed in sea green. */
body.twists{
  --bg:#DDF4EA; --ink:#14353A; --text:#14353A; --mut:#4C7D77; --rim:#14353A; --dot:rgba(16,110,96,.1);
  --card:#FFFFFF; --bin:#FFFFFF; --wash:rgba(16,110,96,.08); --win:#C9F7E6;
  background-image:linear-gradient(rgba(16,110,96,.17) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(16,110,96,.17) 1.5px, transparent 1.5px),
    linear-gradient(rgba(16,110,96,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(16,110,96,.09) 1px, transparent 1px);
  background-size:120px 120px, 120px 120px, 24px 24px, 24px 24px; background-position:0 0;
}
body.twists .bin-fill{stroke:#0E8C78}
/* The chapter of inventions is drawn on a blueprint, whatever the theme: deep blue, ruled in fine white squares with a
   heavier line every fifth, and the box rimmed in white. */
body.invent{
  --bg:#17406E; --ink:#0B1E36; --text:#EEF5FF; --mut:#A9C4E6; --rim:#EEF5FF; --dot:rgba(238,245,255,.08);
  --card:#1F4C80; --bin:#245892; --wash:rgba(238,245,255,.09); --win:#2E7D6E;
  background-image:linear-gradient(rgba(238,245,255,.16) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(238,245,255,.16) 1.5px, transparent 1.5px),
    linear-gradient(rgba(238,245,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(238,245,255,.07) 1px, transparent 1px);
  background-size:120px 120px, 120px 120px, 24px 24px, 24px 24px; background-position:0 0;
}
body.invent .bin-fill{stroke:#EEF5FF}
/* The chapter of rivals is played at a games table, whatever the theme: green baize with a soft lamp-lit middle and a
   fine weave, the box rimmed in brass, and Sam's corner of the table washed in her pink. */
body.rivals{
  --bg:#1D5A43; --ink:#0B241A; --text:#F4F1E4; --mut:#B7D3C2; --rim:#F4F1E4; --dot:rgba(244,241,228,.06);
  --card:#22694F; --bin:#2A7A5C; --wash:rgba(244,241,228,.09); --win:#2E7D6E;
  background-image:radial-gradient(ellipse 70% 55% at 50% 45%, rgba(255,236,170,.13), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255,143,203,.12), transparent 75%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px);
  background-size:auto;
}
body.rivals .bin-fill{stroke:#E8C36A}
body.rivals .squares{stroke:#F4F1E4; stroke-opacity:.35}
/* In the chapter of powers a strip between the level's name and the board is kept for the power in hand:
   its face, its name and one line, on a gold card. The strip is always there, so nothing moves when the
   card comes and goes, and it covers neither the name nor the board. Empty, it says what it is for. */
#power-row{display:none; flex:none; height:50px; margin-top:8px; align-items:center; justify-content:center}
body.powers #power-row,body.guests #power-row,body.once #power-row{display:flex}   /* and at the dinner party, for what the guest in hand wants */
#power-idle{margin:0; padding:0 8px; font-size:14.5px; font-weight:500; text-align:center; color:var(--mut)}
#power-row.told #power-idle{display:none}   /* (said three times already: see startLevel) */
#power-note{width:max-content; max-width:100%; max-height:100%; display:flex; align-items:center; gap:11px; padding:5px 18px 6px 8px;
  color:#2B2140; background:var(--sun); border:var(--bw) solid var(--ink); border-radius:16px; animation:note .28s var(--pop) both}
@keyframes note{from{transform:translateY(-8px) scale(.97); opacity:0}}
#power-note .avatar{width:34px; height:34px}
#power-note p{margin:0; font-size:15px; font-weight:500; line-height:1.22}
#power-note b{margin-right:6px; font-size:16px; font-weight:700}
@media (prefers-reduced-motion:reduce){ #power-note{animation:none} }
.avatar.p-ghost .fill{fill-opacity:.88; stroke-dasharray:calc(6px * var(--u)) calc(4px * var(--u))}
.avatar .zz,.avatar .snooze,.avatar .yawn,.avatar .drool{visibility:visible} .avatar .lid,.avatar.p-sleeper .eye,.avatar.p-sleeper .mouth{visibility:hidden}
@media (max-width:460px){ #power-row{height:60px; margin-top:6px} #power-idle{font-size:13.5px} #power-note{gap:8px; padding:4px 10px 5px 6px; border-radius:14px} #power-note .avatar{width:32px; height:32px} #power-note b{font-size:14px} #power-note p{font-size:12.5px; line-height:1.2} }
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{height:100%; margin:0}
*{touch-action:none}
.card,.card *{touch-action:pan-y}
body{
  font-family:var(--f); color:var(--text); background-color:var(--bg);
  background-image:radial-gradient(var(--dot) 1.6px, transparent 1.7px); background-size:26px 26px;
  overflow:hidden; overscroll-behavior:none; user-select:none; -webkit-user-select:none;
  touch-action:none; -webkit-touch-callout:none; -webkit-text-size-adjust:100%;
}
button{font:inherit; color:inherit; cursor:pointer}
[hidden]{display:none !important}

/* soft blobs drifting behind everything: none of them a shape the game is played with, so none can be taken for a piece */
.sky{position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:0}
.sky i{position:absolute; display:block; opacity:.14; transition:opacity .25s; animation:drift 26s ease-in-out infinite alternate}
.sky i.s{border-radius:58% 42% 55% 45% / 48% 58% 42% 52%}
.sky i.t{border-radius:42% 58% 46% 54% / 56% 44% 56% 44%}
body:has(#stage.eyes) .sky i{opacity:0}   /* and none of them shows round the table while eyesight is on */
.sky i:nth-child(1){width:120px; height:120px; left:-30px; top:16%; background:var(--sky); animation-duration:31s}
.sky i:nth-child(2){width:90px; height:80px; right:6%; top:9%; background:var(--sun); animation-duration:24s; animation-delay:-8s}
.sky i:nth-child(3){width:150px; height:132px; right:-40px; bottom:12%; background:var(--pink); animation-duration:36s; animation-delay:-14s}
.sky i:nth-child(4){width:70px; height:70px; left:12%; bottom:6%; background:var(--mint); animation-duration:22s; animation-delay:-4s}
.sky i:nth-child(5){width:56px; height:50px; left:44%; top:4%; background:var(--grape); animation-duration:28s; animation-delay:-19s}
@keyframes drift{
  from{transform:translate(0,0)}
  to{transform:translate(38px,-46px)}
}

#app{position:relative; z-index:1; height:100vh; height:100dvh; display:flex; flex-direction:column;
  padding:max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left))}

/* top bar */
/* the bar stands above everything under it, so the labels that drop from its buttons are never covered by the level strip */
.top{position:relative; z-index:6; display:flex; align-items:center; justify-content:space-between; gap:10px; flex:none}
.logo{display:flex; align-items:center; gap:9px; text-decoration:none; color:inherit}
.logo svg{width:38px; height:38px; flex:none; animation:bob 3.2s ease-in-out infinite}
@keyframes bob{50%{transform:translateY(-3px)}}
.word{display:flex; font-weight:700; font-size:30px; letter-spacing:.5px; line-height:1}
.word b{display:inline-block; font-weight:700; animation:hop .7s var(--pop) both; animation-delay:calc(var(--n) * 70ms + 150ms)}
.word b:nth-child(1){color:var(--coral)} .word b:nth-child(2){color:var(--tang)} .word b:nth-child(3){color:var(--sun)}
.word b:nth-child(4){color:var(--mint)} .word b:nth-child(5){color:var(--sky)} .word b:nth-child(6){color:var(--grape)} .word b:nth-child(7){color:var(--pink)}
.word b{-webkit-text-stroke:var(--bw) var(--ink); paint-order:stroke fill}
.logo:hover .word b{animation:wave .55s var(--pop) both; animation-delay:calc(var(--n) * 50ms)}
@keyframes hop{from{transform:translateY(-24px); opacity:0} to{transform:none; opacity:1}}
@keyframes wave{40%{transform:translateY(-7px)}}

.tools{display:flex; gap:8px}
.ib{width:42px; height:42px; display:grid; place-items:center; padding:0; background:var(--card);
  border:var(--bw) solid var(--ink); border-radius:14px; transition:transform .12s var(--pop)}
.ib svg{width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round}
.ib:hover{transform:translateY(-2px)}
.ib:active{transform:translateY(1px)}
.ib.off{color:var(--mut)}
.ib.sure{position:relative; background:var(--coral); color:#2B2140; animation:wiggle .45s var(--pop)}
.ib.sure::after{content:"Again to start over"; position:absolute; top:calc(100% + 10px); right:-6px; padding:5px 11px 6px; white-space:nowrap;
  font-weight:600; font-size:14px; color:#FFF4DE; background:#2B2140; border-radius:10px; z-index:5; animation:hop .3s var(--pop) both}
@keyframes wiggle{25%{transform:translateX(-4px)} 60%{transform:translateX(3px)}}
/* What a button is for, in a small label under it: while the cursor is over it, or, on a phone,
   for a couple of seconds after it is tapped (.tip, set in game.js). */
.ib[data-tip]{position:relative}
.ib[data-tip]:not(.sure)::after{content:attr(data-tip); position:absolute; z-index:5; top:calc(100% + 8px); left:50%; padding:4px 10px 5px; white-space:nowrap;
  font-weight:600; font-size:13px; line-height:1.2; color:#FFF4DE; background:#2B2140; border-radius:9px; pointer-events:none;
  opacity:0; transform:translate(-50%,-4px); transition:opacity .35s, transform .35s}
.ib[data-tip].tip:not(.sure)::after{opacity:1; transform:translate(-50%,0); transition:none}
/* the last one would run off the edge of the window if it were centred */
.tools .ib[data-tip]:last-child:not(.sure)::after{left:auto; right:0; transform:translate(0,-4px)}
.tools .ib[data-tip].tip:last-child:not(.sure)::after{transform:none}
@media (hover:hover){
  .ib[data-tip]:not(.sure):hover::after,.ib[data-tip]:not(.sure):focus-visible::after{opacity:1; transform:translate(-50%,0); transition:none}
  .tools .ib[data-tip]:last-child:not(.sure):hover::after,.tools .ib[data-tip]:last-child:not(.sure):focus-visible::after{transform:none}
}
/* how many hints the chapter has left, on the corner of the hint button */
.ib .left{position:absolute; right:-7px; top:-8px; min-width:19px; height:19px; padding:0 4px; display:grid; place-items:center; font-size:11.5px; font-weight:700; line-height:1;
  color:#2B2140; background:var(--sun); border:2px solid var(--ink); border-radius:999px; pointer-events:none}
.ib .left.none{background:var(--card); color:var(--mut)}
.ib.dim{color:var(--mut); opacity:.5}
/* eyesight, while it is on: the button takes the blue the shapes turn */
.ib[aria-pressed="true"]{background:#7C97C9; color:#2B2140}
/* the leaderboard: the same button as the rest, with a gold cup */
.ib.lead .cup{fill:var(--sun)}
/* the three for the board in front of you stand a little apart from the three for the game as a whole */
@media (min-width:600px){ .tools #b-board{margin-left:10px} }
.ib.nag{background:var(--sun); color:#2B2140; box-shadow:0 0 0 4px rgba(255,201,60,.4); animation:nudge 1.6s ease-in-out infinite}
.ib.off .on-only{display:none}
.ib:not(.off) .off-only{display:none}
:focus-visible{outline:3px solid var(--sky); outline-offset:2px}

/* level strip */
/* the level's button, its name and the progress squares all start from the same line, however much sits under the name */
.hud{display:flex; align-items:flex-start; gap:12px; margin-top:12px; flex:none; min-height:50px}
.chip{flex:none; padding:7px 13px 8px; font-weight:600; font-size:15px; white-space:nowrap;
  background:var(--sun); color:#2B2140; border:var(--bw) solid var(--ink); border-radius:999px;
  transition:transform .12s var(--pop)}
.chip:hover{transform:translateY(-2px)}
.chip:active{transform:translateY(1px)}
.chip b{font-weight:700; font-size:17px}
.title{flex:1; min-width:0}
.title h1{margin:0; font-size:21px; font-weight:700; line-height:1.15}
.title p{margin:2px 0 0; font-size:15.5px; color:var(--text); opacity:.8; line-height:1.25;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
/* the hint's choices on one line, the way on at the right */
.row{display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; margin-top:16px}
.row .btn{margin:0; padding:8px 16px 9px; font-size:15px}

/* leaderboard: the name sheet, a player's block, and the ranked rows */
/* (A picture is a piece from the board at one fixed size, scaled to fit: game.js gives it its --u. Nothing happens on tapping one.) */
.avatar{flex:none; display:block; width:30px; height:30px; pointer-events:none}
.avatar.blink .eye{visibility:hidden} .avatar.blink .shut{visibility:visible}
.you{display:inline-block; vertical-align:middle}
#name-face .avatar{width:84px; height:84px; margin:0 auto 10px; animation:bob 2.6s ease-in-out infinite}
#name-form{margin-top:16px}
#name-form .btn{padding:11px 22px 12px; font-size:18px}
.field{display:block; width:100%; padding:11px 16px 12px; font:600 19px var(--f); text-align:center; color:var(--text); background:var(--wash);
  border:var(--bw) solid var(--ink); border-radius:16px; user-select:text; -webkit-user-select:text}
.field + .field{margin-top:10px}
.field:focus{outline:none; background:var(--card); box-shadow:0 0 0 4px rgba(255,201,60,.55)}
.field::placeholder{color:var(--mut); opacity:.7}
.field.no{animation:wiggle .3s}
/* an email somebody else plays with, and a way to it; then, under the name sheet, the way back to a game already played */
.taken{margin:10px 0 0; font-size:14.5px; color:var(--text)} .taken .link{font-size:14.5px; color:var(--text)}
#name-back{margin-top:14px}
#recover-form{margin-top:16px} #recover-form .btn{padding:11px 22px 12px; font-size:18px}
#recover-sent{margin:16px 0 0; color:var(--text)} #recover-back{margin-top:14px}
body:has(#m-recover.open) #m-name .card{visibility:hidden}   /* (getting a game back from the name sheet: one card at a time, the name sheet back on Back) */
#m-recover.done #recover-form{display:none}
.lb{margin-top:16px; text-align:left}
.lb-head{display:flex; align-items:baseline; justify-content:space-between; margin-bottom:6px; font-size:16px}
.link{padding:0; font:600 14px var(--f); color:var(--mut); background:none; border:0; text-decoration:underline; text-underline-offset:3px; cursor:pointer}
.ranks{list-style:none; margin:0; padding:0; text-align:left; transition:opacity .15s}
/* the whole board, a hundred deep, scrolls inside its sheet */
#board-ranks{max-height:min(46vh, 400px); overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding-right:2px}
#board-ranks li.head{position:sticky; top:0; z-index:1; background:var(--card)}
.ranks.wait{opacity:.45}
.ranks li{display:flex; align-items:center; gap:9px; padding:5px 10px 5px 6px; border-radius:14px; font-size:15px}
.ranks li:nth-child(even){background:var(--wash)}
.ranks .pos{flex:none; width:24px; font-size:14px; font-weight:700; text-align:center; color:var(--mut)}
/* the first three: a medal where the number would be, and the row tinted with its metal */
.ranks li.top .who{font-weight:700}
.ranks li.t1{background:rgba(255,201,60,.26)} .ranks li.t2{background:rgba(160,170,196,.24)} .ranks li.t3{background:rgba(224,146,82,.22)}
.ranks .pos svg{display:block; width:26px; height:28px; margin:-4px calc((100% - 26px) / 2); overflow:visible}
.ranks .pos .tail{fill:#FF6B6B; stroke:var(--ink); stroke-width:1.3; stroke-linejoin:round}
.ranks .pos .disc{stroke:var(--ink); stroke-width:1.6} .ranks .pos .ring{fill:none; stroke-width:1.1}
.ranks .pos text{font:700 10px var(--f); text-anchor:middle}
.t1 .disc{fill:#FFC93C} .t1 .ring{stroke:#FFE9A8} .t1 text{fill:#6B4300}
.t2 .disc{fill:#CDD3E0} .t2 .ring{stroke:#F4F6FA} .t2 text{fill:#3F4660}
.t3 .disc{fill:#E0925A} .t3 .ring{stroke:#F6C9A6} .t3 text{fill:#5C2E0C}
.ranks .who{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600}
.ranks .fig{flex:none; width:46px; text-align:right; font-size:14px; font-weight:600; font-variant-numeric:tabular-nums}
.ranks .fig.t{width:52px}
.ranks li.head{padding-top:0; padding-bottom:3px; background:none}
.ranks li.head .fig{font-size:12px; font-weight:600; color:var(--mut)}
.ranks li.me{background:var(--sun); color:#2B2140; box-shadow:inset 0 0 0 var(--bw) var(--ink)}
.ranks li.me .pos{color:#2B2140}
.ranks li.gap{justify-content:center; padding:0; font-weight:700; color:var(--mut); background:none}
.ranks li.none{justify-content:center; padding:14px; color:var(--mut); background:var(--wash)}
.note{margin:9px 0 0; font-size:14px; font-weight:500; color:var(--mut)}
.note[hidden],.note:empty,.lb[hidden]{display:none}
.whoami{display:flex; align-items:center; justify-content:center; gap:9px; margin:16px 0 0; font-size:15px; font-weight:500}
@media (max-width:420px){ .ranks li{gap:6px; padding-left:4px; padding-right:8px} .ranks .pos{width:18px} .ranks .avatar{width:24px; height:24px} .ranks .fig{width:38px; font-size:13px} .ranks .fig.t{width:44px} }

@keyframes tempt{0%,100%{transform:rotate(-7deg) scale(1)} 50%{transform:rotate(7deg) scale(1.12)}}
.title.swap h1,.title.swap p{animation:slidein .45s var(--pop) both}
.title.swap p{animation-delay:60ms}
@keyframes slidein{from{transform:translateX(-18px); opacity:0}}
.meter{flex:none; text-align:right}
/* how many are packed is plain from the squares; the words stay for screen readers only */
.unseen{position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
#pips{display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; max-width:150px; margin-left:auto}
#pips i{width:13px; height:13px; border:2px solid var(--rim); border-radius:4px; background:var(--wash); transition:background .15s}
#pips i.t{border:0; width:15px; background:var(--rim); clip-path:polygon(50% 0,100% 100%,0 100%); position:relative}
#pips i.t::after{content:""; position:absolute; inset:3.5px 3px 2px; background:var(--bg); clip-path:inherit; transition:background .15s}
#pips i.d{width:24px} #pips i.h{border-radius:50%}
/* the chameleon's place in the row: no shape, only a question mark */
#pips i.q{position:relative; border-style:dashed}
#pips i.q::after{content:"?"; position:absolute; inset:0; display:grid; place-items:center; font:700 9px/1 var(--f); font-style:normal; color:var(--text)}
#pips i.q.on::after{color:#2B2140}
#pips i.on{background:var(--mint); animation:pip .4s var(--pop)}
#pips i.t.on{background:var(--rim)}
#pips i.t.on::after{background:var(--mint)}
@keyframes pip{50%{transform:translateY(-4px)}}
#best{font-size:12.5px; font-weight:500; color:var(--mut); font-variant-numeric:tabular-nums; white-space:nowrap}
#stats{margin-top:4px; font-size:13.5px; font-weight:500; color:var(--mut); font-variant-numeric:tabular-nums; white-space:nowrap}

/* board */
#stage{position:relative; flex:1; min-height:0; margin:8px 0}
/* under eyesight the table round the box is dark: the box is white and the shapes are blues, and both stand clear of it.
   The table runs from one side of the window to the other, and comes and goes in a moment. */
#stage::before{content:""; position:absolute; inset:0 -50vw; z-index:-1; background:var(--around); opacity:0; transition:opacity .2s; pointer-events:none}
#stage.eyes::before{opacity:1}
#board{position:absolute; inset:0; width:100%; height:100%; touch-action:none; overflow:visible; display:block}
#board{--u:.02}
/* Introducing eyesight, on the second level: all dark but the button, with a note hanging under it.
   Nothing here can be closed; the button is the way on. */
#coach{position:fixed; inset:0; z-index:18; pointer-events:none}
#coach[hidden]{display:none}
#coach .spot{position:fixed; box-shadow:0 0 0 4px var(--sun), 0 0 0 200vmax rgba(27,20,45,.66); animation:spot 1.6s ease-in-out infinite}
@keyframes spot{50%{box-shadow:0 0 0 8px var(--sun), 0 0 0 200vmax rgba(27,20,45,.66)}}
#coach .blk{position:fixed; pointer-events:auto}
#coach-say{position:fixed; width:min(262px, calc(100vw - 24px)); margin:0; padding:12px 15px 13px; font-size:15px; font-weight:500; line-height:1.35; text-align:left;
  color:var(--text); background:var(--card); border:var(--bw) solid var(--ink); border-radius:16px; animation:hop .4s var(--pop) both}
#coach-say b{font-weight:700}
#coach-say::before{content:""; position:absolute; left:var(--ax, 50%); top:-8px; width:13px; height:13px; margin-left:-7px; background:var(--card);
  border:solid var(--ink); border-width:var(--bw) 0 0 var(--bw); border-radius:3px 0 0 0; transform:rotate(45deg)}

/* Eyesight: flat colour and no lines. Every shape at its true size, a hair bigger than it is drawn, in a
   blue of its own (set in game.js); the box at its true size, a hair smaller, in white. The faces and the dark frames all go. */
.safe{visibility:hidden; pointer-events:none; fill:#7C97C9}
/* the hard-edged copy of each shape that lies under them all and backs the joins (see game.js) */
.seam{visibility:hidden; pointer-events:none; shape-rendering:crispEdges}
#board.eyes .seam{visibility:visible}
/* the slivers that close a hair of space between two shapes, or a shape and a wall, that count as touching */
.seal{pointer-events:none}
/* Eyesight is a diagram and keeps one palette whatever the theme: a white box on a dark blue table. */
#true-box{visibility:hidden; pointer-events:none; fill:#fff}
#bin.win #true-box{fill:#C9F7E6}
#board.eyes .safe,#board.eyes #true-box{visibility:visible}
#board.eyes .bin-fill{visibility:hidden}
#board.eyes .piece .fill{fill:transparent; stroke:transparent; pointer-events:all}
#board.eyes .piece .face,#board.eyes .piece .face *,#board.eyes .piece .back,#board.eyes .piece .goo{visibility:hidden}
/* An overlap: orange-red against the blue, the pair that stays apart for nearly every kind of colour blindness. */
.hit{fill:#FF4A1C; pointer-events:none}
.bin-fill{fill:var(--bin); stroke:var(--rim); stroke-width:calc(4px * var(--u)); stroke-linejoin:round; transition:fill .35s}
/* nothing inside the board animates with CSS transforms: Safari can leave smears behind */
#bin{animation:fadein .5s both}
#bin.win .bin-fill{fill:var(--win)}
@keyframes fadein{from{opacity:0}}

.piece{cursor:grab}
.piece.fresh .pop{animation:fadein .4s both; animation-delay:var(--d)}
.piece.held{cursor:grabbing}
.piece.sel .fill{stroke-width:calc(4px * var(--u))}
.squares{fill:none; stroke:var(--rim); stroke-opacity:.28; stroke-width:calc(1.5px * var(--u)); stroke-dasharray:calc(4px * var(--u)) calc(4px * var(--u)); pointer-events:none}   /* Rival: the box's squares */
body.duel #handle,body.duel .dock .spin .rb,body.duel .dock .spin .angle{display:none} body.duel .dock .tip{opacity:1}   /* a duel: nothing turns, so no handle and no angle buttons, only the line of what to do */
.piece.twin .fill{stroke-width:calc(4px * var(--u))}   /* the entangled twin of the one in hand, and the thread between the two */
.fence{stroke:var(--rim); stroke-width:calc(2px * var(--u)); stroke-dasharray:calc(6px * var(--u)) calc(8px * var(--u)); stroke-linecap:round; pointer-events:none; opacity:.4}   /* the line down a board that entangled shapes may not cross */
.thread{stroke:var(--rim); stroke-width:calc(2.5px * var(--u)); stroke-dasharray:calc(1px * var(--u)) calc(7px * var(--u)); stroke-linecap:round; fill:none; pointer-events:none; opacity:.75}
/* A shape that does not fit has red dashes round it: round its true edge, which is a few pixels outside the shape as it is drawn.
   So what it is into shows without eyesight: the dashes of two shapes that overlap run into each other, and into the box's wall. */
#board:not(.eyes) .piece.bad .safe{visibility:visible; fill:none !important; stroke:var(--bad); stroke-width:calc(3px * var(--u)); stroke-dasharray:calc(7px * var(--u)) calc(5px * var(--u)); stroke-linejoin:round}

/* (How a shape and its face are painted is in faces.css, which the page that introduces the shapes uses too.
   Here is only what the game adds: how a face changes with what is happening to its shape.) */
.face,.back,.goo{pointer-events:none} .back{fill:var(--c)}
.piece.blink .eye,.piece.bad .eye{visibility:hidden} .piece.blink .shut,.piece.bad .wince{visibility:visible}
.piece.bad.blink .shut{visibility:hidden}
.piece.good .m-good,.piece.good .w-good{visibility:visible} .piece.good .m-idle,.piece.good .w-idle{visibility:hidden}
.piece.bad .m-bad{visibility:visible; fill:var(--face)} .piece.bad .m-idle,.piece.bad .w-idle{visibility:hidden}   /* squashed, it has only the round mouth: no tongue or teeth left over from the one it had */
/* the powers of chapter two: what each one wears, and how it shows the state it is in */
.count{font:700 .4px var(--f); fill:#FF4A1C; stroke:#fff; stroke-width:.07px; paint-order:stroke; pointer-events:none}
#power-note.warn{background:#FF8A70}
.piece.lit .spark{animation:flick .24s steps(2) infinite}
@keyframes flick{50%{fill:#FF4A1C}}
/* the ghost: see-through, with a dashed edge; clearer still once it is sharing a space as it should */
.piece.p-ghost .fill{fill-opacity:.88; stroke-dasharray:calc(6px * var(--u)) calc(4px * var(--u))} .piece.p-ghost .back{visibility:hidden}
.piece.p-ghost.haunt .fill{fill-opacity:.45}
/* the shape it is lying over keeps its colour and gives up its face, so only the ghost's shows */
.piece.haunted .face,.piece.haunted .back{visibility:hidden}
/* Under eyesight the ghost is no block of colour, since it takes up no room of its own: only a dashed outline, so it can still be found and moved. */
#board.eyes .seam.ghostly,#board.eyes .piece.p-ghost .safe{visibility:hidden}
#board.eyes .piece.p-ghost .fill{stroke:#17213F; stroke-width:calc(2px * var(--u)); stroke-dasharray:calc(6px * var(--u)) calc(4px * var(--u))}
.piece.good .boo{visibility:hidden}
.piece.glued .fill{stroke:#B85C00}
/* the glue squeezed out between Sticky and what it is stuck to */
.gum{pointer-events:none} .gum path{fill:none; stroke:#E8891A; stroke-width:.075px; stroke-linecap:round; stroke-linejoin:round} .gum circle{fill:#E8891A}
#board.eyes .gum{visibility:hidden}
#board.eyes .toasts,#board.eyes .piece .wine{visibility:hidden}   /* (nor what the party's guests show of how they get on) */
/* the sleeper asleep: a shade darker, eyes shut, mouth open, drooling, and z's that come up one after another */
.zz,.snooze,.yawn,.drool{visibility:hidden}
.piece.asleep .zz,.piece.asleep .snooze,.piece.asleep .yawn,.piece.asleep .drool{visibility:visible}
.piece.asleep .eye,.piece.asleep .shut,.piece.asleep .wince,.piece.asleep .lid,.piece.asleep .mouth{visibility:hidden}
.piece.asleep .fill,.piece.asleep .back{fill:#7A5FE0}
.piece.asleep .zz{animation:zz 2.4s linear infinite} .piece.asleep .z2{animation-delay:.5s} .piece.asleep .z3{animation-delay:1s}
.piece.asleep .drool{animation:drool 2.4s ease-in-out infinite}
@keyframes zz{0%,10%{opacity:0} 30%,70%{opacity:1} 95%,100%{opacity:0}}
@keyframes drool{50%{fill-opacity:.45}}
@media (prefers-reduced-motion:reduce){ .piece.asleep .zz,.piece.asleep .drool{animation:none} }
/* the magnet's waves, while it is held: three rings out to its reach, coming and going one after another */
.waves{pointer-events:none}
.wave{animation:ripple 1.1s ease-in-out infinite}
.wave.w1{animation-delay:.22s} .wave.w2{animation-delay:.44s}
@keyframes ripple{0%{opacity:0} 35%{opacity:.9} 100%{opacity:0}}   /* (not 'wave': that is the name's, in the bar) */
@media (prefers-reduced-motion:reduce){ .wave{animation:none; opacity:.6} }

.ghost{pointer-events:none; fill:var(--sun); fill-opacity:.3; stroke:var(--text); stroke-width:calc(2.5px * var(--u)); stroke-linejoin:round;
  stroke-dasharray:calc(6px * var(--u)) calc(5px * var(--u)); animation:beckon 1.2s ease-in-out infinite alternate}
@keyframes beckon{from{opacity:.45}}
/* under eyesight the hinted spot is a flat yellow shape at its true size, like everything else there: no outline, no dashes */
#board.eyes .ghost{fill-opacity:1; stroke:none}
.ghost-way{pointer-events:none} .ghost-way line{stroke:var(--sun); stroke-width:calc(3px * var(--u)); stroke-dasharray:.07 .06; stroke-linecap:round} .ghost-way circle{fill:var(--sun)}
#ribbon{pointer-events:none}
#ribbon .edge,#ribbon .band{fill:none; stroke-dasharray:1; animation:tie .4s ease-out both}
#ribbon .edge{stroke:var(--ink); stroke-width:calc(.12px + 5px * var(--u))}
#ribbon .band{stroke:var(--coral); stroke-width:.12px}
.bow{animation:fadein .25s .55s both}
.bow path,.bow circle{fill:var(--coral); stroke:var(--ink); stroke-width:calc(2.5px * var(--u)); stroke-linejoin:round}
@keyframes tie{from{stroke-dashoffset:1}}
#handle{pointer-events:none}
#handle line{stroke:var(--text); stroke-width:calc(2.5px * var(--u)); stroke-dasharray:calc(1px * var(--u)) calc(5px * var(--u)); stroke-linecap:round}
/* Under eyesight the stem crosses dark table, white box and blue shapes. Each dark dot gets a pale ring,
   and the knob a pale rim, so they show on all three. */
#handle line.halo{stroke:none}
#board.eyes #handle line.halo{stroke:#FFF4DE; stroke-width:calc(6px * var(--u))}
#board.eyes #handle line:not(.halo){stroke:#2B2140}
#board.eyes #knob{fill:#fff; stroke:#2B2140; filter:drop-shadow(0 0 calc(1.5px * var(--u)) #FFF4DE) drop-shadow(0 0 calc(1.5px * var(--u)) #FFF4DE)}
#knob{pointer-events:auto; cursor:grab; fill:var(--card); stroke:var(--ink); stroke-width:calc(2.5px * var(--u))}
#knob-hit{pointer-events:auto; cursor:grab; fill:transparent}
#knob-dot{fill:var(--coral); pointer-events:none}
#handle.spin #knob{fill:var(--sun)}
#bubble{position:absolute; left:0; top:0; padding:3px 10px 4px; font-weight:700; font-size:16px; font-variant-numeric:tabular-nums;
  background:var(--ink); color:#FFF4DE; border-radius:999px; pointer-events:none; opacity:0; transition:opacity .15s; will-change:transform}
#bubble.show{opacity:1}
/* rotate dock */
.dock{flex:none; display:flex; align-items:center; gap:10px; height:56px; position:relative}
.spin{flex:1; display:flex; align-items:center; justify-content:center; gap:8px; position:relative; align-self:stretch}
@keyframes nudge{0%,70%,100%{transform:none} 76%{transform:translateX(-4px)} 82%{transform:translateX(4px)} 88%{transform:translateX(-2px)}}
.dock .rb{height:46px; min-width:52px; padding:0 10px; font-weight:600; font-size:16px; background:var(--card);
  border:var(--bw) solid var(--ink); border-radius:15px; transition:transform .2s var(--pop), opacity .2s}
.dock .rb:active{transform:translateY(1px)}
.dock .rb.big{background:var(--sky); color:#2B2140}
.angle{display:flex; align-items:center; height:46px; padding:0 12px 0 6px; background:var(--card);
  border:var(--bw) solid var(--ink); border-radius:15px; font-weight:700; font-size:20px; transition:opacity .2s, transform .2s var(--pop)}
.angle input{width:52px; border:0; background:none; font:inherit; color:inherit; text-align:right; padding:0; outline:0;
  font-variant-numeric:tabular-nums; -moz-appearance:textfield; appearance:textfield; user-select:text; -webkit-user-select:text}
.angle input::-webkit-outer-spin-button,.angle input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0}
.dock.idle .spin .rb,.dock.idle .spin .angle{opacity:0; transform:translateY(8px); pointer-events:none}
.dock .tip{position:absolute; inset:0; display:grid; place-items:center; font-size:15px; font-weight:500; color:var(--mut); pointer-events:none;
  opacity:0; transition:opacity .2s}
.dock.idle .tip{opacity:1}
.dock.won .tip{opacity:0}
body.powers .dock.idle .tip{opacity:0}   /* among the powers the strip over the board already says what to pick up */
.dock .onward{position:absolute; inset:0; margin:auto; width:max-content; height:max-content; padding:8px 20px 9px; font-size:17px; white-space:nowrap; animation:beckon 1s ease-in-out infinite alternate}

/* sheets */
.sheet{position:fixed; inset:0; z-index:20; display:grid; place-items:center; padding:18px;
  background:rgba(27,20,45,.55); opacity:0; visibility:hidden; transition:opacity .2s, visibility .2s}
.sheet.open{opacity:1; visibility:visible}
.card{width:min(440px,100%); max-height:100%; overflow:auto; touch-action:pan-y; padding:24px 22px 22px; text-align:center; background:var(--card);
  border:3px solid var(--ink); border-radius:26px; transform:translateY(30px); transition:transform .35s var(--pop)}
.sheet.open .card{transform:none}
.card h2{margin:0 0 6px; font-size:32px; font-weight:700; line-height:1.1}
.card p{margin:8px 0; font-size:16.5px; line-height:1.4}
.card .sub{color:var(--mut)}
.card .fact{margin-top:14px; padding:11px 14px; text-align:left; font-size:15px; background:var(--wash); border-radius:14px}
.btn{display:inline-block; margin:14px 4px 0; padding:11px 22px 12px; font-weight:700; font-size:18px; background:var(--mint); color:#2B2140;
  border:var(--bw) solid var(--ink); border-radius:16px; transition:transform .12s var(--pop)}
.btn:hover{transform:translateY(-2px)}
.btn:active{transform:translateY(1px)}
.btn{position:relative}
.badge{position:absolute; right:-9px; top:-10px; min-width:24px; height:24px; padding:0 6px; display:grid; place-items:center; font-size:13px; font-weight:700;
  color:#2B2140; background:var(--sun); border:var(--bw) solid var(--ink); border-radius:999px}
.btn:disabled{opacity:.5; cursor:default; transform:none} .btn:disabled .badge{background:var(--card)}
.btn.plain{background:var(--card); color:var(--text); font-weight:600; font-size:16px; padding:9px 16px 10px}
.btn.danger{background:var(--coral)}
.tick-row{display:flex; align-items:center; justify-content:center; gap:9px; margin:14px 0 2px; font-size:15.5px; font-weight:500; cursor:pointer}
.tick-row input{width:20px; height:20px; margin:0; accent-color:var(--coral); cursor:pointer}
.btn.plain.star{background:var(--sun); color:#2B2140; font-weight:700; font-size:18px; padding:11px 22px 12px}
#lose-again svg,.btn.plain svg{width:17px; height:17px; margin:-3px 6px 0 -2px; vertical-align:middle; fill:none; stroke:currentColor; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round}
.how{list-style:none; margin:10px 0 2px; padding:0; text-align:left}
.how li{display:flex; align-items:center; gap:10px; padding:5px 0; font-size:14.5px; line-height:1.3}
.how li > span{flex:none; width:32px; height:32px; display:grid; place-items:center; font-weight:700; font-size:15px; color:#2B2140;
  border:var(--bw) solid var(--ink); border-radius:12px}
.how li:nth-child(1) > span{background:var(--coral)} .how li:nth-child(2) > span{background:var(--sun)}
.how li:nth-child(3) > span{background:var(--mint)}
.taps{display:none}
@media (hover:none) and (pointer:coarse){ .keys{display:none} .taps{display:inline} }
kbd{font:inherit; font-weight:600; font-size:.88em; padding:1px 6px 2px; border:2px solid var(--ink); border-radius:7px; background:var(--wash)}
/* the welcome: its headline is a whole sentence; the prize and the first three on the leaderboard together on a tinted panel,
   the rows in the room three of them take; and a big way in */
#help-h{font-size:27px; text-wrap:balance}
.podium{margin:12px 0 0; padding:8px; border-radius:18px; background:var(--wash)}
.podium .gift{margin:0; background:var(--card)}
#help-ranks{min-height:141px; margin-top:8px}
#help-ranks.none{display:none}
#m-help .btn.go{margin-top:18px; padding:14px 38px 15px; font-size:22px}
@media (max-width:440px){ #help-ranks{min-height:123px} }
/* Under everything, three small things in grey words with a mark each: whose game it is, the shapes, and starting from nothing.
   A row of their own in the middle under the dock; on a wide screen, where the dock's ends are empty, in the page's bottom right
   corner, as far from the edges as the buttons at the top right are. */
.extras{flex:none; display:flex; justify-content:center; gap:14px; margin-top:4px}
.mini{flex:none; display:flex; align-items:center; gap:4px; padding:2px 0; font:600 12px var(--f); line-height:1.2; white-space:nowrap; text-decoration:none;
  color:var(--mut); background:none; border:0; cursor:pointer; filter:grayscale(1); opacity:.45; transition:opacity .15s}
.mini:hover,.mini:focus-visible{opacity:1}
.mini svg{flex:none; width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round}
@media (max-width:440px){ .extras{gap:9px} .mini{gap:3px; font-size:11.5px} }
@media (min-width:1041px), (max-height:480px) and (orientation:landscape){
  .extras{position:absolute; z-index:2; right:max(14px, env(safe-area-inset-right)); bottom:max(10px, env(safe-area-inset-bottom)); margin:0}
}

.stats{display:flex; justify-content:center; gap:10px; margin:14px 0 2px}
.stats div{min-width:92px; padding:8px 10px 9px; border:var(--bw) solid var(--ink); border-radius:14px; background:var(--wash)}
.stats b{display:block; font-size:22px; font-variant-numeric:tabular-nums}
.stats div.new{background:var(--sun); color:#2B2140} .stats div.new small{color:#2B2140}
.stats small{font-size:13px; color:var(--mut)}
.gift{display:flex; align-items:center; gap:10px; margin:10px 0 2px; padding:8px 12px; text-align:left; font-size:14.5px; line-height:1.3;
  border:var(--bw) solid var(--ink); border-radius:14px; background:var(--wash)}
.gift b{color:var(--coral)}
.gift .mug{--k:.24; margin:-10px -6px -10px -10px}   /* (the mug: see mug/mug.css) */
/* The mug is a button: a tap is a closer look. Then it has the sheet to itself, grown to fill it, with Close under it. */
.mug-tap{flex:none; display:flex; margin:0; padding:0; border:0; border-radius:14px; background:none; cursor:zoom-in; -webkit-tap-highlight-color:transparent; transition:transform .15s var(--pop)}
.mug-tap:hover{transform:scale(1.1) rotate(-3deg)} .mug-tap:active{transform:scale(.96)} .mug-tap:focus-visible{outline:3px solid #4DA8FF; outline-offset:2px}
.mug-big{display:none}
.card.mugged{display:flex; flex-direction:column; align-items:center; overflow:hidden}
.card.mugged > *{display:none} .card.mugged > [data-close]{display:inline-block; flex:none; margin-top:0}
.card.mugged > .mug-big{display:grid; place-items:center; flex:1; min-height:0; width:100%; cursor:zoom-out}   /* (it grows into its place from the small one's: see mugUp in game.js) */
.card.mugged > [data-close]{animation:fadein .3s .2s both}
#m-help .card.mugged > .btn.go{margin-top:0; padding:9px 16px 10px; font-size:16px; font-weight:600; color:var(--text); background:var(--card)}   /* (Close, as the leaderboard has it) */
/* a mug nobody can see is not kept turning */
.sheet:not(.open) .mug *,.sheet:not(.open) .mug *::before,.sheet:not(.open) .mug *::after{animation-play-state:paused}
.stats.all{margin-top:8px} .stats.all div{background:var(--sun); color:#2B2140; min-width:142px} .stats.all small{color:#2B2140}
/* a place among the first three taken from somebody: a big medal and who it was taken from */
.whole{display:inline-block}   /* a sentence that is not to be broken across lines */
.coup{display:flex; align-items:center; gap:12px; margin:16px 0 4px; padding:10px 14px 10px 10px; text-align:left; color:#2B2140; background:#FFE9A8;
  border:var(--bw) solid var(--ink); border-radius:18px; box-shadow:0 5px 0 var(--ink)}
.coup[hidden]{display:none}
.sheet.open .coup{animation:hop .6s var(--pop) both}
.coup.t2{background:#E3E7F0} .coup.t3{background:#F6D3B7}
#coup-medal{flex:none; width:54px} #coup-medal svg{display:block; width:54px; height:58px; overflow:visible; animation:tempt 1.8s ease-in-out infinite}
#coup-medal .tail{fill:#FF6B6B; stroke:#2B2140; stroke-width:1.3; stroke-linejoin:round} #coup-medal .disc{stroke:#2B2140; stroke-width:1.6} #coup-medal .ring{fill:none; stroke-width:1.1}
#coup-medal text{font:700 10px var(--f); text-anchor:middle}
.coup p{margin:0; font-size:16px; font-weight:500; line-height:1.3} .coup p b{font-weight:700} .coup p strong{display:block; font-size:21px; font-weight:700; line-height:1.15}
/* the prize: a little sun, with rays turning slowly behind the words and a glow that breathes */
.prize{position:relative; isolation:isolate; overflow:hidden; margin:18px 0 6px; padding:12px 14px 15px; color:#2B2140; background:var(--sun);
  border:var(--bw) solid var(--ink); border-radius:16px; box-shadow:0 0 0 4px rgba(255,201,60,.4)}
.prize::before{content:""; position:absolute; z-index:-1; left:50%; top:50%; width:200%; aspect-ratio:1; margin:-100% 0 0 -100%;
  background:repeating-conic-gradient(rgba(255,255,255,.42) 0 15deg, transparent 15deg 30deg); animation:rays 26s linear infinite}
.sheet.open .prize{animation:hop .6s var(--pop) .3s both, glow 2.2s ease-in-out .9s infinite}
.prize .gi{display:block; width:46px; height:46px; margin:0 auto 2px; animation:tempt 1.8s ease-in-out infinite}
.prize .gi svg{display:block; width:100%; height:100%}
.prize b{display:block; font-size:26px; line-height:1.15; color:var(--coral); -webkit-text-stroke:2.5px var(--ink); paint-order:stroke fill}
.prize p{margin:5px 0 0; font-size:15px; font-weight:500}
.prize small{display:block; margin-top:7px; font-size:13px; font-weight:500; opacity:.72}
.prize button{display:block; margin:11px auto 0; padding:6px 22px 7px; font:inherit; font-weight:700; font-size:15px; color:#2B2140; background:#FFF4DE;
  border:var(--bw) solid var(--ink); border-radius:999px; cursor:pointer; transition:transform .12s var(--pop)}
.prize button:hover{transform:translateY(-2px)} .prize button:active{transform:translateY(1px)}
@keyframes rays{to{transform:rotate(1turn)}}
@keyframes glow{50%{box-shadow:0 0 0 8px rgba(255,201,60,.28), 0 0 20px 8px rgba(255,201,60,.6)}}
#win-title{font-size:40px; color:var(--coral); -webkit-text-stroke:2.5px var(--ink); paint-order:stroke fill}
.sheet.open #win-title{animation:stamp .6s var(--pop) .1s both}
@keyframes stamp{from{transform:translateY(-22px); opacity:0}}

/* three buttons that take the list of levels straight to a chapter; they stay at the top as it scrolls */
.jump{position:sticky; top:0; z-index:3; display:grid; grid-template-columns:repeat(4, 1fr); gap:6px; margin:12px -6px 0; padding:8px 6px; background:var(--card)}
.jump button{flex:1; min-width:0; padding:6px 4px 7px; font-weight:600; font-size:13.5px; line-height:1.15; color:var(--text); background:var(--wash);
  border:var(--bw) solid var(--ink); border-radius:13px; transition:transform .12s var(--pop)}
.jump button:hover{transform:translateY(-2px)} .jump button:active{transform:translateY(1px)}
.jump button.on{background:var(--sun); color:#2B2140}
.jump small{display:block; font-size:11.5px; font-weight:500; opacity:.75}
.grid{display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-top:6px}
.lv{position:relative; aspect-ratio:1; padding:4px 0 0; background:var(--card); border:var(--bw) solid var(--ink); border-radius:16px;
  font-weight:700; font-size:17px; transition:transform .12s var(--pop);
  animation:popgrid .4s var(--pop) both; animation-delay:calc(var(--n) * 35ms)}
.sheet:not(.open) .lv{animation:none}
@keyframes popgrid{from{transform:translateY(12px); opacity:0}}
.more{grid-column:1 / -1; margin-top:4px; font-size:14.5px; font-weight:600; color:var(--mut)}
.lv:hover{transform:translateY(-3px)}
.lv:active{transform:translateY(1px)}
.lv svg{display:block; width:56%; height:46%; margin:0 auto 1px; overflow:visible}
.lv svg polygon{fill:var(--wash); stroke:var(--ink); stroke-width:2.5px; stroke-linejoin:round; vector-effect:non-scaling-stroke}
.lv svg polygon.hid{fill:none; stroke-dasharray:3px 4px}   /* the box nobody can see */
.lv.done{background:var(--mint); color:#2B2140}
.lv.done svg polygon{fill:#fff}
.lv.here{outline:3px solid var(--coral); outline-offset:2px}
.lv.locked{color:var(--mut); border-color:var(--mut); cursor:default; transform:none}
.lv.locked svg{opacity:.35} .lv.locked .tick{background:var(--card); border-color:var(--mut); font-size:11px}
.lv .tick{position:absolute; right:-7px; top:-8px; width:22px; height:22px; display:grid; place-items:center; font-size:13px; color:#2B2140;
  background:var(--sun); border:2px solid var(--ink); border-radius:50%}
/* first, second or third on that level: the leaderboard's medal in place of the tick */
.lv .tick.medal{right:-11px; top:-17px; width:31px; height:33px; background:none; border:0; border-radius:0}
.lv .tick.medal svg{display:block; width:100%; height:100%; overflow:visible; filter:drop-shadow(0 1px 0 rgba(0,0,0,.25))}
.lv .medal .tail{fill:#FF6B6B; stroke:#2B2140; stroke-width:1.3; stroke-linejoin:round}
.lv .medal .disc{stroke:#2B2140; stroke-width:1.6} .lv .medal .ring{fill:none; stroke-width:1.1}
.lv .medal text{font:700 10px var(--f); text-anchor:middle}

#finale{position:fixed; inset:0; z-index:25; display:grid; place-items:center; align-content:center; gap:2px; pointer-events:none; text-align:center;
  opacity:0; visibility:hidden; transition:opacity .45s, visibility .45s;
  background:radial-gradient(closest-side, var(--bg) 35%, transparent)}
#finale.show{opacity:1; visibility:visible}
#finale small{font-size:clamp(15px,4.4vw,22px); font-weight:600; color:var(--mut); letter-spacing:.14em; text-transform:uppercase}
#finale .big{font-size:clamp(46px,15vw,124px); font-weight:700; line-height:1.05; white-space:nowrap}
#finale .big b{display:inline-block; -webkit-text-stroke:clamp(2.5px,.6vw,5px) var(--ink); paint-order:stroke fill}
#finale.show .big b{animation:hop .7s var(--pop) both, wave .7s var(--pop) 1.5s 3; animation-delay:calc(var(--n) * 60ms + 100ms), calc(var(--n) * 60ms + 1.5s)}
#finale .big b:nth-child(7n+1){color:var(--coral)} #finale .big b:nth-child(7n+2){color:var(--tang)} #finale .big b:nth-child(7n+3){color:var(--sun)}
#finale .big b:nth-child(7n+4){color:var(--mint)} #finale .big b:nth-child(7n+5){color:var(--sky)} #finale .big b:nth-child(7n+6){color:var(--grape)} #finale .big b:nth-child(7n){color:var(--pink)}
#finale p{margin:4px 0 0; font-size:clamp(17px,5vw,26px); font-weight:600; color:var(--text)}
/* The end of the whole game: the cast runs in from every side, gathers round the game's name, and bounces.
   (Lengths inside the drawing are in its own units, a square to one: a px there is one of those.) */
#grand{position:fixed; inset:0; z-index:25; display:grid; place-items:center; overflow:hidden; pointer-events:none; text-align:center; --ink:#2B2140; --face:#2B2140; color:#2B2140;
  opacity:0; visibility:hidden; transition:opacity .45s, visibility .45s;
  background:#FFF4DE radial-gradient(rgba(43,33,64,.09) 1.6px, transparent 1.7px) 0 0 / 26px 26px}
#grand.show{opacity:1; visibility:visible}
#grand-crowd{position:absolute; left:0; top:0; width:100%; height:100%; overflow:visible}
#grand .in,#grand .hop{transform-box:fill-box; transform-origin:center}
#grand.show .in{animation:grand-in .9s cubic-bezier(.2,1.25,.4,1) both; animation-delay:calc(var(--n) * 70ms + 150ms)}
@keyframes grand-in{from{transform:translate(calc(var(--fx) * 1px), calc(var(--fy) * 1px)) rotate(var(--spin)) scale(.7)}}
#grand.show .hop{animation:grand-hop .52s cubic-bezier(.3,0,.7,1) infinite alternate; animation-delay:calc(var(--n) * -137ms + 1.6s)}
@keyframes grand-hop{from{transform:translateY(.05px) scale(1.07,.93)} 35%{transform:translateY(0) scale(1,1)} to{transform:translateY(-.42px) scale(.96,1.05) rotate(var(--lean))}}
.grand-mid{position:relative; padding:0 12px}
.grand-name{display:flex; align-items:center; justify-content:center; gap:calc(var(--s) * .26)}
.grand-name svg{width:calc(var(--s) * 1.25); height:calc(var(--s) * 1.25); flex:none}
#grand.show .grand-name svg{animation:hop .7s var(--pop) .2s both, bob 1.4s ease-in-out 1s infinite}
.grand-name .word{display:flex !important; font-size:var(--s); letter-spacing:1px; --bw:calc(var(--s) * .085)}
#grand.show .grand-name .word b{animation:hop .7s var(--pop) both, wave .8s ease-in-out infinite; animation-delay:calc(var(--n) * 70ms + 300ms), calc(var(--n) * 90ms + 1.4s)}
.grand-say{margin:calc(var(--s) * .16) 0 0; font-size:calc(var(--s) * .42); font-weight:700; line-height:1.15}
.grand-sum{margin:calc(var(--s) * .08) 0 0; font-size:calc(var(--s) * .27); font-weight:600; color:#7A6F90}
#grand.show .grand-say,#grand.show .grand-sum{animation:hop .6s var(--pop) 1s both}
@media (prefers-reduced-motion:reduce){ #grand .in,#grand .hop{animation:none !important} }
.dev[hidden]{display:none}
.dev{position:fixed; left:8px; bottom:72px; z-index:40; display:flex; gap:6px}
.dev button{padding:5px 10px 6px; font:600 13px var(--f); color:#FFF4DE; background:#2B2140; border:0; border-radius:9px; cursor:pointer; opacity:.8}
.dev button:hover{opacity:1}
#fx{position:fixed; inset:0; width:100%; height:100%; z-index:30; pointer-events:none}

@media (max-width:560px){
  .word{font-size:25px} .logo svg{width:32px; height:32px}
  .tools{gap:6px} .ib{width:38px; height:38px; border-radius:12px} .ib svg{width:19px; height:19px}
  .hud{display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:5px 9px; margin-top:10px; min-height:0}
  .title{display:contents} .title h1{font-size:18px}
  .title p{grid-column:1 / -1; grid-row:2; font-size:13.5px; margin:0; min-height:2.5em}
  .chip{padding:6px 10px 7px; font-size:13.5px} .chip b{font-size:15px}
  #pips{max-width:86px} #pips i{width:10px; height:10px; border-radius:3px} #pips i.t{width:12px} #pips i.d{width:18px} #pips i.h{border-radius:50%}
  #pips i.t::after{inset:3.5px 3px 2px}
  .dock{gap:6px} .spin{gap:5px} .dock .rb{min-width:44px; padding:0 5px; font-size:14.5px} .angle{padding:0 9px 0 4px} .angle input{width:44px}
  .dock .tip{font-size:14px}
  .grid{gap:8px} .lv{border-radius:13px; font-size:15px}
  .card{padding:20px 16px 18px} .jump{gap:4px; grid-template-columns:repeat(4, 1fr)} .jump button{font-size:12px; padding:5px 2px 6px} .jump small{font-size:10.5px}   /* seven chapters on a phone: four, then three */
}
/* six buttons and the name do not fit side by side on a phone: the name gives way, the face stays */
@media (max-width:460px){ .word{display:none} }
@media (max-width:400px){ .tools{gap:5px} .ib{width:35px; height:35px} }
@media (max-height:520px){ .hud{min-height:0} .title p{display:none} .dock{height:50px} }
/* a phone on its side: one slim bar on top, the spin buttons stacked down the right */
@media (max-height:480px) and (orientation:landscape){
  #app{display:grid; grid-template-columns:auto 1fr auto; grid-template-rows:auto 1fr; gap:4px 12px}
  .top{display:contents}
  .logo{grid-area:1 / 1} .word{display:none}
  .hud{grid-area:1 / 2; display:flex; align-items:center; margin:0; gap:10px} .title{display:block} .title h1{font-size:18px}
  .tools{grid-area:1 / 3; gap:6px} .ib{width:38px; height:38px; border-radius:12px}
  #pips{max-width:none; flex-wrap:nowrap; gap:3px} #pips i{width:9px; height:9px; border-width:1.5px; border-radius:3px} #pips i.t{width:11px}
  #pips i.t::after{inset:3px 2.5px 1.5px}
  #stats{margin-top:2px; font-size:12.5px}
  #stage{grid-area:2 / 1 / 3 / 3; margin:0}
  /* no room for a strip here: the card lies over the top of the board, and the empty strip says nothing */
  body.powers #power-row,body.guests #power-row,body.once #power-row{grid-area:2 / 1 / 3 / 3; align-self:start; z-index:4; margin:0; height:auto; pointer-events:none} #power-idle{display:none}
  body.once #power-idle{display:block; font-size:12.5px}
  .dock{grid-area:2 / 3; flex-direction:column; height:auto; gap:8px; align-self:center} .spin{flex:none; flex-direction:column; gap:5px}
  .dock .rb{height:36px; min-width:74px; border-radius:12px} .angle{height:38px; width:74px; padding:0 8px 0 2px; font-size:18px; border-radius:12px}
  .angle input{width:44px}
  .dock .tip{font-size:13.5px; text-align:center; padding:0 6px}
  .sheet{padding:10px} .card{width:min(560px,100%); padding:14px 18px 14px; border-radius:20px}
  .card h2{font-size:24px} #win-title{font-size:30px} .card p{margin:5px 0; font-size:15px}
  .stats{margin:8px 0 0} .stats div{padding:4px 10px 5px} .stats b{font-size:18px}
  .card .fact{margin-top:8px; padding:8px 12px; font-size:13.5px}
  .btn{margin-top:9px; padding:8px 18px 9px; font-size:16px} .btn.plain{padding:7px 14px 8px; font-size:15px}
  .how{margin:6px 0 0} .how li{padding:3px 0; font-size:14.5px} .how li > span{width:30px; height:30px; border-radius:9px}
  .grid{grid-template-columns:repeat(9,1fr); gap:7px; margin-top:8px} #help-h{font-size:22px} #m-help .btn.go{margin-top:10px; padding:9px 28px 10px; font-size:18px}
}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none !important; transition:none !important}
}

/* The fifth chapter's things on the board (in game.js, under inventions). A box with walls of its own has them drawn one
   by one, with the door or the open side left out; a box nobody can see shows only round each shape; a copy cannot be picked up, and one hidden under its shape is not seen; a nailed shape
   has the nail's head on it; a guest whose wish is not kept looks pained; and a box that must balance has its beam, pivot and weight. */
#bin.walled .bin-fill{stroke:none}
/* solid walls (their hatching and stripes are patterns game.js draws, and fills them with): hatched slabs, from the real wall outwards; a door's posts striped; the bay before it, with its arrows in */
.rims{pointer-events:none}
.rims .h{stroke:var(--rim); stroke-width:.018; opacity:.75}
.rims .slab{stroke:var(--rim); stroke-width:calc(2.5px * var(--u)); stroke-linejoin:round}
.rims .slab.bump{animation:bump .35s ease-out}
@keyframes bump{from{fill:#FF6B6B; stroke:#FF6B6B}}
.rims .hz-a{fill:#FFC93C} .rims .hz-b{fill:#0B1E36}
.rims .post{stroke:var(--rim); stroke-width:calc(2.5px * var(--u))}
.rims .bay{fill:rgba(255,201,60,.08); stroke:#FFC93C; stroke-width:calc(2px * var(--u)); stroke-dasharray:.08 .06}
.rims .chev{fill:none; stroke:#FFC93C; stroke-width:calc(4px * var(--u)); stroke-linecap:round; stroke-linejoin:round; animation:chev 1.1s ease-in-out infinite}
@keyframes chev{0%,100%{opacity:.25} 40%{opacity:1}}
/* Blind Box: the box is drawn only just round each shape (a mask: game.js, under inventions), and whole on a win */
.fog{pointer-events:none} .fog .sees path{stroke:#fff; stroke-width:calc(20px * var(--u)); stroke-linejoin:miter; stroke-miterlimit:8}   /* (half of it outside the shape: a rim of 10 pixels) */
.piece.echo{pointer-events:none}
.piece.echo .pop{opacity:.84}
.piece.away{visibility:hidden}
/* One Shot: the nail every shape carries. Over the box in hand, it hangs above the shape and bobs, ready; let go of, it is
   hammered in with a ring of dust and the shape gives under it, and only the head shows after. A nailed shape loses its shine. */
.stake{pointer-events:none}
.stake .drop{opacity:0; transform:translateY(-.42px); transition:opacity .15s, transform .15s}
.stake .nail{fill:#D5DAE3; stroke:#2B2140; stroke-width:calc(2.5px * var(--u))}
.stake .shank{fill:#9AA3B2; stroke:#2B2140; stroke-width:calc(2px * var(--u)); stroke-linejoin:round}
.stake .shine{fill:#fff; opacity:.8}
.stake .thud{fill:none; stroke:var(--ink); stroke-width:calc(3px * var(--u)); opacity:0; transform-box:fill-box; transform-origin:center}
.piece.aim .stake .drop{opacity:.95; animation:poise .7s ease-in-out infinite alternate}
@keyframes poise{from{transform:translateY(-.42px)} to{transform:translateY(-.32px)}}
.piece.nailed .stake .drop{opacity:1; transform:none}
.piece.nailed .stake .shank{visibility:hidden}
.piece.struck .stake .drop{animation:drive .16s cubic-bezier(.5,0,1,.6) both}
.piece.struck .stake .shank{visibility:visible; animation:sink .16s step-end both}
.piece.struck .stake .thud{animation:thud .45s .13s ease-out both}
.piece.struck .body{animation:give .4s .13s ease-out}   /* (about the shape's middle, where it turns: no transform-origin)*/
@keyframes drive{from{transform:translateY(-.42px)} to{transform:none}}
@keyframes sink{to{visibility:hidden}}
@keyframes thud{from{opacity:.9; transform:scale(.6)} to{opacity:0; transform:scale(3.2)}}
@keyframes give{30%{scale:.93}}
.piece.nailed .body{filter:saturate(.7) brightness(.93)}
#power-idle .shot{display:inline-block; width:7px; height:16px; margin:0 0 -3px 5px; background:var(--rim); border-radius:4px 4px 1px 1px; clip-path:polygon(0 0,100% 0,100% 30%,70% 30%,70% 85%,50% 100%,30% 85%,30% 30%,0 30%)}
#power-idle .shot.used{opacity:.25}
/* Sam's party: bunting on two posts over the box, and between guests who meet a beating heart, a word, or a fit of temper (game.js: decorate, token) */
.party,.toasts{pointer-events:none}
.party .post{stroke:var(--rim); stroke-width:calc(3px * var(--u)); stroke-linecap:round}
.party .cap{fill:#FFC93C; stroke:#2B2140; stroke-width:calc(2px * var(--u))}
.party .string{fill:none; stroke:var(--rim); stroke-width:calc(1.5px * var(--u))}
.party .hang{transform-box:fill-box; transform-origin:50% 0; animation:sway 2.6s ease-in-out infinite alternate}
@keyframes sway{from{transform:rotate(-6deg)} to{transform:rotate(6deg)}}
.party .flag{stroke:#2B2140; stroke-width:calc(1.5px * var(--u)); stroke-linejoin:round}
.party .f0{fill:#FF6B6B} .party .f1{fill:#FFC93C} .party .f2{fill:#3DDBB4} .party .f3{fill:#4DA8FF}
.party .letter{font-family:var(--f); font-weight:800; font-size:.15px; fill:#fff}
.toasts .big,.toasts .mini{fill:#FF5C8A; stroke:#2B2140; stroke-width:calc(2px * var(--u)); stroke-linejoin:round}
.toasts .shine{fill:#fff; opacity:.75}
.toasts .beat{transform-box:fill-box; transform-origin:50% 50%; animation:pop-in .5s cubic-bezier(.3,1.7,.5,1) both, beat 1.1s .5s ease-in-out infinite}
@keyframes pop-in{from{transform:scale(0)}}
@keyframes beat{0%,40%,100%{transform:scale(1)} 15%{transform:scale(1.18)} 28%{transform:scale(1.05)}}
.toasts .burst{transform-box:fill-box; transform-origin:50% 50%; animation:burst .6s ease-out both}
.toasts .spark{stroke:#FFC93C; stroke-width:calc(3px * var(--u)); stroke-linecap:round}
@keyframes burst{from{transform:scale(.5); opacity:1} to{transform:scale(1.35); opacity:0}}
.toasts .rise{opacity:0; animation:rise 1.8s ease-out infinite}
@keyframes rise{0%{opacity:0; transform:translateY(0)} 15%{opacity:1} 100%{opacity:0; transform:translateY(-.55px)}}
.toasts .cloud{fill:#fff; stroke:#2B2140; stroke-width:calc(2px * var(--u)); stroke-linejoin:round}
.toasts .bubble{transform-box:fill-box; transform-origin:30% 100%; animation:pop-in .4s cubic-bezier(.3,1.7,.5,1) both}
.toasts .dot{fill:#2B2140; animation:chatter 1s ease-in-out infinite}
@keyframes chatter{0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-.04px)}}
.toasts .vein path{fill:none; stroke-linecap:round}
.toasts .vein .under{stroke:#fff; stroke-width:calc(7px * var(--u))} .toasts .vein .over{stroke:#E8304A; stroke-width:calc(3.5px * var(--u))}
.toasts .vein{transform-box:fill-box; transform-origin:50% 50%; animation:pop-in .35s cubic-bezier(.3,1.7,.5,1) both, throb .7s .35s ease-in-out infinite alternate}
@keyframes throb{to{transform:scale(1.15)}}
.piece.fuming .body{filter:saturate(1.5) hue-rotate(-14deg)}
.piece.fuming .face{animation:fume .12s linear infinite alternate}
@keyframes fume{from{transform:translateX(-.012px)} to{transform:translateX(.012px)}}
.piece.loved .blush{fill-opacity:.7; transition:fill-opacity .4s}
.piece.loved .face .heart{transform-box:fill-box; transform-origin:50% 50%; animation:beat 1.1s ease-in-out infinite}
.wine{opacity:0; transition:opacity .25s}
.piece.happy .wine{opacity:1}
.wine .bowl{fill:#fff; fill-opacity:.55}
.wine .rim{fill:none; stroke:#2B2140; stroke-width:calc(1.5px * var(--u)); stroke-linejoin:round}
.wine .red{fill:#B3123E}
.wine .stem{fill:none; stroke:#2B2140; stroke-width:calc(1.5px * var(--u)); stroke-linecap:round}
.wine .glint{fill:none; stroke:#fff; stroke-width:calc(1.5px * var(--u)); stroke-linecap:round; opacity:.8}
.wine .hand{fill:var(--c); stroke:#2B2140; stroke-width:calc(1.5px * var(--u))}
.wine .sip,.wine .level{transform-box:view-box; transform-origin:0 0}   /* (about the glove, and the middle of the bowl) */
.piece.happy .wine .sip{animation:sip 4s ease-in-out infinite}
.piece.happy .wine .level{animation:level 4s ease-in-out infinite}
@keyframes sip{0%,55%,100%{transform:none} 68%,85%{transform:translate(-.17px,-.03px) rotate(-38deg)}}
@keyframes level{0%,55%,100%{transform:none} 68%,85%{transform:rotate(38deg)}}
.toasts .snore path{fill:none; stroke-linecap:round; stroke-linejoin:round}
.toasts .snore .under{stroke:#2B2140; stroke-width:calc(6px * var(--u))} .toasts .snore .over{stroke:#fff; stroke-width:calc(3px * var(--u))}
.toasts .doze{opacity:0; animation:doze 1.8s ease-out infinite}
@keyframes doze{0%{opacity:0; transform:translate(0,.05px)} 25%{opacity:1} 100%{opacity:0; transform:translate(.06px,-.16px)}}
.toasts .ring{fill:none; stroke:#2B2140; stroke-width:calc(2.5px * var(--u)); stroke-linecap:round; opacity:.15; animation:purr .9s ease-in-out infinite}
@keyframes purr{30%{opacity:.9}}
.toasts .star{fill:#FFC93C; stroke:#2B2140; stroke-width:calc(1.5px * var(--u)); stroke-linejoin:round}
.toasts .twinkle{transform-box:fill-box; transform-origin:50% 50%; animation:twinkle 1.6s ease-in-out infinite}
@keyframes twinkle{0%,100%{transform:scale(.55) rotate(0)} 50%{transform:scale(1.1) rotate(45deg)}}
.toasts .speck{fill:#FFF3B0; stroke:#2B2140; stroke-width:calc(1px * var(--u)); animation:speck 1.2s ease-in-out infinite}
@keyframes speck{0%,100%{opacity:0} 50%{opacity:1}}
.piece.happy.v-kid .face{animation:bounce .45s ease-in-out infinite alternate}
.piece.sad.v-kid .face{animation:jitter .09s steps(2) infinite}
@keyframes jitter{0%{transform:translate(-.018px,.01px) rotate(-2deg)} 50%{transform:translate(.018px,-.01px) rotate(2deg)} 100%{transform:translate(-.01px,-.012px)}}
.tophat{opacity:0; transform:translateY(-.16px); transition:opacity .25s, transform .4s cubic-bezier(.3,1.6,.5,1)}
.piece.happy .tophat{opacity:1; transform:none}
.tophat .crown,.tophat .brim{fill:#2B2140}
.tophat .band{fill:#FF6B6B}
.tophat .sheen{fill:none; stroke:#fff; stroke-opacity:.35; stroke-width:calc(2.5px * var(--u)); stroke-linecap:round}
@keyframes bounce{from{transform:translateY(.02px)} to{transform:translateY(-.045px)}}
@media (prefers-reduced-motion:reduce){ .party .hang,.toasts *,.wine .sip,.wine .level,.piece.fuming .face,.piece.loved .face .heart{animation:none !important} .toasts .rise{display:none} }
.piece.sad .eye,.piece.sad .shut{visibility:hidden} .piece.sad .wince{visibility:visible}   /* (and it does not blink through it) */
.face .broken{display:none; fill:#E5263A; stroke:var(--face); stroke-width:calc(1.5px * var(--u)); stroke-linejoin:round}
.piece.sad.v-smitten .face .heart,.piece.sad.v-smitten .wince{display:none}
.piece.sad.v-smitten .face .broken{display:inline; transform-box:fill-box; animation:crack .5s cubic-bezier(.3,1.6,.5,1) both}
.piece.sad.v-smitten .face .hl{transform-origin:100% 100%; --to:translate(-.014px,.008px) rotate(-12deg)}
.piece.sad.v-smitten .face .hr{transform-origin:0 100%; --to:translate(.014px,.008px) rotate(12deg)}
@keyframes crack{from{transform:none} to{transform:var(--to)}}
@media (prefers-reduced-motion:reduce){ .piece.sad.v-smitten .face .broken{animation:none; transform:var(--to)} }
.piece.sad .m-bad{visibility:visible; fill:var(--face)} .piece.sad .m-idle,.piece.sad .w-idle{visibility:hidden}
.scale{pointer-events:none}
.scale .beam{stroke:var(--rim); stroke-width:calc(5px * var(--u)); stroke-linecap:round}
.scale .pivot{fill:var(--rim)}
.scale .bob{fill:var(--sun); stroke:var(--ink); stroke-width:calc(2.5px * var(--u))}
.scale .bob.even,.scale .say.even{fill:var(--mint)}
.scale .say{font-family:var(--f); font-size:0.26px; font-weight:600; fill:var(--text)}

/* Rival: the queues' names, the two shapes up next, and Sam's moods (after .piece.good, which they override) */
.piece.next .fill{stroke:#fff; stroke-width:calc(3px * var(--u)); filter:drop-shadow(0 0 calc(6px * var(--u)) rgba(255,255,255,.75))}
.piece.smug .m-good{visibility:visible} .piece.smug .m-idle,.piece.smug .w-idle{visibility:hidden}
.piece.smug .face{animation:bounce .45s ease-in-out infinite alternate}
.piece.sulk .eye,.piece.sulk .shut{visibility:hidden} .piece.sulk .wince{visibility:visible}
.piece.sulk .m-bad{visibility:visible; fill:var(--face)} .piece.sulk .m-idle,.piece.sulk .w-idle,.piece.sulk .m-good,.piece.sulk .w-good{visibility:hidden}
/* Rival: each side's tray, its name on a pill on the top edge; lit (white rim, the pill in the side's colour) when that
   side is to play or has won. The meter in the corner has nothing to count. */
body.rivals #pips{display:none}
.tray{pointer-events:none}
.tray .panel{fill:rgba(0,0,0,.12); stroke:rgba(255,255,255,.14); stroke-width:calc(1.5px * var(--u)); transition:fill .2s, stroke .2s}
.tray .pill .bg{fill:#2C5E4A; stroke:rgba(255,255,255,.14); stroke-width:calc(1.5px * var(--u))}
.tray text{font-size:calc(13px * var(--u)); font-weight:700; letter-spacing:.03em; fill:var(--mut)}
.tray.go .panel,.tray.won .panel{fill:rgba(255,255,255,.07); stroke:#fff; stroke-width:calc(2.5px * var(--u))}
.tray.you.go .pill .bg,.tray.you.won .pill .bg{fill:var(--mint); stroke:#fff} .tray.you.go text,.tray.you.won text{fill:#14353A}
.tray.sam.go .pill .bg,.tray.sam.won .pill .bg{fill:var(--pink); stroke:#fff} .tray.sam.go text,.tray.sam.won text{fill:#2B2140}
.tray .dots{animation:think 1s ease-in-out infinite alternate}
@keyframes think{from{opacity:.25} to{opacity:1}}
.order{pointer-events:none} .order text{font-size:.21px; font-weight:700; fill:var(--face); opacity:.6}   /* Rival: a shape's place in its queue, quietly */
/* Rival, lost: the box shudders and blushes red, and the sheet has Packman on top, bobbing smugly */
#bin.lost{animation:shudder .5s ease-in-out both} #bin.lost .bin-fill{fill:#5B2B35; transition:fill .4s}
@keyframes shudder{0%,100%{transform:none} 15%{transform:translateX(-.08px)} 35%{transform:translateX(.07px)} 55%{transform:translateX(-.05px)} 75%{transform:translateX(.03px)}}
#bin{transform-box:fill-box}
.lose-face{display:flex; justify-content:center; margin:-4px 0 4px} .lose-face svg{width:64px; height:64px}
.sheet.open .lose-face svg{animation:smug 1.1s ease-in-out .2s infinite alternate}
@keyframes smug{from{transform:rotate(-8deg) translateY(0)} to{transform:rotate(8deg) translateY(-4px)}}
#lose-title{font-size:40px; color:var(--pink); -webkit-text-stroke:2.5px var(--ink); paint-order:stroke fill}
.sheet.open #lose-title{animation:stamp .6s var(--pop) .1s both}
@media (max-width:460px){ #lose-title{font-size:30px} }
@media (prefers-reduced-motion:reduce){ #bin.lost,.sheet.open .lose-face svg{animation:none} }
/* Rival: the shape you play now glows and bobs; shapes still waiting their turn sit back, dimmed */
.piece.go .fill{filter:drop-shadow(0 0 calc(12px * var(--u)) rgba(255,255,255,.95)) drop-shadow(0 0 calc(4px * var(--u)) rgba(255,255,255,.9))}
.piece.go:not(.held) .pop{animation:nudge 1.1s ease-in-out infinite alternate}
@keyframes nudge{from{transform:translateY(0)} to{transform:translateY(-.07px)}}
.piece.wait .body{opacity:.45; transition:opacity .25s}
@media (prefers-reduced-motion:reduce){ .piece.go:not(.held) .pop{animation:none} }
/* Rival: a rock on a square of the box, that nothing can go on */
.rock{fill:#6E7B72; stroke:#3F4A43; stroke-width:calc(2px * var(--u)); filter:drop-shadow(0 calc(2px * var(--u)) 0 rgba(0,0,0,.25))}
/* a level not out yet: under it, the day it opens */
.lv.soon{margin-bottom:14px}
#grid .lv{align-self:start}   /* (none stretched to a row made taller by a date under one: in Safari a square would widen with it) */
.lv .when{position:absolute; left:0; right:0; bottom:-17px; font-size:10.5px; font-weight:600; color:var(--mut); text-align:center}
/* A level not out yet: everything on the board dimmed and still, and over it a banner with the day it opens and how long to go */
#soon{position:absolute; z-index:5; left:50%; top:50%; transform:translate(-50%,-50%); display:flex; align-items:center; gap:12px; padding:12px 22px 13px 16px;
  color:#2B2140; background:var(--sun); border:var(--bw) solid var(--ink); border-radius:18px; box-shadow:0 8px 0 rgba(0,0,0,.18); pointer-events:none; white-space:nowrap; animation:note .35s var(--pop) both}
#soon svg{width:30px; height:30px; flex:none; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round}
#soon b{display:block; font-size:19px; line-height:1.15} #soon small{display:block; font-size:13.5px; font-weight:500; opacity:.75}
body.early #board{opacity:.45; filter:saturate(.6)}
body.early .dock .tip{opacity:0}
