:root {
  --bg: #07070a;
  --bg-2: #0d0d12;
  --panel: rgba(20, 18, 14, .72);
  --panel-solid: #121014;
  --line: rgba(245, 197, 24, .16);
  --line-strong: rgba(245, 197, 24, .45);
  --gold: #f5c518;
  --gold-hi: #ffe680;
  --gold-lo: #b8860b;
  --gold-grad: linear-gradient(180deg, #fff4b8 0%, #ffd84a 38%, #e8a90c 70%, #a86f05 100%);
  /* gold lettering is one flat colour: gradient-clipped text rendered with a dark lower half on phones */
  --gold-bright: #ffd84a;
  --gold-glow: 0 0 18px rgba(255, 196, 40, .35);
  --text: #f3eee2;
  --muted: #9a9384;
  --dim: #5c5649;
  --up: #4ade80;
  --down: #f87171;
  --bronze: #cd7f32;
  --silver: #c9d1d9;
  --legend: #ff5ef0;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .55);
  --display: "Rajdhani", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(245, 197, 24, .14), transparent 60%),
    radial-gradient(800px 600px at 100% 40%, rgba(184, 134, 11, .07), transparent 60%),
    radial-gradient(700px 500px at 0% 80%, rgba(184, 134, 11, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
#embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
main, .footer, .nav { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.gold-text {
  color: var(--gold-bright);
  text-shadow: var(--gold-glow);
}
.eyebrow {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
}
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: .02em; }
h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1; text-transform: uppercase; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold {
  background: var(--gold-grad);
  color: #1a1203;
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(245, 197, 24, .25), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-gold:hover { box-shadow: 0 8px 32px rgba(245, 197, 24, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-ghost:hover { background: rgba(245, 197, 24, .08); }
.btn-danger { border-color: rgba(248, 113, 113, .5); color: var(--down); }
.btn-danger:hover { background: rgba(248, 113, 113, .1); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--gold); border-color: var(--line-strong); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(7, 7, 10, .6);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-color: var(--line); background: rgba(7, 7, 10, .85); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; letter-spacing: .18em; font-size: 18px; }
.brand img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.brand-crest {
  width: 38px; height: 38px; overflow: hidden; flex-shrink: 0;
  mask-image: radial-gradient(closest-side at 50% 46%, #000 60%, transparent 88%);
  -webkit-mask-image: radial-gradient(closest-side at 50% 46%, #000 60%, transparent 88%);
}
.brand-crest img { width: 100%; height: 100%; transform: scale(1.8); transform-origin: 50% 33%; }
.brand > span:last-child { filter: drop-shadow(0 0 10px rgba(255, 200, 60, .25)); }
.brand > span:last-child { color: var(--gold-bright); text-shadow: var(--gold-glow); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 14px;
  color: var(--muted); position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--gold-grad); transform: scaleX(0); transition: transform .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--display); font-weight: 700; letter-spacing: .2em; font-size: 12px;
  color: var(--up); padding: 5px 10px; border-radius: 99px; border: 1px solid rgba(74, 222, 128, .3);
  background: rgba(74, 222, 128, .06);
}
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: ping 1.6s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.nav-toggle { display: none; width: 40px; height: 40px; background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-toggle span { width: 18px; height: 2px; background: var(--gold); border-radius: 2px; }

/* ---------- masthead ---------- */
.masthead {
  position: relative; z-index: 1;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(245, 197, 24, .06), transparent);
}
.masthead-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 48px);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px;
}
/* zoom in on the lion (dropping the baked-in wordmark) and fade the square edges into the page */
.crest {
  width: 104px; height: 104px; overflow: hidden;
  mask-image: radial-gradient(closest-side at 50% 46%, #000 60%, transparent 88%);
  -webkit-mask-image: radial-gradient(closest-side at 50% 46%, #000 60%, transparent 88%);
}
.crest img { width: 100%; height: 100%; transform: scale(1.8); transform-origin: 50% 33%; }
.masthead h1 { font-size: clamp(40px, 5.5vw, 62px); line-height: .95; letter-spacing: .08em; }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 460px; }
.stat-strip {
  display: grid; grid-template-columns: repeat(4, minmax(92px, auto));
  margin: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); overflow: hidden;
}
.stat-strip div { padding: 14px 18px; border-left: 1px solid var(--line); }
.stat-strip div:first-child { border-left: 0; }
.stat-strip dt { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.stat-strip dd {
  margin: 4px 0 0; font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1;
  color: var(--gold-bright); text-shadow: var(--gold-glow);
}

/* ---------- views ---------- */
.views { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 34px clamp(16px, 4vw, 48px) 64px; }
.view { animation: viewIn .3s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.view-head h2 + .hint { margin-top: 6px; }
.updated { color: var(--muted); font-size: 13px; margin: 0; }
.updated b { color: var(--gold); font-weight: 600; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- welcome ---------- */
body[data-view="welcome"] .masthead { display: none; }
.welcome { max-width: 1040px; margin: 0 auto; }
.welcome-hero { text-align: center; padding: 18px 0 34px; }
.crest-lg { width: 180px; height: 180px; margin: 0 auto 6px; filter: drop-shadow(0 0 28px rgba(245, 197, 24, .3)); }
.welcome-hero h1 { font-size: clamp(54px, 10vw, 112px); line-height: .9; letter-spacing: .08em; text-shadow: 0 0 28px rgba(255, 196, 40, .4); }
.motto-line {
  margin: 14px 0 0;
  font-family: var(--display); font-weight: 600; font-size: clamp(16px, 2.2vw, 22px);
  letter-spacing: .2em; text-transform: uppercase; color: var(--text);
}
.welcome-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.pillars {
  list-style: none; margin: 0 0 28px; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden;
}
.pillars li {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 8px;
  border-left: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
}
.pillars li:first-child { border-left: 0; }
.pillar-icon { width: 26px; height: 26px; color: var(--gold); }
.pillar-icon svg { width: 100%; height: 100%; }

.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.welcome-card { padding: 26px 28px; }
.welcome-card h2 { font-size: 24px; margin-bottom: 14px; }
.welcome-card p { margin: 0 0 14px; color: #d8d2c4; line-height: 1.7; }
.welcome-card p:last-child { margin-bottom: 0; }
.code-card { border-color: var(--line-strong); background: linear-gradient(180deg, rgba(245, 197, 24, .07), var(--panel)); }
.code-list { list-style: none; counter-reset: code; margin: 0; padding: 0; }
.code-list li {
  counter-increment: code;
  display: flex; gap: 14px; align-items: baseline;
  padding: 11px 0; border-top: 1px solid var(--line);
  font-weight: 500;
}
.code-list li::before {
  content: counter(code, upper-roman);
  flex: 0 0 26px;
  font-family: var(--display); font-weight: 700; color: var(--gold);
}

.welcome-close { text-align: center; padding: 44px 0 10px; }
.welcome-close p { margin: 0 0 8px; color: var(--muted); font-size: 16px; }
.welcome-close strong { font-family: var(--display); font-size: clamp(28px, 4.5vw, 46px); letter-spacing: .06em; text-transform: uppercase; }

.gicon {
  position: relative;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .02em;
  color: #1a1203;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 70%, #fff 30%), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.gicon svg { width: 24px; height: 24px; }

/* ---------- inputs ---------- */
input, select {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  min-width: 0;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 197, 24, .15); }
select option { background: var(--panel-solid); }

/* ---------- avatar ---------- */
.avatar {
  --c: var(--gold);
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 24px;
  color: #120d02;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 55%, #fff 45%), var(--c));
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px color-mix(in srgb, var(--c) 60%, transparent);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 40px; height: 40px; font-size: 16px; }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; box-shadow: 0 0 0 2px var(--panel-solid); }

/* ---------- games ---------- */
.game-chips { margin-bottom: 20px; }
#gameSearch { width: 220px; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.games-grid.single { grid-template-columns: minmax(0, 720px); }
.game-card { position: relative; overflow: hidden; }
.game-card::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 2; height: 3px; background: var(--accent); }
/* game logo banner on top, title row underneath */
.gc-banner { position: relative; height: 150px; overflow: hidden; background: #000; }
.gc-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.games-grid.single .gc-banner { height: 260px; }
.gc-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.gc-head h3 { font-size: 20px; text-transform: uppercase; letter-spacing: .04em; }
.gc-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.gc-list { list-style: none; margin: 0; padding: 6px 0; }
.gr { display: flex; align-items: center; gap: 12px; padding: 9px 18px; cursor: pointer; transition: background .2s, opacity .2s; }
.gr:hover { background: rgba(245, 197, 24, .05); }
.gr-n { width: 24px; flex-shrink: 0; text-align: center; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--muted); }
.gr.r1 { background: linear-gradient(90deg, rgba(245, 197, 24, .09), transparent 70%); }
.gr.r1 .gr-n { color: var(--gold); }
.gr.r2 .gr-n { color: var(--silver); }
.gr.r3 .gr-n { color: var(--bronze); }
.gr-who { flex: 1; min-width: 0; }
.gr-who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-who small { display: block; color: var(--muted); font-size: 11px; }
.gr-note {
  flex-shrink: 0; max-width: 45%; padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--line); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gr.dim { opacity: .3; }
.gr.hit { background: rgba(245, 197, 24, .12); }
.gc-empty { margin: 0; padding: 22px 18px; color: var(--muted); font-size: 13px; }
.game-card.flash { animation: cardFlash 1.6s ease-out; }
@keyframes cardFlash { 0% { box-shadow: 0 0 0 2px var(--gold), 0 0 40px rgba(245, 197, 24, .35); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* roster: which games each member is ranked in */
.gchips { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.gchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .06em; color: var(--muted);
}
.gchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.gchip b { color: var(--text); }
.gchip.top b { color: var(--gold-hi); }
.gchip.none { font-family: var(--body); letter-spacing: 0; }

/* admin rankings editor */
.rank-editor { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rank-editor li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }
.rank-editor li:first-child { border-top: 0; }
.rk-n { width: 22px; flex-shrink: 0; text-align: center; font-family: var(--display); font-weight: 700; color: var(--gold); }
.rk-name { flex: 1 1 auto; min-width: 50px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-note { flex: 0 1 130px; width: 130px; padding: 6px 8px; font-size: 13px; }
.rank-editor button {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(245, 197, 24, .05); color: var(--gold); cursor: pointer; font-size: 11px;
}
.rank-editor button:hover:not(:disabled) { border-color: var(--gold); }
.rank-editor button:disabled { opacity: .3; cursor: default; }
.rank-editor button.del { color: var(--muted); }
.rank-editor button.del:hover { color: var(--down); border-color: var(--down); }
.rank-editor .rk-empty { padding: 16px 12px; color: var(--muted); font-size: 13px; }
.rank-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.pm-game-sub { margin: 0; color: var(--muted); font-size: 13px; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }

/* ---------- achievements ---------- */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 99px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { color: #1a1203; background: var(--gold-grad); border-color: transparent; }
.ach-group { --t: var(--gold); }
.ach-group + .ach-group { margin-top: 32px; }
.ach-group.bronze { --t: var(--bronze); }
.ach-group.silver { --t: var(--silver); }
.ach-group.legend { --t: var(--legend); }
.ach-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ach-group-head h3 { font-size: 15px; letter-spacing: .22em; text-transform: uppercase; color: var(--t); }
.ach-group-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ach-group-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ach {
  --t: var(--gold);
  position: relative;
  padding: 22px 18px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.ach.bronze { --t: var(--bronze); }
.ach.silver { --t: var(--silver); }
.ach.gold { --t: var(--gold); }
.ach.legend { --t: var(--legend); }
.ach::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(200px 120px at 50% 0%, color-mix(in srgb, var(--t) 22%, transparent), transparent 70%);
}
.ach:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--t) 60%, transparent); box-shadow: 0 16px 40px color-mix(in srgb, var(--t) 18%, transparent); }
.ach.locked { filter: grayscale(1); opacity: .45; }
.ach.locked:hover { opacity: .7; }
.medal {
  position: relative;
  width: 64px; height: 64px; margin-bottom: 14px;
  display: grid; place-items: center;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: linear-gradient(145deg, color-mix(in srgb, var(--t) 50%, #fff 50%), var(--t) 55%, color-mix(in srgb, var(--t) 60%, #000 40%));
  color: #140f04;
}
.medal svg { width: 28px; height: 28px; }
.ach.legend .medal, .pm-badge.legend .medal {
  background: linear-gradient(135deg, #fff6c9, #ffd84a 25%, #ff9a3c 50%, #ff5ef0 75%, #ffd84a);
  background-size: 300% 300%;
  animation: legend 4s ease-in-out infinite;
}
@keyframes legend { 50% { background-position: 100% 100%; } }
.ach h4 { position: relative; margin: 0 0 4px; font-family: var(--display); font-size: 19px; letter-spacing: .03em; }
.ach p { position: relative; margin: 0; color: var(--muted); font-size: 13px; min-height: 2.6em; }
.ach .meta { position: relative; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 8px; }
.ach .tier { font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--t); }
.ach .gbadge { position: absolute; top: 14px; right: 14px; font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.holders { display: flex; align-items: center; }
.holders .avatar { margin-left: -8px; }
.holders .avatar:first-child { margin-left: 0; }
.holders .more { margin-left: 6px; font-size: 12px; color: var(--muted); }
.ach.new { animation: unlock 1.4s cubic-bezier(.2, .8, .2, 1); }
@keyframes unlock { 0% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(245, 197, 24, .8); } 40% { transform: scale(1.04); } 100% { transform: none; box-shadow: 0 0 0 30px rgba(245, 197, 24, 0); } }

/* ---------- roster ---------- */
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pcard {
  --c: var(--gold);
  position: relative;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s, border-color .25s;
}
.pcard::before {
  content: ""; position: absolute; top: -60px; right: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%);
}
.pcard:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.pcard .top { position: relative; display: flex; align-items: center; gap: 14px; }
.pcard h4 { margin: 0; font-family: var(--display); font-size: 22px; }
.pcard .role { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.pcard .motto { position: relative; color: var(--muted); font-size: 13px; font-style: italic; margin: 12px 0 0; min-height: 1.5em; }
.pcard .nrank { position: absolute; top: 16px; right: 18px; font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--dim); }
.pcard .nrank.top { color: var(--gold); }
.pcard .bar { position: relative; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); margin: 16px 0 6px; overflow: hidden; }
.pcard .bar i { position: absolute; inset: 0 auto 0 0; background: var(--gold-grad); border-radius: 6px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.pcard .foot { position: relative; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.pcard .foot b { color: var(--text); font-family: var(--display); font-size: 15px; }
.pcard .games { position: relative; display: flex; gap: 5px; margin-top: 12px; flex-wrap: wrap; }
.pcard .games span { width: 26px; height: 26px; border-radius: 7px; font-size: 9px; }
.pcard .kpis { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pcard .kpis small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pcard .kpis b { font-family: var(--display); font-size: 17px; }

/* ---------- feed ---------- */
.feed { list-style: none; margin: 0; padding: 6px 0; max-height: 440px; overflow-y: auto; }
.feed li { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); animation: slideIn .5s ease-out; }
.feed li:first-child { border-top: 0; }
.feed li .gicon { width: 34px; height: 34px; border-radius: 9px; font-size: 11px; flex-shrink: 0; }
.feed li p { margin: 0; flex: 1; min-width: 0; }
.feed li p b { color: var(--gold-hi); }
.feed li time { color: var(--dim); font-size: 12px; white-space: nowrap; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px); } }
.feed.compact { max-height: none; overflow: visible; padding: 0; }
.feed.compact li { padding: 9px 0; gap: 10px; align-items: flex-start; }
.feed.compact li .gicon { display: none; }
.feed.compact li p { font-size: 13px; line-height: 1.45; }
.feed.compact li time { font-size: 11px; padding-top: 2px; }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 1; text-align: center; padding: 26px 16px 34px; border-top: 1px solid var(--line); color: var(--muted); }
.footer .credits { margin-top: 8px; font-family: var(--body); letter-spacing: 0; font-size: 11px; color: var(--dim); }
.footer .credits a { text-decoration: underline; }
.footer p { margin: 0; font-family: var(--display); letter-spacing: .1em; }

/* ---------- modal ---------- */
.modal, .drawer { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop, .drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal-panel {
  position: relative;
  width: min(860px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  margin: 24px auto;
  background: linear-gradient(180deg, #17140d, var(--panel-solid) 240px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow), 0 0 80px rgba(245, 197, 24, .1);
  animation: pop .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.modal-x { position: absolute; top: 16px; right: 16px; z-index: 2; }
.pm-hero { display: flex; align-items: center; gap: 22px; padding: 32px 32px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pm-hero .avatar { width: 104px; height: 104px; font-size: 40px; }
.pm-hero h3 { font-size: 40px; line-height: 1; }
.pm-hero .role { color: var(--gold); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; }
.pm-hero .motto { color: var(--muted); font-style: italic; margin: 6px 0 0; }
.uid-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 6px 8px 6px 12px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: rgba(245, 197, 24, .06);
  font-size: 11px; letter-spacing: .12em; color: var(--muted); cursor: pointer;
}
.uid-chip b { color: var(--text); letter-spacing: .02em; font-size: 13px; font-variant-numeric: tabular-nums; user-select: all; }
.uid-chip span { padding: 3px 9px; border-radius: 99px; background: var(--gold-grad); color: #1a1203; font-weight: 700; letter-spacing: .06em; }
.uid-chip:hover { border-color: var(--gold); }
.pm-kpis { margin-left: auto; display: flex; gap: 22px; }
.pm-kpis div { text-align: center; }
.pm-kpis b { display: block; font-family: var(--display); font-size: 30px; line-height: 1; color: var(--gold-bright); text-shadow: var(--gold-glow); }
.pm-kpis span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pm-body { padding: 24px 32px 32px; }
.pm-body h5 { margin: 0 0 12px; font-family: var(--display); font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.pm-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 26px; }
.pm-game { --accent: var(--gold); padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.pm-game .gh { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pm-game .gh .gicon { width: 34px; height: 34px; font-size: 11px; border-radius: 9px; }
.pm-game .gh b { font-family: var(--display); font-size: 16px; flex: 1; }
.pm-game .gh em { font-style: normal; font-family: var(--display); font-weight: 700; color: var(--gold); }
.pm-game dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.pm-game dt { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pm-game dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pm-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.pm-badge { --t: var(--gold); display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--t) 40%, transparent); background: color-mix(in srgb, var(--t) 8%, transparent); }
.pm-badge.bronze { --t: var(--bronze); } .pm-badge.silver { --t: var(--silver); } .pm-badge.legend { --t: var(--legend); }
.pm-badge .medal { width: 32px; height: 32px; margin: 0; }
.pm-badge .medal svg { width: 15px; height: 15px; }
.pm-badge b { font-size: 13px; }

.pin-panel { width: min(400px, calc(100% - 32px)); margin-top: 18vh; padding: 32px 28px 28px; display: flex; flex-direction: column; gap: 14px; }
.pin-panel h3 { font-size: 30px; text-transform: uppercase; }
.pin-error { margin: 0; color: var(--down); font-size: 13px; }
.live-pill.off { color: var(--muted); border-color: var(--line); background: transparent; }
.live-pill.off i { background: var(--dim); animation: none; }

/* ---------- drawer ---------- */
.drawer-head-actions { display: flex; align-items: center; gap: 10px; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(480px, 100%);
  background: var(--panel-solid);
  border-left: 1px solid var(--line-strong);
  display: flex; flex-direction: column;
  animation: slideL .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slideL { from { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 24px; text-transform: uppercase; color: var(--gold-bright); text-shadow: var(--gold-glow); }
.drawer-tabs { display: flex; border-bottom: 1px solid var(--line); }
.drawer-tabs button {
  flex: 1; padding: 13px 6px; background: none; border: 0; border-bottom: 2px solid transparent;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); cursor: pointer;
}
.drawer-tabs button.active { color: var(--gold); border-color: var(--gold); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.row2 > *, .field-grid > * { min-width: 0; }
label input, label select { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); font-size: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#statsForm .row2 { margin-bottom: 16px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.num-wrap { display: flex; gap: 4px; }
.num-wrap input { flex: 1; width: 100%; }
.num-wrap button { width: 34px; border-radius: 8px; border: 1px solid var(--line); background: rgba(245, 197, 24, .06); color: var(--gold); cursor: pointer; font-weight: 700; }
.num-wrap button:hover { border-color: var(--gold); }
.form-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.form-actions:only-child, .stack .form-actions { justify-content: flex-end; }
input[type=color] { padding: 4px; height: 42px; cursor: pointer; }
.mini-list { list-style: none; padding: 0; margin: 22px 0 0; border-top: 1px solid var(--line); }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-list li > span:not(.avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list li small { color: var(--muted); }
.mini-list button { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.mini-list button:hover { color: var(--gold); border-color: var(--gold); }
.mini-list button.del:hover { color: var(--down); border-color: var(--down); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 6px 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: calc(100% - 40px); }
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: rgba(18, 16, 20, .95); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); max-width: 380px;
  animation: toastIn .4s cubic-bezier(.2, .8, .2, 1);
}
.toast.out { animation: toastOut .3s forwards; }
.toast .medal { width: 34px; height: 34px; margin: 0; flex-shrink: 0; }
.toast .medal svg { width: 16px; height: 16px; }
.toast p { margin: 0; font-size: 14px; }
.toast p small { display: block; color: var(--muted); font-size: 12px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-20px); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .masthead-inner { grid-template-columns: auto minmax(0, 1fr); }
  .stat-strip { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(7, 7, 10, .97); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .nav-links.open { max-height: 300px; }
  .nav-links a { padding: 14px 20px; border-top: 1px solid var(--line); }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
  .live-pill { display: none; }
  .masthead-inner { gap: 14px 16px; padding-top: 20px; padding-bottom: 20px; }
  .crest { width: 68px; height: 68px; }
  .masthead .eyebrow { letter-spacing: .2em; font-size: 10px; }
  .tagline { font-size: 13px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip div { padding: 12px 14px; }
  .stat-strip div:nth-child(3) { border-left: 0; }
  .stat-strip div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat-strip dd { font-size: 22px; }
  .views { padding-top: 26px; }
  .crest-lg { width: 130px; height: 130px; }
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pillars li { font-size: 12px; letter-spacing: .12em; padding: 14px 4px; }
  .pillars li:nth-child(4) { border-left: 0; }
  .pillars li:nth-child(n+4) { border-top: 1px solid var(--line); }
  .welcome-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome-card { padding: 22px 20px; }
  #gameSearch { width: 100%; }
  .games-grid { grid-template-columns: minmax(0, 1fr); }
  .gicon { width: 38px; height: 38px; font-size: 12px; }
  .rk-note { flex-basis: 96px; width: 96px; }
  .rank-add { grid-template-columns: 1fr auto; }
  .rank-add select { grid-column: 1 / -1; }
  .pm-hero { padding: 26px 20px 20px; }
  .pm-hero .avatar { width: 76px; height: 76px; font-size: 30px; }
  .pm-hero h3 { font-size: 30px; }
  .pm-kpis { margin-left: 0; width: 100%; justify-content: space-around; }
  .pm-body { padding: 20px; }
  .row2, .field-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
