/* kzna PHOTO BOOTH — 모바일 우선 스타일 */

:root {
  --ivory: #fffaf6;
  --lav: #cdbdf5;
  --lav-soft: #f1eaff;
  --pink-soft: #ffe2ef;
  --hot: #ff3d8b;
  --hot-press: #e72a77;
  --purple: #6b3fd1;
  --ink: #2b1f45;
  --ink-2: #6c5f86;
  --line: rgba(107, 63, 209, 0.14);
  --booth: #1d1430;
  --booth-2: #2a1e45;

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;

  --font: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Hiragino Sans', 'Noto Sans JP', system-ui, sans-serif;
  --font-logo: 'Unbounded', 'Pretendard', sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* 일본어일 때는 일본어 글꼴을 먼저 (한자 모양이 일본식으로 나오도록) */
:root:lang(ja) {
  --font: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Pretendard', system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 0% 0%, #efe3ff 0%, transparent 60%),
    radial-gradient(100% 50% at 100% 30%, #ffe3f0 0%, transparent 60%),
    var(--ivory);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body[data-screen='shoot'] { background: var(--booth); color: #fff; }

[hidden] { display: none !important; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; border-radius: 8px; }
h1:focus, h2:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.noscript { padding: 24px; text-align: center; }

/* ---------- 화면 컨테이너 ---------- */

#app { min-height: 100dvh; }

.screen {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
  display: flex;
  flex-direction: column;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.screen.is-entering { opacity: 0; transform: translateY(8px); }
.screen--shoot { max-width: 760px; }

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 20px calc(20px + var(--safe-b));
}
.page__title { margin: 8px 0 4px; font-size: 26px; line-height: 1.3; font-weight: 800; letter-spacing: -0.02em; }
.page__sub { margin: 0 0 20px; color: var(--ink-2); font-size: 15px; }
.page__bottom {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 16px 0 calc(4px + var(--safe-b));
  background: linear-gradient(to top, var(--ivory) 70%, transparent);
}
.page__bottom--row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }

.fine { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* ---------- 상단 바 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 4px 8px;
}
.topbar__title { font-weight: 700; font-size: 16px; }
.topbar--shoot { color: #fff; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.icon-btn:active { background: rgba(107, 63, 209, 0.1); }
.icon-btn--spacer { visibility: hidden; }

/* ---------- 버튼 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s, opacity 0.2s;
  touch-action: manipulation;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--xl { width: 100%; min-height: 58px; font-size: 17px; }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn--primary { background: var(--hot); color: #fff; box-shadow: 0 8px 22px -10px rgba(255, 61, 139, 0.8); }
.btn--primary:active:not(:disabled) { background: var(--hot-press); }
.btn--light { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost { background: rgba(255, 255, 255, 0.7); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }

.btn__spinner,
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
.btn.is-ready .btn__spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  border: 0;
  background: none;
  padding: 10px 4px;
  min-height: 44px;
  font-weight: 700;
  font-size: 14px;
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 언어 선택 ---------- */

.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.lang-switch button {
  min-height: 34px;
  min-width: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  touch-action: manipulation;
}
.lang-switch button[aria-checked='true'] { background: var(--ink); color: #fff; }
.topbar .lang-switch { margin-right: 4px; }

/* ---------- 01 랜딩 ---------- */

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 24px calc(24px + var(--safe-b));
}
.home__lang { align-self: flex-end; margin-bottom: 20px; }
.home__brand { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.wordmark {
  font-family: var(--font-logo);
  font-weight: 800;
  font-size: clamp(64px, 22vw, 96px);
  letter-spacing: -0.04em;
  color: var(--ink);
}
.wordmark-sub {
  margin-top: 10px;
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: var(--purple);
}

/* 대표 장면: 셔터가 한 칸씩 터지는 미니 스트립 (유일한 자동 애니메이션) */
.booth-strip {
  position: relative;
  margin: 36px 0 32px;
  width: 132px;
  padding: 12px 12px 34px;
  border-radius: 10px;
  background: linear-gradient(#e7dcfc, #d3c2f7);
  box-shadow: 0 24px 40px -24px rgba(107, 63, 209, 0.55);
  transform: rotate(-4deg);
  display: grid;
  gap: 7px;
}
.booth-strip__cell {
  aspect-ratio: 4 / 3;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.55);
}
.booth-strip__beat {
  position: absolute;
  left: 10px; right: 10px; bottom: 11px;
  width: calc(100% - 20px);
  height: 18px;
  fill: none;
  stroke: var(--hot);
  stroke-width: 3;
  stroke-linejoin: round;
}

.home__title { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; }
.home__sub { margin: 10px 0 0; color: var(--ink-2); font-size: 16px; }
.home__actions { width: 100%; margin-top: auto; padding-top: 32px; }

/* ---------- 02 멤버 선택 ---------- */

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.member-row {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  transition: transform 0.2s var(--ease);
  touch-action: manipulation;
}
.member-row:not(.is-locked):active { transform: scale(0.98); }

/* 포토이즘 셀렉트 화면처럼: 흰 종이 위에 4컷, 얇은 컷 테두리, 작은 로고 */
.member-row__strip {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px 8px 10px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(43, 31, 69, 0.04), 0 10px 24px -18px rgba(43, 31, 69, 0.55);
}
.member-row:not(.is-locked) .member-row__strip { box-shadow: inset 0 0 0 1.5px var(--member), 0 12px 26px -18px var(--member); }
.member-row__logo {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  color: var(--hot);
}
.member-row__cuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.member-row__cut {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e4dfea, 0 0 0 1px #e4dfea;
}
.member-row.is-locked .member-row__cuts { opacity: 0.35; }
.member-row__lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.member-row__name { display: flex; align-items: baseline; gap: 8px; padding: 0 2px; }
.member-row__name b {
  font-family: var(--font-logo);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}
.member-row__name small { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.member-row__go {
  margin-left: auto;
  align-self: center;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--member);
  color: #fff;
}
.member-row.is-shake { animation: shake 0.35s; }
@keyframes shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---------- 03 인트로 ---------- */

.intro__hero { position: relative; margin: 4px 0 18px; }
.intro__photo {
  width: 62%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 32px;
  background: var(--lav-soft);
  box-shadow: 0 0 0 4px #fff, 0 20px 40px -22px var(--member);
  transform: rotate(-3deg);
}
.intro__bubbles {
  position: absolute;
  right: 0;
  top: 18%;
  width: 56%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.bubble {
  margin: 0;
  padding: 11px 15px;
  border-radius: 20px 20px 6px 20px;
  background: #fff;
  box-shadow: 0 8px 22px -14px rgba(43, 31, 69, 0.5), inset 0 0 0 1.5px var(--line);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  animation: bubbleIn 0.5s var(--ease) both;
  animation-delay: calc(0.25s + var(--d, 0) * 0.55s);
}
.bubble--left { border-radius: 20px 20px 20px 6px; animation: none; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(0.96); } }

.intro__card {
  margin: 0 0 12px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.intro__card--soft { background: var(--lav-soft); box-shadow: none; }
.intro__card p { margin: 0; font-size: 15px; }
.intro__card p + p { margin-top: 8px; }
.intro__card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}
.pose-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pose-steps__item { display: flex; align-items: center; gap: 10px; }
.pose-steps__n {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--member);
  color: #fff;
  font-family: var(--font-logo);
  font-size: 12px;
  font-weight: 700;
}
.pose-steps__label { display: flex; flex-direction: column; line-height: 1.25; }
.pose-steps__label b { font-size: 14px; }
.pose-steps__label small { font-size: 12px; color: var(--ink-2); }
.intro__asset-note {
  margin: 0 0 4px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: #fff4d6;
  color: #6b4b00;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- 04 촬영 ---------- */

.shoot {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-b);
}
.stage-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.stage {
  position: relative;
  width: min(100%, calc((100dvh - 330px - var(--safe-t) - var(--safe-b)) * 4 / 3));
  min-width: min(100%, 320px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--booth-2);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
@media (min-width: 560px) { .stage { border-radius: var(--r-md); } }
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage__video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.stage__guide {
  position: absolute;
  left: 7%;
  bottom: 0;
  width: 38%;
  height: 84%;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity 0.3s;
}
.stage__guide span {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(29, 20, 48, 0.55);
  font-size: 12px;
  font-weight: 700;
}
.stage.is-counting .stage__guide,
.stage.is-counting .stage__hint,
.stage.is-counting .stage__pose { opacity: 0; }

.stage__pose {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: rgba(29, 20, 48, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  transition: opacity 0.3s;
}
.stage__pose-n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--member);
  font-family: var(--font-logo);
  font-size: 12px;
  font-weight: 700;
}
.stage__pose-text { display: flex; flex-direction: column; line-height: 1.15; }
.stage__pose-text b { font-size: 13px; }
.stage__pose-text small { font-size: 11px; opacity: 0.8; }

.stage__hint {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: 52%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  pointer-events: none;
  transition: opacity 0.3s;
}
.stage__hint:empty { display: none; }
.stage__hint.is-in { animation: bubbleIn 0.45s var(--ease) both; animation-delay: 0.2s; }

.stage__tag {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffd25a;
  color: #3a2a00;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.stage__countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.stage__countdown span {
  font-family: var(--font-logo);
  font-weight: 800;
  font-size: clamp(96px, 30vw, 180px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 6px 30px rgba(255, 61, 139, 0.6);
}
.stage__countdown.is-tick span { animation: tick 1s var(--ease) both; }
@keyframes tick {
  0% { opacity: 0; transform: scale(1.5); }
  20% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.85); }
}
.stage__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.stage__flash.is-on { animation: flash 0.5s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

.stage__state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(29, 20, 48, 0.82);
}
.state-card { max-width: 340px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.state-card__title { margin: 0; font-size: 17px; font-weight: 800; }
.state-card__body { margin: 0; font-size: 14px; opacity: 0.88; line-height: 1.5; }
.state-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }

.tools {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tools::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.chip[aria-pressed='true'] { background: rgba(255, 255, 255, 0.92); color: var(--booth); }
.chip:disabled { opacity: 0.5; }
.tools__hint { margin: 8px 16px 0; font-size: 12px; color: rgba(255, 255, 255, 0.55); }

.thumbs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 16px 0;
  padding: 0;
}
.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.18);
  font-family: var(--font-logo);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-current { box-shadow: inset 0 0 0 2.5px var(--hot); color: #fff; }
.thumb.is-current.is-taken { box-shadow: 0 0 0 2.5px var(--hot); }

.controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 16px calc(18px + var(--safe-b));
}
.ctrl-btn {
  justify-self: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  min-height: 56px;
  padding: 6px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ctrl-btn:active { background: rgba(255, 255, 255, 0.1); }
.ctrl-btn--spacer { visibility: hidden; }
.controls > :first-child { grid-column: 1; }
.controls .shutter { grid-column: 2; }
.controls [data-switch],
.controls [data-retake-last] { grid-column: 3; grid-row: 1; }

.shutter {
  position: relative;
  width: 80px;
  height: 80px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.25);
  touch-action: manipulation;
  transition: transform 0.15s var(--ease), opacity 0.2s;
}
.shutter__ring { position: absolute; inset: 7px; border-radius: 50%; background: var(--hot); transition: inset 0.2s var(--ease); }
.shutter:active:not(:disabled) { transform: scale(0.92); }
.shutter:disabled { opacity: 0.4; cursor: default; }
.shutter.is-upload .shutter__ring { background: var(--purple); }
.screen.is-busy .shutter__ring { inset: 22px; border-radius: 8px; }

/* 가로로 눕힌 휴대폰: 컨트롤을 옆으로 */
@media (orientation: landscape) and (max-height: 520px) {
  .screen--shoot { max-width: none; }
  .topbar--shoot {
    position: absolute;
    top: var(--safe-t);
    right: calc(12px + var(--safe-r));
    width: 200px;
    z-index: 2;
    padding: 4px 0;
  }
  .topbar--shoot .topbar__title { display: none; }
  .shoot {
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-template-rows: auto auto auto 1fr;
    column-gap: 12px;
    padding: 8px 12px var(--safe-b);
  }
  .stage-wrap { grid-row: 1 / -1; align-items: center; }
  .stage { width: min(100%, calc((100dvh - 16px) * 4 / 3)); border-radius: var(--r-md); }
  .tools { flex-wrap: wrap; padding: 56px 0 0; }
  .tools__hint { display: none; }
  .thumbs { margin: 10px 0 0; }
  .controls { padding: 10px 0; }
}

/* ---------- 확인창 / 뷰어 ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  justify-items: center;
  background: rgba(20, 12, 36, 0.55);
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  width: min(100%, 480px);
  padding: 22px 20px calc(18px + var(--safe-b));
  border-radius: 26px 26px 0 0;
  background: #fff;
  color: var(--ink);
  animation: sheetUp 0.3s var(--ease) both;
}
@media (min-width: 560px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 26px; padding-bottom: 20px; }
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } }
.sheet__title { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.sheet__body { margin: 0; color: var(--ink-2); font-size: 15px; }
.sheet__actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.sheet__photo { width: 100%; border-radius: 14px; }
.sheet--viewer { padding-top: 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 05 미리보기 ---------- */

.preview-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
}
.preview-card { animation: bubbleIn 0.45s var(--ease) both; animation-delay: calc(var(--d) * 0.08s); }
.preview-card__photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: var(--lav-soft);
  box-shadow: 0 10px 22px -16px rgba(43, 31, 69, 0.6);
}
.preview-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.preview-card__empty {
  display: grid;
  place-items: center;
  height: 100%;
  border: 2px dashed var(--lav);
  border-radius: 14px;
  font-family: var(--font-logo);
  color: var(--ink-2);
}
.preview-card__n {
  position: absolute;
  left: 7px;
  top: 7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(29, 20, 48, 0.7);
  color: #fff;
  font-family: var(--font-logo);
  font-size: 11px;
}
.preview-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 2px; }
.preview-card__label { font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* ---------- 06 꾸미기 ---------- */

.customize { padding-top: 0; }
.strip-preview {
  display: grid;
  place-items: center;
  padding: 12px 0 18px;
}
.strip-preview__canvas {
  height: min(54dvh, 560px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 22px 40px -22px rgba(43, 31, 69, 0.55);
}
.customize__panel { display: grid; gap: 18px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 800; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.swatch[aria-checked='true'] { box-shadow: inset 0 0 0 2.5px var(--hot); }
.swatch__dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--a), var(--b));
  box-shadow: inset 0 0 0 1px rgba(43, 31, 69, 0.12);
}
.swatch__name { text-align: center; }
/* ---------- 07 결과 ---------- */

.result { align-items: center; padding-top: 0; }
.printer {
  width: 100%;
  max-width: 320px;
  height: 18px;
  border-radius: 10px;
  background: var(--ink);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}
.printer__slot { width: 82%; height: 4px; border-radius: 4px; background: #000; }
.result__strip {
  margin-top: -9px;
  width: 100%;
  display: grid;
  justify-items: center;
  overflow: hidden;
  padding-bottom: 24px;
}
.result__img {
  height: min(60dvh, 620px);
  width: auto;
  max-width: 82%;
  object-fit: contain;
  transform: translateY(-102%);
  box-shadow: 0 24px 40px -22px rgba(43, 31, 69, 0.6);
  -webkit-touch-callout: default;
}
.result__strip.is-printed .result__img { animation: printOut 1.6s var(--ease) forwards; }
@keyframes printOut { to { transform: translateY(0); } }

.result__msg { display: flex; align-items: flex-end; gap: 10px; width: 100%; margin: 4px 0 18px; }
.result__avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--lav-soft);
  box-shadow: 0 0 0 2.5px var(--member);
}
.result__actions { width: 100%; display: grid; gap: 10px; justify-items: center; }
.result__actions .fine { margin: 0; text-align: center; }
.result__more {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-bottom: var(--safe-b);
}
.result__more .btn { padding: 0 10px; font-size: 14px; }

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


/* =====================================================================
   스크롤 없는 레이아웃
   - 모든 화면은 정확히 화면 높이(100dvh)에 맞춘다. 페이지 스크롤 없음.
   - 화면마다 가장 큰 요소(스트립, 카메라, 사진)가 남은 공간을 차지하고,
     container query(cqw/cqh)로 그 공간 안에 비율을 지켜 들어간다.
   ===================================================================== */

html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { min-height: 0; }
#app { height: 100vh; height: 100dvh; min-height: 0; }
.screen {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.page { min-height: 0; overflow: hidden; }
.page__title { margin-top: 4px; }
.page__bottom { position: static; background: none; padding-top: 12px; flex: none; }

/* 01 랜딩: 미니 스트립이 남는 높이에 맞춰 크기 조절 */
.home { min-height: 0; padding-top: 10px; }
.home__lang { margin-bottom: 8px; flex: none; }
.home__brand, .home__copy, .home__actions { flex: none; }
.home__actions { padding-top: 16px; margin-top: 0; }
.home__stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
  container-type: size;
  padding: 16px 0;
}
.booth-strip {
  /* 칸 크기를 남는 공간에서 직접 계산: 세로 4칸 + 여백(위10 아래40 + 간격 8x3)이 들어가고, 가로는 화면의 66%까지 */
  --cell-w: min(100cqw * 0.66 - 20px, (100cqh - 16px - 74px) / 4 * 4 / 3);
  margin: 0;
  width: auto;
  height: auto;
  padding: 10px 10px 40px;
  gap: 8px;
  grid-template-rows: none;
  grid-template-columns: var(--cell-w);
}
.booth-strip__cell { aspect-ratio: 4 / 3; width: var(--cell-w); }
.wordmark { font-size: clamp(44px, min(17vw, 8.5dvh), 80px); }
.home__stage { padding: 10px 0 12px; }
.home__copy .home__title { font-size: clamp(22px, 3.4dvh, 28px); }
.home__sub { margin-top: 6px; }

/* 02 멤버 선택: 4줄이 화면 안에 다 들어가게 */
.member-list {
  flex: 1;
  min-height: 0;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: calc(4px + var(--safe-b));
}
.member-list > li { min-height: 0; display: flex; }
.member-row { min-height: 0; flex: 1; display: flex; }
.member-row__strip {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 8px 8px;
}
.member-row__head { display: flex; align-items: center; gap: 8px; flex: none; min-height: 28px; }
.member-row__name { padding: 0; gap: 6px; min-width: 0; }
.member-row__name b { font-size: 16px; }
.member-row__name small { font-size: 12px; }
.member-row__go { width: 28px; height: 28px; margin-left: auto; }
.member-row__cuts {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.member-row__cut {
  flex: none;
  width: min((100cqw - 15px) / 4, 100cqh * 4 / 3);
  height: auto;
}

/* 04 촬영: 카메라 화면이 남는 공간 안에서 4:3 최대 크기 */
.shoot { min-height: 0; }
.stage-wrap { flex: 1; min-height: 0; container-type: size; }
.stage { width: min(100cqw, 100cqh * 4 / 3); min-width: 0; }
.tools:not(:has(.chip:not([hidden]))) { display: none; }
.thumbs { margin-top: 12px; flex: none; }
.controls { flex: none; padding-top: 14px; }

/* 05 사진 확인: 2x2 카드가 남는 공간 안에 들어가게 */
.preview-fit { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
.preview-grid {
  --card-w: min((100cqw - 10px) / 2, ((100cqh - 14px) / 2 - 40px) * 4 / 3);
  grid-template-columns: repeat(2, var(--card-w));
  gap: 14px 10px;
}
.preview-card__meta { min-height: 40px; }

/* 06 프레임 꾸미기: 스트립 미리보기가 남는 높이에 맞춤 */
.customize { padding-bottom: calc(12px + var(--safe-b)); }
.strip-preview { flex: 1; min-height: 0; container-type: size; padding: 8px 0 14px; }
.strip-preview__canvas { height: 100cqh; width: auto; max-width: 100cqw; }
.customize__panel { flex: none; }

/* 07 완성: 결과 스트립이 남는 높이에 맞춤, 버튼은 한 화면 안에 */
.result { padding-bottom: calc(12px + var(--safe-b)); }
.printer { flex: none; }
.result__strip { flex: 1; min-height: 0; container-type: size; padding-bottom: 10px; }
.result__img { height: 100cqh; max-width: 82cqw; }
.result__msg { flex: none; margin: 2px 0 12px; }
.result__msg .bubble { font-size: 14px; padding: 9px 13px; }
.result__avatar { width: 38px; height: 38px; }
.result__actions { flex: none; grid-template-columns: 1fr; gap: 8px; }
.result__actions:has([data-share]) { grid-template-columns: 1fr 1fr; }
.result__actions .fine { grid-column: 1 / -1; font-size: 12px; }
.result__actions .btn--xl { min-height: 52px; font-size: 16px; }
.result__more { flex: none; margin-top: 10px; }
.result__more .btn { min-height: 46px; }

/* 키가 아주 낮은 화면(가로로 눕힌 휴대폰 등): 보조 문구를 줄인다 */
@media (max-height: 600px) {
  .page__sub, .home__sub, .home__actions .fine, .result__actions .fine { display: none; }
  .page__title { font-size: 20px; margin-bottom: 6px; }
  .wordmark-sub { margin-top: 4px; }
}

/* 랜딩 미니 스트립: 칸마다 멤버 한 명 (깜빡임 없음) */
.booth-strip__cell {
  position: relative;
  overflow: hidden;
  background: #fff;
  animation: none;
}
.booth-strip__cell canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.booth-strip__cell canvas.is-ready { opacity: 1; }

/* 랜딩: 스트립을 최대한 크게 보이도록 주변 요소를 줄인다 */
.wordmark { font-size: clamp(40px, min(16vw, 7.5dvh), 76px); }
.wordmark-sub { margin-top: 6px; font-size: 12px; }
.home__lang { margin-bottom: 4px; }
.home__stage { padding: 8px 0 10px; }
.booth-strip {
  --cell-w: min(100cqw * 0.72 - 20px, (100cqh - 10px - 66px) / 4 * 4 / 3);
  padding: 10px 10px 34px;
  gap: 6px;
}
.booth-strip__beat { bottom: 8px; }
.home__actions { padding-top: 12px; }
@media (max-height: 760px) {
  .home__sub { display: none; }
  .home__actions .fine { margin-top: 6px; font-size: 12px; }
}

/* 랜딩 보조 문장은 항상 한 줄 (좁은 화면에서는 글자를 줄여서 맞춤) */
.home__sub {
  white-space: nowrap;
  font-size: min(15px, 3.7vw);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 랜딩: 네컷 스트립 두 장을 자연스럽게 겹쳐 놓는다 (앞장 = 첫 포즈, 뒷장 = 두 번째 포즈) */
.booth-pair {
  display: grid;
  place-items: center;
}
.booth-pair .booth-strip {
  grid-area: 1 / 1;
  /* 두 장이 옆으로 겹치므로 가로는 화면 폭 안에서, 세로는 남는 높이 안에서 */
  --cell-w: min((100cqw * 0.94) / 1.85 - 20px, (100cqh - 24px - 66px) / 4 * 4 / 3);
}
.booth-strip--back {
  transform: translateX(44%) translateY(-3%) rotate(7deg);
  z-index: 0;
  box-shadow: 0 18px 32px -22px rgba(107, 63, 209, 0.45);
}
.booth-strip--front {
  transform: translateX(-40%) translateY(2%) rotate(-5deg);
  z-index: 1;
  box-shadow: 0 26px 44px -22px rgba(107, 63, 209, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* kzna 로고: 투명 PNG 를 마스크로 써서 글자색(currentColor)으로 칠한다 */
.kzna-logo {
  display: block;
  aspect-ratio: 2624 / 685;
  background-color: currentColor;
  -webkit-mask: url('../assets/logos/kzna-logo.png') center / contain no-repeat;
  mask: url('../assets/logos/kzna-logo.png') center / contain no-repeat;
}
.wordmark.kzna-logo {
  height: clamp(40px, min(13vw, 7dvh), 70px);
  width: auto;
  font-size: 0;
  color: var(--ink);
}
.member-row__logo.kzna-logo { height: 14px; width: auto; color: var(--hot); }
