/* ===== Reset & base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #2c2416;
  background: #fdfaf3;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(210, 180, 140, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(180, 160, 130, 0.06) 0%, transparent 50%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #6b4c2a;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:hover {
  color: #3e2b15;
}

ul, ol {
  list-style-position: inside;
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #2c2416;
  color: #fff;
  padding: 0.5em 1em;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ===== Header ===== */
.site-header {
  background: #fffbf0;
  border-bottom: 2px solid #d4b896;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75em 1.25em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5em;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  color: #2c2416;
  font-weight: 700;
  font-size: 1.125rem;
}

.logo-icon {
  font-size: 1.5rem;
}

.site-nav ul {
  display: flex;
  gap: 1.5em;
  list-style: none;
}

.site-nav a {
  text-decoration: none;
  font-weight: 500;
  color: #5c4328;
}

.site-nav a:hover {
  color: #2c2416;
  text-decoration: underline;
}

/* ===== Container ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5em 1.25em;
}

/* ===== Quiz section ===== */
.quiz-section {
  padding: 2em 0 1em;
}

.quiz-section h1 {
  font-size: 2rem;
  text-align: center;
  color: #3e2b15;
  margin-bottom: 0.25em;
}

.subtitle {
  text-align: center;
  color: #5c4328;
  font-size: 1.1rem;
  margin-bottom: 2em;
}

/* ===== Quiz app ===== */
.quiz-app {
  background: #fffdf7;
  border: 1px solid #d4b896;
  border-radius: 12px;
  padding: 2em 1.5em;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  min-height: 360px;
  position: relative;
}

.quiz-screen {
  display: none;
}

.quiz-screen.is-active {
  display: block;
}

/* Start screen */
.start-illustration {
  text-align: center;
  margin-bottom: 1.5em;
}

.start-description {
  font-size: 1.05rem;
  margin-bottom: 0.75em;
  color: #3e2b15;
}

.start-note {
  font-size: 0.9rem;
  color: #6b5a44;
  margin-bottom: 1.5em;
  font-style: italic;
}

.start-meta {
  text-align: center;
  font-size: 0.85rem;
  color: #8b7a64;
  margin-top: 1em;
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 0.85em 1.5em;
  background: #6b4c2a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #4e3520;
}

.btn-primary:disabled {
  background: #c4b49e;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.65em 1.2em;
  background: #f0e8db;
  color: #3e2b15;
  border: 1px solid #c4b49e;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #e5d9c5;
}

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

.btn-text {
  background: none;
  border: none;
  color: #6b4c2a;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25em 0;
}

.btn-text:hover {
  color: #3e2b15;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5d9c5;
  border-radius: 4px;
  margin-bottom: 1.5em;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #6b4c2a;
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Question */
.question-counter {
  font-size: 0.85rem;
  color: #8b7a64;
  margin-bottom: 0.5em;
}

.question-text {
  font-size: 1.2rem;
  margin-bottom: 1.25em;
  color: #2c2416;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin-bottom: 1.5em;
}

.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85em 1em;
  background: #faf6ef;
  border: 2px solid #d4b896;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
  color: #2c2416;
}

.option-btn:hover {
  background: #f0e8db;
  border-color: #b8976e;
}

.option-btn.is-selected {
  background: #e8d9c0;
  border-color: #6b4c2a;
  font-weight: 600;
}

.question-actions {
  display: flex;
  gap: 1em;
  justify-content: center;
  flex-wrap: wrap;
}

/* Result screen */
.result-card {
  background: #fffbf0;
  border: 2px solid #d4b896;
  border-radius: 12px;
  padding: 2em 1.5em;
  text-align: center;
  margin-bottom: 1.5em;
}

.result-grade {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25em;
}

.result-title {
  font-size: 1.4rem;
  margin-bottom: 0.5em;
  color: #3e2b15;
}

.result-description {
  color: #5c4328;
  margin-bottom: 1em;
}

.result-tips {
  list-style: none;
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

.result-tips li {
  padding: 0.5em 0;
  border-bottom: 1px dotted #d4b896;
  color: #2c2416;
}

.result-tips li::before {
  content: "→ ";
  color: #6b4c2a;
  font-weight: bold;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75em;
  justify-content: center;
  margin-bottom: 2em;
}

/* History */
.history-section {
  border-top: 1px solid #d4b896;
  padding-top: 1.5em;
}

.history-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75em;
  color: #3e2b15;
}

.history-list {
  list-style: none;
  margin-bottom: 0.75em;
}

.history-list li {
  padding: 0.4em 0;
  font-size: 0.9rem;
  color: #5c4328;
  border-bottom: 1px dotted #e5d9c5;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5em;
}

.history-grade {
  font-weight: 700;
  color: #3e2b15;
}

/* ===== Supporting sections ===== */
.supporting-section {
  padding: 2.5em 0;
}

.supporting-section.alt-bg {
  background: #faf6ef;
}

.supporting-section h2 {
  font-size: 1.5rem;
  color: #3e2b15;
  margin-bottom: 0.75em;
}

.supporting-section h3 {
  font-size: 1.15rem;
  color: #4e3520;
  margin-bottom: 0.4em;
}

.supporting-section p {
  margin-bottom: 1em;
  color: #3e2b15;
}

/* Scenario grid */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25em;
  margin-top: 1.5em;
}

.scenario-card {
  background: #fffdf7;
  border: 1px solid #d4b896;
  border-radius: 8px;
  padding: 1.25em;
}

.scenario-score {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b4c2a;
  margin-top: 0.5em;
}

/* Mistakes list */
.mistakes-list {
  list-style-position: outside;
  padding-left: 1.5em;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.mistakes-list li {
  color: #3e2b15;
  line-height: 1.5;
}

.mistakes-list strong {
  color: #2c2416;
}

/* Comparison table */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1em;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.comparison-table th {
  background: #6b4c2a;
  color: #fff;
  padding: 0.65em 0.75em;
  text-align: left;
  font-weight: 600;
}

.comparison-table td {
  padding: 0.65em 0.75em;
  border-bottom: 1px solid #d4b896;
  color: #3e2b15;
}

.comparison-table tr:nth-child(even) td {
  background: #faf6ef;
}

.table-note {
  font-size: 0.85rem;
  color: #6b5a44;
  font-style: italic;
}

/* Troubleshooting */
.troubleshooting-list {
  display: flex;
  flex-direction: column;
  gap: 1.25em;
}

.troubleshooting-list dt {
  font-weight: 700;
  color: #3e2b15;
  margin-bottom: 0.2em;
}

.troubleshooting-list dd {
  margin-left: 0;
  color: #4e3520;
  padding-left: 1em;
  border-left: 3px solid #d4b896;
}

/* ===== Footer ===== */
.site-footer {
  background: #2c2416;
  color: #d4b896;
  padding: 2em 0;
  margin-top: 2em;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  align-items: center;
  text-align: center;
}

.footer-brand {
  font-size: 0.9rem;
}

.footer-brand a {
  color: #e8d5b7;
}

.footer-nav ul {
  display: flex;
  gap: 1.5em;
  list-style: none;
}

.footer-nav a {
  color: #d4b896;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-nav a:hover {
  text-decoration: underline;
  color: #fff;
}

.footer-note {
  font-size: 0.8rem;
  color: #8b7a64;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 1.5em;
  left: 50%;
  transform: translateX(-50%);
  background: #2c2416;
  color: #fff;
  padding: 0.75em 1.5em;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 200;
}

.toast.is-visible {
  opacity: 1;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .quiz-section h1 {
    font-size: 1.5rem;
  }

  .quiz-app {
    padding: 1.25em 1em;
  }

  .result-grade {
    font-size: 3rem;
  }

  .result-actions {
    flex-direction: column;
    align-items: center;
  }

  .result-actions .btn-secondary,
  .result-actions .btn-primary {
    width: 100%;
    max-width: 280px;
  }

  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  .site-nav ul {
    gap: 1em;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .scenario-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media print {
  .site-header,
  .site-footer,
  .result-actions,
  .history-section,
  .btn-primary,
  .btn-secondary,
  .btn-text,
  .skip-link,
  .toast {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .quiz-app {
    box-shadow: none;
    border: none;
  }

  .result-card {
    border: 1px solid #000;
  }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
