:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: #000;
  color: #f7f7f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #000;
}

body { min-height: 100svh; }
button { font: inherit; }

.welcome-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top, 0px)) 20px calc(22px + var(--safe-bottom));
  overflow: hidden;
  background: #000;
}

.welcome-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

.welcome-copy {
  width: 100%;
  margin-top: clamp(70px, 14vh, 120px);
  text-align: center;
}

.welcome-copy h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(48px, 12vw, 68px);
  line-height: 1.08;
  font-weight: 430;
  letter-spacing: -.065em;
}

.welcome-copy p {
  margin: 34px 0 0;
  color: #e5e5e7;
  font-size: clamp(17px, 4.7vw, 23px);
  font-weight: 400;
  letter-spacing: -.025em;
}

.coin-stage {
  position: relative;
  display: grid;
  width: min(68vw, 350px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  place-items: center;
  margin-top: clamp(54px, 10vh, 88px);
  perspective: 680px;
}

.coin-stage::before {
  position: absolute;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 67, 255, .24), transparent 68%);
  content: "";
  filter: blur(24px);
}

.coin {
  position: absolute;
  width: 88%;
  height: 88%;
  transform-style: preserve-3d;
  animation: coin-spin 8s linear infinite;
}

.coin-side-stack {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.coin-side {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    #11164f 0deg 38deg,
    #1b36a0 45deg,
    #1269d5 58deg,
    #38d9ff 68deg,
    #a7f6e8 75deg,
    #fff46a 80deg,
    #ffb38e 85deg,
    #ff6bbb 90deg,
    #ffa89f 95deg,
    #ffe85b 101deg,
    #42e7ff 109deg,
    #2678ee 120deg,
    #29217e 132deg,
    #100f42 180deg,
    #080d36 245deg,
    #11164f 360deg
  );
}

.coin-side:nth-child(1)  { transform: translateZ(-12px); }
.coin-side:nth-child(2)  { transform: translateZ(-10.5px); }
.coin-side:nth-child(3)  { transform: translateZ(-9px); }
.coin-side:nth-child(4)  { transform: translateZ(-7.5px); }
.coin-side:nth-child(5)  { transform: translateZ(-6px); }
.coin-side:nth-child(6)  { transform: translateZ(-4.5px); }
.coin-side:nth-child(7)  { transform: translateZ(-3px); }
.coin-side:nth-child(8)  { transform: translateZ(-1.5px); }
.coin-side:nth-child(9)  { transform: translateZ(-.75px); }
.coin-side:nth-child(10) { transform: translateZ(0); }
.coin-side:nth-child(11) { transform: translateZ(.75px); }
.coin-side:nth-child(12) { transform: translateZ(1.5px); }
.coin-side:nth-child(13) { transform: translateZ(3px); }
.coin-side:nth-child(14) { transform: translateZ(4.5px); }
.coin-side:nth-child(15) { transform: translateZ(6px); }
.coin-side:nth-child(16) { transform: translateZ(7.5px); }
.coin-side:nth-child(17) { transform: translateZ(9px); }
.coin-side:nth-child(18) { transform: translateZ(10.5px); }
.coin-side:nth-child(19) { transform: translateZ(12px); }

.coin-face {
  position: absolute;
  inset: 5%;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 76% 38%, rgba(27, 143, 255, .86), transparent 42%),
    radial-gradient(ellipse at 29% 69%, #061343 0%, #062577 49%, transparent 78%),
    radial-gradient(circle at 53% 47%, #075bea 0%, #0348d9 64%, #061342 100%);
  box-shadow:
    inset -12px -9px 23px rgba(0, 0, 0, .58),
    inset 8px 6px 19px rgba(42, 130, 255, .3),
    0 0 0 1px rgba(95, 191, 255, .3);
  backface-visibility: hidden;
}

.coin-face--front {
  transform: translateZ(13.5px);
}

.coin-face--back {
  background:
    radial-gradient(ellipse at 72% 35%, rgba(28, 131, 255, .72), transparent 43%),
    radial-gradient(circle at 48% 52%, #034bd7 0%, #05215e 72%, #030a25 100%);
  transform: rotateY(180deg) translateZ(13.5px);
}

.coin-face::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.006) 0, rgba(255,255,255,.006) 1px, transparent 1px, transparent 4px),
    linear-gradient(112deg, rgba(0, 0, 0, .25), transparent 54%, rgba(43, 151, 255, .12));
  content: "";
}

.coin-face--front::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 99% 48%, rgba(255, 255, 255, .98) 0, rgba(145, 244, 255, .8) 2%, rgba(15, 165, 255, .35) 6%, transparent 17%),
    radial-gradient(ellipse at 82% 43%, rgba(53, 186, 255, .48), transparent 29%),
    linear-gradient(108deg, transparent 70%, rgba(255, 255, 255, .13) 81%, rgba(147, 239, 255, .24) 84%, transparent 91%);
  content: "";
}

.coin-face--back::before { display: none; }

.welcome-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 30px;
}

.welcome-agreement {
  margin: 0 0 28px;
  color: #929297;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.welcome-agreement strong {
  color: #aaaab0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.welcome-create {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 999px;
  background: #f7f7f8;
  color: #070707;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}

.welcome-create:active { transform: scale(.985); background: #dedee0; }

.welcome-import {
  margin-top: 22px;
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: #f4f4f5;
  font-size: 16px;
  font-weight: 550;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.welcome-import:active { opacity: .7; }

.welcome-notice {
  max-width: 100%;
  margin: 16px 0 0;
  color: #aaaab0;
  font-size: 13px;
  text-align: center;
}

.welcome-notice[hidden] { display: none; }

@keyframes coin-spin {
  from { transform: rotateX(8deg) rotateY(-24deg) rotateZ(-9deg); }
  to { transform: rotateX(8deg) rotateY(336deg) rotateZ(-9deg); }
}

@media (min-width: 700px) {
  .welcome-screen {
    min-height: min(100svh, 960px);
    padding-right: 34px;
    padding-left: 34px;
  }
  .welcome-copy { margin-top: clamp(70px, 12vh, 110px); }
  .coin-stage { width: min(48vw, 350px); margin-top: clamp(45px, 7vh, 72px); }
  .welcome-actions { margin-top: 18px; }
}

@media (max-height: 740px) {
  .welcome-copy { margin-top: 5vh; }
  .welcome-copy p { margin-top: 16px; }
  .coin-stage { width: min(58vw, 210px); margin-top: 3vh; }
  .welcome-actions { margin-top: 4px; }
  .welcome-agreement { margin-bottom: 12px; font-size: 12px; }
  .welcome-create { min-height: 52px; }
  .welcome-import { margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
