:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --brand: #f97316;
  --brand-deep: #9a3412;
  --line: #e5e7eb;
  --good: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, #ffe7d6, transparent 35%),
    radial-gradient(circle at 100% 100%, #dbeafe, transparent 34%),
    var(--bg);
}

.app-shell {
  width: min(780px, 100%);
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.08);
  padding: 22px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

#home-screen {
  text-align: center;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.25;
  margin-bottom: 18px;
}

h2 {
  margin: 16px 0 12px;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.3;
}

h3 {
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.2;
  margin-top: 6px;
}

h4 {
  font-size: 20px;
  margin-bottom: 10px;
}

.author-link {
  color: #1d4ed8;
  text-decoration: underline;
  font-weight: 700;
}

.author-home {
  display: inline-block;
  margin-top: 14px;
  font-size: clamp(22px, 3.3vw, 34px);
  width: 100%;
  text-align: center;
}

.home-copy {
  margin-top: 14px;
  color: var(--text);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
}

.home-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(14px, 1.8vw, 18px);
}

.counter {
  font-weight: 800;
  font-size: 22px;
}

.rule {
  margin-top: 6px;
  color: var(--muted);
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.option-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font: inherit;
  padding: 13px 14px;
  cursor: pointer;
  transition: 0.16s ease;
}

.option-card:hover {
  border-color: #fdba74;
  background: #fff7ed;
}

.option-card.active {
  border-color: var(--brand);
  background: #fff7ed;
  box-shadow: 0 0 0 3px #ffedd5;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(90deg, var(--brand), #fb923c);
  color: #fff;
}

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

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.tease {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 800;
  margin-bottom: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  margin-bottom: 12px;
}

.kicker {
  color: var(--muted);
}

.score {
  margin: 8px 0 10px;
  font-size: 18px;
}

.score strong {
  color: var(--brand-deep);
}

.share-card img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #fed7aa;
}

.result-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: center;
}

.result-hero img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
}

.compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.share-line {
  margin-top: 10px;
  color: var(--brand-deep);
  font-weight: 700;
}

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

@media (max-width: 640px) {
  .app-shell {
    padding: 16px;
    border-radius: 14px;
  }

  .actions {
    flex-direction: column;
  }

  .result-hero {
    grid-template-columns: 1fr;
  }

  .compact {
    flex-direction: column;
    align-items: flex-start;
  }
}
