/* Dressed to Impress - toy-box UI. Phone portrait: view / panel / bottom tabs. Wide: rail | view | panel. */
/* Fredoka (SIL Open Font License 1.1), self-hosted variable latin subset: no request to a font CDN. */
@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/fredoka-latin.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
:root {
  --pink: #ff8fc3; --pink-d: #e9619f; --pink-l: #ffe3f0;
  --lilac: #b99cf5; --lilac-d: #8d6ae0; --lilac-l: #efe7ff;
  --mint: #7fdcc8; --mint-d: #3fb79f; --sun: #ffd166; --sun-d: #e8a93a;
  --ink: #5b3a6e; --ink-soft: #8d74a0; --paper: #fffafd; --line: #f3dcea;
  --r-lg: 26px; --r-md: 18px; --r-sm: 12px;
  --shadow: 0 10px 30px rgba(140, 80, 140, 0.18);
  --font: 'Fredoka', 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  --tabs-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #ffeaf4; color: var(--ink); font-family: var(--font); }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

.app {
  position: fixed; inset: 0; display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, auto) calc(var(--tabs-h) + var(--safe-b));
  grid-template-areas: 'view' 'panel' 'tabs';
}
.view { grid-area: view; position: relative; overflow: hidden; min-height: 0; }
.panel { grid-area: panel; }
.tabs { grid-area: tabs; }

/* ---------- 3D view */
.backdrop { position: absolute; inset: 0; background: linear-gradient(180deg, #ffe4f1 0%, #f4dcff 55%, #fbe9f5 100%); background-size: cover; background-position: center 40%; transition: opacity .4s; }
/* lookdev: the room sits slightly out of focus and softer so the doll pops; a soft glow behind her */
.backdrop { filter: blur(1.6px) saturate(.84) brightness(1.03); transform: scale(1.02); }
.backdrop::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 34% 42% at 50% 50%, rgba(255, 246, 252, .42), rgba(255, 246, 252, 0) 72%); }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#c:active { cursor: grabbing; }
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: max(10px, env(safe-area-inset-top)) 12px 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-right { display: flex; gap: 8px; justify-content: flex-end; }
.logo { display: flex; flex-direction: column; line-height: .9; font-weight: 700; color: #fff; text-shadow: 0 2px 0 var(--pink-d), 0 4px 12px rgba(200, 80, 150, .35); transform: rotate(-4deg); padding: 4px 6px; }
.logo span { font-size: 22px; letter-spacing: .5px; }
.logo small { font-size: 13px; margin: 1px 0 1px 26px; color: #fff4c2; text-shadow: 0 2px 0 var(--sun-d); }

.round-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .88); box-shadow: 0 4px 0 #f2c2dc, 0 6px 16px rgba(160, 80, 140, .2); display: grid; place-items: center; cursor: pointer; transition: transform .12s; padding: 0; }
.round-btn svg { width: 26px; height: 26px; }
.round-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #f2c2dc; }
.round-btn:disabled { opacity: .45; }
.round-btn.wiggle { animation: wiggle .6s; }
@keyframes wiggle { 20% { transform: rotate(-14deg) scale(1.1); } 50% { transform: rotate(12deg) scale(1.15); } 80% { transform: rotate(-5deg); } }

.theme-banner { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow); max-width: calc(100% - 24px); }
.theme-banner .tb-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-banner .tb-name small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }

/* ---------- tabs */
.tabs { display: flex; justify-content: space-around; align-items: stretch; background: #fff; padding: 6px 6px calc(6px + var(--safe-b)); box-shadow: 0 -6px 20px rgba(160, 80, 140, .12); z-index: 3; }
.tab { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; border-radius: var(--r-md); padding: 4px 2px; transition: background .2s, color .2s, transform .15s; }
.tab .ti { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; transition: transform .2s, background .2s; }
.tab .ti svg, .tab .ti img { width: 30px; height: 30px; object-fit: contain; }
.tab.on { color: var(--pink-d); }
.tab.on .ti { background: linear-gradient(180deg, #ffd0e6, #ffb3d6); transform: translateY(-4px) scale(1.06); box-shadow: 0 4px 0 #f59cc7; }
.tab:active .ti { transform: scale(.92); }

/* ---------- panel */
.panel { background: var(--paper); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -8px 24px rgba(160, 80, 140, .14); overflow-y: auto; overscroll-behavior: contain; max-height: 46vh; min-height: 34vh; z-index: 2; padding: 0 12px 14px; scrollbar-width: thin; scrollbar-color: #f3c6dd transparent; }
.panel h3 { margin: 12px 4px 8px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel h3 .hint { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.panel-head { position: sticky; top: 0; z-index: 2; background: var(--paper); padding-top: 10px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.section { margin-bottom: 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.chip.on { background: linear-gradient(180deg, #ff9fcb, #ff7fb6); color: #fff; box-shadow: 0 3px 0 var(--pink-d); }
.chip .dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .12); }
.chip.small { padding: 6px 11px; font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.card { position: relative; border: 0; border-radius: var(--r-md); background: #fff; padding: 6px 6px 8px; box-shadow: 0 3px 0 var(--line), 0 6px 14px rgba(160, 80, 140, .08); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .12s; }
.card:active { transform: scale(.95); }
.card .thumb { width: 100%; aspect-ratio: 1; border-radius: 13px; display: grid; place-items: center; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.card .thumb > svg, .card .thumb > img[src*='/icons/'] { width: 62%; height: 62%; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .08)); }
.card .name { font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.1; min-height: 2.2em; display: flex; align-items: center; }
.card.on { box-shadow: 0 0 0 3px var(--pink), 0 4px 0 var(--pink-d); }
.card .badge { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--pink); color: #fff; display: grid; place-items: center; box-shadow: 0 2px 0 var(--pink-d); }
.card .badge svg { width: 15px; height: 15px; }
.card.none .thumb { background: repeating-linear-gradient(45deg, #fff, #fff 8px, #fdf0f6 8px, #fdf0f6 16px); }

.zone-box { background: linear-gradient(180deg, #fff, #fff6fb); border-radius: var(--r-md); box-shadow: inset 0 0 0 2px var(--line); padding: 8px 10px 10px; margin-bottom: 10px; }
.zone-box .zb-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.zone-box .zb-title > span { white-space: nowrap; }
.zone-box .zb-title .chips { padding-bottom: 4px; flex-wrap: wrap; overflow: visible; }
.swatches { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08), 0 2px 0 rgba(0, 0, 0, .06); transition: transform .1s; padding: 0; min-width: 0; }
.sw:active { transform: scale(.85); }
.sw.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--pink-d); transform: scale(1.05); }
.sw.wide { aspect-ratio: auto; border-radius: 999px; }
.swatch-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tool-btn { border: 0; border-radius: 999px; padding: 7px 12px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; position: relative; }
.tool-btn input[type=color] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.tool-btn .rainbow { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(#ff5e8a, #ffc23d, #8fd14f, #2ec4b6, #3a86ff, #c04cfd, #ff5e8a); }
.prints { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 4px; scrollbar-width: none; }
.print { flex: none; width: 46px; height: 46px; border-radius: 14px; border: 0; cursor: pointer; background-size: cover; box-shadow: inset 0 0 0 2px var(--line); padding: 0; }
.print.on { box-shadow: 0 0 0 3px var(--pink); }
.print.none { background: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-soft); }

.slider-row { display: flex; align-items: center; gap: 12px; padding: 6px 6px 4px; }
.slider-row svg { width: 26px; height: 26px; flex: none; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 999px; background: linear-gradient(90deg, #ffd6ea, #d9c8ff); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 var(--pink-d), inset 0 0 0 4px var(--pink); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 4px solid var(--pink); cursor: pointer; }

.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.opt { border: 0; background: #fff; border-radius: var(--r-sm); padding: 4px 4px 6px; box-shadow: 0 2px 0 var(--line), inset 0 0 0 2px var(--line); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; }
.opt img, .opt canvas { width: 54px; height: 54px; border-radius: 50%; }
.opt.on { box-shadow: 0 0 0 3px var(--pink), 0 3px 0 var(--pink-d); }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 4px 6px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--pink-d); }

.btn { border: 0; border-radius: 999px; padding: 12px 22px; font-size: 17px; font-weight: 700; cursor: pointer; color: #fff; background: linear-gradient(180deg, #ffa3cf, #ff74b1); box-shadow: 0 5px 0 var(--pink-d), 0 8px 18px rgba(233, 97, 159, .3); transition: transform .1s; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--pink-d); }
.btn.lilac { background: linear-gradient(180deg, #ccb4ff, #a888f2); box-shadow: 0 5px 0 var(--lilac-d), 0 8px 18px rgba(141, 106, 224, .3); }
.btn.mint { background: linear-gradient(180deg, #a2ecd9, #6fd3bc); box-shadow: 0 5px 0 var(--mint-d), 0 8px 18px rgba(63, 183, 159, .3); }
.btn.sun { background: linear-gradient(180deg, #ffe08f, #ffc547); box-shadow: 0 5px 0 var(--sun-d); color: #6b4300; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn svg { width: 22px; height: 22px; }

.show-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding-top: 12px; }
.show-card { border: 0; border-radius: var(--r-lg); padding: 16px 12px; color: #fff; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 120px; box-shadow: 0 5px 0 rgba(0, 0, 0, .12); transition: transform .12s; }
.show-card:active { transform: translateY(3px); }
.show-card b { font-size: 19px; }
.show-card span { font-size: 13px; opacity: .95; }
.show-card svg { width: 40px; height: 40px; }
.show-card.c1 { background: linear-gradient(135deg, #ff9ccc, #ff6fae); }
.show-card.c2 { background: linear-gradient(135deg, #b9a0ff, #8f6cf0); }
.show-card.c3 { background: linear-gradient(135deg, #8de6d3, #4fc7ad); }

/* ---------- overlay / modals */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(90, 50, 110, .35); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal { background: var(--paper); border-radius: 28px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal h2 { margin: 0 0 10px; font-size: 22px; text-align: center; }
.modal .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.modal input[type=text] { width: 100%; font: inherit; font-size: 18px; padding: 10px 14px; border-radius: 14px; border: 0; box-shadow: inset 0 0 0 2px var(--line); color: var(--ink); background: #fff; }
.close-x { float: right; margin: -6px -6px 0 0; }

.theme-card { border-radius: 24px; padding: 22px 18px; text-align: center; color: #fff; background: linear-gradient(135deg, var(--c1, #ff9ccc), var(--c2, #b9a0ff)); box-shadow: 0 6px 0 rgba(0, 0, 0, .12); animation: flip .6s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes flip { from { transform: rotateY(90deg) scale(.8); } }
.theme-card .tc-icon { width: 76px; height: 76px; margin: 0 auto 6px; background: rgba(255, 255, 255, .3); border-radius: 50%; display: grid; place-items: center; }
.theme-card .tc-icon svg { width: 48px; height: 48px; }
.theme-card h3 { margin: 4px 0; font-size: 28px; text-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.theme-card p { margin: 6px 0 10px; font-size: 16px; }
.theme-card .tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.theme-card .tags span { background: rgba(255, 255, 255, .3); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; }

.look-group h3 { margin: 14px 2px 8px; }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.look { border: 0; border-radius: var(--r-md); background: #fff; padding: 6px; box-shadow: 0 3px 0 var(--line); cursor: pointer; text-align: center; font-weight: 600; font-size: 13px; }
.look img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 4px; background: #fdf0f6; }
.look .hearts { color: var(--pink-d); font-size: 12px; }
.empty { text-align: center; color: var(--ink-soft); padding: 20px; }

/* judges */
.judges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.judge { background: #fff; border-radius: 20px; padding: 10px 8px; text-align: center; box-shadow: 0 4px 0 var(--line); opacity: 0; transform: translateY(20px) scale(.9); transition: all .45s cubic-bezier(.2, 1.4, .4, 1); }
.judge.in { opacity: 1; transform: none; }
.judge svg.animal { width: 80px; height: 80px; }
.judge .jn { font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.judge .jh { display: flex; justify-content: center; gap: 2px; min-height: 24px; margin: 4px 0; }
.judge .jh svg { width: 20px; height: 20px; transform: scale(0); transition: transform .3s cubic-bezier(.2, 1.8, .4, 1); }
.judge .jh svg.in { transform: scale(1); }
.judge .jc { font-size: 13px; line-height: 1.25; min-height: 3.6em; }
.score-title { text-align: center; font-size: 26px; font-weight: 700; color: var(--pink-d); margin: 12px 0 0; opacity: 0; transition: opacity .4s; }
.score-title.in { opacity: 1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }

.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: #fff; color: var(--ink); font-weight: 600; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); z-index: 30; animation: toast 2.2s forwards; white-space: nowrap; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -20px); } 12%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.loading { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; text-align: center; background: linear-gradient(180deg, #ffe4f1, #efdcff); transition: opacity .5s; font-weight: 600; }
.loading.done { opacity: 0; pointer-events: none; }
.loading.updating { z-index: 100; }
.loading.updating[hidden] { display: none; }
.loader-doll { display: flex; gap: 10px; justify-content: center; }
.loader-doll i { width: 18px; height: 18px; border-radius: 50%; background: var(--pink); animation: bob 0.9s infinite ease-in-out; }
.loader-doll i:nth-child(2) { background: var(--lilac); animation-delay: .15s; }
.loader-doll i:nth-child(3) { background: var(--mint); animation-delay: .3s; }
@keyframes bob { 50% { transform: translateY(-14px); } }

/* show-time / photo modes: full-screen view */
.app.fullview { grid-template-rows: 1fr 0 0; grid-template-columns: 1fr; }
.app.fullview .panel, .app.fullview .tabs { display: none; }
.app.fullview .hud { display: none; }
.photo-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 10px calc(12px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; background: linear-gradient(180deg, transparent, rgba(255, 240, 248, .9) 30%); }
.photo-bar .chips { max-width: 100%; }
.photo-bar .row { display: flex; gap: 10px; }
.runway-caption { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); color: #fff; font-size: 34px; font-weight: 700; text-shadow: 0 3px 0 rgba(150, 50, 120, .6), 0 0 24px rgba(255, 150, 220, .8); opacity: 0; transition: opacity .5s; white-space: nowrap; pointer-events: none; }
.runway-caption.in { opacity: 1; }

/* ---------- wide screens and landscape phones */
@media (min-aspect-ratio: 1/1) and (min-width: 640px) {
  :root { --tabs-h: 0px; }
  .app { grid-template-columns: 96px minmax(0, 1fr) clamp(300px, 34vw, 430px); grid-template-rows: 1fr; grid-template-areas: 'tabs view panel'; }
  .tabs { flex-direction: column; justify-content: center; gap: 8px; padding: 12px 8px; box-shadow: 6px 0 20px rgba(160, 80, 140, .1); }
  .tab { flex: none; padding: 8px 2px; font-size: 13px; }
  .tab .ti { width: 50px; height: 50px; }
  .tab .ti svg, .tab .ti img { width: 38px; height: 38px; }
  .panel { max-height: none; min-height: 0; border-radius: var(--r-lg) 0 0 var(--r-lg); box-shadow: -8px 0 24px rgba(160, 80, 140, .12); padding: 0 16px 18px; }
  .panel-head { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .app.fullview { grid-template-columns: 0 1fr 0; grid-template-areas: 'tabs view panel'; }
  .logo span { font-size: 28px; }
  .logo small { font-size: 15px; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 500px) {
  :root { --tabs-h: 0px; }
  .app { grid-template-columns: 72px minmax(0, 1fr) min(44vw, 340px); grid-template-rows: 1fr; grid-template-areas: 'tabs view panel'; }
  .tabs { flex-direction: column; padding: 4px; gap: 0; }
  .tab { font-size: 10px; padding: 2px; }
  .tab .ti { width: 34px; height: 34px; }
  .tab .ti svg, .tab .ti img { width: 26px; height: 26px; }
  .panel { max-height: none; min-height: 0; border-radius: var(--r-lg) 0 0 var(--r-lg); }
  .round-btn { width: 38px; height: 38px; }
  .round-btn svg { width: 22px; height: 22px; }
  .logo span { font-size: 17px; }
  .app.fullview { grid-template-columns: 0 1fr 0; }
}
@media (max-width: 520px) {
  .round-btn { width: 42px; height: 42px; } .round-btn svg { width: 24px; height: 24px; }
  .hud-right { gap: 6px; } .logo span { font-size: 18px; } .logo small { font-size: 11px; margin-left: 20px; }
}
@media (max-width: 520px) {
  .judge { padding: 8px 4px; border-radius: 16px; }
  .judge svg.animal { width: 62px; height: 62px; }
  .judge .jn { font-size: 13px; }
  .judge .jh svg { width: 15px; height: 15px; }
  .judge .jc { font-size: 12px; }
  .modal { padding: 16px 12px; }
}
@media (max-width: 360px) { .round-btn { width: 38px; height: 38px; } .hud-right { gap: 4px; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition-duration: .01s !important; } }

/* ---------- sculpt sliders (Me tab) */
.sc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 4px; }
.sc-head h3 { margin: 0; }
.sc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-actions .btn svg { width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.sc-group { background: linear-gradient(180deg, #fff, #fff6fb); border-radius: var(--r-md); box-shadow: inset 0 0 0 2px var(--line); padding: 6px 10px 4px; margin: 10px 0; }
.sc-group h4 { margin: 2px 0 2px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--pink-d); }
.sc-row { display: grid; grid-template-columns: minmax(64px, 30%) 1fr 26px; align-items: center; gap: 10px; min-height: 44px; }
.sc-label { font-weight: 600; font-size: 14px; line-height: 1.1; }
.sc-track { position: relative; display: flex; align-items: center; padding: 6px 0 12px; }
.sc-ends { position: absolute; left: 4px; right: 4px; bottom: -2px; display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 600; color: var(--ink-soft); pointer-events: none; }
.sc-track input { position: relative; z-index: 1; height: 12px; }
.sc-tick { position: absolute; top: 12px; width: 3px; height: 20px; margin: -10px 0 0 -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px var(--line); z-index: 0; }
.sc-with-icons { display: flex; align-items: center; gap: 8px; }
.sc-with-icons svg { width: 24px; height: 24px; flex: none; }
.reset-dot { width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; cursor: default; background: #f1e8f5; box-shadow: inset 0 0 0 2px #e6d9ee; transition: transform .15s, background .15s; }
.reset-dot.on { cursor: pointer; background: radial-gradient(circle at 35% 35%, #fff 0 18%, var(--pink) 22%); box-shadow: 0 2px 0 var(--pink-d); }
.reset-dot.on:hover { transform: scale(1.15); }
.reset-dot.on:active { transform: scale(.9); }
.empty.small { padding: 10px; font-size: 13px; }

/* ---------- opening title card (OPENING = 'title') and picks-page previews */
.title-card { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: max(7vh, 40px); pointer-events: auto; cursor: pointer; animation: tc-in .5s ease-out both; transition: opacity .5s, transform .5s; }
.title-card .logo.big span { font-size: clamp(40px, 11vw, 76px); }
.title-card .logo.big small { font-size: clamp(22px, 5.5vw, 38px); margin-left: clamp(40px, 12vw, 90px); }
.title-card p { margin: 14px 0 0; font-weight: 600; font-size: clamp(16px, 4.2vw, 22px); color: #fff; text-shadow: 0 2px 0 var(--pink-d), 0 3px 10px rgba(200, 80, 150, .35); }
.title-card.out { opacity: 0; transform: translateY(-24px); pointer-events: none; }
@keyframes tc-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.app.doll-only .backdrop { display: none; }

/* ---------- round 5: dressing UX (app) */
/* phone portrait: one fixed panel height, so picking a chip or an item never makes the screen jump */
.panel { height: 42vh; min-height: 0; max-height: none; }
@media (min-aspect-ratio: 1/1) and (min-width: 640px) { .panel { height: auto; } }
@media (min-aspect-ratio: 1/1) and (max-height: 500px) { .panel { height: auto; } }
.sheet { grid-area: panel; z-index: 4; animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.app.fullview .sheet { display: none; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--paper); margin: 0 -12px 6px; padding: 10px 12px 8px; }
.sheet-head b { font-size: 17px; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sheet-head .hint { font-size: 13px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .btn svg { width: 18px; height: 18px; }
.colour-bar { display: flex; align-items: center; gap: 8px; padding: 0 2px 8px; }
.colour-bar .cb-dots { display: flex; }
.colour-bar .cb-dots i { width: 20px; height: 20px; border-radius: 50%; margin-right: -6px; box-shadow: 0 0 0 2px #fff, inset 0 0 0 1.5px rgba(0, 0, 0, .12); }
.colour-bar .cb-name { flex: 1; min-width: 0; margin-left: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.colour-bar .btn { padding: 7px 14px; font-size: 14px; flex: none; }
.colour-bar .btn svg { width: 20px; height: 20px; }
.swatches.quick { grid-template-columns: repeat(6, minmax(0, 46px)); justify-content: space-between; gap: 10px 8px; }
.more-btn { display: block; margin: 12px auto 2px; border: 0; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--pink-d); cursor: pointer; padding: 6px 12px; border-radius: 999px; }
.more-btn::after { content: ' \25BE'; }
.more-btn.on::after { content: ' \25B4'; }
.more-btn.on + div { margin-top: 8px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; gap: 6px; }
.opt.pic .opt-pic { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fff, #ffe9f3); display: grid; place-items: center; }
.opt.pic .opt-pic svg { width: 42px; height: 42px; }
.show-card .photo-icon svg { width: 44px; height: 44px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .12)); }
/* ta-da: a tiny judge pops in with one word */
.tada-pop { position: absolute; right: 14px; top: 24%; display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; box-shadow: var(--shadow); pointer-events: none; z-index: 2; animation: tada-pop 1.9s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.tada-pop .tp-face svg { width: 40px; height: 40px; display: block; }
.tada-pop b { font-size: 18px; color: var(--pink-d); white-space: nowrap; }
@keyframes tada-pop { 0% { opacity: 0; transform: scale(.4) translateY(10px); } 14% { opacity: 1; transform: scale(1.08); } 22%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }
/* slot-machine Surprise */
.slot-machine { position: absolute; left: 50%; top: max(70px, calc(env(safe-area-inset-top) + 64px)); transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; background: linear-gradient(180deg, #ffd1e6, #c9b6ff); border-radius: 22px; box-shadow: 0 5px 0 var(--lilac-d), var(--shadow); z-index: 3; pointer-events: none; animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .4s, transform .4s; }
.slot-machine.out { opacity: 0; transform: translate(-50%, -16px); }
.reel { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 0 var(--lilac-d); }
.reel-win { width: 58px; height: 58px; border-radius: 14px; background: #fff; overflow: hidden; display: grid; place-items: center; box-shadow: inset 0 3px 6px rgba(90, 50, 110, .2); }
.reel-win > * { width: 100%; height: 100%; object-fit: contain; animation: reel-flip .085s linear; }
.reel-win > span { display: grid; place-items: center; } .reel-win > span img, .reel-win > span svg { width: 70%; height: 70%; }
.reel.landed .reel-win { box-shadow: 0 0 0 3px var(--sun), inset 0 3px 6px rgba(90, 50, 110, .1); animation: pop .35s cubic-bezier(.2, 1.8, .4, 1); }
.reel.landed .reel-win > * { animation: none; }
@keyframes reel-flip { from { transform: translateY(-40%); opacity: .4; } }
/* photo studio: one chip row at a time */
.photo-tabs { display: flex; gap: 4px; background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 3px; }
.photo-tabs button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.photo-tabs button.on { background: var(--pink); color: #fff; }
/* load failure */
.oops-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 45; width: min(320px, calc(100% - 32px)); background: var(--paper); border-radius: 26px; box-shadow: var(--shadow); padding: 18px 18px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); }
body > .oops-card, .app > .oops-card { position: fixed; }
.oops-card .oops-face svg { width: 72px; height: 72px; }
.oops-card b { font-size: 18px; }
.oops-card.busy .btn { opacity: .6; pointer-events: none; }
