/* ──────────────────────────────────────────────────────────────────────── */
/*  Sow a Sylvan Seed — ecosystem herb generator                            */
/* ──────────────────────────────────────────────────────────────────────── */

.hg-page { max-width: 1200px; margin: 0 auto; }

/* Header */
.hg-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding-bottom: 1.1rem; border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.hg-head-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .7rem; border-radius: 999px;
  border: 1px solid rgba(76,175,80,.25); background: rgba(76,175,80,.07);
  color: #8bd19a; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem;
}
.hg-head-title h1 {
  margin: 0 0 .4rem; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 10%, #c7e5c9 55%, #f0cf7d 95%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hg-head-sub { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; max-width: 600px; }
.hg-head-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* Buttons */
.hg-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.05rem; border-radius: 10px;
  font-size: .86rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all .16s ease; white-space: nowrap;
  border: 1px solid transparent;
}
.hg-btn-primary {
  background: linear-gradient(135deg, #a589ff 0%, var(--violet) 55%, #6a4df4 100%);
  color: #fff; border-color: rgba(139,112,255,.55);
  box-shadow: 0 3px 14px rgba(139,112,255,.3);
}
.hg-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(139,112,255,.45); }
.hg-btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.hg-btn-ghost:hover { color: var(--text); border-color: var(--gold); background: rgba(214,178,87,.06); }
.hg-btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* Herb card */
.hg-herb {
  background: linear-gradient(180deg, var(--panel-top), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem 1.75rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 8px 22px rgba(0,0,0,.25);
  margin-bottom: 2rem;
}
.hg-herb-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1.25rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 1rem; margin-bottom: 1.1rem;
}
.hg-herb-name {
  font-family: var(--display); font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin: 0; color: var(--gold-hi); letter-spacing: .02em; line-height: 1.15;
  flex: 1; min-width: 0;
}
.hg-herb-rarity { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; max-width: 320px; }
.hg-rarity-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .85rem; border-radius: 999px;
  font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
  border: 1px solid;
}
.hg-rarity-Abundant  { color: #9fd39f; background: rgba(100,180,100,.1); border-color: rgba(100,180,100,.35); }
.hg-rarity-Uncommon  { color: #8ac4d6; background: rgba(100,160,200,.1); border-color: rgba(100,160,200,.4); }
.hg-rarity-Rare      { color: #b29cff; background: rgba(139,112,255,.12); border-color: rgba(139,112,255,.4); }
.hg-rarity-VeryRare  { color: #f3a6ff; background: rgba(240,140,255,.08); border-color: rgba(240,140,255,.4); }
.hg-rarity-Legendary { color: #f0d97a; background: rgba(214,178,87,.1); border-color: rgba(214,178,87,.45); }
.hg-rarity-desc { font-size: .78rem; color: var(--muted); font-style: italic; line-height: 1.5; text-align: right; }

.hg-herb-body { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .hg-herb-body { grid-template-columns: 1fr 1fr; } }

.hg-section { display: flex; flex-direction: column; gap: .35rem; }
.hg-section.is-full { grid-column: 1 / -1; }
.hg-section-label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .7rem; color: var(--gold); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.hg-section-label i { font-size: .75rem; opacity: .8; }
.hg-section-value { font-size: .95rem; color: var(--text); line-height: 1.65; }
.hg-sub { margin-top: .2rem; }
.hg-sub strong { color: var(--gold); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin-right: .35rem; }

/* Status line */
.hg-status {
  padding: .6rem .9rem; border-radius: 10px;
  background: rgba(139,112,255,.08);
  border: 1px solid rgba(139,112,255,.25);
  color: var(--muted); font-size: .85rem;
  display: flex; align-items: center; gap: .55rem;
  margin-bottom: 1.1rem;
}
.hg-status.is-error { background: rgba(233,69,96,.08); border-color: rgba(233,69,96,.3); color: #ff9ba8; }
.hg-status[hidden] { display: none; }

/* Empty state */
.hg-empty {
  text-align: center; padding: 2.5rem 1rem 2.8rem;
  color: var(--faint); font-style: italic;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
}
.hg-empty-icon { font-size: 2rem; color: var(--faint); opacity: .55; }
.hg-empty p { margin: 0; }

/* Ledger */
.hg-ledger {
  background: linear-gradient(180deg, var(--panel-top), var(--panel));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.4rem;
}
.hg-ledger-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: .75rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: .55rem; margin-bottom: 1rem;
}
.hg-ledger-title { font-family: var(--display); font-size: 1.15rem; color: var(--gold-hi); letter-spacing: .02em; }
.hg-ledger-count { font-size: .72rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }

.hg-search {
  width: 100%; padding: .6rem .85rem;
  background: rgba(8,8,14,.65); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
  font-family: inherit; font-size: .88rem; outline: none;
  transition: border-color .15s ease; margin-bottom: 1rem;
}
.hg-search:focus { border-color: var(--gold); }

.hg-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.hg-table th, .hg-table td { padding: .6rem .55rem; text-align: left; border-bottom: 1px solid var(--border-soft); }
.hg-table th { font-size: .7rem; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hg-table tbody tr { cursor: pointer; transition: background .12s ease; }
.hg-table tbody tr:hover { background: rgba(214,178,87,.05); }
.hg-table td.hg-col-name { font-weight: 600; color: var(--text); }
.hg-table td.hg-col-biome { color: var(--muted); }
.hg-table td.hg-col-rarity { color: var(--muted); font-size: .8rem; }

.hg-pager {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1rem; gap: .6rem; flex-wrap: wrap;
}
.hg-pager-info { font-size: .76rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.hg-pager-btns { display: flex; gap: .5rem; }

.hg-skel { height: 38px; background: linear-gradient(110deg, rgba(40,40,60,.4) 25%, rgba(70,70,90,.55) 50%, rgba(40,40,60,.4) 75%); background-size: 200% 100%; border-radius: 8px; border: 1px solid var(--border); animation: hg-shimmer 1.4s infinite; margin-bottom: .45rem; }
@keyframes hg-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Modal */
.hg-modal-host { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; padding: 1rem; }
.hg-modal-host.open { display: flex; }
.hg-modal-backdrop { position: absolute; inset: 0; background: rgba(4,4,8,.78); backdrop-filter: blur(4px); }
.hg-modal {
  position: relative; max-width: 780px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel-top), var(--panel));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  padding: 1.5rem 1.7rem 1.7rem;
}
.hg-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit;
  transition: color .15s, border-color .15s;
}
.hg-modal-close:hover { color: var(--gold); border-color: var(--gold); }

/* Toast */
.hg-toast-host { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 99999; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; max-width: calc(100vw - 32px); }
.hg-toast { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.05rem; border-radius: 10px; background: linear-gradient(180deg, rgba(26,26,45,.97), rgba(19,19,33,.97)); border: 1px solid var(--border); color: var(--text); font-size: .86rem; box-shadow: 0 10px 28px rgba(0,0,0,.5); pointer-events: auto; animation: hg-toast-in .22s ease-out; max-width: 440px; }
.hg-toast i { font-size: .9rem; flex-shrink: 0; }
.hg-toast.is-info i { color: var(--violet); }
.hg-toast.is-warn { border-color: rgba(232,160,80,.5); }
.hg-toast.is-warn i { color: #e8a050; }
.hg-toast.is-error { border-color: rgba(233,69,96,.55); }
.hg-toast.is-error i { color: #e94560; }
.hg-toast.is-success i { color: #8bd19a; }
.hg-toast.is-out { opacity: 0; transform: translateY(-6px); transition: all .2s ease-in; }
@keyframes hg-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 720px) {
  .hg-head { align-items: stretch; }
  .hg-head-actions { justify-content: space-between; }
  .hg-herb-head { flex-direction: column; }
  .hg-herb-rarity { align-items: flex-start; max-width: none; }
  .hg-rarity-desc { text-align: left; }
}
