/* =============================================
   ROOT VARIABLES & RESET
   ============================================= */
:root {
  --bg: #111113;
  --surface: #1c1c1f;
  --surface2: #252529;
  --border: #2e2e33;
  --border-hover: #4ade80;
  --accent: #4ade80;
  --accent-dim: rgba(74,222,128,0.15);
  --accent-glow: 0 0 12px rgba(74,222,128,0.35);
  --text: #f1f1f3;
  --text-muted: #888896;
  --text-dim: #555566;
  --rarity-common: #9e9e9e;
  --rarity-uncommon: #4CAF50;
  --rarity-rare: #2196F3;
  --rarity-epic: #9C27B0;
  --rarity-legendary: #FF9800;
  --rarity-mythic: #F44336;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --transition: 0.18s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* =============================================
   NAV / HEADER
   ============================================= */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}
.nav-links a.trading-glow-btn {
  color: #fff;
  background: #333333;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.7);
  border: 1px solid rgba(255, 204, 0, 0.8);
}
.nav-links a.trading-glow-btn:hover {
  box-shadow: 0 0 25px rgba(255, 204, 0, 1);
  background: #444;
}
.nav-links a:hover { color: var(--text); }

/* =============================================
   TAB NAVIGATION (Competitor style)
   ============================================= */
.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tab-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { border-color: var(--accent); color: var(--text); }
.tab-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--accent-glow);
}

/* Tab Dropdown (Plants by Events) */
.tab-dropdown {
  position: relative;
  display: inline-block;
}
.tab-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.tab-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  min-width: 200px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  padding: 0.35rem 0;
  animation: dropdownFadeIn 0.15s ease;
}
.tab-dropdown.open .tab-dropdown-menu {
  display: block;
}
.tab-dropdown.open .tab-dropdown-toggle {
  border-color: var(--accent);
  color: var(--accent);
}
.tab-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.tab-dropdown-item:hover {
  background: var(--surface);
  color: var(--text);
  border-left-color: var(--accent);
}
.tab-dropdown-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  font-weight: 600;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
.main-wrapper {
  display: flex;
  height: calc(100vh - 57px - 57px); /* minus nav + tabs */
  overflow: hidden;
}
.plant-grid-panel {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}
.detail-panel {
  width: 360px;
  min-width: 360px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface);
  transition: all 0.25s ease;
}
.detail-panel.hidden-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-left: none;
}

/* =============================================
   PLANT GRID
   ============================================= */
.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 0.6rem;
}
.plant-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.3rem 0.5rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.plant-card:hover {
  border-color: var(--accent);
  background: #1e2822;
  transform: translateY(-1px);
}
.plant-card.selected {
  border-color: var(--accent);
  background: #1a2c1a;
  box-shadow: var(--accent-glow);
}
.plant-icon {
  font-size: 2.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.plant-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  image-rendering: auto;
}
.plant-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}
.plant-card.selected .plant-name { color: var(--accent); }

/* =============================================
   DETAIL PANEL (right side calculator)
   ============================================= */
.detail-inner {
  padding: 1.25rem;
}
.detail-plant-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.detail-plant-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-radius: 12px;
  border: 1.5px solid var(--border);
}
.detail-plant-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.detail-plant-value {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.detail-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

/* Inputs */
.field {
  margin-bottom: 1rem;
}
.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}
.field input, .field select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field select option { background: var(--surface2); }

/* Mutation chips */
.mutation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.mutation-chip {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.mutation-chip:hover { border-color: var(--accent); color: var(--text); }
.mutation-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* Results box */
.result-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; }
.result-row .lbl { font-size: 0.78rem; color: var(--text-muted); }
.result-row .val { font-size: 0.85rem; font-weight: 700; color: var(--text); }

.final-box {
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin-top: 0.75rem;
}
.final-box .final-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.final-box .final-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.final-box .final-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* No selection state */
.empty-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 2rem;
  text-align: center;
}
.empty-detail .big-icon { font-size: 3rem; opacity: 0.4; }

/* =============================================
   SPECIAL TAB VIEWS (Pet XP, Egg Speed, etc.)
   ============================================= */
.special-view {
  display: none;
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}
.special-view.active { display: block; }
.special-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.special-view-title { font-size: 1.25rem; font-weight: 800; }
.special-view-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.back-btn {
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); }

.calc-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.calc-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.stat-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
}
.stat-mini-label { font-size: 0.68rem; color: var(--text-dim); margin-bottom: 0.2rem; }
.stat-mini-val { font-size: 1rem; font-weight: 700; color: var(--text); }

/* Pet slots - matched to competitor layout */
.pet-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.pet-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  display: flex;
  gap: 1rem;
}
.pet-slot-left {
  flex-shrink: 0;
}
.pet-img-box {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
}
.pet-slot-right {
  flex: 1;
  min-width: 0;
}
.pet-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.pet-slot-label { font-size: 0.75rem; color: #fff; font-weight: 600; }
.target-checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.target-checkbox input { width: 12px; height: 12px; accent-color: var(--accent); }
.slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.slot-grid .field { margin-bottom: 0; }
.slot-grid .field:nth-child(1) { flex: 1; min-width: 120px; }
.slot-grid .field:nth-child(2) { width: 80px; }
.slot-full-row { width: 100%; }
.slot-grid label { font-size: 0.65rem; color: var(--text-dim); }
.slot-grid select, .slot-grid input { font-size: 0.75rem; padding: 0.35rem 0.5rem; }

.toys-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.toy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.toy-pill input { width: 10px; height: 10px; accent-color: var(--accent); cursor: pointer; }

/* Age Timeline Graph */
.age-timeline-wrapper {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.age-timeline-stats {
  min-width: 200px;
  max-width: 220px;
  flex-shrink: 0;
}
.age-timeline-graph {
  flex: 1;
  min-width: 0;
}
.age-timeline-graph-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.age-timeline-canvas-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 220px;
  position: relative;
  overflow: hidden;
}
.age-timeline-canvas-wrap canvas {
  position: absolute;
  inset: 0;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .main-wrapper { flex-direction: column; height: auto; }
  .age-timeline-wrapper { flex-direction: column; }
  .age-timeline-stats { max-width: 100%; }
  .detail-panel {
    width: 100% !important;
    min-width: 100% !important;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .detail-panel.hidden-panel { display: none; }
  .plant-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .pet-slots { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .tabs-bar { padding: 0.75rem 1rem; gap: 0.35rem; }
  .tab-btn { font-size: 0.78rem; padding: 0.35rem 0.75rem; }
  .plant-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 0.45rem; }
  .plant-icon { font-size: 1.8rem; width: 44px; height: 44px; }
}

/* =============================================
   RARITY COLORS
   ============================================= */
.rarity-common { color: var(--rarity-common); }
.rarity-uncommon { color: var(--rarity-uncommon); }
.rarity-rare { color: var(--rarity-rare); }
.rarity-epic { color: var(--rarity-epic); }
.rarity-legendary { color: var(--rarity-legendary); }
.rarity-mythic { color: var(--rarity-mythic); }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
}
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.8rem; color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 0.78rem; color: var(--text-dim); }

/* SEO Section */
.seo-section {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 860px;
}
.seo-section h1 { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: 0.75rem; }
.seo-section h2 { font-size: 1.05rem; font-weight: 700; color: var(--accent); margin: 1.5rem 0 0.5rem; }
.seo-section p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 0.75rem; }

/* Animations */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.detail-inner { animation: fadeSlideIn 0.2s ease; }

@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.plant-card { animation: popIn 0.15s ease; }
/* --- Pet Ability layout & styling --- */

/* Make this category use our custom layout instead of the generic grid */
.category-content.active:has(#petAbilityButtons) {
  display: block !important;
  margin-top: 20px;
}

.pet-ability-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(340px, 1.6fr);
  gap: 16px;
  align-items: flex-start;
}

.pet-ability-left {
  display: flex;
  flex-direction: column;
  gap: 8px;

}

/* Search bar */

# {
width: 95%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #111;
  color: #eee;
  font-size: 14px;
}

/* Uniform grid of pet buttons â€“ slightly bigger, more rows visible */

# {
display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  grid-auto-rows: 130px;
  gap: 10px;
  overflow-y: auto;
  max-height: 540px;    /* shows more rows at once */
  padding-right: 8px;
}

#::after {
content: "Scroll for more pets";
  display: block;
  text-align: center;
  font-size: 13px;
  color: #aaa;
  margin-top: 8px;
}

/* Base pet button style */
.ability-button {
  border: 1px solid #444;
  background: #151515;
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    border-color 0.08s ease,
    background 0.08s ease;
}



.ability-button img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 4px;
}

.ability-button span {
  font-size: 12px;
  color: #ddd;
  text-transform: capitalize;
}

/* Right side: calc menu + results */
.pet-ability-right {
  min-width: 0;
  max-height: 900px;
  overflow-y: auto;
}

# {
display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Make the "Calculations" card always visible at the top while scrolling results */

# .ability-controls {
position: sticky;
  top: 0;
  z-index: 1;
  background: #111;
  border-radius: 10px;
  border: 1px solid #333;
  padding: 10px 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-calc-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.ability-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.ability-row-title {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

.ability-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.ability-pill-group label {
  background: #191919;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid #333;
  font-size: 12px;
}

.ability-pill-group input {
  margin-right: 4px;
}

.pet-calc-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #4caf50;
  background: #145214;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.pet-calc-btn:hover {
  filter: brightness(1.1);
}

.pet-calc-hint {
  font-size: 12px;
  color: #aaa;
  margin-left: 8px;
}

/* Nicer results box */

# {
background: #111;
  border-radius: 10px;
  border: 1px solid #333;
  padding: 10px 12px;
  font-size: 13px;
}

# h4 {
margin: 8px 0 4px;
}



/* Mobile fallback: stack instead of side-by-side */
@media (max-width: 900px) {
  .pet-ability-layout {
    grid-template-columns: 1fr;
  }

  .pet-ability-right,
  #petAbilityButtons {
    max-height: none;
  }

  #petAbilityOutput .ability-controls {
    position: static;
    box-shadow: none;
  }
}

.displaybox-value {
  color: #ffd54f;       /* bright yellow-gold to pop on dark background */
  font-weight: 600;
}
.selected-pet-indicator{
  margin: 0 0 10px;
  font-weight: 600;
}

.selected-pet-name{
  font-weight: 700;
}

@media (min-width: 900px) {
  .pet-ability-layout {
    align-items: start;
  }
  .pet-ability-left,
  .pet-ability-right,
  #petAbilityOutput,
  #petAbilityOutput .ability-controls,
  .ability-controls {
    min-height: 0;
  }
  .pet-ability-left {
    align-self: start;
  }
  .pet-ability-right {
    padding-bottom: 16px;
  }
  #petAbilityButtons {
    max-height: 840px;
    overflow-y: auto;
    overflow-x: hidden;
  }
}
