/* ================================================================
   style.css — Киоск-тема для фотобудки.
   Pass 8: PHOTO_RESULT, карусель дизайнов, обновлённый QR, крупный lifeview.
   ================================================================ */
:root {
  --c-bg:        #14102b;
  --c-surface:   #1f1a3d;
  --c-primary:   #5b3df0;
  --c-primary-h: #7c5df2;
  --c-text:      #f5f3ff;
  --c-muted:     #9d97c9;
  --c-accent:    #34d399;
  --c-danger:    #f87171;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius:      18px;
  --txt-shadow:  0 1px 12px rgba(0,0,0,.95), 0 2px 4px rgba(0,0,0,.8);
  --glass-bg:    rgba(10, 8, 25, 0.55);
  --glass-blur:  blur(8px);
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  user-select: none;
  -webkit-user-select: none;
}

/* ── Screens — весь viewport ─────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ── Общий контент-блок ─────────────────────────────────────── */
.screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 36px 60px 24px;
  gap: 20px;
  overflow: hidden;
  position: relative;
  background: rgba(0,0,0,.18);
}
.screen-body.center {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.screen-title {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: var(--txt-shadow);
}
.screen-hint {
  font-size: clamp(16px, 2vw, 22px);
  color: var(--c-muted);
  text-shadow: var(--txt-shadow);
}

/* ── Click zones — невидимые зоны клика ─────────────────────── */
.click-zone-full,
.click-zone-left,
.click-zone-right,
.click-zone-bottom {
  position: absolute;
  cursor: pointer;
  z-index: 10;
}
.click-zone-full   { top: 0; bottom: 0; left: 0; right: 0; }
.click-zone-left   { top: 0; bottom: 0; left: 0; width: 50%; }
.click-zone-right  { top: 0; bottom: 0; right: 0; width: 50%; }
.click-zone-bottom { bottom: 0; left: 0; right: 0; height: 20%; z-index: 200; }

/* ── IDLE / WELCOME ─────────────────────────────────────────── */
#screen-IDLE { background: radial-gradient(ellipse at 50% 40%, #2a1660 0%, #14102b 70%); }

.attract {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  position: relative;
}

.attract-glow {
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(91,61,240,.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: glow-pulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glow-pulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ── SONG_PICK ───────────────────────────────────────────────── */
.song-pick-body {
  padding: 32vh 0 4vh;
  background: none;
}
.carousel {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.carousel-track {
  display: flex;
  gap: 32px;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
  padding: 16px 0;
}
.carousel-card {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s;
  transform-origin: center center;
}
.song-cover-wrap {
  display: block;
  width: 100%;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  transform-origin: center center;
}
.song-cover,
.song-cover-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0;
  display: block;
  flex-shrink: 0;
}
.song-cover-placeholder {
  background: linear-gradient(135deg, #3a2580 0%, #1a0f4a 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; opacity: .6; color: #fff;
}
.song-cover-placeholder::before { content: '\266A'; }
.song-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.song-title  { font-size: clamp(28px, 2.3vw, 52px); font-weight: 800; color: #111; text-shadow: none; }
.song-artist { font-size: clamp(24px, 2vw,   44px); font-weight: 500; color: #333; text-shadow: none; }

.carousel.no-anim .carousel-track,
.carousel.no-anim .carousel-card,
.carousel.no-anim .song-cover-wrap {
  transition: none !important;
}

/* ── SONG ────────────────────────────────────────────────────── */
.record-screen { background: #000; }
.karaoke-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; z-index: 0;
}
.record-overlay {
  position: absolute; inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 20px;
  gap: 12px;
  pointer-events: none;
}
.record-hud {
  display: flex; align-items: center; gap: 16px;
  background: rgba(0,0,0,.65);
  border-radius: 10px;
  padding: 8px 16px;
}
.rec-dot   { color: var(--c-danger); font-size: 20px; animation: blink 1s step-end infinite; }
.rec-timer { font-size: clamp(24px, 3vw, 36px); font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── PRE_PHOTO ───────────────────────────────────────────────── */
#screen-PRE_PHOTO { background: var(--c-bg); }

/* ── PHOTO ──────────────────────────────────────────────────── */
#screen-PHOTO { background: #000; }

.photo-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-hint {
  position: absolute;
  bottom: 20px; left: 0; right: 0;
  text-align: center;
  font-size: clamp(18px, 2.5vw, 28px);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.95);
  background: rgba(0,0,0,.5);
  padding: 10px 0;
  z-index: 2;
}
.photo-hint:empty { display: none; }

#photo-crop-zone {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  flex-shrink: 0;
  transform: translateY(10px);
}
.crop-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.crop-media.hidden { display: none !important; }

/* ── Таймер "1 2 3" ─────────────────────────────────────────── */
.countdown-bar {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 32px);
  z-index: 8;
  pointer-events: none;
}
.count-digit {
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 900;
  font-family: var(--font);
  color: rgba(0, 0, 0, 0.55);
  text-shadow: none;
  line-height: 1;
  transition: color .18s, transform .18s, text-shadow .18s;
  user-select: none;
}
.count-digit.active {
  color: #ffffff;
  transform: scale(1.3);
  text-shadow: 0 0 24px rgba(255, 255, 255, .55), 0 2px 10px rgba(0, 0, 0, .5);
}

/* ── PHOTO_RESULT — чистый кадр крупно ──────────────────────── */
.photo-result-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}
.photo-result-img {
  max-height: 80vh;
  max-width: 62vw;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 16px 60px rgba(0,0,0,.7);
}

/* ── DESIGN_PICK — карусель дизайнов (по типу SONG_PICK) ─────── */
.design-pick-body {
  padding: 0 0 20vh;
  background: none;
}
.design-pick-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 20px;
}
.design-carousel {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}
.design-carousel-track {
  display: flex;
  gap: 36px;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
  padding: 20px 0;
}
.design-carousel-card {
  flex: 0 0 300px;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s;
  transform-origin: center center;
}
.design-img-wrap {
  display: block;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  transform-origin: center center;
}
.design-carousel-img {
  width: 300px;
  max-height: 66vh;
  object-fit: contain;
  display: block;
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(0,0,0,.55);
  transition: box-shadow .2s;
}
.design-carousel-card.selected .design-carousel-img {
  box-shadow: 0 0 0 4px var(--c-primary), 0 0 32px rgba(91, 61, 240, .6);
}
.design-carousel.no-anim .design-carousel-track,
.design-carousel.no-anim .design-carousel-card,
.design-carousel.no-anim .design-img-wrap {
  transition: none !important;
}

/* ── PROCESSING ─────────────────────────────────────────────── */
.spinner {
  width: 80px; height: 80px;
  border: 6px solid rgba(91,61,240,.25);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── QR — фото слева (наклонено) + QR справа ────────────────── */
.qr-layout {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: flex;
}
.qr-left {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 2vw 4vh 6vw;
}
.qr-right {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 17vh;
}
.qr-photo {
  max-height: 82vh;
  max-width: 46vw;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 16px 60px rgba(0,0,0,.65);
  transform: rotate(-5deg);
}
#qr-canvas {
  display: block;
  background: #fff;
  padding: 16px;
  width: clamp(220px, 26vw, 340px);
  aspect-ratio: 1 / 1;
  transform: translate(calc(-12vw + 20px), -30px);
}

/* ── Utilities ───────────────────────────────────────────────── */
.hidden { display: none !important; }