/* =============================================
   AI 패밀리 체험존 키오스크 - 반응형 디자인 시스템
   세로형(9:16) / 가로형(16:9) / 태블릿 / 모바일 자동 대응
   ============================================= */

:root {
  --brand: #8b7ff0;
  --brand-dark: #4a3dbf;
  --bg-deep: #0b0a18;
  --bg-mid: #16132e;
  --gold: #d8bc8a;
  --gold-soft: #e9d7b4;
  --gold-dim: rgba(216, 188, 138, 0.55);
  --text: #f4f2fb;
  --text-dim: rgba(233, 229, 248, 0.62);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.12);
  --hairline: rgba(255, 255, 255, 0.09);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --touch-min: 56px;
  --fs-base: clamp(16px, 1.8vmin, 22px);
  --font-body: 'Pretendard Variable', 'Pretendard', -apple-system, 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --font-display: 'Noto Serif KR', 'Pretendard Variable', serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 450;
  letter-spacing: -0.01em;
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 46% at 18% -8%, rgba(109, 96, 214, 0.28), transparent 70%),
    radial-gradient(ellipse 52% 36% at 88% 6%, rgba(216, 188, 138, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(74, 61, 191, 0.22), transparent 70%),
    linear-gradient(168deg, var(--bg-deep) 0%, var(--bg-mid) 58%, #241d4e 100%);
  min-height: 100dvh;
  overflow: hidden;
}

/* 필름 그레인 + 비네팅 — 고급 질감 레이어 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(4, 3, 12, 0.5) 100%);
}
#app { position: relative; z-index: 1; }

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* 큰 글씨 모드 */
body.large-text { --fs-base: clamp(20px, 2.4vmin, 28px); }

/* ---------- 공통 컴포넌트 ---------- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 3vmin, 40px);
  animation: fadeIn 0.35s ease;
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: var(--touch-min);
  padding: 0.7em 1.6em;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1.05em;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  position: relative;
  background: linear-gradient(155deg, #8d7bf2 0%, #6a58dd 55%, #5443c4 100%);
  color: #fff;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 10px 30px rgba(84, 67, 196, 0.42);
  overflow: hidden;
}
.btn-secondary {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.btn-big {
  font-size: 1.3em;
  padding: 0.9em 2.2em;
  min-height: 72px;
}
.btn-danger { background: rgba(244, 67, 54, 0.16); color: #ffab91; border: 1px solid rgba(244,67,54,0.32); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
  border: 1px solid var(--hairline);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  padding: clamp(14px, 2.5vmin, 28px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* ---------- 상단 헤더 ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(10px, 2vmin, 20px) clamp(16px, 3vmin, 40px);
  flex-shrink: 0;
}
.top-brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1em; letter-spacing: 0.09em;
}
.top-brand .logo-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 0 0 4px rgba(216, 188, 138, 0.14), 0 0 14px rgba(216, 188, 138, 0.55);
}
.top-actions { display: flex; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all 0.2s var(--ease-out);
}
.chip.active { background: rgba(139, 127, 240, 0.22); color: #fff; border-color: rgba(139, 127, 240, 0.65); }

/* ---------- 진행 단계 표시 ---------- */
.progress-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 0; flex-shrink: 0;
}
.step-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.16);
  transition: all 0.4s var(--ease-out);
}
.step-dot.done { background: var(--gold-dim); }
.step-dot.current {
  background: var(--gold-soft);
  transform: scale(1.5);
  box-shadow: 0 0 0 4px rgba(216, 188, 138, 0.16), 0 0 12px rgba(216, 188, 138, 0.6);
}

/* ---------- 메인(어트랙트) 화면 ---------- */
.attract {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: clamp(12px, 2.5vmin, 28px);
  padding: clamp(16px, 3vmin, 48px);
}
.attract .zone-name {
  font-family: var(--font-display);
  font-size: clamp(32px, 6.4vmin, 70px);
  font-weight: 900;
  letter-spacing: -0.01em;
  background: linear-gradient(175deg, #ffffff 20%, #ded5ff 52%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.22;
  text-shadow: 0 0 60px rgba(139, 127, 240, 0.35);
}
.attract .tagline {
  font-size: clamp(15px, 2.3vmin, 24px);
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.attract .facility {
  display: flex; align-items: center; gap: 14px;
  font-size: 0.72em; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--gold-dim); font-weight: 600;
}
.attract .facility::before, .attract .facility::after {
  content: '';
  width: clamp(24px, 4vmin, 48px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.attract .facility::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }

.floating-icons {
  display: flex; gap: clamp(10px, 2.2vmin, 22px);
  font-size: clamp(20px, 3.4vmin, 36px);
}
.floating-icons span {
  width: 2.1em; height: 2.1em;
  display: flex; align-items: center; justify-content: center;
  border-radius: 26%;
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 10px 26px rgba(0,0,0,0.3);
  animation: float 4.5s ease-in-out infinite;
}
.floating-icons span:nth-child(2) { animation-delay: 0.5s; }
.floating-icons span:nth-child(3) { animation-delay: 1s; }
.floating-icons span:nth-child(4) { animation-delay: 1.5s; }
.floating-icons span:nth-child(5) { animation-delay: 2s; }
.floating-icons span:nth-child(6) { animation-delay: 2.5s; }
.floating-icons span:nth-child(7) { animation-delay: 3s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.start-btn {
  font-size: clamp(19px, 3vmin, 32px);
  padding: 0.85em 2.6em;
  min-height: 80px;
  animation: pulse 3.2s ease-in-out infinite;
}
.start-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-20deg);
  animation: sheen 4.2s ease-in-out infinite;
}
@keyframes sheen {
  0%, 55% { left: -80%; }
  75%, 100% { left: 130%; }
}
@keyframes pulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 10px 30px rgba(84, 67, 196, 0.42); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 14px 52px rgba(139, 127, 240, 0.72); }
}

.demo-badge {
  position: fixed; top: calc(var(--safe-top) + 10px); right: 10px;
  background: rgba(216, 188, 138, 0.92); color: #2a2113;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; padding: 6px 16px; border-radius: 999px;
  z-index: 100;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* ---------- 합성 결과 쇼케이스 (기대치 UP) ---------- */
.attract-wrap {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 0;
  width: 100%;
}
.attract-wrap .attract { flex: 1; min-width: 0; }

.sc-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 4vmin, 40px);
  padding: clamp(10px, 2vmin, 24px);
  width: clamp(180px, 19vw, 300px);
  flex-shrink: 0;
}

.sc-card {
  position: relative;
  margin: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 9px 9px 7px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: scFloat 7s ease-in-out infinite;
}
.sc-tilt-0 { transform: rotate(-3deg); }
.sc-tilt-1 { transform: rotate(2.5deg); animation-delay: 1.4s; }
.sc-tilt-2 { transform: rotate(3deg); animation-delay: 0.7s; }
.sc-tilt-3 { transform: rotate(-2.5deg); animation-delay: 2.1s; }
@keyframes scFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

.sc-result {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.sc-before {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 34%;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  z-index: 2;
  background: #1a1c33;
}
.sc-before img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.sc-before-label {
  display: block;
  font-size: clamp(8px, 1.1vmin, 11px);
  font-weight: 800;
  text-align: center;
  padding: 2px 0 3px;
  background: rgba(10, 12, 30, 0.85);
  color: #cfc6ff;
}
.sc-arrow {
  position: absolute;
  top: 16%;
  left: 30%;
  z-index: 3;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--gold-soft), var(--gold));
  color: #2a2113;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  box-shadow: 0 4px 14px rgba(216, 188, 138, 0.5);
}
.sc-card figcaption {
  padding: 8px 4px 2px;
  text-align: center;
  line-height: 1.25;
}
.sc-card figcaption b { display: block; font-size: clamp(12px, 1.6vmin, 16px); }
.sc-card figcaption span { font-size: clamp(10px, 1.3vmin, 13px); color: var(--text-dim); }

.sc-hint {
  font-size: clamp(12px, 1.7vmin, 16px);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--gold-soft);
  background: rgba(216, 188, 138, 0.07);
  border: 1px solid rgba(216, 188, 138, 0.28);
  padding: 9px 24px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

/* 가로 스트립 (세로 화면용) */
.sc-strip {
  display: none;
  gap: clamp(14px, 3vmin, 26px);
  width: 100%;
  max-width: 720px;
  justify-content: center;
  padding: 14px 4px 4px;
}
.sc-strip .sc-card { flex: 1; min-width: 0; max-width: 165px; }

/* 가로 화면: 좌우 사이드에 배치, 스트립 숨김 */
@media (orientation: landscape) {
  .sc-strip { display: none; }
  .sc-side .sc-card:nth-child(2) { display: block; }
}
/* 가로인데 폭이 좁으면 사이드 카드 1장만 */
@media (orientation: landscape) and (max-width: 1100px) {
  .sc-side { width: clamp(150px, 17vw, 220px); }
  .sc-side .sc-card:nth-child(2) { display: none; }
}
/* 세로 화면: 사이드 숨기고 하단 스트립으로 */
@media (orientation: portrait) {
  .sc-side { display: none; }
  .sc-strip { display: flex; }
}
/* 세로 폭이 좁으면 2장만 */
@media (orientation: portrait) and (max-width: 520px) {
  .sc-strip .sc-card:nth-child(n + 3) { display: none; }
  .sc-strip .sc-card { max-width: 46%; }
}
/* 높이가 낮은 가로 화면(노트북 등)에서는 카드가 화면을 넘지 않게 */
@media (orientation: landscape) and (max-height: 760px) {
  .sc-side { gap: 14px; }
  .sc-side .sc-card:nth-child(2) { display: none; }
  .sc-side { justify-content: center; }
}

/* ---------- 체험 선택 그리드 ---------- */
.exp-grid {
  flex: 1;
  display: grid;
  gap: clamp(12px, 2.2vmin, 26px);
  overflow-y: auto;
  padding: 4px;
  align-content: safe center;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
/* 세로 화면: 1열 크게 / 가로 화면: 다열 */
@media (orientation: portrait) {
  .exp-grid { grid-template-columns: 1fr; }
  .exp-grid.many { grid-template-columns: 1fr 1fr; }
}
@media (orientation: landscape) {
  .exp-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

.exp-card {
  display: flex; align-items: center; gap: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
  min-height: clamp(110px, 14vmin, 150px);
}
.exp-card:hover {
  border-color: rgba(216, 188, 138, 0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 14px 44px rgba(0,0,0,0.4);
  transform: translateY(-3px);
}
@media (orientation: portrait) {
  .exp-card { min-height: clamp(120px, 12vh, 170px); }
  .exp-card h3 { font-size: 1.25em; }
  .exp-card p { font-size: 0.9em; }
}
.exp-card:active { transform: scale(0.97); }
.exp-card .exp-icon {
  font-size: clamp(36px, 5.4vmin, 56px);
  width: 1.7em; height: 1.7em;
  display: flex; align-items: center; justify-content: center;
  border-radius: 22%;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.exp-card h3 { font-size: 1.12em; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 5px; }
.exp-card p { font-size: 0.84em; color: var(--text-dim); line-height: 1.45; font-weight: 400; }
.exp-card .free-tag {
  margin-left: auto; flex-shrink: 0;
  background: rgba(216, 188, 138, 0.1); color: var(--gold-soft);
  border: 1px solid rgba(216, 188, 138, 0.3);
  padding: 6px 15px; border-radius: 999px; font-size: 0.72em; font-weight: 600; letter-spacing: 0.05em;
}

/* ---------- 테마 선택 ---------- */
.theme-grid {
  flex: 1;
  display: grid;
  gap: clamp(12px, 2vmin, 22px);
  overflow-y: auto;
  padding: 4px;
  align-content: safe center;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 44vw), 1fr));
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}
.theme-card {
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: clamp(150px, 20vmin, 210px);
  justify-content: center;
}
.theme-card:active { transform: scale(0.95); }
.theme-card.selected {
  border-color: rgba(216, 188, 138, 0.75);
  background: linear-gradient(180deg, rgba(216, 188, 138, 0.13), rgba(139, 127, 240, 0.1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 0 1px rgba(216, 188, 138, 0.4), 0 14px 44px rgba(0,0,0,0.42);
}
.theme-card .theme-emoji { font-size: clamp(40px, 6vmin, 62px); filter: drop-shadow(0 6px 16px rgba(0,0,0,0.35)); }
.theme-card h4 { font-size: 1.04em; font-weight: 700; letter-spacing: -0.01em; }
.theme-card p { font-size: 0.77em; color: var(--text-dim); line-height: 1.4; font-weight: 400; }

/* ---------- 배경(실제 장소) 선택 ---------- */
.bg-grid {
  flex: 1;
  display: grid;
  gap: clamp(12px, 2vmin, 22px);
  overflow-y: auto;
  padding: 4px;
  align-content: safe center;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 44vw), 1fr));
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.bg-card {
  position: relative;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column;
  min-height: clamp(170px, 24vmin, 240px);
}
.bg-card:active { transform: scale(0.96); }
.bg-card img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  display: block;
}
.bg-card-label {
  padding: 10px 14px;
  background: rgba(10, 12, 30, 0.72);
}
.bg-card-label h4 { font-size: 1em; margin: 0; }
.bg-card-label p { font-size: 0.75em; color: var(--text-dim); margin: 2px 0 0; line-height: 1.3; }
.bg-card.selected {
  border-color: rgba(216, 188, 138, 0.8);
  box-shadow: 0 0 0 1px rgba(216, 188, 138, 0.45), 0 16px 48px rgba(0, 0, 0, 0.5);
}
.bg-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--gold-soft), var(--gold));
  color: #2a2113;
  display: none;
  align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.bg-card.selected .bg-check { display: flex; }
.bg-none {
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
}
.bg-none-inner { text-align: center; padding: 16px; }
.bg-none-inner span { font-size: clamp(36px, 5vmin, 54px); display: block; margin-bottom: 8px; }
.bg-none-inner h4 { font-size: 1em; margin: 0 0 4px; }
.bg-none-inner p { font-size: 0.75em; color: var(--text-dim); margin: 0; }

/* ---------- 카메라 ---------- */
.camera-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 0;
}
.camera-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(216, 188, 138, 0.25), 0 24px 70px rgba(0,0,0,0.55);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4;
}
@media (orientation: landscape) {
  .camera-frame { height: min(62vh, 560px); }
}
@media (orientation: portrait) {
  .camera-frame { width: min(86vw, 520px); }
}
.camera-frame video, .camera-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.camera-frame video.mirror { transform: scaleX(-1); }
.face-guide {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.face-guide .oval {
  width: 62%; height: 66%;
  border: 2px dashed rgba(233, 215, 180, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18);
}
.countdown-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  font-family: var(--font-display);
  font-size: 120px; font-weight: 900;
  color: var(--gold-soft); text-shadow: 0 6px 40px rgba(0,0,0,0.7);
}
.camera-controls { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.shutter-btn {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #ece7dc);
  border: 5px solid rgba(255,255,255,0.28);
  box-shadow: 0 0 0 1px rgba(216, 188, 138, 0.5), 0 10px 30px rgba(0,0,0,0.45);
  cursor: pointer; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s var(--ease-out);
}
.shutter-btn:active { transform: scale(0.9); }

/* ---------- 폼 입력 (미래직업/베이커리) ---------- */
.form-scroll { flex: 1; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 10px; font-size: 1em; }
.option-row { display: flex; flex-wrap: wrap; gap: 10px; }
.option-pill {
  min-height: 52px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  color: var(--text);
  font-size: 0.92em; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.option-pill.selected {
  background: linear-gradient(155deg, rgba(139, 127, 240, 0.32), rgba(84, 67, 196, 0.28));
  border-color: rgba(139, 127, 240, 0.75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 6px 18px rgba(84, 67, 196, 0.35);
}
.text-input {
  width: 100%;
  min-height: 60px;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1.5px solid var(--glass-border);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: inherit;
  font-size: 1.05em;
}
.text-input::placeholder { color: rgba(255,255,255,0.4); }
.text-input:focus { outline: none; border-color: rgba(216, 188, 138, 0.7); box-shadow: 0 0 0 3px rgba(216, 188, 138, 0.18); }

/* ---------- 하단 네비게이션 ---------- */
.bottom-nav {
  display: flex; gap: 12px; justify-content: space-between; align-items: center;
  padding-top: clamp(10px, 2vmin, 20px);
  flex-shrink: 0;
}
.bottom-nav .spacer { flex: 1; }

/* ---------- 생성 진행 화면 ---------- */
.generating {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 24px; padding: 24px;
}
.gen-spinner {
  width: clamp(90px, 14vmin, 140px); height: clamp(90px, 14vmin, 140px);
  position: relative;
}
.gen-spinner .ring {
  position: absolute; inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
.gen-spinner .ring:nth-child(2) {
  inset: 13px; border-top-color: var(--gold); animation-duration: 1.8s; animation-direction: reverse;
}
.gen-spinner .center-emoji {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(36px, 6vmin, 56px);
}
@keyframes spin { to { transform: rotate(360deg); } }

.gen-steps { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.gen-step { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 0.95em; }
.gen-step.done { color: var(--gold-soft); }
.gen-step.current { color: #fff; font-weight: 700; }
.gen-step .mark { width: 26px; text-align: center; }

/* ---------- 결과 화면 ---------- */
.result-layout {
  flex: 1; display: flex; gap: clamp(16px, 3vmin, 36px);
  min-height: 0;
  overflow: hidden;
}
@media (orientation: portrait) {
  .result-layout { flex-direction: column; align-items: center; overflow-y: auto; }
  .result-image-wrap { width: min(80vw, 480px); flex-shrink: 0; }
  .result-side { width: 100%; max-width: 520px; }
}
@media (orientation: landscape) {
  .result-layout { flex-direction: row; align-items: center; justify-content: center; }
  .result-image-wrap { height: min(66vh, 620px); flex-shrink: 0; }
  .result-image-wrap img { height: 100%; width: auto; }
  .result-side { max-width: 420px; }
}
.result-image-wrap {
  position: relative;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(216, 188, 138, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.result-image-wrap::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.result-image-wrap img { width: 100%; display: block; }
.result-side { display: flex; flex-direction: column; gap: 16px; }
.result-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vmin, 34px);
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(175deg, #fff 30%, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.qr-box {
  background: linear-gradient(180deg, #ffffff, #f4f1ea);
  border-radius: 18px; padding: 18px 16px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #333;
  box-shadow: inset 0 0 0 1px rgba(216, 188, 138, 0.35), 0 14px 40px rgba(0,0,0,0.35);
}
.qr-box canvas { max-width: min(200px, 40vmin); }
.qr-box .qr-label { font-size: 0.8em; font-weight: 700; color: #555; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* AI 텍스트 카드 (직업추천/캐릭터소개) */
.ai-text-card { text-align: left; font-size: 0.88em; max-height: 30vh; overflow-y: auto; }
.ai-text-card h5 {
  color: var(--gold-soft);
  margin-bottom: 6px;
  font-size: 1.02em;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ai-text-card .career-item { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--glass-border); }
.ai-text-card .career-item:last-child { border-bottom: none; }
.ai-text-card p { color: var(--text-dim); line-height: 1.5; }

/* ---------- 동의 화면 ---------- */
.consent-box { max-width: 720px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.consent-item strong { font-size: 1.05em; }
.consent-item small { font-size: 0.85em; line-height: 1.5; }
.consent-item {
  display: flex; align-items: flex-start; gap: 14px;
  cursor: pointer;
}
.consent-item .checkbox {
  width: 32px; height: 32px; border-radius: 10px;
  border: 2px solid var(--glass-border);
  background: var(--glass);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  transition: all 0.15s;
}
.consent-item.checked .checkbox {
  background: linear-gradient(155deg, var(--gold-soft), var(--gold));
  border-color: transparent;
  color: #2a2113;
}
.consent-item .consent-text { font-size: 0.9em; line-height: 1.5; }
.consent-item .consent-text small { color: var(--text-dim); display: block; margin-top: 2px; }

/* ---------- 가이드 캐릭터 ---------- */
.guide-bubble {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px 0;
}
.guide-bubble .guide-face { font-size: clamp(30px, 4.5vmin, 44px); }
.guide-bubble .bubble {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--hairline);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 20px;
  font-size: 0.9em;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
}

/* ---------- 화면 제목 ---------- */
.screen-title { text-align: center; flex-shrink: 0; margin-bottom: clamp(10px, 2vmin, 20px); }
.screen-title h2 {
  font-family: var(--font-display);
  font-size: clamp(21px, 3.4vmin, 35px);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.screen-title p { color: var(--text-dim); font-size: 0.88em; font-weight: 400; margin-top: 6px; letter-spacing: 0.01em; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; bottom: calc(var(--safe-bottom) + 30px); left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 12, 30, 0.94);
  border: 1px solid rgba(216, 188, 138, 0.35);
  backdrop-filter: blur(12px);
  color: #fff; padding: 14px 30px; border-radius: 999px;
  font-size: 0.92em; font-weight: 500; letter-spacing: 0.01em;
  box-shadow: 0 16px 50px rgba(0,0,0,0.5);
  z-index: 1000;
  animation: toastIn 0.3s ease;
  max-width: 86vw;
  text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 스크롤바 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 관리자 기어 버튼 ---------- */
.admin-gear {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  bottom: calc(var(--safe-bottom) + 14px);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.35);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.2s ease;
}
.admin-gear:hover, .admin-gear:active {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.12);
  transform: rotate(45deg);
}

/* ---------- PIN 패드 ---------- */
.pin-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 6, 22, 0.82);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pin-modal {
  position: relative;
  background: rgba(28, 24, 58, 0.97);
  border: 1.5px solid var(--glass-border);
  border-radius: 24px;
  padding: 30px 28px 26px;
  width: min(88vw, 360px);
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
}
.pin-close {
  position: absolute; top: 12px; right: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6); font-size: 16px; cursor: pointer;
}
.pin-title { font-size: 1.2em; font-weight: 800; }
.pin-title .fa-gear { color: var(--brand, #8f7bff); margin-right: 6px; }
.pin-sub { color: var(--text-dim); font-size: 0.85em; margin: 6px 0 14px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; min-height: 18px; margin-bottom: 8px; }
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.15s ease;
}
.pin-dot.filled { background: var(--gold-soft); border-color: var(--gold-soft); box-shadow: 0 0 10px rgba(216,188,138,0.5); }
.pin-error { color: #ff8a9e; font-size: 0.8em; min-height: 1.2em; margin-bottom: 8px; font-weight: 600; }
.pin-pad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pin-key {
  height: 62px;
  border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: #fff; font-size: 1.4em; font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}
.pin-key:active { background: rgba(255,255,255,0.2); transform: scale(0.96); }
.pin-key-fn { font-size: 0.9em; color: var(--text-dim); }
.pin-key-ok {
  background: var(--brand, #8f7bff);
  color: #fff; border-color: transparent;
}
.pin-key-ok:disabled { opacity: 0.5; }

/* ===== 갤러리 월 (대기화면 '오늘의 작품') ===== */
.gallery-wall {
  width: 100%;
  max-width: 1100px;
  margin-top: 10px;
}
.gal-title {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--font-display);
  font-size: 0.92em;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-align: left;
  padding-left: 4px;
}
.gal-sub {
  font-weight: 500;
  font-size: 0.78em;
  color: var(--text-dim);
  margin-left: 8px;
}
.gal-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 10px;
  scrollbar-width: thin;
}
.gal-card {
  flex: 0 0 auto;
  width: clamp(110px, 13vw, 160px);
  margin: 0;
  border-radius: 13px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 28px rgba(0,0,0,0.4);
  transition: transform 0.3s var(--ease-out);
}
.gal-card:hover { transform: translateY(-4px); }
.gal-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}
.gal-card figcaption {
  font-size: 0.62em;
  padding: 6px 8px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gal-icon { font-size: 1.1em; }

/* ===== 테마 뱃지 ===== */
.theme-card { position: relative; }
.theme-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.62em;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  z-index: 2;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}
.badge-new { background: linear-gradient(135deg, #b78ef0, #7c5fd8); box-shadow: 0 3px 12px rgba(124, 95, 216, 0.5); }
.badge-hot { background: linear-gradient(135deg, var(--gold-soft), #c3a26b); color: #2a2113; box-shadow: 0 3px 12px rgba(216, 188, 138, 0.45); }
.badge-season { background: linear-gradient(135deg, #6cc3d5, #3a7bd5); box-shadow: 0 3px 12px rgba(58, 123, 213, 0.45); }

/* ===== 별점 ===== */
.rating-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}
.rating-label { font-size: 0.78em; color: var(--text-dim); font-weight: 600; }
.rating-stars { display: flex; gap: 6px; }
.star-btn {
  background: none;
  border: none;
  font-size: 1.9em;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 2px 4px;
  transition: transform 0.12s ease, color 0.12s ease;
  line-height: 1;
}
.star-btn.on { color: var(--gold-soft); text-shadow: 0 0 18px rgba(216, 188, 138, 0.6); }
.star-btn:active { transform: scale(1.25); }

/* ===== 갤러리 전시 버튼 ===== */
.gallery-publish-btn { width: 100%; }
.gallery-publish-btn:disabled { opacity: 0.75; }

/* ===== 동화책 페이지 텍스트 ===== */
.story-page {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 6px;
  line-height: 1.5;
}
.story-num {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--gold-soft), var(--gold));
  color: #2a2113;
  font-size: 0.7em;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
