/* ================= ธีมน่ารักสดใส ================= */
:root { --pink: #ff8fb6; --peach: #ffb37a; --mint: #6fd6b0; --lemon: #ffd84d; --lav: #b39cff; --skyc: #7cc6ff; --accent: #ff7aa2; --accent2: #3fc495; }
html, body { background: linear-gradient(180deg, #cdeeff 0%, #ffe9f2 55%, #fff4dc 100%); }
.screen, .home { position: relative; isolation: isolate; background: transparent; }
.screen::before, .home::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle, rgba(255,255,255,.6) 2px, transparent 2.5px) 0 0 / 34px 34px,
    radial-gradient(ellipse 120px 44px at 12% 14%, #fff 98%, transparent),
    radial-gradient(ellipse 80px 34px at 18% 10%, #fff 98%, transparent),
    radial-gradient(ellipse 140px 48px at 86% 22%, #fff 98%, transparent),
    radial-gradient(ellipse 90px 36px at 80% 18%, #fff 98%, transparent);
  opacity: .9; }

h1 { color: #ff6f9c; text-shadow: 0 3px 0 #fff, 0 5px 0 rgba(255,111,156,.25); letter-spacing: .5px; }
.title { font-size: clamp(34px, 7vw, 56px); background: linear-gradient(90deg, #ff6f9c, #ff9a4d, #b38cff, #4fb3ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 #fff) drop-shadow(0 4px 6px rgba(255,111,156,.3)); }
.sub { color: #8a6a63; }
.mascot { width: min(220px, 46vw); aspect-ratio: 260/232; margin-top: 6px; animation: hop 2.4s ease-in-out infinite; }
.mascot svg { width: 100%; height: 100%; overflow: visible; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-12px) rotate(-2deg); } 55% { transform: translateY(-12px) rotate(2deg); } }

/* ปุ่มลูกอม */
.btn { background: linear-gradient(180deg, #ff9fc0, #ff6f9c); box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 5px 0 #d9507c, 0 8px 14px rgba(255,111,156,.3); border: 3px solid #fff; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 1px 0 #d9507c; }
.btn.green { background: linear-gradient(180deg, #7fe3bf, #34bf8c); box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 5px 0 #23966b, 0 8px 14px rgba(52,191,140,.3); }
.btn.grey { background: linear-gradient(180deg, #d9cfe9, #b3a5cc); box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 5px 0 #8f80aa; }
.iconbtn { border: 3px solid #fff; background: linear-gradient(180deg, #fff, #ffeef5); box-shadow: 0 4px 0 #f3c6d8, 0 6px 12px rgba(255,111,156,.15); }

/* แป้นตัวเลข / รหัสรูป */
.code-dots span, .pin-slots span { border: 4px solid #fff; background: #fff7fb; box-shadow: 0 4px 0 #f3c6d8; color: #ff6f9c; }
.keypad button, .pinpad button { border: 3px solid #fff; color: #5a4640; box-shadow: inset 0 3px 0 rgba(255,255,255,.6), 0 5px 0 rgba(0,0,0,.12); }
.keypad button:nth-child(6n+1), .pinpad button:nth-child(6n+1) { background: #ffe0ec; }
.keypad button:nth-child(6n+2), .pinpad button:nth-child(6n+2) { background: #ffe8d1; }
.keypad button:nth-child(6n+3), .pinpad button:nth-child(6n+3) { background: #fff4c2; }
.keypad button:nth-child(6n+4), .pinpad button:nth-child(6n+4) { background: #d9f5e9; }
.keypad button:nth-child(6n+5), .pinpad button:nth-child(6n+5) { background: #dcefff; }
.keypad button:nth-child(6n+6), .pinpad button:nth-child(6n+6) { background: #ece4ff; }
.roster button { border: 4px solid #fff; background: linear-gradient(180deg, #fff, #fff3f8); box-shadow: 0 5px 0 #f3c6d8, 0 8px 16px rgba(255,111,156,.12); transition: transform .15s; }
.roster button:nth-child(4n+2) { background: linear-gradient(180deg, #fff, #effaff); box-shadow: 0 5px 0 #bfe0f5; }
.roster button:nth-child(4n+3) { background: linear-gradient(180deg, #fff, #fffbe6); box-shadow: 0 5px 0 #f2e1a3; }
.roster button:nth-child(4n+4) { background: linear-gradient(180deg, #fff, #f0fff7); box-shadow: 0 5px 0 #bfe8d4; }
.roster button:hover, .card:hover { transform: translateY(-3px) rotate(-1deg); }
.roster .face { background: #fff; border-radius: 50%; box-shadow: inset 0 0 0 4px #ffe0ec; }

/* หน้าสร้างแมว */
.preview { border: 5px solid #fff; background: radial-gradient(circle at 50% 40%, #fff 0, #fff 40%, #ffeaf3 100%); box-shadow: 0 6px 0 #f3c6d8, 0 12px 24px rgba(255,111,156,.15); }
.opt-row { border: 3px solid #fff; background: rgba(255,255,255,.9); box-shadow: 0 4px 0 #f3d9e3; }
.opt-row h3 { color: #ff6f9c; }
.chip { background: #fff0f6; border: 2px solid #ffd3e3; }
.chip.on { background: #ff8fb6; color: #fff; border-color: #fff; }
.on { outline-color: #ff6f9c; }
.name-in { border-color: #ffd3e3; background: #fffafc; }

/* บ้าน */
.topbar { margin: 8px 10px 0; background: rgba(255,255,255,.88); border-radius: 26px; border: 3px solid #fff; box-shadow: 0 4px 0 #f3c6d8, 0 8px 18px rgba(255,111,156,.12); padding: 6px 10px; }
.avatar { width: 54px; height: 54px; flex: none; border-radius: 50%; background: radial-gradient(circle, #fff 55%, #ffe0ec); border: 3px solid #ffb3cd; overflow: hidden; }
.avatar svg { width: 100%; height: 100%; }
.catname { color: #ff5d8f; display: flex; flex-direction: column; gap: 3px; }
.hearts { display: flex; align-items: center; gap: 4px; font-size: 16px; }
.heart-bar { height: 16px; border: 2px solid #fff; box-shadow: 0 0 0 2px #ffc9da; background: #fff0f4; }
.heart-bar i { background: repeating-linear-gradient(-45deg, #ff7aa2 0 10px, #ff94b6 10px 20px); }
.coins { background: linear-gradient(180deg, #fff6c9, #ffd84d); border: 3px solid #fff; box-shadow: 0 4px 0 #e0b21f; color: #8a5a00; }
.stage { border: 7px solid #fff; border-radius: 32px; box-shadow: 0 0 0 4px #ffc9da, 0 10px 0 #f3c6d8, 0 18px 30px rgba(255,111,156,.18); }
.stage-wrap { padding: 10px 12px 4px; }
.catbox .shadow { position: absolute; left: 24%; right: 24%; bottom: 0; height: 7%; background: rgba(74,58,53,.2); border-radius: 50%; filter: blur(2px); z-index: -1; }
.thought { border: 3px solid #ffd3e3; }

/* แถบเครื่องมือหลากสี */
.toolbar { gap: 10px; padding-top: 10px; }
.tool { --c: #ffe0ec; --d: #f3b6cc; background: #fff; border: 3px solid #fff; border-radius: 22px; box-shadow: 0 5px 0 var(--d), 0 8px 14px rgba(0,0,0,.06); color: #6b524b; transition: transform .12s; }
.tool .ti { width: 46px; height: 46px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-size: 28px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.06); }
.tool:hover .ti { animation: wob .5s; }
@keyframes wob { 30% { transform: rotate(-10deg) scale(1.1); } 60% { transform: rotate(8deg); } }
.tool[data-a=missions] { --c: #fff1b8; --d: #ecd27a; }
.tool[data-a=feed] { --c: #ffe1cc; --d: #f0b68e; }
.tool[data-a=bath] { --c: #d8efff; --d: #9fcdf0; }
.tool[data-a=play] { --c: #e2f7d8; --d: #a8d897; }
.tool[data-a=wardrobe] { --c: #ffe0ec; --d: #f3b6cc; }
.tool[data-a=deco] { --c: #ece4ff; --d: #c1b1ee; }
.tool[data-a=shop] { --c: #ffd9d9; --d: #eda9a9; }
.tool[data-a=photo] { --c: #dff6f2; --d: #a2d9cf; }
.tool[data-a=album] { --c: #fff0d6; --d: #e8c78c; }
.badge { border: 2px solid #fff; animation: bob 1s ease-in-out infinite; }

/* แผ่นหน้าต่าง */
.sheet { background: radial-gradient(circle, rgba(255,143,182,.12) 2px, transparent 2.5px) 0 0 / 26px 26px, #fffaf3; border: 4px solid #fff; border-bottom: 0; box-shadow: 0 -6px 0 #ffc9da; }
.sheet-head h2 { color: #ff5d8f; }
.tab { border: 3px solid #fff; background: #fff0f6; color: #b0567a; box-shadow: 0 4px 0 #f3c6d8; }
.tab.on { background: linear-gradient(180deg, #ff9fc0, #ff6f9c); color: #fff; }
.card { border: 3px solid #fff; box-shadow: 0 5px 0 #f3d9e3, 0 8px 14px rgba(0,0,0,.05); transition: transform .15s; color: #6b524b; }
.card .pic { background: radial-gradient(circle at 50% 40%, #fff, #fff1f6); }
.card.owned::after { content: '✓'; position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: #fff; font-weight: 900; display: grid; place-items: center; border: 3px solid #fff; }
.card.on { outline: 4px solid #ff8fb6; }
.price { background: #fff6c9; border-radius: 999px; padding: 1px 10px; }
.card.owned .price { background: #dcf7ec; }
.msn { border: 3px solid #fff; box-shadow: 0 5px 0 #f3d9e3; }
.bar { border: 2px solid #fff; box-shadow: 0 0 0 2px #d6efe5; }
.bar i { background: repeating-linear-gradient(-45deg, #4fcf9f 0 10px, #6fdcb3 10px 20px); }
.dialog { border: 5px solid #fff; background: linear-gradient(180deg, #fff, #fff4f8); box-shadow: 0 8px 0 #f3c6d8, 0 16px 40px rgba(0,0,0,.15); }
.dialog h2 { color: #ff5d8f; }
.toast, .hint-banner { border: 3px solid #ffd3e3; color: #ff5d8f; }

@media (max-width: 700px) {
  .tool .ti { width: 38px; height: 38px; font-size: 23px; }
  .avatar { width: 44px; height: 44px; }
  .topbar { margin: 6px 6px 0; }
}
@media (prefers-reduced-motion: reduce) { .mascot, .badge { animation: none; } }
/* ให้ห้องพอดีพื้นที่ที่เหลือจริง ไม่ว่าแถบเครื่องมือจะมีกี่แถว */
@supports (width: 1cqh) {
  .stage-wrap { container-type: size; }
  .stage { width: min(100cqw - 8px, (100cqh - 14px) * 1000 / 620) !important; }
}
.tool { width: 76px; height: 70px; }
@media (max-width: 700px) { .tool { width: 64px; height: 62px; } .toolbar { gap: 6px; } }
