/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green-900: #1a3a2a;
  --green-800: #2d5a3f;
  --green-700: #3d6b4f;
  --green-600: #4a7c59;
  --green-500: #5a9a6b;
  --green-400: #7ab88a;
  --green-300: #a8d4b5;
  --green-200: #d4ecd9;
  --green-100: #e8f5e9;
  --green-50: #f4fbf5;
  --amber-500: #d4a017;
  --amber-100: #fef3cd;
  --red-600: #c0392b;
  --red-100: #f8d7da;
  --orange-500: #e67e22;
  --orange-100: #fdebd0;
  --blue-600: #2980b9;
  --blue-100: #d6eaf8;
  --gray-900: #1a1a1a;
  --gray-700: #444;
  --gray-500: #666;
  --gray-300: #ccc;
  --gray-200: #e0e0e0;
  --gray-100: #f5f5f5;
  --white: #fff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--green-50);
  line-height: 1.6;
  font-size: 16px;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Header */
.site-header {
  background: var(--green-800);
  color: var(--white);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo:hover { text-decoration: none; color: var(--green-200); }
.main-nav { display: flex; gap: 20px; }
.main-nav a {
  color: var(--green-200);
  font-size: 0.95rem;
  padding: 4px 0;
}
.main-nav a:hover { color: var(--white); text-decoration: none; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green-800) 0%, var(--green-600) 100%);
  color: var(--white);
  padding: 60px 0 70px;
  text-align: center;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--green-200);
  max-width: 560px;
  margin: 0 auto 28px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  gap: 8px;
}
.btn-primary {
  background: var(--amber-500);
  color: var(--gray-900);
  border-color: var(--amber-500);
}
.btn-primary:hover { background: #c4930f; border-color: #c4930f; text-decoration: none; color: var(--gray-900); }
.btn-secondary {
  background: var(--white);
  color: var(--green-800);
  border-color: var(--green-600);
}
.btn-secondary:hover { background: var(--green-100); text-decoration: none; }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  border-color: transparent;
  padding: 12px 16px;
}
.btn-ghost:hover { color: var(--gray-700); text-decoration: underline; }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }

/* Identify Section */
.identify-section { padding: 48px 0; }
.identify-section h2 {
  font-size: 1.8rem;
  margin-bottom: 24px;
  color: var(--green-800);
}

/* Quiz */
.quiz-container {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--green-600);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 20%;
}
.progress-text {
  font-size: 0.85rem;
  color: var(--gray-500);
  white-space: nowrap;
}
.quiz-step h3 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: var(--gray-900);
}
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--white);
  text-align: center;
}
.option-card:hover {
  border-color: var(--green-500);
  background: var(--green-50);
}
.option-card:focus {
  outline: 3px solid var(--green-400);
  outline-offset: 2px;
}
.option-icon {
  font-size: 2rem;
  line-height: 1;
}
.option-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* Quiz Result */
.quiz-result {
  padding: 24px 0;
}
.result-card {
  border-radius: var(--radius);
  padding: 28px;
  border: 2px solid var(--gray-200);
}
.result-card.edible { border-color: var(--green-500); background: var(--green-50); }
.result-card.toxic { border-color: var(--red-600); background: var(--red-100); }
.result-card.invasive { border-color: var(--orange-500); background: var(--orange-100); }
.result-card.medicinal { border-color: var(--blue-600); background: var(--blue-100); }
.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.result-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.result-badge.edible { background: var(--green-600); color: var(--white); }
.result-badge.toxic { background: var(--red-600); color: var(--white); }
.result-badge.invasive { background: var(--orange-500); color: var(--white); }
.result-badge.medicinal { background: var(--blue-600); color: var(--white); }
.result-name { font-size: 1.5rem; font-weight: 700; }
.result-scientific { font-style: italic; color: var(--gray-500); font-size: 0.95rem; margin-bottom: 12px; }
.result-notes { margin-bottom: 16px; }
.result-notes p { margin-bottom: 8px; }
.result-details { margin-top: 16px; }
.result-details h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; color: var(--gray-700); }
.result-details ul { padding-left: 20px; }
.result-details li { margin-bottom: 4px; font-size: 0.95rem; }
.result-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.quiz-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}
.hidden { display: none !important; }

/* Reference Section */
.reference-section { padding: 48px 0; background: var(--white); }
.reference-section h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--green-800);
}
.section-intro { color: var(--gray-500); margin-bottom: 28px; }
.reference-grid { display: flex; flex-direction: column; gap: 8px; }
.ref-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ref-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  background: var(--white);
  transition: background 0.15s;
}
.ref-summary:hover { background: var(--green-50); }
.ref-summary:focus { outline: 3px solid var(--green-400); outline-offset: -3px; }
.ref-icon { font-size: 1.5rem; }
.ref-name { font-weight: 600; flex: 1; }
.ref-badges { display: flex; gap: 6px; }
.ref-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.ref-badge.edible { background: var(--green-200); color: var(--green-800); }
.ref-badge.toxic { background: var(--red-100); color: var(--red-600); }
.ref-badge.invasive { background: var(--orange-100); color: var(--orange-500); }
.ref-badge.medicinal { background: var(--blue-100); color: var(--blue-600); }
.ref-toggle { font-size: 1.2rem; color: var(--gray-300); transition: transform 0.2s; }
.ref-card.open .ref-toggle { transform: rotate(180deg); }
.ref-details {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  background: var(--gray-100);
}
.ref-card.open .ref-details {
  padding: 16px 20px;
  max-height: 500px;
}
.ref-details p { margin-bottom: 8px; font-size: 0.95rem; }
.ref-details h4 { font-size: 0.9rem; font-weight: 600; margin: 12px 0 6px; }
.ref-details ul { padding-left: 20px; }
.ref-details li { font-size: 0.9rem; margin-bottom: 3px; }

/* About Section */
.about-section { padding: 48px 0; }
.about-section h2 {
  font-size: 1.8rem;
  margin-bottom: 28px;
  color: var(--green-800);
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.about-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.about-icon { font-size: 2.5rem; margin-bottom: 12px; }
.about-card h3 { font-size: 1.15rem; margin-bottom: 8px; color: var(--green-800); }
.about-card p { color: var(--gray-500); font-size: 0.95rem; }

.info-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.info-block h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--green-800);
}
.info-block p { margin-bottom: 10px; color: var(--gray-700); }
.info-block ul { padding-left: 20px; }
.info-block li { margin-bottom: 6px; color: var(--gray-700); }

/* Footer */
.site-footer {
  background: var(--green-900);
  color: var(--green-300);
  padding: 32px 0;
  text-align: center;
  font-size: 0.9rem;
}
.site-footer p { margin-bottom: 6px; }
.site-footer a { color: var(--green-400); }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 1rem; }
  .hero { padding: 40px 0 50px; }
  .quiz-container { padding: 20px; }
  .option-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .option-card { padding: 16px 12px; }
  .about-grid { grid-template-columns: 1fr; }
  .site-header .container { flex-direction: column; gap: 8px; }
  .logo span { font-size: 1rem; }
}
@media (max-width: 480px) {
  .option-grid { grid-template-columns: 1fr 1fr; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
}

/* Print */
@media print {
  .site-header, .site-footer, .quiz-actions, .hero { display: none; }
  .quiz-container { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}

/* Focus visible */
*:focus-visible {
  outline: 3px solid var(--green-500);
  outline-offset: 2px;
}



/* 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;
}
