/* Ong Chăm Học — shared styles (always a bright daytime look).
 * Games may use the .g-* classes below and the --c accent variable.
 * Palette variables games rely on: --bg --card --ink --muted --honey --good --bad --c.
 */
:root {
  color-scheme: light;
  --bg: #fff8e7;
  --bg2: #e3f6f1;
  --card: #ffffff;
  --ink: #3a2e1f;
  --muted: #8a7a66;
  --brand: #14a38b;
  --brand-hi: #2cc8ab;
  --brand-deep: #0c7a68;
  --honey: #ffc93c;
  --honey-deep: #f59f00;
  --good: #37b24d;
  --bad: #f03e3e;
  --pink: #ff6fa8;
  --sky: #4dabf7;
  --paper: #fffdf5;
  --line: #f1e6cf;
  --radius: 24px;
  --shadow: 0 4px 0 rgba(58, 46, 31, .09), 0 12px 24px -8px rgba(58, 46, 31, .22), 0 1px 3px rgba(58, 46, 31, .06);
  --shadow-lg: 0 6px 0 rgba(58, 46, 31, .10), 0 22px 40px -12px rgba(58, 46, 31, .32), 0 2px 6px rgba(58, 46, 31, .08);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", "Varela Round", "Segoe UI Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: light; background: #bfe6fb; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: #bfe6fb;
  user-select: none; -webkit-user-select: none; overscroll-behavior: none;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 4px solid rgba(245, 159, 0, .75); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 900; line-height: 1.15; letter-spacing: .2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

#app { min-height: 100%; }
.screen {
  max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  min-height: 100vh; min-height: 100dvh;
}
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }

/* ================= background scene ================= */
.bg-scene {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #56bdf7 0%, #8fd3fb 30%, #c6ecff 56%, #eaf8ff 76%, #f4fde8 100%);
}
.bg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.bg-sun { position: absolute; top: -38px; right: -30px; width: clamp(150px, 24vw, 250px); aspect-ratio: 1; }
.bg-sun svg, .bg-cloud svg, .bg-bird svg { display: block; width: 100%; height: auto; overflow: visible; }
.sun-rays { transform-box: view-box; transform-origin: 100px 100px; animation: spin 90s linear infinite; }
.sun-glow { transform-box: view-box; transform-origin: 100px 100px; animation: sun-pulse 5s ease-in-out infinite; }
.bg-cloud {
  position: absolute; left: 0; top: var(--y); width: var(--w); opacity: var(--o, .95);
  transform: translateX(var(--x)); animation: drift var(--t) linear infinite; animation-delay: var(--dl);
  will-change: transform;
}
.bg-cloud.c1 { --y: 7%; --w: 170px; --t: 120s; --dl: -34s; --x: 6vw; }
.bg-cloud.c2 { --y: 19%; --w: 110px; --t: 80s; --dl: -52s; --x: 62vw; --o: .9; }
.bg-cloud.c3 { --y: 31%; --w: 220px; --t: 150s; --dl: -110s; --x: 30vw; --o: .7; }
.bg-cloud.c4 { --y: 3%; --w: 84px; --t: 95s; --dl: -8s; --x: 82vw; }
.bg-bird { position: absolute; left: 0; top: 15%; width: 56px; animation: bird-fly 40s linear infinite; animation-delay: -12s; will-change: transform; }
.bg-bird .bw { transform-box: fill-box; transform-origin: center; animation: bird-flap .45s ease-in-out infinite alternate; }
.bg-bird .bw2 { animation-delay: -.22s; }
.bg-hills { position: absolute; left: 0; bottom: 0; width: 100%; height: clamp(170px, 34vh, 330px); display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sun-pulse { 0%, 100% { transform: scale(1); opacity: .55; } 50% { transform: scale(1.08); opacity: .8; } }
@keyframes drift { from { transform: translateX(-280px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes bird-fly {
  0% { transform: translate(-90px, 0); }
  25% { transform: translate(25vw, -18px); }
  50% { transform: translate(50vw, 10px); }
  75% { transform: translate(75vw, -14px); }
  100% { transform: translate(calc(100vw + 90px), 0); }
}
@keyframes bird-flap { to { transform: scaleY(-.45); } }

/* ================= mascot "Ong Vàng" ================= */
.mascot { display: inline-block; width: 110px; aspect-ratio: 1; flex: none; line-height: 0; vertical-align: middle; }
.mascot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mascot .m-bob { transform-box: view-box; transform-origin: 60px 108px; animation: m-bob 3s ease-in-out infinite; }
.mascot .m-wing { transform-box: view-box; }
.mascot .m-wl { transform-origin: 44px 42px; animation: m-flap-l .42s ease-in-out infinite alternate; }
.mascot .m-wr { transform-origin: 76px 42px; animation: m-flap-r .42s ease-in-out infinite alternate; }
.mascot .m-eyes { transform-box: view-box; transform-origin: 60px 57px; animation: m-blink 4.6s infinite; }
.mascot .m-wave { transform-box: view-box; transform-origin: 92px 66px; animation: m-wave 3.4s ease-in-out infinite; }
.mascot .m-spark { transform-box: fill-box; transform-origin: center; animation: m-twinkle .9s ease-in-out infinite alternate; }
.mascot .m-q { animation: m-q 1.8s ease-in-out infinite; }
.mascot .m-tear { animation: m-tear 2.4s ease-in infinite; }
.mascot.m-cheer .m-bob { animation: m-hop .75s ease-in-out infinite; }
.mascot.m-sad .m-bob { animation-duration: 4.6s; }
.mascot.m-sad .m-wl, .mascot.m-sad .m-wr { animation-duration: .9s; }
.mascot.m-jump { animation: m-jump .55s cubic-bezier(.3, 1.6, .5, 1); }
.mascot-btn { padding: 0; border-radius: 50%; flex: none; line-height: 0; touch-action: manipulation; }
.mascot-btn:active .mascot { scale: .94; }
@keyframes m-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes m-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-9px) scale(.98, 1.03); } 80% { transform: translateY(0) scale(1.05, .95); } }
@keyframes m-flap-l { from { transform: rotate(8deg); } to { transform: rotate(-16deg); } }
@keyframes m-flap-r { from { transform: rotate(-8deg); } to { transform: rotate(16deg); } }
@keyframes m-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes m-wave { 0%, 45%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-20deg); } 20%, 38% { transform: rotate(8deg); } }
@keyframes m-twinkle { from { transform: scale(.6) rotate(0); opacity: .6; } to { transform: scale(1.15) rotate(20deg); opacity: 1; } }
@keyframes m-q { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes m-tear { 0%, 20% { transform: translateY(0); opacity: 0; } 35% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes m-jump { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-14px) scale(1.06); } 100% { transform: translateY(0) scale(1); } }

/* speech bubble */
.bubble {
  position: relative; background: #fff; border-radius: 22px; padding: 12px 16px; box-shadow: var(--shadow);
  font-weight: 700; line-height: 1.35; min-width: 0; border: 3px solid #fff2c2;
}
.bubble strong { display: block; font-size: 1.2rem; font-weight: 900; color: var(--brand-deep); margin-bottom: 2px; }
.bubble-left::before, .bubble-down::before {
  content: ''; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 4px;
  border: 3px solid #fff2c2; border-top-color: transparent; border-right-color: transparent;
}
.bubble-left::before { left: -11px; top: calc(50% - 9px); rotate: 45deg; }
.bubble-down::before { left: calc(50% - 9px); bottom: -11px; rotate: -45deg; }

/* ================= top bar ================= */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.topbar > :first-child { min-width: 0; }
.topbar-right, .title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-right { flex: none; }
.title-row > *, .game-title > * { min-width: 0; }
.title-row h2 { font-size: 1.3rem; text-shadow: 0 2px 0 rgba(255, 255, 255, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 48px; height: 48px; flex: none; border-radius: 16px; font-size: 1.35rem; display: grid; place-items: center;
  background: linear-gradient(180deg, #fff, #fff4d8); border: 2px solid #fff;
  box-shadow: 0 4px 0 #e5d3ad, 0 10px 16px -8px rgba(58, 46, 31, .35);
  transition: transform .1s, box-shadow .1s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #e5d3ad, 0 4px 8px -6px rgba(58, 46, 31, .35); }
.crumb { background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 8px 14px; font-weight: 900; box-shadow: var(--shadow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { background: var(--card); box-shadow: var(--shadow); border-radius: 999px; padding: 10px 14px; font-weight: 800; }
.star-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px 5px 6px; font-size: 1.15rem; font-weight: 900;
  background: linear-gradient(180deg, #fff, #fff6d6); border: 2px solid #ffe28a; min-height: 46px;
}
.star-pill .art-star { width: 32px; height: 32px; }
.star-pill .sp-num { min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
.star-pill.counting { border-color: var(--honey-deep); }
.star-pill.counting .art-star { animation: spin-star .6s linear infinite; }
.bump { animation: bump .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 0% { scale: 1; } 35% { scale: 1.25; } 100% { scale: 1; } }
@keyframes spin-star { to { rotate: 360deg; } }

.art-star { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.22em; line-height: 0; }
.art-star svg, .art-chest svg { display: block; width: 100%; height: 100%; overflow: visible; }
.art-chest { display: inline-block; line-height: 0; }

.profile-chip {
  display: flex; align-items: center; gap: 10px; background: var(--card); box-shadow: var(--shadow);
  border-radius: 999px; padding: 4px 16px 4px 4px; min-width: 0; border: 2px solid #fff;
}
.pc-text { min-width: 0; }
.profile-chip strong { display: block; font-size: 1.05rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-ring {
  --p: 0; flex: none; width: 56px; height: 56px; border-radius: 50%; padding: 4px; display: grid; place-items: center;
  background: conic-gradient(var(--honey-deep) calc(var(--p) * 1turn), #ffeab0 0);
}
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--honey); display: grid; place-items: center; font-size: 1.6rem; }
.avatar-ring .avatar { width: 100%; height: 100%; border: 3px solid #fff; background: radial-gradient(circle at 35% 30%, #fff7d1, var(--honey) 72%); font-size: 1.7rem; }

/* ================= buttons ================= */
.btn {
  --sh: #e2d1ac;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px;
  border-radius: 18px; padding: 12px 22px; font-weight: 900; font-size: 1.08rem; color: var(--ink);
  background: linear-gradient(180deg, #fff, #fff4d9); border: 3px solid #fff;
  box-shadow: 0 5px 0 var(--sh), 0 12px 18px -10px rgba(58, 46, 31, .45);
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.btn.primary {
  --sh: var(--brand-deep);
  background: linear-gradient(180deg, var(--brand-hi), var(--brand)); color: #fff;
  border-color: rgba(255, 255, 255, .45); text-shadow: 0 2px 0 rgba(0, 0, 0, .16);
}
.btn.ghost { background: linear-gradient(180deg, #fff, #fff8e8); }
.btn.small { padding: 8px 14px; font-size: .92rem; min-height: 40px; border-radius: 14px; }
.btn.big-btn { font-size: 1.3rem; min-height: 60px; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--sh), 0 4px 8px -6px rgba(58, 46, 31, .45); }
.btn:disabled { opacity: .5; cursor: default; }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.04); } }

/* ================= setup ================= */
.setup {
  max-width: 460px; width: 100%; margin: 2vh auto; display: flex; flex-direction: column; gap: 12px; align-items: stretch;
  text-align: center; padding: 20px; border-radius: 32px; border: 5px solid #ffe7a0; box-shadow: var(--shadow-lg);
  background: linear-gradient(180deg, #fffdf3, #fff);
}
.setup-hero { display: flex; align-items: center; gap: 14px; text-align: left; }
.setup-hero .mascot { width: 112px; }
.setup-hero .bubble { flex: 1; }
.brand-title { font-size: clamp(2.1rem, 9vw, 2.8rem); letter-spacing: .5px; text-shadow: 0 4px 0 rgba(58, 46, 31, .12); }
.brand-title span:nth-child(1) { color: var(--honey-deep); }
.brand-title span:nth-child(2) { color: var(--pink); }
.brand-title span:nth-child(3) { color: var(--brand); }
.logo.big { font-size: 4rem; }
.text-input {
  font: inherit; font-size: 1.1rem; font-weight: 700; width: 100%; padding: 13px 16px; border-radius: 16px;
  border: 3px solid #f0e2c2; background: #fffbf0; color: var(--ink); outline: none; user-select: text; -webkit-user-select: text;
  transition: border-color .15s, box-shadow .15s;
}
.text-input:focus { border-color: var(--honey-deep); box-shadow: 0 0 0 4px rgba(255, 201, 60, .35); }
select.text-input {
  appearance: none; -webkit-appearance: none; padding-right: 46px; cursor: pointer;
  background: #fffbf0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 7l6 6 6-6' fill='none' stroke='%23f59f00' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.label { margin: 4px 0 0; font-weight: 900; font-size: 1.05rem; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-opt {
  font-size: 1.8rem; aspect-ratio: 1; border-radius: 16px; background: #fff6df; border: 3px solid transparent;
  box-shadow: 0 4px 0 #ecdcb9; transition: transform .12s, box-shadow .12s, scale .15s; display: grid; place-items: center;
}
.avatar-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 #ecdcb9; }
.avatar-opt.on { background: radial-gradient(circle at 50% 35%, #fff3bf, var(--honey)); border-color: var(--honey-deep); box-shadow: 0 4px 0 #d08a00; scale: 1.06; }

/* ================= home ================= */
.home-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hero { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hero .mascot { width: 112px; }
.hero .bubble { flex: 1; }

.missions { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; border: 3px solid #fff; background: linear-gradient(180deg, #fff, #fffaf0); }
.missions-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mh-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mh-title strong { font-size: 1.2rem; font-weight: 900; }
.mh-title span { color: var(--muted); font-weight: 700; font-size: .88rem; }
.missions ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.missions li.done { color: var(--good); }

.meter { --p: 0; height: 16px; border-radius: 999px; background: #f1e7d2; box-shadow: inset 0 2px 3px rgba(58, 46, 31, .16); overflow: hidden; }
.meter > i {
  display: block; height: 100%; width: calc(var(--p) * 100%); border-radius: inherit;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .28) 0 8px, transparent 8px 16px), linear-gradient(180deg, #ffe066, var(--honey-deep));
  background-size: 22.6px 22.6px, 100% 100%;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08), inset 0 3px 0 rgba(255, 255, 255, .45);
  animation: meter-grow 1s cubic-bezier(.2, .9, .3, 1.1) both, meter-slide 1.2s linear infinite;
}
@keyframes meter-grow { from { width: 0; } }
@keyframes meter-slide { to { background-position: 22.6px 0, 0 0; } }

.mission-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mission-chip {
  display: flex; align-items: center; gap: 10px; min-width: 0; background: #fff7e3; border: 2px solid #ffe6a6;
  border-radius: 18px; padding: 8px 10px; font-weight: 800;
}
.mission-chip .mc-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 1.15rem; box-shadow: 0 2px 0 rgba(58, 46, 31, .12); flex: none; }
.mission-chip .mc-text { flex: 1; min-width: 0; font-size: .93rem; line-height: 1.2; }
.mission-chip .mc-prog { flex: none; font-size: .82rem; font-weight: 900; color: var(--muted); background: #fff; border-radius: 999px; padding: 2px 8px; }
.mission-chip.done { background: #e7f9ea; border-color: #a5e3b0; }
.mission-chip.done .mc-ic { background: var(--good); color: #fff; font-weight: 900; }
.mission-chip.done .mc-prog { color: var(--good); }

.chest-btn {
  flex: none; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px 8px;
  border-radius: 18px; background: #fff4da; border: 2px solid #ffe6a6; font-weight: 900; font-size: .85rem;
  box-shadow: 0 4px 0 #ecd7a8; transition: transform .1s, box-shadow .1s;
}
.chest-btn .art-chest { width: 58px; height: 51px; }
.chest-btn.locked .art-chest { filter: saturate(.55) opacity(.8); }
.chest-btn.locked { color: var(--muted); cursor: default; }
.chest-btn.ready {
  background: linear-gradient(180deg, #fff3bf, #ffd45c); border-color: #fff; color: #7a3e0e;
  box-shadow: 0 4px 0 #d99500, 0 0 0 4px rgba(255, 201, 60, .35), 0 10px 22px -6px rgba(245, 159, 0, .7);
  animation: chest-glow 1.6s ease-in-out infinite;
}
.chest-btn.ready .art-chest { transform-origin: 50% 90%; animation: wiggle 1.3s ease-in-out infinite; }
.chest-btn.ready:active { transform: translateY(3px); box-shadow: 0 1px 0 #d99500; }
.chest-btn.claimed { background: #e7f9ea; border-color: #a5e3b0; color: var(--good); cursor: default; }
.chest-btn.opening .art-chest { animation: chest-open .7s cubic-bezier(.3, 1.6, .5, 1); }
.chest-btn:disabled { cursor: default; }
@keyframes wiggle { 0%, 55%, 100% { transform: rotate(0); } 62% { transform: rotate(-9deg) scale(1.05); } 70% { transform: rotate(8deg) scale(1.08); } 78% { transform: rotate(-6deg); } 86% { transform: rotate(4deg); } }
@keyframes chest-glow { 50% { box-shadow: 0 4px 0 #d99500, 0 0 0 8px rgba(255, 201, 60, .25), 0 10px 26px -4px rgba(245, 159, 0, .8); } }
@keyframes chest-open { 0% { transform: scale(.7); } 60% { transform: scale(1.2) translateY(-4px); } 100% { transform: scale(1); } }

.section-title { font-size: 1.3rem; padding: 2px 4px; text-shadow: 0 2px 0 rgba(255, 255, 255, .85); }

.subject-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.subject-card {
  --c: var(--brand);
  position: relative; overflow: hidden; isolation: isolate;
  flex: 0 0 calc((100% - 14px) / 2); min-width: 0; min-height: 210px; padding: 18px 12px 14px;
  border-radius: 28px; color: #fff; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 48%, color-mix(in srgb, var(--c) 80%, #000) 100%);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 55%, #000), 0 18px 28px -10px color-mix(in srgb, var(--c) 60%, #000), inset 0 3px 0 rgba(255, 255, 255, .35);
  animation: card-float 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.15s);
  transition: transform .12s, box-shadow .12s, filter .15s;
}
.subject-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--pat, none);
  -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 85%); mask-image: linear-gradient(180deg, #000 10%, transparent 85%);
}
.subject-card::after {
  content: ''; position: absolute; z-index: -1; width: 150px; height: 150px; right: -52px; bottom: -58px;
  border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%; background: rgba(255, 255, 255, .16);
}
.subject-card.pat-0 { --pat: radial-gradient(circle, rgba(255, 255, 255, .3) 2.5px, transparent 3px) 0 0 / 18px 18px; }
.subject-card.pat-1 { --pat: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .16) 0 7px, transparent 7px 18px); }
.subject-card.pat-2 { --pat: radial-gradient(circle, transparent 5px, rgba(255, 255, 255, .24) 5.5px 7.5px, transparent 8px) 0 0 / 26px 26px; }
.subject-card.pat-3 { --pat: linear-gradient(90deg, rgba(255, 255, 255, .17) 2px, transparent 2px) 0 0 / 20px 20px, linear-gradient(0deg, rgba(255, 255, 255, .17) 2px, transparent 2px) 0 0 / 20px 20px; }
.subject-card.pat-4 { --pat: conic-gradient(from 45deg, rgba(255, 255, 255, .17) 25%, transparent 0 50%, rgba(255, 255, 255, .17) 0 75%, transparent 0) 0 0 / 22px 22px; }
.sc-blob { position: absolute; z-index: -1; border-radius: 50%; background: color-mix(in srgb, var(--c) 45%, #fff); opacity: .35; pointer-events: none; }
.sc-blob.b1 { width: 76px; height: 76px; left: -24px; top: -22px; }
.sc-blob.b2 { width: 22px; height: 22px; left: 14%; bottom: 20%; opacity: .45; }
.sc-blob.b3 { width: 14px; height: 14px; right: 16%; top: 14%; opacity: .55; }
.subject-icon {
  position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 3.2rem; line-height: 1;
  background: radial-gradient(circle at 50% 38%, #fff 0%, #fff 48%, color-mix(in srgb, var(--c) 26%, #fff) 100%);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 60%, #000), inset 0 -6px 0 color-mix(in srgb, var(--c) 20%, transparent), 0 0 0 5px rgba(255, 255, 255, .35);
  transition: rotate .2s, scale .2s;
}
.subject-icon::after {
  content: ''; position: absolute; left: 17%; top: 8%; width: 44%; height: 26%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0)); rotate: -22deg; pointer-events: none;
}
.subject-name { font-size: 1.45rem; font-weight: 900; line-height: 1.15; margin-top: 4px; text-shadow: 0 2px 0 color-mix(in srgb, var(--c) 55%, #000); }
.subject-desc, .game-desc { font-size: .9rem; opacity: .95; }
.subject-desc { font-weight: 700; line-height: 1.25; text-shadow: 0 1px 0 rgba(0, 0, 0, .18); }
.sc-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }
.sc-chip {
  background: rgba(255, 255, 255, .93); color: color-mix(in srgb, var(--c) 55%, #000); border-radius: 999px;
  padding: 3px 10px; font-weight: 900; font-size: .8rem; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); white-space: nowrap;
}
.subject-card:active { transform: translateY(5px) scale(.98); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 55%, #000), 0 6px 12px -8px color-mix(in srgb, var(--c) 60%, #000), inset 0 3px 0 rgba(255, 255, 255, .35); }
@media (hover: hover) {
  .subject-card:hover { filter: brightness(1.05); }
  .subject-card:hover .subject-icon { rotate: -8deg; scale: 1.06; }
}
@keyframes card-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

.side-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.side-card {
  --c: #cc5de8;
  display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; padding: 12px 14px;
  background: var(--card); border-radius: var(--radius); font-weight: 900; font-size: 1.05rem;
  border: 3px solid color-mix(in srgb, var(--c) 22%, #fff);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 35%, #e6d6b6), 0 12px 20px -10px rgba(58, 46, 31, .35);
  transition: transform .1s, box-shadow .1s;
}
.side-card:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 35%, #e6d6b6); }
.side-card .sd-ic {
  flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem;
  background: color-mix(in srgb, var(--c) 18%, #fff); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--c) 18%, transparent);
}
.side-card .sd-txt { min-width: 0; }
.side-card small { display: block; color: var(--muted); font-weight: 700; font-size: .82rem; line-height: 1.25; }

/* ================= subject screen ================= */
.subject-banner {
  --c: var(--brand);
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 28px; color: #fff; min-width: 0;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 82%, #000));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 55%, #000), 0 18px 28px -12px color-mix(in srgb, var(--c) 70%, #000), inset 0 3px 0 rgba(255, 255, 255, .3);
}
.subject-banner::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle, rgba(255, 255, 255, .25) 2.5px, transparent 3px) 0 0 / 20px 20px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.subject-banner::after { content: ''; position: absolute; z-index: -1; width: 180px; height: 180px; left: -60px; bottom: -110px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.sb-icon {
  position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; line-height: 1;
  background: radial-gradient(circle at 50% 38%, #fff 50%, color-mix(in srgb, var(--c) 26%, #fff));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 60%, #000), 0 0 0 5px rgba(255, 255, 255, .3);
}
.sb-text { flex: 1; min-width: 0; }
.sb-text h2 { font-size: clamp(1.45rem, 5vw, 2.2rem); text-shadow: 0 3px 0 color-mix(in srgb, var(--c) 55%, #000); overflow-wrap: anywhere; }
.sb-text p { margin: 2px 0 8px; font-weight: 700; opacity: .96; text-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.sb-stars {
  display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .94); color: var(--ink);
  border-radius: 999px; padding: 4px 12px 4px 6px; font-weight: 900; box-shadow: 0 2px 0 rgba(0, 0, 0, .14);
}
.sb-stars .art-star { width: 24px; height: 24px; }
.subject-banner .mascot { width: 100px; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.game-card {
  --c: var(--brand);
  position: relative; overflow: hidden; isolation: isolate; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 16px 12px 14px; border-radius: 24px; color: var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, #fff), color-mix(in srgb, var(--c) 21%, #fff));
  border: 3px solid color-mix(in srgb, var(--c) 28%, #fff);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 40%, #d9cbb0), 0 14px 22px -12px rgba(58, 46, 31, .4);
  transition: transform .12s, box-shadow .12s;
}
.game-card::before { content: ''; position: absolute; z-index: -1; width: 120px; height: 120px; right: -44px; top: -46px; border-radius: 50%; background: color-mix(in srgb, var(--c) 16%, transparent); }
.game-card::after { content: ''; position: absolute; z-index: -1; width: 60px; height: 60px; left: -22px; bottom: 30%; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.game-card:active { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 40%, #d9cbb0), 0 4px 10px -8px rgba(58, 46, 31, .4); }
@media (hover: hover) { .game-card:hover .game-icon { rotate: 6deg; scale: 1.06; } }
.game-icon {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 2.5rem; line-height: 1; margin-bottom: 4px;
  background: radial-gradient(circle at 50% 36%, #fff 45%, color-mix(in srgb, var(--c) 22%, #fff));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 45%, #cbb994), 0 0 0 4px #fff;
  transition: rotate .2s, scale .2s;
}
.game-name { font-weight: 900; font-size: 1.12rem; line-height: 1.2; }
.game-card .game-desc { font-size: .85rem; color: var(--muted); font-weight: 700; line-height: 1.25; opacity: 1; }
.game-stars { display: flex; gap: 2px; margin-top: auto; padding-top: 4px; font-size: 1.4rem; line-height: 1; color: #e3d8c3; letter-spacing: 0; }
.game-stars span { color: #e3d8c3; text-shadow: 0 2px 0 rgba(58, 46, 31, .12); }
.game-stars span.on { color: var(--honey); text-shadow: 0 2px 0 var(--honey-deep); }
.gc-ribbon {
  position: absolute; top: 13px; right: -34px; width: 122px; rotate: 45deg; text-align: center; z-index: 2;
  background: linear-gradient(180deg, #ff7eab, #f0447f); color: #fff; font-weight: 900; font-size: .78rem;
  letter-spacing: 1px; text-transform: uppercase; padding: 4px 0; box-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}

/* ================= game screen ================= */
.game-bar { flex-wrap: nowrap; }
.game-title {
  --c: var(--brand);
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 16px 4px 4px; border-radius: 999px;
  background: #fff; box-shadow: var(--shadow); border: 3px solid color-mix(in srgb, var(--c) 30%, #fff);
}
.game-title .gt-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; background: color-mix(in srgb, var(--c) 20%, #fff); }
.game-title h2 { font-size: 1.15rem; text-shadow: none; }
.stage {
  --c: var(--brand);
  flex: 1; position: relative; overflow: hidden; min-height: 60vh; display: flex; flex-direction: column; padding: 16px;
  border-radius: 30px; border: 6px solid var(--c);
  background: radial-gradient(130% 80% at 50% 0%, #fff 55%, color-mix(in srgb, var(--c) 9%, #fff) 100%);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 60%, #000), 0 22px 36px -14px rgba(58, 46, 31, .4), inset 0 0 0 4px rgba(255, 255, 255, .8);
}

/* ================= reusable game building blocks ================= */
.g-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; flex: 1; justify-content: center; text-align: center; }
.g-progress { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.g-progress i {
  width: 16px; height: 16px; border-radius: 50%; background: #ece2cf;
  box-shadow: inset 0 2px 2px rgba(58, 46, 31, .2); transition: background .2s, scale .2s;
}
.g-progress i.ok { background: var(--good); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.g-progress i.no { background: var(--bad); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.g-progress i.now { background: var(--c); scale: 1.2; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent); animation: dot-pulse 1.3s ease-in-out infinite; }
@keyframes dot-pulse { 50% { scale: 1.38; } }
.g-prompt { font-size: clamp(1.3rem, 4.6vw, 1.6rem); font-weight: 900; line-height: 1.3; text-wrap: balance; }
.g-big {
  font-size: clamp(4rem, 14vw, 8rem); font-weight: 900; line-height: 1; color: var(--c);
  text-shadow: 0 5px 0 color-mix(in srgb, var(--c) 45%, #3a2e1f), 0 12px 18px rgba(58, 46, 31, .18);
}
.g-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; width: 100%; max-width: 640px; }
.g-btn {
  position: relative; color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border: 3px solid color-mix(in srgb, var(--c) 24%, #efe3cb); border-radius: 22px;
  padding: 14px 10px; font-size: 2rem; font-weight: 900; min-height: 84px;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 32%, #dccdb0), 0 14px 18px -12px rgba(58, 46, 31, .45);
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-direction: column;
  transition: transform .1s, box-shadow .1s, border-color .15s, background-color .2s;
  touch-action: manipulation;
}
.g-btn small { font-size: .95rem; font-weight: 800; color: var(--muted); }
.g-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 32%, #dccdb0), 0 4px 8px -6px rgba(58, 46, 31, .45); }
@media (hover: hover) { .g-btn:hover { border-color: color-mix(in srgb, var(--c) 55%, #fff); } }
.g-btn.ok { background: linear-gradient(180deg, #63d474, var(--good)); border-color: #2f9e44; color: #fff; box-shadow: 0 6px 0 #2b8a3e, 0 0 0 5px rgba(55, 178, 77, .25); text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.g-btn.no { background: linear-gradient(180deg, #ff7d7d, var(--bad)); border-color: #c92a2a; color: #fff; box-shadow: 0 6px 0 #c92a2a, 0 0 0 5px rgba(240, 62, 62, .2); text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.g-btn.ok small, .g-btn.no small { color: rgba(255, 255, 255, .92); }
.g-speak {
  position: relative; flex-shrink: 0; font-size: 1.6rem; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; border: 4px solid #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 70%);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 55%, #000), 0 12px 18px -8px rgba(0, 0, 0, .35);
  transition: transform .1s, box-shadow .1s;
}
.g-speak::after {
  content: ''; position: absolute; inset: -9px; border-radius: 50%; pointer-events: none;
  border: 3px solid color-mix(in srgb, var(--c) 55%, transparent); animation: ping 2.4s ease-out infinite;
}
.g-speak:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 55%, #000); }
@keyframes ping { 0% { scale: .85; opacity: .9; } 70%, 100% { scale: 1.25; opacity: 0; } }
.g-field {
  position: relative; flex: 1; width: 100%; min-height: 50vh; border-radius: 22px; overflow: hidden; touch-action: none;
  background: radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .7) 0 8%, transparent 26%), linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, var(--bg)), color-mix(in srgb, var(--c) 20%, var(--bg)));
  box-shadow: inset 0 4px 10px rgba(58, 46, 31, .12), inset 0 0 0 3px color-mix(in srgb, var(--c) 24%, transparent);
}
.g-sprite { position: absolute; font-size: 2.6rem; line-height: 1; transform: translate(-50%, -50%); }
.g-hud { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 900; width: 100%; }
.g-hud > :where(span, div) {
  background: #fff; border-radius: 999px; padding: 6px 14px; min-height: 2.2em;
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid color-mix(in srgb, var(--c) 22%, #fff); box-shadow: 0 3px 0 rgba(58, 46, 31, .12);
}

/* ================= feedback animations =================
 * Use individual transform properties so they combine with an element's own transform
 * (e.g. .g-sprite's translate(-50%, -50%) or a drag offset). */
.shake { animation: shake .45s; }
.pop { animation: pop .35s; }
.glow { animation: glow .6s; }
@keyframes shake { 0%, 100% { translate: 0 0; } 20% { translate: -9px 0; } 40% { translate: 8px 0; } 60% { translate: -6px 0; } 80% { translate: 4px 0; } }
@keyframes pop { 0% { scale: .8; } 60% { scale: 1.1; } 100% { scale: 1; } }
@keyframes glow { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--honey) 70%, transparent), 0 0 26px 8px color-mix(in srgb, var(--honey) 55%, transparent); } }
@keyframes fade-in { from { opacity: 0; } }

/* ================= overlays ================= */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; padding: 16px; overflow-y: auto;
  background: radial-gradient(circle at 50% 40%, rgba(255, 236, 180, .3), rgba(30, 24, 16, .55));
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in .25s;
}
.overlay > * { margin: auto; }
.overlay.result-layer { padding-top: 76px; }
.result, .settings { width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.result {
  --c: var(--brand);
  position: relative; padding: 18px 18px 20px; border-radius: 32px; border: 5px solid #ffe28a;
  background: radial-gradient(120% 70% at 50% 0%, #fffbe6, #fff 60%); box-shadow: var(--shadow-lg);
  animation: result-in .55s cubic-bezier(.2, 1.4, .4, 1) both;
}
.result h2 { font-size: 2rem; color: var(--brand-deep); text-shadow: 0 3px 0 rgba(20, 163, 139, .15); }
.result-mascot { margin: -78px auto -4px; line-height: 0; }
.result-mascot .mascot { width: 124px; }
.result-stars { font-size: 3.6rem; display: flex; justify-content: center; align-items: flex-end; gap: 6px; color: rgba(138, 122, 102, .3); }
.result-stars .on { color: var(--honey); }
.result-stars .rs { position: relative; width: 74px; height: 74px; display: block; }
.result-stars .rs:nth-child(2) { width: 90px; height: 90px; translate: 0 -10px; }
.result-stars .rs .art-star { width: 100%; height: 100%; }
.result-stars .rs.on .art-star { animation: star-fly .65s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: var(--d, 0s); }
.result-stars .rs.off .art-star { animation: fade-in .4s both; }
.result-stars .spark {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; opacity: 0;
  box-shadow: 0 -38px 0 #ffd43b, 27px -27px 0 #ff8fb8, 38px 0 0 #74c0fc, 27px 27px 0 #ffd43b, 0 38px 0 #8ce99a, -27px 27px 0 #ff8fb8, -38px 0 0 #74c0fc, -27px -27px 0 #ffd43b;
  animation: spark .7s ease-out both; animation-delay: calc(var(--d, 0s) + .35s);
}
.result-gain { margin: 0; display: inline-flex; align-self: center; align-items: center; gap: 4px; font-size: 1.7rem; font-weight: 900; color: var(--honey-deep); background: #fff6d6; border-radius: 999px; padding: 4px 18px; border: 2px solid #ffe28a; }
.result-gain b { font-variant-numeric: tabular-nums; min-width: .7em; }
.result-gain .art-star { width: 30px; height: 30px; }
.result .row .btn { flex: 1 1 130px; }
@keyframes result-in { from { opacity: 0; transform: translateY(30px) scale(.85); } }
@keyframes star-fly {
  0% { opacity: 0; transform: translateY(90px) scale(.1) rotate(-200deg); }
  65% { opacity: 1; transform: translateY(-8px) scale(1.25) rotate(12deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes spark { 0% { opacity: 1; scale: .3; } 100% { opacity: 0; scale: 1.5; } }

.sticker-reveal { display: flex; flex-direction: column; align-items: center; gap: 6px; perspective: 800px; }
.sr-card { position: relative; width: 112px; height: 132px; padding: 0; transform-style: preserve-3d; animation: sr-flip .9s ease-in-out both; animation-delay: var(--d, 2s); }
.sr-card.now { animation: none; transform: rotateY(180deg); transition: transform .5s; }
.sr-face {
  position: absolute; inset: 0; border-radius: 22px; display: grid; place-items: center;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: 0 5px 0 rgba(58, 46, 31, .15);
}
.sr-back {
  color: #fff; font-size: 3.2rem; font-weight: 900; border: 4px solid #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .15);
  background: radial-gradient(circle, rgba(255, 255, 255, .3) 3px, transparent 3.5px) 0 0 / 18px 18px, linear-gradient(160deg, #ff9fc4, #cc5de8);
}
.sr-front { transform: rotateY(180deg); background: #fff; border: 4px dashed var(--honey); font-size: 4rem; line-height: 1; }
.sticker-new { margin: 0; font-weight: 900; font-size: 1.15rem; color: #c2255c; animation: fade-in .4s both; animation-delay: var(--d, 0s); }
@keyframes sr-flip { 0% { transform: rotateY(0) scale(.9); } 55% { transform: rotateY(200deg) scale(1.12); } 100% { transform: rotateY(180deg) scale(1); } }
.big-emoji { font-size: 2.4rem; vertical-align: middle; }

.settings { padding: 20px; border-radius: 30px; gap: 10px; border: 5px solid #fff2c2; animation: result-in .4s cubic-bezier(.2, 1.4, .4, 1) both; }
.settings h2 { font-size: 1.6rem; margin-bottom: 4px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 900; padding: 10px 14px; background: #fff8e6; border-radius: 18px; text-align: left; cursor: pointer; }
.set-label { min-width: 0; }
.set-label small { display: block; font-weight: 700; font-size: .8rem; color: var(--muted); }
.setting input {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0; cursor: pointer;
  width: 58px; height: 34px; border-radius: 999px; background: #e2d6bf; box-shadow: inset 0 2px 4px rgba(58, 46, 31, .22);
  transition: background .2s; accent-color: var(--brand);
}
.setting input::before {
  content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .25); transition: translate .22s cubic-bezier(.3, 1.4, .5, 1);
}
.setting input:checked { background: var(--brand); }
.setting input:checked::before { translate: 24px 0; }

/* ================= sticker book ================= */
.album {
  position: relative; border-radius: 28px; padding: 26px 16px 18px; margin-top: 8px;
  background: var(--paper); border: 4px solid #f3e3bd; box-shadow: var(--shadow-lg);
  background-image: linear-gradient(rgba(77, 171, 247, .1) 1.5px, transparent 1.5px); background-size: 100% 30px;
}
.album::before {
  content: ''; position: absolute; top: -14px; left: 28px; right: 28px; height: 26px;
  background: radial-gradient(circle at 13px 13px, #fff 0 5px, #d9c79f 5.5px 9px, transparent 9.5px) 0 0 / 52px 26px repeat-x;
}
.album-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.album-head .mascot { width: 92px; }
.album-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.album-info h3 { font-size: 1.25rem; }
.next-bar { height: 18px; }
.next-label { font-weight: 900; font-size: .9rem; color: var(--honey-deep); }
.next-label .art-star { width: 20px; height: 20px; }
.album-hint { margin: 0; color: var(--muted); font-weight: 700; }
.album-page { background: rgba(255, 255, 255, .7); border-radius: 22px; padding: 14px; border: 2px dashed #efdcb2; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.sticker {
  position: relative; aspect-ratio: 1; border-radius: 20px; display: grid; place-items: center; font-size: 2.7rem; line-height: 1;
  background: #fff8e6; border: 3px dashed #e8d6ae; padding: 0;
}
.sticker.on { background: #fff; border: 3px solid #fff; box-shadow: 0 4px 0 #eadbb9, 0 10px 16px -10px rgba(58, 46, 31, .35); }
.sticker.on .st-em {
  display: block; rotate: var(--r, 0deg); transition: scale .15s;
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 3px 3px rgba(58, 46, 31, .3));
}
.sticker.on:active .st-em { scale: 1.15; }
.sticker.locked .st-q { font-size: 1.9rem; font-weight: 900; color: #dcc69a; }
.sticker.next { border-color: var(--honey-deep); background: #fff3cf; animation: next-pulse 1.8s ease-in-out infinite; }
.sticker.next .st-sil { filter: brightness(0); opacity: .16; }
.sticker.next .st-lock { position: absolute; right: -6px; bottom: -6px; font-size: 1.1rem; background: #fff; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; box-shadow: var(--shadow); }
@keyframes next-pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 201, 60, .3); } }

/* ================= toast & confetti ================= */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 70; translate: -50% 0;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 10px 18px;
  background: #fff; border-radius: 999px; border: 3px solid #ffe28a; font-weight: 900; box-shadow: var(--shadow-lg);
  animation: toast-in .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.toast.out { animation: toast-out .4s forwards; }
.toast-em { font-size: 2rem; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(40px) scale(.8); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(30px); } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
.confetti i:nth-child(3n) { border-radius: 50%; width: 10px; height: 10px; }
.confetti i:nth-child(4n) { width: 7px; height: 18px; }
@keyframes fall { to { top: 105%; transform: rotate(720deg); } }

/* ================= responsive ================= */
@media (min-width: 700px) {
  .subject-card { flex-basis: calc((100% - 28px) / 3); }
}
@media (min-width: 900px) {
  .home-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; }
  .hero .mascot { width: 130px; }
}
@media (min-width: 1040px) {
  .subject-card { flex-basis: calc((100% - 56px) / 5); }
}
@media (max-width: 760px) {
  .mission-chips { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 600px) {
  .screen { padding: max(10px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom)); gap: 14px; }
  .subject-card { min-height: 178px; padding: 14px 8px 12px; border-radius: 24px; }
  .subject-icon { width: 70px; height: 70px; font-size: 2.3rem; }
  .subject-name { font-size: 1.2rem; }
  .subject-desc { font-size: .8rem; }
  .sc-chip { font-size: .72rem; padding: 2px 8px; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .game-icon { width: 64px; height: 64px; font-size: 2.1rem; }
  .game-name { font-size: 1rem; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .profile-chip { padding-right: 12px; gap: 8px; }
  .avatar-ring { width: 50px; height: 50px; }
  .hero .mascot { width: 92px; }
  .bubble strong { font-size: 1.08rem; }
  .bubble { padding: 10px 13px; font-size: .95rem; }
  .side-row { gap: 12px; }
  .side-card { padding: 10px; gap: 8px; font-size: .98rem; }
  .side-card .sd-ic { width: 42px; height: 42px; font-size: 1.4rem; border-radius: 13px; }
  .subject-banner { padding: 12px; gap: 10px; border-radius: 24px; }
  .sb-icon { width: 54px; height: 54px; font-size: 1.8rem; }
  .subject-banner .mascot { width: 76px; }
  .stage { border-width: 4px; padding: 10px; border-radius: 24px; }
  .setup { padding: 16px; }
  .setup-hero .mascot { width: 92px; }
  .album { padding: 24px 12px 14px; }
  .album-page { padding: 10px; }
  .album-head .mascot { width: 76px; }
  .result h2 { font-size: 1.7rem; }
  .result-stars .rs { width: 64px; height: 64px; }
  .result-stars .rs:nth-child(2) { width: 78px; height: 78px; }
}
@media (max-width: 400px) {
  .icon-btn { width: 42px; height: 42px; border-radius: 14px; font-size: 1.15rem; }
  .topbar-right { gap: 6px; }
  .star-pill { min-height: 42px; font-size: 1.05rem; padding-right: 10px; }
  .star-pill .art-star { width: 28px; height: 28px; }
  .chest-btn { min-width: 80px; padding: 5px 6px 7px; }
  .chest-btn .art-chest { width: 50px; height: 44px; }
  .mh-title strong { font-size: 1.08rem; }
  .title-row h2 { font-size: 1.12rem; }
  .game-title h2 { font-size: 1rem; }
  .game-title .gt-ic { width: 34px; height: 34px; font-size: 1.15rem; }
}
@media (max-width: 360px) {
  .fs-btn { display: none; }
}

/* ================= reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  .bg-scene *, .mascot, .mascot *, .subject-card, .chest-btn, .chest-btn .art-chest, .g-speak::after,
  .g-progress i.now, .meter > i, .sticker.next, .star-pill .art-star {
    animation: none !important;
  }
  .bg-bird { display: none; }
  .meter > i { transition: none; }
}

/* game card badge for voice / camera games */
.gc-tag {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: #fff; color: var(--ink); font-size: .72rem; font-weight: 900;
  padding: 3px 8px; border-radius: 999px; box-shadow: 0 2px 0 rgba(0,0,0,.15);
}

/* voice chooser in settings */
.setting.voice-setting { flex-direction: column; align-items: stretch; gap: 6px; }
.voice-row { display: flex; gap: 8px; align-items: center; }
.voice-select { flex: 1; min-width: 0; font-size: .95rem; padding: 8px 10px; }
.voice-hint { margin: 0; line-height: 1.35; text-align: left; }
.settings { max-height: calc(100vh - 32px); overflow-y: auto; }
