:root {
  color-scheme: light;
  --bg-start: #eef2f8;
  --bg-end: #dbe3ee;
  --card: rgba(248, 249, 254, .92);
  --ink: #182132;
  --muted: #98a2b3;
  --button-start: #6564f4;
  --button-end: #8b48ee;
  --shadow: rgba(74, 89, 115, .18);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 5% 12%, rgba(255, 255, 255, .95) 0 10%, transparent 28%),
    linear-gradient(145deg, var(--bg-start), var(--bg-end));
  color: var(--ink);
}

button {
  font: inherit;
}

.demo-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 40px);
}

.mnemonic-card {
  width: min(560px, calc(100vw - 28px));
  min-height: min(736px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 5vw, 34px);
  border-radius: 32px;
  background: var(--card);
  box-shadow:
    0 24px 60px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, .75);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 27px;
}

.icon-button,
.help-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #172033;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.help-button {
  font-size: 25px;
  font-weight: 800;
}

.copy-block h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 6vw, 31px);
  line-height: 1.12;
  letter-spacing: 0;
  color: #182132;
  font-weight: 850;
}

.copy-block p {
  margin: 0 0 31px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

.words-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 27px 24px;
  padding: 18px 28px 28px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(60, 78, 110, .08);
}

.word-cell {
  min-height: 54px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.word-cell span {
  min-height: 17px;
  color: #d8dde6;
  text-align: right;
  font-size: 13px;
  line-height: 1;
}

.word-cell strong {
  color: #1f2736;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
  word-break: break-word;
}

.warning-copy {
  margin: 27px 0 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

.cta-button,
.button.primary {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(98deg, var(--button-start), var(--button-end));
  color: #ffffff;
  box-shadow: 0 13px 22px rgba(105, 88, 240, .26);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.cta-button:hover,
.button.primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 16px 28px rgba(105, 88, 240, .32);
}

.cta-button:active,
.button.primary:active {
  transform: translateY(1px);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(24, 33, 50, .42);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.modal.open {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  border-radius: 22px;
  padding: 30px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(48, 60, 84, .26);
  text-align: center;
  color: #182132;
}

.modal-title {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 850;
}

.modal-message {
  min-height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: #1f2736;
  font-size: clamp(22px, 4.8vw, 34px);
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #eef1f7;
  color: #263145;
  cursor: pointer;
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 15px;
  width: 14px;
  height: 2px;
  background: #263145;
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

@media (max-width: 520px) {
  .demo-stage {
    padding: 0;
  }

  .mnemonic-card {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    padding: 30px 24px;
  }

  .copy-block h1 {
    font-size: 30px;
  }

  .words-panel {
    gap: 24px 16px;
    padding: 18px 24px 27px;
  }

  .word-cell strong {
    font-size: 16px;
  }
}
