/* Zoey Games: calm, pastel, no ads. */
:root {
  --bg1: #fdf0ee; --bg2: #e6ecfb; --bg3: #efe6f8; --blob1: #ffd9e6; --blob2: #cfe3ff; --blob3: #fff0c4;
  --ink: #3f3d56; --ink-fixed: #3f3d56; --muted: #8683a3; --card: rgba(255,255,255,.74); --card-solid: #fff;
  --line: rgba(63,61,86,.10); --accent: #8b97f2; --accent2: #b39cf2; --good: #7fd6a2;
  --shadow: 0 10px 28px rgba(95,85,150,.16); --soft: 0 3px 10px rgba(95,85,150,.12); --cell: rgba(110,104,160,.11);
  --glass: rgba(255,255,255,.55);
  --sky1: #cfe6fb; --sky2: #fdf0ee; --hill1: #c4e6c2; --hill2: #a9dba9; --grass1: #a6dc9c; --grass2: #86c98a; --grass3: #6fb878;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --spring: cubic-bezier(.34,1.56,.64,1);
}
[data-theme="mint"] { --bg1: #e9f7ef; --bg2: #dff0f7; --bg3: #e8f4e4; --blob1: #c9f0dc; --blob2: #cfe9fb; --accent: #5fc4a4; --accent2: #7cbcec; --sky1: #c8ecf2; --sky2: #eefaf2; }
[data-theme="lilac"] { --bg1: #f3eafb; --bg2: #e3e8fb; --bg3: #f6e6f4; --blob1: #ecd3f7; --blob2: #d3d9fb; --accent: #a38af0; --accent2: #e39ae0; --sky1: #dcd3f7; --sky2: #f8ecf8; }
[data-theme="meadow"] { --bg1: #f6f7de; --bg2: #dff1dc; --bg3: #eef5d2; --blob1: #d4efc4; --blob2: #fbeeb4; --blob3: #c9ecd9; --accent: #6fbf7c; --accent2: #b6cf5c; --sky1: #cdeaf4; --sky2: #f6f7de; }
[data-theme="sunset"] { --bg1: #ffe9d6; --bg2: #f9d6e2; --bg3: #f1dcf5; --blob1: #ffcdb5; --blob2: #f7c3dd; --blob3: #ffe2a8; --accent: #f08a8f; --accent2: #f3a871; --sky1: #f9c3cf; --sky2: #ffe6c7; --hill1: #cfe0b4; --hill2: #b4d3a0; }
[data-theme="night"] {
  --bg1: #2b2c45; --bg2: #353456; --bg3: #2e2f4d; --blob1: #5a4a8a; --blob2: #3c5a9a; --blob3: #4a3f78; --ink: #ecebfa; --muted: #a9a7c9;
  --card: rgba(255,255,255,.09); --card-solid: #3a3a5c; --line: rgba(255,255,255,.12);
  --accent: #8f9bf5; --accent2: #b79ff5; --shadow: 0 10px 28px rgba(0,0,0,.3); --soft: 0 3px 10px rgba(0,0,0,.22);
  --cell: rgba(255,255,255,.08); --glass: rgba(255,255,255,.1);
  --sky1: #232547; --sky2: #4a4478; --hill1: #3f5f6a; --hill2: #36535c; --grass1: #3f6f60; --grass2: #2f5a50; --grass3: #5a9080;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font); color: var(--ink); position: fixed; inset: 0; width: 100%;
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 58%, var(--bg3)) fixed;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}
body::before, body::after {
  content: ""; position: fixed; z-index: 0; border-radius: 50%; pointer-events: none; filter: blur(50px); opacity: .6;
  animation: blob 18s ease-in-out infinite alternate;
}
body::before { width: 280px; height: 280px; left: -90px; top: 10%; background: var(--blob1); }
body::after { width: 320px; height: 320px; right: -120px; bottom: 4%; background: var(--blob2); animation-duration: 23s; animation-direction: alternate-reverse; }
[data-theme="night"] body::before, [data-theme="night"] body::after { opacity: .34; }
@keyframes blob { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 50px) scale(1.15); } }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
svg { display: block; }

#app { position: absolute; inset: 0; z-index: 1; max-width: 540px; margin: 0 auto; }
#modals { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: calc(var(--sat) + 10px) 16px calc(var(--sab) + 12px); animation: screenIn .34s cubic-bezier(.2,.8,.2,1) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ shared bits */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px 7px 9px; border-radius: 99px;
  background: var(--card); box-shadow: var(--soft); font-weight: 800; font-size: 16px; }
.pill svg { width: 22px; height: 22px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--card); box-shadow: var(--soft);
  display: grid; place-items: center; flex: none; transition: transform .12s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 26px;
  border-radius: 99px; background: var(--card-solid); font-weight: 800; font-size: 17px; box-shadow: 0 4px 14px rgba(95,85,150,.14); transition: transform .12s; }
.btn:active { transform: scale(.96); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.1), 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.quiet { background: transparent; box-shadow: none; color: var(--muted); font-weight: 700; min-height: 42px; padding: 0 14px; }
.btn.small { min-height: 40px; font-size: 15px; padding: 0 16px; }
.btn.small.quiet { min-height: 34px; font-size: 14px; }
.btn.big { min-height: 58px; font-size: 19px; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.hint-line { text-align: center; color: var(--muted); font-weight: 700; font-size: 14px; line-height: 1.35; margin: 8px 6px 4px; }
.hint-line b { color: var(--ink); }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 6px; flex: none; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 15px; border-radius: 99px; background: var(--card); font-weight: 800; font-size: 14px; color: var(--muted); box-shadow: var(--soft); transition: background .2s, color .2s; }
.tab.on { background: var(--ink); color: var(--card-solid); }

/* ------------------------------------------------------------------- Zoey */
.zoey { display: block; }
.zoey-svg { width: 100%; height: 100%; overflow: visible; }
/* breathing: the body swells a touch and the head rides on it */
.zoey .z-body { transform-origin: 100px 212px; animation: zbreath 3.8s ease-in-out infinite; }
@keyframes zbreath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.022); } }
.zoey .z-bob { animation: zbob 3.8s ease-in-out infinite; }
@keyframes zbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.zoey .z-tail { transform-origin: 152px 204px; animation: ztail 3.1s ease-in-out infinite; }
@keyframes ztail { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(7deg); } }
.zoey .z-wag { transform-origin: 152px 204px; }
.zoey.happy .z-wag { animation: zwag .3s ease-in-out infinite alternate; }
@keyframes zwag { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
/* eyes: follow the finger (set from JS), blink now and then */
.zoey .z-look { transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.zoey .z-eyes { transform-origin: 100px 92px; animation: zblink 6.4s infinite; }
@keyframes zblink {
  0%, 43.5%, 50%, 89.5%, 96%, 100% { transform: scaleY(1); animation-timing-function: ease-in; }
  46.5%, 92.5%, 98% { transform: scaleY(.06); animation-timing-function: ease-out; }
}
/* ears */
.zoey .z-ear.l { transform-origin: 70px 72px; animation: earL 7s cubic-bezier(.4,0,.2,1) infinite; }
.zoey .z-ear.r { transform-origin: 130px 72px; animation: earR 8.6s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes earL { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-9deg); } 92.5% { transform: rotate(3.5deg); } 96% { transform: rotate(-1.5deg); } }
@keyframes earR { 0%, 68%, 100% { transform: rotate(0); } 71% { transform: rotate(10deg); } 74.5% { transform: rotate(-3.5deg); } 78% { transform: rotate(1.5deg); } }
.zoey.wiggle .z-ear.l { animation: wiggleL .8s cubic-bezier(.36,.07,.19,.97); }
.zoey.wiggle .z-ear.r { animation: wiggleR .8s cubic-bezier(.36,.07,.19,.97); }
@keyframes wiggleL { 18% { transform: rotate(-17deg); } 40% { transform: rotate(8deg); } 62% { transform: rotate(-5deg); } 82% { transform: rotate(2deg); } }
@keyframes wiggleR { 18% { transform: rotate(17deg); } 40% { transform: rotate(-8deg); } 62% { transform: rotate(5deg); } 82% { transform: rotate(-2deg); } }
/* head */
.zoey .z-head { transform-origin: 100px 150px; transition: transform .55s var(--spring); }
.zoey.curious .z-head { transform: rotate(-9deg); }
.zoey.sway .z-head { animation: zsway 5s ease-in-out infinite; }
@keyframes zsway { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(2.6deg); } 75% { transform: rotate(-2.6deg); } }
.zoey.tilt .z-head { animation: ztilt 1.9s cubic-bezier(.45,0,.3,1); }
@keyframes ztilt { 0%, 100% { transform: rotate(0); } 22%, 72% { transform: rotate(-11deg); } }
/* mouth: opens with a little spring instead of popping */
.zoey .z-open, .zoey .z-tongue { transform-origin: 100px 146px; transform: scale(.7, 0); opacity: 0; transition: transform .26s var(--spring), opacity .12s; }
.zoey.happy .z-open, .zoey.happy .z-tongue { transform: scale(1, 1); opacity: 1; }
.zoey.happy .z-tongue { animation: zpant .34s ease-in-out .26s infinite alternate; }
@keyframes zpant { from { transform: scale(1, 1); } to { transform: scale(1.04, 1.16); } }
.zoey .z-mouth { transition: opacity .16s; }
.zoey.happy .z-mouth { opacity: 0; }
/* whole dog */
.zoey.bounce { animation: zbounce .7s cubic-bezier(.3,.7,.3,1); transform-origin: 50% 100%; }
@keyframes zbounce {
  0% { transform: none; } 16% { transform: scale(1.07, .91); } 42% { transform: translateY(-15px) scale(.96, 1.06); }
  66% { transform: translateY(0) scale(1.05, .95); } 82% { transform: translateY(-4px) scale(.99, 1.01); } 100% { transform: none; }
}
.zoey.bounce .z-ear.l { animation: flopL .7s ease-out; } .zoey.bounce .z-ear.r { animation: flopR .7s ease-out; }
@keyframes flopL { 20% { transform: rotate(6deg); } 45% { transform: rotate(-14deg); } 70% { transform: rotate(5deg); } }
@keyframes flopR { 20% { transform: rotate(-6deg); } 45% { transform: rotate(14deg); } 70% { transform: rotate(-5deg); } }

/* -------------------------------------------------------------------- hub */
.hub-top { display: flex; align-items: center; justify-content: space-between; }
.hub-hero { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 0 0 10px; position: relative; padding-top: 6px; }
.hub-zoey { width: min(30vw, 118px); aspect-ratio: 200/212; cursor: pointer; filter: drop-shadow(0 8px 12px rgba(80,70,130,.2)); flex: none; }
.hub-head { padding-bottom: 12px; }
.bubble { position: absolute; top: 0; left: calc(50% - 16px); background: var(--card-solid); border-radius: 18px 18px 18px 4px;
  padding: 8px 13px; font-weight: 700; font-size: 14px; max-width: 170px; box-shadow: var(--shadow); animation: pop .4s var(--spring) both; transition: opacity .3s, transform .3s; }
.bubble.gone { opacity: 0; transform: scale(.8) translateY(6px); }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
.hub-title { font-size: 28px; font-weight: 900; letter-spacing: -.015em; margin: 0; line-height: 1.05;
  background: linear-gradient(120deg, var(--ink) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hub-sub { color: var(--muted); font-weight: 700; font-size: 14px; margin: 3px 0 0; }
.cards { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(138px, 1fr); gap: 12px; flex: 1; min-height: 0; overflow: auto;
  padding: 4px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
.cards.one { grid-template-columns: 1fr; grid-auto-rows: 104px; flex: none; }
.gcard { position: relative; border-radius: 24px; text-align: left; background: var(--card-solid); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; transition: transform .15s; animation: cardIn .45s var(--spring) both; max-height: 210px; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.94); } }
.gcard:active { transform: scale(.96); }
.gcard .art { position: relative; flex: 1; min-height: 76px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(140deg, color-mix(in srgb, var(--gc) 70%, #fff), var(--gc)); }
.gcard .art i { position: absolute; border-radius: 50%; background: rgba(255,255,255,.24); }
.gcard .art i:nth-child(1) { width: 96px; height: 96px; right: -26px; top: -34px; }
.gcard .art i:nth-child(2) { width: 58px; height: 58px; left: -16px; bottom: -22px; background: rgba(255,255,255,.18); }
.gcard .gi { position: relative; display: grid; place-items: center; filter: drop-shadow(0 4px 5px rgba(0,0,0,.14)); transition: transform .3s var(--spring); }
.gcard:active .gi { transform: scale(1.12) rotate(-6deg); }
.gcard .gi svg { width: 54px; height: 54px; }
.gcard .art em { position: absolute; left: 8px; top: 8px; font-style: normal; font-size: 10.5px; font-weight: 900; background: rgba(255,255,255,.94); color: var(--ink-fixed);
  padding: 3px 8px; border-radius: 99px; }
.gcard .txt { display: flex; flex-direction: column; gap: 2px; padding: 9px 13px 11px; }
.gcard b { font-size: 17px; font-weight: 900; line-height: 1.1; }
.gcard small { color: var(--muted); font-weight: 800; font-size: 12.5px; }
.gcard.wide, .cards:not(.one) .gcard:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.gcard.wide .art, .cards:not(.one) .gcard:last-child:nth-child(odd) .art { flex: none; width: 112px; }
.gcard.wide .txt, .cards:not(.one) .gcard:last-child:nth-child(odd) .txt { justify-content: center; }
.hub-bottom { display: flex; gap: 8px; justify-content: center; padding-top: 8px; }
.dock-btn { flex: 1; min-height: 58px; border-radius: 20px; background: var(--card); font-weight: 800; font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; box-shadow: var(--soft); position: relative; transition: transform .12s; }
.dock-btn svg { width: 24px; height: 24px; color: var(--ink); }
.dock-btn:active { transform: scale(.94); }
.dock-btn .dot { position: absolute; top: 8px; right: calc(50% - 22px); width: 11px; height: 11px; border-radius: 50%; background: #ff8fa3; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { transform: scale(1.35); opacity: .7; } }

/* ----------------------------------------------------------------- splash */
.sp-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 2px 8px; scrollbar-width: none; }
.sp-body::-webkit-scrollbar { display: none; }
.sp-hero { position: relative; width: 150px; height: 138px; flex: none; display: grid; place-items: center; }
.sp-hero i { position: absolute; border-radius: 50%; background: var(--g); }
.sp-hero i:nth-child(1) { inset: 4px 10px; opacity: .26; animation: breathe 4.2s ease-in-out infinite; }
.sp-hero i:nth-child(2) { width: 30px; height: 30px; right: 0; top: 12px; opacity: .55; animation: floaty 5s ease-in-out infinite; }
.sp-hero i:nth-child(3) { width: 18px; height: 18px; left: 6px; bottom: 16px; opacity: .65; animation: floaty 6s -2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); } }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.sp-icon { position: relative; width: 100px; height: 100px; border-radius: 32px; display: grid; place-items: center;
  background: linear-gradient(140deg, color-mix(in srgb, var(--g) 68%, #fff), var(--g));
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.08), inset 0 4px 0 rgba(255,255,255,.35), 0 14px 26px color-mix(in srgb, var(--g) 55%, transparent);
  animation: floaty 4.5s ease-in-out infinite, pop .5s var(--spring) both; }
.sp-icon svg { width: 66px; height: 66px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.14)); }
.splash h1 { font-size: 30px; font-weight: 900; margin: 6px 0 0; letter-spacing: -.015em; }
.sp-tag { color: var(--muted); font-weight: 800; margin: 2px 0 12px; }
.sp-how { width: 100%; background: var(--card); border-radius: 24px; padding: 13px 15px 8px; text-align: left; box-shadow: var(--soft); }
.sp-how h3 { margin: 0 0 5px; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 900; }
.how { display: flex; align-items: center; gap: 13px; padding: 7px 0; font-weight: 700; font-size: 15px; line-height: 1.3; animation: howIn .45s cubic-bezier(.2,.8,.2,1) both; }
.how:nth-of-type(2) { animation-delay: .08s; } .how:nth-of-type(3) { animation-delay: .16s; }
@keyframes howIn { from { opacity: 0; transform: translateX(-10px); } }
.how-ic { position: relative; flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--ink);
  background: color-mix(in srgb, var(--g, var(--accent)) 34%, var(--card-solid)); }
.how-ic svg { width: 24px; height: 24px; }
.how-ic em { position: absolute; left: -5px; top: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--card-solid);
  font-size: 11px; font-weight: 900; font-style: normal; display: grid; place-items: center; }
.sp-tip { display: flex; align-items: flex-end; gap: 6px; width: 100%; margin-top: 10px; }
.sp-z { width: 72px; height: 76px; flex: none; cursor: pointer; }
.sp-say { flex: 1; background: var(--card-solid); border-radius: 18px 18px 18px 4px; padding: 10px 13px; font-weight: 700; font-size: 14px; line-height: 1.3; text-align: left;
  box-shadow: var(--shadow); margin-bottom: 16px; animation: pop .4s .25s var(--spring) both; transform-origin: 0 100%; }
.sp-acts { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.sp-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 4px; }
.splash .btn.primary { background: linear-gradient(135deg, color-mix(in srgb, var(--g) 80%, var(--ink-fixed)), color-mix(in srgb, var(--g) 70%, var(--accent)));
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.1), 0 8px 20px color-mix(in srgb, var(--g) 55%, transparent); text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.howbox { text-align: left; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.howbox summary { font-weight: 800; color: var(--muted); list-style: none; cursor: pointer; text-align: center; }
.howbox summary::-webkit-details-marker { display: none; }
.howbox[open] summary { margin-bottom: 4px; }

/* -------------------------------------------------------------- game shell */
.gbar { display: flex; align-items: center; gap: 10px; flex: none; }
.gbar.top { justify-content: space-between; }
.gtitle { flex: 1; text-align: center; line-height: 1.15; padding: 4px 6px; border-radius: 14px; }
.gtitle small { display: block; color: var(--muted); font-weight: 800; font-size: 12px; }
.gtitle b { font-size: 20px; font-weight: 900; }
.buddy { width: 46px; height: 46px; flex: none; background: var(--card); border-radius: 50%; overflow: hidden; box-shadow: var(--soft); position: relative; }
.buddy .zoey { position: absolute; width: 56px; left: -5px; top: 3px; }
.goal { margin: 10px 2px 6px; background: var(--card); border-radius: 18px; padding: 8px 14px; display: flex; align-items: center; gap: 12px; min-height: 50px; font-weight: 800;
  box-shadow: var(--soft); flex: none; }
.goal .gl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.goal .bar { height: 9px; border-radius: 9px; background: var(--cell); overflow: hidden; }
.goal .bar i { display: block; height: 100%; width: 0; border-radius: 9px; transition: width .45s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(90deg, color-mix(in srgb, var(--g, var(--accent)) 85%, var(--ink-fixed)), var(--g, var(--accent2))); }
.goal .chip { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; }
.goal .hearts { display: flex; gap: 4px; }
.goal .hearts svg { width: 22px; height: 22px; fill: #ff8fa3; transition: transform .25s var(--spring), fill .2s; }
.goal .hearts svg.lost { fill: var(--cell); transform: scale(.82); }
.stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; touch-action: none; }
.stage::before { content: ""; position: absolute; inset: 6% 0; border-radius: 50%; pointer-events: none; opacity: .2; filter: blur(34px);
  background: radial-gradient(closest-side, var(--g, transparent), transparent); }
.stage > * { position: relative; }
.gbar.bottom { justify-content: space-between; padding-top: 8px; gap: 8px; }
.tool { flex: 1; min-height: 58px; border-radius: 20px; background: var(--card); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; font-weight: 800; font-size: 12px; color: var(--muted); box-shadow: var(--soft); transition: transform .12s; }
.tool svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.tool:active { transform: scale(.93); }
.tool.hint { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.1), 0 6px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.tool.hint svg { stroke: #fff; }
.tool[hidden] { display: none; }

/* ------------------------------------------------------------------ modals */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 22px;
  background: rgba(60,50,100,.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: auto; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: min(100%, 380px); max-height: 86%; overflow: auto; background: var(--card-solid); border-radius: 30px; padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(50,40,100,.3); text-align: center; animation: sheetIn .4s var(--spring) both; position: relative; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
.sheet h2 { margin: 0 0 4px; font-size: 24px; font-weight: 900; }
.sheet p { margin: 6px 0 14px; color: var(--muted); font-weight: 700; line-height: 1.35; }
.sheet .acts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sheet .x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; }
.sheet .zoey-big { width: 118px; height: 125px; margin: -4px auto 0; }
.reward { display: inline-flex; align-items: center; gap: 8px; font-size: 30px; font-weight: 900; margin: 4px 0 10px; }
.reward svg { width: 34px; height: 34px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px; font-weight: 800; border-bottom: 1px solid var(--line); text-align: left; }
.row:last-child { border-bottom: 0; }
.row small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 1px; }
.row .btns { display: flex; gap: 6px; flex: none; }
.row .btn.small { padding: 0 13px; font-size: 14px; }
.savebox { background: color-mix(in srgb, var(--good) 24%, transparent); border-radius: 16px; padding: 10px 13px; text-align: left; margin: 10px 0 2px; }
.savebox b { display: block; font-weight: 900; font-size: 15px; }
.savebox small { display: block; color: var(--muted); font-weight: 700; font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.switch { width: 52px; height: 30px; border-radius: 30px; background: var(--cell); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s var(--spring); }
.switch.on { background: var(--accent); } .switch.on::after { transform: translateX(22px); }
textarea.code { width: 100%; height: 76px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--cell); color: var(--ink);
  font: 12px ui-monospace, Menlo, monospace; padding: 8px; resize: none; -webkit-user-select: text; user-select: text; margin-top: 8px; }
.lvgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; text-align: center; }
.lv { aspect-ratio: 1; border-radius: 14px; background: var(--cell); font-weight: 900; font-size: 16px; display: grid; place-items: center; position: relative; }
.lv.done { background: color-mix(in srgb, var(--good) 40%, transparent); }
.lv.skip { outline: 2px dashed var(--accent); outline-offset: -3px; background: transparent; }
.lv.cur { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.lv.here { box-shadow: 0 0 0 3px var(--card-solid), 0 0 0 5px var(--ink); }

/* ---------------------------------------------------------------- wardrobe */
.wd-stage { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 4px 0 0; flex: none; }
.wardrobe-zoey { width: 150px; height: 159px; position: relative; cursor: pointer; filter: drop-shadow(0 8px 12px rgba(80,70,130,.2)); flex: none; }
.wardrobe-zoey::before { content: ""; position: absolute; left: 4%; right: 4%; bottom: -8px; height: 22px; border-radius: 50%; background: var(--card); z-index: -1; }
.wd-side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 150px; }
.wd-count { font-weight: 800; font-size: 13.5px; color: var(--muted); text-align: center; line-height: 1.3; margin-bottom: 2px; }
.wd-count b { color: var(--ink); font-size: 17px; }
.shop { flex: 1; min-height: 0; overflow: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.shop::-webkit-scrollbar { display: none; }
.shop h3 { margin: 12px 4px 8px; font-size: 14px; color: var(--ink); font-weight: 900; display: flex; justify-content: space-between; align-items: baseline; }
.shop h3 small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.item { background: var(--card-solid); border-radius: 20px; padding: 8px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 4px 12px rgba(95,85,150,.1); font-weight: 800; font-size: 12px; position: relative; transition: transform .15s, box-shadow .2s; line-height: 1.15; }
.item .pv { width: 100%; height: 56px; padding: 4px 8px; }
.item .pv.theme { border-radius: 12px; margin: 4px 6px 0; width: calc(100% - 12px); box-shadow: inset 0 0 0 1px var(--line); }
.item .tag, .swatch .tag, .chipbtn .tag { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; font-weight: 800; }
.tag svg { width: 14px; height: 14px; }
.item.on, .swatch.on, .chipbtn.on { box-shadow: 0 0 0 3px var(--accent), 0 6px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.item.on .tag, .swatch.on .tag, .chipbtn.on .tag { color: var(--accent); }
.item.locked .pv { opacity: .78; }
.item:active, .swatch:active, .chipbtn:active { transform: scale(.95); }

/* ------------------------------------------------------- garden + doghouse */
.hscene { flex: none; width: 100%; aspect-ratio: 400 / 330; max-height: 42vh; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); margin-top: 8px; position: relative; background: var(--sky2); }
.hscene > svg { width: 100%; height: 100%; }
.hscene text { font-family: var(--font); }
.hs-sky1 { stop-color: var(--sky1); } .hs-sky2 { stop-color: var(--sky2); }
.hs-grass1 { stop-color: var(--grass1); } .hs-grass2 { stop-color: var(--grass2); }
.hs-hill1 { fill: var(--hill1); } .hs-hill2 { fill: var(--hill2); }
.hs-tuft { stroke: var(--grass3); stroke-width: 2; stroke-linecap: round; fill: none; }
.hs-night { display: none; } [data-theme="night"] .hs-night { display: block; } [data-theme="night"] .hs-day { display: none; }
.hs-moonbite { fill: var(--sky1); }
.hs-cloud { fill: #fff; opacity: .85; } [data-theme="night"] .hs-cloud { opacity: .14; }
.hs-cloud.a { animation: drift 52s -12s linear infinite; } .hs-cloud.b { animation: drift 74s -40s linear infinite; }
@keyframes drift { from { transform: translateX(-300px); } to { transform: translateX(420px); } }
.gsway { transform-box: fill-box; transform-origin: 50% 100%; animation: gsway 5.5s ease-in-out infinite; }
@keyframes gsway { 0%, 100% { transform: rotate(-1.8deg); } 50% { transform: rotate(1.8deg); } }
.hs-spot { cursor: pointer; }
.hs-plus { opacity: .8; transform-box: fill-box; transform-origin: center; }
.hs-plus circle { fill: rgba(255,255,255,.6); stroke: #fff; stroke-width: 2; stroke-dasharray: 4 4; }
.hs-plus path { stroke: #4f8f5c; stroke-width: 3; stroke-linecap: round; }
.hs-plus.go { opacity: 1; animation: plusGo .8s ease-in-out infinite alternate; }
@keyframes plusGo { to { transform: scale(1.22); } }
.hs-glow { opacity: .35; animation: twinkle 2.6s ease-in-out infinite; }
.hs-bulb { animation: twinkle 1.9s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .3; } }
.hs-vane { transform-origin: 135px 137px; animation: vane 6s ease-in-out infinite; }
@keyframes vane { 0%, 40%, 100% { transform: scaleX(1); } 50%, 90% { transform: scaleX(-1); } }
.hs-fly { animation: fly 15s ease-in-out infinite; }
@keyframes fly { 0% { transform: translate(40px, 300px); } 20% { transform: translate(120px, 250px); } 40% { transform: translate(220px, 290px); }
  60% { transform: translate(300px, 220px); } 80% { transform: translate(180px, 200px); } 100% { transform: translate(40px, 300px); } }
.hs-flap { animation: flap .22s ease-in-out infinite alternate; }
@keyframes flap { to { transform: scaleX(.35); } }
.hscene .zoey { transform-box: fill-box; transform-origin: 50% 100%; cursor: pointer; }
.hs-big { width: 120px; height: 110px; margin: 0 auto 4px; }
.hbuild { display: flex; align-items: center; gap: 12px; background: var(--card-solid); border-radius: 20px; padding: 10px 12px 10px 14px; margin-top: 10px; box-shadow: var(--shadow); }
.hb-steps { display: flex; flex-direction: column; gap: 4px; }
.hb-steps i { width: 10px; height: 10px; border-radius: 50%; background: var(--cell); }
.hb-steps i.done { background: var(--good); } .hb-steps i.cur { background: var(--accent); animation: pulse 1.4s infinite; }
.hb-txt { flex: 1; display: flex; flex-direction: column; }
.hb-txt b { font-weight: 900; font-size: 16px; } .hb-txt small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swatch { background: var(--card-solid); border-radius: 18px; padding: 9px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-weight: 800; font-size: 12px;
  box-shadow: 0 4px 12px rgba(95,85,150,.1); transition: transform .15s, box-shadow .2s; }
.swatch i { width: 36px; height: 36px; border-radius: 50%; border: 3px solid; box-shadow: inset 0 3px 0 rgba(255,255,255,.4); }
.chips { display: flex; gap: 10px; }
.chipbtn { flex: 1; padding: 11px 6px 9px; border-radius: 18px; background: var(--card-solid); display: flex; flex-direction: column; gap: 3px; align-items: center; font-size: 13px;
  box-shadow: 0 4px 12px rgba(95,85,150,.1); transition: transform .15s, box-shadow .2s; }
.rows { background: var(--card); border-radius: 20px; padding: 2px 12px; }

/* ----------------------------------------------------------------- effects */
.fx-p { position: fixed; border-radius: 50%; pointer-events: none; }
.fx-conf { position: fixed; border-radius: 2px; pointer-events: none; }
.fx-text { position: fixed; font-weight: 900; font-size: 22px; color: #fff; text-shadow: 0 2px 8px rgba(70,50,130,.5), 0 0 2px rgba(70,50,130,.6); pointer-events: none; white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 110px); transform: translateX(-50%); background: var(--ink); color: var(--card-solid);
  padding: 11px 18px; border-radius: 99px; font-weight: 800; font-size: 14px; max-width: 86%; text-align: center; box-shadow: var(--shadow); }
[data-theme="night"] .toast { background: #ecebfa; color: #2b2c45; }

/* shared look for the game boards and pieces */
.bboard, .brick-board, .m3-board, .trails-canvas, .vine-board {
  box-shadow: inset 0 2px 7px rgba(80,70,130,.13), 0 0 0 2px var(--glass), 0 14px 30px rgba(95,85,150,.14); }

/* ======================================================= BLOCKS (zoey blocks) */
.blocks-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.bboard { display: grid; background: color-mix(in srgb, var(--ink) 8%, var(--glass)); border-radius: 18px; padding: 6px; gap: 2px; position: relative; touch-action: none; }
.bcell { border-radius: 7px; background: var(--cell); position: relative; transition: background .12s, transform .12s; }
.bcell.f, .tpiece .pc, .floatpiece .pc {
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 72%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 90%, #000) 100%);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12), inset 0 2.5px 0 rgba(255,255,255,.45); }
.bcell.f.pop { animation: cpop .3s var(--spring); }
@keyframes cpop { from { transform: scale(.4); } to { transform: scale(1); } }
.bcell.ghost { background: color-mix(in srgb, var(--c) 55%, transparent); }
.bcell.will { box-shadow: inset 0 0 0 3px rgba(255,255,255,.9); }
.bcell.hintc { animation: hintc .5s ease-in-out infinite alternate; background: color-mix(in srgb, var(--c) 70%, transparent); }
@keyframes hintc { to { transform: scale(.82); filter: brightness(1.15); } }
.bcell.clearing { animation: cclear .3s ease-in forwards; z-index: 2; }
@keyframes cclear { 40% { transform: scale(1.12); filter: brightness(1.4); } to { transform: scale(0) rotate(40deg); opacity: 0; } }
.bcell .gem { position: absolute; inset: 0; display: grid; place-items: center; }
.bcell .gem svg { width: 70%; height: 70%; fill: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); animation: gemf 2s ease-in-out infinite; }
@keyframes gemf { 50% { transform: scale(1.12); } }
.tray { display: flex; justify-content: space-around; align-items: center; width: 100%; background: var(--card); border-radius: 22px; box-shadow: var(--soft); }
.tslot { flex: 1; display: grid; place-items: center; position: relative; touch-action: none; align-self: stretch; }
.tpiece { display: grid; gap: 2px; touch-action: none; transition: transform .15s; animation: cpop .3s var(--spring); }
.tpiece.used { visibility: hidden; }
.tpiece.dragging { opacity: .22; }
.tpiece.hintp { animation: hintp .5s ease-in-out infinite alternate; }
@keyframes hintp { to { transform: scale(1.12); } }
.tpiece .pc, .floatpiece .pc { border-radius: 6px; }
.floatpiece { position: fixed; display: grid; gap: 2px; pointer-events: none; z-index: 30; filter: drop-shadow(0 10px 10px rgba(60,50,110,.28)); transition: none; }
.floatpiece.back { transition: left .2s ease, top .2s ease, transform .2s ease; }

/* ============================================================ SORT (pour sort) */
.sort-wrap { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 22px 12px; width: 100%; padding: 6px 2px 0; position: relative; }
.tube { position: relative; flex: none; cursor: pointer; transition: transform .25s var(--spring); z-index: 1; }
.tube.sel { transform: translateY(-16px); z-index: 5; }
.tube .glass { position: absolute; inset: 0; border-radius: 6px 6px 22px 22px; background: color-mix(in srgb, #fff 42%, transparent);
  border: 2.5px solid color-mix(in srgb, var(--ink) 20%, transparent); overflow: hidden; display: flex; flex-direction: column-reverse; padding: 0;
  box-shadow: inset 5px 0 8px rgba(255,255,255,.5), 0 6px 12px rgba(95,85,150,.12); }
.tube::before { content: ""; position: absolute; left: -4px; right: -4px; top: -7px; height: 9px; border-radius: 6px;
  border: 2.5px solid color-mix(in srgb, var(--ink) 20%, transparent); background: color-mix(in srgb, #fff 55%, transparent); z-index: 2; }
.tube .glass::after { content: ""; position: absolute; left: 14%; top: 6%; bottom: 14%; width: 13%; border-radius: 6px; background: linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,.12)); z-index: 3; pointer-events: none; }
.seg { width: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 88%, #000), var(--c) 30%, color-mix(in srgb, var(--c) 80%, #fff) 70%, var(--c)); position: relative; flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.seg.snow { box-shadow: inset 0 0 0 1.5px rgba(80,80,120,.18); }
.seg.hid { background: #b9b8d0; }
.seg.hid::before { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; }
.seg.grow { animation: grow .3s ease-out; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.tube.done .glass { border-color: color-mix(in srgb, var(--good) 80%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--good) 70%, transparent); }
.tube.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.tube.hint-from, .tube.hint-to { filter: drop-shadow(0 0 10px var(--accent)); }
.tube.hint-from { animation: hf .6s ease-in-out infinite alternate; }
@keyframes hf { to { transform: translateY(-10px); } }
.tube.hint-to::after { content: ""; position: absolute; left: 50%; top: -30px; width: 12px; height: 12px; margin-left: -6px; border-right: 4px solid var(--accent); border-bottom: 4px solid var(--accent); transform: rotate(45deg); animation: bob .6s ease-in-out infinite alternate; }
@keyframes bob { to { top: -22px; } }
.stream { position: absolute; width: 7px; border-radius: 4px; background: var(--c); z-index: 4; pointer-events: none; transform-origin: top; }

/* ===================================================== BRICK OUT (slide out) */
.brick-board { position: relative; border-radius: 20px; background: color-mix(in srgb, var(--ink) 7%, var(--glass)); touch-action: none; }
.brick { position: absolute; border-radius: 10px; cursor: pointer;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 74%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 92%, #000));
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.14), inset 0 3px 0 rgba(255,255,255,.4), 0 3px 6px rgba(80,70,130,.18);
  transition: transform .5s cubic-bezier(.55,0,.85,.45), opacity .5s ease-in .05s; }
.brick::before { content: ""; position: absolute; inset: 0; border-radius: 10px; pointer-events: none;
  background-image: radial-gradient(circle at 50% 46%, rgba(255,255,255,.45) 0 24%, rgba(0,0,0,.1) 26% 34%, transparent 36%);
  background-size: var(--cell-px) var(--cell-px); background-position: center; }
.brick .arrow { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.brick .arrow svg { width: min(60%, 30px); height: auto; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.brick.shake { animation: bshake .35s; }
@keyframes bshake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.brick.block { outline: 3px solid #ff8fa3; z-index: 3; }
.brick.hintb { animation: hintb .55s ease-in-out infinite alternate; z-index: 3; }
@keyframes hintb { to { transform: scale(1.07); filter: brightness(1.12); box-shadow: 0 0 0 4px rgba(255,255,255,.8), 0 0 18px var(--c); } }
.brick.in { animation: bin .4s var(--spring); }
@keyframes bin { from { opacity: 0; transform: scale(.7); } }

/* ============================================================ MATCH (match 3) */
.m3-board { position: relative; border-radius: 22px; background: color-mix(in srgb, var(--ink) 7%, var(--glass)); touch-action: none; overflow: hidden; }
.m3-cell { position: absolute; border-radius: 10px; background: var(--cell); }
.m3-cell.ice { background: color-mix(in srgb, #bfe8ff 80%, transparent); box-shadow: inset 0 0 0 2px rgba(255,255,255,.8), inset 0 -4px 8px rgba(120,190,240,.5); }
.m3-cell.ice::after { content: ""; position: absolute; left: 14%; top: 10%; width: 28%; height: 14%; border-radius: 6px; background: rgba(255,255,255,.8); transform: rotate(-20deg); }
.tile { position: absolute; transition: transform .26s cubic-bezier(.34,1.2,.5,1); display: grid; place-items: center; z-index: 2; }
.tile .tb { width: 88%; height: 88%; border-radius: 30%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 62%, color-mix(in srgb, var(--c) 90%, #000));
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.13), inset 0 3px 0 rgba(255,255,255,.4), 0 3px 5px rgba(80,70,130,.16); transition: transform .18s var(--spring); position: relative; }
.tile .tb svg { width: 62%; height: 62%; filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)); }
.tile.sel .tb { transform: scale(1.12); box-shadow: 0 0 0 3px #fff, 0 0 16px var(--c), inset 0 -4px 0 rgba(0,0,0,.13); }
.tile.clearing .tb { animation: tclear .22s ease-in forwards; }
@keyframes tclear { 40% { transform: scale(1.18); filter: brightness(1.3); } to { transform: scale(0); opacity: 0; } }
.tile.hintt .tb { animation: hintt .5s ease-in-out infinite alternate; }
@keyframes hintt { to { transform: scale(1.14); filter: brightness(1.12); } }
.tile.made .tb { animation: made .4s var(--spring); }
@keyframes made { from { transform: scale(.3); } }
.tile.sp-h .tb::after, .tile.sp-v .tb::after { content: ""; position: absolute; inset: 0; border-radius: 30%;
  background: repeating-linear-gradient(var(--ang), rgba(255,255,255,.7) 0 3px, transparent 3px 9px); opacity: .85; }
.tile.sp-h { --ang: 90deg; } .tile.sp-v { --ang: 0deg; }
.tile.sp-b .tb { box-shadow: 0 0 0 3px #fff, 0 0 14px var(--c), inset 0 -4px 0 rgba(0,0,0,.13); }
.tile.sp-b .tb::after { content: ""; position: absolute; width: 36%; height: 36%; border-radius: 50%; border: 3px solid #fff; opacity: .9; }
.tile.sp-r .tb { background: conic-gradient(#ff9db5, #ffd27a, #9ee0a0, #8fd6f5, #b9a6f7, #ff9db5); animation: spin 3s linear infinite; }
@keyframes spin { to { filter: hue-rotate(360deg); } }
.tile.sp-r .tb svg { fill: #fff; }
.m3-stats { display: flex; gap: 14px; align-items: center; }

/* ============================================================ TRAILS (connect) */
.trails-canvas { border-radius: 22px; background: color-mix(in srgb, var(--ink) 6%, var(--glass)); touch-action: none; }

/* ======================================================== VINES (vine garden) */
.vine-board { position: relative; border-radius: 22px; background: color-mix(in srgb, #c9a877 30%, var(--card-solid)); touch-action: none; }
.vcell { position: absolute; border-radius: 12px; background: color-mix(in srgb, #b08a55 22%, var(--card-solid)); box-shadow: inset 0 2px 3px rgba(110,80,40,.12); }
.vt { position: absolute; cursor: pointer; }
.vt svg { width: 100%; height: 100%; overflow: visible; transition: transform .24s cubic-bezier(.34,1.4,.64,1); }
.vt .st { fill: none; stroke: #cdc4a6; stroke-width: 13; stroke-linejoin: round; transition: stroke .35s ease; }
.vt .knot { fill: #cdc4a6; transition: fill .35s ease; }
.vt .flow { fill: none; stroke: transparent; stroke-width: 4; stroke-dasharray: 3 15; stroke-linecap: round; transition: stroke .35s; }
.vt .lf { fill: #7ccf8a; transform: scale(0); transition: transform .4s var(--spring); }
.vt .bud { fill: #c6d0a8; stroke: #aab98b; stroke-width: 2.5; transition: opacity .25s; }
.vt .fl { transform: scale(0) rotate(-50deg); transition: transform .55s var(--spring); }
.vt .vsrc { transition: transform .24s cubic-bezier(.34,1.4,.64,1); }
.vt.alive .st { stroke: #5fbe78; transition-delay: calc(var(--d) * 38ms); }
.vt.alive .knot { fill: #5fbe78; transition-delay: calc(var(--d) * 38ms); }
.vt.alive .flow { stroke: rgba(255,255,255,.5); animation: vflow 1.1s linear infinite; transition-delay: calc(var(--d) * 38ms); }
.vt.alive .lf { transform: scale(1); transition-delay: calc(var(--d) * 38ms + 90ms); }
.vt.alive .bud { opacity: 0; transition-delay: calc(var(--d) * 38ms + 60ms); }
.vt.alive .fl { transform: scale(1) rotate(0deg); transition-delay: calc(var(--d) * 38ms + 100ms); }
@keyframes vflow { to { stroke-dashoffset: -18; } }
.vt.lock::after { content: ""; position: absolute; right: 13%; top: 13%; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff; }
.vt.nope { animation: bshake .3s; }
.vt.hintv { z-index: 3; animation: hintv .45s ease-in-out 4 alternate; }
@keyframes hintv { to { transform: scale(1.14); filter: drop-shadow(0 0 8px var(--accent)); } }
.vine-board.won .vt .fl { animation: fspin 1.2s ease-in-out infinite; }
@keyframes fspin { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.2) rotate(36deg); } }

/* ====================================================== STUDIO (colour studio) */
.studio-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.studio-art { background: #fffdf7; border-radius: 30px; padding: 6px; touch-action: none; box-shadow: 0 0 0 2px var(--glass), 0 14px 30px rgba(95,85,150,.16); }
.art { width: 100%; height: 100%; overflow: visible; }
.art .rg { stroke: #5b5770; stroke-width: .7; stroke-linejoin: round; transition: fill .22s ease; }
.studio-art .rg { cursor: pointer; }
.art .rg.tg { stroke: #2f2c45; stroke-width: 1.15; }
.art .rg.pop { animation: rgpop .34s ease-out; }
@keyframes rgpop { from { filter: brightness(1.4) saturate(1.2); } }
.art .rg.hintr { animation: hintr .45s ease-in-out infinite alternate; }
@keyframes hintr { to { opacity: .35; } }
.art .rn { fill: #9a96b0; font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; font-family: var(--font); }
.art .rn.tgn { fill: #2f2c45; }
.art .rn.no { transform-box: fill-box; transform-origin: center; animation: rnno .45s; fill: #e8607f; }
@keyframes rnno { 30% { transform: scale(1.7); } 60% { transform: scale(.9); } }
.art.finished { animation: artdone 1.2s var(--spring); }
.art.finished .rg, .gal .art .rg, .gal-big .art .rg, .win-art .art .rg { stroke: rgba(60,50,90,.32); stroke-width: .5; }
@keyframes artdone { 35% { transform: scale(1.06) rotate(5deg); } }
.studio-pal { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; max-width: 100%; min-height: 50px; }
.pc { position: relative; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 60%, #fff), var(--c) 65%);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.12), 0 3px 8px rgba(80,70,130,.2); display: grid; place-items: center; color: #fff; transition: transform .2s var(--spring), box-shadow .2s; }
.pc b { font-size: 17px; font-weight: 900; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.pc small { position: absolute; right: -5px; top: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--card-solid); color: var(--ink); font-size: 10.5px; font-weight: 900;
  display: grid; place-items: center; padding: 0 4px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.pc svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.pc.on { transform: scale(1.14); box-shadow: inset 0 -4px 0 rgba(0,0,0,.12), 0 0 0 3px var(--card-solid), 0 0 0 6px var(--c); }
.pc.done { opacity: .5; }
.pc.pulse { animation: pcpulse .5s var(--spring); }
@keyframes pcpulse { 40% { transform: scale(1.35); } }
.studio-pal.free { gap: 7px; }
.studio-pal.free .pc { width: 36px; height: 36px; }
.gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.gal-item { background: #fffdf7; border-radius: 16px; padding: 6px 6px 5px; box-shadow: 0 4px 12px rgba(95,85,150,.14); display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #6b6784; font-weight: 800; font-size: 11px; }
.gal-item:active { transform: scale(.95); }
.gal-big { background: #fffdf7; border-radius: 24px; padding: 10px; margin: 8px 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.win-art { width: 156px; height: 156px; margin: 0 auto 8px; background: #fffdf7; border-radius: 26px; padding: 8px; box-shadow: var(--shadow); animation: artdone 1s var(--spring); }

/* ============================================================== mini games */
.mini { position: fixed; inset: 0; z-index: 45; pointer-events: auto; display: flex; flex-direction: column;
  background: linear-gradient(170deg, #d9ecff, #fdeef4 70%); overflow: hidden; animation: fade .25s both; touch-action: none; }
[data-theme="night"] .mini { background: linear-gradient(170deg, #2a3a63, #3b2f5a 70%); }
.mini .mtop { position: absolute; left: 0; right: 0; top: 0; padding: calc(var(--sat) + 10px) 14px 0; display: flex; justify-content: space-between; align-items: center; z-index: 5; pointer-events: none; }
.mini .mtop > * { pointer-events: auto; }
.mini .mtimer { font-size: 22px; font-weight: 900; min-width: 64px; text-align: center; }
.mini .mscore { display: inline-flex; gap: 6px; align-items: center; font-weight: 900; font-size: 22px; }
.mini .mscore svg { width: 26px; height: 26px; }
.mini .mfield { position: absolute; inset: 0; }
.mini .mhint { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 18px); text-align: center; color: var(--muted); font-weight: 800; font-size: 15px; pointer-events: none; }
.fall { position: absolute; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; will-change: transform;
  background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 65%); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12), 0 4px 8px rgba(80,70,130,.2); }
.fall svg { width: 26px; height: 26px; }
.fall.gold { background: radial-gradient(circle at 35% 30%, #fff3b0, #ffcf4a); width: 54px; height: 54px; }
.catcher { position: absolute; bottom: calc(var(--sab) + 12px); width: 110px; height: 116px; will-change: transform; pointer-events: none; }
.bubble-m { position: absolute; border-radius: 50%; will-change: transform; background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95), rgba(255,255,255,.35) 38%, color-mix(in srgb, var(--c) 55%, transparent) 70%);
  border: 2px solid rgba(255,255,255,.75); display: grid; place-items: center; }
.bubble-m svg { width: 44%; height: 44%; opacity: .95; }
.bubble-m.poof { animation: poof .22s ease-out forwards; }
@keyframes poof { to { scale: 1.5; opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .hs-cloud, .gsway, .sp-icon, .sp-hero i { animation: none !important; }
}
