/* Deusama Learning - styles */
:root {
  --ink: #3b2b5a;
  --ink-soft: #6f6390;
  --purple: #8f7bff;
  --purple-d: #6a55e0;
  --pink: #ff7eb6;
  --pink-d: #e0579a;
  --mint: #5fd4a8;
  --mint-d: #36ad82;
  --sunny: #ffd166;
  --sky: #8fd0ff;
  --card: #ffffff;
  --radius: 26px;
  --shadow: 0 10px 30px rgba(90, 60, 160, .16);
  font-family: 'Fredoka', 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: linear-gradient(180deg, #bfe6ff 0%, #e6dcff 55%, #ffe3f1 100%) fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
p { margin: .3em 0 .8em; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
[hidden] { display: none !important; }
.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; }
.ico.flip { transform: scaleX(-1); }

/* ---------- sky + clouds ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.cloud { position: absolute; width: 180px; height: 60px; background: #fff; border-radius: 60px; opacity: .7; animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; left: 25px; top: -40px; }
.cloud::after { width: 60px; height: 60px; left: 90px; top: -28px; }
.c1 { top: 8%; left: -200px; }
.c2 { top: 30%; left: -200px; animation-delay: -25s; transform: scale(.7); animation-duration: 80s; }
.c3 { top: 70%; left: -200px; animation-delay: -45s; transform: scale(.85); animation-duration: 70s; }
@keyframes drift { to { left: 110%; } }

/* ---------- layout ---------- */
#app { max-width: 1180px; margin: 0 auto; padding: 14px clamp(10px, 2.5vw, 26px) 40px; }
.has-demo #app { padding-top: 44px; }
.demo-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; text-align: center;
  background: repeating-linear-gradient(135deg, #ffd166 0 18px, #ffc84a 18px 36px);
  color: #5a3d00; font-weight: 600; font-size: .9rem; padding: 6px 10px; letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; font-weight: 600; color: inherit; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 2.4vw, 26px); margin-bottom: 18px; }
.center-card { max-width: 720px; margin: 20px auto; text-align: center; }
.big-title { text-align: center; margin: 12px 0 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 0; border-radius: 18px; padding: .7em 1.2em; font-weight: 600; font-size: 1.05rem;
  background: #efeaff; color: var(--ink); box-shadow: 0 5px 0 #d6ccf7; transition: transform .08s, box-shadow .08s, filter .15s;
  min-height: 48px; text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #d6ccf7; }
.btn:hover:not(:disabled) { filter: brightness(1.04); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-go { background: linear-gradient(180deg, #a08fff, var(--purple)); color: #fff; box-shadow: 0 5px 0 var(--purple-d); }
.btn-go:active:not(:disabled) { box-shadow: 0 1px 0 var(--purple-d); }
.btn-soft { background: #fff; box-shadow: 0 5px 0 #ddd3fa, 0 0 0 2px #ebe5ff inset; }
.btn-danger { background: #fff0f3; color: #c2335d; box-shadow: 0 5px 0 #f5c2d0; }
.btn-wide { width: 100%; }
.btn-big { font-size: 1.3rem; padding: .8em 1.4em; }
.btn-icon { width: 48px; padding: 0; background: #fff; box-shadow: 0 4px 0 #ddd3fa; }
.btn:focus-visible, .tab:focus-visible, .area:focus-visible, .key:focus-visible { outline: 4px solid #ffd166; outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; min-height: 56px; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; flex: 1; }
.tb-right { justify-content: flex-end; flex-wrap: wrap; }
.tb-title { font-weight: 700; font-size: 1.3rem; text-align: center; white-space: nowrap; }
.brand { font-weight: 700; font-size: 1.6rem; background: linear-gradient(90deg, #ff7eb6, #8f7bff, #4fb6f0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 1.1rem; box-shadow: 0 3px 0 #ddd3fa; }
.btn-player { padding: 4px 14px 4px 4px; min-height: 48px; background: #fff; box-shadow: 0 4px 0 #ddd3fa; border-radius: 999px; }
.btn-player .mini { width: 40px; height: 40px; border-radius: 50%; background: #f1ecff; display: grid; place-items: center; overflow: hidden; }
.btn-player .mini svg { width: 40px; height: 40px; }

/* ---------- welcome ---------- */
.welcome { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; align-items: center; min-height: 80vh; }
.hero { text-align: center; }
.hero-pets { display: flex; justify-content: center; align-items: flex-end; gap: 0; }
.hero-pets svg { width: min(30%, 190px); height: auto; }
.logo { font-size: clamp(3rem, 8vw, 5rem); margin: 10px 0 0; background: linear-gradient(90deg, #ff7eb6, #8f7bff 55%, #4fb6f0); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(255,255,255,.9)); }
.tagline { font-size: 1.35rem; font-weight: 500; color: var(--ink-soft); }
.auth-card { max-width: 460px; width: 100%; justify-self: center; }
.tabs { display: flex; gap: 6px; background: #f3efff; border-radius: 18px; padding: 5px; margin-bottom: 16px; }
.tab { flex: 1; border: 0; background: none; padding: 10px; border-radius: 14px; font-weight: 600; color: var(--ink-soft); min-height: 44px; }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(90,60,160,.12); }
.form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.form.narrow { max-width: 380px; margin: 0 auto; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
.form label small { font-weight: 400; color: var(--ink-soft); }
.form input, .inline-form input {
  border: 3px solid #e3dcfb; border-radius: 16px; padding: 12px 14px; font-size: 1.1rem; background: #fcfbff; outline: none; min-height: 50px;
}
.form input:focus { border-color: var(--purple); background: #fff; }
.form-msg { min-height: 1.2em; margin: 0; font-weight: 500; }
.form-msg.err { color: #c2335d; }
.form-msg.ok { color: var(--mint-d); }
.demo-try { margin-top: 18px; padding-top: 16px; border-top: 2px dashed #ebe5ff; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: center; text-align: center; }
.invite-row { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.code-input { font-size: 1.4rem !important; letter-spacing: .12em; text-transform: uppercase; text-align: center; font-weight: 600; }
.demo-try small { width: 100%; color: var(--ink-soft); }

/* ---------- profiles ---------- */
.profile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.profile-card {
  width: 210px; border: 0; background: #fff; border-radius: 30px; padding: 18px; box-shadow: var(--shadow), 0 7px 0 #e3dcfb;
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .15s;
}
.profile-card:hover { transform: translateY(-4px) rotate(-1deg); }
.profile-card .avatar { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fff 0, #efe8ff 70%); display: grid; place-items: center; }
.profile-card .avatar svg { width: 130px; height: 130px; }
.pc-name { font-size: 1.5rem; font-weight: 700; }
.pc-stars { display: flex; align-items: center; gap: 4px; color: var(--ink-soft); font-weight: 600; }

/* ---------- PIN ---------- */
.pin-screen { display: grid; place-items: center; min-height: 75vh; }
.pin-card { position: relative; text-align: center; width: min(420px, 100%); }
.pin-x { position: absolute; left: 14px; top: 14px; }
.pin-avatar svg { width: 120px; height: 120px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 10px 0 4px; }
.pin-dots i { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #cfc4ea; transition: background .1s, transform .1s; }
.pin-dots i.on { background: var(--purple); border-color: var(--purple); transform: scale(1.1); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ---------- number pad ---------- */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 330px; margin: 10px auto; }
.key {
  border: 0; border-radius: 20px; background: #fff; font-size: 1.8rem; font-weight: 600; min-height: 64px;
  box-shadow: 0 5px 0 #ddd3fa, 0 0 0 2px #efeaff inset; transition: transform .06s, box-shadow .06s;
}
.key:active { transform: translateY(4px); box-shadow: 0 1px 0 #ddd3fa; }
.key-del { background: #fff4f7; }
.key-ok { background: linear-gradient(180deg, #7fe6bf, var(--mint)); color: #fff; box-shadow: 0 5px 0 var(--mint-d); }
.pinpad { margin-bottom: 14px; }

/* ---------- hatching ---------- */
.hatch h1 { margin-top: 6px; }
.egg-row { display: flex; justify-content: center; gap: clamp(10px, 3vw, 30px); flex-wrap: wrap; margin: 20px 0; }
.egg-pick { border: 0; background: radial-gradient(circle, #fff 0 55%, transparent 70%); border-radius: 50%; padding: 10px; transition: transform .15s; }
.egg-pick:hover { transform: scale(1.06); }
.egg-pick svg { width: clamp(110px, 18vw, 170px); height: auto; }
.egg-big { border: 0; background: none; padding: 0; display: block; margin: 10px auto; }
.egg-big svg { width: clamp(200px, 32vw, 280px); height: auto; }
.wobble-slow { animation: wobble 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.shake-egg { animation: eggshake .35s; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes eggshake { 20% { transform: rotate(-10deg); } 50% { transform: rotate(9deg); } 80% { transform: rotate(-5deg); } }
.burst { animation: burst .55s forwards; }
@keyframes burst { to { transform: scale(1.35); opacity: 0; filter: brightness(2); } }
.pop-in { animation: popin .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes popin { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.hatch-pet svg, .modal-pet svg { width: 180px; height: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip-btn { border: 0; background: #f3efff; border-radius: 999px; padding: 8px 14px; font-weight: 600; min-height: 40px; }
.chip-btn:hover { background: #e6deff; }

/* ---------- creature animation ---------- */
.creature .c-bob { animation: bob 2.6s ease-in-out infinite; transform-origin: 100px 188px; }
.creature .c-eyes { animation: blink 4.5s infinite; transform-origin: 100px 110px; transform-box: view-box; }
.creature .c-tail { animation: tail 1.8s ease-in-out infinite; transform-origin: 152px 160px; }
.creature .c-wings { animation: flap 1.4s ease-in-out infinite; transform-origin: 100px 110px; }
.mood-happy .c-bob { animation: hop .6s ease-in-out infinite; }
.mood-eat .c-bob { animation: munch .25s ease-in-out infinite; }
.bob1 .c-bob { animation-delay: -.8s; } .bob3 .c-bob { animation-delay: -1.6s; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(1.02, .98); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-16px); } }
@keyframes munch { 50% { transform: scale(1.04, .95); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes tail { 50% { transform: rotate(10deg); } }
@keyframes flap { 50% { transform: scaleX(1.06) translateY(-2px); } }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px; align-items: start; }
.pet-card { text-align: center; background: linear-gradient(180deg, #fff 0, #fff 60%, #f7f2ff 100%); }
.pet-head { display: flex; align-items: center; justify-content: center; gap: 10px; }
.pet-head h2 { margin: 0; font-size: 1.8rem; }
.stage-tag { background: #ffe8f3; color: var(--pink-d); border-radius: 999px; padding: 3px 12px; font-weight: 600; }
.pet-stage { border: 0; background: radial-gradient(ellipse 42% 9% at 50% 93%, #d8f3df 0 96%, transparent 100%), radial-gradient(circle at 50% 50%, #fff4cc 0, rgba(255,244,204,0) 62%); padding: 0; width: 100%; display: block; border-radius: 24px; }
.pet-stage svg { width: min(100%, 290px); height: auto; }
.jump { animation: jumpup .5s; }
@keyframes jumpup { 40% { transform: translateY(-14px) scale(1.04); } }
.grow p { margin: 6px 0 12px; color: var(--ink-soft); }
.bar { height: 18px; background: #efeaff; border-radius: 999px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(90,60,160,.12); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff9ec7, #ffb86b, #ffd166); border-radius: 999px; transition: width .5s cubic-bezier(.3, 1.4, .5, 1); min-width: 18px; }
.pet-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.map-card { padding: 16px; }
.map-card h2 { margin: 4px 8px 12px; }
.map { position: relative; aspect-ratio: 1000 / 640; border-radius: 22px; overflow: hidden; }
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.area {
  position: absolute; transform: translate(-50%, -50%); border: 0; background: rgba(255,255,255,.9); border-radius: 22px;
  padding: 6px 10px 8px; width: clamp(110px, 17%, 160px); display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 6px 0 rgba(90,60,160,.18), 0 8px 20px rgba(90,60,160,.18); transition: transform .15s;
}
.area-art svg { width: 100%; height: auto; max-height: 90px; display: block; }
.area-art { width: 100%; }
.area-name { font-weight: 700; font-size: clamp(.85rem, 1.5vw, 1.05rem); white-space: nowrap; }
.area-sub { font-size: .78rem; color: var(--ink-soft); white-space: nowrap; }
.area.open { animation: glow 2.4s ease-in-out infinite; }
.area.open:hover { transform: translate(-50%, -54%) scale(1.05); }
.area.open .area-sub { color: var(--purple-d); font-weight: 600; }
.area.soon { filter: saturate(.35); opacity: .85; }
.area.soon .area-sub { background: #efeaff; border-radius: 999px; padding: 0 8px; }
@keyframes glow { 0%, 100% { box-shadow: 0 6px 0 rgba(90,60,160,.18), 0 0 0 0 rgba(255,209,102,.0); } 50% { box-shadow: 0 6px 0 rgba(90,60,160,.18), 0 0 0 8px rgba(255,209,102,.6); } }

/* ---------- closet ---------- */
.closet { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.closet-preview { text-align: center; position: sticky; top: 50px; }
.closet-preview svg { width: 100%; max-width: 260px; height: auto; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 18px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.swatch, .acc-item { position: relative; border: 3px solid transparent; background: #f7f4ff; border-radius: 20px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; }
.swatch.on, .acc-item.on { border-color: var(--purple); background: #fff; box-shadow: 0 4px 12px rgba(143,123,255,.3); }
.swatch .dot { width: 50px; height: 50px; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0,0,0,.1); }
.acc-pic svg { width: 90px; height: 90px; }
.locked { opacity: .6; }
.locked .dot, .locked .acc-pic { filter: grayscale(.8); }
.need { position: absolute; top: 6px; right: 6px; background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 7px; font-size: .78rem; display: flex; align-items: center; gap: 2px; }
.need .ico { width: 1em; height: 1em; }
.sw-name { font-size: .9rem; }

/* ---------- area pages ---------- */
.area-hero { display: flex; align-items: center; gap: 18px; }
.ah-art { width: 140px; flex: none; }
.ah-art svg { width: 100%; }
.woods-hero { background: linear-gradient(120deg, #e4fbe9, #fff 70%); }
.caves-hero { background: linear-gradient(120deg, #ece6ff, #fff 70%); }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.list-card { margin: 0; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.wchip { border-radius: 999px; padding: 3px 11px; font-weight: 500; font-size: .95rem; background: #f1eeff; }
.wchip.new { background: #f1eeff; color: var(--ink-soft); }
.wchip.learning { background: #fff2cc; color: #8a6200; }
.wchip.tricky { background: #ffe1ea; color: #b1305a; }
.wchip.known { background: #d9f7ea; color: #1f7a57; }
.legend { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.list-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.op-card { border: 0; border-radius: 26px; padding: 22px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; box-shadow: 0 7px 0 rgba(0,0,0,.14), var(--shadow); transition: transform .15s; }
.op-card:hover { transform: translateY(-4px); }
.op-card:active { transform: translateY(3px); }
.op-sign { font-size: 3.4rem; font-weight: 700; line-height: 1; text-shadow: 0 4px 0 rgba(0,0,0,.12); }
.op-name { font-size: 1.3rem; font-weight: 700; }
.op-level { background: rgba(255,255,255,.3); border-radius: 999px; padding: 2px 12px; font-weight: 600; }
.op-pink { background: linear-gradient(160deg, #ff9ec7, #ff6fa8); }
.op-sky { background: linear-gradient(160deg, #8fd0ff, #4fa8f0); }
.op-sunny { background: linear-gradient(160deg, #ffd166, #ffab3d); }
.op-mint { background: linear-gradient(160deg, #7fe6bf, #3fbf8f); }
.op-lavender { background: linear-gradient(160deg, #c4a8ff, #8f6bff); }

/* ---------- game cards ---------- */
.game-card { max-width: 760px; margin: 0 auto; text-align: center; background-color: #fff; }
.woods-card { background-image: radial-gradient(circle at 0 100%, #e4fbe9 0 120px, transparent 121px), radial-gradient(circle at 100% 0, #fff2cc 0 90px, transparent 91px); }
.cave-card { background-image: radial-gradient(circle at 100% 100%, #ece6ff 0 140px, transparent 141px), radial-gradient(circle at 0 0, #e3f4ff 0 90px, transparent 91px); }
.list-name { color: var(--ink-soft); font-weight: 600; margin-top: 10px; }
.listen-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.btn-sound { background: linear-gradient(180deg, #ffb3d3, var(--pink)); color: #fff; box-shadow: 0 6px 0 var(--pink-d); }
.btn-sound .ico { width: 1.6em; height: 1.6em; }
.meaning { color: var(--ink-soft); min-height: 1.4em; font-size: 1.05rem; }
.tiles { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; min-height: 10px; margin: 8px 0; }
.tile { width: 44px; height: 54px; display: grid; place-items: center; border-radius: 12px; font-size: 1.7rem; font-weight: 700; animation: popin .35s both; }
.tile.ok { background: #d9f7ea; color: #1f7a57; box-shadow: 0 4px 0 #a6e6c9; }
.tile.fix { background: #fff2cc; color: #a36a00; box-shadow: 0 4px 0 #ffd98a; outline: 3px dashed #ffb84d; }
.spell-form { display: flex; gap: 10px; max-width: 540px; margin: 10px auto; }
.spell-input { flex: 1; min-width: 0; border: 4px solid #e3dcfb; border-radius: 20px; padding: 12px 18px; font-size: 1.8rem; text-align: center; letter-spacing: .06em; outline: none; background: #fcfbff; }
.spell-input:focus { border-color: var(--purple); background: #fff; }
.feedback { font-size: 1.25rem; font-weight: 600; min-height: 2.4em; margin-top: 10px; text-align: center; }
.feedback small { display: block; font-size: .95rem; font-weight: 500; color: var(--ink-soft); margin-top: 4px; }
.feedback.good { color: var(--mint-d); animation: popin .3s; }
.feedback.try { color: #d0781f; }
.feedback.show { color: var(--purple-d); }
.prompt { font-size: 1.2rem; margin-top: 12px; }
.meaning-card { display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff8e1; border-radius: 22px; padding: 18px; font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 600; margin: 6px auto 16px; max-width: 600px; box-shadow: 0 5px 0 #ffe29a; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin: 0 auto; }
.choice { font-size: 1.5rem; min-height: 70px; background: #fff; box-shadow: 0 6px 0 #ddd3fa, 0 0 0 3px #ebe5ff inset; }
.choice.right { background: #d9f7ea; box-shadow: 0 6px 0 #8fdcb9; animation: jumpup .5s; }
.choice.nope { animation: shake .4s; }

.dots { display: flex; gap: 8px; justify-content: center; margin: 6px 0 10px; }
.dots i { width: 18px; height: 18px; border-radius: 50%; background: #efeaff; transition: all .2s; }
.dots i.now { background: #fff; box-shadow: 0 0 0 3px var(--purple); }
.dots i.good { background: var(--mint); }
.dots i.ok { background: var(--sunny); }
.level-tag { display: inline-block; background: #efeaff; color: var(--purple-d); border-radius: 999px; padding: 3px 14px; font-weight: 600; }
.problem { font-size: clamp(2.6rem, 7vw, 4rem); font-weight: 700; margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.problem.pop { animation: popin .35s; }
.vertical { display: inline-block; text-align: right; line-height: 1.1; }
.vrow { display: flex; justify-content: space-between; gap: 18px; }
.vsign { color: var(--pink-d); }
.hsign { color: var(--pink-d); margin: 0 .15em; }
.vline { height: 6px; background: var(--ink); border-radius: 4px; margin-top: 4px; }
.answer { display: inline-block; min-width: 200px; font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 700; border-radius: 20px; background: #f7f4ff; border: 4px dashed #cfc4ea; padding: 4px 20px; font-variant-numeric: tabular-nums; }
.answer .placeholder { color: #cfc4ea; }
.wiggle { animation: shake .4s; }
.btn-next { margin-top: 10px; font-size: 1.3rem; }

/* ---------- reward ---------- */
.reward-pet svg { width: 200px; height: auto; }
.reward .big { font-size: 1.3rem; }
.reward-stars { display: flex; justify-content: center; gap: 12px; margin: 10px 0; }
.rstar { display: inline-block; animation: starpop .6s cubic-bezier(.3, 1.8, .5, 1) both; }
.rstar .ico { width: 84px; height: 84px; }
@keyframes starpop { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
.reward-treats { font-size: 1.3rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.reward-treats .ico { width: 1.6em; height: 1.6em; }
.reward-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- parent ---------- */
.parent-bar .tb-title { font-size: 1.4rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { margin: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.stat-k { color: var(--ink-soft); font-weight: 500; }
.stat-v { font-size: 1.6rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stat-v.small-v { font-size: 1.15rem; }
.table-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: 1rem; }
.ptable th { text-align: left; color: var(--ink-soft); font-weight: 600; padding: 8px; border-bottom: 2px solid #efeaff; }
.ptable td { padding: 9px 8px; border-bottom: 1px solid #f3f0ff; vertical-align: top; }
.ptable small { color: var(--ink-soft); }
.ptable tr.dim td { color: #aaa1c4; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid #f3f0ff; }
.activity li span:first-child { font-weight: 600; }
.manage { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.inline-form { background: #faf8ff; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.inline-form h3 { font-size: 1.05rem; margin: 0; }
.danger-row { display: flex; gap: 10px; flex-wrap: wrap; }
.kid-tabs { max-width: 520px; margin: 0 auto 10px; }

/* ---------- modal / toast / fx ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(59, 43, 90, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .2s; }
.modal { background: #fff; border-radius: 30px; padding: 26px; max-width: 440px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(59,43,90,.35); animation: popin .35s cubic-bezier(.3, 1.5, .5, 1); }
.modal-btns { display: flex; gap: 10px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.modal-art svg { width: 150px; }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 600; z-index: 120; animation: popin .3s; box-shadow: var(--shadow); max-width: 90vw; text-align: center; }
.toast.out { opacity: 0; transition: opacity .4s; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 110; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 12px; height: 16px; border-radius: 3px; animation: fall 2s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--drift), 105vh) rotate(var(--spin)); } }
.float-text { position: fixed; transform: translate(-50%, 0); font-size: 1.6rem; font-weight: 700; color: var(--pink-d); animation: floatup 1.3s ease-out forwards; display: flex; align-items: center; gap: 4px; text-shadow: 0 2px 0 #fff; }
.float-text .ico { width: 1.2em; height: 1.2em; }
.heart { color: #ff5c8a; }
@keyframes floatup { to { transform: translate(-50%, -80px); opacity: 0; } }

/* ---------- loading ---------- */
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--ink-soft); }
.loading-egg { width: 70px; height: 90px; background: #fff; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; border: 5px solid #ffa6d2; animation: wobble 1s ease-in-out infinite; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .home { grid-template-columns: 1fr; }
  .pet-card { display: grid; grid-template-columns: 200px 1fr; grid-template-areas: "stage head" "stage grow" "stage actions"; align-items: center; text-align: left; gap: 0 16px; }
  .pet-head { grid-area: head; justify-content: flex-start; }
  .pet-stage { grid-area: stage; }
  #grow { grid-area: grow; }
  .pet-actions { grid-area: actions; justify-content: flex-start; }
  .closet { grid-template-columns: 1fr; }
  .closet-preview { position: static; }
  .closet-preview svg { max-width: 180px; }
}
@media (max-width: 760px) {
  .welcome { grid-template-columns: 1fr; min-height: 0; gap: 10px; }
  .two-col { grid-template-columns: 1fr; }
  .tb-title { display: none; }
  .pname { display: none; }
  .btn-player { padding: 4px; }
}
@media (max-width: 560px) {
  .pet-card { grid-template-columns: 1fr; grid-template-areas: "head" "stage" "grow" "actions"; text-align: center; }
  .pet-head, .pet-actions { justify-content: center; }
  .map { aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #bfeaff; padding: 10px; }
  .map-bg { display: none; }
  .area { position: static; transform: none; width: auto; }
  .area.open:hover { transform: none; }
  .choices { grid-template-columns: 1fr; }
  .spell-form { flex-direction: column; }
  .area-hero { flex-direction: column; text-align: center; }
  .chip { padding: 5px 9px; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
