/* ============ Tokens ============ */
:root {
  --pink: #ff4fb3;
  --pink-hot: #ff2d9a;
  --pink-2: #ff9bd2;
  --pink-pale: #ffe0f1;
  --magenta: #c81f8f;
  --magenta-dk: #8f0f66;
  --purple: #7b2fbf;
  --purple-2: #a35ce6;
  --purple-dk: #4a1773;
  --lilac: #ecdcff;
  --teal: #3fd0c4;
  --yellow: #ffd23f;
  --ink: #3a1840;
  --panel: #2a1d34;
  --panel-2: #3b2a48;
  --white: #fff;
  --accent: var(--pink);
  --font-pop: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-px: "Pixelify Sans", ui-monospace, monospace;
  --gloss: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0) 52%);
  --r: 18px;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  /* sparkle wand cursor */
  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M9 2l2.2 6.3L18 9l-5.4 3.8L14.5 19 9 15.2 3.5 19l1.9-6.2L0 9l6.8-.7z' fill='%23ff4fb3' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M12 13l17 17' stroke='%23fff' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M12 13l17 17' stroke='%23a35ce6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 9 9, auto;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.18) 0 2px, transparent 3px) 0 0 / 90px 90px,
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.12) 0 1.5px, transparent 2.5px) 0 0 / 60px 60px,
    linear-gradient(135deg, #e0218a, #b2167e 45%, #6a1a8a);
  color: var(--ink);
  font-family: var(--font-pop);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
@media (pointer: fine) {
  body, button, a, input, label { cursor: var(--cursor); }
}
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.pixel { font-family: var(--font-px); letter-spacing: .02em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 8px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--magenta); color: #fff; margin: 0; font-size: 1.4rem; }

/* ============ Console bezel ============ */
.bezel {
  position: relative;
  height: 100dvh;
  padding: clamp(6px, 1.6vw, 18px);
}
.screen {
  position: relative;
  height: 100%;
  border-radius: clamp(14px, 2vw, 26px);
  overflow: hidden;
  background: #2a0f3a;
  box-shadow:
    0 0 0 4px #ff8fd0,
    0 0 0 8px var(--magenta-dk),
    inset 0 0 0 3px rgba(255,255,255,.25),
    0 20px 50px rgba(40, 0, 50, .5);
}
.scene {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ============ Shared pieces ============ */
.logo { margin: 0; text-align: center; line-height: .9; }
.logo__name {
  display: inline-block;
  font-size: clamp(3rem, 10vw, 6.5rem);
  font-weight: 800;
  color: var(--pink);
  letter-spacing: .01em;
  transform: rotate(-4deg);
  text-shadow:
    0 0 0 #fff, 3px 3px 0 #fff, -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff,
    0 4px 0 #fff, 0 -4px 0 #fff, 4px 0 0 #fff, -4px 0 0 #fff,
    6px 8px 0 var(--purple), 7px 10px 18px rgba(60, 0, 80, .45);
  background: linear-gradient(180deg, #ffb3df 0%, var(--pink) 45%, var(--pink-hot) 100%);
  -webkit-background-clip: text; background-clip: text;
}
.logo__sub {
  display: block;
  margin-top: .3em;
  font-family: var(--font-px);
  font-size: clamp(.95rem, 2.2vw, 1.3rem);
  color: #fff;
  text-shadow: 2px 2px 0 var(--purple);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.chip-link {
  display: inline-block;
  font-weight: 800;
  color: #fff;
  background: var(--purple);
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--purple-dk), inset 0 1px 0 rgba(255,255,255,.4);
}
.chip-link:hover { background: var(--purple-2); }

/* Bratz-style slanted menu buttons */
.menu { display: grid; gap: 10px; }
.menu__btn {
  position: relative;
  border: 0;
  padding: 10px 22px;
  min-height: 48px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.12) 0 6px, transparent 6px 14px),
    linear-gradient(180deg, var(--purple-2), var(--purple));
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  text-shadow: 0 2px 0 var(--purple-dk);
  transition: transform .15s var(--ease-pop), filter .15s;
}
.menu__btn::after {
  content: ""; position: absolute; inset: 3px 6% 50% 6%;
  background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0));
  border-radius: 4px; pointer-events: none;
}
.menu__btn:hover, .menu__btn:focus-visible { transform: translateX(4px) scale(1.04); filter: brightness(1.12); }
.menu__btn:active { transform: scale(.96); }
.menu__btn--hot {
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.14) 0 6px, transparent 6px 14px),
    linear-gradient(180deg, #ff7cc7, var(--pink-hot));
  text-shadow: 0 2px 0 var(--magenta-dk);
}
.menu__btn--small { min-height: 40px; font-size: .95rem; padding: 6px 20px; }
.menu__btn:focus-visible { outline: none; filter: brightness(1.15) drop-shadow(0 0 0 var(--yellow)) drop-shadow(0 0 4px var(--yellow)); }

/* Mute toggle */
.mute {
  position: absolute; z-index: 30;
  top: calc(clamp(6px, 1.6vw, 18px) + 10px);
  right: calc(clamp(6px, 1.6vw, 18px) + 10px);
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid #fff;
  background: var(--gloss), linear-gradient(180deg, var(--purple-2), var(--purple));
  box-shadow: 0 3px 0 var(--purple-dk);
  font-size: 1.2rem;
  display: grid; place-items: center;
}
.mute:hover { filter: brightness(1.12); }

/* Room backdrop (pink bedroom with bubble wallpaper + wood floor) */
.room {
  background:
    linear-gradient(180deg, #fff 0 5px, #f6c3dd 5px 9px, rgba(0,0,0,.08) 9px 16px, transparent 16px) left 0 bottom 26% / 100% 34px no-repeat,
    repeating-linear-gradient(90deg, #e9967a 0 92px, #d98468 92px 95px, #f0a587 95px 190px, #d98468 190px 193px) left 0 bottom 0 / 100% 27% no-repeat,
    radial-gradient(circle at 50% 50%, transparent 0 34px, rgba(255,255,255,.55) 35px 38px, transparent 39px) 0 0 / 150px 150px,
    radial-gradient(circle at 50% 50%, transparent 0 14px, rgba(255,255,255,.45) 15px 17px, transparent 18px) 75px 75px / 150px 150px,
    linear-gradient(180deg, #ffb6dc, #ff9ccf);
}
.room::before { /* teal star decal */
  content: "★";
  position: absolute; right: 9%; top: 6%;
  font-size: clamp(60px, 9vw, 120px);
  color: var(--teal);
  opacity: .9;
  transform: rotate(12deg);
  text-shadow: 0 4px 0 rgba(0,0,0,.08);
  pointer-events: none;
}

/* ============ 1. Loading ============ */
.scene--loading {
  align-items: center; justify-content: center; gap: 14px;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, #a33fd6 0%, #6a1a9a 45%, #2c0b47 100%);
  color: #fff;
}
.sky-sparkles, .sky-sparkles::before, .sky-sparkles::after {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 1.5px, transparent 2px) 10px 20px / 80px 70px,
    radial-gradient(circle, #ffd6f0 0 1px, transparent 1.5px) 40px 50px / 110px 90px;
  animation: twinkle 3s ease-in-out infinite alternate;
}
.sky-sparkles::before { content: ""; animation-delay: -1.5s; background-position: 55px 5px, 0 30px; }
.sky-sparkles::after { content: ""; animation-delay: -.7s; background-size: 140px 120px, 60px 100px; }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }

.loading__label { margin: 18px 0 0; font-size: 1.2rem; text-shadow: 2px 2px 0 var(--purple-dk); }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.progress {
  position: relative;
  width: min(480px, 86vw); height: 30px;
  border-radius: 999px;
  background: #3a0f55;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px var(--pink), inset 0 3px 6px rgba(0,0,0,.4), 0 0 30px rgba(255, 79, 179, .55);
  overflow: visible;
}
.progress__fill {
  position: relative;
  height: 100%; width: 0%;
  border-radius: 999px;
  background:
    var(--gloss),
    repeating-linear-gradient(115deg, rgba(255,255,255,.25) 0 10px, transparent 10px 20px),
    linear-gradient(90deg, var(--pink-2), var(--pink-hot));
  background-size: auto, 40px 100%, auto;
  animation: stripes .8s linear infinite;
}
@keyframes stripes { to { background-position: 0 0, 40px 0, 0 0; } }
.progress__sparkle {
  position: absolute; right: -14px; top: 50%;
  transform: translateY(-50%);
  font-size: 28px; color: #fff;
  text-shadow: 0 0 8px #fff, 0 0 16px var(--pink);
  animation: spin 1.4s linear infinite;
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }
.progress__pct { margin: 0; font-size: 1.1rem; }
.tip {
  position: relative;
  margin: 20px 0 0;
  max-width: 460px; min-height: 3.2em;
  padding: 12px 18px;
  text-align: center;
  background: #fff; color: var(--purple);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--pink);
  transition: opacity .25s;
}
.tip::before {
  content: ""; position: absolute; left: 50%; top: -10px; margin-left: -10px;
  border: 10px solid transparent; border-top: 0; border-bottom-color: #fff;
}

/* ============ 2. Title ============ */
.scene--title {
  flex-direction: row; align-items: center; justify-content: center;
  gap: clamp(20px, 5vw, 70px);
  padding: 30px clamp(16px, 4vw, 60px);
  overflow-y: auto;
}
.title__left { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 22px; z-index: 1; }
.press-start {
  border: 4px solid #fff;
  border-radius: 999px;
  padding: 14px 34px;
  font-family: var(--font-px);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-weight: 600;
  color: #fff;
  background: var(--gloss), linear-gradient(180deg, #ff7cc7, var(--pink-hot));
  box-shadow: 0 6px 0 var(--magenta-dk), 0 10px 24px rgba(120, 0, 80, .4);
  text-shadow: 2px 2px 0 var(--magenta-dk);
  transition: transform .15s var(--ease-pop);
}
.press-start:hover { transform: scale(1.06); }
.press-start:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--magenta-dk); }
.blink { animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.title__progress { margin: 0; color: #fff; text-shadow: 2px 2px 0 var(--purple); min-height: 1.2em; }

/* MySpace-style profile card */
.profile {
  z-index: 1;
  flex-shrink: 0;
  width: min(420px, 100%);
  background: #fff;
  border: 3px solid var(--purple);
  border-radius: 12px;
  box-shadow: 8px 8px 0 rgba(74, 23, 115, .35);
  font-size: .95rem;
  overflow: hidden;
  transform: rotate(1.2deg);
}
.profile__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--gloss), linear-gradient(180deg, var(--purple-2), var(--purple));
  color: #fff; font-weight: 800; font-size: 1.15rem;
}
.profile__online { font-family: var(--font-px); font-size: .85rem; color: #b6ffcf; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.profile__online i { width: 10px; height: 10px; border-radius: 50%; background: #3dff7a; box-shadow: 0 0 6px #3dff7a; animation: blink 1.4s steps(2, start) infinite; }
.profile__top { display: flex; gap: 12px; padding: 12px; }
.profile__photo {
  flex: 0 0 120px; height: 150px;
  border: 3px solid var(--pink-2); border-radius: 6px; overflow: hidden;
  background: var(--pink-pale);
}
.profile__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.profile__meta p { margin: 0 0 6px; }
.profile__quote { font-style: italic; color: var(--purple); font-weight: 700; }
.profile__h {
  margin: 0; padding: 4px 12px;
  font-size: .95rem; color: #fff;
  background: linear-gradient(90deg, var(--pink), var(--pink-2));
}
.profile__stats {
  display: grid; grid-template-columns: auto 1fr auto 1fr;
  gap: 4px 10px; margin: 0; padding: 10px 12px;
}
.profile__stats dt { font-weight: 800; color: var(--purple); }
.profile__stats dd { margin: 0; }
.profile__contact {
  list-style: none; margin: 0; padding: 10px 12px 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.profile__contact a, .profile__contact span {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--lilac);
  color: var(--purple-dk);
  font-weight: 700; font-size: .9rem;
  text-decoration: none;
}
.profile__contact a:hover { background: var(--pink-pale); }

/* ============ 3. Closet ============ */
.scene--closet { padding: 12px clamp(10px, 2vw, 22px) 0; }
.hud { display: flex; align-items: center; gap: 14px; padding-right: 60px; z-index: 2; }
.hud__tag {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem); font-weight: 800;
  color: #fff;
  padding: 2px 22px;
  background: linear-gradient(180deg, var(--purple-2), var(--purple));
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
  text-shadow: 0 2px 0 var(--purple-dk);
}
.hud__count { margin: 0; padding: 4px 12px; border-radius: 999px; background: #fff; color: var(--purple); box-shadow: 0 3px 0 var(--pink); }

.closet {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 1.25fr) minmax(220px, .85fr) 48px;
  grid-template-areas: "avatar mirror panel meter";
  gap: clamp(10px, 2vw, 24px);
  align-items: center;
  padding: 8px 0;
}

/* avatar on the zebra rug */
.avatar-stage {
  grid-area: avatar;
  position: relative;
  height: 100%; min-height: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 6%;
}
.avatar {
  position: relative; z-index: 2;
  height: 92%; max-height: 560px;
  aspect-ratio: 200 / 520;
  display: flex; align-items: flex-end; justify-content: center;
  filter:
    drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff)
    drop-shadow(5px 8px 0 rgba(74, 23, 115, .22));
}
.avatar > svg, .avatar > img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.avatar.is-idle > * { animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob { 50% { transform: translateY(-4px) scaleY(1.01); } }
.rug {
  position: absolute; z-index: 1;
  bottom: 2%; left: 50%;
  width: min(100%, 300px); aspect-ratio: 3 / 1;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 6px solid var(--teal);
  background:
    repeating-linear-gradient(100deg, #fff 0 14px, #1b1b1b 14px 22px, #fff 22px 30px, #1b1b1b 30px 34px);
  box-shadow: 0 6px 0 rgba(0,0,0,.12);
}
.arrow {
  position: absolute; z-index: 3; top: 46%;
  width: 54px; height: 54px; border-radius: 50%;
  border: 4px solid #fff;
  background: var(--gloss), linear-gradient(180deg, #ff7cc7, var(--pink-hot));
  color: #fff; font-size: 1.3rem;
  box-shadow: 0 4px 0 var(--magenta-dk), 0 8px 18px rgba(120, 0, 80, .3);
  transition: transform .15s var(--ease-pop);
}
.arrow--prev { left: 0; }
.arrow--next { right: 0; }
.arrow:hover { transform: scale(1.12); }
.arrow:active { transform: scale(.92); }

/* Hollywood vanity mirror with the real photos */
.mirror-wrap { grid-area: mirror; height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.mirror {
  position: relative;
  margin: 0;
  flex: 1; min-height: 0;
  padding: 22px;
  border-radius: 140px 140px 22px 22px;
  background: linear-gradient(160deg, #ffe08a, #e0a93a 40%, #ffd76b 70%, #c48a1c);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.5), 0 10px 0 rgba(74, 23, 115, .18), 0 0 0 5px #fff;
}
.mirror__bulbs {
  position: absolute; inset: 7px;
  border-radius: 130px 130px 16px 16px;
  pointer-events: none;
  background:
    radial-gradient(circle, #fffbe6 0 4px, rgba(255, 245, 190, .7) 5px, transparent 8px) 0 0 / 34px 34px;
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 9px;
  animation: twinkle 1.6s ease-in-out infinite alternate;
}
.mirror__glass {
  position: relative;
  height: 100%;
  border-radius: 120px 120px 10px 10px;
  overflow: hidden;
  background: linear-gradient(160deg, #fdf3ff, #e9d6ff);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.8), inset 0 0 30px rgba(123, 47, 191, .25);
}
.mirror__glass img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background-size: cover; background-position: center;
}
.mirror__glass::after { /* glass shine */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.28) 38%, transparent 46%);
}
.thumbs {
  list-style: none; margin: 0; padding: 4px 2px;
  display: flex; gap: 8px; justify-content: center; flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.thumbs button {
  width: 52px; height: 52px; padding: 0;
  border: 3px solid #fff; border-radius: 8px;
  overflow: hidden;
  background: var(--pink-pale);
  box-shadow: 0 3px 0 rgba(74, 23, 115, .25);
  transition: transform .15s var(--ease-pop);
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.thumbs button:hover { transform: translateY(-3px) rotate(-3deg); }
.thumbs button[aria-current="true"] { border-color: var(--pink-hot); box-shadow: 0 0 0 3px #fff, 0 3px 0 rgba(74, 23, 115, .3); }

/* IMVU-style info panel */
.look-panel {
  grid-area: panel;
  align-self: center;
  padding: 16px 16px 18px;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent), 0 12px 24px rgba(40, 0, 50, .35);
  transition: box-shadow .3s;
}
.look-panel__badge {
  display: inline-block; margin: 0 0 6px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .85rem;
}
.look-panel__name { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.75rem); line-height: 1.05; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.look-panel__sub { margin: 4px 0 8px; color: var(--pink-2); font-size: .95rem; }
.look-panel__blurb { margin: 0 0 10px; font-size: .95rem; color: #f2e6ff; }
.tags { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 1px 10px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: .8rem; font-weight: 800; }

/* Style Meter (vertical, segmented) */
.meter {
  grid-area: meter;
  align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: min(78%, 420px);
}
.meter__icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--pink-hot); font-size: 1.5rem;
  border: 3px solid var(--pink-hot);
  box-shadow: 0 3px 0 var(--magenta-dk);
}
.meter.is-full .meter__icon { animation: pulse 1s ease-in-out infinite; color: var(--yellow); background: var(--pink-hot); }
@keyframes pulse { 50% { transform: scale(1.15); } }
.meter__track {
  position: relative; flex: 1; width: 30px;
  border-radius: 8px; overflow: hidden;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--magenta), inset 0 2px 4px rgba(0,0,0,.15);
}
.meter__fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: var(--gloss), linear-gradient(0deg, var(--pink-hot), var(--pink-2));
  transition: height .6s var(--ease-pop);
}
.meter__segs { position: absolute; inset: 0; display: flex; flex-direction: column; }
.meter__segs i { flex: 1; border-bottom: 3px solid #fff; }
.meter__segs i:last-child { border-bottom: 0; }
.meter__label { margin: 0; font-size: .8rem; color: #fff; text-shadow: 1px 1px 0 var(--magenta-dk); }

/* Bottom button-hint bar (GBA style) */
.hints {
  display: flex; gap: clamp(10px, 3vw, 34px); justify-content: center; align-items: center;
  margin: 0 calc(-1 * clamp(10px, 2vw, 22px));
  padding: 8px 12px;
  background: linear-gradient(180deg, var(--magenta), var(--magenta-dk));
  color: #fff; font-size: 1rem;
  border-top: 3px solid #ff8fd0;
}
.hints kbd {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; margin-right: 4px; padding: 0 4px;
  border-radius: 6px; background: #fff; color: var(--magenta-dk);
  font: inherit; font-size: .8rem;
}
.hints .btn-a, .hints .btn-b { border-radius: 50%; }
.hints .btn-a { background: var(--yellow); }
.hints .btn-b { background: var(--teal); }
.hints__swipe { display: none; }

/* Swap animations */
.sparkle-burst { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.sparkle-burst i {
  position: absolute; left: 50%; top: 50%;
  font-style: normal; color: #fff; font-size: 22px;
  text-shadow: 0 0 6px var(--pink), 0 0 12px #fff;
}

/* ============ Scene wipe (star iris) ============ */
.wipe {
  position: absolute; inset: 0; z-index: 40;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255,255,255,.9) 0 2px, transparent 3px) 0 0 / 40px 40px,
    linear-gradient(135deg, var(--pink), var(--purple));
  clip-path: circle(0% at 50% 50%);
}

/* ============ 4. Photo shoot ============ */
dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(30, 5, 40, .72); backdrop-filter: blur(3px); }
.shoot { width: min(1100px, 96vw); height: min(760px, 94dvh); overflow: visible; }
.camera {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  border-radius: 26px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #5b4038, #3b2622);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.2), 0 0 0 4px #2a1814, 0 0 0 7px var(--pink), 0 30px 60px rgba(0,0,0,.5);
  color: #f6e7d8;
}
.camera__top {
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
  padding: 6px 14px; border-radius: 12px;
  background: #24130f; box-shadow: inset 0 2px 4px rgba(0,0,0,.5);
  font-size: .95rem;
}
.camera__mode { color: var(--pink-2); }
.camera__look { color: #fff; font-weight: 600; flex: 1; text-align: center; }
.camera__batt { color: #7dff9a; letter-spacing: -2px; }
.camera__body { flex: 1; min-height: 0; display: flex; gap: 12px; align-items: stretch; }
.zoom {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 40px; font-size: 1.2rem; color: #ffd8a8;
}
.zoom input {
  writing-mode: vertical-lr; direction: rtl;
  width: 22px; height: 60%;
  accent-color: var(--pink);
}
.viewfinder {
  position: relative; flex: 1; min-width: 0;
  border: 0; padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #0d0708;
  box-shadow: inset 0 0 0 4px #1a0d0b, inset 0 0 40px rgba(0,0,0,.8);
}
.viewfinder__photo { position: absolute; inset: 0; display: block; }
.viewfinder__photo img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform .25s ease-out, filter .3s;
}
.viewfinder__photo.is-live img { filter: blur(14px) brightness(.55) saturate(1.2); }
.viewfinder__grid {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(255,255,255,.18) 33.33%, transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255,255,255,.18) 66.66%, transparent calc(66.66% + 1px)),
    linear-gradient(180deg, transparent calc(33.33% - 1px), rgba(255,255,255,.18) 33.33%, transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255,255,255,.18) 66.66%, transparent calc(66.66% + 1px));
}
.viewfinder__corners i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; opacity: .85; }
.viewfinder__corners i:nth-child(1) { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.viewfinder__corners i:nth-child(2) { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.viewfinder__corners i:nth-child(3) { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.viewfinder__corners i:nth-child(4) { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }
.viewfinder__focus {
  position: absolute; left: 50%; top: 50%; width: 70px; height: 70px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(125, 255, 154, .9);
  border-radius: 6px;
}
.viewfinder.is-focusing .viewfinder__focus { animation: focus .35s ease-out; }
@keyframes focus { from { transform: translate(-50%, -50%) scale(1.5); opacity: .3; } }
.viewfinder__rec { position: absolute; top: 22px; left: 62px; color: #ff4d6d; font-size: .95rem; animation: blink 1.2s steps(2, start) infinite; }
.viewfinder__count {
  position: absolute; bottom: 20px; right: 62px;
  padding: 2px 10px; border-radius: 8px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 1.15rem;
}
.viewfinder__hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 79, 179, .9); color: #fff; white-space: nowrap;
}
.viewfinder.has-shot .viewfinder__hint { opacity: 0; transition: opacity .3s; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.camera__side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 92px; }
.camera__side p { margin: 0; color: #ffd8a8; }
.shutter {
  width: 78px; height: 78px; border-radius: 50%;
  border: 5px solid #e9d6c4;
  background: radial-gradient(circle at 35% 30%, #ff9bd2, var(--pink-hot) 55%, var(--magenta-dk));
  box-shadow: 0 6px 0 #1f0f0c, 0 0 0 4px #24130f;
  transition: transform .08s;
}
.shutter:active, .shutter.is-pressed { transform: translateY(4px); box-shadow: 0 2px 0 #1f0f0c, 0 0 0 4px #24130f; }
.camera__bottom { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 58px; }
.film {
  list-style: none; margin: 0; padding: 6px 10px;
  display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto;
  border-radius: 10px;
  background:
    radial-gradient(circle, #3b2622 0 3px, transparent 3.5px) 4px 2px / 14px 100% repeat-x,
    #120a08;
  min-height: 58px;
  scrollbar-width: thin;
}
.film li { flex: 0 0 auto; }
.film button { width: 44px; height: 44px; padding: 0; border: 2px solid #fff; border-radius: 4px; overflow: hidden; background: #333; }
.film img { width: 100%; height: 100%; object-fit: cover; }
.film li.is-new { animation: drop .45s var(--ease-pop); }
@keyframes drop { from { transform: translateY(-30px) scale(.6); opacity: 0; } }
.wrap-card {
  position: absolute; left: 50%; bottom: 84px; z-index: 5;
  transform: translateX(-50%);
  width: min(380px, 86%);
  padding: 14px 18px 16px;
  text-align: center;
  border-radius: 20px;
  background: #fff; color: var(--ink);
  box-shadow: 0 0 0 4px var(--pink), 0 20px 40px rgba(0,0,0,.4);
  animation: pop .45s var(--ease-pop);
}
.wrap-card__title { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--pink-hot); }
.wrap-card p { margin: 0; }
.wrap-card__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.wrap-card__btns .menu__btn { font-size: .9rem; padding: 8px 10px; }
@keyframes pop { from { transform: translateX(-50%) translateY(40px) scale(.6); opacity: 0; } }

/* ============ Panels (All looks, Stats) ============ */
.panel-dialog { width: min(760px, 94vw); }
.panel {
  max-height: 88dvh; overflow: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 0 0 4px var(--purple), 0 0 0 8px #fff, 0 30px 60px rgba(0,0,0,.4);
}
.panel__bar {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  background: var(--gloss), linear-gradient(180deg, var(--purple-2), var(--purple));
  color: #fff;
}
.panel__bar h2 { margin: 0; font-size: 1.4rem; }
.x {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid #fff; background: var(--pink-hot); color: #fff; font-weight: 800;
}
.look-grid {
  list-style: none; margin: 0; padding: 16px;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.look-grid button {
  width: 100%; padding: 0; border: 3px solid var(--lilac); border-radius: 14px;
  overflow: hidden; background: #fff; text-align: left;
  transition: transform .15s var(--ease-pop), border-color .15s;
}
.look-grid button:hover { transform: translateY(-3px); border-color: var(--pink); }
.look-grid .lg-img { aspect-ratio: 4 / 5; background: var(--pink-pale); overflow: hidden; position: relative; }
.look-grid .lg-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.look-grid .lg-name { display: block; padding: 6px 10px 2px; font-weight: 800; line-height: 1.1; }
.look-grid .lg-sub { display: block; padding: 0 10px 8px; font-size: .8rem; color: #8a6a90; }
.lg-seen { position: absolute; top: 6px; right: 6px; padding: 0 8px; border-radius: 999px; background: var(--yellow); font-size: .75rem; font-weight: 800; }
.look-grid .is-locked .lg-img { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--lilac) 0 10px, #fff 10px 20px); font-size: 3rem; color: var(--purple); }
.look-grid .is-locked button { cursor: not-allowed; }
.panel__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 16px 16px; color: var(--purple); }
.link-btn { border: 0; background: none; color: var(--magenta); text-decoration: underline; font: inherit; padding: 4px; }
#stats-dialog .profile__stats { font-size: 1.05rem; padding: 16px; }

/* ============ 5. Unlock ============ */
.unlock { width: min(440px, 92vw); overflow: visible; }
.unlock::backdrop { background: radial-gradient(circle, rgba(255, 79, 179, .55), rgba(40, 0, 60, .85)); }
.unlock__card {
  position: relative; z-index: 1;
  padding: 26px 22px 24px;
  text-align: center;
  border-radius: 26px;
  background: linear-gradient(180deg, #fff, var(--pink-pale));
  box-shadow: 0 0 0 4px var(--yellow), 0 0 0 9px var(--pink-hot), 0 0 60px rgba(255, 210, 63, .7);
  animation: unlockIn .6s var(--ease-pop);
}
@keyframes unlockIn { from { transform: scale(.3) rotate(-10deg); opacity: 0; } }
.unlock__kicker { margin: 6px 0 0; color: var(--magenta); }
.unlock__title { margin: 2px 0 6px; font-size: 2rem; line-height: 1.05; color: var(--pink-hot); text-shadow: 2px 2px 0 var(--yellow); }
.unlock__doll { height: 220px; display: flex; justify-content: center; filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff); animation: reveal 1.2s .3s both; }
.unlock__doll svg { height: 100%; width: auto; }
@keyframes reveal { from { filter: brightness(0) drop-shadow(0 0 0 #fff); transform: scale(.8); } 60% { filter: brightness(0) drop-shadow(0 0 0 #fff); } }
.unlock__name { margin: 8px 0 14px; font-weight: 800; font-size: 1.25rem; color: var(--purple); }
.lock { position: relative; width: 56px; height: 64px; margin: 0 auto; }
.lock__shackle {
  position: absolute; left: 12px; top: 0; width: 32px; height: 34px;
  border: 7px solid #c9a227; border-bottom: 0; border-radius: 18px 18px 0 0;
  transform-origin: 100% 100%;
  animation: shackle .5s .35s ease-out forwards;
}
@keyframes shackle { to { transform: translateY(-10px) rotate(28deg); } }
.lock__body {
  position: absolute; left: 0; bottom: 0; width: 56px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--gloss), linear-gradient(180deg, var(--yellow), #e0a400);
  color: #fff; font-size: 1.3rem; text-shadow: 0 1px 0 #a87800;
}
.unlock__burst {
  position: absolute; left: 50%; top: 40%; width: 0; height: 0; z-index: 0;
}
.unlock__burst i { position: absolute; font-style: normal; font-size: 26px; color: var(--yellow); text-shadow: 0 0 8px #fff; }

/* ============ Cursor trail ============ */
.sparkle-canvas { position: fixed; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; z-index: 2147483000; }

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .closet { grid-template-columns: minmax(170px, .9fr) minmax(0, 1.3fr) minmax(200px, .9fr) 40px; }
  .menu__btn { font-size: 1rem; }
}

@media (max-width: 820px), (max-height: 520px) and (max-width: 1000px) {
  body { overflow: auto; }
  .bezel { height: auto; min-height: 100dvh; }
  .screen { height: calc(100dvh - 2 * clamp(6px, 1.6vw, 18px)); }

  .scene--title { flex-direction: column; justify-content: flex-start; padding-top: 70px; background-attachment: local; }
  .profile { transform: none; }
  .room::before { top: 2%; right: 4%; font-size: 64px; }

  .scene--closet { padding-top: 10px; overflow-y: auto; background-attachment: local; }
  .hud { padding-right: 56px; flex-wrap: wrap; gap: 8px; }
  .closet {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "meter" "mirror" "avatar" "panel";
    align-items: stretch;
    flex: none;
  }
  .meter { flex-direction: row; height: auto; width: 100%; }
  .meter__icon { width: 34px; height: 34px; font-size: 1.1rem; flex: none; }
  .meter__track { height: 22px; width: auto; }
  .meter__fill { top: 0; bottom: 0; right: auto; height: auto !important; width: var(--fill, 0%); transition: width .6s var(--ease-pop); background: var(--gloss), linear-gradient(90deg, var(--pink-hot), var(--pink-2)); }
  .meter__segs { flex-direction: row; }
  .meter__segs i { border-bottom: 0; border-right: 3px solid #fff; }
  .meter__segs i:last-child { border-right: 0; }

  .mirror-wrap { height: auto; }
  .mirror { flex: none; height: min(50dvh, 520px); padding: 14px; border-radius: 90px 90px 18px 18px; }
  .mirror__glass { border-radius: 80px 80px 8px 8px; }
  .mirror__bulbs { border-radius: 84px 84px 12px 12px; }

  /* the doll stands in front of the mirror's bottom-left corner; arrows sit on its sides */
  .avatar-stage {
    grid-area: mirror; align-self: stretch;
    height: auto; margin-bottom: 70px; padding: 0 0 4px 6px;
    justify-content: flex-start;
    pointer-events: none; z-index: 3;
  }
  .avatar { height: 160px; }
  .rug { left: -6px; width: 110px; transform: none; bottom: -2px; border-width: 4px; }
  .arrow { top: 42%; width: 50px; height: 50px; pointer-events: auto; }
  .arrow--prev { left: -6px; }
  .arrow--next { right: -6px; }
  .meter__label { display: none; }
  .mute { width: 40px; height: 40px; font-size: 1rem; }

  .look-panel { margin: 0 4px 18px; padding: 12px 12px 14px; }
  .look-panel__blurb { display: none; }
  .menu { grid-template-columns: 1fr 1fr; gap: 6px; }
  .menu__btn { padding: 8px 8px; font-size: .9rem; letter-spacing: .02em; clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); }
  .menu__btn--hot { grid-column: 1 / -1; font-size: 1.15rem; }

  .hints { position: sticky; bottom: 0; z-index: 4; font-size: .85rem; }
  .hints > span { display: none; }
  .hints .hints__swipe { display: inline; }

  .shoot { width: 100vw; height: 100dvh; }
  .camera { border-radius: 0; padding: 10px; }
  .camera__top span:nth-child(3) { display: none; }
  .zoom { display: none; }
  .camera__body { flex-direction: column; }
  .camera__side { flex-direction: row; width: auto; }
  .shutter { width: 64px; height: 64px; }
  .viewfinder__rec { left: 58px; }
}

@media (max-width: 420px) {
  .profile__stats { grid-template-columns: auto 1fr; }
  .profile__contact { grid-template-columns: 1fr; }
  .profile__photo { flex-basis: 96px; height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .blink { animation: none; }
}
