:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --text: #1c1c1e;
  --subtext: #6c6c70;
  --border: #c6c6c8;
  --purple: #a78bfa;
  --green: #4ade80;
  --orange: #fb923c;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "SF Pro Display", "Avenir Next", "Segoe UI", sans-serif;
}

body {
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle at 15% 4%, #fff 0%, transparent 40%), var(--bg);
}

.ad-header {
  display: none;
  margin: 0 0 12px;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 1.2px;
  line-height: 1;
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(145deg, rgba(18, 18, 18, 0.95), rgba(8, 8, 8, 0.95));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.phone {
  width: min(430px, 100%);
  height: min(920px, 95vh);
  border-radius: 32px;
  border: 1px solid #d8d8dc;
  background: var(--bg);
  overflow: hidden;
  position: relative;
  box-shadow: 0 26px 70px rgba(20, 20, 32, 0.26);
}

.screen {
  position: absolute;
  inset: 0;
  transition: opacity 250ms ease, transform 280ms ease;
}

.screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.clip-screen { background: #000; }

.clip-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.hazard-popup {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(300px, calc(100% - 28px));
  padding: 14px 16px 12px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.96), rgba(120, 0, 0, 0.96));
  border: 1px solid rgba(255, 77, 77, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.18), 0 18px 40px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.hazard-popup.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
}

.hazard-popup h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.02;
  letter-spacing: -0.4px;
}

.hazard-popup p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

.hazard-ribbon {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.6px;
  color: #fff;
  background: linear-gradient(90deg, #ff3b30, #ff0066);
}

.status-bar {
  height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.status-bar.dark { color: #fff; }

.home {
  padding: 0 12px 102px;
  overflow: hidden;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--border);
}

.home-header h1 {
  margin: 0;
  font-size: 44px;
  line-height: 0.9;
  letter-spacing: -1.4px;
  font-weight: 900;
  color: var(--text);
}

.home-header p {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--subtext);
  letter-spacing: 0.2px;
}

.header-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.streak,
.icon-btn {
  height: 34px;
  border: 0;
  border-radius: 17px;
  background: var(--surface);
  color: #111;
  font-weight: 800;
}

.streak {
  min-width: 52px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.icon-btn {
  width: 34px;
  font-size: 14px;
}

.quick-stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-stats article {
  border-radius: 18px;
  background: #ebebeb;
  min-height: 76px;
  display: grid;
  place-items: center;
  text-align: center;
}

.quick-stats h2 {
  margin: 0;
  font-size: 34px;
  line-height: 0.84;
  letter-spacing: -0.8px;
  color: #111;
  font-weight: 900;
}

.quick-stats p {
  margin: 2px 0 0;
  font-size: 9px;
  color: #4f4f54;
  font-weight: 700;
}

.section-label {
  margin: 14px 0 8px;
  color: #55565d;
  font-weight: 800;
  letter-spacing: 3px;
  font-size: 10px;
}

.cards {
  display: grid;
  gap: 8px;
}

.quick-card {
  min-height: 84px;
  border: 0;
  width: 100%;
  border-radius: 22px;
  color: #fff;
  padding: 12px 12px 10px 16px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.quick-card h3 {
  margin: 0;
  font-size: 30px;
  line-height: 0.83;
  letter-spacing: -0.8px;
  font-weight: 900;
}

.quick-card p {
  margin: 5px 0 0;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.87);
  font-weight: 800;
}

.pill-icon {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-right: 2px;
}

.grad-onthisday { background: linear-gradient(130deg, #f59e0b, #ec4899); }
.grad-recents { background: linear-gradient(130deg, #10b981, #0891b2); cursor: pointer; }
.grad-random { background: linear-gradient(130deg, #8b5cf6, #6366f1); }
.grad-duplicates { background: linear-gradient(130deg, #ef4444, #f97316); }
.grad-videos { background: linear-gradient(130deg, #3b82f6, #8b5cf6); }

.floating-toggle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(338px, calc(100% - 48px));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.floating-toggle button {
  border: 0;
  height: 40px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: transparent;
  color: #5d5f65;
}

.floating-toggle button.active {
  background: #6366f1;
  color: #fff;
}

.swipe {
  background: #000;
  color: #fff;
  padding: 0 0 10px;
}

.swipe-header {
  padding: 4px 12px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.circle {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 22px;
  display: grid;
  place-items: center;
}

.circle.bolt { color: var(--orange); font-size: 16px; }

.swipe-title { text-align: center; }

.swipe-title h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 1px;
}

.swipe-title p {
  margin: 3px 0 0;
  font-size: 8px;
  color: #666;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.swipe-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.done {
  border: 0;
  border-radius: 23px;
  background: var(--purple);
  color: #000;
  min-width: 74px;
  height: 38px;
  font-size: 12px;
  font-weight: 900;
}

.swipe-stage {
  position: relative;
  height: calc(100% - 240px);
  min-height: 300px;
  margin: 6px 0 8px;
  display: grid;
  place-items: center;
}

.swipe.auto-mode .swipe-actions,
.swipe.auto-mode .delete-now { display: none; }

.swipe-stage.simple-mode .photo-card.back,
.swipe-stage.simple-mode .photo-card.third { display: none; }

.stamp {
  position: absolute;
  top: 24px;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 8px 12px;
  border: 3px solid;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
  opacity: 0;
  transition: opacity 170ms ease;
  z-index: 8;
}

.stamp.delete {
  left: 14px;
  transform: rotate(-8deg);
  border-color: var(--purple);
  color: var(--purple);
}

.stamp.keep {
  right: 14px;
  transform: rotate(8deg);
  border-color: var(--green);
  color: var(--green);
}

.photo-card {
  position: absolute;
  width: calc(100% - 36px);
  max-width: 300px;
  height: 100%;
  max-height: 410px;
  border-radius: 18px;
  overflow: hidden;
  background: #181818;
  transition: transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 220ms ease;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.6);
}

.photo-card.back { transform: scale(0.94) translateY(8px); opacity: 0.8; }
.photo-card.third { transform: scale(0.9) translateY(14px); opacity: 0.56; }

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hover-hand {
  position: absolute;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  font-size: 46px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
  opacity: 0;
  left: 0;
  top: 0;
  z-index: 9;
  pointer-events: none;
  transition: left 220ms cubic-bezier(0.2, 0.7, 0.2, 1), top 220ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 120ms ease;
}

.delete-now {
  width: calc(100% - 28px);
  margin: 0 auto 12px;
  border: 0;
  border-radius: 18px;
  height: 40px;
  background: linear-gradient(180deg, #b79cff, #9773ff);
  color: #000;
  font-size: 12px;
  font-weight: 900;
  transition: opacity 220ms ease;
}

.delete-now.hidden { opacity: 0; pointer-events: none; }

.swipe-footer {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 10px;
  padding: 0 14px 10px;
}

.count-block { text-align: center; }

.lbl {
  margin: 0;
  font-size: 13px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 1.2px;
}

.lbl.delete { color: var(--purple); }
.lbl.keep { color: var(--green); }

.num {
  margin: 6px 0 0;
  font-size: 20px;
  line-height: 0.85;
  font-weight: 900;
  color: #555;
}

.tug {
  height: 9px;
  border-radius: 5px;
  background: #2a2a2a;
  display: flex;
  overflow: hidden;
}

.seg { display: block; }
.seg.delete { width: 0; background: var(--purple); }
.seg.remain { flex: 1; background: #2a2a2a; }
.seg.keep { width: 0; background: var(--green); }

.result {
  background: #000;
  display: block;
  padding: 0;
}

.appstore-final {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.appstore-final-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.appstore-final-finger {
  position: absolute;
  left: 49%;
  top: 22%;
  font-size: 58px;
  z-index: 5;
  opacity: 1;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
  transform: translateY(0);
  animation: fingerBounce 900ms ease-in-out infinite;
}

@keyframes fingerBounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

.pulse { animation: pulse 460ms ease 1; }

@keyframes pulse {
  0% { transform: scale(1); }
  45% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@media (max-width: 420px) {
  html,
  body {
    background:
      radial-gradient(circle at 18% 8%, rgba(82, 82, 91, 0.38), transparent 42%),
      radial-gradient(circle at 82% 14%, rgba(39, 39, 42, 0.6), transparent 36%),
      linear-gradient(180deg, #050505, #0f0f10 58%, #121214);
  }

  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 10px 12px;
  }

  .ad-header {
    display: block;
    align-self: center;
    font-size: 24px;
    letter-spacing: 0.8px;
    padding: 9px 14px;
  }

  .phone {
    width: min(390px, calc(100% - 14px));
    height: min(840px, calc(100vh - 90px));
    border-radius: 30px;
    border: 5px solid transparent;
    background:
      linear-gradient(var(--bg), var(--bg)) padding-box,
      linear-gradient(135deg, #f97316, #ec4899 34%, #8b5cf6 68%, #22d3ee) border-box;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
  }
}
