@font-face {
  font-family: ProductSans;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/ProductSansRegular.ttf") format("truetype");
}

@font-face {
  font-family: ProductSans;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/ProductSansBold.ttf") format("truetype");
}

@font-face {
  font-family: ProductSans;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/ProductSansBold.ttf") format("truetype");
}

:root {
  --bg: #1c2128;
  --header-bg: #1c242c;
  --text: #ffffff;
  --muted: #8794a1;
  --muted-strong: #ffffff;
  --link: #4db2ff;
  --button: #3390ec;
  --button-pressed: #2b7cd1;
  --legal: #7d8b9a;
  --input-bg: #2a3139;
  --input-border: #3d4654;
  --input-focus: #3390ec;
  --cancel-bg: #3d4654;
  --cancel-pressed: #343c48;
  --font-brand: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-app: ProductSans, -apple-system, system-ui, sans-serif;
  --header-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tg-viewport-height: 100dvh;
}

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

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-app);
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: var(--tg-viewport-height);
  overflow: hidden;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:active {
  opacity: 0.82;
}

.app {
  width: min(100%, 430px);
  height: var(--tg-viewport-height);
  margin: 0 auto;
  padding-top: var(--safe-top);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.header {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 14px 0 12px;
  display: flex;
  align-items: center;
  background: var(--header-bg);
  isolation: isolate;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.logo-wrap {
  position: relative;
  width: 26px;
  height: 21px;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-poster,
.logo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.logo-video {
  opacity: 0;
  mix-blend-mode: screen;
}

.brand:hover .logo-poster,
.brand.is-spinning .logo-poster {
  opacity: 0;
}

.brand:hover .logo-video,
.brand.is-spinning .logo-video {
  opacity: 1;
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  color: #fff;
}

.main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.hero {
  flex: 0 1 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(42vh, 320px);
  min-height: 180px;
  margin-top: 8px;
  overflow: hidden;
  background-image: url("../assets/hero.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
}

.copy {
  flex: 0 0 auto;
  padding: 12px 28px 0;
  text-align: center;
}

.copy h1 {
  font-family: var(--font-app);
  font-size: clamp(26px, 7vw, 30px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--text);
  margin: 0 auto 16px;
  max-width: 100%;
}

.lead {
  font-family: var(--font-app);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
  max-width: 22.5em;
  margin: 0 auto;
}

.lead strong {
  color: var(--muted-strong);
  font-weight: 700;
}

.hint {
  font-family: var(--font-app);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 18px;
}

.footer {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 24px calc(16px + var(--safe-bottom));
  text-align: center;
}

.verify-btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: #fff;
  font-family: var(--font-app);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.verify-btn:active {
  transform: scale(0.985);
  background: var(--button-pressed);
}

.verify-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.legal {
  margin-top: 16px;
  font-family: var(--font-app);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--legal);
}

.legal a {
  color: var(--legal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-height: 720px) {
  .hero {
    min-height: 140px;
    max-height: 32vh;
    margin-top: 4px;
    background-size: contain;
  }

  .copy {
    padding-top: 2px;
  }

  .copy h1 {
    font-size: 24px;
    margin-bottom: 12px;
  }

  .hint {
    margin-bottom: 14px;
  }

  .footer {
    padding-top: 16px;
  }
}

/* ── Seed phrase page ── */

.seed-app {
  overflow: hidden;
}

.seed-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0 16px;
}

.seed-intro {
  flex: 0 0 auto;
  text-align: center;
  padding: 8px 8px 16px;
}

.seed-intro h1 {
  font-size: clamp(22px, 5.5vw, 26px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 12px;
}

.seed-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 22em;
  margin: 0 auto;
}

.seed-desc strong {
  color: var(--muted-strong);
  font-weight: 700;
}

.seed-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  display: flex;
  justify-content: center;
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  width: min(100%, 308px);
  margin: 0 auto;
}

.seed-field {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 20px;
  padding: 0 10px 0 8px;
  min-height: 38px;
  transition: border-color 0.15s ease;
}

.seed-field:focus-within {
  border-color: var(--input-focus);
}

.seed-field__num {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  min-width: 20px;
  text-align: right;
  user-select: none;
}

.seed-field__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-app);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  padding: 9px 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.seed-field__input::placeholder {
  color: transparent;
}

.seed-footer {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(16px + var(--safe-bottom));
}

.seed-btn {
  flex: 1 1 0;
  height: 50px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-app);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.seed-btn:active {
  transform: scale(0.985);
}

.seed-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.seed-btn--cancel {
  background: var(--cancel-bg);
  color: var(--text);
}

.seed-btn--cancel:active {
  background: var(--cancel-pressed);
}

.seed-btn--continue {
  background: var(--button);
  color: #fff;
}

.seed-btn--continue:active {
  background: var(--button-pressed);
}

@media (max-height: 720px) {
  .seed-intro {
    padding-top: 4px;
    padding-bottom: 10px;
  }

  .seed-intro h1 {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .seed-desc {
    font-size: 14px;
  }

  .seed-grid {
    width: min(100%, 292px);
    gap: 8px 10px;
  }

  .seed-field {
    min-height: 34px;
    border-radius: 18px;
    padding: 0 8px 0 6px;
  }

  .seed-field__num {
    min-width: 20px;
    font-size: 11px;
  }

  .seed-field__input {
    font-size: 12px;
    padding: 7px 0;
  }

  .seed-footer {
    padding-top: 8px;
  }
}

/* ── Success page ── */

.success-app {
  overflow: hidden;
}

.success-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 32px 28px calc(24px + var(--safe-bottom));
  text-align: center;
}

.success-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
  border-radius: 50%;
  background: rgba(51, 144, 236, 0.16);
  color: var(--button);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-icon svg {
  width: 36px;
  height: 36px;
}

.success-main h1 {
  font-family: var(--font-app);
  font-size: clamp(24px, 6vw, 28px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 14px;
}

.success-desc {
  font-family: var(--font-app);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
  max-width: 22em;
  margin: 0;
}

.success-desc strong {
  color: var(--muted-strong);
  font-weight: 700;
}
