:root {
  --background: #f5f5f4;
  --foreground: #262626;
  --muted: #b2b2b1;
  --panel: #e7e7e6;
  --border: #b2b2b1;
  --red: #c83f38;
  --red-light: #f26a62;
  --red-hi: #ffd1ce;
  --red-shadow: #9f2b27;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px;
}

.header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.logo svg,
.status-heart svg,
.heart-button svg,
.hero-heart svg {
  image-rendering: pixelated;
}

.screen {
  min-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
}

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.title {
  margin: 36px 0 0;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 46px;
  letter-spacing: 0.22em;
  font-weight: 400;
}

.claim {
  margin: 24px 0 0;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 500;
}

.copy {
  max-width: 350px;
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.75;
  color: rgb(38 38 38 / 72%);
}

.quiet-copy {
  max-width: 350px;
  margin: 28px 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: rgb(38 38 38 / 64%);
}

.anti {
  margin: 28px 0 0;
  padding: 14px 0;
  width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: rgb(38 38 38 / 76%);
  font-size: 16px;
}

.button {
  border: 0;
  background: var(--foreground);
  color: var(--background);
  padding: 18px 28px;
  width: 100%;
  min-height: 58px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid var(--border);
  background: rgb(231 231 230 / 55%);
  color: var(--foreground);
  padding: 15px;
  min-height: 56px;
  cursor: pointer;
}

.button-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 32px;
}

.button-row .active {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
}

.price,
.teaser,
.label,
.muted {
  color: var(--muted);
}

.price {
  margin-top: 18px;
  font-size: 14px;
}

.teaser {
  margin-top: 32px;
  font-size: 14px;
  line-height: 1.6;
}

.panel {
  margin-top: 28px;
  width: 100%;
  border: 1px solid var(--border);
  background: rgb(231 231 230 / 55%);
  padding: 24px;
}

.code {
  margin: 0;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 42px;
  line-height: 1.15;
}

.text-input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgb(231 231 230 / 55%);
  padding: 18px 16px;
  color: var(--foreground);
  outline: none;
}

.code-input {
  margin-top: 12px;
  text-align: center;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 33px;
}

.back {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: rgb(231 231 230 / 55%);
  color: var(--foreground);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.heart-screen {
  min-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  padding-bottom: 96px;
}

.heart-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.heart-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 160ms ease;
}

.heart-button:active {
  transform: scale(0.97);
}

.heart-button.pulse {
  animation: heart-pulse 2.8s ease-in-out infinite;
}

.micro {
  min-height: 22px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 16px;
}

.notice {
  width: min(82vw, 320px);
  margin-top: 20px;
  border: 1px solid rgb(178 178 177 / 52%);
  background: rgb(231 231 230 / 62%);
  padding: 14px 18px;
  font-size: 20px;
  line-height: 1.42;
  color: rgb(38 38 38 / 78%);
  box-shadow: 0 10px 40px rgb(38 38 38 / 4%);
}

.pair-code {
  position: fixed;
  left: max(22px, calc((100vw - 430px) / 2 + 22px));
  bottom: 18px;
  z-index: 30;
  max-width: 138px;
  border: 1px solid transparent;
  background: transparent;
  color: rgb(178 178 177 / 72%);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  padding: 6px 8px;
  cursor: pointer;
}

.pair-code:hover {
  border-color: var(--border);
  background: rgb(231 231 230 / 75%);
  color: var(--foreground);
}

.connection-status {
  position: fixed;
  right: max(22px, calc((100vw - 430px) / 2 + 22px));
  bottom: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgb(178 178 177 / 76%);
  font-size: 13px;
}

.connection-status span {
  max-width: 142px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-heart {
  position: relative;
  width: 40px;
  height: 40px;
}

.status-heart svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  transform: translate(-50%, -50%);
}

.status-heart .fill-pixels {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  transform: translate(-50%, -50%);
}

.status-heart.arrived .base {
  animation: heart-pulse-soft 3.4s ease-in-out infinite;
}

.signal-rain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
}

.signal-rain i {
  position: absolute;
  display: block;
  image-rendering: pixelated;
}

.p1 { right: max(68px, calc((100vw - 430px) / 2 + 68px)); top: 7vh; width: 10px; height: 10px; background: rgb(212 63 56 / 95%); animation: signal-fall-one max(7s, calc(var(--travel-duration, 12s) * 0.92)) ease-in-out infinite; }
.p2 { right: max(100px, calc((100vw - 430px) / 2 + 100px)); top: 12vh; width: 8px; height: 8px; background: rgb(227 74 67 / 90%); animation: signal-fall-two max(8s, calc(var(--travel-duration, 12s) * 1.02)) ease-in-out infinite 1.4s; }
.p3 { right: max(48px, calc((100vw - 430px) / 2 + 48px)); top: 18vh; width: 8px; height: 8px; background: rgb(212 63 56 / 95%); animation: signal-fall-three max(8s, calc(var(--travel-duration, 12s) * 0.96)) ease-in-out infinite 2.5s; }
.p4 { right: max(120px, calc((100vw - 430px) / 2 + 120px)); top: 24vh; width: 10px; height: 10px; background: rgb(200 63 56 / 88%); animation: signal-fall-four max(9s, calc(var(--travel-duration, 12s) * 1.12)) ease-in-out infinite 3.4s; }
.p5 { right: max(80px, calc((100vw - 430px) / 2 + 80px)); top: 4vh; width: 8px; height: 8px; background: rgb(227 74 67 / 92%); animation: signal-fall-five max(8s, calc(var(--travel-duration, 12s) * 0.98)) ease-in-out infinite 0.6s; }
.p6 { right: max(140px, calc((100vw - 430px) / 2 + 140px)); top: 28vh; width: 8px; height: 8px; background: rgb(200 63 56 / 86%); animation: signal-fall-six max(10s, calc(var(--travel-duration, 12s) * 1.18)) ease-in-out infinite 4s; }
.p7 { right: max(32px, calc((100vw - 430px) / 2 + 32px)); top: 34vh; width: 8px; height: 8px; background: rgb(212 63 56 / 90%); animation: signal-fall-seven max(9s, calc(var(--travel-duration, 12s) * 1.06)) ease-in-out infinite 5s; }
.p8 { right: max(112px, calc((100vw - 430px) / 2 + 112px)); top: 40vh; width: 8px; height: 8px; background: rgb(227 74 67 / 82%); animation: signal-fall-eight max(10s, calc(var(--travel-duration, 12s) * 1.22)) ease-in-out infinite 6s; }

.push {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  background: rgb(231 231 230 / 75%);
  padding: 16px;
}

.push p {
  margin: 0;
  color: rgb(38 38 38 / 78%);
  font-size: 16px;
}

.push-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo {
  position: fixed;
  right: max(18px, calc((100vw - 430px) / 2 + 18px));
  bottom: 70px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.admin-screen {
  min-height: calc(100dvh - 40px);
  padding-bottom: 36px;
}

.admin-header,
.admin-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-title-row {
  margin-top: 54px;
}

.admin-title-row h1 {
  margin: 4px 0 0;
  font-size: 30px;
  font-weight: 500;
}

.admin-version {
  color: var(--muted);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.admin-button,
.admin-chip,
.admin-quiet,
.admin-danger,
.admin-link {
  border: 1px solid var(--border);
  background: rgb(231 231 230 / 62%);
  color: var(--foreground);
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
}

.admin-button {
  background: var(--foreground);
  color: var(--background);
  min-width: 116px;
}

.admin-panel,
.admin-card {
  margin-top: 18px;
  border: 1px solid var(--border);
  background: rgb(231 231 230 / 52%);
  padding: 16px;
}

.admin-list {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.admin-card {
  display: grid;
  gap: 14px;
}

.admin-card-main p {
  margin: 6px 0 0;
}

.admin-code {
  margin: 0;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 19px;
  color: var(--foreground);
}

.admin-speed,
.admin-links,
.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-chip.active {
  background: var(--foreground);
  color: var(--background);
}

.admin-link {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-danger {
  border-color: rgb(200 63 56 / 55%);
  color: var(--red);
}

.admin-error {
  margin-top: 18px;
  border: 1px solid rgb(200 63 56 / 45%);
  color: var(--red);
  padding: 12px;
}

@keyframes heart-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.035); opacity: 0.96; }
}

@keyframes heart-pulse-soft {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.86; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

@keyframes subtle-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.blink {
  animation: subtle-blink 0.4s ease-in-out 2;
}

@keyframes status-pixel-fill {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.status-fill-pixel {
  opacity: 0;
  animation: status-pixel-fill 0.2s steps(1, end) forwards;
}

.fill-delay-1 { animation-delay: 0.7s; }
.fill-delay-2 { animation-delay: 1.6s; }
.fill-delay-3 { animation-delay: 2.5s; }
.fill-delay-4 { animation-delay: 3.4s; }
.fill-delay-5 { animation-delay: 4.3s; }
.fill-delay-6 { animation-delay: 5.2s; }
.fill-delay-7 { animation-delay: 6.1s; }
.fill-delay-8 { animation-delay: 7s; }
.fill-delay-9 { animation-delay: 7.9s; }
.fill-delay-10 { animation-delay: 8.8s; }
.fill-delay-11 { animation-delay: 9.7s; }
.fill-delay-12 { animation-delay: 10.6s; }

@keyframes signal-fall-one {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: 0.98; }
  88% { transform: translate3d(-22px, 78vh, 0); opacity: 0.9; }
  100% { transform: translate3d(-24px, 84vh, 0); opacity: 0; }
}

@keyframes signal-fall-two {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  16% { opacity: 0.92; }
  88% { transform: translate3d(16px, 74vh, 0); opacity: 0.82; }
  100% { transform: translate3d(18px, 80vh, 0); opacity: 0; }
}

@keyframes signal-fall-three {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  14% { opacity: 0.96; }
  86% { transform: translate3d(-8px, 68vh, 0); opacity: 0.84; }
  100% { transform: translate3d(-10px, 74vh, 0); opacity: 0; }
}

@keyframes signal-fall-four {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  20% { opacity: 0.9; }
  88% { transform: translate3d(10px, 62vh, 0); opacity: 0.74; }
  100% { transform: translate3d(12px, 68vh, 0); opacity: 0; }
}

@keyframes signal-fall-five {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  14% { opacity: 0.96; }
  86% { transform: translate3d(-32px, 82vh, 0); opacity: 0.82; }
  100% { transform: translate3d(-34px, 88vh, 0); opacity: 0; }
}

@keyframes signal-fall-six {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  22% { opacity: 0.88; }
  88% { transform: translate3d(18px, 54vh, 0); opacity: 0.7; }
  100% { transform: translate3d(20px, 60vh, 0); opacity: 0; }
}

@keyframes signal-fall-seven {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  18% { opacity: 0.9; }
  86% { transform: translate3d(-20px, 48vh, 0); opacity: 0.68; }
  100% { transform: translate3d(-24px, 54vh, 0); opacity: 0; }
}

@keyframes signal-fall-eight {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  20% { opacity: 0.82; }
  86% { transform: translate3d(28px, 38vh, 0); opacity: 0.58; }
  100% { transform: translate3d(30px, 44vh, 0); opacity: 0; }
}
