/* ═══════════════════════════════════════════════════════════════════════════ */
/* FONTS                                                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */
@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');
  font-weight: 400;
  font-display: swap;
}

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

/* ═══════════════════════════════════════════════════════════════════════════ */
/* RESET & BASE                                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'TCCC-Unity', 'Arial Black', sans-serif;
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* APP ROOT — Fixed 1080x1920 canvas, auto-scaled to fit viewport            */
/* ═══════════════════════════════════════════════════════════════════════════ */
#app-root {
  width: 1080px;
  height: 1920px;
  position: relative;
  overflow: hidden;
  background: #000;
  transform-origin: center center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SCREEN SYSTEM                                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */
.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.transitions-enabled {
  transition: opacity 0.4s ease;
}

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

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SCREEN 1: LANDING                                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */
.landing-bg {
  width: 100%;
  height: 100%;
  background:
    url('/assets/images/bg-start.jpg') center/cover no-repeat,
    #000;
  position: relative;
}

.cta-button {
  position: absolute;
  left: 228px;
  top: 833px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.5));
  animation: pulse-glow 2s ease-in-out infinite;
  line-height: 0;
}

.cta-button svg {
  width: 625px;
  height: 170px;
  display: block;
}

.cta-button:active {
  transform: scale(0.93);
  opacity: 0.85;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
}

@keyframes pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 30px rgba(215, 193, 118, 0.3));
  }
  50% {
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 60px rgba(215, 193, 118, 0.6));
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SCREEN 2: CAMERA                                                           */
/* ═══════════════════════════════════════════════════════════════════════════ */
#screen-camera,
#screen-preview,
#screen-loading {
  background: url('/assets/images/bg-camera.jpg') center/cover no-repeat, #000;
}

#screen-result {
  background: url('/assets/images/bg-result.jpg') center/cover no-repeat, #000;
}

.camera-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.camera-container {
  position: absolute;
  left: 88px;
  top: 296px;
  width: 904px;
  height: 1281px;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  border: none;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.camera-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 5;
}

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

.countdown-overlay span {
  font-family: 'TCCC-Holidays', 'TCCC-Holidays-OTF', serif;
  font-size: 260px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  text-shadow: none;
  animation: countdown-pop 1s ease-in-out;
}

@keyframes countdown-pop {
  0% { transform: scale(2); opacity: 0; }
  30% { transform: scale(1); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; }
}

.capture-svg-button {
  position: absolute;
  left: 421px;
  top: 1629px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  transition: all 0.15s ease;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.4));
}

.capture-svg-button svg {
  width: 239px;
  height: 239px;
  display: block;
}

.capture-svg-button:active {
  transform: scale(0.9);
  opacity: 0.85;
}

.capture-svg-button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* BUTTONS (shared)                                                           */
/* ═══════════════════════════════════════════════════════════════════════════ */
.action-button {
  border: none;
  border-radius: 60px;
  padding: 30px 80px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.action-button span {
  font-family: 'TCCC-Unity', 'Arial Black', sans-serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.action-button:active {
  transform: scale(0.94);
  opacity: 0.85;
}

.capture-button {
  background: linear-gradient(180deg, #c4102e 0%, #9b0c24 100%);
  border: 3px solid #e0384f;
}

.capture-button span { color: #fff; }

.confirm-button {
  background: linear-gradient(180deg, #d4a843 0%, #b8922b 100%);
  border: 3px solid #e8c55a;
}

.confirm-button span { color: #1a0a00; }

.secondary-button {
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.secondary-button span { color: #fff; }

.restart-svg-button {
  position: absolute;
  left: 309px;
  top: 1731px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  transition: all 0.15s ease;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.4));
}

.restart-svg-button svg {
  width: 463px;
  height: 112px;
  display: block;
}

.restart-svg-button:active {
  transform: scale(0.93);
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SCREEN 3: PREVIEW                                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */
.preview-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.preview-svg-button {
  position: absolute;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  transition: all 0.15s ease;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.4));
}

.preview-svg-button svg {
  width: 189px;
  height: 189px;
  display: block;
}

.preview-svg-button:active {
  transform: scale(0.9);
  opacity: 0.85;
}

#btn-retake {
  left: 305.5px;
  top: 1629px;
}

#btn-confirm {
  left: 585.5px;
  top: 1629px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SCREEN 3.5: LOADING                                                        */
/* ═══════════════════════════════════════════════════════════════════════════ */
.loading-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.loader-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 8px solid rgba(200, 169, 78, 0.15);
  border-top-color: #c8a94e;
  border-right-color: #D7C176;
  animation: spin 1.2s linear infinite;
  position: relative;
}

.loader-ring-inner {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 6px solid rgba(200, 169, 78, 0.1);
  border-bottom-color: #D7C176;
  border-left-color: #c8a94e;
  animation: spin 0.8s linear infinite reverse;
}

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

.loading-text {
  font-family: 'TCCC-Unity', 'Arial Black', sans-serif;
  font-size: 44px;
  color: #c8a94e;
  text-align: center;
}

.loading-subtext {
  font-family: 'TCCC-Unity', 'Arial Black', sans-serif;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.5);
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/* SCREEN 4: RESULT                                                           */
/* ═══════════════════════════════════════════════════════════════════════════ */
.result-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.result-image-container {
  position: absolute;
  left: 184px;
  top: 414px;
  width: 711px;
  height: 1008px;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.result-image-container #result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.qr-section {
  position: absolute;
  left: 50%;
  top: 1235px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-circle {
  width: 375px;
  height: 375px;
  border-radius: 50%;
  background: #D7C176;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-circle img {
  width: 211px;
  height: 211px;
  object-fit: contain;
  border-radius: 0;
}

.qr-label {
  font-family: 'TCCC-Unity', 'Arial Black', sans-serif;
  font-size: 26px;
  color: rgba(255, 255, 255, 0.7);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* FLASH OVERLAY                                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.flash-overlay.flash {
  opacity: 1;
  transition: opacity 0.05s ease;
}
