:root {
  --bg: #eef2f9;
  --surface: #ffffff;
  --text: #182338;
  --muted: #5b6b86;
  --muted-2: #8794a8;
  --border: #e5e9f2;
  --border-soft: #eef1f7;
  --accent: #4f46e5;
  --owned: #22a565;
  --owned-bg: #e4f7ee;
  --missing: #e5484d;
  --missing-bg: #fdeaea;
  --trade-bg: #e7eeff;
  --trade: #2f6bff;
  --raid-bg: #fdf0dc;
  --raid: #b06f00;
  --extra-bg: #efe9fd;
  --extra: #8b5cf6;

  /* dashboard-specific tokens */
  --brand: #2f6bff;
  --brand-2: #22c6e6;
  --surface-2: #f6f8fc;
  --track: #e7ecf6;
  --r-card: 18px; --r-sm: 12px; --r-pill: 999px;
  --shadow-sm: 0 2px 8px -3px rgba(31, 52, 94, .20);
  --shadow: 0 6px 20px -8px rgba(31, 52, 94, .22);
  --shadow-lg: 0 18px 44px -18px rgba(31, 52, 94, .38);
  --hero-shadow: 0 16px 40px rgba(23, 37, 84, .14), 0 3px 10px rgba(23, 37, 84, .08);
  --glow: radial-gradient(120% 60% at 50% -10%, rgba(47, 107, 255, .10), transparent 70%);
  --you-bg: rgba(47, 107, 255, .10);
  --gold: #f6a821; --silver: #a9b3c9; --bronze: #cf8a4e;

  /* event-type accent gradients (Events page) — reuse the category palette */
  --ev-raid: linear-gradient(135deg, #ef4a4a, #ff7a5c);
  --ev-community: linear-gradient(135deg, #22a565, #4ad3a0);
  --ev-spotlight: linear-gradient(135deg, #f6a821, #ffcb52);
  --ev-season: linear-gradient(135deg, #2f6bff, #22c6e6);
  --ev-gbl: linear-gradient(135deg, #8b5cf6, #b07cff);
  --ev-event: linear-gradient(135deg, #e0459e, #ff6fc7);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1220;
    --surface: #161d2e;
    --text: #eaf0fb;
    --muted: #9fb0cb;
    --muted-2: #6f7f9c;
    --border: #26304a;
    --border-soft: #212a40;
    --accent: #8b7bf0;
    --owned: #3ecb86;
    --owned-bg: #12352a;
    --missing: #ff6b6f;
    --missing-bg: #3a1c20;
    --trade-bg: #1a2748;
    --trade: #6f9dff;
    --raid-bg: #3a2a12;
    --raid: #ffb43d;
    --extra-bg: #2a1f45;
    --extra: #b07cff;

    --brand: #4d82ff;
    --brand-2: #38d6ef;
    --surface-2: #1c2437;
    --track: #232c46;
    --shadow-sm: 0 3px 10px -4px rgba(0, 0, 0, .55);
    --shadow: 0 8px 24px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 22px 50px -20px rgba(0, 0, 0, .7);
    --hero-shadow: 0 18px 44px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .4);
    --glow: radial-gradient(120% 60% at 50% -10%, rgba(77, 130, 255, .22), transparent 70%);
    --you-bg: rgba(77, 130, 255, .16);
    --silver: #b7c0d6; --bronze: #d69a63;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; margin-right: auto; }
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search svg { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--muted-2); pointer-events: none; }
.nav-search input {
  width: 168px; padding: 6px 10px 6px 30px; border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 12.5px;
}
.nav-search input:focus { outline: none; border-color: var(--brand); width: 210px; transition: width .15s ease; }
.topbar nav { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--text); font-size: 0.9rem; }
.topbar nav a.active { color: var(--accent); font-weight: 600; }

.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem; }
.card .label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.card .value { font-size: 1.6rem; font-weight: 700; margin-top: 0.15rem; }

/* ===================== Dashboard (RaidDex-style) ===================== */
.dash { position: relative; }
.dash::before {
  content: ""; position: absolute; inset: -1rem -1rem auto -1rem; height: 420px;
  background: var(--glow); pointer-events: none; z-index: -1;
}

.switcher { display: flex; gap: 0.5rem; overflow-x: auto; padding: 2px 2px 0.6rem; margin-bottom: 0.4rem; }
.switcher::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: transform .12s ease;
}
.chip:hover { transform: translateY(-1px); }
.chip .ava {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; font-weight: 600;
  font-size: 13px; color: #fff; background: var(--ava);
}
.chip .nm { font-family: "Fredoka", sans-serif; font-size: 13.5px; font-weight: 600; }
.chip.sel { background: var(--brand); border-color: transparent; box-shadow: 0 6px 16px rgba(47, 107, 255, .35); }
.chip.sel .nm { color: #fff; }
.chip.sel .ava { box-shadow: 0 0 0 2px var(--brand), 0 0 0 3.5px rgba(255, 255, 255, .9); }

.dash-layout { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.4rem; }
.dash-col-left { display: flex; flex-direction: column; gap: 0.75rem; }
.dash-sec-title { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 0.95rem; margin: 0.15rem 0.15rem 0.6rem; }

.hero {
  border-radius: 22px; padding: 1.35rem 1.25rem; border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-2)); box-shadow: var(--hero-shadow);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.hero-id { display: flex; align-items: center; gap: 12px; width: 100%; }
.hero-id .ava {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-content: center; font-weight: 700;
  font-size: 22px; color: #fff; background: var(--ava); flex-shrink: 0;
}
.hero-id .who { flex: 1; min-width: 0; }
.hero-id .who b { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 22px; display: block; line-height: 1.05; }
.hero-id .who small { font-size: 12.5px; color: var(--muted); }
.hero-id .rankpill {
  font-size: 12px; font-weight: 700; color: var(--brand); background: var(--you-bg);
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
}

.ring-wrap { position: relative; width: 186px; height: 186px; filter: drop-shadow(0 6px 18px rgba(47, 107, 255, .28)); }
.ring {
  width: 186px; height: 186px; border-radius: 50%;
  background: conic-gradient(from -90deg, var(--brand), var(--brand-2) calc(var(--pct) * 1%), var(--track) 0);
}
.ring::before { content: ""; position: absolute; inset: 15px; border-radius: 50%; background: var(--surface); }
.ring-lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.ring-lbl .pct { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 52px; line-height: .9; letter-spacing: -.02em; }
.ring-lbl .cnt { font-size: 13px; font-weight: 600; color: var(--muted); }
.ring-lbl .cap { font-size: 10.5px; font-weight: 600; color: var(--muted); opacity: .8; }

.dash-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.dash-btn {
  font-family: "Fredoka", sans-serif; border: 0; border-radius: 14px; padding: 0.85rem 1rem; font-weight: 600; font-size: 15px;
  cursor: pointer; text-align: center; text-decoration: none; display: block; transition: transform .12s ease, filter .12s ease;
}
.dash-btn:hover { transform: translateY(-1px); }
.dash-btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(47, 107, 255, .35); }
.dash-btn.primary:hover { filter: brightness(1.05); }
.dash-btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.dash-btn.ghost:hover { background: var(--surface); }

.cats { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.cats.compare-cats { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 8px; }
.cat {
  display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 13px 15px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); transition: transform .12s ease, box-shadow .12s ease;
}
.cat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--cat); }
.cat-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-content: center;
  background: linear-gradient(135deg, var(--cat), var(--cat2));
}
.cat-icon svg { width: 24px; height: 24px; display: block; }
.cat-body { min-width: 0; }
.cat-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; }
.cat-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; }
.cat-pct { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 18px; color: var(--cat); }
.cat-bar { height: 8px; border-radius: 999px; background: var(--track); margin: 7px 0 5px; overflow: hidden; }
.cat-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cat), var(--cat2)); }
.cat-count { font-size: 12px; color: var(--muted); font-weight: 500; }

.dash-col-mid { display: flex; flex-direction: column; gap: 1rem; }

.today-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 14px 15px 15px; }
.today-list { display: flex; flex-direction: column; gap: 8px; }
.today-row {
  display: flex; align-items: center; gap: 11px; padding: 8px 9px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--text); transition: background .12s ease;
}
a.today-row:hover { background: var(--surface-2); }
.today-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted-2); flex: none; }
.today-icon svg { width: 17px; height: 17px; }
.today-icon.live { background: var(--owned-bg); color: var(--owned); }
.today-body { min-width: 0; flex: 1; }
.today-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.today-sub { font-size: 11.5px; color: var(--muted-2); font-weight: 500; margin-top: 1px; }
.today-chip {
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 10.5px; padding: 3px 9px; border-radius: var(--r-pill); flex: none;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}
.today-chip.raid { color: #fff; background: linear-gradient(135deg, #ef4a4a, #ff7a5c); border: none; }
.today-chip.live { color: #fff; background: var(--owned); border: none; }
.today-chip.soon { color: var(--brand); }
.today-more {
  display: flex; align-items: center; gap: 5px; justify-content: center; margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border); font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 12.5px;
  color: var(--brand); text-decoration: none;
}
.today-more svg { width: 14px; height: 14px; }
.new-badge {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 9.5px; letter-spacing: .03em; padding: 2px 7px;
  border-radius: var(--r-pill); color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.board { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.lb {
  display: grid; grid-template-columns: 30px 36px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.lb:last-child { border-bottom: 0; }
.lb.cur { background: var(--you-bg); box-shadow: inset 3px 0 0 var(--brand); }
.rank { font-weight: 700; font-size: 14px; color: var(--muted); text-align: center; }
.rank.m1, .rank.m2, .rank.m3 {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-content: center; margin: 0 auto; font-size: 13px;
}
.rank.m1 { background: linear-gradient(135deg, var(--gold), #ffdc7a); color: #3a2b00; }
.rank.m2 { background: linear-gradient(135deg, var(--silver), #e6ebf5); color: #2b3346; }
.rank.m3 { background: linear-gradient(135deg, var(--bronze), #f0b782); color: #3a2b00; }
.ava.sm {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; font-weight: 600;
  font-size: 15px; color: #fff; background: var(--ava);
}
.lb-body { min-width: 0; }
.lb-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.lb-name .you { font-size: 10px; font-weight: 700; color: var(--brand); background: var(--you-bg); padding: 2px 7px; border-radius: 999px; }
.lb-bar { height: 5px; border-radius: 999px; background: var(--track); margin-top: 6px; overflow: hidden; max-width: 220px; }
.lb-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.lb-pct { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 17px; }

@media (min-width: 500px) {
  .switcher { flex-wrap: wrap; overflow: visible; }
}

/* The 330px + 322px fixed rails below only leave a workable middle column
   once the (max-width: 1100px) .container has essentially reached that cap —
   below this, .cats would be squeezed too narrow for a 2-up grid. */
@media (min-width: 1140px) {
  .dash-layout { display: grid; grid-template-columns: 330px 1fr 322px; align-items: start; gap: 1.4rem; }
  .dash-col-left { position: sticky; top: 4.2rem; }
  .cats { grid-template-columns: 1fr 1fr; }
  .ring-lbl .pct { font-size: 56px; }
}

.person-picker { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.person-picker a {
  padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-size: 0.85rem; background: var(--surface);
}
.person-picker a.active { background: var(--accent); color: white; border-color: var(--accent); }

table.grid { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 10px; overflow: hidden; }
table.grid th, table.grid td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.88rem; }
table.grid th { background: var(--bg); }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }

select.status-select {
  border: none; border-radius: 6px; padding: 0.25rem 0.4rem; font-weight: 600; font-size: 0.82rem;
  cursor: pointer; appearance: none; text-align: center;
}
.st-owned { background: var(--owned-bg); color: var(--owned); }
.st-not_owned { background: var(--missing-bg); color: var(--missing); }
.st-needs_trade { background: var(--trade-bg); color: var(--trade); }
.st-needs_raid { background: var(--raid-bg); color: var(--raid); }
.st-has_extra { background: var(--extra-bg); color: var(--extra); }

.pokemon-cards { display: grid; gap: 0.6rem; }
.pokemon-card {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.85rem;
}
.pokemon-card .name { font-weight: 600; }
.pokemon-card .meta { color: var(--muted); font-size: 0.8rem; }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; margin-right: 0.3rem; }

.progress-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 0.4rem; }
.progress-bar > div { height: 100%; background: var(--accent); }

.desktop-only { display: none; }
.mobile-only { display: block; }
@media (min-width: 800px) {
  .desktop-only { display: block; }
  .mobile-only { display: none; }
}

form.login-form { max-width: 320px; margin: 3rem auto; display: flex; flex-direction: column; gap: 0.75rem; }
form.login-form input { padding: 0.6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
button, .btn {
  padding: 0.5rem 0.9rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent);
  color: white; font-size: 0.9rem; cursor: pointer; text-decoration: none; display: inline-block;
}
button.secondary, .btn.secondary { background: transparent; color: var(--accent); }

.diff-list { font-size: 0.85rem; color: var(--muted); }
.section-title { font-weight: 700; margin: 1.5rem 0 0.5rem; }

/* ============================================================
   v2 — Collection & Pokémon Detail (RaidDex visual language)
   ============================================================ */
.screen-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.screen-head h1 { font-family: "Fredoka", sans-serif; font-size: 24px; font-weight: 700; }
.count-chip {
  font-weight: 600; font-size: 0.78rem; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); padding: 0.25rem 0.7rem; border-radius: var(--r-pill);
}

/* ---- category badge (Pokémon rarity/type family — NOT ownership) ---- */
.cat-badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: 11px; padding: 3px 9px 3px 7px; border-radius: var(--r-pill); color: #fff; line-height: 1;
}
.cat-badge .b-dot { width: 12px; height: 12px; border-radius: 4px; background: rgba(255, 255, 255, .9); }
.cat-badge.legendary { background: linear-gradient(135deg, #f6a821, #ffcb52); }
.cat-badge.mega { background: linear-gradient(135deg, #ef4a4a, #ff7a5c); }
.cat-badge.mythical { background: linear-gradient(135deg, #e0459e, #ff6fc7); }
.cat-badge.ultra { background: linear-gradient(135deg, #14c4d4, #4de3ef); }
.cat-badge.shadow { background: linear-gradient(135deg, #8b5cf6, #b07cff); }
.type-badge {
  display: inline-flex; font-size: 10.5px; font-weight: 600; font-family: "Fredoka", sans-serif;
  padding: 3px 9px; border-radius: var(--r-pill); color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}

/* ---- sprite well: category-gradient ring around the Pokémon sprite ---- */
.sprite { position: relative; flex: none; }
.sprite .ring { display: block; border-radius: 50%; padding: 2.5px; }
.sprite .well {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, var(--surface), var(--surface-2) 70%);
  overflow: hidden;
  box-shadow: inset 0 -4px 10px rgba(31, 52, 94, .10), inset 0 2px 4px rgba(255, 255, 255, .6);
}
@media (prefers-color-scheme: dark) {
  .sprite .well { box-shadow: inset 0 -4px 10px rgba(0, 0, 0, .5), inset 0 2px 3px rgba(255, 255, 255, .05); }
}
.sprite .well img {
  position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; object-fit: contain;
}
.sprite .dex {
  position: absolute; bottom: -3px; right: -3px; background: var(--surface); border: 1.5px solid var(--border);
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 10px; color: var(--muted);
  padding: 1px 6px; border-radius: var(--r-pill); box-shadow: var(--shadow-sm);
}
.sprite.s44 { width: 44px; height: 44px; } .sprite.s44 .ring { width: 44px; height: 44px; }
.sprite.s56 { width: 56px; height: 56px; } .sprite.s56 .ring { width: 56px; height: 56px; }
.sprite.s112 { width: 112px; height: 112px; } .sprite.s112 .ring { width: 112px; height: 112px; padding: 3px; }
.sprite.cat-legendary .ring { background: linear-gradient(135deg, #f6a821, #ffcb52); }
.sprite.cat-mega .ring { background: linear-gradient(135deg, #ef4a4a, #ff7a5c); }
.sprite.cat-mythical .ring { background: linear-gradient(135deg, #e0459e, #ff6fc7); }
.sprite.cat-ultra .ring { background: linear-gradient(135deg, #14c4d4, #4de3ef); }
.sprite.cat-shadow .ring { background: linear-gradient(135deg, #8b5cf6, #b07cff); }

/* ---- status pill: a real <select> skinned as a game-token pill ---- */
.pill { position: relative; display: inline-flex; align-items: center; height: 34px; min-width: 78px; }
.pill select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; border: none; }
.pill-face {
  display: inline-flex; align-items: center; gap: 7px; width: 100%; height: 100%;
  padding: 0 12px 0 11px; border-radius: var(--r-pill); font-family: "Fredoka", sans-serif;
  font-weight: 600; font-size: 12.5px; letter-spacing: .2px; border: 1.5px solid transparent;
  transition: transform .12s, box-shadow .12s; pointer-events: none;
}
.pill:hover .pill-face { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.pill-face .caret { margin-left: auto; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); opacity: .7; }
.pill[data-v="YES"] .pill-face { color: #fff; background: var(--owned); border-color: var(--owned); }
.pill[data-v="NO"] .pill-face { color: var(--missing); background: var(--missing-bg); border-color: var(--missing); }
.pill[data-v="TRADE"] .pill-face { color: #fff; background: var(--trade); border-color: var(--trade); }
.pill[data-v="RAID"] .pill-face { color: #fff; background: var(--raid); border-color: var(--raid); }
.pill[data-v="EXTRA"] .pill-face { color: #fff; background: var(--extra); border-color: var(--extra); }
.pill[data-v="NO"] .pill-dot { box-shadow: 0 0 0 3px rgba(229, 72, 77, .14); }
.pill.sm { height: 30px; min-width: 64px; }
.pill.sm .pill-face { font-size: 11.5px; padding: 0 9px; }
.pill.sm .caret { display: none; }

/* ---- filter bar ---- */
.filters {
  position: relative; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-sm); padding: 12px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.search { flex: 1 1 220px; min-width: 180px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.search input {
  width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 500;
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .18); }
.fdrop { position: relative; }
.fdrop select {
  appearance: none; padding: 10px 32px 10px 14px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
}
.fdrop::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 2px solid var(--muted-2); border-bottom: 2px solid var(--muted-2); transform: translateY(-70%) rotate(45deg);
}
.fdrop select:focus { outline: none; border-color: var(--brand); }
.owned-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; }
.owned-toggle a { padding: 7px 13px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; display: inline-block; }
.owned-toggle a.on { background: var(--text); color: var(--surface); }

/* ---- collection: per-person card list ---- */
.card-list { display: flex; flex-direction: column; gap: 9px; }
.mon-card {
  display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 11px 13px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s;
}
.mon-card:hover { box-shadow: var(--shadow); border-color: var(--border-soft); }
.mon-meta { min-width: 0; flex: 1; }
.mon-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15.5px; display: flex; align-items: center; gap: 7px; }
.mon-name .shiny { color: #ffcb52; flex: none; }
.mon-sub { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.mon-card .pill { margin-left: auto; flex: none; }

/* ---- collection: group table ---- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); overflow: auto; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; }
table.grid th, table.grid td { padding: 9px 12px; text-align: center; white-space: nowrap; }
table.grid thead th {
  position: sticky; top: 0; z-index: 5; background: var(--surface-2);
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border);
}
table.grid thead th:first-child { text-align: left; z-index: 6; }
.th-person { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mon-col { position: sticky; left: 0; z-index: 4; background: var(--surface); text-align: left !important; border-right: 1px solid var(--border); min-width: 220px; }
table.grid tbody tr:hover td { background: var(--surface-2); }
table.grid tbody tr:hover .mon-col { background: var(--surface-2); }
table.grid tbody td { border-bottom: 1px solid var(--border-soft); }
.row-mon { display: flex; align-items: center; gap: 11px; padding-left: 8px; border-left: 3px solid transparent; }
.row-mon.legendary { border-color: #f6a821; } .row-mon.mega { border-color: #ef4a4a; }
.row-mon.mythical { border-color: #e0459e; } .row-mon.ultra { border-color: #14c4d4; } .row-mon.shadow { border-color: #8b5cf6; }
.row-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.row-dex { font-size: 11px; color: var(--muted-2); font-weight: 500; }
.mark-all {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-pill);
  background: var(--brand); background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  font-family: "Fredoka", sans-serif; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-sm); border: none; cursor: pointer;
}
.mark-all.ghost { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); box-shadow: none; }
.mark-all:hover { filter: brightness(1.04); }
.mark-all svg { width: 13px; height: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 12px; flex: none;
}
.th-person .avatar { width: 32px; height: 32px; }
.th-person small { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---- Pokémon detail profile ---- */
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13px; margin-bottom: 14px; text-decoration: none; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 15px; height: 15px; }
.profile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.profile-hero { position: relative; padding: 26px 22px 20px; display: flex; gap: 20px; align-items: center; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.profile-hero::before { content: ""; position: absolute; inset: 0; opacity: .10; pointer-events: none; }
.profile.cat-legendary .profile-hero::before { background: linear-gradient(135deg, #f6a821, #ffcb52); }
.profile.cat-mega .profile-hero::before { background: linear-gradient(135deg, #ef4a4a, #ff7a5c); }
.profile.cat-mythical .profile-hero::before { background: linear-gradient(135deg, #e0459e, #ff6fc7); }
.profile.cat-ultra .profile-hero::before { background: linear-gradient(135deg, #14c4d4, #4de3ef); }
.profile.cat-shadow .profile-hero::before { background: linear-gradient(135deg, #8b5cf6, #b07cff); }
.profile-hero > * { position: relative; }
.hero-info { min-width: 0; }
.hero-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.hero-name { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 26px; }

.copy-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent; color: var(--muted-2); cursor: pointer; flex: none; padding: 0; }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { color: var(--brand); background: var(--surface-2); }
.copy-btn.copied { color: var(--owned); }
.hero-dex { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--muted-2); }
.shiny-tag {
  display: inline-flex; align-items: center; gap: 5px; font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: 11px; color: #b26f00; background: #fff4d6; border: 1px solid #ffe1a3; padding: 3px 9px; border-radius: var(--r-pill);
}
@media (prefers-color-scheme: dark) { .shiny-tag { background: #3a2e12; border-color: #5a4718; color: #ffcb52; } }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.profile-body { padding: 20px 22px 24px; }
.notes { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13.5px; color: var(--muted); margin-bottom: 22px; display: flex; gap: 9px; }
.notes svg { width: 16px; height: 16px; color: var(--muted-2); flex: none; margin-top: 1px; }
.who-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sum-chip { display: flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); padding: 7px 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.sum-chip b { font-family: "Fredoka", sans-serif; color: var(--text); font-size: 14px; }
.sum-dot { width: 9px; height: 9px; border-radius: 50%; }
.who-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.who-head h3 { font-size: 16px; font-weight: 600; }
.who-actions { display: flex; gap: 8px; }
.who-list { display: flex; flex-direction: column; gap: 8px; }
.who-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.who-row:hover { background: var(--surface-2); }
.who-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.who-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; }
.who-changed { font-size: 11px; color: var(--muted-2); font-weight: 500; }
.who-row .pill { margin-left: auto; }

@media (max-width: 560px) {
  .profile-hero { flex-direction: column; text-align: center; gap: 14px; }
  .hero-top { justify-content: center; }
  .badge-row { justify-content: center; }
  .who-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ============================================================
   v2 — Raid Rotation, Compare, Admin, Login
   ============================================================ */

/* ---- Raid Rotation ---- */
.live-bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 12px 15px; margin-bottom: 16px; flex-wrap: wrap; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--owned); position: relative; flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--owned); opacity: .35; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.7); opacity: .5; } 100% { transform: scale(2); opacity: 0; } }
.live-bar .lb-title { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; }
.live-bar .lb-meta { font-size: 12px; color: var(--muted-2); font-weight: 500; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted-2); font-weight: 500; flex-wrap: wrap; margin: 0 2px 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.tier { margin-bottom: 22px; }
.tier-head { display: flex; align-items: center; gap: 10px; padding: 8px 4px 10px; }
.tier-badge { display: inline-flex; align-items: center; gap: 6px; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 14px; }
.tier-badge .tdot { width: 11px; height: 11px; border-radius: 50%; }
.tier-stars { display: inline-flex; gap: 1px; color: var(--gold); }
.tier-stars svg { width: 13px; height: 13px; }
.tier-count { font-size: 12px; color: var(--muted-2); font-weight: 600; }
.tier-count.tier-ends { color: var(--brand); }
.tier-rule { flex: 1; height: 1px; background: var(--border); }
.raid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.raid-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.raid-card.untracked { border-style: dashed; background: transparent; box-shadow: none; }
.raid-top { display: flex; align-items: center; gap: 12px; }
.raid-info { min-width: 0; flex: 1; }
.raid-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 7px; }
.raid-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.track-chip { display: inline-flex; align-items: center; gap: 5px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 10.5px; padding: 3px 9px; border-radius: var(--r-pill); flex: none; align-self: flex-start; }
.track-chip.on { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.track-chip.off { color: var(--muted-2); background: var(--surface-2); border: 1px solid var(--border); }
.track-chip svg { width: 11px; height: 11px; }
.squad { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--border); }
.squad-cell { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px 3px 3px 4px; }
.squad-cell .avatar { width: 22px; height: 22px; font-size: 10px; }
.squad-cell .pill { height: 26px; min-width: 54px; }
.squad-cell .pill-face { font-size: 10.5px; padding: 0 8px; }
.ref-note { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted-2); padding-top: 10px; border-top: 1px dashed var(--border); }
.ref-note svg { width: 15px; height: 15px; flex: none; }

/* ---- Toast (Admin action feedback) ---- */
.toast {
  position: fixed; top: 18px; left: 50%; z-index: 100; display: flex; align-items: center; gap: 9px;
  padding: 12px 18px; border-radius: var(--r-pill); font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13.5px;
  color: #fff; background: var(--owned); box-shadow: var(--shadow-lg);
  transform: translate(-50%, 0);
  animation: toast-in .25s ease, toast-out .4s ease 3.2s forwards;
}
.toast.error { background: var(--missing); }
.toast svg { width: 16px; height: 16px; flex: none; }
@keyframes toast-in { from { transform: translate(-50%, -12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes toast-out { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -12px); opacity: 0; visibility: hidden; } }

/* ---- Events ---- */
.events-bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 11px 14px; margin-bottom: 20px; flex-wrap: wrap; }
.events-bar .eb-title { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13.5px; }
.events-bar .eb-meta { font-size: 12px; color: var(--muted-2); font-weight: 500; }

.section-head { display: flex; align-items: center; gap: 10px; margin: 6px 2px 14px; }
.section-head h2 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 9px; font-family: "Fredoka", sans-serif; }
.sh-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.section-head .n { font-size: 12px; color: var(--muted-2); font-weight: 600; }
.section-head .rule { flex: 1; height: 1px; background: var(--border); }
.event-section + .event-section { margin-top: 26px; }

.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.event-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-soft); }

.event-banner { position: relative; display: block; width: 100%; height: 110px; background-size: cover; background-position: center; background-color: var(--surface-2); }
.event-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10, 16, 30, .55)); }
.event-banner.raid { background-image: var(--ev-raid); }
.event-banner.community { background-image: var(--ev-community); }
.event-banner.spotlight { background-image: var(--ev-spotlight); }
.event-banner.season { background-image: var(--ev-season); }
.event-banner.gbl { background-image: var(--ev-gbl); }
.event-banner.event { background-image: var(--ev-event); }

.event-status {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 11.5px; padding: 5px 11px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .92); color: var(--text); box-shadow: var(--shadow-sm); backdrop-filter: blur(4px);
}
.event-status svg { width: 12px; height: 12px; }
.event-status.ending { background: var(--missing); color: #fff; }
.event-status.starting { color: var(--brand); }

.event-body { padding: 13px 14px 15px; display: flex; flex-direction: column; flex: 1; }
.event-type {
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 11px; letter-spacing: .03em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; width: fit-content;
  padding: 3px 9px 3px 7px; border-radius: var(--r-pill); color: #fff;
}
.event-type .t-dot { width: 11px; height: 11px; border-radius: 4px; background: rgba(255, 255, 255, .9); }
.event-type.raid { background: var(--ev-raid); }
.event-type.community { background: var(--ev-community); }
.event-type.spotlight { background: var(--ev-spotlight); }
.event-type.season { background: var(--ev-season); }
.event-type.gbl { background: var(--ev-gbl); }
.event-type.event { background: var(--ev-event); }

.event-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 16px; line-height: 1.25; }
.event-range { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.event-range svg { width: 13px; height: 13px; color: var(--muted-2); flex: none; }

.event-bosses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--border); }
.boss-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px 10px 3px 3px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 11.5px; color: var(--muted); }
.boss-orb { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--surface), var(--surface-2)); border: 1.5px solid var(--border); display: grid; place-items: center; flex: none; }
.boss-orb.legendary { border-color: #f6a821; } .boss-orb.mega { border-color: #ef4a4a; } .boss-orb.shadow { border-color: #8b5cf6; }
.boss-chip .shiny { color: var(--gold); }

.event-more { margin-top: auto; padding-top: 12px; display: flex; align-items: center; gap: 6px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 12px; color: var(--brand); }
.event-more svg { width: 13px; height: 13px; }

@media (max-width: 560px) {
  .event-grid { grid-template-columns: 1fr; }
}

/* ---- Compare ---- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 15px; }
.stat .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; margin-bottom: 11px; }
.stat .ico svg { width: 19px; height: 19px; }
.stat .num { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 28px; line-height: 1; }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.ico-tracked { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.ico-all { background: var(--owned); }
.ico-some { background: var(--raid); }
.ico-none { background: var(--missing); }

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 9px; }
.panel-head h3 { font-size: 15.5px; font-weight: 600; font-family: "Fredoka", sans-serif; }
.panel-head .sub { font-size: 12px; color: var(--muted-2); font-weight: 500; margin-left: auto; }
.panel-body { padding: 16px 18px 20px; }

.simple-rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.simple-rank-row:last-child { border-bottom: none; }
.simple-rank-row .rank-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; width: 6.5rem; flex: none; }
.simple-rank-row .rank-bar { flex: 1; height: 7px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.simple-rank-row .rank-bar i { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--missing), #ff8a8d); }
.simple-rank-row .rank-val { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13px; min-width: 2.4rem; text-align: right; color: var(--muted); }

.need-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.need-row:last-child { border-bottom: none; }
.need-info { flex: 1; min-width: 0; }
.need-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; }
.need-sub { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.need-count { display: inline-flex; align-items: center; gap: 6px; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13px; color: var(--missing); background: var(--missing-bg); border: 1px solid var(--missing); padding: 5px 11px; border-radius: var(--r-pill); flex: none; }

/* ---- Admin ---- */
.admin-note { font-size: 12.5px; color: var(--muted-2); margin: -6px 2px 18px; }
.admin-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 15px 16px; display: flex; align-items: center; gap: 13px; }
.admin-stat .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); flex: none; }
.admin-stat .ico svg { width: 19px; height: 19px; }
.admin-stat .num { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 22px; line-height: 1; }
.admin-stat .lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }
.admin-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-top: 22px; align-items: start; }
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.log-row:last-child { border-bottom: none; }
.log-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 5px; flex: none; }
.log-dot.fail { background: var(--missing); }
.log-text { font-size: 13.5px; color: var(--text); }
.log-time { font-size: 11.5px; color: var(--muted-2); font-weight: 500; margin-top: 2px; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.person-row:last-child { border-bottom: none; }
.person-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; }
.person-name .sub { font-family: "Inter", sans-serif; font-weight: 500; font-size: 12px; color: var(--muted-2); margin-left: 4px; }
.person-row.off .person-name { color: var(--muted-2); }
.status-tag { font-size: 10.5px; font-weight: 600; font-family: "Fredoka", sans-serif; padding: 2px 8px; border-radius: var(--r-pill); }
.status-tag.active { color: var(--owned); background: var(--owned-bg); }
.status-tag.inactive { color: var(--muted-2); background: var(--surface-2); border: 1px solid var(--border); }
.status-tag.admin { color: var(--extra); background: var(--extra-bg); }

/* ---- Friendships ---- */
.friend-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.friend-section .panel-head { gap: 10px; }
.friend-list { display: flex; flex-direction: column; gap: 8px; }
.friend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); flex-wrap: wrap; }
.friend-who { display: flex; align-items: center; gap: 8px; flex: 1 1 120px; min-width: 0; }
.friend-names { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-controls { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.friend-badge { font-size: 10.5px; font-weight: 600; font-family: "Fredoka", sans-serif; padding: 3px 10px; border-radius: var(--r-pill); flex: none; white-space: nowrap; }
.friend-badge.level-new { color: var(--muted-2); background: var(--surface-2); border: 1px solid var(--border); }
.friend-badge.level-good { color: var(--trade); background: var(--trade-bg); }
.friend-badge.level-great { color: var(--brand); background: var(--you-bg); }
.friend-badge.level-ultra { color: var(--extra); background: var(--extra-bg); }
.friend-badge.level-best { color: var(--gold); background: var(--raid-bg); }
.friend-badge.level-forever { color: #fff; background: linear-gradient(135deg, #e0459e, #ff6fc7); }
.friend-select { padding: 5px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 600; font-family: "Fredoka", sans-serif; cursor: pointer; flex: none; }

/* ---- Trade Matches ---- */
.trade-list { display: flex; flex-direction: column; gap: 14px; }
.trade-match { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; }
.trade-mon { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.trade-mon-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; }
.trade-mon-name:hover { color: var(--brand); }
.trade-pairs { display: flex; flex-direction: column; gap: 6px; }
.trade-pair { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: var(--r-sm); background: var(--surface-2); flex-wrap: wrap; }
.trade-pair .avatar { width: 24px; height: 24px; font-size: 11px; }
.trade-arrow-icon { width: 13px; height: 13px; color: var(--muted-2); flex: none; }
.trade-names { font-size: 12.5px; font-weight: 500; color: var(--text); margin-right: auto; }
.trade-cost {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; font-family: "Fredoka", sans-serif;
  padding: 3px 10px; border-radius: var(--r-pill); flex: none; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); white-space: nowrap;
}
.trade-cost svg { width: 11px; height: 11px; color: var(--gold); }
.trade-cost.cheap { color: var(--owned); background: var(--owned-bg); border-color: transparent; }
.trade-cost.pricey { color: var(--missing); background: var(--missing-bg); border-color: transparent; }
.trade-cost.blocked { color: var(--muted-2); }
.trade-cost.blocked svg { display: none; }

/* ---- Shiny toggle (per-trainer, distinct from the species-level "can be shiny" star) ---- */
.shiny-toggle {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px;
  border-radius: var(--r-pill); border: 1.5px solid var(--gold); background: var(--surface-2); color: var(--gold);
  cursor: pointer; flex: none; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 11px; white-space: nowrap;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.shiny-toggle svg { width: 13px; height: 13px; flex: none; }
.shiny-toggle:hover { background: var(--gold); color: #fff; }
.shiny-toggle.on { color: #fff; background: linear-gradient(135deg, var(--gold), #ffcb52); border-color: transparent; }
.p-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mini-btn { padding: 5px 11px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.mini-btn:hover { color: var(--text); }
.mini-form { display: inline-flex; align-items: center; gap: 6px; }
.mini-form input[type=text] { padding: 5px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; width: 8rem; }
.mini-form select { padding: 5px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; font-family: "Fredoka", sans-serif; cursor: pointer; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.v2-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.v2-btn svg { width: 15px; height: 15px; }
.v2-btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow-sm); border: none; }
.v2-btn.ghost { background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.add-trainer-form { display: flex; gap: 8px; margin-top: 14px; }
.add-trainer-form input { flex: 1; padding: 9px 13px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13px; }

/* ---- Login ---- */
.login-wrap { display: flex; min-height: 72vh; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 38px 32px 30px; text-align: center; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; top: -60px; left: 50%; transform: translateX(-50%); width: 220px; height: 220px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); opacity: .10; filter: blur(10px); }
.login-mark { width: 62px; height: 62px; border-radius: 18px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; margin: 0 auto 16px; box-shadow: var(--shadow); position: relative; }
.login-mark svg { width: 34px; height: 34px; }
.login-card h2 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 26px; position: relative; margin: 0; }
.login-card h2 span { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-tag { font-size: 13.5px; color: var(--muted); margin: 6px 0 24px; position: relative; }
.login-field { position: relative; margin-bottom: 12px; }
.login-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); }
.login-field input { width: 100%; padding: 13px 14px 13px 40px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: 14px; }
.login-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .18); }
.login-btn { width: 100%; padding: 13px; border: none; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; box-shadow: var(--shadow-sm); position: relative; cursor: pointer; }
.login-btn:hover { filter: brightness(1.04); }
.login-error { color: var(--missing); font-size: 13px; margin-bottom: 12px; }
.login-foot { font-size: 11.5px; color: var(--muted-2); margin-top: 18px; position: relative; }

@media (max-width: 900px) {
  .compare-grid { grid-template-columns: 1fr; }
  .admin-cols { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .raid-grid { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .stat-row { grid-template-columns: 1fr; }
}
