/* =========================================================
   KZNA GLOW UP v2.1 — CHROME BLUE × Clean Beauty × Minimal Editorial
   ========================================================= */
:root {
  --color-navy: #0b0f1a;
  --color-white: #f7f9fc;
  --color-ice-blue: #a8d8f4;
  --color-chrome: #c8d2dc;
  --color-pink: #f3b8d1;
  --color-charcoal: #171c25;
  --color-muted: #8793a6;
  --color-red: #9e1b2f;

  --bg: var(--color-navy);
  --fg: #f4f7fa;
  --fg-mute: rgba(244, 247, 250, 0.62);
  --line: rgba(200, 210, 220, 0.22);
  --surface: rgba(255, 255, 255, 0.05);
  --panel: #131a2a;
  --accent: var(--color-ice-blue);
  --btn-bg: #f4f7fa;
  --btn-fg: var(--color-charcoal);

  --font-en: 'Space Grotesk', 'Noto Sans JP', system-ui, sans-serif;
  --font-body: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', system-ui, sans-serif;

  --gutter: 20px;
  --radius: 14px;
  --btn-h: 54px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --t: 280ms;
}
html[lang='ko'] { --font-body: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', system-ui, sans-serif; }
html[lang='en'] { --font-body: 'Space Grotesk', 'Noto Sans JP', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #05070d;
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { overflow: hidden; line-break: strict; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- App frame & themes (spec §11.2) ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  transition: background-color 500ms var(--ease), color 500ms var(--ease);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.app[data-theme='ice'],
.app[data-theme='pearl'],
.app[data-theme='offwhite'],
.app[data-theme='gallery'] {
  --fg: var(--color-charcoal);
  --fg-mute: rgba(23, 28, 37, 0.56);
  --line: rgba(23, 28, 37, 0.12);
  --surface: rgba(23, 28, 37, 0.04);
  --panel: #ffffff;
  --accent: #4f8fbf;
  --btn-bg: var(--color-charcoal);
  --btn-fg: #f4f7fa;
}
.app[data-theme='ice'] { --bg: #eaf3fa; }
.app[data-theme='pearl'] { --bg: var(--color-white); }
.app[data-theme='pearl'] .app[data-theme='offwhite'] { --bg: #fbfaf8; }
.app[data-theme='gallery'] { --bg: #f4f6f9; }
@media (min-width: 481px) {
  .app { box-shadow: 0 0 0 1px rgba(200, 210, 220, 0.08), 0 30px 80px rgba(0, 0, 0, 0.5); }
}

.screen-host { position: absolute; inset: 0; }
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 66px) var(--gutter) calc(var(--safe-bottom) + 16px);
  animation: screen-in var(--t) var(--ease) both;
}
.screen.is-leaving { animation: screen-out 220ms var(--ease) both; pointer-events: none; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes screen-out { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- Top bar ---------- */
.topbar {
  position: absolute;
  z-index: 30;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 10px) calc(var(--gutter) - 10px) 8px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.progress { flex: 1; min-width: 0; padding: 0 2px; }
.progress__label {
  display: flex; justify-content: space-between; gap: 8px;
  font-family: var(--font-en); font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--fg-mute); margin-bottom: 6px; white-space: nowrap;
}
.progress__label b { color: var(--fg); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.progress__bar { display: flex; gap: 3px; height: 2px; }
.progress__seg { flex: 1; background: var(--line); border-radius: 2px; overflow: hidden; position: relative; }
.progress__seg.is-group-start { margin-left: 4px; }
.progress__seg::after {
  content: ''; position: absolute; inset: 0; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 400ms var(--ease);
}
.progress__seg.is-done::after { transform: scaleX(1); }
.progress__seg.is-current::after { transform: scaleX(0.5); }

.icon-btn {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--fg);
  transition: transform 120ms, opacity var(--t);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.3; pointer-events: none; }
.icon-btn svg { width: 20px; height: 20px; }
.lang-btn { font-family: var(--font-en); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.top-controls { display: flex; gap: 0; }

/* ---------- Typography ---------- */
.eyebrow { font-family: var(--font-en); font-size: 11px; letter-spacing: 0.1em; color: var(--fg-mute); margin: 0; }
.headline { font-family: var(--font-en); font-weight: 700; font-size: 26px; letter-spacing: 0.01em; line-height: 1.1; margin: 4px 0 0; }
.lede { font-size: 14px; line-height: 1.6; color: var(--fg-mute); margin: 6px 0 0; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: var(--btn-h);
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  transition: transform 120ms var(--ease), opacity var(--t), background-color var(--t);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--ghost { border: 1px solid var(--line); color: var(--fg); }
.btn--sm { min-height: 44px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 6px;
  font-size: 12.5px; letter-spacing: 0.02em; color: var(--fg-mute);
}
.link-btn--en { font-family: var(--font-en); letter-spacing: 0.08em; font-size: 11px; }
.link-btn:active { opacity: 0.6; }

/* ---------- Intro ---------- */
.intro {
  padding: calc(var(--safe-top) + 58px) 0 calc(var(--safe-bottom) + 18px);
  overflow: hidden; background: radial-gradient(120% 60% at 50% 0%, #17223a 0%, var(--color-navy) 60%);
}
.intro__brand { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 0 0; animation: rise 800ms 200ms var(--ease) both; }
.intro__cobrand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.intro__kzna { height: 20px; width: auto; opacity: 0.95; }
.intro__lua { height: 15px; width: auto; opacity: 0.75; }
.intro__x { font-family: var(--font-en); font-size: 11px; color: var(--color-chrome); opacity: 0.6; }
.intro__title {
  margin: 0; font-family: var(--font-en); font-weight: 700; font-size: 58px; line-height: 1; letter-spacing: 0.01em;
  background: linear-gradient(180deg, #ffffff 20%, #c8d2dc 60%, #a8d8f4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro__stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; display: flex; flex-direction: column; justify-content: center; }
.intro__halo {
  position: absolute; left: 50%; top: 45%; width: 120%; aspect-ratio: 1.2; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(168, 216, 244, 0.2), rgba(168, 216, 244, 0.05) 55%, transparent 78%);
  pointer-events: none;
}
.intro__track { position: relative; width: 100%; flex: none; }
.intro__slot {
  flex: none; border-radius: 14px; overflow: hidden; background: linear-gradient(110deg, #141b2b 30%, #1f2940 50%, #141b2b 70%); background-size: 200% 100%;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(200, 210, 220, 0.14);
  position: absolute; left: 0; top: 0; transform-origin: 50% 50%;
  opacity: 0.45; transition: opacity 460ms var(--ease);
  animation: shimmer 1.2s linear infinite;
}
.intro__slot.is-anim { transition: transform 380ms var(--ease), opacity 340ms var(--ease); }
.intro__slot.is-ready { animation: none; }
.intro__slot.is-active { opacity: 1; }
.intro__slot canvas { backface-visibility: hidden; }
.intro__slot canvas { width: 100%; height: 100%; display: block; }
.intro__steps { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.intro__steps span { font-family: var(--font-en); font-size: 10px; font-weight: 700; letter-spacing: 0.2em; color: rgba(200, 210, 220, 0.4); transition: color 400ms var(--ease); }
.intro__steps span.is-done { color: rgba(200, 210, 220, 0.75); }
.intro__steps span.is-on { color: var(--color-ice-blue); }
.intro__steps i { width: 14px; height: 1px; background: rgba(200, 210, 220, 0.3); }
.intro__dots { position: relative; display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.intro__dots button { width: 32px; height: 28px; display: grid; place-items: center; }
.intro__dots button::before { content: ''; width: 6px; height: 6px; border-radius: 6px; background: rgba(200, 210, 220, 0.3); transition: width 400ms var(--ease), background-color 400ms; }
.intro__dots button.is-on::before { width: 20px; background: var(--color-ice-blue); }
.intro__bottom { flex: none; padding: 6px var(--gutter) 0; text-align: center; animation: rise 700ms 700ms var(--ease) both; }
/* same voice as the small caps above: Space Grotesk, letter-spaced, chrome / ice tones */
.intro__head { font-family: var(--font-en); font-weight: 500; font-size: 12px; letter-spacing: 0.3em; padding-left: 0.3em; margin: 0; color: var(--color-ice-blue); }
.intro__copy { font-size: 15px; font-weight: 500; letter-spacing: 0.04em; color: #f4f7fa; margin: 8px 0 18px; }
.intro .btn--primary { background: #fff; color: var(--color-charcoal); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Avatar ---------- */
.avatar { position: relative; aspect-ratio: 3 / 4; }
.avatar__face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.avatar__overlay { position: absolute; pointer-events: none; z-index: 5; } /* above the sheet mask, like a real headband */
.fade-swap { animation: fade 260ms var(--ease) both; }

/* ---------- Member select ---------- */
.select__head { text-align: center; }

.select { padding-bottom: calc(var(--safe-bottom) + 16px); background: radial-gradient(120% 60% at 50% 0%, #17223a 0%, var(--color-navy) 60%); }
.select__head { text-align: center; }
.select .eyebrow { color: rgba(200, 210, 220, 0.7); }
.select .headline { color: #fff; }
.sel-stage { position: relative; flex: 1; min-height: 0; margin: 10px calc(var(--gutter) * -1) 0; overflow: hidden; touch-action: pan-y; }
.sel-halo { position: absolute; left: 50%; top: 50%; width: 110%; aspect-ratio: 1; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(168, 216, 244, 0.18), transparent 75%); pointer-events: none; }
.sel-card {
  position: absolute; left: 0; border-radius: 22px; overflow: hidden; background: #cdcdd4; cursor: pointer;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(200, 210, 220, 0.14);
  opacity: 0.4; transform-origin: 50% 50%; transition: opacity 360ms var(--ease);
}
.sel-card.is-anim { transition: transform 380ms var(--ease), opacity 360ms var(--ease); }
.sel-card.is-active { opacity: 1; cursor: default; }
.sel-card.is-chosen { animation: chosen 380ms var(--ease) both; }
@keyframes chosen { 50% { scale: 1.03; } 100% { scale: 1; } }
.sel-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.sel-card__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 15, 26, 0) 52%, rgba(11, 15, 26, 0.55) 78%, rgba(11, 15, 26, 0.85) 100%); }
.sel-card__num { position: absolute; top: 14px; left: 16px; font-family: var(--font-en); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: rgba(23, 28, 37, 0.55); }
.sel-card__info { position: absolute; left: 18px; right: 18px; bottom: 16px; color: #fff; }
.sel-card__name { margin: 0; font-family: var(--font-en); font-weight: 700; font-size: 38px; letter-spacing: 0.05em; line-height: 1; }
.sel-card__meta { margin: 8px 0 0; display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: rgba(244, 247, 250, 0.82); }
.sel-card__meta span:first-child { font-weight: 700; color: #fff; }
.sel-picks { display: flex; justify-content: center; gap: 14px; padding: 14px 0 12px; }
.sel-pick { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 52px; }
.sel-pick__face { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(200, 210, 220, 0.25); transition: box-shadow 300ms var(--ease), transform 200ms var(--ease); }
.sel-pick__face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; transform: scale(1.7); transform-origin: 50% 30%; }
.sel-pick__name { font-family: var(--font-en); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: rgba(200, 210, 220, 0.55); transition: color 300ms; }
.sel-pick.is-on .sel-pick__face { box-shadow: 0 0 0 2px var(--color-ice-blue), 0 0 0 5px rgba(168, 216, 244, 0.2); }
.sel-pick.is-on .sel-pick__name { color: #fff; }
.sel-pick:active .sel-pick__face { transform: scale(0.94); }
.select .btn--primary { background: #fff; color: var(--color-charcoal); }
@media (max-height: 700px) {
  .sel-pick__face { width: 40px; height: 40px; }
  .sel-picks { padding: 10px 0 8px; }
  .sel-card__name { font-size: 32px; }
}

/* ---------- Mission shell (prep / skincare / final) ---------- */
.mission__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mission__stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  margin: 6px calc(var(--gutter) * -1) 0;
  touch-action: none; overflow: hidden;
}
.mission__stage::before {
  content: ''; position: absolute; left: 50%; top: 46%; width: 92%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(168, 216, 244, 0.35), rgba(243, 184, 209, 0.08) 60%, transparent);
}
.face-zoom { position: relative; flex: none; transform-origin: 50% 40%; transition: transform 600ms var(--ease); }
.face-zoom.is-close { transform: scale(1.4) translateY(8%); }
.face-box { position: relative; width: 100%; height: 100%; }
.face-box .avatar { position: absolute; inset: 0; }
.face-box__layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.instruction { min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14px; color: var(--fg); }

.tray { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.tray__product { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(23, 28, 37, 0.08); transition: transform 160ms var(--ease), box-shadow var(--t); }
.tray__product svg, .tray__product img { width: 54px; height: 54px; object-fit: contain; }
.tray__product.is-active { box-shadow: 0 0 0 2px #4f8fbf, 0 6px 18px rgba(79, 143, 191, 0.25); }
.tray__product.is-pulse { animation: pulse-ring 1.6s ease-in-out infinite; }
.tray__product:active { transform: scale(0.94); }
@keyframes pulse-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(79, 143, 191, 0.5), 0 6px 18px rgba(23, 28, 37, 0.08); } 50% { box-shadow: 0 0 0 6px rgba(79, 143, 191, 0), 0 6px 18px rgba(23, 28, 37, 0.08); } }
.tray__meta { min-width: 0; flex: 1; }
.tray__brand { font-family: var(--font-en); font-size: 10px; letter-spacing: 0.14em; color: var(--fg-mute); }
.tray__name { font-size: 12.5px; font-weight: 500; line-height: 1.4; margin-top: 2px; }
.tray__status { font-family: var(--font-en); font-size: 12px; color: var(--fg-mute); white-space: nowrap; }

.zone-ring {
  position: absolute; transform: translate(-50%, -50%); border-radius: 50%;
  border: 1.5px dashed rgba(79, 143, 191, 0.55);
  pointer-events: none; transition: opacity 400ms var(--ease), transform 400ms var(--ease);
  animation: ring-pulse 1.8s ease-in-out infinite;
}
.zone-ring.is-done { animation: none; opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
@keyframes ring-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.done-panel {
  position: absolute; z-index: 20; left: var(--gutter); right: var(--gutter); bottom: calc(var(--safe-bottom) + 16px);
  padding: 16px; border-radius: 18px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--fg);
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(23, 28, 37, 0.14);
  animation: panel-in 340ms var(--ease) both;
}
.done-panel__row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.done-panel__check { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--color-ice-blue); color: var(--color-charcoal); }
.done-panel__title { font-family: var(--font-en); font-weight: 700; letter-spacing: 0.06em; font-size: 14px; }
.done-panel__sub { font-size: 11.5px; opacity: 0.62; margin-top: 2px; line-height: 1.4; }
@keyframes panel-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Draggable props (turban, sheet mask) */
.drag-prop {
  position: absolute; z-index: 12; touch-action: none; cursor: grab;
  transform: translate(-50%, -50%);
  transition: transform 160ms var(--ease);
}
.drag-prop img, .drag-prop svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 14px rgba(23, 28, 37, 0.18)); pointer-events: none; }
.drag-prop.is-dragging { transform: translate(-50%, -50%) scale(1.06); cursor: grabbing; transition: none; }
.drag-prop.is-return { transition: left 380ms var(--ease), top 380ms var(--ease), width 380ms var(--ease), transform 160ms; }
.drag-prop.is-enter { animation: prop-in 420ms var(--ease) both; }
@keyframes prop-in { from { opacity: 0; translate: 0 40px; scale: 0.7; } }
.drop-target {
  position: absolute; border-radius: 50%; border: 1.5px dashed rgba(79, 143, 191, 0.5);
  transform: translate(-50%, -50%); pointer-events: none; transition: opacity var(--t), border-color var(--t), background-color var(--t);
}
.drop-target.is-near { border-color: #4f8fbf; border-style: solid; background: rgba(168, 216, 244, 0.14); }

.mask-sheet { position: absolute; z-index: 4; pointer-events: none; }
.mask-sheet img { display: block; width: 100%; height: auto; opacity: 0; transform: scale(0.85); transition: opacity 420ms var(--ease), transform 520ms var(--ease); }
.mask-sheet.is-on img { opacity: 1; transform: none; }
.mask-sheet.is-off img { opacity: 0; transform: translateY(-14%) scale(1.04); transition-duration: 700ms; }

.bubble {
  position: absolute; z-index: 10;
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  display: grid; place-items: center;
  animation: bubble-in 420ms var(--ease) both, float 2.8s ease-in-out infinite;
}
.bubble::before {
  content: ''; position: absolute; inset: 4px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(243, 184, 209, 0.35) 45%, rgba(168, 216, 244, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 14px rgba(243, 184, 209, 0.35);
}
.bubble svg { position: relative; width: 20px; height: 20px; color: #e48bb2; }
.bubble.is-pop { animation: pop 260ms var(--ease) forwards; pointer-events: none; }
@keyframes bubble-in { from { opacity: 0; transform: scale(0.3); } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes pop { to { opacity: 0; transform: scale(1.6); } }

/* Glow */
.glow-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; touch-action: none; }
.heart-gauge { position: absolute; z-index: 5; left: 50%; bottom: 4%; width: 78px; transform: translateX(-50%); pointer-events: none; transition: transform 700ms var(--ease); }
.heart-gauge svg { width: 100%; height: auto; overflow: visible; }
.heart-gauge.is-full { transform: translateX(-50%) scale(1.25); }
.glow-light {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(42% 36% at 50% 42%, rgba(168, 216, 244, 0.55), rgba(200, 210, 220, 0.18) 55%, transparent 75%);
  transition: opacity 900ms var(--ease);
}
.glow-light.is-on { opacity: 1; }
.glow-complete {
  position: absolute; z-index: 9; left: 0; right: 0; top: 4%; text-align: center;
  font-family: var(--font-en); font-weight: 700; font-size: 26px; letter-spacing: 0.08em;
  color: #4f8fbf; text-shadow: 0 0 18px rgba(168, 216, 244, 0.9);
  animation: complete-in 1800ms var(--ease) both; pointer-events: none;
}
@keyframes complete-in { 0% { opacity: 0; transform: scale(0.9); } 30%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }
.counter { font-family: var(--font-en); font-size: 12px; color: var(--fg-mute); }

/* Finger hint */
.finger-hint { position: absolute; z-index: 25; width: 44px; height: 44px; margin: -6px 0 0 -14px; pointer-events: none; opacity: 0; transition: opacity 400ms; }
.finger-hint.is-on { opacity: 1; }
.finger-hint svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25)); }
.finger-hint.is-rub svg { animation: rub 1.2s ease-in-out infinite; }
.finger-hint.is-tap svg { animation: tap 1.2s ease-in-out infinite; }
.finger-hint.is-drag svg { animation: drag 1.6s var(--ease) infinite; }
.finger-hint.is-up svg { animation: drag 1.6s var(--ease) infinite; }
@keyframes rub { 0%, 100% { transform: translateX(-14px); } 50% { transform: translateX(14px); } }
@keyframes tap { 0%, 100% { transform: scale(1); } 40% { transform: scale(0.84); } }
@keyframes drag { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 80% { transform: translateY(-140px); opacity: 1; } 100% { transform: translateY(-140px); opacity: 0; } }

/* ---------- Makeup studio ---------- */
.studio { padding-bottom: 0; }
.studio__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.studio__member { font-family: var(--font-en); font-size: 12px; letter-spacing: 0.08em; color: var(--fg-mute); }
.studio__tools { display: flex; gap: 2px; margin-right: -8px; }
.studio__stage { position: relative; flex: 1; min-height: 0; margin: 4px calc(var(--gutter) * -1) 0; touch-action: none; overflow: hidden; }
.studio__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.studio__headband {
  position: absolute; z-index: 6; right: 12px; top: 10px; min-height: 36px;
  font-family: var(--font-body); letter-spacing: 0.02em; color: var(--fg);
  background: rgba(255, 255, 255, 0.9); box-shadow: 0 2px 8px rgba(23, 28, 37, 0.08);
}
.studio__headband[aria-pressed='true'] { border-color: #4f8fbf; }
.studio .studio .studio__hint {
  position: absolute; z-index: 4; left: 50%; bottom: 10px; transform: translateX(-50%);
  max-width: 88%; padding: 6px 12px; border-radius: 20px;
  background: rgba(23, 28, 37, 0.78); color: #fff; font-size: 12px; text-align: center; white-space: nowrap;
  pointer-events: none; transition: opacity var(--t);
}
.studio__hint:empty { opacity: 0; }

.panel {
  flex: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter) calc(var(--safe-bottom) + 14px);
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(23, 28, 37, 0.05);
}
.tabs { display: flex; }
.tab { flex: 1; min-height: 46px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--fg-mute); }
.tab b { font-family: var(--font-en); font-size: 12px; letter-spacing: 0.06em; }
.tab span { font-size: 9.5px; }
.tab.is-active { color: var(--fg); }
.tab.is-active::after { content: ''; position: absolute; left: 24%; right: 24%; bottom: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.tab.has-value b::after { content: ''; display: inline-block; width: 5px; height: 5px; margin-left: 4px; border-radius: 50%; background: var(--color-pink); vertical-align: middle; }
.panel__body { max-height: 30vh; overflow-y: auto; overscroll-behavior: contain; padding: 10px 0 2px; }
.swatches { display: flex; gap: 10px; align-items: flex-start; overflow-x: auto; padding: 8px 8px 6px; margin: 0 -8px; scrollbar-width: none; }
.swatches::-webkit-scrollbar { display: none; }
.swatch { flex: none; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.swatch__dot { width: 42px; height: 42px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(23, 28, 37, 0.1); position: relative; transition: transform 120ms var(--ease); }
.swatch__dot::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid transparent; transition: border-color var(--t); }
.swatch.is-selected .swatch__dot::after { border-color: var(--color-charcoal); }
.swatch:active .swatch__dot { transform: scale(0.92); }
.swatch__dot--none { background: #fff; }
.swatch__dot--none::before { content: ''; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 1.5px; background: #c94c69; transform: rotate(45deg); }
.swatch__name { font-family: var(--font-en); font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-align: center; line-height: 1.2; }
.control-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; min-height: 44px; }
.control-row label { font-size: 12px; color: var(--fg-mute); flex: none; min-width: 3.5em; }
.control-row output { font-family: var(--font-en); font-size: 12px; width: 3em; text-align: right; color: var(--fg-mute); }
.range { flex: 1; -webkit-appearance: none; appearance: none; height: 44px; background: transparent; touch-action: pan-x; }
.range::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--v, 40%), var(--line) var(--v, 40%)); }
.range::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line); }
.range::-moz-range-progress { height: 3px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10.5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(23, 28, 37, 0.3); }
.range::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(23, 28, 37, 0.3); }
.range:disabled { opacity: 0.35; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--font-en); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.toggle i { width: 38px; height: 22px; border-radius: 22px; background: var(--line); position: relative; transition: background-color var(--t); }
.toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform var(--t) var(--ease); }
.toggle[aria-pressed='true'] i { background: #4f8fbf; }
.toggle[aria-pressed='true'] i::after { transform: translateX(16px); }
.studio__cta { margin-top: 10px; }

/* ---------- Final touch: before / after ---------- */
.final .btn { font-size: 14px; white-space: nowrap; padding: 0 10px; }
.final .btn-row > .btn--ghost { flex: 0 0 38%; }

/* ---------- Photo card ---------- */
.result { align-items: center; }
.shutter { position: absolute; inset: 0; z-index: 40; pointer-events: none; background: #000; animation: shutter 900ms var(--ease) forwards; }
.shutter::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; animation: flash 900ms ease-out forwards; }
@keyframes shutter { 0% { opacity: 0; } 25% { opacity: 0.85; } 100% { opacity: 0; } }
@keyframes flash { 0%, 35% { opacity: 0; } 45% { opacity: 0.9; } 100% { opacity: 0; } }
.result__head { text-align: center; }
.card-wrap { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; perspective: 1200px; margin: 10px 0; }
.card-wrap img, .card-skeleton {
  height: 100%; max-width: 100%; aspect-ratio: 9 / 16; object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(200, 210, 220, 0.18);
}
.card-wrap img.is-flip { animation: card-flip 700ms var(--ease) both; }
.card-wrap img.is-swap { animation: card-swap 380ms var(--ease) both; }
.card-skeleton { background: linear-gradient(110deg, #141b2b 30%, #1f2940 50%, #141b2b 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes card-flip { 0% { opacity: 0; transform: rotateY(-100deg) scale(0.85); } 100% { transform: none; } }
@keyframes card-swap { 0% { transform: rotateY(-14deg); opacity: 0.6; } 100% { transform: none; } }
.frames { display: flex; gap: 8px; width: 100%; margin-bottom: 10px; }
.frame-opt { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); transition: border-color var(--t); }
.frame-opt.is-selected { border-color: var(--color-ice-blue); background: rgba(168, 216, 244, 0.08); }
.frame-opt i { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); }
.frame-opt span { font-family: var(--font-en); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; }
.result__actions { width: 100%; }
.result__more { display: flex; justify-content: space-between; flex-wrap: wrap; margin-top: 2px; }
.result__cta { width: 100%; display: flex; justify-content: center; }

/* ---------- Chips ---------- */
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); font-family: var(--font-en); font-size: 11px; letter-spacing: 0.06em; color: var(--fg-mute); background: #fff; }
.chip.is-active { border-color: var(--color-charcoal); color: var(--fg); }

/* ---------- Toast ---------- */
.toast {
  position: absolute; z-index: 60; left: 50%; top: calc(var(--safe-top) + 64px);
  transform: translate(-50%, -10px); max-width: calc(100% - 48px);
  padding: 10px 16px; border-radius: 12px; background: rgba(23, 28, 37, 0.92); color: #fff;
  font-size: 13px; text-align: center; opacity: 0; pointer-events: none; transition: opacity var(--t), transform var(--t);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Rotate guard ---------- */
.rotate-guard { display: none; }
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .rotate-guard {
    position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    background: var(--color-navy); color: #f4f7fa; font-size: 15px;
  }
  .rotate-guard__icon { width: 36px; height: 60px; border: 2px solid var(--color-ice-blue); border-radius: 8px; animation: rotate-hint 2s var(--ease) infinite; }
  @keyframes rotate-hint { 0%, 30% { transform: rotate(-90deg); } 70%, 100% { transform: rotate(0); } }
}

/* ---------- Small screens ---------- */
@media (max-height: 700px) {
  :root { --btn-h: 50px; }
  .headline { font-size: 22px; }
    .tray__product { width: 54px; height: 54px; }
  .tray__product svg { width: 44px; height: 44px; }
  .panel__body { max-height: 32vh; padding-top: 6px; }
  .swatch__dot { width: 36px; height: 36px; }
  .control-row { margin-top: 2px; min-height: 40px; }
  .range { height: 40px; }
  .toggle { min-height: 40px; }
}

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

/* ---------- Narrow phones (iPhone SE etc.) ---------- */
@media (max-width: 360px) {
  .studio .headline { font-size: 21px; white-space: nowrap; }
  .studio__tools .icon-btn { width: 38px; }
}

/* ---------- Photo backdrop mode (portraits keep their grey studio background) ---------- */
.photo-mode .avatar { border-radius: 18px; overflow: hidden; }
.photo-mode .face-box { border-radius: 22px; overflow: hidden; box-shadow: 0 14px 40px rgba(23, 28, 37, 0.12); }
.photo-mode .mission__stage::before { display: none; }
.photo-mode .photo-mode .photo-mode .photo-mode .studio__stage { background: var(--color-white); }

/* ---------- Product visibility (official LUASSENCIA packages) ---------- */
.tray { padding: 8px 14px 8px 8px; }
.tray__product { width: 76px; height: 76px; border-radius: 16px; background: linear-gradient(180deg, #ffffff, #eef3f8); }
.tray__product img { width: 68px; height: 68px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(23, 28, 37, 0.12)); }
.tray__name { font-size: 13px; font-weight: 700; }

.spotlight {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(60% 46% at 50% 44%, rgba(255, 255, 255, 0.97), rgba(247, 249, 252, 0.9) 70%, rgba(247, 249, 252, 0.78));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade 260ms var(--ease) both;
  cursor: pointer;
}
.spotlight.is-leaving { animation: fade-out 420ms var(--ease) 120ms forwards; }
.spotlight__art { width: 58%; max-width: 260px; aspect-ratio: 1; display: grid; place-items: center; animation: spot-in 520ms var(--ease) both; }
.spotlight__art img, .spotlight__art svg { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 26px rgba(23, 28, 37, 0.18)); }
.spotlight__brand { font-family: var(--font-en); font-size: 11px; font-weight: 700; letter-spacing: 0.24em; color: var(--fg-mute); margin-top: 10px; animation: rise 500ms 120ms var(--ease) both; }
.spotlight__name { font-size: 15px; font-weight: 700; text-align: center; padding: 0 24px; line-height: 1.45; text-wrap: balance; animation: rise 500ms 180ms var(--ease) both; }
@keyframes spot-in { from { opacity: 0; transform: translateY(18px) scale(0.86); } to { opacity: 1; transform: none; } }
@keyframes fade-out { to { opacity: 0; } }

.done-panel__product { position: relative; width: 56px; height: 56px; flex: none; border-radius: 14px; background: linear-gradient(180deg, #ffffff, #eef3f8); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(23, 28, 37, 0.08); }
.done-panel__product img, .done-panel__product svg { width: 50px; height: 50px; object-fit: contain; }
.done-panel__badge { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--color-ice-blue); color: var(--color-charcoal); box-shadow: 0 0 0 2px var(--panel); }
.done-panel__badge svg { width: 14px; height: 14px; }

.used {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 6px 10px 6px 12px;
  border-radius: 14px; border: 1px solid var(--line); color: var(--fg); text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}
.used:active { opacity: 0.7; }
.used__label { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 11px; color: var(--fg-mute); line-height: 1.35; }
.used__label b { font-family: var(--font-en); font-size: 10.5px; letter-spacing: 0.18em; color: var(--fg); }
.used__items { display: flex; gap: 6px; }
.used__item { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: grid; place-items: center; }
.used__item img, .used__item svg { width: 36px; height: 36px; object-fit: contain; }
@media (max-height: 700px) {
  .tray__product { width: 64px; height: 64px; }
  .tray__product img { width: 56px; height: 56px; }
  .used__item { width: 34px; height: 34px; }
  .used__item img { width: 30px; height: 30px; }
}

@media (max-height: 700px) {
  .intro__title { font-size: 46px; }
  .intro__copy { margin-bottom: 12px; }
}
.app[data-theme='navy'] .topbar .icon-btn { color: #fff; }

/* ---------- Beauty prep ---------- */
.prep__ghost { position: absolute; z-index: 3; pointer-events: none; opacity: 0.8; filter: drop-shadow(0 0 4px rgba(168, 216, 244, 0.95)) drop-shadow(0 0 10px rgba(168, 216, 244, 0.6)); animation: ghost-pulse 1.6s ease-in-out infinite; transition: opacity 300ms var(--ease); }
.prep__ghost.is-near { animation: none; opacity: 1; }
.prep__ghost.is-off { animation: none; opacity: 0; }
@keyframes ghost-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.95; } }
.prep__prop img { filter: drop-shadow(0 10px 16px rgba(23, 28, 37, 0.22)); }
.drag-prop.is-landing { transition: left 340ms var(--ease), top 340ms var(--ease), width 340ms var(--ease); }
.drag-prop.is-landing img { filter: none; }
.prep__hand { position: absolute; left: 0; top: 0; z-index: 25; width: 44px; height: 44px; pointer-events: none; opacity: 0; }
.prep__hand.is-on { opacity: 1; }
.prep__hand svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25)); }
.prep .tray__product { position: relative; }
.tray__ph { width: 54px; height: 40px; border-radius: 10px; background: linear-gradient(110deg, #eef2f6 30%, #ffffff 50%, #eef2f6 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.tray__ph.is-empty { animation: none; background: transparent; }
.prep .tray__brand { font-family: var(--font-en); letter-spacing: 0.14em; color: var(--fg); font-weight: 700; font-size: 11px; }
.prep .tray__name { font-weight: 500; color: var(--fg-mute); }

.prep .mission__stage { margin-bottom: 0; }
.prep .instruction { min-height: 36px; }
.prep__dock { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 2px; }
.prep__slot { position: relative; width: 100%; height: 132px; display: flex; align-items: flex-end; justify-content: center; }
.prep__pedestal { width: 46%; height: 18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(79, 143, 191, 0.28), rgba(79, 143, 191, 0) 100%); margin-bottom: 6px; }
.prep__dock.is-ready .prep__dock.is-done .prep__label { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.prep__label b { font-family: var(--font-en); font-size: 12px; letter-spacing: 0.2em; }
.prep__label span { font-size: 12px; color: var(--fg-mute); }
.prep__prop { cursor: grab; }
.prep__prop.is-floating img { animation: float-item 2.4s ease-in-out infinite; }
@keyframes float-item { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@media (max-height: 700px) { .prep__slot { height: 100px; } }

/* ---------- Skincare: large product dock (same language as Beauty Prep) ---------- */
.mission:not(.prep) .tray {
  position: relative; flex-direction: column; gap: 4px; padding: 0 0 2px; border: 0; background: none; border-radius: 0;
}
.mission:not(.prep) .tray__product {
  display: block; width: 120px; height: 104px; border-radius: 0; background: none; box-shadow: none; position: relative;
}
.mission:not(.prep) .tray__product::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: -2px; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(79, 143, 191, 0.25), transparent); }
.mission:not(.prep) .tray__product img, .mission:not(.prep) .tray__product svg {
  width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1;
  filter: drop-shadow(0 10px 14px rgba(23, 28, 37, 0.18)); animation: float-item 2.6s ease-in-out infinite;
}
.mission:not(.prep) .tray__product.is-pulse { animation: none; }
.mission:not(.prep) .tray__product.is-pulse img { filter: drop-shadow(0 0 10px rgba(168, 216, 244, 0.95)) drop-shadow(0 10px 14px rgba(23, 28, 37, 0.18)); }
.mission:not(.prep) .tray__product.is-active { box-shadow: none; }
.mission:not(.prep) .tray__product.is-active img { animation: none; }
.mission:not(.prep) .tray__product.is-used img { opacity: 0.35; animation: none; }
.mission:not(.prep) .tray__meta { text-align: center; flex: none; }
.mission:not(.prep) .tray__brand { font-weight: 700; letter-spacing: 0.2em; color: var(--fg-mute); }
.mission:not(.prep) .tray__name { font-size: 13px; font-weight: 700; }
.mission:not(.prep) .tray__status {
  position: absolute; right: 0; top: 36px; padding: 5px 10px; border-radius: 20px; background: #fff;
  box-shadow: 0 2px 10px rgba(23, 28, 37, 0.08); font-weight: 700; color: var(--fg);
}
.mission:not(.prep) .tray__status:empty { display: none; }
.mission:not(.prep) .instruction { min-height: 36px; }
/* soft glowing target instead of dashed circles */
.zone-ring { border: 0; background: radial-gradient(closest-side, rgba(168, 216, 244, 0) 62%, rgba(168, 216, 244, 0.55) 80%, rgba(168, 216, 244, 0) 100%); }
.mask-sheet.is-landed img { transform: none; transition: opacity 120ms linear; }
@media (max-height: 700px) { .mission:not(.prep) .tray__product { width: 96px; height: 80px; } }

/* ---------- Cream touch: gauge + combo pops ---------- */
.foam-meter { display: inline-flex; align-items: center; gap: 6px; }
.foam-meter__bar { width: 54px; height: 6px; border-radius: 3px; background: rgba(23, 28, 37, 0.12); overflow: hidden; }
.foam-meter__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #dfe6f2, #a8d8f4); transition: width 160ms linear; }
.foam-meter.is-pat .foam-meter__bar i { background: linear-gradient(90deg, #a8d8f4, #5fb3ea); }
.foam-meter b { font-family: var(--font-en); font-size: 11px; min-width: 30px; text-align: right; }
.foam-pop {
  position: absolute; z-index: 8; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  font-family: var(--font-en); font-weight: 800; font-size: 18px; letter-spacing: 0.06em; color: #fff;
  -webkit-text-stroke: 1px rgba(95, 179, 234, 0.9); text-shadow: 0 2px 10px rgba(95, 179, 234, 0.55);
  animation: foam-pop 1200ms var(--ease) both;
}
.foam-pop.is-big { font-size: 22px; }
@keyframes foam-pop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  30% { transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(1); }
}
.spotlight__role { margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(168, 216, 244, 0.22); color: #3b6f93; font-size: 12px; font-weight: 600; animation: rise 500ms 240ms var(--ease) both; }
.tray__role { margin-top: 2px; font-size: 11px; color: #4f87ad; font-weight: 600; }

/* ---------- Mask fit: redness, air pockets, essence shine ---------- */
.mask-redness { z-index: 3; mix-blend-mode: multiply; pointer-events: none; transition: opacity 2400ms var(--ease); }
.mask-redness.is-calm { opacity: 0; }
.mask-sheet { transition: transform 200ms var(--ease); }
.mask-sheet__shine {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.75) 45%, rgba(210, 236, 252, 0.5) 52%, transparent 66%) 0 0 / 260% 100% no-repeat;
}
.mask-sheet.is-soak .mask-sheet__shine { opacity: 1; animation: essence-sheen 1300ms var(--ease) infinite; }
.mask-sheet.is-soak img { filter: saturate(1.05) brightness(1.04); }
@keyframes essence-sheen { from { background-position: 120% 0; } to { background-position: -40% 0; } }
.air-pocket {
  position: absolute; z-index: 5; transform: translate(-50%, -50%); pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.95) 0 12%, rgba(255, 255, 255, 0.35) 30%, rgba(225, 236, 246, 0.25) 62%, rgba(150, 168, 190, 0.35) 100%);
  box-shadow: 0 3px 6px rgba(60, 70, 90, 0.28), inset 0 -3px 5px rgba(120, 136, 160, 0.3);
  animation: air-in 380ms var(--ease) both, air-wobble 1600ms ease-in-out 400ms infinite;
}
.air-pocket i { position: absolute; inset: -30%; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.85); animation: air-ping 1600ms ease-out infinite; }
.air-pocket.is-out { animation: air-out 380ms var(--ease) forwards; }
@keyframes air-in { from { transform: translate(-50%, -50%) scale(0); } }
@keyframes air-wobble { 50% { transform: translate(-50%, -50%) scale(1.08, 0.94); } }
@keyframes air-ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.3); opacity: 0; } }
@keyframes air-out { to { transform: translate(-50%, -50%) scale(1.6, 0.2); opacity: 0; } }

/* ---------- Inner glow: dissolving film ---------- */
.odf-film {
  --melt: 0;
  position: absolute; left: 50%; top: 46%; z-index: 5; width: min(34%, 140px); aspect-ratio: 3 / 4; pointer-events: none;
  transform: translate(-50%, -50%) rotate(-8deg) scale(calc(1 - var(--melt) * 0.4));
  border-radius: calc(10px + var(--melt) * 60px);
  background: linear-gradient(135deg, rgba(255, 228, 238, 0.93), rgba(255, 238, 216, 0.9) 55%, rgba(255, 214, 230, 0.92));
  box-shadow: 0 12px 30px rgba(220, 140, 170, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.85), inset 0 0 18px rgba(255, 255, 255, 0.6);
  opacity: calc(1 - var(--melt) * 0.8); filter: blur(calc(var(--melt) * 3px));
  animation: film-in 520ms var(--ease) both, film-float 2600ms ease-in-out 520ms infinite;
  overflow: hidden;
}
.odf-film i { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.85) 48%, transparent 60%) 0 0 / 260% 100% no-repeat; animation: essence-sheen 1800ms var(--ease) infinite; }
.odf-film.is-gone { animation: film-gone 420ms var(--ease) forwards; }
@keyframes film-in { from { opacity: 0; translate: 0 30px; scale: 0.7; } }
@keyframes film-float { 50% { translate: 0 -6px; } }
@keyframes film-gone { to { opacity: 0; scale: 0.2; } }

/* ---------- Makeup studio: product swatches, tools, compare ---------- */
.swatch__dot--art { background: none; box-shadow: none; display: grid; place-items: center; }
.swatch__compact {
  width: 100%; height: 100%; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.6), transparent 40%),
    repeating-conic-gradient(from 8deg, rgba(255, 255, 255, 0.1) 0 7deg, rgba(0, 0, 0, 0.05) 7deg 14deg),
    radial-gradient(circle, var(--c) 0 58%, color-mix(in srgb, var(--c) 82%, #6b4250) 100%);
  box-shadow: 0 0 0 3px #e7e9ee, 0 0 0 4.5px #b9bec9, 0 3px 6px rgba(23, 28, 37, 0.2), inset 0 -2px 4px rgba(0, 0, 0, 0.12);
}
.swatch__pan {
  width: 88%; height: 88%; border-radius: 9px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95) 0 5%, transparent 32%),
    radial-gradient(circle at 68% 62%, rgba(255, 255, 255, 0.9) 0 1.2px, transparent 2px),
    radial-gradient(circle at 42% 70%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.8px),
    radial-gradient(circle at 72% 30%, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.8px),
    radial-gradient(circle at 25% 55%, rgba(255, 255, 255, 0.7) 0 0.8px, transparent 1.5px),
    linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%),
    radial-gradient(circle at 50% 45%, var(--c) 25%, var(--b) 100%);
  box-shadow: 0 0 0 2.5px #e7e9ee, 0 0 0 4px #b9bec9, 0 3px 6px rgba(23, 28, 37, 0.2);
}
.swatch__lipstick { width: 100%; height: 100%; filter: drop-shadow(0 3px 3px rgba(23, 28, 37, 0.2)); }
.swatch--eye .swatch__dot::after { border-radius: 12px; }
.swatch--lip .swatch__dot::after { border-radius: 12px; }
.tab.has-value b::after { background: var(--c, var(--color-pink)); width: 7px; height: 7px; box-shadow: 0 0 0 1px rgba(23, 28, 37, 0.12); }
.mk-tool { position: absolute; left: 0; top: 0; z-index: 5; width: 46px; height: 46px; pointer-events: none; opacity: 0; filter: drop-shadow(0 4px 6px rgba(23, 28, 37, 0.3)); }
.mk-tool svg { width: 100%; height: 100%; }
.studio__compare {
  position: absolute; z-index: 6; left: 12px; bottom: 10px; min-height: 34px; padding: 0 12px;
  font-family: var(--font-en); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--fg);
  background: rgba(255, 255, 255, 0.9); box-shadow: 0 2px 8px rgba(23, 28, 37, 0.1);
}
.studio__compare[aria-pressed='true'] { background: var(--color-charcoal); color: #fff; }
.control-row--bare { grid-template-columns: 1fr; display: block; }
.control-row--bare .range { width: 100%; }

/* ---------- Makeup studio v4: K-makeup flow ---------- */
.studio .tab b { font-size: 10.5px; letter-spacing: 0.04em; }
.studio .tab { min-height: 42px; }
.studio .panel__body { min-height: 150px; }
.swatch__cushion {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, var(--c) 0 62%, color-mix(in srgb, var(--c) 85%, #9b6f60) 100%);
  box-shadow: 0 0 0 3px #f2f2f5, 0 0 0 4.5px #c3c7d1, 0 3px 6px rgba(23, 28, 37, 0.18);
}
.swatch__cushion.is-glass, .swatch__cushion.is-radiant { background: radial-gradient(circle at 34% 28%, #fff 0 10%, transparent 34%), radial-gradient(circle at 62% 64%, rgba(255, 255, 255, 0.7) 0 6%, transparent 22%), radial-gradient(circle at 50% 55%, var(--c) 0 62%, color-mix(in srgb, var(--c) 85%, #9b6f60) 100%); }
.swatch__cushion.is-toneup { background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.75), transparent 55%), radial-gradient(circle at 50% 55%, var(--c) 0 62%, color-mix(in srgb, var(--c) 85%, #9b6f60) 100%); }
.swatch__cushion.is-semimatte { filter: saturate(0.85); }
.swatch--base .swatch__dot::after { border-radius: 50%; }
.opt-rows { display: grid; gap: 6px; margin-top: 4px; }
.opt-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.opt-row::-webkit-scrollbar { display: none; }
.opt-row__label { flex: none; min-width: 2.6em; font-size: 11px; color: var(--fg-mute); }
.opt-chip {
  flex: none; min-height: 32px; padding: 0 12px; border-radius: 16px; font-size: 12px; font-weight: 600;
  color: var(--fg); background: #f2f3f6; border: 1px solid transparent; transition: background var(--t), border-color var(--t), color var(--t);
}
.opt-chip.is-on { background: #fff; border-color: var(--color-charcoal); color: var(--color-charcoal); }
.opt-chip:disabled { opacity: 0.4; }
.subtabs { display: flex; gap: 4px; padding: 3px; margin-bottom: 8px; border-radius: 12px; background: #f2f3f6; }
.subtab { flex: 1; min-height: 30px; border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--fg-mute); }
.subtab.is-active { background: #fff; color: var(--fg); box-shadow: 0 1px 4px rgba(23, 28, 37, 0.1); }
.looks { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 10px 2px 6px; }
.looks::-webkit-scrollbar { display: none; }
.look-card {
  position: relative; flex: none; width: 112px; min-height: 104px; padding: 12px 10px 10px; border-radius: 14px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; background: #f7f7fa; border: 1px solid var(--line);
}
.look-card.is-rec { background: linear-gradient(160deg, #fff4f7, #f3f6fb); border-color: #e7b9c7; }
.look-card:active { transform: scale(0.97); }
.look-card__badge { position: absolute; top: -8px; left: 8px; padding: 2px 8px; border-radius: 10px; background: var(--color-charcoal); color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; }
.look-card__dots { display: flex; margin-bottom: 4px; }
.look-card__dots i { width: 20px; height: 20px; border-radius: 50%; margin-right: -5px; box-shadow: 0 0 0 2px #fff; }
.look-card b { font-size: 13px; line-height: 1.3; }
.look-card small { font-size: 10.5px; color: var(--fg-mute); }
.cmp { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.cmp i { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(23, 28, 37, 0.35); }
.cmp__knob { position: absolute; top: 50%; left: var(--x); width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(23, 28, 37, 0.3); }
.cmp__knob::before { content: '‹ ›'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--color-charcoal); letter-spacing: 2px; }
.cmp b { position: absolute; top: 12px; padding: 3px 8px; border-radius: 10px; font-family: var(--font-en); font-size: 10px; letter-spacing: 0.1em; background: rgba(23, 28, 37, 0.6); color: #fff; }
.cmp__l { left: 12px; }
.cmp__r { right: 12px; }
.studio .swatch__name { font-family: var(--font-body); font-size: 10px; font-weight: 600; letter-spacing: 0; word-break: keep-all; }
.mission.is-spotlight .tray__meta, .mission.is-spotlight .instruction span { visibility: hidden; }
.mission > .spotlight { inset: calc(var(--safe-top) + 60px) 0 0; padding-bottom: 6%; background: radial-gradient(70% 50% at 50% 46%, #ffffff, rgba(247, 249, 252, 0.96) 75%, rgba(247, 249, 252, 0.94)); }
.mission > .spotlight .spotlight__art { width: 64%; max-width: 280px; }
.mission > .spotlight .spotlight__brand { margin-top: 18px; }
.mission > .spotlight .spotlight__art { flex: none; width: auto; height: min(64vw, 280px, 40vh); max-width: none; aspect-ratio: 1; }
.mission > .spotlight .spotlight__art { position: relative; }
.mission > .spotlight .spotlight__art img, .mission > .spotlight .spotlight__art svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.finish-grid { display: grid; gap: 8px; padding-top: 6px; }
.finish-card {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px 8px 8px; border-radius: 14px; text-align: left;
  background: #f7f7fa; border: 1px solid var(--line); transition: background var(--t), border-color var(--t);
}
.finish-card:active { transform: scale(0.98); }
.finish-card.is-on { background: linear-gradient(160deg, #fff6f8, #f3f6fb); border-color: var(--color-charcoal); }
.finish-card__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(23, 28, 37, 0.08); }
.finish-card__icon svg { width: 34px; height: 34px; }
.finish-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.finish-card__text b { font-size: 13px; }
.finish-card__text small { font-size: 11px; color: var(--fg-mute); }
.finish-card__check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #c9cdd6; position: relative; transition: background var(--t), border-color var(--t); }
.finish-card.is-on .finish-card__check { background: var(--color-charcoal); border-color: var(--color-charcoal); }
.finish-card.is-on .finish-card__check::after { content: ''; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@media (max-height: 700px) { .finish-grid { gap: 6px; } .finish-card { min-height: 46px; padding: 5px 12px 5px 6px; } .finish-card__icon { width: 34px; height: 34px; } .finish-card__icon svg { width: 28px; height: 28px; } }
/* option tiles: every choice shows a small picture of the result */
.opt-group { padding-top: 4px; }
.opt-group__label { display: block; margin-bottom: 4px; font-size: 11px; color: var(--fg-mute); }
.opt-tiles { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.opt-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 7px; border-radius: 14px;
  background: #f7f7fa; border: 1.5px solid transparent; transition: background var(--t), border-color var(--t), transform 120ms var(--ease);
}
.opt-tile:active { transform: scale(0.96); }
.opt-tile.is-on { background: #fff; border-color: var(--color-charcoal); box-shadow: 0 2px 8px rgba(23, 28, 37, 0.08); }
.opt-tile:disabled { opacity: 0.4; }
.opt-tile__art { display: block; width: 100%; max-width: 64px; }
.opt-tile__art svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.opt-tile__name { font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center; word-break: keep-all; color: var(--fg); }
.opt-group.is-compact .opt-tile { flex-direction: row; justify-content: center; gap: 6px; padding: 4px 6px; min-height: 40px; }
.opt-group.is-compact .opt-tile__art { width: 38px; flex: none; }
.opt-group.is-compact .opt-tile__name { text-align: left; font-size: 10.5px; }
.opt-rows { gap: 6px; }
/* compact groups (LIP style / texture): label + one segmented control per row, so one choice per row is obvious */
.opt-group.is-compact { display: flex; align-items: center; gap: 8px; padding-top: 0; }
.opt-group.is-compact .opt-group__label { flex: none; width: 2.6em; margin: 0; font-size: 11px; font-weight: 600; color: var(--fg-mute); }
.opt-group.is-compact .opt-tiles { flex: 1; gap: 3px; padding: 3px; border-radius: 14px; background: #f0f1f4; }
.opt-group.is-compact .opt-tile { background: transparent; border: 0; border-radius: 11px; min-height: 38px; }
.opt-group.is-compact .opt-tile.is-on { background: #fff; box-shadow: 0 1px 5px rgba(23, 28, 37, 0.14); }
.opt-group.is-compact .opt-tile.is-on .opt-tile__name { font-weight: 700; }
.opt-group.is-compact .opt-tile:not(.is-on) .opt-tile__name { color: var(--fg-mute); }
.opt-group.is-compact .opt-tile__art { width: 30px; }
.opt-group.is-compact .opt-group__label { width: auto; min-width: 2.6em; white-space: nowrap; }
.opt-group.is-compact .opt-tile { gap: 4px; padding: 3px 4px; }
.opt-group.is-compact .opt-tile__art { width: 26px; }
/* ---------- Final touch: portrait framing, reveal ---------- */
.final__stage { overflow: hidden; margin-top: 4px; display: block; }
.final__stage .face-zoom { position: absolute; }
.final__stage .face-box { overflow: visible; }
.final__flash { position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0; background: radial-gradient(60% 50% at 50% 35%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.4) 60%, transparent 85%); }
.final__flash.is-on { animation: final-flash 900ms var(--ease) both; }
@keyframes final-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.final__pop { left: 50%; top: 24%; z-index: 8; font-size: 30px; }
.final__actions { margin-top: 2px; }
/* ---------- Final touch: hair picker ---------- */
.hair-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 2px 0 10px; }
.hair-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.hair-tile__thumb { position: relative; width: 58px; height: 58px; border-radius: 50%; overflow: hidden; background: #e9eaee; box-shadow: 0 0 0 1.5px rgba(23, 28, 37, 0.1); transition: box-shadow var(--t), transform 160ms var(--ease); }
.hair-tile__thumb svg { width: 100%; height: 100%; display: block; }
.hair-tile:active .hair-tile__thumb { transform: scale(0.94); }
.hair-tile.is-on .hair-tile__thumb { box-shadow: 0 0 0 2.5px var(--color-charcoal), 0 0 0 5px rgba(168, 216, 244, 0.45); }
.hair-tile__name { font-size: 10.5px; font-weight: 600; line-height: 1.25; text-align: center; word-break: keep-all; color: var(--fg-mute); }
.hair-tile.is-on .hair-tile__name { color: var(--fg); font-weight: 700; }
@media (max-height: 700px) { .hair-tile__thumb { width: 50px; height: 50px; } .hair-picker { padding-bottom: 8px; } .final .instruction { min-height: 30px; } }
.toast { white-space: nowrap; max-width: none; width: max-content; }
/* intro: the logos share the top row with the language button; the title gets room before the cards */
.intro { padding-top: calc(var(--safe-top) + 22px); }
.intro__brand { gap: 14px; padding: 0 0 16px; }
.intro__title { font-size: 62px; }
@media (max-height: 700px) { .intro__brand { gap: 10px; padding-bottom: 10px; } .intro__title { font-size: 52px; } }
.intro { padding-top: calc(var(--safe-top) + 17px); }
.intro__cobrand { gap: 12px; }
.intro__kzna { height: 30px; }
.intro__lua { height: 23px; }
.intro__x { font-size: 13px; }
@media (max-height: 700px) { .intro__kzna { height: 26px; } .intro__lua { height: 20px; } }
/* language menu (top bar) */
.top-controls { position: relative; }
.lang-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 40; min-width: 120px; padding: 6px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.98); box-shadow: 0 10px 30px rgba(11, 15, 26, 0.25), 0 0 0 1px rgba(23, 28, 37, 0.06);
  display: flex; flex-direction: column; gap: 2px;
}
.lang-menu[hidden] { display: none; }
.lang-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--color-charcoal); text-align: left; }
.lang-menu button:active { background: #f2f3f6; }
.lang-menu button.is-on { background: #f2f3f6; }
.lang-menu button.is-on::after { content: ''; width: 5px; height: 10px; border: solid var(--color-charcoal); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
/* intro: GLOW UP reveal — a light sweep, twinkling sparkles and a soft glow around the card */
.intro__slot { transition: opacity 460ms var(--ease), box-shadow 700ms var(--ease); }
.intro__slot.is-anim { transition: transform 380ms var(--ease), opacity 340ms var(--ease), box-shadow 700ms var(--ease); }
.intro__slot.is-glow {
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.32), 0 0 28px rgba(243, 184, 209, 0.42), 0 0 64px rgba(168, 216, 244, 0.28);
}
.intro__shine {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 34%, rgba(255, 255, 255, 0.55) 47%, rgba(255, 228, 240, 0.4) 52%, transparent 64%) 0 0 / 260% 100% no-repeat;
}
.intro__slot.is-glow .intro__shine { animation: intro-shine 1300ms 120ms cubic-bezier(.3, .6, .3, 1) both; }
@keyframes intro-shine { 0% { opacity: 0; background-position: 130% 0; } 20% { opacity: 1; } 100% { opacity: 0; background-position: -40% 0; } }
.intro__stars { position: absolute; inset: 0; pointer-events: none; }
.intro__stars i {
  position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); opacity: 0;
  background: #fff; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 4px rgba(255, 220, 236, 0.95));
}
.intro__slot.is-glow .intro__stars i { animation: intro-twinkle 1.8s ease-in-out infinite both; }
@keyframes intro-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); }
  45% { opacity: 1; transform: scale(1) rotate(45deg); }
  70% { opacity: 0.5; transform: scale(0.75) rotate(70deg); }
}
/* intro: breathing room above the logos grows with the screen height (compact on phones) */
.intro { padding-top: calc(var(--safe-top) + clamp(17px, 7vh - 26px, 64px)); }
.intro__brand { padding-bottom: clamp(10px, 3vh - 4px, 28px); }
