/* Bridge: onboarding screens inside start.html without leaking onto s5+ */

#s-welcome.screen.active,
#s-select.screen.active,
#s-connect.screen.active {
  display: block;
  padding: 0;
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #000;
  animation: none;
}

body.ob-early {
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ob-pad-x: 8px;
  --ob-pad-y: 10px;
  --ob-logo-w: 88px;
  --ob-logo-h: 24px;
}

body.ob-early [data-lang-dropdown],
body:not(.ob-early) [data-lang-dropdown],
[data-lang-dropdown] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

body:not(.ob-early) .ob-lang {
  display: none !important;
}

.fw-lang {
  display: none;
}

body:not(.ob-early) .fw-lang {
  display: block;
  position: fixed;
  top: 20px;
  left: 16px;
  z-index: 10001;
}

body.seed-active .fw-lang {
  display: none !important;
}

.seed-lang {
  margin: 0 0 16px;
  align-self: flex-start;
}

#s-select .page,
#s-connect .page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
  color: #fff;
}

body.ob-early .header {
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "lang logo .";
  align-items: center;
  column-gap: 8px;
  box-sizing: border-box;
  padding: calc(var(--ob-pad-y) + env(safe-area-inset-top, 0px)) var(--ob-pad-x) var(--ob-pad-y);
  width: 100%;
}

body.ob-early .header .ob-lang {
  grid-area: lang;
  justify-self: start;
  align-self: center;
  min-width: 0;
}

body.ob-early .header-logo {
  grid-area: logo;
  display: flex;
  align-items: center;
  justify-content: center;
  position: static;
  transform: none;
  pointer-events: none;
  line-height: 0;
}

body.ob-early .header-logo svg {
  width: var(--ob-logo-w);
  height: var(--ob-logo-h);
  flex-shrink: 0;
}

body.ob-early .btn-lang {
  height: 32px;
  padding: 0 8px;
  box-sizing: border-box;
}

body.ob-early .btn-lang svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#s-welcome .header {
  background: transparent;
  pointer-events: auto;
}

#s-welcome .ll-welcome-overlay {
  height: auto;
  flex: 1;
  min-height: 0;
}

#s-welcome .ll-welcome-top {
  padding: 8px 20px 0;
}

#s-select .title {
  flex-shrink: 0;
  margin: 32px 0 0;
  padding: 0 16px;
  font-family: Alpha, Inter, sans-serif;
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  text-align: center;
  white-space: normal;
}

#s-select .grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
}

#s-select .col {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: #000;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 200ms, border-color 200ms;
}

#s-select .col:first-child { border-left: none; }
#s-select .col:last-child { border-right: none; }
#s-select .col:hover { background: #191919; }
#s-select .col:not(:first-child):hover { border-left-color: #565656; }
#s-select .col:not(:last-child):hover { border-right-color: #565656; }

#s-select .col-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 16px 8px 24px;
}

#s-select .illus {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  width: 100%;
  height: 280px;
}

#s-select .illus img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(200px, 72%);
  max-height: 240px;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

#s-select .label {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 24px;
  padding: 0 4px;
  min-height: 60px;
  height: auto;
  font-size: clamp(16px, 1.6vw, 24px);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

#s-select .select-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  padding: 12px 32px;
  border: none;
  border-radius: 100px;
  background: #fff;
  color: #000;
  font: 600 14px/1 Inter, sans-serif;
  opacity: 0;
  transition: opacity 200ms;
  pointer-events: none;
}

#s-select .col:hover .select-btn {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  #s-select .select-btn {
    opacity: 1;
    pointer-events: auto;
  }
}

#s-connect .page {
  position: relative;
  align-items: stretch;
  justify-content: flex-start;
}

#s-connect .header,
#s-connect .help-footer {
  width: 100%;
  align-self: stretch;
}

#s-connect .connect-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  padding: 16px 20px 32px;
  text-align: center;
  width: 100%;
  max-width: 640px;
}

#s-connect #lottie {
  width: 100%;
  max-width: 420px;
  min-height: 260px;
  margin-bottom: 8px;
}

#s-connect #connect-title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  max-width: 520px;
  margin-top: 24px;
  animation: fadeUp 0.5s ease-out;
}

#s-connect #verify-btn { margin-top: 32px; }

#s-connect .help-footer {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
}

#s-connect .help-footer a {
  color: #949494;
  font-size: 14px;
}

@media (max-width: 900px) {
  #s-connect .page {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  #s-connect .connect-stage {
    padding: 16px 20px 32px;
  }
  #s-connect .help-footer {
    position: relative;
    bottom: auto;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.connection-success-modal__btn--primary {
  cursor: pointer;
  border: 0;
}

@media (max-width: 1280px) {
  body.ob-early:has(#s-select.screen.active) {
    overflow: auto;
  }
  #s-select .page {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  #s-select .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); flex: none; }
  #s-select .col {
    height: auto;
    min-height: 240px;
    border-left: none;
    border-right: none;
    border-top: 1px solid #191919;
  }
  #s-select .col:nth-child(-n+3) { border-top: none; }
  #s-select .col:hover { border-left-color: transparent; border-right-color: transparent; }
  #s-select .illus { height: 220px; }
  #s-select .illus img { max-height: 190px; }
}

@media (max-height: 720px) and (min-width: 1281px) {
  #s-select .title { margin-top: 12px; font-size: 24px; }
  #s-select .illus { height: 200px; }
  #s-select .illus img { max-width: 140px; max-height: 170px; }
  #s-select .label { min-height: 0; margin-top: 12px; font-size: 18px; }
  #s-select .select-btn { margin-top: 12px; }
}

@media (max-width: 900px) {
  body.ob-early:has(#s-select.screen.active) {
    overflow: auto;
  }
  #s-select .page {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  #s-select .title { font-size: clamp(20px, 6vw, 28px); margin-top: 20px; }
  #s-select .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: none;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  #s-select .col:nth-child(-n+3) { border-top: 1px solid #191919; }
  #s-select .col:nth-child(-n+2) { border-top: none; }
  #s-select .col { min-height: 220px; }
  #s-select .illus { height: 200px; }
  #s-select .illus img { max-width: 140px; max-height: 170px; }
  #s-select .label { min-height: 0; margin-top: 16px; font-size: 18px; }
  #s-select .select-btn { opacity: 1; pointer-events: auto; margin-top: 16px; }
}

@media (max-width: 520px) {
  #s-select .grid { grid-template-columns: 1fr; }
  #s-select .col:nth-child(-n+2) { border-top: 1px solid #191919; }
  #s-select .col:first-child { border-top: none; }
  #s-select .col { min-height: 200px; }
}

.hidden { display: none !important; }
.btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 250px;
  padding: 14px 32px;
  border: none;
  border-radius: 100px;
  background: #fff;
  color: #000;
  font: 600 14px/1 Inter, sans-serif;
  cursor: pointer;
}
.btn-main.is-hidden { opacity: 0; pointer-events: none; }
