/* ================================================
   Grow a Garden Calculator – WordPress Plugin CSS
   Matches the React web app design exactly.
   All selectors scoped to .gag-app-root or .gag-modal-overlay
   ================================================ */

/* ---- Design Tokens (mirrors web app index.css) ---- */
/*
  --background  : hsl(0,0%,97%)     ≈ #f7f7f7
  --foreground  : hsl(220,15%,15%)  ≈ #1e2433
  --card        : #ffffff
  --border      : hsl(220,13%,88%)  ≈ #dde1e6
  --primary     : hsl(142,72%,29%)  ≈ #16a34a
  --secondary   : hsl(220,13%,92%)  ≈ #e9eaee
  --muted-fg    : hsl(220,10%,46%)  ≈ #6b7280
  --emerald-400 : #34d399
*/

/* ---- Base Reset (scoped) ---- */
.gag-app-root *,
.gag-app-root *::before,
.gag-app-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.gag-app-root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1e2433;
  background: transparent;
}

/* ---- Outer Wrapper ---- */
.gag-wrap {
  background: #f7f7f7;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #dde1e6;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

/* ---- Tab Bar (mirrors Layout.tsx nav) ---- */
.gag-tabs {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid #dde1e6;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 8px;
}
.gag-tabs::-webkit-scrollbar { display: none; }

.gag-tab {
  padding: 14px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.15s;
  letter-spacing: 0.01em;
  outline: none;
  line-height: 1;
  margin-bottom: -1px;
  font-family: inherit;
  border-radius: 6px 6px 0 0;
}
.gag-tab:hover {
  color: #1e2433;
  background: #f3f4f6;
}
.gag-tab.active {
  color: #16a34a;
  border-bottom-color: #16a34a;
  background: rgba(22,163,74,0.05);
}

/* ---- Content Area ---- */
.gag-content { padding: 24px; background: #f7f7f7; }

/* ---- Page Title (mirrors h1 in each page) ---- */
.gag-page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1e2433;
  margin-bottom: 4px;
  line-height: 1.2;
}
.gag-page-desc {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 20px;
}

/* ---- Card (mirrors <Card> component) ---- */
.gag-card {
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.gag-card-body { padding: 20px; }
.gag-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #dde1e6;
  background: #ffffff;
}
.gag-card-header-noborder {
  padding: 16px 20px 10px;
}

.gag-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e2433;
  line-height: 1.3;
}
.gag-card-desc {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* Primary-accented card (Final Value, XP Output) */
.gag-card-primary {
  background: rgba(22,163,74,0.04);
  border-color: #16a34a;
}
.gag-card-primary-bar {
  height: 4px;
  background: linear-gradient(90deg, #16a34a, #34d399);
  width: 100%;
}

/* Secondary card (Top Mutations, milestones) */
.gag-card-secondary {
  background: rgba(233,234,238,0.4);
  border-color: #dde1e6;
}

/* ---- 2-Column Layout ---- */
.gag-layout-2col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

/* ---- Grid Helpers ---- */
.gag-grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gag-grid-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.gag-grid-4  { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; }
.gag-grid-7  { display: grid; grid-template-columns: repeat(7,1fr); gap: 8px; }

/* ---- Flex Helpers ---- */
.gag-flex        { display: flex; align-items: center; }
.gag-flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gag-flex-col    { display: flex; flex-direction: column; }
.gag-flex-wrap   { display: flex; flex-wrap: wrap; }
.gag-gap-2 { gap: 8px; }
.gag-gap-3 { gap: 12px; }
.gag-gap-4 { gap: 16px; }

/* ---- Spacing ---- */
.gag-mt-2 { margin-top: 8px; }
.gag-mt-3 { margin-top: 12px; }
.gag-mt-4 { margin-top: 16px; }
.gag-mb-2 { margin-bottom: 8px; }
.gag-mb-3 { margin-bottom: 12px; }
.gag-mb-4 { margin-bottom: 16px; }
.gag-space-y > * + * { margin-top: 16px; }

/* ---- Input ---- */
.gag-input {
  background: rgba(233,234,238,0.5);
  border: 1px solid #dde1e6;
  border-radius: 8px;
  color: #1e2433;
  padding: 9px 12px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  line-height: 1.4;
}
.gag-input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
  background: #ffffff;
}
.gag-input::placeholder { color: #9ca3af; }
.gag-input[type=number] { font-family: 'Courier New', monospace; }

.gag-input-wrap { position: relative; }
.gag-input-wrap .gag-input { padding-left: 36px; }
.gag-input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 15px;
  pointer-events: none;
  line-height: 1;
}

/* ---- Buttons ---- */
.gag-btn {
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gag-btn:hover { background: #15803d; }

.gag-btn-outline {
  background: transparent;
  border: 1px dashed #dde1e6;
  color: #6b7280;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}
.gag-btn-outline:hover {
  border-color: #16a34a;
  color: #16a34a;
  background: rgba(22,163,74,0.05);
}

.gag-btn-outline-primary {
  background: rgba(22,163,74,0.05);
  border: 1px dashed rgba(22,163,74,0.3);
  color: #16a34a;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}
.gag-btn-outline-primary:hover {
  background: rgba(22,163,74,0.1);
}

.gag-btn-ghost {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  transition: color 0.2s;
  line-height: 1;
  border-radius: 6px;
}
.gag-btn-ghost:hover { color: #1e2433; background: #f3f4f6; }

.gag-btn-sm { padding: 6px 12px; font-size: 12px; }

.gag-btn-danger {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
  font-family: inherit;
}

/* ---- Scrollable List ---- */
.gag-scroll-list {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #dde1e6 transparent;
}
.gag-scroll-list::-webkit-scrollbar { width: 4px; }
.gag-scroll-list::-webkit-scrollbar-track { background: transparent; }
.gag-scroll-list::-webkit-scrollbar-thumb { background: #dde1e6; border-radius: 4px; }

/* ---- Plant Item (mirrors plant grid in ValueCalculator) ---- */
.gag-plant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #dde1e6;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  background: #ffffff;
}
.gag-plant-item:hover {
  border-color: rgba(22,163,74,0.5);
  background: #ffffff;
}
.gag-plant-item.selected {
  background: rgba(22,163,74,0.08);
  border-color: #16a34a;
  box-shadow: 0 0 15px rgba(22,163,74,0.12);
}

/* ---- Rarity Badges (mirrors RARITY_COLORS in gameData) ---- */
.gag-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
  line-height: 1.4;
  white-space: nowrap;
}
.gag-badge-common    { color: #6b7280; border-color: #d1d5db; background: #f3f4f6; }
.gag-badge-uncommon  { color: #16a34a; border-color: #86efac; background: #f0fdf4; }
.gag-badge-rare      { color: #2563eb; border-color: #93c5fd; background: #eff6ff; }
.gag-badge-legendary { color: #d97706; border-color: #fcd34d; background: #fffbeb; }
.gag-badge-mythical  { color: #9333ea; border-color: #d8b4fe; background: #faf5ff; }

/* ---- Mutation Chip (matches web app mutation toggle style) ---- */
.gag-mut-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(233,234,238,0.5);
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  user-select: none;
  line-height: 1;
}
.gag-mut-chip:hover {
  border-color: rgba(22,163,74,0.4);
  color: #1e2433;
  background: rgba(22,163,74,0.05);
}
/* selected state: color-coded per mutation (set via inline style) */

/* ---- Mutation checkbox (matches web app Check icon) ---- */
.gag-mut-check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
}

/* ---- Value Display (mirrors the value card in ValueCalculator) ---- */
.gag-value-display {
  background: rgba(247,247,247,0.6);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.gag-value-display::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(22,163,74,0.04);
  border-radius: 14px;
  pointer-events: none;
}
.gag-value-emoji { font-size: 52px; margin-bottom: 8px; line-height: 1; display: block; position: relative; z-index: 1; }
.gag-value-big {
  font-size: 44px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, #16a34a, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
}
.gag-value-label {
  color: rgba(22,163,74,0.85);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* ---- Breakdown Table (mirrors "Calculation Breakdown" card) ---- */
.gag-breakdown {
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 12px;
  overflow: hidden;
}
.gag-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f1f3f5;
  color: #374151;
}
.gag-breakdown-row:last-child { border-bottom: none; }
.gag-breakdown-row.total {
  font-weight: 700;
  border-top: 1px solid #dde1e6;
  color: #1e2433;
  font-size: 14px;
}

/* ---- Top Mutations card ---- */
.gag-top-mut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  margin-bottom: 6px;
}
.gag-top-mut:last-child { margin-bottom: 0; }

/* ---- Section Label ---- */
.gag-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 10px;
}

/* ---- Mutation Card (Mutations Reference grid) ---- */
.gag-mut-card {
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.gag-mut-card:hover {
  border-color: rgba(22,163,74,0.4);
  box-shadow: 0 2px 8px rgba(22,163,74,0.08);
}
.gag-mut-card.selected {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22,163,74,0.2);
}
.gag-mut-card-bar { height: 6px; width: 100%; opacity: 0.5; }
.gag-mut-card-body { padding: 16px; }
.gag-mut-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.gag-mut-card-name { font-weight: 700; font-size: 15px; color: #1e2433; }
.gag-mut-card-mult {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid;
}
.gag-mut-card-desc {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

/* ---- Quick Combo Tester ---- */
.gag-combo-box {
  background: rgba(22,163,74,0.04);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.gag-combo-chips-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  align-items: center;
}
.gag-combo-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e9eaee;
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #dde1e6;
}
.gag-combo-result {
  background: #ffffff;
  border: 1px solid rgba(22,163,74,0.3);
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
  min-width: 120px;
}
.gag-combo-result-big {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  background: linear-gradient(90deg, #16a34a, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Controls Row ---- */
.gag-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

/* ---- Select ---- */
.gag-select {
  background: rgba(233,234,238,0.6);
  border: 1px solid #dde1e6;
  border-radius: 8px;
  color: #1e2433;
  padding: 7px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s;
}
.gag-select:focus { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,0.12); }

/* ---- XP Display ---- */
.gag-xp-display {
  background: rgba(247,247,247,0.6);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.gag-xp-display::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(22,163,74,0.04);
  pointer-events: none;
}
.gag-xp-big {
  font-size: 40px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, #16a34a, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

/* ---- Pet Slot (mirrors PetSelector in PetXPCalculator) ---- */
.gag-pet-slot {
  border: 2px dashed #dde1e6;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #ffffff;
  padding: 8px 4px;
  text-align: center;
  min-height: 80px;
  position: relative;
  user-select: none;
}
.gag-pet-slot:hover {
  border-color: rgba(22,163,74,0.4);
  background: rgba(22,163,74,0.03);
}
.gag-pet-slot.filled {
  border-style: solid;
  border-color: rgba(22,163,74,0.5);
  background: rgba(22,163,74,0.04);
}
.gag-pet-slot.filled:hover { border-color: #16a34a; }
.gag-pet-slot.target {
  border-color: rgba(168,85,247,0.4);
  background: rgba(168,85,247,0.04);
}
.gag-pet-slot.target:hover { border-color: rgba(168,85,247,0.7); }
.gag-pet-slot.target.filled {
  border-color: rgba(168,85,247,0.5);
  background: rgba(168,85,247,0.06);
}
.gag-pet-slot-emoji { font-size: 26px; line-height: 1; }
.gag-pet-slot-name {
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  padding: 0 2px;
}
.gag-pet-slot-bonus {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 9px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  background: rgba(22,163,74,0.15);
  color: #16a34a;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.4;
  border: 1px solid rgba(22,163,74,0.2);
}
.gag-pet-slot-add { color: #9ca3af; font-size: 22px; line-height: 1; }
.gag-pet-slot-add.target-add { color: #a855f7; }
.gag-pet-slot-add-text { font-size: 10px; color: #9ca3af; margin-top: 3px; font-weight: 600; }

/* ---- Milestone Row ---- */
.gag-milestone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: rgba(233,234,238,0.4);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.gag-milestone:last-child { margin-bottom: 0; }

/* ---- Trade Layout ---- */
.gag-trade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  position: relative;
}
.gag-trade-vs {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e9eaee;
  border: 1px solid #dde1e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  z-index: 5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.gag-trade-side {
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.gag-trade-side-header {
  padding: 16px 20px;
  border-bottom: 1px solid #dde1e6;
  background: rgba(233,234,238,0.3);
}
.gag-trade-side-title { font-size: 15px; font-weight: 700; color: #1e2433; margin-bottom: 4px; }
.gag-trade-total {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: #1e2433;
}
.gag-trade-total.their {
  background: linear-gradient(90deg, #16a34a, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gag-trade-side-body { padding: 14px; }
.gag-trade-empty {
  height: 100px;
  border: 2px dashed #dde1e6;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  background: #f9fafb;
}
.gag-trade-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dde1e6;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
  background: #ffffff;
}
.gag-trade-item:hover {
  border-color: rgba(22,163,74,0.35);
}
.gag-trade-item:hover .gag-btn-danger { opacity: 1; }
.gag-trade-item-icon {
  width: 44px;
  height: 44px;
  background: #f3f4f6;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.gag-trade-item-details { flex: 1; min-width: 0; }
.gag-trade-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e2433;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gag-trade-item-muts { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.gag-trade-item-value {
  font-size: 13px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: #16a34a;
  text-align: right;
  margin-top: 4px;
}

/* ---- Fairness Banner (mirrors TradeChecker fairnessData) ---- */
.gag-fairness {
  padding: 20px 24px;
  border-radius: 16px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  transition: all 0.3s;
}
.gag-fairness-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.gag-fairness-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  margin-bottom: 2px;
}
.gag-fairness-text { font-size: 20px; font-weight: 800; }
.gag-fairness-stats {
  display: flex;
  gap: 20px;
  background: rgba(255,255,255,0.7);
  padding: 10px 18px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
}
.gag-fairness-stat { text-align: center; }
.gag-fairness-stat-label { font-size: 10px; color: #6b7280; margin-bottom: 2px; }
.gag-fairness-stat-val { font-size: 15px; font-weight: 700; font-family: 'Courier New', monospace; }
.gag-fairness-divider { width: 1px; background: #dde1e6; }

/* ---- Wiki Table (mirrors PlantWiki table) ---- */
.gag-table-wrap {
  border: 1px solid #dde1e6;
  border-radius: 14px;
  overflow: hidden;
  overflow-x: auto;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.gag-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gag-table thead { background: rgba(233,234,238,0.5); }
.gag-table th {
  padding: 12px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: color 0.15s;
  border: none;
  border-bottom: 1px solid #dde1e6;
}
.gag-table th:hover { color: #374151; }
.gag-table th.text-right,
.gag-table td.text-right { text-align: right; }
.gag-table td {
  padding: 13px 18px;
  border-top: 1px solid #f1f3f5;
  color: #374151;
  border-left: none;
  border-right: none;
  border-bottom: none;
}
.gag-table tr:hover td { background: rgba(233,234,238,0.3); }
.gag-table td.td-primary { color: #16a34a; font-family: 'Courier New', monospace; font-weight: 600; }
.gag-table td.td-emerald { color: #059669; font-family: 'Courier New', monospace; font-weight: 600; }
.gag-table td.td-muted  { color: #9ca3af; font-family: 'Courier New', monospace; }

/* ---- Rarity Filter Chips (mirrors PlantWiki rarity badges) ---- */
.gag-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.gag-chip {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: rgba(233,234,238,0.6);
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
  font-family: inherit;
}
.gag-chip:hover {
  border-color: #16a34a;
  color: #16a34a;
  background: rgba(22,163,74,0.06);
}
.gag-chip.active {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

/* ---- Util ---- */
.gag-accent  { color: #16a34a; }
.gag-muted   { color: #9ca3af; }
.gag-green   { color: #16a34a; }
.gag-emerald { color: #059669; }
.gag-red     { color: #dc2626; }
.gag-yellow  { color: #d97706; }
.gag-purple  { color: #9333ea; }
.gag-orange  { color: #ea580c; }
.gag-mono    { font-family: 'Courier New', monospace; }
.gag-bold    { font-weight: 700; }
.gag-center  { text-align: center; }
.gag-divider { height: 1px; background: #dde1e6; margin: 12px 0; }
.gag-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 6px;
}
.gag-form-group { margin-bottom: 16px; }
.gag-form-group:last-child { margin-bottom: 0; }
.gag-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* ---- Modal (body-level overlay) ---- */
.gag-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}
.gag-modal {
  background: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 18px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  color: #1e2433;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 25px 60px rgba(0,0,0,0.15);
  scrollbar-width: thin;
  scrollbar-color: #dde1e6 transparent;
}
.gag-modal::-webkit-scrollbar { width: 4px; }
.gag-modal::-webkit-scrollbar-thumb { background: #dde1e6; border-radius: 4px; }
.gag-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #dde1e6;
  background: rgba(233,234,238,0.3);
  position: sticky;
  top: 0;
  z-index: 1;
}
.gag-modal-title { font-size: 17px; font-weight: 700; color: #1e2433; }
.gag-modal-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px;
  font-family: inherit;
  transition: color 0.2s;
  border-radius: 6px;
}
.gag-modal-close:hover { color: #1e2433; background: #f3f4f6; }
.gag-modal-body { padding: 20px 22px; }
.gag-modal * { box-sizing: border-box; }

/* Pet modal list */
.gag-pet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
  color: #1e2433;
}
.gag-pet-option:hover { background: #f3f4f6; }
.gag-pet-option.remove-opt {
  color: #dc2626;
  margin-bottom: 8px;
  border-bottom: 1px solid #f1f3f5;
  padding-bottom: 12px;
}

/* Item builder plant option */
.gag-plant-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 14px;
  margin-bottom: 2px;
  color: #1e2433;
}
.gag-plant-option:hover { background: #f3f4f6; }

/* Selected plant preview (inside trade item modal) */
.gag-selected-plant-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(22,163,74,0.06);
  border: 1px solid rgba(22,163,74,0.3);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1e2433;
  margin-bottom: 12px;
}
.gag-selected-plant-preview .clear-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px;
  font-family: inherit;
}
.gag-selected-plant-preview .clear-btn:hover { color: #dc2626; }

/* Mut toggle in modal */
.gag-mut-toggle {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(233,234,238,0.7);
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid #dde1e6;
  user-select: none;
  margin: 3px;
}
.gag-mut-toggle:hover { border-color: rgba(22,163,74,0.4); color: #16a34a; }
.gag-mut-toggle.selected {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

/* Scroll area in modal */
.gag-modal-scroll {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  background: #f9fafb;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: #dde1e6 transparent;
}
.gag-modal-scroll::-webkit-scrollbar { width: 4px; }
.gag-modal-scroll::-webkit-scrollbar-thumb { background: #dde1e6; border-radius: 4px; }

/* Qty row */
.gag-qty-row { display: flex; gap: 10px; align-items: flex-end; }
.gag-qty-field { width: 80px; flex-shrink: 0; }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 900px) {
  .gag-layout-2col { grid-template-columns: 1fr; }
  .gag-grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .gag-content { padding: 14px; }
  .gag-tabs { padding: 0; }
  .gag-tab { padding: 12px 12px; font-size: 12px; }
  .gag-trade-grid { grid-template-columns: 1fr; }
  .gag-trade-vs { display: none; }
  .gag-grid-3 { grid-template-columns: 1fr 1fr; }
  .gag-grid-7 { grid-template-columns: repeat(4,1fr); }
  .gag-fairness { flex-direction: column; align-items: flex-start; }
  .gag-value-big { font-size: 34px; }
}

@media (max-width: 480px) {
  .gag-grid-2 { grid-template-columns: 1fr; }
  .gag-grid-4 { grid-template-columns: 1fr 1fr; }
  .gag-grid-7 { grid-template-columns: repeat(3,1fr); }
  .gag-mut-chip { font-size: 12px; padding: 5px 9px; }
  .gag-tab { padding: 11px 10px; font-size: 11px; }
}
