/* ===== My Mini Cat - pastel candy theme ===== */
@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/fredoka.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
:root {
  --peach: #FFE0D1; --blush: #FFE6EF; --lav: #E7D9FF;
  --coral: #FF7A8A; --orange: #FFA552; --yellow: #FFD54F; --mint: #5FD8A9; --sky: #5CC0F5; --lilac: #AE8CFF; --pink: #FF9EC4;
  --ink: #4A2E3E; --ink-soft: #7A5A6C;
  --fuzz: #8A5A3B; --fuzz-2: #C48A58; --cola: #22BFC0; --cola-2: #8FDDF0;
  --card: rgba(255,255,255,.86); --radius: 28px;
  --shadow: 0 10px 30px rgba(170,100,160,.18), 0 2px 6px rgba(170,100,160,.12);
  --font: 'Fredoka', 'Baloo 2', 'Nunito', 'Comic Sans MS', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); font-size: 20px; line-height: 1.35;
  background: linear-gradient(165deg, var(--peach) 0%, var(--blush) 45%, var(--lav) 100%) fixed; min-height: 100vh; overflow-x: hidden; }
button, input, a { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { -webkit-user-drag: none; user-select: none; }
[hidden] { display: none !important; }
.sky { position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='340'%3E%3Cpath d='M60 70c-9-14-30-4-22 12l22 20 22-20c8-16-13-26-22-12z' fill='%23FF9EC4'/%3E%3Cpath d='M260 60l7 15 16 2-12 11 3 16-14-8-14 8 3-16-12-11 16-2z' fill='%23FFD54F'/%3E%3Cg fill='%23C9B2FF'%3E%3Cellipse cx='120' cy='260' rx='14' ry='11'/%3E%3Ccircle cx='103' cy='243' r='6'/%3E%3Ccircle cx='116' cy='236' r='6'/%3E%3Ccircle cx='130' cy='238' r='6'/%3E%3Ccircle cx='139' cy='249' r='6'/%3E%3C/g%3E%3Cpath d='M280 250c-7-11-23-3-17 9l17 15 17-15c6-12-10-20-17-9z' fill='%238FDDF0'/%3E%3Cpath d='M190 170l4 9 10 1-7 7 2 10-9-5-9 5 2-10-7-7 10-1z' fill='%23FFB38A'/%3E%3C/svg%3E");
  background-size: 340px 340px; animation: drift 60s linear infinite; }
@keyframes drift { to { background-position: 340px 680px; } }

/* candy letters */
.candy { font-weight: 700; letter-spacing: .5px; margin: 0; line-height: 1.05; }
.candy b { display: inline-block; -webkit-text-stroke: 0; text-shadow: 0 3px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff, 0 6px 14px rgba(170,100,160,.25); }
.candy b:nth-of-type(6n+1) { color: var(--coral); } .candy b:nth-of-type(6n+2) { color: var(--orange); } .candy b:nth-of-type(6n+3) { color: #F5B800; }
.candy b:nth-of-type(6n+4) { color: #3CC995; } .candy b:nth-of-type(6n+5) { color: var(--sky); } .candy b:nth-of-type(6n) { color: var(--lilac); }
.candy.big { font-size: clamp(46px, 9vw, 92px); text-align: center; }
.candy.big b { animation: hop 2.6s ease-in-out infinite; } .candy.big b:nth-of-type(2n) { animation-delay: .2s; } .candy.big b:nth-of-type(3n) { animation-delay: .4s; }
.candy.mid { font-size: clamp(34px, 6vw, 54px); }
.candy.small { font-size: 26px; }
@keyframes hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top));
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 2px 14px rgba(170,100,160,.12); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { border-radius: 14px; }
.tabs { display: flex; gap: 6px; margin-left: auto; }
.tabs a { display: flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; padding: 10px 16px; border-radius: 999px; transition: .2s; min-height: 52px; }
.tabs a .ti { font-size: 26px; }
.tabs a.on { background: linear-gradient(135deg, var(--pink), var(--lilac)); color: #fff; box-shadow: var(--shadow); }
.iconbtn { width: 52px; height: 52px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font-size: 24px; display: grid; place-items: center; flex: none; }
@media (max-width: 760px) {
  .brand .candy { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; justify-content: space-around; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(170,100,160,.16); z-index: 40; }
  .tabs a { flex-direction: column; gap: 0; padding: 6px 10px; font-size: 14px; min-width: 72px; border-radius: 22px; }
  .topbar { justify-content: space-between; }
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
}

main { max-width: 1180px; margin: 0 auto; padding: 14px 14px 30px; }
.view { animation: pop-in .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }

/* bubbles */
.bubble { position: relative; background: #fff; border-radius: 26px; padding: 12px 56px 12px 18px; box-shadow: var(--shadow); font-weight: 600; font-size: 22px; min-height: 56px; display: flex; align-items: center; }
.bubble .speak { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.speak { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #FFE27A, #FFB86B); font-size: 20px; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.speak:active { transform: translateY(-50%) scale(.9); }
.no-speech .speak { display: none; }
.no-speech .bubble { padding-right: 18px; }

/* buttons */
.mega, .bigbtn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; font-weight: 700; border-radius: 999px; color: #fff; box-shadow: var(--shadow), inset 0 -6px 0 rgba(0,0,0,.12); transition: transform .15s; }
.mega { font-size: clamp(30px, 6vw, 44px); padding: 20px 46px; background: linear-gradient(135deg, var(--coral), var(--orange)); animation: pulse 2.2s ease-in-out infinite; }
.bigbtn { font-size: 26px; padding: 16px 30px; min-height: 72px; }
.mega .mi, .bigbtn .mi { font-size: 1.25em; }
.sky-b { background: linear-gradient(135deg, var(--sky), var(--lilac)); } .mint-b { background: linear-gradient(135deg, var(--mint), #3CC0C9); }
.small-b { background: linear-gradient(135deg, var(--lilac), var(--pink)); font-size: 22px; min-height: 60px; padding: 10px 22px; }
.mega:active, .bigbtn:active, .act:active, .tile:active, .navbtn:active { transform: scale(.94); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.row2 { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* home */
.hero { text-align: center; padding: 10px 0 18px; }
.mascots { display: grid; grid-template-columns: 1.25fr 1fr .9fr; align-items: end; gap: 6px; max-width: 900px; margin: 4px auto 14px; }
.mascot { padding: 0; }
.mascot img { width: 100%; height: auto; filter: drop-shadow(0 12px 16px rgba(120,60,100,.22)); }
.mascot.fuzz img { animation: bob 3s ease-in-out infinite; }
.mascot.cola img { animation: bob 3s ease-in-out infinite .8s; }
.mascots .big-bubble { align-self: center; text-align: left; font-size: clamp(20px, 3vw, 28px); }
.mascots .big-bubble::before { content: ''; position: absolute; left: -16px; top: 50%; border: 12px solid transparent; border-right: 18px solid #fff; transform: translateY(-50%); }
@media (max-width: 760px) {
  .mascots { grid-template-columns: 1fr 1fr; }
  .mascots .big-bubble { grid-column: 1 / -1; grid-row: 1; }
  .mascots .big-bubble::before { left: 30%; top: auto; bottom: -26px; border: 14px solid transparent; border-top: 16px solid #fff; transform: none; }
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }
.meet { margin-top: 26px; }
.meet h2 { margin: 0 0 10px; font-size: 26px; text-align: center; }
.meet-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: center; }
.meet-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.meet-cat img { width: 100%; max-width: 170px; height: auto; }
.pill { color: #fff; font-weight: 700; padding: 4px 18px; border-radius: 999px; font-size: 22px; }
.fuzz-pill { background: linear-gradient(135deg, var(--fuzz), var(--fuzz-2)); } .cola-pill { background: linear-gradient(135deg, var(--cola), var(--cola-2)); }
.tiny { font-size: 16px; color: var(--ink-soft); }
.sketch { margin: 0; text-align: center; } .sketch img { width: 100%; max-width: 200px; border-radius: 16px; transform: rotate(-3deg); box-shadow: var(--shadow); border: 6px solid #fff; }
.sketch figcaption { font-size: 16px; color: var(--ink-soft); }
@media (max-width: 560px) { .meet-row { grid-template-columns: 1fr 1fr; } .sketch { grid-column: 1 / -1; } }

/* steps */
.steps { display: flex; justify-content: center; gap: 6px; margin: 2px 0 12px; flex-wrap: nowrap; overflow-x: auto; padding: 4px; }
.step { flex: none; width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.7); font-size: 26px; display: grid; place-items: center; position: relative; transition: .25s; box-shadow: 0 2px 6px rgba(170,100,160,.15); }
.step.done { background: #fff; }
.step.on { background: linear-gradient(135deg, var(--pink), var(--lilac)); transform: scale(1.15); box-shadow: var(--shadow); }
.step:disabled { opacity: .45; }
@media (max-width: 500px) { .step { width: 44px; height: 44px; font-size: 20px; } }

/* wizard layout */
.make { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stage-col { position: sticky; top: 90px; }
@media (max-width: 860px) { .make { grid-template-columns: minmax(0, 1fr); } .stage-col { position: sticky; top: 72px; z-index: 5; } }
.stage { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 32px; overflow: hidden; box-shadow: var(--shadow); border: 6px solid #fff; background: #fff; }
@media (max-width: 860px) { #makeStage { aspect-ratio: auto; height: min(38vh, 300px); } }
.stage .scene, .stage .scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.catwrap { position: absolute; left: 50%; bottom: 3%; height: 88%; aspect-ratio: 400 / 452; transform: translateX(-50%); }
.catwrap .cat { width: 100%; height: 100%; transform-origin: 50% 90%; }
.catwrap svg { width: 100%; height: 100%; display: block; }
.catwrap.boop .cat { animation: boop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes boop { 0% { transform: scale(.88, 1.1); } 60% { transform: scale(1.06, .95); } 100% { transform: none; } }
/* personality idle animations */
.catwrap.m-happy .inner { animation: bounce 1.4s ease-in-out infinite; }
.catwrap.m-shy .inner { animation: shy 3s ease-in-out infinite; }
.catwrap.m-funny .inner { animation: wiggle 1.2s ease-in-out infinite; }
.catwrap.m-sleepy .inner { animation: breathe 3.6s ease-in-out infinite; }
.catwrap.m-curious .inner { animation: tilt 2.6s ease-in-out infinite; }
.catwrap.m-brave .inner { animation: brave 2s ease-in-out infinite; }
.catwrap.m-silly .inner { animation: silly 1.6s ease-in-out infinite; }
.inner { width: 100%; height: 100%; transform-origin: 50% 92%; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5%); } }
@keyframes shy { 0%,100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(-3%) rotate(-3deg); } }
@keyframes wiggle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes breathe { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
@keyframes tilt { 0%,100% { transform: rotate(0); } 30% { transform: rotate(6deg); } 70% { transform: rotate(-2deg); } }
@keyframes brave { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05) translateY(-2%); } }
@keyframes silly { 0% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-8deg) translateY(-6%); } 50% { transform: rotate(0) translateY(0); } 75% { transform: rotate(8deg) translateY(-6%); } 100% { transform: rotate(0); } }
.zz, .qm { animation: floaty 2s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.say { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); background: #fff; border-radius: 22px; padding: 8px 16px; font-weight: 700; font-size: clamp(16px, 2.4vw, 22px); box-shadow: var(--shadow); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; animation: pop-in .4s cubic-bezier(.2,1.6,.4,1); z-index: 3; }
.namepill { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); background: rgba(255,255,255,.92); padding: 4px 20px; border-radius: 999px; font-weight: 700; font-size: 24px; box-shadow: var(--shadow); z-index: 3; }

/* ambient world animations (in-app only) */
.a-drift { animation: adrift 14s ease-in-out infinite alternate; }
.a-float { animation: floaty 3.2s ease-in-out infinite; }
.a-float2 { animation: floaty 4.2s ease-in-out infinite .6s; }
.a-twinkle { animation: twinkle 2.2s ease-in-out infinite; }
.a-fall { animation: fall 7s linear infinite; }
.a-wave { animation: wave 3s ease-in-out infinite alternate; }
.a-pulse { animation: apulse 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.a-spin { animation: spin 8s linear infinite; transform-box: fill-box; transform-origin: center; }
.a-sway { animation: sway 3s ease-in-out infinite alternate; }
.a-flutter { animation: flutter .35s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes adrift { to { transform: translateX(40px); } }
@keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes fall { from { transform: translateY(-110%); } to { transform: translateY(110%); } }
@keyframes wave { to { transform: translateX(-30px); } }
@keyframes apulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes flutter { from { transform: scaleX(1); } to { transform: scaleX(.4); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* guide + panel */
.guide { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.guide-fuzz { width: 92px; height: auto; flex: none; filter: drop-shadow(0 6px 8px rgba(120,60,100,.2)); cursor: pointer; }
.guide-fuzz.cheer { animation: boop .6s cubic-bezier(.2,1.6,.4,1); }
.guide .bubble { flex: 1; }
.guide .bubble::before { content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); border: 10px solid transparent; border-right: 16px solid #fff; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; animation: pop-in .35s cubic-bezier(.2,1.4,.4,1); }
.subtabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.subtab { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; padding: 8px 10px; border-radius: 20px; background: #fff; font-weight: 600; font-size: 15px; box-shadow: 0 2px 6px rgba(170,100,160,.15); position: relative; }
.subtab .si { font-size: 28px; line-height: 1; }
.subtab.on { background: linear-gradient(135deg, #FFE27A, #FFB86B); }
.subtab .dot { position: absolute; top: 4px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--coral); border: 2px solid #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tiles.sw { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.tile { position: relative; background: #fff; border-radius: 22px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 3px 8px rgba(170,100,160,.15); border: 4px solid transparent; transition: transform .15s, border-color .15s; min-height: 76px; font-weight: 600; font-size: 16px; }
.tile.on { border-color: var(--coral); box-shadow: 0 0 0 4px #FFD1DA, var(--shadow); }
.tile.on::after { content: '✓'; position: absolute; top: -8px; right: -6px; width: 28px; height: 28px; border-radius: 50%; background: var(--coral); color: #fff; font-size: 17px; display: grid; place-items: center; font-weight: 700; }
.tile .mini { width: 100%; max-width: 96px; aspect-ratio: 400 / 452; }
.tile .mini svg { width: 100%; height: 100%; }
.tile .scene-mini { width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; }
.tile .scene-mini svg { width: 100%; height: 100%; display: block; }
.swatch { width: 58px; height: 58px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.08), inset 0 -6px 0 rgba(0,0,0,.08); }
.tile .ei { font-size: 34px; line-height: 1.1; }
.tile.none-t .ei { font-size: 40px; opacity: .7; }
.switch { width: 54px; height: 30px; border-radius: 999px; background: #E5D9E2; position: relative; transition: .2s; margin-top: 4px; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.tile.on .switch { background: var(--mint); } .tile.on .switch::after { left: 27px; }
.tiles.toggles .tile.on::after { display: none; }
.fact { margin: 0 0 14px; background: linear-gradient(135deg, #FFF6D6, #FFE6F0); border-radius: 26px; padding: 14px 60px 14px 16px; position: relative; animation: pop-in .4s cubic-bezier(.2,1.6,.4,1); box-shadow: var(--shadow); }
.fact h3 { margin: 0 0 4px; font-size: 26px; }
.fact p { margin: 0; font-size: 19px; }
.fact .speak { position: absolute; right: 10px; top: 12px; }
.namebox { text-align: center; padding: 8px 0; }
.namebox label { display: block; font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.namebox .nrow { display: flex; gap: 10px; align-items: center; justify-content: center; }
#nameInput { font-size: 40px; font-weight: 700; text-align: center; width: 100%; max-width: 380px; padding: 12px 16px; border-radius: 26px; border: 5px solid var(--pink); background: #fff; outline: none; color: var(--ink); }
#nameInput:focus { border-color: var(--lilac); box-shadow: 0 0 0 6px #EEE4FF; }
.dice { width: 72px; height: 72px; border-radius: 22px; font-size: 40px; background: linear-gradient(135deg, #FFE27A, #FFB86B); box-shadow: var(--shadow); flex: none; }
.dice.roll { animation: spin .5s ease; }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.chip { padding: 10px 20px; border-radius: 999px; background: #fff; font-weight: 700; font-size: 22px; box-shadow: 0 3px 8px rgba(170,100,160,.15); }
.wizbar { display: flex; justify-content: space-between; margin-top: 16px; gap: 12px; }
.navbtn { width: 96px; height: 76px; border-radius: 999px; font-size: 34px; color: #fff; box-shadow: var(--shadow), inset 0 -6px 0 rgba(0,0,0,.12); }
.navbtn.back { background: linear-gradient(135deg, #C8B8D8, #B3A3C8); }
.navbtn.next { background: linear-gradient(135deg, var(--mint), #3CC0C9); width: 150px; animation: pulse 2.2s ease-in-out infinite; }
.navbtn:disabled { opacity: .35; animation: none; }
@media (max-width: 760px) { .wizbar { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 6; } }
.shake { animation: shake .5s; }
@keyframes shake { 0%,100% { transform: none; } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

/* reveal */
.reveal { text-align: center; }
.reveal h2 { font-size: clamp(38px, 7vw, 64px); margin: 0 0 8px; }
.reveal .tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0 12px; }
.tag { padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 19px; }
.tag.t1 { background: #FFE1EA; color: #D9476A; } .tag.t2 { background: #E3F6FF; color: #1F86C4; } .tag.t3 { background: #E6FAEF; color: #1E9A68; }
.outs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.out { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px 6px; border-radius: 24px; color: #fff; font-weight: 700; font-size: 19px; min-height: 92px; box-shadow: var(--shadow), inset 0 -5px 0 rgba(0,0,0,.12); text-decoration: none; }
.out .mi { font-size: 36px; line-height: 1; }
.out:nth-child(6n+1) { background: linear-gradient(135deg, var(--coral), var(--orange)); } .out:nth-child(6n+2) { background: linear-gradient(135deg, #F5B800, var(--orange)); }
.out:nth-child(6n+3) { background: linear-gradient(135deg, var(--sky), var(--lilac)); } .out:nth-child(6n+4) { background: linear-gradient(135deg, var(--lilac), var(--pink)); }
.out:nth-child(6n+5) { background: linear-gradient(135deg, var(--mint), #3CC0C9); } .out:nth-child(6n) { background: linear-gradient(135deg, var(--pink), var(--coral)); }
.saved { margin-top: 10px; font-weight: 700; color: #1E9A68; }

/* gallery */
.vhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 14px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.gcat { background: #fff; border-radius: 26px; padding: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .15s; animation: pop-in .4s cubic-bezier(.2,1.4,.4,1) backwards; }
.gcat:active { transform: scale(.95); }
.gcat .stage { border-width: 0; border-radius: 20px; box-shadow: none; }
.gcat .catwrap { height: 90%; }
.gcat .gname { font-weight: 700; font-size: 22px; padding-bottom: 4px; }
.empty { text-align: center; max-width: 480px; margin: 20px auto; }
.empty img { width: 200px; height: auto; } .empty p { font-size: 28px; font-weight: 700; margin: 6px 0 14px; }

/* play */
.play-stage { max-width: 760px; margin: 0 auto; }
.play-stage .catwrap { cursor: pointer; }
.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 760px; margin: 14px auto; }
.meter { background: #fff; border-radius: 20px; padding: 8px 10px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; }
.meter .mi { font-size: 26px; }
.meter .bar { flex: 1; height: 16px; border-radius: 999px; background: #F1E6EE; overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2,1.4,.4,1); }
.meter.low { animation: shake .6s 2; }
@media (max-width: 560px) { .meters { grid-template-columns: repeat(2, 1fr); } }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 760px; margin: 0 auto; }
.act { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 26px; background: #fff; font-weight: 700; font-size: 20px; box-shadow: var(--shadow), inset 0 -5px 0 rgba(170,100,160,.12); min-height: 96px; }
.act .mi { font-size: 44px; line-height: 1.05; }
.thought { position: absolute; right: 10%; top: 8%; background: #fff; border-radius: 50%; width: 76px; height: 76px; display: grid; place-items: center; font-size: 40px; box-shadow: var(--shadow); animation: floaty 2s ease-in-out infinite; z-index: 3; }
.night { position: absolute; inset: 0; background: rgba(40,30,90,.45); opacity: 0; transition: opacity .8s; pointer-events: none; z-index: 2; }
.night.on { opacity: 1; }

/* effects */
.fx { position: absolute; pointer-events: none; font-size: 34px; z-index: 4; animation: fly 1.2s ease-out forwards; }
@keyframes fly { from { opacity: 1; transform: translate(0,0) scale(.6); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.3) rotate(var(--rot)); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(74,46,62,.45); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal-box { position: relative; background: #fff; border-radius: 32px; padding: 18px; max-width: 560px; width: 100%; max-height: 92vh; overflow: auto; text-align: center; animation: pop-in .35s cubic-bezier(.2,1.6,.4,1); }
.modal-box .close { position: absolute; top: 10px; right: 10px; z-index: 2; }
.modal-box img.result { max-width: 100%; max-height: 58vh; border-radius: 20px; box-shadow: var(--shadow); }
.modal-box img.result.st { background: repeating-conic-gradient(#F4ECF2 0 25%, #fff 0 50%) 0 0 / 28px 28px; box-shadow: none; }
.modal-box h3 { margin: 4px 0 10px; font-size: 28px; }
.mbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.mbtns .bigbtn { font-size: 22px; min-height: 64px; padding: 10px 22px; }
.del-b { background: linear-gradient(135deg, #C8B8D8, #B3A3C8); }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(30px); background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 999px; font-weight: 600; opacity: 0; transition: .3s; z-index: 70; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- phone layout fixes ---- */
@media (max-width: 760px) {
  /* backdrop-filter would turn the top bar into the containing block of the fixed bottom tab bar */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255,255,255,.94); }
  #makeStage { height: min(33vh, 270px); }
  .stage-col { top: 70px; }
  .guide { margin-bottom: 8px; }
  .guide-fuzz { width: 64px; }
  .guide .bubble { font-size: 19px; min-height: 48px; }
  .panel { padding-bottom: 96px; }
  .wizbar { position: fixed; left: 0; right: 0; bottom: calc(74px + env(safe-area-inset-bottom)); margin: 0; padding: 8px 14px; z-index: 35;
    background: linear-gradient(to top, rgba(255,240,246,.97) 70%, rgba(255,240,246,0)); }
  .navbtn { height: 64px; width: 86px; font-size: 30px; }
  .navbtn.next { width: 140px; }
  .is-card .wizbar { display: none; }
  #v-make { padding-bottom: 10px; }
}

/* ---- credit footer (Afra) ---- */
.credit { max-width: 760px; margin: 8px auto 18px; padding: 12px 20px; text-align: center; font-size: 16px; line-height: 1.4; color: var(--ink-soft);
  background: rgba(255,255,255,.72); border-radius: 24px; box-shadow: 0 4px 14px rgba(170,100,160,.12); border: 2px dashed #FFC6DD; }
.credit p { margin: 0; }
.credit .c1 { font-size: 17px; color: var(--ink); }
.credit .afra { color: var(--coral); font-weight: 700; }
.credit .c2 { margin-top: 2px; }
@media (max-width: 760px) {
  .credit { margin: 6px 12px 12px; font-size: 15px; padding: 10px 14px; }
  .credit .c1 { font-size: 16px; }
  /* on the Make screen the Back/Next bar is fixed above the tab bar: leave room so it never covers the footer */
  body[data-view="make"] .credit { margin-bottom: 96px; }
  body[data-view="make"]:has(#v-make.is-card) .credit { margin-bottom: 12px; }
}
