@font-face {
  font-family: 'TCCC-Unity';
  src: url('/assets/fonts/TCCC-UnityHeadline-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'TCCC-Holidays';
  src:
    url('/assets/fonts/TCCCNewHolidays23-Narrow.ttf') format('truetype'),
    url('/assets/fonts/TCCCHolidays23-Narrow.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --coke-red: #F40009;
  --coke-red-deep: #B00008;
  --coke-gold: #FFD700;
  --coke-cream: #FFF5E8;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

body {
  font-family: 'TCCC-Unity', 'Arial Black', sans-serif;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

#app-root {
  width: 1080px;
  height: 1920px;
  position: relative;
  overflow: hidden;
  background: #000;
  transform-origin: center center;
  flex-shrink: 0;
}

.screen {
  position: absolute;
  inset: 0;
  width: 1080px;
  height: 1920px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.screen.transitions-enabled {
  transition: opacity 0.35s ease;
}

/* ── Landing ─────────────────────────────────────────────── */
.landing-bg {
  position: absolute;
  inset: 0;
  background: var(--coke-red) url('/assets/images/bg-start.jpg') center / cover no-repeat;
  overflow: hidden;
}

.landing-pattern {
  position: absolute;
  right: -40px;
  top: 80px;
  width: 420px;
  opacity: 0.28;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.landing-ornaments {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 920px;
  opacity: 0.95;
  pointer-events: none;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25));
  animation: floaty 4.5s ease-in-out infinite;
}

.landing-santa {
  position: absolute;
  left: 50%;
  bottom: 420px;
  transform: translateX(-50%);
  height: 980px;
  width: auto;
  max-width: 720px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 24px 48px rgba(0,0,0,0.4));
  animation: santa-in 0.9s ease-out both;
}

.landing-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(180,0,8,0.15) 0%,
    rgba(180,0,8,0.05) 40%,
    rgba(0,0,0,0.55) 72%,
    rgba(0,0,0,0.82) 100%
  );
  pointer-events: none;
}

.landing-content {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  z-index: 3;
}

.brand-mark {
  font-family: 'TCCC-Holidays', 'TCCC-Unity', sans-serif;
  font-size: 88px;
  letter-spacing: 0.02em;
  color: var(--coke-cream);
  text-shadow: 0 4px 24px rgba(0,0,0,0.45);
  line-height: 1;
}

.landing-title {
  font-family: 'TCCC-Unity', sans-serif;
  font-size: 58px;
  line-height: 1.12;
  font-weight: 700;
  text-shadow: 0 6px 28px rgba(0,0,0,0.5);
  color: #fff;
}

.landing-sub {
  font-family: 'TCCC-Holidays', 'TCCC-Unity', sans-serif;
  font-size: 34px;
  opacity: 0.9;
  letter-spacing: 0.03em;
  color: var(--coke-cream);
}

.cta-button {
  appearance: none;
  border: none;
  cursor: pointer;
  background: #fff;
  color: var(--coke-red);
  font-family: 'TCCC-Unity', sans-serif;
  font-size: 40px;
  font-weight: 700;
  padding: 28px 72px;
  border-radius: 999px;
  min-width: 440px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
  text-transform: none;
}

.cta-button:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.cta-button.secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: none;
  border: 3px solid rgba(255,255,255,0.45);
}

.cta-button.small {
  min-width: 0;
  padding: 22px 36px;
  font-size: 28px;
  background: var(--coke-red);
  color: #fff;
}

.cta-button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

@keyframes floaty {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-12px); }
}

@keyframes santa-in {
  from { opacity: 0; transform: translateX(-50%) translateY(40px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Camera / preview ────────────────────────────────────── */
.camera-wrapper,
.preview-wrapper,
.result-wrapper,
.loading-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 64px;
  gap: 36px;
  background: #0a0a0a url('/assets/images/bg-camera.jpg') center / cover no-repeat;
  position: relative;
}

.deco-corner {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 2;
}

.camera-container {
  position: absolute;
  top: 160px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 1200px;
  border-radius: 28px;
  overflow: hidden;
  background: #111;
  border: 5px solid rgba(255,215,0,0.55);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 3px rgba(244,0,9,0.65);
}

#camera-feed,
#preview-image,
#result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#camera-feed.rotated {
  transform: scaleX(-1) rotate(90deg);
  width: 1200px;
  height: 900px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -600px;
  margin-top: -450px;
}

#result-image {
  transform: none;
}

.frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.camera-hint {
  position: relative;
  z-index: 3;
  font-family: 'TCCC-Holidays', 'TCCC-Unity', sans-serif;
  font-size: 42px;
  color: var(--coke-cream);
  margin-bottom: 8px;
}

.capture-btn,
.preview-actions,
.restart-btn {
  position: relative;
  z-index: 3;
}

.preview-actions {
  display: flex;
  gap: 28px;
}

.countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
}

.countdown-overlay.hidden {
  display: none;
}

#countdown-number {
  font-family: 'TCCC-Holidays', 'TCCC-Unity', sans-serif;
  font-size: 220px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: countdown-pop 1s ease-in-out;
}

.countdown-hint {
  font-family: 'TCCC-Unity', sans-serif;
  font-size: 40px;
  letter-spacing: 0.04em;
}

@keyframes countdown-pop {
  0% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Loading ─────────────────────────────────────────────── */
.loading-wrapper {
  justify-content: center;
  background:
    radial-gradient(circle at 50% 35%, #7a0008 0%, #1a0000 70%),
    url('/assets/images/bg-result.jpg') center / cover;
  gap: 24px;
}

.loading-santa {
  height: 520px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 40px rgba(0,0,0,0.45));
  animation: floaty-plain 2.8s ease-in-out infinite;
}

@keyframes floaty-plain {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.loader-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 8px solid rgba(255,255,255,0.15);
  border-top-color: var(--coke-gold);
  animation: spin 1s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-ring-inner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(244,0,9,0.35);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'TCCC-Holidays', 'TCCC-Unity', sans-serif;
  font-size: 48px;
  text-align: center;
  color: var(--coke-cream);
}

.loading-subtext {
  font-family: 'TCCC-Unity', sans-serif;
  font-size: 28px;
  opacity: 0.75;
}

/* ── Result ──────────────────────────────────────────────── */
.result-wrapper {
  background: #120505 url('/assets/images/bg-result.jpg') center / cover no-repeat;
  justify-content: flex-end;
  padding-bottom: 72px;
}

.result-gift {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1080px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
}

.result-image-container {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 780px;
  height: 1100px;
  border-radius: 24px;
  overflow: hidden;
  border: 4px solid rgba(255,215,0,0.55);
  box-shadow: 0 0 0 3px rgba(244,0,9,0.5);
  z-index: 2;
}

.share-panel {
  position: relative;
  z-index: 3;
  width: 920px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: rgba(0,0,0,0.62);
  border-radius: 32px;
  padding: 32px 40px 36px;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,215,0,0.25);
}

.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-circle {
  width: 220px;
  height: 220px;
  border-radius: 24px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

#qr-code {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-label {
  font-family: 'TCCC-Holidays', 'TCCC-Unity', sans-serif;
  font-size: 30px;
  color: var(--coke-cream);
}

.email-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-label {
  font-family: 'TCCC-Unity', sans-serif;
  font-size: 24px;
  opacity: 0.85;
}

.email-row {
  display: flex;
  gap: 16px;
  width: 100%;
}

#email-input {
  flex: 1;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 28px;
  padding: 22px 28px;
  border-radius: 999px;
  outline: none;
  font-family: 'TCCC-Unity', sans-serif;
}

#email-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.email-status {
  min-height: 32px;
  font-size: 24px;
  color: #9FE870;
  font-family: 'TCCC-Unity', sans-serif;
}

.email-status.error {
  color: #ffb4b4;
}

#flash-overlay {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

#flash-overlay.flash {
  animation: flash 0.5s ease-out;
}

@keyframes flash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}
