:root {
  --neon-pink: #ff2d55;
  --neon-purple: #bc13fe;
  --neon-heart: #ff007f;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  position: fixed;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Main layer */
.main-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
}

.grid-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  background: #000;
}

.grid-item {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle, #1a000d 0%, #000 100%);
}

.grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: brightness(0.7) contrast(1.1);
  transition: opacity 1s ease;
}

.grid-item.is-ready video {
  opacity: 0.6;
}

.grid-item--5 {
  z-index: 5;
  border: 2px solid var(--neon-heart);
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.4);
  animation: center-pulse 2s infinite;
}

@keyframes center-pulse {
  50% {
    box-shadow: 0 0 40px rgba(255, 0, 127, 0.6);
    transform: scale(1.02);
  }
}

.heart-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.video-mask {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(to top, #000 10%, transparent 60%),
    linear-gradient(to right, rgba(0, 0, 0, 0.18), transparent 35%);
}

.status-badge {
  position: absolute;
  top: calc(40px + var(--safe-top));
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--neon-heart);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.65);
  color: #eee;
  font-size: 12px;
  line-height: 1.2;
  backdrop-filter: blur(6px);
}

.status-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 8px var(--neon-pink);
  animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

.main-content {
  position: relative;
  z-index: 10;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 24px calc(130px + var(--safe-bottom));
  pointer-events: none;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  pointer-events: auto;
  animation: content-in 850ms 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.app-logo {
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  border: 2px solid var(--neon-heart);
  border-radius: 18px;
  background: #222;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.16);
}

.text-group {
  min-width: 0;
}

.text-group h1 {
  max-width: 195px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.text-group h1 span {
  color: var(--neon-pink);
  font-size: 0.8em;
}

.text-group p {
  margin-top: 5px;
  color: var(--neon-pink);
  font-size: 13px;
  letter-spacing: 2px;
}

.desc-box {
  padding: 12px;
  border-left: 4px solid var(--neon-heart);
  border-radius: 0 8px 8px 0;
  background: rgba(20, 20, 20, 0.8);
  color: #ccc;
  font-size: 14px;
  line-height: 1.5;
  backdrop-filter: blur(5px);
  pointer-events: auto;
  animation: content-in 850ms 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.download-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 20px 24px calc(20px + var(--safe-bottom));
  background: linear-gradient(to top, #000 80%, transparent);
}

.download-actions {
  display: flex;
  gap: 12px;
}

.main-btn {
  display: flex;
  width: 100%;
  height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
  background: var(--neon-heart);
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.5);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  animation: button-float 3s ease-in-out infinite;
  transition: transform 120ms ease, box-shadow 180ms ease;
}

@keyframes button-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.main-btn:hover {
  box-shadow: 0 0 30px rgba(255, 0, 127, 0.7);
}

.main-btn:active {
  transform: scale(0.97);
}

.footer-tagline {
  margin-top: 10px;
  color: #666;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
}

@media (min-width: 760px) {
  .main-content {
    width: min(760px, 72vw);
    padding-right: 48px;
    padding-bottom: 150px;
    padding-left: 48px;
  }

  .app-logo {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
    border-radius: 21px;
  }

  .text-group h1 {
    max-width: none;
    font-size: 42px;
  }

  .text-group p {
    font-size: 15px;
  }

  .desc-box {
    max-width: 620px;
    font-size: 16px;
  }

  .download-bar {
    padding-right: 48px;
    padding-left: 48px;
  }

  .download-actions {
    width: min(760px, 100%);
  }

  .main-btn {
    font-size: 18px;
  }

  .status-badge {
    left: 42px;
    padding: 8px 14px;
    font-size: 13px;
  }
}

@media (max-width: 370px) {
  .main-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .app-header {
    gap: 12px;
  }

  .app-logo {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
    border-radius: 16px;
  }

  .text-group h1 {
    font-size: 25px;
  }

  .text-group p {
    font-size: 11px;
    letter-spacing: 1.5px;
  }

  .desc-box {
    font-size: 13px;
  }

  .download-bar {
    padding-right: 18px;
    padding-left: 18px;
  }

  .download-actions {
    gap: 9px;
  }

  .main-btn {
    font-size: 14px;
  }
}

@media (max-height: 700px) {
  .main-content {
    padding-bottom: 124px;
  }

  .app-header {
    margin-bottom: 15px;
  }
}

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