/* ============================================================ fonts */
@font-face { font-family: 'Fredoka'; src: url('../../assets/fonts/fredoka-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../../assets/fonts/fredoka-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../../assets/fonts/nunito-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../../assets/fonts/nunito-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../../assets/fonts/nunito-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../../assets/fonts/nunito-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }

/* ============================================================ tokens */
:root {
  --pink: #ff5fa2; --pink-d: #e0247e; --pink-l: #ffe1ef;
  --violet: #7c4dff; --lilac: #b28dff; --lilac-l: #efe6ff;
  --mint: #4fd1b0; --sky: #55c6e0; --sun: #ffd84f; --peach: #ff9a76;
  --ink: #3b1d4a; --ink-2: #5d4270; --muted: #8a6f9e;
  --bg: #fff5fb; --card: #ffffff; --line: #f1e1f5; --shadow: 0 8px 24px rgba(124, 77, 255, .12), 0 2px 6px rgba(255, 95, 162, .08);
  --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  --grad: linear-gradient(135deg, #ff5fa2 0%, #b28dff 100%);
  --grad-sun: linear-gradient(135deg, #ffd84f 0%, #ff9a76 100%);
  --grad-mint: linear-gradient(135deg, #4fd1b0 0%, #55c6e0 100%);
  --font-head: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --top-h: 64px; --dock-h: 74px;
  color-scheme: light;
}

/* ============================================================ base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255, 95, 162, .10) 0, transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(178, 141, 255, .14) 0, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(85, 198, 224, .10) 0, transparent 50%);
  background-attachment: fixed;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0; letter-spacing: .2px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
a.chip, a.icon-btn, a.btn { text-decoration: none; color: inherit; }
a.btn-primary, a.btn-mint { color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============================================================ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 800; font-size: 15px;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s; white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(255, 95, 162, .35); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(255, 95, 162, .45); }
.btn-gold { background: var(--grad-sun); color: #5a2a00; box-shadow: 0 6px 18px rgba(255, 154, 118, .35); }
.btn-mint { background: var(--grad-mint); color: #fff; box-shadow: 0 6px 18px rgba(79, 209, 176, .35); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--lilac); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 15px 30px; font-size: 18px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow); font-size: 19px; transition: transform .15s; }
.icon-btn:active { transform: scale(.92); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 800; font-size: 14px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--lilac-l); color: var(--violet); font-size: 11px; font-weight: 800; }
.input { width: 100%; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-size: 16px; outline: none; }
.input:focus { border-color: var(--lilac); }

.coin-amt { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; }
.coin-ico { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c4 0 18%, #ffd84f 20% 60%, #e9a23b 62%); box-shadow: inset 0 0 0 1.5px #d18a1a; display: inline-block; flex: none; }

/* ============================================================ app shell */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: rgba(255, 245, 251, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(241, 225, 245, .8);
}
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; font-size: 24px; text-decoration: none; color: var(--ink); }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark { width: 34px; height: 34px; }
.topbar .spacer { flex: 1; }
.lvl-chip { position: relative; padding-left: 44px; min-width: 120px; }
.lvl-badge { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-size: 15px; box-shadow: 0 0 0 3px #fff; }
.lvl-bar { height: 6px; border-radius: 6px; background: var(--lilac-l); overflow: hidden; margin-top: 2px; }
.lvl-bar i { display: block; height: 100%; background: var(--grad); border-radius: 6px; transition: width .6s ease; }
.lvl-chip small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; line-height: 1.1; }
.coin-chip.bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.18); } }

#view { flex: 1; padding: 18px 16px calc(var(--dock-h) + 28px); max-width: 1280px; width: 100%; margin: 0 auto; animation: viewIn .35s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.dock {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 40; display: flex; gap: 4px; padding: 6px;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 26px; box-shadow: 0 10px 30px rgba(59, 29, 74, .18);
  max-width: calc(100vw - 16px);
}
.dock a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 12px; border-radius: 20px; text-decoration: none; color: var(--muted); font-weight: 800; font-size: 11px; min-width: 62px; transition: background .2s, color .2s; }
.dock a span { font-size: 22px; line-height: 1.15; transition: transform .2s; }
.dock a.on { background: var(--pink-l); color: var(--pink-d); }
.dock a.on span { transform: translateY(-2px) scale(1.08); }
.dock a:hover span { transform: translateY(-2px); }

.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(24px, 4vw, 34px); }
.page-head p { margin: 2px 0 0; color: var(--muted); font-weight: 600; }
.back-btn { flex: none; }
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.center { text-align: center; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-weight: 700; }
.empty .big { font-size: 46px; display: block; margin-bottom: 8px; }

/* ============================================================ title screen */
.title-screen { min-height: calc(100vh - 40px); display: grid; place-items: center; text-align: center; position: relative; overflow: hidden; padding: 20px 16px; }
.title-screen .hero-avatars { display: flex; justify-content: center; align-items: flex-end; gap: 0; height: min(46vh, 420px); margin: 10px 0 18px; }
.title-screen .hero-avatars svg { height: 100%; width: auto; margin: 0 -22px; filter: drop-shadow(0 10px 18px rgba(124, 77, 255, .2)); }
.title-screen .hero-avatars svg:nth-child(2) { height: 108%; z-index: 2; }
.title-logo { font-family: var(--font-head); font-size: clamp(54px, 11vw, 104px); line-height: .95; background: linear-gradient(135deg, #ff5fa2, #b28dff 55%, #55c6e0); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 rgba(255, 255, 255, .9)) drop-shadow(0 12px 22px rgba(255, 95, 162, .3)); }
.title-sub { font-size: clamp(16px, 2.4vw, 20px); color: var(--ink-2); font-weight: 700; margin: 8px 0 22px; }
.sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sparkles i { position: absolute; color: #fff; font-style: normal; animation: twinkle 3s ease-in-out infinite; text-shadow: 0 0 10px #ff9cc7; }
@keyframes twinkle { 0%, 100% { opacity: .1; transform: scale(.6) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(45deg); } }

/* ============================================================ city hub */
.hub { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; align-items: start; }
.star-card { position: sticky; top: calc(var(--top-h) + 14px); text-align: center; background: linear-gradient(180deg, #fff 0%, #fff0f8 100%); }
.star-card .stage { height: 380px; }
.star-card h2 { font-size: 24px; margin-top: 4px; }
.char-switch { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0 4px; }
.char-switch button { width: 44px; height: 44px; border-radius: 50%; background: var(--pink-l); overflow: hidden; box-shadow: 0 0 0 2px #fff, 0 0 0 4px transparent; transition: box-shadow .2s, transform .2s; }
.char-switch button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pink); }
.char-switch button:hover { transform: translateY(-2px); }
.char-switch svg { width: 100%; height: 100%; }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.place {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 150px; padding: 16px; border-radius: var(--r-lg);
  color: #fff; text-decoration: none; overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.place:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 16px 34px rgba(124, 77, 255, .22); }
.place .pi { position: absolute; right: 10px; top: 4px; font-size: 64px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18)); transition: transform .3s; }
.place:hover .pi { transform: scale(1.12) rotate(6deg); }
.place h3 { font-size: 21px; text-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.place p { margin: 0; font-weight: 700; font-size: 13px; opacity: .92; }
.place::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .35), transparent 50%); pointer-events: none; }
.place .badge { position: absolute; left: 12px; top: 12px; background: #fff; color: var(--pink-d); font-weight: 800; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.daily { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; background: linear-gradient(135deg, #fff8d6, #ffe1ef); }
.daily .big { font-size: 40px; animation: wiggle 2s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.06); } }

/* ============================================================ avatar */
.avatar { width: 100%; height: 100%; overflow: visible; }
.av-anim .av-body, .av-anim .av-head { animation: breathe 3.6s ease-in-out infinite; transform-box: view-box; transform-origin: 150px 200px; }
.av-anim .av-head { animation-name: headBob; }
@keyframes breathe { 50% { transform: translateY(-1.5px) scaleY(1.004); } }
@keyframes headBob { 50% { transform: translateY(-2.5px) rotate(.6deg); } }
.blink { animation: blink 5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(0); } 95.5% { transform: scaleY(1); } }
.stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(ellipse at 50% 100%, #ffd6ec 0%, rgba(255, 214, 236, 0) 60%), linear-gradient(180deg, #fbefff 0%, #fff 100%);
}
.stage svg.avatar { height: 100%; width: auto; max-width: 100%; position: relative; z-index: 1; }
.stage .spot { z-index: 0; position: absolute; left: 50%; top: -20%; width: 70%; height: 120%; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .9), transparent 65%); pointer-events: none; }

/* ============================================================ studio */
.studio { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(340px, 560px); gap: 18px; align-items: start; }
.studio-stage { position: sticky; top: calc(var(--top-h) + 14px); display: flex; flex-direction: column; gap: 10px; }
.studio-stage .stage { height: min(68vh, 640px); min-height: 380px; }
.stage-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.challenge-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--grad); color: #fff; font-weight: 800; }
.challenge-banner .big { font-size: 30px; }
.challenge-banner small { display: block; font-weight: 700; opacity: .9; }
.panel { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.cat-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px; background: linear-gradient(180deg, #fff6fb, #fff); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.cat-tabs button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border-radius: 14px; font-size: 11px; font-weight: 800; color: var(--muted); min-width: 64px; transition: background .2s, color .2s; }
.cat-tabs button span { font-size: 22px; }
.cat-tabs button.on { background: var(--pink-l); color: var(--pink-d); }
.sub-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 14px 0; }
.sub-tabs button { padding: 6px 12px; border-radius: 999px; background: var(--lilac-l); color: var(--violet); font-weight: 800; font-size: 13px; }
.sub-tabs button.on { background: var(--violet); color: #fff; }
.panel-body { padding: 14px; max-height: calc(100vh - var(--top-h) - 220px); overflow-y: auto; }
.section-label { font-family: var(--font-head); font-size: 15px; color: var(--ink-2); margin: 14px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-label:first-child { margin-top: 0; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.item {
  position: relative; border-radius: 16px; background: #faf6fd; padding: 6px 6px 8px; text-align: center; font-size: 11.5px; font-weight: 800; color: var(--ink-2);
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .15s, transform .15s, background .15s; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.item:hover { transform: translateY(-2px); background: #f5eefb; }
.item.on { box-shadow: inset 0 0 0 3px var(--pink); background: #fff0f7; }
.item .thumb { width: 100%; aspect-ratio: 1 / 1.1; display: grid; place-items: center; overflow: hidden; }
.item .thumb svg { width: 100%; height: 100%; }
.item .name { line-height: 1.15; min-height: 26px; display: flex; align-items: center; }
.item .lock { position: absolute; right: 5px; top: 5px; background: #fff; border-radius: 999px; padding: 2px 7px 2px 4px; font-size: 11px; box-shadow: 0 2px 6px rgba(0, 0, 0, .1); display: flex; align-items: center; gap: 3px; }
.item .lock .coin-ico { width: 13px; height: 13px; }
.item.locked .thumb { filter: saturate(.75); opacity: .85; }
.item .lvl-lock { position: absolute; inset: 0; border-radius: 16px; background: rgba(255, 255, 255, .7); display: grid; place-items: center; font-size: 12px; color: var(--violet); }
.item.none .thumb { font-size: 34px; color: var(--muted); }
.item .check { position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--pink); color: #fff; font-size: 12px; display: grid; place-items: center; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 8px 14px; border-radius: 999px; background: #faf6fd; font-weight: 800; font-size: 13px; color: var(--ink-2); box-shadow: inset 0 0 0 2px transparent; transition: .15s; position: relative; }
.opt.on { box-shadow: inset 0 0 0 2px var(--pink); background: #fff0f7; color: var(--pink-d); }
.opt .lock { margin-left: 4px; font-size: 11px; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08), 0 2px 5px rgba(0, 0, 0, .08); transition: transform .15s, box-shadow .15s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--pink); transform: scale(1.06); }
.swatch.custom { background: conic-gradient(#ff5fa2, #ffd84f, #4fd1b0, #55c6e0, #7c4dff, #ff5fa2); position: relative; overflow: hidden; }
.swatch.custom input { position: absolute; inset: -8px; opacity: 0; cursor: pointer; }
.color-row { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: start; margin-top: 10px; }
.color-row > b { font-size: 12px; color: var(--muted); padding-top: 7px; }
.pattern-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pattern-row button { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); }
.pattern-row button.on { box-shadow: 0 0 0 3px var(--pink); }
.pattern-row svg { width: 100%; height: 100%; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; cursor: pointer; }
.toggle input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: #e4d8ee; position: relative; transition: background .2s; cursor: pointer; }
.toggle input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .15); }
.toggle input:checked { background: var(--pink); }
.toggle input:checked::after { transform: translateX(20px); }
.slider { width: 100%; accent-color: var(--pink); }

/* ============================================================ shopping */
.mall { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.shopfront { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .2s; display: block; }
.shopfront:hover { transform: translateY(-4px); }
.shopfront .awning { height: 26px; background: repeating-linear-gradient(90deg, var(--sc) 0 26px, #fff 26px 52px); position: relative; }
.shopfront .awning::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: radial-gradient(circle at 13px 0, var(--sc) 12px, transparent 13px) 0 0 / 52px 10px repeat-x; }
.shopfront .sf-body { padding: 24px 16px 16px; display: flex; gap: 12px; align-items: center; }
.shopfront .sf-ico { font-size: 44px; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--sc) 16%, #fff); flex: none; }
.shopfront h3 { font-size: 19px; }
.shopfront p { margin: 2px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.shop-hero { border-radius: var(--r-lg); padding: 18px 20px; color: #fff; margin-bottom: 16px; display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--sc), color-mix(in srgb, var(--sc) 55%, #7c4dff)); box-shadow: var(--shadow); }
.shop-hero .big { font-size: 48px; }
.shop-hero h1 { font-size: 30px; }
.shop-hero p { margin: 0; opacity: .92; font-weight: 700; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.product { background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s; }
.product:hover { transform: translateY(-3px); }
.product .pv { aspect-ratio: 1 / 1; background: linear-gradient(180deg, #fff6fb, #f6efff); display: grid; place-items: center; padding: 8px; cursor: pointer; }
.product .pv svg { width: 100%; height: 100%; }
.product .pi { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product h4 { font-size: 15px; }
.product .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.product .buy-row { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.owned-badge { color: #2fa37a; font-weight: 800; font-size: 13px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar button { padding: 7px 14px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 800; font-size: 13px; color: var(--ink-2); }
.filter-bar button.on { background: var(--ink); color: #fff; }
.tryon { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: center; }
.tryon .stage { height: 360px; }

/* ============================================================ homes */
.estates { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.estate { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.estate .ext { aspect-ratio: 16 / 11; background: #e8f5ff; }
.estate .ext svg { width: 100%; height: 100%; }
.estate .ei { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.estate h3 { font-size: 20px; }
.estate p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.estate .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.house-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.house-view { background: linear-gradient(180deg, #cdeaff 0%, #fff0f7 85%); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: auto; padding: 8px; touch-action: none; max-height: calc(100vh - 210px); min-height: 360px; display: flex; align-items: flex-end; justify-content: center; }
.house-svg { width: 100%; height: auto; max-height: calc(100vh - 230px); user-select: none; }
.house-svg.interactive .fi, .house-svg.interactive .actor { cursor: grab; }
.house-svg .fi:active, .house-svg .actor:active { cursor: grabbing; }
.room-label { font-family: var(--font-head); font-size: 11px; fill: rgba(59, 29, 74, .45); font-weight: 600; }
.slot-label { font-family: var(--font-head); font-size: 18px; fill: var(--pink-d); font-weight: 700; }
.build-slot { cursor: pointer; }
.build-slot:hover rect { fill-opacity: .85; }
.room.picked rect:first-child { stroke: #ff5fa2; stroke-width: 4; }
.side-panel { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--top-h) + 14px); }
.side-panel .card { padding: 14px; }
.inv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 300px; overflow-y: auto; }
.inv button { background: #faf6fd; border-radius: 14px; padding: 6px; position: relative; font-size: 10.5px; font-weight: 800; color: var(--ink-2); }
.inv button:hover { background: #f3eafc; }
.inv button svg { width: 100%; height: 52px; }
.inv .cnt { position: absolute; right: 4px; top: 4px; background: var(--pink); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; }
.mode-tabs { display: flex; background: #fff; border-radius: 999px; box-shadow: var(--shadow); padding: 4px; }
.mode-tabs button { flex: 1; padding: 8px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--muted); }
.mode-tabs button.on { background: var(--grad); color: #fff; }

/* ============================================================ family & pets */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.member { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 10px 10px 14px; text-align: center; position: relative; }
.member .stage { height: 250px; }
.member h3 { font-size: 18px; margin-top: 6px; }
.member .role { color: var(--muted); font-weight: 800; font-size: 12px; }
.member .acts { display: flex; gap: 6px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.member .active-flag { position: absolute; left: 10px; top: 10px; z-index: 2; }
.hearts { color: var(--pink); letter-spacing: 1px; font-size: 13px; }
.family-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.fa { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow); text-align: left; transition: transform .2s; }
.fa:hover { transform: translateY(-3px); }
.fa .big { font-size: 34px; }
.fa b { display: block; font-family: var(--font-head); font-size: 16px; }
.fa small { color: var(--muted); font-weight: 700; }
.pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pet-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 12px; text-align: center; text-decoration: none; color: var(--ink); transition: transform .2s; display: block; }
.pet-card:hover { transform: translateY(-3px); }
.pet-card .pv { height: 170px; background: radial-gradient(circle at 50% 70%, #fff0f7, #fff 70%); border-radius: 18px; }
.pet-card .pv svg { width: 100%; height: 100%; }
.pet-card h3 { font-size: 18px; margin-top: 4px; }
.need { display: grid; grid-template-columns: 26px 1fr 34px; gap: 8px; align-items: center; font-size: 13px; font-weight: 800; }
.need .bar { height: 12px; background: #f1e8f7; border-radius: 999px; overflow: hidden; }
.need .bar i { display: block; height: 100%; border-radius: 999px; transition: width .6s ease; }
.pet-room { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.pet-stage { height: min(60vh, 520px); border-radius: var(--r-lg); background: radial-gradient(ellipse at 50% 90%, #ffe1ef 0%, transparent 60%), linear-gradient(180deg, #e9f6ff, #fff6fb); box-shadow: var(--shadow); display: grid; place-items: center; position: relative; overflow: hidden; }
.pet-stage svg.pet { width: min(80%, 420px); height: auto; transition: transform .3s; }
.pet-stage svg.pet.bounce { animation: petBounce .6s ease; }
@keyframes petBounce { 30% { transform: translateY(-24px) scale(1.04, .97); } 60% { transform: translateY(0) scale(.97, 1.03); } }
.pet .wag { animation: wag .5s ease-in-out infinite alternate; transform-origin: 140px 160px; transform-box: view-box; }
@keyframes wag { to { transform: rotate(14deg); } }
.float-heart { animation: floatUp 2s ease-in-out infinite; }
.float-heart.d2 { animation-delay: .8s; }
@keyframes floatUp { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }
.pet-fx { position: absolute; font-size: 34px; pointer-events: none; animation: fx 1.2s ease forwards; }
@keyframes fx { from { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; transform: translateY(-10px) scale(1.1); } to { transform: translateY(-90px) scale(1); opacity: 0; } }
.care-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.care-btns button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 18px; background: #faf6fd; font-weight: 800; font-size: 12.5px; transition: transform .15s, background .15s; }
.care-btns button span { font-size: 30px; }
.care-btns button:hover { background: var(--pink-l); transform: translateY(-2px); }
.care-btns button[disabled] { opacity: .4; }

/* ============================================================ runway & salon */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.event { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #fff; box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column; transition: transform .2s; }
.event:hover { transform: translateY(-3px); }
.event .eh { height: 92px; display: grid; place-items: center; font-size: 50px; position: relative; }
.event .ei { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.event h3 { font-size: 18px; }
.event p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.event.locked { filter: grayscale(.7); opacity: .7; }
.event .best { position: absolute; right: 10px; top: 10px; background: #fff; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 800; }
.runway { position: relative; height: min(72vh, 640px); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.runway .floor { position: absolute; left: 50%; bottom: 0; width: 46%; height: 52%; transform: translateX(-50%) perspective(400px) rotateX(48deg); transform-origin: bottom; background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .55)); border-radius: 12px 12px 0 0; }
.runway .walker { position: absolute; left: 50%; bottom: 4%; height: 62%; transform: translateX(-50%) scale(.55); transform-origin: bottom center; transition: transform 3.2s cubic-bezier(.4, .1, .3, 1); }
.runway .walker.walk { transform: translateX(-50%) scale(1); }
.runway .walker svg { height: 100%; width: auto; }
.runway .walker.walk svg { animation: walkBob .55s ease-in-out infinite; }
@keyframes walkBob { 50% { transform: translateY(-6px) rotate(.8deg); } }
.runway .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.runway .flash.go { animation: flash .35s ease; }
@keyframes flash { 30% { opacity: .85; } }
.runway .deco { position: absolute; font-size: 54px; opacity: .85; }
.judges { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 12px; padding: 12px; pointer-events: none; }
.judge { background: rgba(255, 255, 255, .94); border-radius: 18px; padding: 8px 10px; width: 150px; text-align: center; box-shadow: var(--shadow); transform: translateY(140%); transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.judge.show { transform: none; }
.judge .face { width: 56px; height: 56px; margin: -30px auto 2px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px #fff, var(--shadow); overflow: hidden; }
.judge .face svg { width: 100%; height: 100%; }
.judge b { font-size: 12px; display: block; }
.judge .score { font-family: var(--font-head); font-size: 30px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.judge .quote { font-size: 11px; color: var(--ink-2); font-weight: 700; min-height: 28px; }
.result-stars { font-size: 44px; letter-spacing: 4px; text-align: center; }
.result-stars .off { filter: grayscale(1); opacity: .3; }
.breakdown { display: grid; gap: 8px; margin: 12px 0; }
.breakdown .need { grid-template-columns: 130px 1fr 40px; }
.wish-list { display: grid; gap: 8px; }
.wish { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #faf6fd; font-weight: 800; }
.wish .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .1); }
.wish.ok { background: #e6fbf3; color: #1f7a5c; }
.speech { position: relative; background: #fff; border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); font-weight: 700; }
.speech::after { content: ''; position: absolute; left: 28px; bottom: -12px; border: 12px solid transparent; border-top-color: #fff; border-bottom: 0; }

/* ============================================================ photo, trophies, lookbook */
.photo-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.photo-frame { position: relative; aspect-ratio: 3 / 4; margin: 10px auto; width: min(100%, 520px, 54vh); border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 10px #fff, var(--shadow); display: flex; align-items: flex-end; justify-content: center; }
.photo-frame svg.avatar { height: 94%; width: auto; }
.photo-frame .ph-deco { position: absolute; font-size: 44px; }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.trophy { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow); }
.trophy .big { font-size: 34px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-sun); flex: none; }
.trophy.off .big { background: #eee6f2; filter: grayscale(1); opacity: .6; }
.trophy b { font-family: var(--font-head); }
.trophy small { display: block; color: var(--muted); font-weight: 700; }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.look { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 8px; text-align: center; }
.look .stage { height: 200px; }

/* ============================================================ preset picker */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.preset { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 8px 8px 10px; text-align: center; font-weight: 800; transition: transform .2s, box-shadow .2s; }
.preset:hover { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--pink), var(--shadow); }
.preset .stage { height: 210px; }
.preset small { display: block; color: var(--muted); font-size: 11px; }

/* ============================================================ modal, toast, fx */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(59, 29, 74, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.modal-wrap.in { opacity: 1; }
.modal-wrap.out { opacity: 0; }
.modal { position: relative; background: #fff; border-radius: 28px; padding: 24px 22px 20px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 30px 60px rgba(59, 29, 74, .3); transform: translateY(20px) scale(.96); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.modal.wide { width: min(820px, 100%); }
.modal-wrap.in .modal { transform: none; }
.modal-x { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; background: #f6eefb; font-size: 14px; }
.modal-title { font-size: 24px; margin: 0 34px 12px 0; }
.modal-body { color: var(--ink-2); font-weight: 600; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.celebrate { text-align: center; }
.celebrate .big { font-size: 64px; display: block; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(0) rotate(-30deg); } }
#toasts { position: fixed; left: 50%; top: calc(var(--top-h) + 10px); transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: #fff; box-shadow: 0 10px 30px rgba(59, 29, 74, .2); font-weight: 800; animation: toastIn .35s cubic-bezier(.3, 1.4, .5, 1); }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .35s; }
.toast-ico { font-size: 20px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 130; }
.float-text { position: fixed; z-index: 130; font-family: var(--font-head); font-size: 22px; color: var(--pink-d); pointer-events: none; animation: floatAway 1.2s ease forwards; text-shadow: 0 2px 0 #fff; }
@keyframes floatAway { to { transform: translateY(-60px); opacity: 0; } }

/* ============================================================ responsive */
@media (max-width: 980px) {
  .hub, .studio, .house-wrap, .pet-room, .photo-wrap { grid-template-columns: 1fr; }
  .star-card, .studio-stage, .side-panel { position: static; }
  .studio-stage .stage { height: 44vh; min-height: 300px; }
  .panel-body { max-height: none; }
  .star-card .stage { height: 300px; }
}
@media (max-width: 600px) {
  :root { --top-h: 56px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .logo span.word { display: none; }
  .lvl-chip { min-width: 0; padding-right: 10px; }
  .lvl-chip small, .lvl-chip .lvl-bar { display: none; }
  .lvl-chip { padding-left: 40px; height: 36px; }
  #view { padding: 14px 12px calc(var(--dock-h) + 24px); }
  .dock a { min-width: 0; padding: 7px 9px; font-size: 10px; }
  .dock a span { font-size: 20px; }
  .items { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .tryon { grid-template-columns: 1fr; }
  .judge { width: 31%; padding: 6px; }
  .judge .quote { display: none; }
  .breakdown .need { grid-template-columns: 96px 1fr 34px; }
  .place { min-height: 120px; }
  .place .pi { font-size: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
