/* LookCat - Scan Styles */

/* === LEVEL UP CELEBRATION === */
.levelup-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7); opacity: 0; pointer-events: none;
  transition: opacity .4s;
}
.levelup-overlay.active { opacity: 1; pointer-events: auto; }
.levelup-box {
  text-align: center; animation: levelupPop .6s cubic-bezier(.175,.885,.32,1.275);
}
.levelup-star { font-size: 64px; animation: levelupSpin 1s ease-out; }
.levelup-title {
  font-family: 'Nunito', sans-serif; font-size: 36px; font-weight: 900;
  color: var(--orange); margin: 8px 0 4px; text-shadow: 0 2px 12px rgba(245,166,35,.5);
}
.levelup-sub {
  font-family: 'Quicksand', sans-serif; font-size: 16px; font-weight: 700;
  color: #fff; opacity: .9;
}
.levelup-avatars {
  display: flex; gap: 24px; justify-content: center; margin-top: 24px;
}
.levelup-avatars img {
  width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--orange);
  box-shadow: 0 4px 20px rgba(245,166,35,.4);
  animation: levelupPop .6s cubic-bezier(.175,.885,.32,1.275) .3s both;
}
@keyframes levelupPop {
  0% { transform: scale(0); } 100% { transform: scale(1); }
}
@keyframes levelupSpin {
  0% { transform: scale(0) rotate(-180deg); } 100% { transform: scale(1) rotate(0); }
}
/* Confetti */
.confetti-container { position: fixed; inset: 0; z-index: 2001; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute; width: 10px; height: 10px; top: -20px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* === AMBIENT VIDEO === */
.ambient-video {
  position: absolute; top: 0; left: 0; width: 100%; height: auto;
  object-fit: contain; object-position: top center; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity 2.5s ease-in-out;
}
.ambient-video.visible { opacity: 1; }

/* === SCAN SCREEN === */
#scanScreen { align-items: center; justify-content: center; padding-top: calc(var(--top-h) + var(--safe-top) + 16px); gap: 20px; position: relative; }
#scanScreen > *:not(.ambient-video) { position: relative; z-index: 1; }

.scan-tap-hint {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: hintFade 5s ease-in-out infinite;
}
.scan-tap-text {
  font-family: 'Dancing Script', cursive; font-size: 26px; font-weight: 700;
  color: var(--orange); letter-spacing: .5px;
}
.scan-tap-arrow {
  font-size: 22px; color: var(--orange); line-height: 1;
  animation: arrowBounce 1.8s ease-in-out infinite;
}
@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
@keyframes hintFade {
  0%, 80%, 100% { opacity: 1; }
  90% { opacity: .4; }
}

.scan-btn-wrap { position: relative; margin: 8px 0; cursor: pointer; }
.scan-btn-ring {
  position: absolute; inset: -12px; border-radius: 50%;
  border: 3.5px dashed var(--orange); opacity: .4;
  animation: ringRotate 12s linear infinite;
}
@keyframes ringRotate { to { transform: rotate(360deg); } }
.scan-icon {
  width: 180px; height: 180px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 8px 32px rgba(245,166,35,.3);
  animation: iconNudge 5s ease-in-out infinite;
}
.scan-btn-wrap:active .scan-icon { animation: none; transform: scale(0.88); }
@keyframes iconNudge {
  0%, 85%, 100% { transform: scale(1); }
  90% { transform: scale(0.88); }
  93% { transform: scale(1.03); }
  96% { transform: scale(1); }
}
.scan-label {
  font-family: 'Nunito', sans-serif; font-size: 26px; font-weight: 900;
  color: var(--green); letter-spacing: .3px; text-align: center; line-height: 1.3;
}
.scan-hint {
  font-size: 17px; color: var(--text-soft); font-weight: 700; text-align: center;
  line-height: 1.5; max-width: 300px;
}

/* === SCANNING SCREEN === */
#scanningScreen { align-items: center; justify-content: flex-start; padding-top: calc(var(--safe-top) + 12vh); gap: 24px; text-align: center; position: relative; overflow: hidden; }
#scanningScreen > *:not(.bridge-video):not(.bridge-cat) { position: relative; z-index: 2; }
.scanning-mascot {
  width: 140px; height: auto;
  filter: drop-shadow(0 8px 20px rgba(245,166,35,.25));
  animation: catLook 2s ease-in-out infinite;
}
@keyframes catLook {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.05) rotate(-3deg); }
  60% { transform: scale(1.05) rotate(3deg); }
}
.scanning-text {
  font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 800;
  color: var(--text); max-width: 280px; line-height: 1.4; position: relative; z-index: 2;
}
/* Bridge cat images */
.bridge-cat {
  position: absolute; bottom: 0; height: 45%; max-height: 340px; width: auto;
  transition: transform .6s cubic-bezier(.22,1,.36,1); z-index: 1;
  pointer-events: none;
}
.bridge-cat--b1 { left: 0; transform: translateX(-110%); }
.bridge-cat--b1.visible { transform: translateX(0); }
.bridge-cat--b2 { right: 0; transform: translateX(110%); }
.bridge-cat--b2.visible { transform: translateX(0); }
/* Bridge video (replaces bridgeCat1 when available) */
.bridge-video {
  position: absolute; bottom: 0; left: 0; width: 100%; height: auto;
  object-fit: cover; object-position: bottom center;
  z-index: 1; pointer-events: none; display: none;
  background: transparent; opacity: 1;
  transition: opacity 0.6s ease-out;
}
.bridge-video.visible { display: block; }
.bridge-video.fade-out { opacity: 0; }
.scanning-dots { display: flex; gap: 8px; justify-content: center; }
.scanning-dots span {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--orange); animation: dotBounce 1.4s ease-in-out infinite;
}
.scanning-dots span:nth-child(2) { animation-delay: .15s; }
.scanning-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .3; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* === PERSON BLOCKED SCREEN === */
#personBlockedScreen {
  align-items: center; justify-content: flex-end; gap: 0; text-align: center;
  background: linear-gradient(180deg, #FFF8E8 0%, #FFF3D6 50%, #FFE8B8 100%);
  overflow: hidden; padding-bottom: 0;
}
.person-speech {
  position: relative; background: #fff; border-radius: 24px;
  padding: 24px 28px; margin: 0 24px 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08);
  max-width: 340px;
}
.person-speech::after {
  content: ''; position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent;
  border-top: 18px solid #fff;
}
.person-speech-text {
  font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 700;
  color: #5D4E37; line-height: 1.5;
}
.person-speech-emoji { font-size: 36px; margin-bottom: 8px; display: block; }
.person-cat {
  width: 100%; max-width: 320px; height: auto; margin-top: 8px;
  filter: drop-shadow(0 -4px 12px rgba(0,0,0,.06));
}
.person-btn-row {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 24px calc(env(safe-area-inset-bottom, 16px) + 16px);
  background: linear-gradient(0deg, rgba(255,232,184,.95) 60%, transparent);
}
.person-back-btn {
  width: 100%; padding: 16px; border: none; border-radius: 16px;
  font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 800;
  background: var(--green); color: #fff; cursor: pointer;
  box-shadow: 0 4px 12px rgba(74,139,63,.3);
}

/* === DUPLICATE SCREEN === */
#duplicateScreen {
  align-items: center; justify-content: flex-start; gap: 0; text-align: center;
  overflow: hidden; padding: 0;
}
.dup-cat-img {
  width: 100%; height: auto; object-fit: contain; object-position: top center;
  flex-shrink: 0;
}
.dup-content {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 20px 24px 0; gap: 12px;
}
.dup-title {
  font-family: 'Nunito', sans-serif; font-size: 24px; font-weight: 900;
  color: var(--orange); line-height: 1.3;
}
.dup-text {
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 700;
  color: var(--text); line-height: 1.6; max-width: 340px;
}
.dup-btn-row {
  width: 100%; padding: 16px 24px calc(env(safe-area-inset-bottom, var(--safe-bottom, 16px)) + 16px);
}
.dup-back-btn {
  width: 100%; padding: 16px; border: none; border-radius: 16px;
  font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 800;
  background: var(--green); color: #fff; cursor: pointer;
  box-shadow: 0 4px 12px rgba(74,139,63,.3);
}
