/* Pragmatic Tech games — senior-friendly shared styles.
   Base 20px, 48px touch targets, 7:1 contrast, reduced-motion safe. */
:root {
  --bg: #ffffff;
  --surface: #f5f3ee;
  --border: #c5bda9;
  --accent: #5a7a5e;
  --accent-hover: #4a6a4e;
  --text: #2a2a2a;
  --muted: #555;
  --ok: #2d5a30;
  --bad: #b33a3a;
  --mark: #ffeb3b;
  --font-size: 20px;
}

html[data-size="xlarge"] {
  --font-size: 24px;
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--font-size);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.psa-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.25rem;
}

h1 {
  font-size: 1.8rem;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

h2 {
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

p {
  margin: 0 0 1rem;
}

.psa-progress {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.psa-bar {
  height: 10px;
  background: #e0ddd5;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.psa-bar > div {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s ease;
}

.email {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1rem 0;
}

.email-from {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
  word-break: break-all;
}

.email-subject {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.email-body {
  font-size: 1rem;
  white-space: pre-wrap;
}

mark {
  background: var(--mark);
  color: #000;
  padding: 0 0.1em;
  border-radius: 2px;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

button {
  font-family: inherit;
  font-size: 1rem;
}

.psa-btn {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s;
}

.psa-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.psa-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.psa-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.psa-btn-primary {
  background: var(--accent);
}

#feedback {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
}

#feedback[hidden] {
  display: none;
}

.verdict {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 1.05rem;
}

.verdict.ok {
  color: var(--ok);
}

.verdict.bad {
  color: var(--bad);
}

.flags {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

.flags li {
  margin-bottom: 0.35rem;
}

.explain {
  margin: 0;
  font-size: 0.95rem;
}

.score-line {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

#summary h2 {
  margin-top: 0;
}

.psa-cta {
  display: inline-block;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  margin: 1rem 0 0;
  text-align: center;
}

.psa-cta:hover {
  background: var(--accent-hover);
}

.psa-link {
  color: var(--accent);
  text-decoration: underline;
}

.psa-link:hover {
  color: var(--accent-hover);
}

@media print {
  .psa-card {
    border: none;
    box-shadow: none;
    background: white;
  }
  .psa-btn,
  .psa-cta {
    display: none;
  }
  body {
    font-size: 16px;
    color: #000;
    background: white;
  }
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8rem;
    color: #666;
  }
  .larger-text-toggle {
    display: none;
  }
}

.larger-text-toggle {
  margin-bottom: 1rem;
  text-align: right;
}

.larger-text-toggle button {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  background: #e0ddd5;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.larger-text-toggle button:hover {
  background: #d6cfbe;
}

ul.steps, ol.steps {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

ul.steps li, ol.steps li {
  margin-bottom: 0.4rem;
}

.likely {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.q {
  margin-top: 0;
}

@media (max-width: 600px) {
  .psa-card {
    padding: 1rem 0.75rem;
  }
  .psa-btn {
    width: 100%;
  }
}