:root {
  --brand: #2a64df;
  --brand-dark: #194cb8;
  --brand-soft: #edf3ff;
  --ink: #172033;
  --muted: #667085;
  --line: #dce3ef;
  --danger: #c43242;
  --surface: #ffffff;
  --shadow: 0 24px 60px rgba(34, 69, 140, 0.16);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(42, 100, 223, 0.16), transparent 34%),
    radial-gradient(circle at 88% 85%, rgba(42, 100, 223, 0.1), transparent 32%),
    #f7f9fd;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

a { color: inherit; }

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header,
.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(42, 100, 223, 0.18);
}

.header-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.header-link:hover { color: var(--brand); }

.main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 48px 0 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: center;
  gap: clamp(48px, 8vw, 104px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 3px;
  border-radius: 99px;
  background: var(--brand);
}

h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(46px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 580px;
  margin: 24px 0 32px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
}

.store-link {
  display: inline-block;
  border-radius: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.store-link:hover,
.store-link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(19, 33, 68, 0.2);
  outline: none;
}

.store-link img {
  display: block;
  width: 210px;
  height: auto;
}

.game-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 38% 62% 58% 42% / 48% 38% 62% 52%;
  background: linear-gradient(145deg, #2a64df, #73a0ff);
  box-shadow: var(--shadow);
}

.game-visual::before,
.game-visual::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(255,255,255,0.28);
  border-radius: 28px;
  transform: rotate(10deg);
}

.game-visual::before { inset: 13%; }
.game-visual::after { inset: 23%; transform: rotate(-8deg); }

.game-visual img {
  position: relative;
  z-index: 1;
  width: 34%;
  min-width: 112px;
  border-radius: 26%;
  box-shadow: 0 24px 48px rgba(10, 32, 78, 0.28);
}

.card {
  width: min(100%, 560px);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(220, 227, 239, 0.9);
  border-radius: 28px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  border-radius: 16px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 27px;
  font-weight: 800;
}

.card h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.card-copy {
  margin: 14px 0 28px;
  color: var(--muted);
  line-height: 1.65;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 750;
}

.email-input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.email-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(42, 100, 223, 0.12);
}

.field-error {
  min-height: 20px;
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  margin-top: 12px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 20px rgba(42, 100, 223, 0.22);
}

.primary-button:hover { background: var(--brand-dark); }
.primary-button:disabled { cursor: wait; opacity: 0.65; }

.secondary-button {
  color: var(--ink);
  background: #eef1f6;
}

.privacy-note {
  display: flex;
  gap: 10px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.privacy-note span { color: var(--brand); font-weight: 900; }

.status-message {
  display: none;
  margin-top: 20px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.status-message.success { display: block; color: #14633c; background: #eaf8f0; }
.status-message.error { display: block; color: #9c2534; background: #fff0f2; }

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(17, 27, 49, 0.55);
  backdrop-filter: blur(5px);
}

.dialog-backdrop.open { display: grid; }

.dialog {
  width: min(100%, 420px);
  padding: 28px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(9, 20, 44, 0.3);
}

.dialog h2 { margin: 0 0 10px; font-size: 22px; }
.dialog p { margin: 0; color: var(--muted); line-height: 1.6; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.dialog .primary-button { margin: 0; }

.result-card { text-align: center; }
.result-card .card-icon { margin: 0 auto 24px; }
.result-card .card-copy { margin-bottom: 0; }
.result-card .retry-button { margin-top: 24px; }

.spinner {
  width: 27px;
  height: 27px;
  border: 3px solid rgba(42, 100, 223, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.site-footer {
  padding: 22px 0 30px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 760px) {
  .site-header, .site-footer, .main { width: min(100% - 28px, 560px); }
  .site-header { padding: 18px 0; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { margin-left: auto; margin-right: auto; }
  .game-visual { width: min(80vw, 370px); margin: 0 auto; grid-row: 1; }
  .eyebrow { justify-content: center; }
  .main { padding: 30px 0 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
