/* ============================================
   Grow a Garden Calculator - Modern Styles
   ============================================ */

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-elevated: #334155;
  --bg-input: #0f172a;
  --border: #334155;
  --border-light: #475569;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --accent-light: #4ade80;
  --gold: #eab308;
  --rainbow: linear-gradient(90deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #a855f7);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --grad-hero: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #059669 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(at 10% 0%, rgba(34, 197, 94, 0.12) 0, transparent 50%),
    radial-gradient(at 90% 10%, rgba(59, 130, 246, 0.1) 0, transparent 50%),
    radial-gradient(at 50% 100%, rgba(168, 85, 247, 0.08) 0, transparent 50%);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo-emoji { font-size: 1.75rem; }
.logo span.accent { color: var(--accent-light); }
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent-light); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f1f5f9 0%, #4ade80 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 1.5rem;
}
.hero-badges {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.badge {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-light);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* ---------- Calculator Card ---------- */
.calculator-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0 3rem;
}
@media (max-width: 900px) {
  .calculator-wrapper { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h2, .card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}
.input-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
input[type="number"], input[type="text"], select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border 0.2s, box-shadow 0.2s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Growth buttons */
.growth-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.growth-btn {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9rem;
}
.growth-btn:hover { border-color: var(--border-light); }
.growth-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.growth-btn.active[data-growth="Gold"] {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(234, 179, 8, 0.1);
}
.growth-btn.active[data-growth="Rainbow"] {
  border-color: transparent;
  background: var(--rainbow);
  color: white;
  background-size: 300% 100%;
  animation: rainbowShift 3s linear infinite;
}
.growth-btn.active[data-growth="Default"] {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(34, 197, 94, 0.1);
}
@keyframes rainbowShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Mutations Grid */
.mutation-search {
  margin-bottom: 0.75rem;
}
.mutations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}
.mutations-grid::-webkit-scrollbar { width: 8px; }
.mutations-grid::-webkit-scrollbar-track { background: var(--bg-input); }
.mutations-grid::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.mutation-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  text-align: center;
  transition: all 0.15s;
  user-select: none;
  position: relative;
}
.mutation-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.mutation-chip.active {
  background: var(--accent);
  border-color: var(--accent-light);
  color: white;
  font-weight: 600;
}
.mutation-chip .mult { font-size: 0.7rem; opacity: 0.8; display: block; }

/* Result Card */
.result-card {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  position: sticky;
  top: 5rem;
}
.result-value {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--accent-light);
  line-height: 1;
  margin: 0.5rem 0;
  letter-spacing: -0.03em;
  word-break: break-all;
}
.result-value-full {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.result-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.result-meta-item {
  background: rgba(15, 23, 42, 0.5);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
}
.result-meta-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.result-meta-item .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.breakdown { margin-top: 1rem; }
.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0;
  font-weight: 600;
}
.breakdown-list {
  list-style: none;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.breakdown-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.breakdown-list li:last-child {
  border-bottom: none;
  font-weight: 700;
  color: var(--accent-light);
  padding-top: 0.6rem;
  margin-top: 0.4rem;
  border-top: 2px solid var(--border);
}
.mutation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}
.mutation-tag {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--border-light); }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ---------- Content Sections ---------- */
section { padding: 3rem 0; }
section h2.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: -0.02em;
}
section p.section-sub {
  text-align: center;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-box:hover { transform: translateY(-2px); border-color: var(--accent); }
.feature-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.feature-box h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-box p { color: var(--text-secondary); font-size: 0.9rem; }

/* FAQ */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-question {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  user-select: none;
}
.faq-question:hover { background: rgba(255,255,255,0.02); }
.faq-question .chevron { transition: transform 0.2s; font-size: 1.2rem; color: var(--accent-light); }
.faq-item.open .chevron { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.25rem;
  color: var(--text-secondary);
}
.faq-item.open .faq-answer { max-height: 500px; padding: 0 1.25rem 1rem; }

/* Tables */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 0.9rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg-elevated);
  font-weight: 700;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:hover { background: rgba(34, 197, 94, 0.05); }
.rarity-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

/* Filters for tables */
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}
.filters input, .filters select { max-width: 240px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab {
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

/* Guide Prose */
.prose {
  max-width: 800px;
  margin: 0 auto;
}
.prose h3 { margin: 1.5rem 0 0.75rem; font-size: 1.35rem; color: var(--accent-light); }
.prose p { margin-bottom: 1rem; color: var(--text-secondary); }
.prose ul, .prose ol { margin: 0 0 1rem 1.5rem; color: var(--text-secondary); }
.prose li { margin-bottom: 0.4rem; }
.prose code {
  background: var(--bg-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9em;
  color: var(--accent-light);
}
.prose .formula-box {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: var(--radius-sm);
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  overflow-x: auto;
  white-space: nowrap;
}

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: var(--accent-light); }
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Utility */
.text-center { text-align: center; }
.hidden { display: none !important; }
.mt-2 { margin-top: 1rem; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Facts Table (AI Overview block) */
.facts-table {
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.facts-table th, .facts-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.facts-table th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 700;
  width: 35%;
  white-space: nowrap;
}
.facts-table tr:last-child th, .facts-table tr:last-child td { border-bottom: none; }
.facts-table code {
  background: var(--bg-input);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85em;
  color: var(--accent-light);
  word-break: break-word;
}
@media (max-width: 640px) {
  .facts-table th, .facts-table td { padding: 0.5rem 0.7rem; font-size: 0.85rem; }
  .facts-table th { width: 42%; }
}

/* FAQ (details/summary version) */
details.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
details.faq-item summary.faq-question {
  list-style: none;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
details.faq-item summary.faq-question::-webkit-details-marker { display: none; }
details.faq-item summary.faq-question:hover { background: rgba(255,255,255,0.02); }
details.faq-item .chevron { transition: transform 0.2s; color: var(--accent-light); font-size: 1.1rem; }
details[open].faq-item .chevron { transform: rotate(180deg); }
details.faq-item .faq-answer { color: var(--text-secondary); }
details.faq-item .faq-answer code {
  background: var(--bg-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85em;
  color: var(--accent-light);
}

/* TL;DR Block */
.tldr dt { font-weight: 600; }
.tldr dd code {
  background: var(--bg-input);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85em;
  color: var(--accent-light);
}
@media (max-width: 640px) {
  .tldr dl { grid-template-columns: 1fr !important; }
  .tldr dt { margin-top: 0.5rem; }
}

/* Focus visibility (accessibility) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .site-header, .site-footer, .calc-mode-tabs, .btn, .nav-toggle, .hero-visual, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  a { color: #000; text-decoration: underline; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ============== NEW: Hero Visual ============== */
.hero-visual {
  margin: 2rem auto 0;
  max-width: 900px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.hero-visual img { width: 100%; display: block; }

/* ============== Section Hero Images ============== */
.section-visual {
  max-width: 1000px;
  margin: 0 auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.section-visual img { width: 100%; display: block; }

/* ============== Calculator Mode Tabs ============== */
.calc-mode-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 2rem auto 1rem;
  background: var(--bg-card);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  max-width: fit-content;
  flex-wrap: wrap;
  justify-content: center;
}
.calc-mode-tab {
  padding: 0.55rem 1.1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.2s;
  white-space: nowrap;
}
.calc-mode-tab.active {
  background: var(--accent);
  color: white;
}

/* ============== Pet Weight Calculator ============== */
.pet-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
@media (max-width: 900px) { .pet-calc-grid { grid-template-columns: 1fr; } }

.hunger-visual {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
}
.hunger-bar {
  width: 100%;
  height: 20px;
  background: var(--bg-primary);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.hunger-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
  border-radius: 999px;
  transition: width 0.3s;
}
.hunger-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ============== Trading Calculator ============== */
.trade-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 2rem;
}
@media (max-width: 768px) {
  .trade-grid { grid-template-columns: 1fr; }
  .trade-vs { order: 1; text-align: center; margin: 0.5rem 0; }
}
.trade-vs {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-light);
  text-align: center;
  padding-top: 2rem;
}
.trade-side {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.trade-side h3 { margin-bottom: 0.75rem; font-size: 1.1rem; }
.trade-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 300px;
  overflow-y: auto;
}
.trade-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.trade-item-name { font-weight: 600; }
.trade-item-value { color: var(--accent-light); font-weight: 700; font-size: 0.8rem; }
.trade-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.3rem;
}
.trade-total {
  padding: 0.75rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  text-align: center;
}
.trade-total .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.trade-total .value { font-size: 1.5rem; font-weight: 900; color: var(--accent-light); }

.trade-verdict {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 1rem;
}
.trade-verdict.fair { border-color: #22c55e; color: #22c55e; }
.trade-verdict.unfair { border-color: #ef4444; color: #ef4444; }
.trade-verdict.winsA, .trade-verdict.winsB { border-color: #eab308; color: #eab308; }

/* ============== Tier List ============== */
.tier-list { display: flex; flex-direction: column; gap: 0.5rem; }
.tier-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tier-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
}
.tier-label.s-plus { background: linear-gradient(135deg, #ef4444, #ec4899); }
.tier-label.s { background: #f97316; }
.tier-label.a { background: #eab308; }
.tier-label.b { background: #84cc16; }
.tier-label.c { background: #22c55e; }
.tier-label.d { background: #64748b; }

.tier-items {
  padding: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tier-pill {
  background: var(--bg-elevated);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.tier-pill:hover { border-color: var(--accent); color: var(--accent-light); }

/* ============== Codes ============== */
.codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.code-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}
.code-card.active { border-color: rgba(34, 197, 94, 0.4); }
.code-card.expired { opacity: 0.5; }
.code-card:hover { transform: translateY(-2px); }
.code-text {
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-light);
  background: var(--bg-input);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.code-reward { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.25rem; }
.code-expire { color: var(--text-muted); font-size: 0.75rem; }
.code-status {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.code-status.active { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.code-status.expired { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* ============== Weather & Stock Cards ============== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.info-card .icon { font-size: 1.75rem; margin-bottom: 0.4rem; }
.info-card .title { font-weight: 700; margin-bottom: 0.3rem; }
.info-card .detail { color: var(--text-secondary); font-size: 0.85rem; }
.info-card .meta { color: var(--text-muted); font-size: 0.75rem; margin-top: 0.3rem; }

/* ============== TOC (Table of Contents) ============== */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem auto;
  max-width: 700px;
}
.toc h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.toc ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.25rem; }
.toc a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; padding: 0.25rem 0; display: block; }
.toc a:hover { color: var(--accent-light); }

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .row-2 { grid-template-columns: 1fr; }
  .result-meta { grid-template-columns: 1fr; }
  section { padding: 2rem 0; }
  .result-card { position: static; }
}
