/* ================================================================
   Build game levels: cabinet -> table -> chair -> sunset sports car
   ================================================================ */
.m-btn[hidden],.g-goal[hidden],.g-win-line[hidden]{display:none!important}

/* ---------- level picker: app tiles, check when finished ---------- */
.g-levels{display:flex;gap:10px;justify-content:center}
.g-lv{position:relative;width:46px;height:46px;border-radius:30%;display:grid;place-items:center;cursor:pointer;
  background:linear-gradient(155deg,rgba(70,40,110,.9),rgba(18,10,40,.92));
  box-shadow:inset 0 0 0 1px rgba(160,200,255,.28),0 6px 14px rgba(0,0,0,.45);
  transition:transform .28s cubic-bezier(.3,1.8,.5,1),box-shadow .3s,background .3s}
.g-lv::before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,255,255,.22),transparent 55%)}
.g-lv svg{position:relative;width:24px;height:24px;fill:none;stroke:#cfe6ff;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;opacity:.75}
.g-lv:active{transform:scale(.88)}
.g-lv.on{background:linear-gradient(155deg,#ffd6a0,#ff5fa2 52%,#c03cff);transform:translateY(-2px);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.45),0 0 0 2.5px #fff,0 0 22px rgba(255,79,154,.75),0 8px 16px rgba(0,0,0,.45)}
.g-lv.on svg{stroke:#fff;opacity:1;filter:drop-shadow(0 1.5px 1.5px rgba(40,0,50,.45))}
.g-lv-ok{position:absolute;right:-5px;top:-5px;width:18px;height:18px;border-radius:50%;scale:0;
  background:radial-gradient(circle at 35% 30%,#fff,#9ffcf3 40%,#26e3d6);box-shadow:0 0 10px rgba(38,227,214,.9),0 0 0 2px #0b1030;
  transition:scale .4s cubic-bezier(.3,1.8,.5,1)}
.g-lv-ok::after{content:"";position:absolute;left:5px;top:4px;width:7px;height:4px;border-left:2px solid #05303a;border-bottom:2px solid #05303a;transform:rotate(-45deg)}
.g-lv.done .g-lv-ok{scale:1}
@media (hover:hover){.g-lv:not(.on):hover{transform:translateY(-2px)}.g-lv:not(.on):hover svg{opacity:1}}

/* goal line: Doc text; the table level shows its Doc dislike with a no-sign */
.g-goal.swap{animation:goalin .5s cubic-bezier(.3,1.4,.5,1)}
@keyframes goalin{from{opacity:0;translate:0 8px}}
.g-goal.no::before{content:"";display:inline-block;width:.78em;height:.78em;margin-right:.32em;vertical-align:-.06em;border-radius:50%;
  border:.12em solid #ff5a7a;background:linear-gradient(45deg,transparent 43%,#ff5a7a 43% 57%,transparent 57%);
  box-shadow:0 0 10px rgba(255,90,122,.7)}
.g-next{--a:#ffe08a;--b:#ff8a5c;--c:#ff3d7f;--glow:255,130,90}

/* win sweep follows each build's outline */
.game.won .g-board::after{left:var(--bx,60px);top:var(--by,30px);width:var(--bw,220px);height:var(--bh,300px)}

/* ---------- wood furniture ---------- */
.piece.k-top,.piece.k-apron,.piece.k-bar,.piece.k-seat,.piece.k-slat,.piece.k-backrest{background:
    repeating-linear-gradient(0deg,rgba(140,90,40,.12) 0 1px,transparent 1px 4px,rgba(140,90,40,.07) 4px 5px,transparent 5px 8px),
    linear-gradient(#efd8ad,#e3c48c 50%,#efd8ad)}
.piece.k-top{border-radius:3px;box-shadow:0 2px 4px rgba(0,0,0,.35),inset 0 2px 0 rgba(255,255,255,.55),inset 0 -3px 0 #c9a46c}
.piece.k-seat{border-radius:5px;box-shadow:0 2px 4px rgba(0,0,0,.35),inset 0 2px 0 rgba(255,255,255,.55),inset 0 -4px 0 #c49d64}
.piece.k-apron{box-shadow:0 2px 4px rgba(0,0,0,.35),inset 0 -2px 0 #c49d64,inset 0 0 0 6px rgba(160,110,60,.12)}
.piece.k-legb,.piece.k-post{filter:brightness(.86) saturate(.9)}
.piece.k-leg,.piece.k-cleg,.piece.k-legb{border-radius:2px 2px 4px 4px}
.g-slot.k-backrest,.piece.k-backrest{border-radius:46px 46px 6px 6px}
.piece.k-backrest{background:
    linear-gradient(90deg,transparent 18%,rgba(140,90,40,.25) 18% 20%,transparent 20% 39%,rgba(140,90,40,.25) 39% 41%,transparent 41% 59%,rgba(140,90,40,.25) 59% 61%,transparent 61% 80%,rgba(140,90,40,.25) 80% 82%,transparent 82%),
    repeating-linear-gradient(90deg,rgba(140,90,40,.1) 0 1px,transparent 1px 6px),
    linear-gradient(#f2ddb6,#e2c28a)}
.g-slot.k-seat{border-radius:5px}

/* ---------- sunset sports car ---------- */
.th-car .g-tray{
  background:
    repeating-linear-gradient(45deg,rgba(255,255,255,.07) 0 2px,transparent 2px 11px),
    repeating-linear-gradient(-45deg,rgba(0,0,0,.18) 0 2px,transparent 2px 11px),
    linear-gradient(#4a4f5e,#2a2e38);
  box-shadow:inset 0 0 0 3px #5d6474,inset 0 10px 18px rgba(0,0,0,.45),0 14px 30px rgba(0,0,0,.5)}
.th-car .g-tray::before{background:linear-gradient(#ff5fa2,#c0306f);height:8px;top:-6px;transform:none;border-radius:4px 4px 0 0;
  box-shadow:0 0 14px rgba(255,79,154,.6)}
.th-car .piece{border:0}
/* shared shapes: the blueprint outline and the part match */
.g-slot.k-body,.piece.k-body{border-radius:46% 22% 18px 14px / 92% 74% 18px 14px}
.g-slot.k-cabin,.piece.k-cabin{border-radius:78% 42% 0 0 / 100% 100% 0 0}
.g-slot.k-wheel,.piece.k-wheel{border-radius:50%}
.g-slot.k-chassis,.piece.k-chassis{border-radius:9px}
.g-slot.k-spoiler,.piece.k-spoiler{border-radius:3px 9px 2px 2px}

.piece.k-chassis{background:
    radial-gradient(circle,#9aa1b0 0 1.6px,transparent 2.2px) 8px 50%/24px 100% repeat-x,
    linear-gradient(#5a6070,#262a33 60%,#1a1d24);
  box-shadow:0 3px 6px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.25)}
.piece.k-body{background:
    radial-gradient(circle at 70px calc(100% + 10px),#120818 0 37px,#ff9bc8 37px 39px,transparent 39.5px),
    radial-gradient(circle at 242px calc(100% + 10px),#120818 0 37px,#ff9bc8 37px 39px,transparent 39.5px),
    linear-gradient(180deg,rgba(255,255,255,.55) 0,rgba(255,255,255,.12) 18%,transparent 34%,transparent 70%,rgba(60,0,40,.35)),
    linear-gradient(100deg,#ff3d8f 0%,#ff6f7a 42%,#ffa45c 78%,#ffd08a 100%);
  box-shadow:0 6px 12px rgba(0,0,0,.45),inset 0 -3px 0 rgba(90,0,50,.35)}
/* teal pinstripe, headlight, tail light */
.piece.k-body::after{content:"";position:absolute;left:12%;right:6%;top:46%;height:3px;border-radius:2px;pointer-events:none;
  background:linear-gradient(90deg,transparent,#9ffcf3 12%,#26e3d6 80%,transparent);box-shadow:0 0 8px rgba(38,227,214,.8)}
.piece.k-body > i{display:none}
.lv-car .piece.k-body{overflow:visible}
.piece.k-cabin{background:
    linear-gradient(90deg,transparent 47%,#2a1838 47% 53%,transparent 53%),
    linear-gradient(155deg,rgba(255,255,255,.55) 0 12%,transparent 30%),
    linear-gradient(160deg,#c9fbff,#26b8e3 45%,#2a3d9a);
  box-shadow:inset 0 0 0 5px #2a1838,0 2px 6px rgba(0,0,0,.4)}
.piece.k-wheel{background:
    radial-gradient(circle,#f3f5f9 0 5px,#7c8496 6px 7px,transparent 8px),
    radial-gradient(circle,transparent 0 20px,#9aa1b0 20.5px 21.5px,#1c1c24 22px 31px,#0c0c11 31.5px),
    repeating-conic-gradient(#e4e8ef 0 10deg,#565c6c 10deg 36deg);
  box-shadow:0 4px 8px rgba(0,0,0,.55),inset 0 0 0 1px #000}
.piece.k-spoiler{background:linear-gradient(#3a3a48,#14141b);box-shadow:0 3px 6px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.25)}
.piece.k-spoiler::after{content:"";position:absolute;left:10px;top:100%;width:5px;height:9px;background:#1c1c24;box-shadow:32px 0 0 #1c1c24;pointer-events:none}
.th-car .piece.set{animation:carset .6s ease-out}
@keyframes carset{0%{filter:brightness(1.7) saturate(1.3)}100%{filter:none}}

/* wheel nuts instead of wood screws */
.th-car .g-hole{background:radial-gradient(circle,#0b0b10 0 40%,#3b404c 50%,#8c93a3 75%)}
.g-screw.nut .head{border-radius:0;clip-path:polygon(25% 6%,75% 6%,100% 50%,75% 94%,25% 94%,0 50%);
  background:radial-gradient(circle,#30343e 0 22%,#6c7384 24% 30%,transparent 32%),linear-gradient(160deg,#f6f8fb,#b3bac8 50%,#6c7486)}
.g-screw.nut .head::before,.g-screw.nut .head::after{display:none}
.th-car .bag-screws i{border-radius:0;clip-path:polygon(25% 6%,75% 6%,100% 50%,75% 94%,25% 94%,0 50%);
  background:radial-gradient(circle,#30343e 0 22%,transparent 26%),linear-gradient(160deg,#f6f8fb,#b3bac8 50%,#6c7486)}

/* finished car: headlights + underglow */
.game.won .lv-car .piece.k-body{box-shadow:0 6px 12px rgba(0,0,0,.45),0 14px 26px -6px rgba(38,227,214,.9)}
.game.won .lv-car .piece.k-chassis{box-shadow:0 10px 26px 2px rgba(255,79,154,.85)}



@media (prefers-reduced-motion:reduce){.g-goal.swap{animation:none}}

/* ---------- vector-drawn parts (parts.js) replace the flat CSS blocks ---------- */
.piece.drawn{background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;
  filter:drop-shadow(0 2px 1.5px rgba(10,4,20,.5)) drop-shadow(0 6px 8px rgba(10,4,20,.25))}
.piece.drawn::after{display:none!important}
.piece .part{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.piece.drawn.lift{filter:drop-shadow(0 16px 12px rgba(0,0,0,.5)) drop-shadow(0 0 8px rgba(255,79,154,.75))}
.game.won .piece.drawn{box-shadow:none!important;filter:drop-shadow(0 2px 1.5px rgba(10,4,20,.5)) drop-shadow(0 0 10px rgba(255,140,200,.55))}
.g-slot:has(.outline){border:0!important;background:none!important;box-shadow:none!important;border-radius:0!important;animation:none!important}
.g-slot .outline{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.g-slot .outline path{fill:rgba(140,230,255,.05);stroke:rgba(140,230,255,.6);stroke-width:1.3;stroke-dasharray:5 4;transition:fill .25s,stroke .25s}
.g-slot.hint .outline path{stroke:#ff8ac4;fill:rgba(255,79,154,.08);animation:outlinepulse 1s ease-in-out infinite}
.g-slot.near .outline path{fill:rgba(255,79,154,.26);stroke:#ffd6ea;stroke-dasharray:none}
.g-slot.filled .outline{visibility:hidden}
@keyframes outlinepulse{50%{stroke-opacity:.45}}
