/* RBX Delivery — Scenic Split Layout + Minimal Obsidian Redemption Sheet */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/jakarta-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/jakarta-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/assets/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/assets/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fira-code-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fira-code-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --night: #0E1329;
  --surface: rgba(11, 14, 24, 0.90);
  --surface-subtle: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --input-bg: rgba(7, 9, 17, 0.85);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.17);
  --divider: rgba(255, 255, 255, 0.075);

  --fg: #F4F7FC;
  --fg-2: #CBD5E4;
  --muted: #8A97AF;

  --blue: #3B82F6;
  --blue-hover: #2563EB;
  --blue-light: #60A5FA;
  --green: #34D399;
  --red: #F87171;
  --red-soft: rgba(239, 68, 68, 0.12);

  --font-display: "Nunito", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Fira Code", Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--night);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Animated Roblox Scenic World ──────────────────────────────────────────── */
.world {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #202f77;
}
.world::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 16, 44, 0.62), rgba(16, 23, 72, 0.20) 48%, transparent 70%, rgba(11, 16, 38, 0.30)),
    linear-gradient(90deg, rgba(12, 16, 53, 0.16) 10%, transparent 48%, rgba(8, 12, 30, 0.36));
}
.landscape {
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: max(100vw, min(177.68svh, 120vw));
  aspect-ratio: 1672 / 941;
  container-type: size;
  background: url("assets/roblox-uzak-plan.webp") center / 100% 100% no-repeat;
}
.scene-drone {
  display: block;
  position: absolute;
  left: 10%;
  top: 12%;
  width: 7%;
  height: auto;
  filter: drop-shadow(0 0 8px rgba(89, 220, 255, 0.38));
  animation: scene-flight 24s linear infinite;
}
.scene-pet {
  position: absolute;
  bottom: 11.5%;
  width: 9.7%;
  height: auto;
}
.scene-pet img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center bottom;
  animation: scene-hop 6.8s ease-in-out infinite;
}
.scene-pet::before {
  content: "";
  position: absolute;
  left: 11%;
  right: 11%;
  bottom: 1%;
  height: 11%;
  background: radial-gradient(ellipse, rgba(2, 25, 53, 0.59), transparent 69%);
  animation: scene-shadow 6.8s ease-in-out infinite;
}
.scene-cat { left: 7.2%; z-index: 1; }
.scene-dog { left: 15.7%; bottom: 15.8%; width: 9.1%; }
.scene-dog img,
.scene-dog::before { animation-delay: -2.9s; }

.scene-spark {
  position: absolute;
  width: 1.8%;
  aspect-ratio: 1;
  background: radial-gradient(circle, #edfeff 9%, #91f8ff 55%, transparent 69%);
  clip-path: polygon(50% 0, 58% 40%, 100% 50%, 58% 59%, 50% 100%, 41% 59%, 0 50%, 41% 40%);
  animation: scene-glimmer 4.6s ease-in-out infinite;
}
.spark-one { left: 29.6%; top: 79.5%; animation-delay: -0.8s; }
.spark-two { left: 34.7%; top: 83%; width: 1.25%; animation-delay: -2.8s; }
.spark-three { left: 31.7%; top: 82%; width: 1.1%; animation-delay: -3.7s; }

.scene-ball {
  position: absolute;
  left: 87.5%;
  top: 76.6%;
  width: 2.1%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #fff1b4;
  background: radial-gradient(circle at 34% 28%, #fffad1 2%, #ff9a53 23%, #ff492c 52%, #a81549 100%);
  box-shadow: 0 0 1.3cqw rgba(255, 83, 56, 0.79);
  animation: scene-ball 5.5s ease-in-out infinite;
}
.scene-ball::after {
  content: "";
  position: absolute;
  right: 45%;
  top: 32%;
  width: 110%;
  height: 42%;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(255, 115, 79, 0.79));
  border-radius: 60% 20% 20% 60%;
}
.world.is-paused :is(.scene-drone, .scene-pet img, .scene-pet::before, .scene-spark, .scene-ball) {
  animation-play-state: paused;
}

@keyframes scene-flight {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  22% { transform: translate(22cqw, -2cqh) rotate(5deg); }
  46% { transform: translate(45cqw, 3cqh) rotate(4deg); }
  61% { transform: translate(55cqw, 0) rotate(-4deg); }
  84% { transform: translate(18cqw, 5cqh) rotate(-8deg); }
}
@keyframes scene-hop {
  0%, 68%, 85%, 100% { transform: translateY(0); }
  70% { transform: scaleX(1.04) scaleY(0.93); }
  76% { transform: translateY(-3cqh) rotate(-3deg); }
  83% { transform: translateY(0) scaleY(0.94); }
}
@keyframes scene-shadow {
  0%, 68%, 85%, 100% { transform: scale(1); opacity: 1; }
  76% { transform: scale(0.78); opacity: 0.52; }
}
@keyframes scene-glimmer {
  0%, 48%, 100% { opacity: 0.18; transform: scale(0.68); }
  60% { opacity: 0.96; transform: scale(1); }
  72% { opacity: 0.25; transform: scale(0.75); }
}
@keyframes scene-ball {
  0%, 100% { transform: translate(-2cqw, 0) rotate(5deg); }
  36% { transform: translate(2.7cqw, -1.4cqh) rotate(9deg); }
  55% { transform: translate(2cqw, -2.3cqh) rotate(-10deg); }
  79% { transform: translate(-2.3cqw, -1cqh) rotate(-5deg); }
}

/* ── Centered Full-Height Split Frame ──────────────────────────────────────── */
.frame {
  width: min(100% - 96px, 1220px);
  margin-inline: auto;
}

.layout {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 436px);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  padding-block: 40px;
}

/* ── Left Hero Typography ──────────────────────────────────────────────────── */
.intro {
  padding-inline-start: clamp(0px, calc(16vw - 160px), 56px);
  padding-bottom: 144px;
  font-family: var(--font-display);
  text-shadow: 0 4px 24px rgba(9, 14, 50, 0.65);
}
.intro h1 {
  font-size: clamp(3.3rem, 5.7vw, 5.3rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
  font-weight: 900;
  margin: 0;
}
.intro h1 span {
  color: #99efff;
  white-space: nowrap;
}
.intro-copy {
  font-size: clamp(0.96rem, 1.3vw, 1.08rem);
  font-weight: 700;
  line-height: 1.5;
  margin: 18px 0 0;
  max-width: 34ch;
  color: #e4ecff;
}

/* ── Right Redemption Card (Clean Obsidian, Zero Slop) ─────────────────────── */
.card {
  position: relative;
  min-width: 0;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 64px rgba(4, 7, 20, 0.62);
}

.view {
  padding: 26px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 180ms var(--ease) both;
}

.view-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.view-head h2:focus,
.amount-hero:focus,
.state-label:focus { outline: none; }

.view-sub {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}

.rule {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--divider);
}

/* Quiet Top Meta Row (Step 2 & Step 3) */
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
}
.meta-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-back {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 140ms var(--ease);
}
.nav-back:hover:not(:disabled) { color: var(--fg); }
.nav-back:disabled { opacity: 0.45; cursor: wait; }

.hero-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.amount-hero {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--fg);
}

/* Forms & Inputs */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--fg-2); }

.input-group {
  display: flex;
  align-items: center;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.input-group:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}
.input-group:has(input[aria-invalid="true"]) {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}
.input-group input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 13px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 13.5px;
  outline: none;
}
.input-group input::placeholder { color: var(--muted); opacity: 0.7; }
.input-group input:read-only { color: var(--muted); }

.input-prefix {
  padding-left: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}
.input-group.has-prefix input { padding-left: 6px; }

.inline-btn {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 140ms var(--ease);
}
.inline-btn:hover { color: var(--fg); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-primary {
  background: var(--blue);
  color: #FFFFFF;
}
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
.btn-primary:disabled::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-ghost {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--fg-2);
  min-height: 42px;
  font-size: 13px;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--fg);
}

.text-action {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 140ms var(--ease);
}
.text-action:hover:not(:disabled) { color: var(--fg); }

.alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
}

/* Recipient Profile Row (Step 2 & Step 3) */
.profile-row,
.recipient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.profile-row {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}
.recipient-row {
  padding-top: 2px;
}
.profile-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  object-fit: cover;
  flex-shrink: 0;
}
.profile-meta { min-width: 0; }
.profile-meta strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-meta span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Live Tracking View (Minimal Typographic State + Single 2px Hairline) ──── */
.live-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-light);
  flex-shrink: 0;
  animation: pulseDot 1.6s ease-in-out infinite;
}
.state-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  line-height: 1.2;
}
.card[data-tone="delivered"] .state-dot {
  background: var(--green);
  animation: none;
}
.card[data-tone="delivered"] .state-label { color: var(--green); }
.card[data-tone="failed"] .state-dot {
  background: var(--red);
  animation: none;
}
.card[data-tone="failed"] .state-label { color: var(--red); }

.code-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 140ms var(--ease);
}
.code-link:hover { color: var(--fg); }

.progress-rail {
  position: relative;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  width: 24%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 420ms var(--ease), background-color 260ms var(--ease);
}
.card[data-tone="queued"] .progress-fill { width: 22%; }
.card[data-tone="preparing"] .progress-fill { width: 54%; }
.card[data-tone="sending"] .progress-fill { width: 82%; }
.card[data-tone="delivered"] .progress-fill {
  width: 100%;
  background: var(--green);
}
.card[data-tone="failed"] .progress-fill {
  width: 100%;
  background: var(--red);
}

.time-stamp {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .frame { width: calc(100% - 48px); }
  .layout { gap: 32px; }
  .intro { padding-inline-start: 0; padding-bottom: 48px; }
  .intro h1 { font-size: clamp(2.9rem, 6.4vw, 4.4rem); }
}

@media (max-width: 760px) {
  .world { background: linear-gradient(#1c296b 0, #0e1329 420px); }
  .landscape { width: auto; height: 340px; left: 0; top: 0; bottom: auto; translate: none; }
  .world::after {
    background: linear-gradient(180deg, rgba(14, 21, 49, 0.36) 0%, rgba(16, 19, 41, 0.10) 190px, transparent 252px, #0e1329 362px);
  }
  .scene-drone { animation-name: scene-flight-mobile; }
  .frame { width: calc(100% - 32px); }
  .layout {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding-block: 44px 36px;
  }
  .intro { padding: 0 0 40px; }
  .intro h1 { font-size: clamp(2.3rem, 8vw, 3.4rem); line-height: 1.02; letter-spacing: -0.05em; }
  .intro h1 span { white-space: normal; }
  .intro-copy { font-size: 0.93rem; margin-top: 10px; max-width: 34ch; }
  .card { width: 100%; max-width: 460px; margin-inline: auto; }
  .view { padding: 22px 20px 20px; }
  .input-group input { font-size: 16px; }
}

@keyframes scene-flight-mobile {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  40% { transform: translate(28cqw, 6cqh) rotate(6deg); }
  62% { transform: translate(31cqw, 2cqh) rotate(-3deg); }
  85% { transform: translate(8cqw, 2cqh) rotate(-7deg); }
}

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