:root {
  --ink: #0b0b0f;
  --muted: #6b7280;
  --blue: #007aff;
  --blue-bright: #4da3ff;
  --blue-deep: #0062d6;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --page-x: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: only light;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #eef6ff;
}

body {
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* —— Liquid glass background (animated) —— */
.zudid-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
  background: #e8f4ff;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
}

.bg-orb-a {
  width: 70vw;
  height: 70vw;
  max-width: 420px;
  max-height: 420px;
  top: 8%;
  left: -18%;
  background:
    radial-gradient(
      circle at 35% 35%,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(120, 205, 255, 0.7) 45%,
      rgba(0, 140, 255, 0.35) 100%
    );
  animation: orb-a 8s ease-in-out infinite alternate;
}

.bg-orb-b {
  width: 65vw;
  height: 65vw;
  max-width: 380px;
  max-height: 380px;
  top: 4%;
  right: -20%;
  background:
    radial-gradient(
      circle at 60% 40%,
      rgba(255, 255, 255, 0.9) 0%,
      rgba(100, 195, 255, 0.65) 50%,
      rgba(0, 130, 255, 0.3) 100%
    );
  animation: orb-b 9.5s ease-in-out infinite alternate;
}

.bg-orb-c {
  width: 90vw;
  height: 55vw;
  max-width: 520px;
  max-height: 320px;
  left: 5%;
  bottom: 8%;
  background:
    radial-gradient(
      ellipse at 50% 40%,
      rgba(180, 225, 255, 0.75) 0%,
      rgba(60, 170, 255, 0.55) 55%,
      rgba(0, 120, 255, 0.25) 100%
    );
  animation: orb-c 7s ease-in-out infinite alternate;
}

.glass {
  position: absolute;
  width: 52vw;
  height: 52vw;
  max-width: 540px;
  max-height: 540px;
  border-radius: 50%;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(150, 220, 255, 0.55) 40%,
      rgba(0, 145, 255, 0.7) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 2px 14px rgba(255, 255, 255, 0.95),
    inset 0 -18px 40px rgba(0, 130, 255, 0.18),
    0 12px 44px rgba(0, 130, 255, 0.12);
  opacity: 0.85;
  will-change: transform;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

.glass-top-left {
  top: -8vw;
  left: -18vw;
  animation: glass-a 10s ease-in-out infinite alternate;
}

.glass-top-right {
  top: -6vw;
  right: -18vw;
  animation: glass-b 11s ease-in-out infinite alternate;
}

.bottom-waves {
  position: absolute;
  left: -18%;
  right: -18%;
  bottom: -8%;
  height: 42%;
}

.wave {
  position: absolute;
  width: 88%;
  height: 58%;
  border-radius: 60% 60% 0 0;
  border-top: 2px solid rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.75) 0%,
      rgba(125, 210, 255, 0.62) 40%,
      rgba(0, 135, 255, 0.84) 100%
    );
  box-shadow:
    inset 0 8px 22px rgba(255, 255, 255, 0.72),
    inset 0 -22px 42px rgba(0, 115, 255, 0.22);
  will-change: transform;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

.wave-1 {
  left: -18%;
  bottom: 5%;
  animation: wave-a 6.5s ease-in-out infinite alternate;
}

.wave-2 {
  right: -20%;
  bottom: 8%;
  animation: wave-b 7.5s ease-in-out infinite alternate;
}

.wave-3 {
  left: 4%;
  bottom: -8%;
  width: 92%;
  height: 70%;
  animation: wave-c 8s ease-in-out infinite alternate;
}

.wave-4 {
  right: -8%;
  bottom: -16%;
  width: 78%;
  height: 65%;
  animation: wave-d 5.8s ease-in-out infinite alternate;
}

@keyframes orb-a {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(18vw, 10vh, 0) scale(1.12); }
}

@keyframes orb-b {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-16vw, 12vh, 0) scale(1.1); }
}

@keyframes orb-c {
  0% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  100% { transform: translate3d(10vw, -8vh, 0) scale(1.15) rotate(8deg); }
}

@keyframes glass-a {
  0% { transform: translate3d(0, 0, 0) rotate(-24deg) scaleX(1.2); }
  100% { transform: translate3d(10vw, 8vw, 0) rotate(-12deg) scaleX(1.3); }
}

@keyframes glass-b {
  0% { transform: translate3d(0, 0, 0) rotate(26deg) scaleX(1.18); }
  100% { transform: translate3d(-10vw, 9vw, 0) rotate(14deg) scaleX(1.28); }
}

@keyframes wave-a {
  0% { transform: translate3d(0, 0, 0) rotate(16deg) scaleX(1.25); }
  100% { transform: translate3d(6%, -12%, 0) rotate(8deg) scaleX(1.38); }
}

@keyframes wave-b {
  0% { transform: translate3d(0, 0, 0) rotate(-16deg) scaleX(1.25); }
  100% { transform: translate3d(-5%, -14%, 0) rotate(-6deg) scaleX(1.36); }
}

@keyframes wave-c {
  0% { transform: translate3d(0, 0, 0) rotate(-7deg) scaleX(1.3); }
  100% { transform: translate3d(4%, -10%, 0) rotate(2deg) scaleX(1.42); }
}

@keyframes wave-d {
  0% { transform: translate3d(0, 0, 0) rotate(11deg) scaleX(1.32); }
  100% { transform: translate3d(-4%, -16%, 0) rotate(4deg) scaleX(1.45); }
}

@media (max-width: 600px) {
  .glass {
    width: 72vw;
    height: 72vw;
  }

  .glass-top-left {
    top: -6vw;
    left: -28vw;
  }

  .glass-top-right {
    top: -4vw;
    right: -28vw;
  }

  .bottom-waves {
    left: -40%;
    right: -40%;
    bottom: -4%;
    height: 40%;
  }

  .wave {
    width: 110%;
  }

  .bg-orb-a,
  .bg-orb-b {
    width: 85vw;
    height: 85vw;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* —— Page —— */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  padding:
    max(14px, calc(var(--safe-top) + 10px))
    var(--page-x)
    max(12px, calc(10px + var(--safe-bottom)));
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  overflow: hidden;
}

.home-page {
  padding-top: max(22px, calc(var(--safe-top) + 14px));
}

.home-head {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  width: 100%;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  gap: 12px;
  animation: rise-in 420ms var(--ease-out) both;
}

.home-top {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  width: 100%;
}

.brand {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  text-align: center;
  margin: 0;
}

.brand-icon {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow:
    0 14px 32px rgba(0, 122, 255, 0.32),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.45);
}

.brand-name {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--blue);
}

.title {
  margin: 6px 0 0;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--ink);
}

.subtitle {
  margin: 8px auto 0;
  max-width: 32ch;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.01em;
}

/* —— CTA —— */
.cta-block {
  width: 100%;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  animation: rise-in 480ms var(--ease-out) 40ms both;
}

.cta {
  margin: 0;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #007aff;
  background-image: linear-gradient(90deg, #5eb0ff 0%, #2f8cff 42%, #007aff 100%);
  color: #fff !important;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow:
    0 0 0 0.5px rgba(120, 190, 255, 0.45),
    0 12px 28px rgba(0, 122, 255, 0.38);
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out), filter 140ms var(--ease-out);
  will-change: transform;
  box-sizing: border-box;
}

.cta-label {
  white-space: nowrap;
  color: #fff;
}

.cta-ico {
  width: 20px;
  height: 20px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  display: block;
}

.cta-ico-dark {
  filter: brightness(0) invert(1);
}

.mute-ico,
.chip-ico {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.cta:active,
.cta.is-pressed {
  transform: scale(0.96);
  filter: brightness(0.94);
  box-shadow:
    0 0 0 0.5px rgba(120, 190, 255, 0.35),
    0 6px 16px rgba(0, 122, 255, 0.28);
}

.cta.done {
  background-image: linear-gradient(90deg, #34c759 0%, #248a3d 100%);
}

.cta-hint {
  margin: 8px 0 0;
  width: 100%;
  text-align: center;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— Cards —— */
.glass-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow:
    0 10px 28px rgba(20, 80, 160, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.section-title {
  margin: 15px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  animation: rise-in 500ms var(--ease-out) 70ms both;
}

.steps {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 5px;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-height: 0;
  margin: 15px 0 0;
}

.step {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  width: 100%;
  -webkit-flex: 1 1 0;
  flex: 1 1 0;
  min-height: 0;
  animation: rise-in 520ms var(--ease-out) both;
}

.step:nth-child(1) {
  animation-delay: 90ms;
}
.step:nth-child(2) {
  animation-delay: 140ms;
}
.step:nth-child(3) {
  animation-delay: 190ms;
}

.step-body {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
}

.step h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.step p {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 500;
}

.step p strong {
  font-weight: 800;
  color: var(--ink);
}

.step-visual {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.08);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  -webkit-justify-content: center;
  align-items: center;
  justify-content: center;
  -webkit-flex: 0 0 36px;
  flex: 0 0 36px;
  -webkit-align-self: center;
  align-self: center;
}

.step-visual > img {
  width: 20px;
  height: 20px;
  margin: 0;
}

.step-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #5eb0ff, #007aff);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  -webkit-justify-content: center;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.35);
  border: 1.5px solid #fff;
}

.step-badge img {
  width: 10px;
  height: 10px;
}

/* —— Safety —— */
.safety {
  margin-top: 6px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.12);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  animation: rise-in 560ms var(--ease-out) 220ms both;
}

.safety .chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #5eb0ff, #007aff);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  -webkit-justify-content: center;
  align-items: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  -webkit-align-self: center;
  align-self: center;
  margin-top: 0;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.28);
}

.safety .chip-ico {
  width: 14px;
  height: 14px;
}

.safety p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 500;
}

/* —— Result page —— */
.page.result-page {
  -webkit-justify-content: flex-start;
  justify-content: flex-start;
  gap: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-left: var(--page-x);
  padding-right: var(--page-x);
}

.result-page .brand {
  margin-top: 8px;
}

.result-page .title {
  margin-top: 8px;
}

.result-page .subtitle {
  margin-top: 8px;
}

.udid-card {
  margin-top: 18px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 16px;
  width: 100%;
  box-sizing: border-box;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.udid-value {
  width: 100%;
  margin: 0;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(12px, 3.6vw, 15px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -webkit-user-select: all;
  user-select: all;
}

.udid-value::-webkit-scrollbar {
  display: none;
}

.result-page .cta {
  margin-top: 12px;
  width: 100%;
}

.result-info {
  margin-top: 14px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  width: 100%;
  box-sizing: border-box;
}

.result-info .chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #5eb0ff, #007aff);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  -webkit-justify-content: center;
  align-items: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  -webkit-align-self: center;
  align-self: center;
  margin-top: 0;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.28);
}

.result-info p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.result-error {
  margin: 12px auto 0;
  max-width: 34ch;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb-a,
  .bg-orb-b,
  .bg-orb-c,
  .glass-top-left,
  .glass-top-right,
  .wave-1,
  .wave-2,
  .wave-3,
  .wave-4,
  .home-head,
  .cta-block,
  .section-title,
  .step,
  .safety {
    animation: none !important;
  }

  .cta,
  .copy-icon-btn {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass-card,
  .safety {
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-height: 740px) {
  .brand-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }

  .title {
    font-size: 26px;
  }

  .cta {
    min-height: 50px;
    font-size: 16px;
  }

  .section-title {
    font-size: 18px;
  }
}

@media (min-width: 480px) {
  body {
    overflow: auto;
  }

  .page {
    max-width: 390px;
  }
}
