:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --ink: #1b1d21;
  --muted: #63676f;
  --line: #d3d8ce;
  --paper: #fffdf7;
  --accent: #ff5a3d;
  --accent-dark: #b33724;
  --blue: #2667ff;
  --green: #2f8f6b;
  --yellow: #ffd166;
  --shadow: 0 18px 48px rgba(35, 30, 23, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  display: grid;
  min-height: 100svh;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 209, 102, 0.7), transparent 28%),
    linear-gradient(135deg, rgba(255, 90, 61, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(47, 143, 107, 0.18), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.app {
  width: 100%;
  max-width: 520px;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: 24px 18px;
}

.intro,
.test,
.result {
  background: rgba(255, 253, 247, 0.93);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.hidden {
  display: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.05;
}

h1 {
  font-size: 48px;
}

h2 {
  font-size: 34px;
}

.lead,
.comment {
  margin: 14px 0 22px;
  color: var(--muted);
  line-height: 1.55;
  word-break: keep-all;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 22px;
}

.mini-stats span {
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.no-script {
  margin: -8px 0 18px;
  padding: 12px;
  border: 1px solid rgba(255, 90, 61, 0.36);
  border-radius: 8px;
  background: rgba(255, 90, 61, 0.1);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  word-break: keep-all;
}

.primary,
.ghost {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  border: 0;
  font-weight: 800;
}

.primary {
  background: var(--ink);
  color: white;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost {
  margin-top: 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.status.sub {
  margin-top: 10px;
}

.prompt {
  margin: 22px 0 14px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.45;
  word-break: keep-all;
}

.progress {
  height: 8px;
  margin: -4px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e2d7;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 120ms ease;
}

textarea {
  width: 100%;
  resize: none;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.45;
  outline: none;
}

textarea:focus {
  border-color: var(--blue);
}

.score {
  margin: 14px 0 0;
  font-size: 22px;
  font-weight: 900;
}

.share-copy {
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  word-break: keep-all;
}

.actions {
  display: grid;
  gap: 0;
  margin-top: 22px;
}

@media (max-width: 360px) {
  .app {
    padding: 16px 12px;
  }

  .intro,
  .test,
  .result {
    padding: 20px;
  }

  h1 {
    font-size: 40px;
  }

  .prompt {
    font-size: 20px;
  }

  .mini-stats {
    grid-template-columns: 1fr;
  }
}
