:root {
  --wine: #7b1630;
  --wine-dark: #5e1025;
  --wine-soft: #f7ebef;
  --text: #222;
  --muted: #666;
  --line: #d8c5cb;
  --bg: #ffffff;
  --page: #f4f1f2;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-shell {
  width: 100%;
  max-width: 960px;
}

.app-header {
  text-align: center;
  margin-bottom: 18px;
}

.app-header h1 {
  margin: 0 0 8px;
  color: var(--wine);
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 800;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.app-card {
  width: 100%;
  min-height: 600px;
  background: var(--bg);
  border: 2px solid var(--wine);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.screen { display: none; }
.screen.active { display: block; }

.center-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.intro-list {
  margin: 16px 0 0;
  padding-left: 22px;
}

.progress-wrap { margin-bottom: 20px; }

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 700;
  color: var(--wine);
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #ece7e9;
  overflow: hidden;
  border: 1px solid #ddd;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--wine), #b5274f);
  transition: width 0.25s ease;
}

.question-container { min-height: 350px; }

.question-block {
  display: grid;
  gap: 14px;
}

.question-title {
  margin: 0;
  color: var(--wine);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.question-help {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.text-input,
.select-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
}

.text-input:focus,
.select-input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(123, 22, 48, 0.12);
}

.options {
  display: grid;
  gap: 12px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #faf8f9;
  cursor: pointer;
}

.option-card.selected {
  border-color: var(--wine);
  background: var(--wine-soft);
}

.option-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--wine);
  flex: 0 0 auto;
}

.option-text { flex: 1; }

.send-row,
.overlay-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.action-btn {
  border: none;
  background: var(--wine);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
}

.action-btn:hover,
.action-btn:focus {
  background: var(--wine-dark);
}

.action-btn.secondary {
  background: #666;
}

.bottom-links {
  margin-top: 20px;
  text-align: right;
}

.bottom-links a,
.back-link {
  color: var(--wine);
  font-weight: 700;
  text-decoration: none;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  display: grid;
  place-items: center;
  padding: 24px;
}

.overlay.hidden { display: none; }

.overlay-card {
  width: min(92vw, 760px);
  background: #fff;
  border: 2px solid var(--wine);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.overlay-card h2 {
  margin-top: 0;
  color: var(--wine);
}

.result-grid {
  display: grid;
  gap: 12px;
}

.result-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fcfbfb;
}

.score-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--wine-soft);
  color: var(--wine);
  font-weight: 800;
  border: 1px solid #e2bdc7;
}

.clovers {
  font-size: 1.6rem;
  line-height: 1.8;
}

.footer-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 18px;
}

.card {
  background: #fff;
  border: 2px solid var(--wine);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
}

@media (max-width: 820px) {
  .page { padding: 12px; }
  .app-card { padding: 18px; min-height: auto; }
  .send-row, .overlay-actions { justify-content: stretch; }
  .action-btn { width: 100%; }
}
