:root {
  --pink: #ff4d9d;
  --purple: #7b2ff7;
  --cyan: #2fe6ff;
  --lime: #c8ff3d;
  --yellow: #ffe14d;
  --ink: #1a1033;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(26, 16, 51, 0.28);
}

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

html, body {
  height: 100%;
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  overflow: hidden;
}

.bg {
  position: fixed;
  inset: -20%;
  z-index: -1;
  background: linear-gradient(125deg, var(--pink), var(--purple) 45%, var(--cyan));
  background-size: 200% 200%;
  animation: drift 14s ease-in-out infinite;
  filter: saturate(1.15);
}
@keyframes drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Screens */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.screen.active { display: flex; }

.card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 32px;
  padding: 30px 26px;
  box-shadow: var(--shadow);
  text-align: center;
}

/* Logo + home */
.logo {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -2px;
  background: linear-gradient(120deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  display: inline-block;
  transform-origin: 50% 70%;
  animation: logoLook 8s cubic-bezier(0.68, -0.4, 0.27, 1.4) infinite;
  will-change: transform;
}
.logo .dot { color: var(--cyan); -webkit-text-fill-color: var(--cyan); }
.tagline { font-size: 19px; font-weight: 600; margin: 14px 0 18px; color: #4a3a6b; }

.bullets { list-style: none; text-align: left; margin: 0 auto 22px; max-width: 300px; }
.bullets li {
  font-size: 16px;
  font-weight: 500;
  padding: 10px 14px;
  margin: 8px 0;
  background: #f4f0ff;
  border-radius: 16px;
}

.fineprint { font-size: 12.5px; color: #9b8fb5; margin-top: 14px; font-weight: 500; }
.muted { color: #8a7da8; font-weight: 500; }

.logo.small { font-size: 38px; margin-bottom: 6px; }

/* Social buttons */
.social-row { display: flex; gap: 10px; margin-top: 18px; }
.social-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: 999px;
  font-weight: 700; font-size: 15px; color: #fff; text-decoration: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.social-btn:active { transform: scale(0.96); }
.social-btn.tiktok { background: #161823; box-shadow: 0 8px 16px rgba(22, 24, 35, 0.32); }
.social-btn.tiktok svg { filter: drop-shadow(1.2px 0 0 #25f4ee) drop-shadow(-1.2px 0 0 #fe2c55); }
.social-btn.insta {
  background: linear-gradient(45deg, #f9ce34, #ee2a7b 45%, #6228d7);
  box-shadow: 0 8px 16px rgba(214, 41, 118, 0.38);
}

/* Fake Google button (test mode — looks real, just goes through) */
.gbtn-fake {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 280px; max-width: 100%; padding: 12px 18px;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
  transition: transform 0.12s ease, background 0.12s ease;
}
.gbtn-fake:hover { background: #f7f8f8; }
.gbtn-fake:active { transform: scale(0.97); }

/* Auth + name screens */
.auth-card, .name-card { text-align: center; }
.auth-card h2, .name-card h2 { font-size: 26px; margin: 4px 0 8px; }
.gbtn-wrap { display: flex; justify-content: center; margin: 22px 0 6px; min-height: 44px; }
.auth-note {
  background: #fff3f6; color: #c0306b; font-size: 13.5px; font-weight: 600;
  padding: 12px 14px; border-radius: 14px; margin: 10px 0; line-height: 1.4;
}
.name-input {
  width: 100%; margin: 22px 0 18px; padding: 16px 20px;
  font-family: inherit; font-size: 20px; font-weight: 600; text-align: center;
  color: var(--ink); background: #f4f0ff;
  border: 3px solid transparent; border-radius: 18px; outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.name-input:focus { border-color: var(--purple); background: #fff; }
.name-input::placeholder { color: #b7abd1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 18px;
  padding: 16px 26px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.7, 0.5, 1), box-shadow 0.15s ease, filter 0.12s ease;
  text-decoration: none;
  user-select: none;
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: scale(0.92); }
.btn.big { width: 100%; font-size: 20px; padding: 18px; }

.btn-primary {
  background: linear-gradient(120deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: 0 10px 22px rgba(123, 47, 247, 0.4);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 14px 28px rgba(123, 47, 247, 0.5); }

.btn-secondary { background: var(--cyan); color: var(--ink); box-shadow: 0 8px 18px rgba(47, 230, 255, 0.45); }
.btn-ghost { background: #f0ecfa; color: #6b5c8c; margin-top: 16px; }
.btn-skip {
  background: var(--yellow);
  color: var(--ink);
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);
  z-index: 5;
}
.btn-skip:active { transform: translateX(-50%) scale(0.96); }

/* Report / flag */
.flag-btn {
  position: absolute; top: 14px; left: 14px; z-index: 6;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.42); border: none; cursor: pointer;
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform 0.18s cubic-bezier(0.34, 1.7, 0.5, 1), background 0.15s ease;
}
.flag-btn:hover { background: rgba(255, 60, 90, 0.6); }
.flag-btn:active { transform: scale(0.86); }
.flag-btn.done { background: rgba(255, 60, 90, 0.9); }

.report-link {
  display: block; margin: 14px auto 0; padding: 6px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 13.5px; color: #b6a7d4;
  text-decoration: underline; text-underline-offset: 3px;
}
.report-link:hover { color: var(--pink); }
.report-link.done { color: #2fa363; text-decoration: none; cursor: default; }

/* Searching */
.radar { position: relative; width: 150px; height: 150px; margin: 6px auto 22px; }
.radar-core {
  position: absolute; inset: 0; margin: auto;
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(120deg, var(--pink), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.ping {
  position: absolute; inset: 0; margin: auto;
  width: 76px; height: 76px; border-radius: 50%;
  border: 3px solid var(--purple);
  animation: ping 2s ease-out infinite;
  opacity: 0;
}
.ping:nth-child(2) { animation-delay: 0.66s; }
.ping:nth-child(3) { animation-delay: 1.33s; }
@keyframes ping {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(2.1); opacity: 0; }
}
.self-preview {
  width: 120px; height: 120px; border-radius: 24px; object-fit: cover;
  margin: 18px auto 4px; display: block; transform: scaleX(-1); background: #000;
}
.search-card h2 { font-size: 24px; margin-bottom: 6px; }

/* Call stage */
.call-stage { position: fixed; inset: 0; }
.tiles { position: absolute; inset: 0; display: flex; flex-direction: column; }
.tile { position: relative; flex: 1; overflow: hidden; background: #120a26; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-local video { transform: scaleX(-1); }
.tile-tag {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(0,0,0,0.45); color: #fff;
  font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.tile-local .tile-tag { left: auto; right: 10px; }

.topic-banner {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 5; max-width: 88%;
  background: rgba(255,255,255,0.95);
  border-radius: 20px; padding: 10px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: var(--shadow);
}
.topic-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--purple); }
.topic-text { font-size: 17px; font-weight: 600; text-align: center; line-height: 1.2; }

.timer-wrap {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 96px; height: 96px; z-index: 6; pointer-events: none;
}
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.25); stroke-width: 8; }
.ring-fg {
  fill: none; stroke: var(--lime); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 339.292; stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear;
  filter: drop-shadow(0 0 6px rgba(200,255,61,0.8));
}
.timer-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.timer-wrap.low .ring-fg { stroke: var(--pink); }

.rec-dot {
  position: absolute; top: 18px; right: 16px; z-index: 6;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.4); color: #fff; font-size: 13px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
}
.rec-dot span { width: 9px; height: 9px; border-radius: 50%; background: #ff3b3b; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* Wrap screen */
.saved-card h2 { font-size: 28px; margin-bottom: 4px; }
.wrap-emoji { font-size: 56px; margin-bottom: 6px; line-height: 1; }
.saved-card .btn-primary { margin-top: 20px; }
.upload-status {
  font-size: 13.5px; font-weight: 600; color: #2fa363;
  background: #eafaf0; border-radius: 12px; padding: 9px 14px; margin: 14px 0 0;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: 14px; z-index: 50; max-width: 90%;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== Cartoony animations ===== */

/* Logo looks left, then right, then back to center every 8s */
@keyframes logoLook {
  0%, 72%  { transform: translateX(0) rotate(0deg); }
  80%      { transform: translateX(-8px) rotate(-10deg); }
  88%      { transform: translateX(8px) rotate(10deg); }
  94%      { transform: translateX(-3px) rotate(-3deg); }
  100%     { transform: translateX(0) rotate(0deg); }
}

/* Bouncy entrance for every card-based screen */
.screen.active .card { animation: cardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.screen.active .call-stage { animation: fadeIn 0.45s ease both; }
@keyframes cardPop {
  0%   { opacity: 0; transform: scale(0.82) translateY(26px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Staggered pop for the home bullets */
.screen.active .bullets li { animation: popUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.screen.active .bullets li:nth-child(1) { animation-delay: 0.12s; }
.screen.active .bullets li:nth-child(2) { animation-delay: 0.2s; }
.screen.active .bullets li:nth-child(3) { animation-delay: 0.28s; }
@keyframes popUp {
  0%   { opacity: 0; transform: translateY(14px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Bouncing dots loader */
.dots { display: inline-flex; gap: 5px; margin-left: 7px; vertical-align: middle; }
.dots i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--purple);
  animation: dotBounce 1s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40%           { transform: translateY(-8px); opacity: 1; }
}

/* Wrap-screen clapboard bounces in then bobs */
.wrap-emoji { animation: bounceIn 0.6s cubic-bezier(0.34, 1.7, 0.5, 1) both, bob 2.6s ease-in-out 0.6s infinite; }
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3) rotate(-15deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
