/* 058 Pipi Cube School - playful kid style */
:root {
  --ink: #2b2250;
  --ink2: #5d5490;
  --purple: #7c5cff;
  --pink: #ff5d8f;
  --sun: #ffd23f;
  --mint: #2fd4a3;
  --sky: #4cc3ff;
  --card: #ffffff;
  --shadow: 0 6px 0 rgba(43, 34, 80, .18);
  --r: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Fredoka", "Noto Sans TC", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #fff4d6 0%, #ffe3f0 45%, #e3f1ff 100%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
}
b, strong { font-weight: 700; }

/* floating bubbles */
.bg-bubbles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-bubbles span {
  position: absolute; bottom: -120px; width: 70px; height: 70px; border-radius: 18px; opacity: .22;
  animation: floatUp 18s linear infinite;
}
.bg-bubbles span:nth-child(1) { left: 6%; background: var(--sun); animation-duration: 21s; }
.bg-bubbles span:nth-child(2) { left: 24%; background: var(--mint); width: 44px; height: 44px; animation-delay: -6s; }
.bg-bubbles span:nth-child(3) { left: 48%; background: var(--pink); animation-duration: 25s; animation-delay: -12s; }
.bg-bubbles span:nth-child(4) { left: 66%; background: var(--sky); width: 54px; height: 54px; animation-delay: -3s; }
.bg-bubbles span:nth-child(5) { left: 82%; background: var(--purple); width: 38px; height: 38px; animation-delay: -9s; }
.bg-bubbles span:nth-child(6) { left: 92%; background: #ff8a1f; animation-duration: 23s; animation-delay: -15s; }
@keyframes floatUp { to { transform: translateY(-120vh) rotate(360deg); } }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(10px);
  border-bottom: 3px solid #f1e9ff;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-name { font-family: "Noto Sans TC", sans-serif; font-weight: 900; font-size: 19px; letter-spacing: .5px; }
.brand-name b { color: var(--purple); font-weight: 900; }
.back-btn, .sound-btn {
  width: 42px; height: 42px; border-radius: 14px; border: 0; cursor: pointer;
  background: #f1ebff; font-size: 20px; box-shadow: 0 3px 0 #d9ccff;
}
.back-btn:active, .sound-btn:active { transform: translateY(3px); box-shadow: none; }
.star-pill {
  background: var(--sun); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 17px;
  box-shadow: 0 3px 0 #e0aa00;
}

.mascot svg { width: 100%; height: 100%; display: block; }
.mascot-sm { width: 36px; height: 36px; }
.mascot-md { width: 64px; height: 64px; flex: none; }
.mascot-xl { width: 130px; height: 130px; flex: none; }
.bounce { animation: bounce 2.4s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
.wiggle { display: inline-block; animation: wiggle 1.8s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }

.app { max-width: 1120px; margin: 0 auto; padding: 16px 14px 30px; }
.app.enter > * { animation: popIn .35s cubic-bezier(.2, 1.4, .5, 1); }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.title { font-family: "Noto Sans TC", sans-serif; font-weight: 900; font-size: 28px; margin: 6px 0 12px; text-align: center; }
.lead { text-align: center; color: var(--ink2); font-size: 17px; margin: 0 0 16px; font-family: "Noto Sans TC", sans-serif; }

/* home */
.hero { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0 22px; flex-wrap: wrap; }
.bubble {
  position: relative; background: #fff; border-radius: var(--r); padding: 16px 20px; box-shadow: var(--shadow);
  font-family: "Noto Sans TC", sans-serif; font-size: 19px; line-height: 1.6; max-width: 330px;
}
.bubble::before {
  content: ""; position: absolute; left: -14px; top: 40px; border: 10px solid transparent; border-right: 16px solid #fff; border-left: 0;
}
.bubble b { color: var(--purple); }
.bubble .sub { color: var(--pink); font-weight: 700; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.size-card {
  display: block; text-decoration: none; color: var(--ink); text-align: center;
  border-radius: 28px; padding: 18px 16px 16px; box-shadow: 0 8px 0 rgba(43, 34, 80, .2);
  transition: transform .15s; font-family: "Noto Sans TC", sans-serif;
}
.size-card:hover { transform: translateY(-4px) rotate(-1deg); }
.size-card:active { transform: translateY(4px); box-shadow: 0 3px 0 rgba(43, 34, 80, .2); }
.size-card .sz { font-family: "Fredoka", sans-serif; font-size: 46px; font-weight: 700; line-height: 1; margin-top: 6px; }
.size-card .tag { display: inline-block; margin: 8px 0 2px; background: rgba(255, 255, 255, .75); border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.size-card p { margin: 6px 0 10px; font-size: 16px; }
.c-mint { background: linear-gradient(160deg, #b9f6e1, #5fe0b8); }
.c-sun { background: linear-gradient(160deg, #fff0a8, #ffc93c); }
.c-grey { background: linear-gradient(160deg, #eceaf3, #d5d1e6); }
.size-card.soon { opacity: .75; cursor: default; }
.size-card.soon:hover { transform: none; }
.bar { height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .6); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--purple); border-radius: 99px; transition: width .6s; }
.bar-l { font-weight: 700; margin-top: 6px; }

/* mini isometric cube on cards */
.mini-cube {
  width: 86px; height: 86px; margin: 0 auto; border-radius: 16px; transform: rotate(-8deg);
  background-color: #2b2250; padding: 5px; display: grid; gap: 4px; box-shadow: 0 6px 0 rgba(0, 0, 0, .2);
  animation: wiggle 3s ease-in-out infinite;
}
.mini-cube.n2 { grid-template-columns: repeat(2, 1fr);
  background-image: none; }
.mini-cube.n2::before, .mini-cube.n3::before, .mini-cube.n4::before { content: none; }
.mini-cube { --a: #ffd23f; --b: #22c55e; --c: #ef4444; --d: #3b82f6; --e: #ff8a1f; --f: #fff; }
.mini-cube.n2 { background: conic-gradient(from 0deg at 50% 50%, var(--a) 0 25%, var(--b) 0 50%, var(--e) 0 75%, var(--c) 0) content-box, #2b2250; }
.mini-cube.n3 { background:
  linear-gradient(90deg, transparent 32%, #2b2250 32% 35%, transparent 35% 65%, #2b2250 65% 68%, transparent 68%) content-box,
  linear-gradient(0deg, transparent 32%, #2b2250 32% 35%, transparent 35% 65%, #2b2250 65% 68%, transparent 68%) content-box,
  conic-gradient(var(--a) 0 12%, var(--b) 0 30%, var(--e) 0 45%, var(--d) 0 62%, var(--c) 0 80%, var(--f) 0 90%, var(--a) 0) content-box, #2b2250; }
.mini-cube.n2 { background-image:
  linear-gradient(90deg, transparent 48%, #2b2250 48% 52%, transparent 52%),
  linear-gradient(0deg, transparent 48%, #2b2250 48% 52%, transparent 52%),
  conic-gradient(var(--a) 0 25%, var(--b) 0 50%, var(--e) 0 75%, var(--c) 0); background-origin: content-box; background-clip: content-box; }
.mini-cube.n4 { background:
  repeating-linear-gradient(90deg, transparent 0 22%, #2b2250 22% 25%) content-box,
  repeating-linear-gradient(0deg, transparent 0 22%, #2b2250 22% 25%) content-box,
  linear-gradient(135deg, #c9c4dc, #9d97b8) content-box, #2b2250; }

/* puzzle card art */
.mini-art { width: 86px; height: 86px; margin: 0 auto; animation: wiggle 3s ease-in-out infinite; }
.art-n2, .art-n3, .art-n4, .art-n5 { border-radius: 16px; background-color: #2b2250; padding: 5px; box-shadow: 0 6px 0 rgba(0, 0, 0, .2); transform: rotate(-8deg); }
.art-n2 { background-image: linear-gradient(90deg, transparent 47%, #2b2250 47% 53%, transparent 53%), linear-gradient(0deg, transparent 47%, #2b2250 47% 53%, transparent 53%), conic-gradient(#ffd23f 0 25%, #22c55e 0 50%, #ff8a1f 0 75%, #ef4444 0); background-origin: content-box; background-clip: content-box; }
.art-n3 { background-image: repeating-linear-gradient(90deg, transparent 0 30%, #2b2250 30% 35%), repeating-linear-gradient(0deg, transparent 0 30%, #2b2250 30% 35%), conic-gradient(#ffd23f 0 14%, #22c55e 0 30%, #ff8a1f 0 46%, #3b82f6 0 62%, #ef4444 0 80%, #fff 0 90%, #ffd23f 0); background-origin: content-box; background-clip: content-box; }
.art-n4 { background-image: repeating-linear-gradient(90deg, transparent 0 21%, #2b2250 21% 25%), repeating-linear-gradient(0deg, transparent 0 21%, #2b2250 21% 25%), conic-gradient(#3b82f6 0 20%, #ffd23f 0 40%, #22c55e 0 60%, #ef4444 0 80%, #ff8a1f 0); background-origin: content-box; background-clip: content-box; }
.art-n5 { background-image: repeating-linear-gradient(90deg, transparent 0 16%, #2b2250 16% 20%), repeating-linear-gradient(0deg, transparent 0 16%, #2b2250 16% 20%), conic-gradient(#ef4444 0 18%, #ffd23f 0 36%, #3b82f6 0 54%, #fff 0 70%, #22c55e 0 86%, #ff8a1f 0); background-origin: content-box; background-clip: content-box; }
.art-pyra { width: 96px; clip-path: polygon(50% 4%, 98% 92%, 2% 92%); background: linear-gradient(180deg, #22c55e 0 33%, #ef4444 33% 66%, #3b82f6 66%); filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .2)); }
.art-skewb { transform: rotate(45deg) scale(.78); border-radius: 14px; border: 5px solid #2b2250;
  background: conic-gradient(from 45deg, #ffd23f 0 25%, #22c55e 0 50%, #ff8a1f 0 75%, #3b82f6 0); box-shadow: 0 6px 0 rgba(0, 0, 0, .2); }
.art-skewb::after { content: ""; display: block; width: 50%; height: 50%; margin: 25%; background: #fff; border: 4px solid #2b2250; border-radius: 6px; box-sizing: border-box; }
.c-sky { background: linear-gradient(160deg, #d6f0ff, #8fd0ff); }
.c-lilac { background: linear-gradient(160deg, #eee4ff, #c3a9ff); }
.c-peach { background: linear-gradient(160deg, #ffe6d1, #ffb07a); }
.c-pink { background: linear-gradient(160deg, #ffe0ee, #ff9cc6); }
.soon-l { opacity: .8; }
.t-grey { background: linear-gradient(160deg, #f0eef6, #d8d4e6); opacity: .8; }

/* menu tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 760px; margin: 0 auto; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--ink);
  border-radius: 26px; padding: 20px 10px; box-shadow: 0 7px 0 rgba(43, 34, 80, .2); font-family: "Noto Sans TC", sans-serif;
  transition: transform .15s;
}
.tile:hover { transform: translateY(-3px) scale(1.02); }
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(43, 34, 80, .2); }
.tile .emo { font-size: 46px; animation: bounce 3s ease-in-out infinite; }
.tile b { font-size: 21px; font-weight: 900; }
.tile small { font-size: 15px; color: var(--ink2); }
.t-purple { background: linear-gradient(160deg, #e6dcff, #b9a5ff); }
.t-blue { background: linear-gradient(160deg, #d8f2ff, #8fd6ff); }
.t-green { background: linear-gradient(160deg, #d9fbe9, #8ce8bd); }
.t-pink { background: linear-gradient(160deg, #ffe0ec, #ffa3c4); }

/* learning map */
.path { list-style: none; padding: 0; margin: 0 auto; max-width: 640px; position: relative; }
.path::before { content: ""; position: absolute; left: 50%; top: 20px; bottom: 20px; border-left: 6px dotted #c9b8ff; transform: translateX(-3px); }
.stone { position: relative; margin: 0 0 14px; width: 86%; }
.stone.right { margin-left: 14%; }
.stone a {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: #fff; border-radius: 24px;
  padding: 12px 14px; box-shadow: var(--shadow); font-family: "Noto Sans TC", sans-serif; border: 3px solid transparent;
}
.stone a:hover { border-color: var(--purple); }
.stone.done a { background: #fff8d9; border-color: var(--sun); }
.stone .ico { font-size: 34px; width: 54px; height: 54px; display: grid; place-items: center; background: #f1ebff; border-radius: 16px; flex: none; }
.stone .txt { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.stone .txt b { font-size: 18px; font-weight: 900; }
.stone .txt small { font-size: 14px; color: var(--ink2); line-height: 1.4; }
.stone .st { font-size: 28px; color: #d0c6ef; }

/* 3D cube */
.cv-host { width: 100%; height: 100%; display: grid; place-items: center; }
.cv-scene { width: 100%; height: 100%; perspective: 900px; display: grid; place-items: center; cursor: grab; touch-action: none; user-select: none; }
.cv-scene:active { cursor: grabbing; }
.cv-cam { position: relative; width: 0; height: 0; transform-style: preserve-3d; }
.cv-cubie { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.cv-face { position: absolute; inset: 0; background: #1b1d2a; border-radius: 12%; backface-visibility: hidden; }
.cv-face i { position: absolute; inset: 6%; border-radius: 18%; display: block; transition: background .25s; }
.cv-face i.cv-st { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), inset 0 3px 0 rgba(255, 255, 255, .45); }
.cv-face i.cv-dim { opacity: .55; }
.cv-face i.cv-in { inset: 0; border-radius: 0; }
.cv-moving .cv-face i.cv-st { box-shadow: inset 0 0 0 4px rgba(255, 93, 143, .95), 0 0 12px rgba(255, 93, 143, .8); }

.stage {
  position: relative; height: 340px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #efe9ff 70%); box-shadow: var(--shadow); border: 3px solid #e6ddff;
}
.stage.pop { animation: stagePop .7s; }
@keyframes stagePop { 30% { transform: scale(1.04) rotate(-1deg); background: #fff7cc; } }
.stage .cube-box { position: absolute; inset: 0 0 40px; }
.stage-badge {
  position: absolute; left: 10px; right: 10px; bottom: 10px; text-align: center; font-family: "Noto Sans TC", sans-serif;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 7px 10px; font-size: 16px;
}
.stage-badge b { color: var(--sun); font-family: "Fredoka", sans-serif; font-size: 19px; }
.view-reset {
  position: absolute; right: 10px; top: 10px; border: 0; border-radius: 12px; padding: 6px 10px; cursor: pointer;
  background: rgba(255, 255, 255, .9); box-shadow: 0 3px 0 #d9ccff; font-family: "Noto Sans TC", sans-serif; font-size: 14px; min-height: 38px;
}

/* lesson */
.lesson-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; font-family: "Noto Sans TC", sans-serif; }
.lesson-head h1 { margin: 0; font-size: 25px; font-weight: 900; }
.lesson-head .goal { margin: 4px 0 0; color: var(--ink2); font-size: 16px; }
.big-ico { font-size: 40px; width: 64px; height: 64px; display: grid; place-items: center; background: #fff; border-radius: 20px; box-shadow: var(--shadow); flex: none; }
.lesson-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.cases { display: flex; gap: 8px; margin-bottom: 10px; overflow-x: auto; padding-bottom: 4px; }
.cases.single { display: none; }
.case {
  flex: none; border: 0; border-radius: 999px; padding: 9px 16px; min-height: 40px; cursor: pointer;
  background: #fff; color: var(--ink); font-family: "Noto Sans TC", sans-serif; font-weight: 700; font-size: 15px; box-shadow: 0 3px 0 #d9ccff;
}
.case.on { background: var(--purple); color: #fff; box-shadow: 0 3px 0 #4f37c9; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 8px; }
.no-moves { font-family: "Noto Sans TC", sans-serif; color: var(--ink2); padding: 8px; }
.seg { background: rgba(255, 255, 255, .7); border-radius: 18px; padding: 8px; }
.seg-l { font-family: "Noto Sans TC", sans-serif; font-size: 14px; font-weight: 700; color: var(--purple); margin: 0 0 6px 4px; }
.seg-l em { font-style: normal; background: var(--pink); color: #fff; border-radius: 99px; padding: 1px 8px; }
.seg-m { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rep { font-size: 16px; }
.chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px; width: 74px; padding: 6px 2px 6px; cursor: pointer;
  border: 3px solid transparent; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 3px 0 #d9ccff;
  transition: transform .15s, background .2s;
}
.chip .mv-ico { width: 38px; height: 38px; }
.chip b { font-size: 19px; line-height: 1.1; }
.chip small { font-family: "Noto Sans TC", sans-serif; font-size: 11.5px; color: var(--ink2); line-height: 1.25; text-align: center; min-height: 2.5em; }
.chip:active { transform: translateY(3px); box-shadow: none; }
.chip.done { opacity: .45; }
.chip.now { border-color: var(--pink); transform: translateY(-4px) scale(1.06); background: #fff0f5; animation: nowPulse 1s ease-in-out infinite; }
@keyframes nowPulse { 50% { box-shadow: 0 0 0 6px rgba(255, 93, 143, .25); } }

.ctrls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cbtn {
  border: 0; border-radius: 18px; padding: 8px 2px; min-height: 58px; cursor: pointer; background: #fff; color: var(--ink);
  font-size: 22px; font-family: "Fredoka", sans-serif; box-shadow: 0 4px 0 #d9ccff; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.cbtn small { font-family: "Noto Sans TC", sans-serif; font-size: 13px; font-weight: 700; }
.cbtn .spd { font-size: 15px; font-family: "Noto Sans TC", sans-serif; }
.cbtn:active { transform: translateY(4px); box-shadow: none; }
.cbtn.play { background: var(--pink); color: #fff; box-shadow: 0 4px 0 #c93a69; }

.talk { display: flex; gap: 10px; align-items: flex-start; }
.talk .say, .talk.mini p {
  flex: 1; margin: 0; background: #fff; border-radius: var(--r); padding: 14px 16px 14px 34px; box-shadow: var(--shadow);
  font-family: "Noto Sans TC", sans-serif; font-size: 17px; line-height: 1.65; position: relative;
}
.talk.mini p { padding-left: 16px; }
.talk .say li { margin: 0 0 6px; }
.talk .say li::marker { color: var(--purple); font-weight: 900; }
.talk .say b, .talk.mini b { color: #e23d74; }
.pic { margin-top: 14px; background: #fff; border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow); text-align: center; }
.pic-h { font-family: "Noto Sans TC", sans-serif; font-weight: 700; color: var(--ink2); font-size: 15px; }
.topview { width: 150px; height: 150px; margin-top: 4px; }
.tip { margin-top: 14px; background: #fff6c9; border: 3px dashed #ffd23f; border-radius: var(--r); padding: 12px 14px; font-family: "Noto Sans TC", sans-serif; font-size: 16px; line-height: 1.55; }
.learned {
  display: block; width: 100%; margin-top: 16px; border: 0; border-radius: 22px; padding: 16px; cursor: pointer;
  font-family: "Noto Sans TC", sans-serif; font-weight: 900; font-size: 21px; color: #fff;
  background: linear-gradient(90deg, var(--purple), var(--pink)); box-shadow: 0 6px 0 #4f37c9;
  animation: nowPulse 2s ease-in-out infinite;
}
.learned:active { transform: translateY(5px); box-shadow: none; }
.learned.is-done { background: var(--sun); color: var(--ink); box-shadow: 0 6px 0 #e0aa00; animation: none; }
.step-nav { display: flex; gap: 10px; margin-top: 14px; }
.nav-btn {
  flex: 1; text-align: center; text-decoration: none; color: var(--ink); background: #fff; border-radius: 18px; padding: 12px;
  font-family: "Noto Sans TC", sans-serif; font-weight: 700; font-size: 17px; box-shadow: 0 4px 0 #d9ccff;
}
.nav-btn.next { background: var(--mint); box-shadow: 0 4px 0 #1ea37c; }

/* moves + practice */
.moves .talk.mini { max-width: 620px; margin: 0 auto 14px; }
.moves-grid, .practice-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad-g { margin-bottom: 10px; }
.pad-l { font-family: "Noto Sans TC", sans-serif; font-weight: 700; color: var(--purple); font-size: 14px; margin: 0 0 6px 4px; }
.pv-svg { width: 78%; height: 100%; max-height: 100%; touch-action: none; cursor: grab; user-select: none; }
.pnet { width: 220px; max-width: 100%; }
.helper { margin-top: 14px; background: #eafff6; border: 3px solid var(--mint); border-radius: var(--r); padding: 12px 14px; font-family: "Noto Sans TC", sans-serif; }
.helper-h { font-weight: 900; font-size: 18px; }
.helper p { margin: 6px 0 10px; font-size: 15px; line-height: 1.5; }
.sk-cross { display: grid; grid-template-columns: repeat(4, 54px); gap: 6px; justify-content: center; }
.sk-cross button { width: 54px; height: 54px; border-radius: 12px; border: 3px solid #2b2250; cursor: pointer; font-weight: 900; font-size: 15px; color: #2b2250; font-family: "Noto Sans TC", sans-serif; }
.sk-labels { display: grid; grid-template-columns: repeat(4, 54px); gap: 6px; justify-content: center; font-size: 13px; color: var(--ink2); text-align: center; margin-top: 2px; }
.helper .go { display: block; margin: 10px auto 0; background: var(--mint); box-shadow: 0 4px 0 #1ea37c; }
.helper-msg { text-align: center; margin-top: 8px; font-weight: 700; min-height: 1.4em; }
.pad .chip { width: auto; }
.soft-btn {
  border: 0; border-radius: 16px; padding: 11px 14px; min-height: 46px; cursor: pointer; background: #fff; color: var(--ink);
  font-family: "Noto Sans TC", sans-serif; font-weight: 700; font-size: 16px; box-shadow: 0 4px 0 #d9ccff;
}
.soft-btn:active { transform: translateY(4px); box-shadow: none; }
.soft-btn.danger { color: #c4314b; }
.reset-cube { display: block; margin: 14px auto 0; }
.row-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.row-btns [data-act="scramble"] { background: var(--sun); box-shadow: 0 4px 0 #e0aa00; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stats div, .tstats div { background: #fff; border-radius: 18px; padding: 8px; text-align: center; box-shadow: var(--shadow); }
.stats small, .tstats small { display: block; font-family: "Noto Sans TC", sans-serif; color: var(--ink2); font-size: 14px; }
.stats b, .tstats b { font-size: 28px; }
.hint { font-family: "Noto Sans TC", sans-serif; font-size: 14px; color: var(--ink2); line-height: 1.5; }

/* timer */
.timer { max-width: 760px; margin: 0 auto; }
.scr-card { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); display: grid; gap: 10px; justify-items: center; }
.scr-text { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: 22px; font-weight: 700; }
.scr-text span { background: #f1ebff; border-radius: 10px; padding: 2px 9px; }
.net { width: 220px; max-width: 100%; }
.clock-pad {
  margin: 16px 0 10px; border-radius: 30px; padding: 26px 10px; text-align: center; cursor: pointer; user-select: none; touch-action: none;
  background: linear-gradient(160deg, #3a2f78, #2b2250); color: #fff; box-shadow: 0 8px 0 #1a1438; outline: none;
}
.clock-pad:focus-visible { box-shadow: 0 0 0 4px var(--sky), 0 8px 0 #1a1438; }
.big-clock { font-size: 76px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.clock-hint { font-family: "Noto Sans TC", sans-serif; margin-top: 10px; font-size: 16px; opacity: .85; }
.clock-pad.holding .big-clock { color: #ff8a8a; }
.clock-pad.ready .big-clock { color: #6dffb3; transform: scale(1.05); }
.clock-pad[data-state="inspect"] { background: linear-gradient(160deg, #ff9f43, #e2683c); box-shadow: 0 8px 0 #a4451f; }
.clock-pad[data-state="running"] { background: linear-gradient(160deg, #19b37b, #0d8a5d); box-shadow: 0 8px 0 #06593b; }
.chk { display: flex; align-items: center; gap: 8px; justify-content: center; font-family: "Noto Sans TC", sans-serif; font-size: 16px; min-height: 40px; }
.chk input { width: 22px; height: 22px; }
.tstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.tstats b { font-size: 22px; }
.tlist { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.tlist li { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 6px 10px; }
.tlist li.pb { background: #fff6c9; }
.tlist .no { color: var(--ink2); width: 40px; }
.tlist b { font-size: 20px; }
.pb-tag { font-family: "Noto Sans TC", sans-serif; font-size: 13px; }
.tlist button { margin-left: auto; border: 0; background: #f6f2ff; border-radius: 10px; width: 38px; height: 38px; cursor: pointer; color: var(--ink2); }
.clear { display: block; margin: 10px auto 0; }

/* confetti + toast */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 140%); z-index: 60; transition: transform .35s cubic-bezier(.2, 1.4, .5, 1);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-family: "Noto Sans TC", sans-serif; font-size: 17px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); max-width: 92vw; text-align: center;
  opacity: 0; visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.foot { text-align: center; font-family: "Noto Sans TC", sans-serif; color: var(--ink2); font-size: 14px; padding: 10px 0 calc(18px + env(safe-area-inset-bottom)); }

/* desktop */
@media (min-width: 900px) {
  .lesson-grid { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .stage { height: 400px; }
  .moves-grid, .practice-grid { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .moves .stage, .practice .stage { height: 430px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .title { font-size: 32px; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 17px; }
  .chip { width: 66px; }
  .stage { height: 300px; }
  .big-clock { font-size: 64px; }
  .tstats b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .bounce, .wiggle, .bg-bubbles span, .tile .emo, .mini-cube, .chip.now, .learned { animation: none !important; }
}
