html { scrollbar-gutter: stable; }
/* Shared Pal detail modal styles (used by tiers.html; Pals page has its own copy) */
:root {
  --color-orange: #6cbf3c;
  --color-danger: #e5484d;
  --radius-md: 16px;
  --tier-common: #7d7360;
  --tier-rare: #2ba0e0;
  --tier-epic: #b06be0;
  --tier-legendary: #f4a63c;
}

[hidden] { display: none !important; }

.type-ico { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(60,78,112,0.12)); }
.type-ico.sm { width: 18px; height: 18px; }
.type-row { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.type-row.big .type-ico { width: 26px; height: 26px; }

.rarity-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 4px;
  border: 1px solid color-mix(in srgb, var(--tier, var(--tier-common)) 45%, transparent);
  border-radius: 999px; background: color-mix(in srgb, var(--tier, var(--tier-common)) 14%, transparent);
  font-size: 0.72rem; font-weight: 750;
}
.rarity-pill b {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--tier, var(--tier-common)); color: #f5efe2; font-weight: 800; font-size: 0.72rem;
}
.rarity-pill span { color: color-mix(in srgb, var(--tier, var(--tier-common)) 82%, #ffffff); }
.rarity-pill[data-tier="common"] { --tier: var(--tier-common); }
.rarity-pill[data-tier="rare"] { --tier: var(--tier-rare); }
.rarity-pill[data-tier="epic"] { --tier: var(--tier-epic); }
.rarity-pill[data-tier="legendary"] { --tier: var(--tier-legendary); }

.modal { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(60,78,112,0.14); backdrop-filter: blur(6px); animation: fade 0.2s var(--ease); }
.modal-card {
  position: relative; width: min(760px, 100%); max-height: 88vh; overflow: auto;
  padding: clamp(18px, 3vw, 30px); border: 1px solid var(--color-border-strong); border-radius: var(--radius-xl);
  background: linear-gradient(160deg, #fbf6ec, #f7f1e4);
  box-shadow: 0 40px 90px rgba(60,78,112,0.15); animation: pop 0.22s var(--ease);
}
.modal-close {
  position: sticky; float: right; top: 0; width: 36px; height: 36px; margin: -6px -6px 0 0;
  border: 1px solid var(--color-border-2); border-radius: 10px; color: var(--color-muted);
  background: rgba(255,255,255,0.7); cursor: pointer; font-size: 0.9rem;
}
.modal-close:hover { color: var(--color-text); border-color: var(--color-border-strong); }

.modal-head { display: flex; align-items: center; gap: 20px; }
.modal-head .pf { --s: 128px; box-shadow: 0 0 30px rgba(108,191,60,0.14), inset 0 -6px 15px rgba(60,78,112,0.09); }
.mh-info { min-width: 0; display: grid; gap: 9px; }
.mh-top { display: flex; align-items: baseline; gap: 10px; }
.mh-top h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; letter-spacing: -0.04em; }
.dex.big { color: var(--color-faint); font-size: 1rem; font-weight: 700; }
.mh-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tagpill { padding: 3px 11px; border: 1px solid var(--color-border-2); border-radius: 999px; color: var(--color-muted); font-size: 0.72rem; font-weight: 700; }
.tagpill.night { color: #cbb2ff; border-color: rgba(150, 120, 220, 0.4); }
.tagpill.danger { color: var(--color-orange); border-color: rgba(108,191,60,0.4); }

.breed-cta {
  display: inline-flex; align-items: center; gap: 9px; margin: 20px 0 6px; padding: 11px 18px;
  border: 1px solid var(--color-border-strong); border-radius: 13px;
  background: linear-gradient(135deg, rgba(108,191,60,0.18), rgba(108,191,60,0.12));
  color: var(--color-cyan-bright); font-weight: 750; text-decoration: none; transition: 150ms;
}
.breed-cta svg { width: 19px; height: 19px; }
.breed-cta:hover { border-color: var(--color-cyan); box-shadow: 0 8px 22px rgba(60,78,112,0.1); transform: translateY(-1px); }

.lore { margin: 16px 0 4px; color: var(--color-muted); font-size: 0.9rem; line-height: 1.6; }
.modal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.block h3 { margin: 0 0 12px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-cyan); }
.muted { color: var(--color-faint); font-size: 0.85rem; }
.stats { display: grid; gap: 9px; }
.stat { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: 10px; }
.stat-l { color: var(--color-muted); font-size: 0.8rem; }
.stat-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.8); overflow: hidden; }
.stat-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--color-orange), var(--color-cyan)); }
.stat-v { text-align: right; font-size: 0.82rem; font-weight: 750; }
.work-list { display: grid; gap: 8px; }
.work-item { display: flex; align-items: center; gap: 9px; }
.work-item img { width: 24px; height: 24px; object-fit: contain; }
.work-item span { flex: 1; color: var(--color-text); font-size: 0.85rem; }
.work-item b { color: #4e9a44; font-size: 0.78rem; font-weight: 800; }
.partner { display: flex; gap: 13px; align-items: flex-start; padding: 13px; border: 1px solid var(--color-border); border-radius: 14px; background: rgba(255,255,255,0.4); }
.partner img { width: 40px; height: 40px; flex: 0 0 40px; object-fit: contain; }
.partner b { font-size: 0.92rem; }
.partner p { margin: 5px 0 0; color: var(--color-muted); font-size: 0.82rem; line-height: 1.5; }
.modal-body > .block { margin-top: 22px; }
.skills { display: grid; gap: 11px; }
.skill { padding: 11px 13px; border: 1px solid var(--color-border); border-radius: 12px; background: rgba(255,255,255,0.4); }
.skill-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.skill-head b { font-size: 0.86rem; }
.skill-meta { color: #7a94a6; font-size: 0.72rem; font-weight: 800; }
.skill p { margin: 6px 0 0; color: var(--color-muted); font-size: 0.8rem; line-height: 1.5; }
.drops { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.drops li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--color-border); border-radius: 11px; background: rgba(255,255,255,0.4); font-size: 0.84rem; }
.drops li em { color: var(--color-muted); font-style: normal; font-size: 0.78rem; }

@media (max-width: 760px) { .modal-cols { grid-template-columns: 1fr; gap: 20px; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
