/* Tangram Shapes: a calm light table (Nordic: soft grey, a slate silhouette), bright pieces, big type. */
:root{--bg:#EDF1F3;--bg2:#DFE6EA;--paper:#FFFFFF;--ink:#1B2730;--ink-soft:#4B5B66;--ink-dim:#7A8892;--line:rgba(27,39,48,.14);
  --teal:#14806F;--teal-lo:#0D5E52;--sil:#33424D;--tray:#D5DDE2;color-scheme:light}
body{background:radial-gradient(120% 90% at 50% 0%,#F8FAFB,var(--bg) 55%,var(--bg2));color:var(--ink);font-size:19px}
.screen{background:none}

/* type and buttons */
.title{font:800 clamp(2.1em,7.5vmin,3.6em)/1.02 var(--sans);color:var(--ink);text-shadow:none;letter-spacing:-.015em;text-wrap:balance}
.pill{font:700 1.15em/1 var(--sans);color:#fff;background:var(--teal);box-shadow:0 2px 0 var(--teal-lo),0 8px 18px rgba(20,128,111,.28);
  min-height:52px;padding:.8em 2.6em;transition:transform .08s,filter .15s}
.pill:hover{filter:brightness(1.06)}
.pill:active{transform:translateY(2px);box-shadow:0 0 0 var(--teal-lo),0 4px 10px rgba(20,128,111,.25)}
.link{color:var(--teal);min-height:44px;font-weight:600;font-size:1em}
.jewel{width:48px;height:48px;border:1px solid var(--line);background:var(--paper);box-shadow:0 1px 3px rgba(20,30,40,.12);transition:transform .08s}
.jewel:active{transform:scale(.94)}
.jewel svg{stroke:var(--ink)}
.jewel:disabled{opacity:.38}
.jewel:focus-visible,.pill:focus-visible,.link:focus-visible,.choice:focus-visible,.toggle:focus-visible,.row:focus-visible{outline:3px solid var(--teal);outline-offset:3px}
.board:focus{outline:none}

/* cards */
.veil{background:rgba(27,39,48,.38)}
.card{background:var(--paper);border:1px solid var(--line);box-shadow:0 20px 50px rgba(20,30,40,.25);color:var(--ink)}
.card h2{font:800 1.5em/1.15 var(--sans);color:var(--ink)}
.card .x{border-color:var(--line);color:var(--ink);width:44px;height:44px}
.card .x svg{stroke:var(--ink)}
.card > .row{margin-top:.45em;min-height:48px;color:var(--ink)}
.card > .row small{color:var(--ink-soft)}
.row{background:var(--bg);border-color:var(--line)}
.choice{border-color:var(--line);background:var(--bg);color:var(--ink);min-height:44px;font-weight:700;font-size:1.05em}
.choice:disabled{opacity:.45;cursor:default}
.levels{display:grid;grid-template-columns:repeat(5,1fr);gap:.4em;max-height:min(52vh,22em);overflow-y:auto;padding:.2em}
.levels .choice{padding:.3em 0;min-width:0;display:flex;flex-direction:column;align-items:center;line-height:1.1}
.levels .choice small{font-size:.7em;color:#C98A00;letter-spacing:.05em}
.levels .choice.cur{outline:2px solid var(--teal)}
.toggle{background:#C3CDD4;border-color:var(--line);width:3.2em;height:1.8em}
.toggle::after{background:#fff}
.toggle[aria-pressed=true]{background:var(--teal)}
.toggle[aria-pressed=true]::after{background:#fff;left:1.55em}
.stats{color:var(--ink-soft)}
.stats b{font:800 1.7em/1.1 var(--sans);color:var(--ink)}
.note{color:var(--ink-soft);margin:.3em 0}
.note.big{font-size:1.1em;color:var(--ink);font-weight:700}
.card .rows .note{text-align:left;margin:0}
.toast{background:var(--ink);color:#fff;border:0}
.stars{text-align:center;font-size:2.2em;line-height:1;margin:.1em 0;color:#E8A317;letter-spacing:.08em}
.result-art{display:flex;justify-content:center}
.card .actions .links{display:flex;gap:.4em;justify-content:center}

/* home */
.home{flex-direction:column;gap:1em}
.home-art{display:grid;place-items:center;filter:drop-shadow(0 10px 18px rgba(20,30,40,.18))}
.home-side{display:flex;flex-direction:column;align-items:center;gap:.6em}
.home .title{font-size:clamp(2.2em,9vmin,4em)}
.tagline{color:var(--ink-soft);text-shadow:none;font-size:1.1em}
.links{gap:.2em 1em;flex-wrap:wrap}
.streak{color:var(--ink-soft);margin:0}
@media (orientation:landscape) and (max-height:560px){
  .home{flex-direction:row;gap:2em}
  .home .title{font-size:clamp(1.8em,9vh,3em)}
  .home-side{gap:.35em}
}

/* the game */
#game{display:flex;flex-direction:column}
.bar{padding:max(.5em,env(safe-area-inset-top)) max(.7em,env(safe-area-inset-right)) .3em max(.7em,env(safe-area-inset-left))}
.status{flex:1;min-width:0;text-align:center;display:flex;flex-direction:column;line-height:1.2}
.lvl-name{font-weight:800;font-size:1.1em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.count{color:var(--ink-soft);font-size:.9em;font-variant-numeric:tabular-nums}
.tools{display:flex;gap:.5em}
.felt{flex:1;position:relative;min-height:0;margin:0 max(4px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left))}
.board{position:absolute;inset:0;left:0;top:0;width:100%;height:100%;display:block;touch-action:none;-webkit-user-select:none;user-select:none}
.tray{fill:var(--tray);opacity:.65}
.sil polygon{fill:var(--sil);stroke:var(--sil);stroke-width:1.4;stroke-linejoin:round}
.lines polygon{fill:none;stroke:rgba(255,255,255,.38);stroke-width:1.5;stroke-linejoin:round;stroke-dasharray:5 4;pointer-events:none}
.board.solved .sil polygon{fill:#F2B134;stroke:#F2B134;transition:fill .5s,stroke .5s}
.hint-l polygon{fill:rgba(255,255,255,.16);stroke:#fff;stroke-width:3;stroke-dasharray:8 6;stroke-linejoin:round;animation:march 1s linear infinite;pointer-events:none}
@keyframes march{to{stroke-dashoffset:-28}}
.pc{cursor:grab}
.pc .hit{fill:transparent}
.pc:not(.in-tray) .hit{display:none}
.pc polygon{stroke:rgba(255,255,255,.85);stroke-width:1.5;stroke-linejoin:round;filter:drop-shadow(0 3px 4px rgba(20,30,40,.28))}
.pc.placed{cursor:default}
.pc.placed polygon{filter:none;stroke:rgba(255,255,255,.55)}
.pc.sel polygon,.pc.glow polygon{stroke:#1B2730;stroke-width:3}
.pc.glow polygon{animation:glow 1s ease-in-out infinite alternate}
@keyframes glow{from{stroke:#1B2730}to{stroke:#fff}}
.pc.pop polygon{animation:pop .3s ease-out}
@keyframes pop{40%{transform:scale(1.1)}}
.pc.wob polygon{animation:wob .3s}
@keyframes wob{25%{transform:rotate(-5deg)}75%{transform:rotate(5deg)}}
.fx{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:15}
@media (max-height:480px){.result-art{display:none}.stars{font-size:1.7em}.card .note{margin:.15em 0}}
