/* ══════════════════════════════════════════════════════════════
   MeowPrac — design system
   ══════════════════════════════════════════════════════════════ */

:root{
  --violet:#a855f7; --pink:#f472b6; --amber:#fbbf24; --cyan:#22d3ee;
  --brand-grad: linear-gradient(115deg,#c084fc 0%,#f472b6 48%,#fbbf24 100%);
  --brand-grad-2: linear-gradient(115deg,#818cf8 0%,#c084fc 50%,#f472b6 100%);

  --bg:#08070d;
  --bg-soft:#0d0b16;
  --surface:rgba(255,255,255,.042);
  --surface-2:rgba(255,255,255,.07);
  --surface-3:rgba(255,255,255,.11);
  --stroke:rgba(255,255,255,.09);
  --stroke-2:rgba(255,255,255,.16);
  --text:#f4f2f9;
  --text-2:#b9b3cc;
  --muted:#837c99;

  --r-sm:10px; --r:16px; --r-lg:22px; --r-xl:30px; --r-pill:999px;
  --sh-1:0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  --sh-2:0 24px 60px -24px rgba(0,0,0,.85), 0 2px 8px rgba(0,0,0,.35);
  --glow:0 0 0 1px rgba(192,132,252,.35), 0 12px 40px -12px rgba(168,85,247,.55);

  --wrap:1220px;
  --header-h:66px;
  --ease:cubic-bezier(.22,1,.36,1);
  --ease-out:cubic-bezier(.16,1,.3,1);
  --font-d:"Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-b:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-m:"JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

[data-theme="light"]{
  --bg:#f6f4fb; --bg-soft:#ffffff;
  --surface:rgba(255,255,255,.72);
  --surface-2:rgba(255,255,255,.9);
  --surface-3:rgba(17,12,34,.07);
  --stroke:rgba(20,14,45,.1);
  --stroke-2:rgba(20,14,45,.18);
  --text:#17122b; --text-2:#4b4463; --muted:#77708f;
  --sh-1:0 1px 2px rgba(40,25,80,.06), 0 10px 30px -18px rgba(40,25,80,.4);
  --sh-2:0 30px 70px -34px rgba(40,25,80,.45), 0 2px 10px rgba(40,25,80,.06);
  --glow:0 0 0 1px rgba(168,85,247,.3), 0 14px 40px -16px rgba(168,85,247,.5);
}

*,*::before,*::after{box-sizing:border-box}
/* .btn and friends set display, which would otherwise beat the UA
   [hidden] rule and leave toggled-off elements on screen. */
[hidden]{display:none !important}
html{scroll-behavior:smooth; -webkit-text-size-adjust:100%}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto} *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

body{
  margin:0; min-height:100dvh;
  font-family:var(--font-b); font-size:16px; line-height:1.6;
  color:var(--text); background:var(--bg);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
body.no-scroll{overflow:hidden}

h1,h2,h3,h4{font-family:var(--font-d);margin:0;line-height:1.12;letter-spacing:-.025em;font-weight:700}
p{margin:0}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
button,input,select,textarea{font:inherit;color:inherit}
code,kbd{font-family:var(--font-m);font-size:.86em}
::selection{background:rgba(192,132,252,.35)}

.wrap{width:100%;max-width:var(--wrap);margin-inline:auto;padding-inline:22px}
.wrap.narrow{max-width:900px}

:focus-visible{outline:2px solid var(--pink);outline-offset:3px;border-radius:6px}

/* The brand gradient is tuned for a dark ground; on white its light
   stops drop below readable contrast, so light mode gets a deeper ramp. */
[data-theme="light"] .brand-text b{
  background:linear-gradient(115deg,#6d28d9 0%,#a21caf 52%,#b45309 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
[data-theme="light"] .stat b,
[data-theme="light"] .ob-rank{
  background:linear-gradient(115deg,#5b21b6 0%,#86198f 52%,#92400e 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}

/* ── ambient background ───────────────────────────────────── */
.aurora{position:fixed;inset:0;z-index:-2;overflow:hidden;pointer-events:none;background:var(--bg)}
.blob{position:absolute;border-radius:50%;filter:blur(90px);opacity:.5;will-change:transform}
.b1{width:52vw;height:52vw;min-width:380px;min-height:380px;background:radial-gradient(circle,#7c3aed,transparent 68%);top:-16vw;left:-10vw;animation:float1 26s var(--ease) infinite alternate}
.b2{width:46vw;height:46vw;min-width:340px;min-height:340px;background:radial-gradient(circle,#db2777,transparent 68%);top:24vh;right:-14vw;opacity:.38;animation:float2 32s var(--ease) infinite alternate}
.b3{width:40vw;height:40vw;min-width:300px;min-height:300px;background:radial-gradient(circle,#0891b2,transparent 68%);bottom:-14vw;left:26vw;opacity:.3;animation:float3 38s var(--ease) infinite alternate}
[data-theme="light"] .blob{opacity:.3;filter:blur(110px)}
@keyframes float1{to{transform:translate3d(9vw,7vh,0) scale(1.14)}}
@keyframes float2{to{transform:translate3d(-11vw,-9vh,0) scale(1.2)}}
@keyframes float3{to{transform:translate3d(7vw,-11vh,0) scale(1.1)}}

.grid-overlay{
  position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.5;
  background-image:linear-gradient(rgba(255,255,255,.028) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.028) 1px,transparent 1px);
  background-size:64px 64px;
  mask-image:radial-gradient(ellipse 90% 60% at 50% 0%,#000 20%,transparent 78%);
}
[data-theme="light"] .grid-overlay{background-image:linear-gradient(rgba(40,25,80,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(40,25,80,.05) 1px,transparent 1px)}

/* ── header ───────────────────────────────────────────────── */
.site-header{
  position:sticky;top:0;z-index:90;
  /* Explicit height so the token includes the bottom border. Without this
     the header renders 1px taller than --header-h and the sticky mode bar
     below it visibly jumps as soon as it engages. */
  height:var(--header-h);
  background:color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter:blur(18px) saturate(160%); -webkit-backdrop-filter:blur(18px) saturate(160%);
  border-bottom:1px solid transparent; transition:border-color .3s,background .3s;
}
.site-header.scrolled{border-bottom-color:var(--stroke);box-shadow:0 10px 30px -24px #000}
.header-inner{height:100%;display:flex;align-items:center;gap:20px}

.brand{display:flex;align-items:center;gap:10px;font-family:var(--font-d);font-weight:700;font-size:18px;letter-spacing:-.03em;flex:none}
/* The gradient tile never moves — only the paw glyph turns inside it, so
   hovering cannot nudge the wordmark sideways. */
.brand-mark{
  width:36px;height:36px;display:grid;place-items:center;border-radius:12px;color:#fff;
  background:var(--brand-grad);box-shadow:0 6px 18px -6px rgba(192,132,252,.8);
}
.brand-mark svg{transform-origin:50% 50%;transition:transform .45s var(--ease)}
.brand:hover .brand-mark svg{transform:rotate(-10deg) scale(1.1)}
.brand-mark.sm{width:30px;height:30px;border-radius:10px}
.brand-text b{font-weight:700;background:var(--brand-grad);-webkit-background-clip:text;background-clip:text;color:transparent}

.nav{display:flex;gap:4px;margin-left:14px}
.nav a{
  padding:8px 14px;border-radius:var(--r-pill);font-size:14.5px;font-weight:500;color:var(--text-2);
  transition:color .2s,background .2s;position:relative;white-space:nowrap;
}
.nav a:hover{color:var(--text);background:var(--surface)}
.nav a.active{color:var(--text);background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--stroke)}

.header-actions{margin-left:auto;display:flex;align-items:center;gap:9px}
.nav a{flex:none}
@media (max-width:1000px){
  .nav a{padding:8px 11px;font-size:13.5px}
}

.mini-search{
  display:flex;align-items:center;gap:9px;height:38px;padding:0 9px 0 13px;flex:none;
  background:var(--surface);border:1px solid var(--stroke);border-radius:var(--r-pill);
  color:var(--muted);font-size:14px;cursor:pointer;white-space:nowrap;
  transition:border-color .2s,background .2s,color .2s;
}
.mini-search:hover{border-color:var(--stroke-2);color:var(--text-2);background:var(--surface-2)}
.mini-search span{margin-right:6px}
kbd{
  font-family:var(--font-m);font-size:11px;padding:3px 7px;border-radius:6px;
  background:var(--surface-3);border:1px solid var(--stroke);color:var(--muted);line-height:1;
}
[data-theme="light"] kbd{background:rgba(20,14,45,.06)}

.icon-btn{
  width:38px;height:38px;display:grid;place-items:center;border-radius:12px;cursor:pointer;
  background:var(--surface);border:1px solid var(--stroke);color:var(--text-2);
  transition:background .2s,color .2s,transform .2s,border-color .2s;
}
.icon-btn:hover{background:var(--surface-2);color:var(--text);transform:translateY(-1px);border-color:var(--stroke-2)}
.icon-btn.sm{width:33px;height:33px;border-radius:10px}
.icon-btn.tiny{width:30px;height:30px;border-radius:9px}
.icon-btn[aria-pressed="true"]{background:var(--brand-grad);color:#fff;border-color:transparent;box-shadow:0 4px 14px -6px rgba(192,132,252,.9)}
.ico-moon{display:none}
[data-theme="light"] .ico-sun{display:none}
[data-theme="light"] .ico-moon{display:block}

/* ── buttons ──────────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  height:44px;padding:0 20px;border-radius:var(--r-pill);border:1px solid transparent;
  font-family:var(--font-d);font-size:15px;font-weight:600;letter-spacing:-.01em;cursor:pointer;
  transition:transform .2s var(--ease),box-shadow .25s,background .2s,color .2s,border-color .2s,opacity .2s;
  white-space:nowrap;
}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--brand-grad);color:#fff;box-shadow:0 10px 26px -12px rgba(192,132,252,.95)}
.btn-primary:hover{box-shadow:0 16px 36px -14px rgba(192,132,252,1);transform:translateY(-2px)}
.btn-ghost{background:var(--surface);border-color:var(--stroke);color:var(--text)}
.btn-ghost:hover{background:var(--surface-2);border-color:var(--stroke-2);transform:translateY(-2px)}
.btn.xs{height:32px;padding:0 13px;font-size:13px}
.btn.danger:hover{color:#fb7185;border-color:rgba(251,113,133,.4)}
.btn[disabled]{opacity:.45;pointer-events:none}

/* ── pills / badges ───────────────────────────────────────── */
.pill{
  display:inline-flex;align-items:center;gap:8px;padding:6px 15px;border-radius:var(--r-pill);
  background:var(--surface);border:1px solid var(--stroke);backdrop-filter:blur(10px);
  font-size:12.5px;font-weight:500;letter-spacing:.01em;color:var(--text-2);
}
.pill .dot{width:6px;height:6px;border-radius:50%;background:#4ade80;box-shadow:0 0 0 3px rgba(74,222,128,.18);animation:pulse 2.4s ease-in-out infinite}
@keyframes pulse{50%{box-shadow:0 0 0 6px rgba(74,222,128,.05)}}

.badge{
  display:inline-flex;align-items:center;gap:6px;padding:4px 11px;border-radius:var(--r-pill);
  background:var(--surface-2);border:1px solid var(--stroke);font-size:12.5px;color:var(--text-2);font-weight:500;
}
.badge-uuid{font-family:var(--font-m);font-size:11.5px}
.grad{background:var(--brand-grad);-webkit-background-clip:text;background-clip:text;color:transparent}

/* ── hero ─────────────────────────────────────────────────── */
.view{padding:38px 0 72px;animation:viewIn .5s var(--ease-out)}
@keyframes viewIn{from{opacity:0;transform:translateY(10px)}}
.hero{text-align:center;padding:52px 0 40px;max-width:880px;margin-inline:auto}
.hero h1{font-size:clamp(2.6rem,7.4vw,4.6rem);margin:22px 0 18px;letter-spacing:-.045em}
.lede{font-size:clamp(1rem,2vw,1.14rem);color:var(--text-2);max-width:62ch;margin-inline:auto;line-height:1.65}

.searchbar{
  position:relative;display:flex;align-items:center;gap:8px;margin:32px auto 0;max-width:600px;
  padding:7px 7px 7px 18px;background:var(--surface-2);border:1px solid var(--stroke);
  border-radius:var(--r-pill);backdrop-filter:blur(20px);box-shadow:var(--sh-1);
  transition:border-color .25s,box-shadow .3s;
}
.searchbar:focus-within{border-color:rgba(192,132,252,.55);box-shadow:var(--glow)}
.sb-ico{color:var(--muted);display:grid;place-items:center;flex:none}
.searchbar input{
  flex:1;min-width:0;height:44px;background:none;border:0;outline:none;font-size:16px;color:var(--text);
}
.searchbar input::placeholder{color:var(--muted)}
.searchbar .btn{height:44px}
.searchbar.sm{max-width:none;margin:0;padding:5px 5px 5px 15px;flex:1}
.searchbar.sm input{height:38px;font-size:15px}
.searchbar.loading .btn{pointer-events:none;opacity:.6}

.chips{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin-top:20px}
.chips-label{font-size:13px;color:var(--muted);margin-right:2px}
.chip{
  padding:6px 14px;border-radius:var(--r-pill);cursor:pointer;font-size:13.5px;font-weight:500;
  background:var(--surface);border:1px solid var(--stroke);color:var(--text-2);
  transition:transform .2s var(--ease),background .2s,color .2s,border-color .2s;
}
.chip:hover{transform:translateY(-2px);background:var(--surface-2);color:var(--text);border-color:var(--stroke-2)}
.chip-random{display:inline-flex;align-items:center;gap:7px;color:var(--pink);border-color:rgba(244,114,182,.32)}
.chip-random:hover{border-color:rgba(244,114,182,.6)}

/* ── stat strip ───────────────────────────────────────────── */
.stat-strip{
  display:grid;grid-template-columns:repeat(4,1fr);gap:1px;margin:18px 0 8px;
  background:var(--stroke);border:1px solid var(--stroke);border-radius:var(--r-lg);overflow:hidden;
}
.stat{background:color-mix(in srgb,var(--bg-soft) 80%,transparent);padding:22px 18px;text-align:center;transition:background .25s}
.stat:hover{background:var(--surface)}
.stat b{display:block;font-family:var(--font-d);font-size:clamp(1.5rem,3.4vw,2.1rem);font-weight:700;letter-spacing:-.04em;
  background:var(--brand-grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.stat span{font-size:12.5px;color:var(--muted)}

/* ── blocks ───────────────────────────────────────────────── */
.block{margin-top:58px}
.block-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.block-head h2{font-size:clamp(1.3rem,3vw,1.7rem)}
.link-btn{
  background:none;border:0;padding:0;cursor:pointer;color:var(--text-2);font-size:14px;font-weight:500;
  border-bottom:1px solid transparent;transition:color .2s,border-color .2s;
}
.link-btn:hover{color:var(--pink);border-bottom-color:currentColor}

.page-head{text-align:center;max-width:640px;margin:22px auto 38px}
.page-head h1{font-size:clamp(2rem,5vw,3.1rem);margin:18px 0 14px}
.page-head .lede{font-size:1.03rem}

/* ── feature cards ────────────────────────────────────────── */
.feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(268px,1fr));gap:16px}
.feature-card{
  padding:26px 24px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--stroke);
  transition:transform .32s var(--ease),border-color .3s,background .3s;position:relative;overflow:hidden;
}
.feature-card::before{
  content:"";position:absolute;inset:0;opacity:0;transition:opacity .35s;
  background:radial-gradient(420px 180px at 50% -30%,rgba(192,132,252,.18),transparent 70%);
}
.feature-card:hover{transform:translateY(-4px);border-color:var(--stroke-2);background:var(--surface-2)}
.feature-card:hover::before{opacity:1}
.feature-card h3{font-size:1.06rem;margin:16px 0 8px}
.feature-card p{font-size:14.2px;color:var(--text-2);line-height:1.62}
.fi{width:42px;height:42px;border-radius:13px;display:block;position:relative;background:var(--surface-2);border:1px solid var(--stroke)}
.fi::after{content:"";position:absolute;inset:0;background:var(--brand-grad);-webkit-mask:var(--m) center/62% no-repeat;mask:var(--m) center/62% no-repeat;opacity:.95}
.fi-3d{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6 21 7.3v9.4L12 21.4 3 16.7V7.3zM3 7.3l9 4.7 9-4.7M12 12v9.4' fill='none' stroke='%23000' stroke-width='1.9' stroke-linejoin='round'/%3E%3C/svg%3E")}
.fi-dl{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m0 0 4.5-4.5M12 15l-4.5-4.5M4 17v2.5A1.5 1.5 0 0 0 5.5 21h13a1.5 1.5 0 0 0 1.5-1.5V17' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.fi-cmd{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 8-3.5 4L6 16M18 8l3.5 4L18 16M14 4.5 10 19.5' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.fi-echo{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3c-4 0-7 2.6-7 6 0 4.4 4 5.6 4 9 0-2.4 2-3 2-5 2.6-.6 4-2 4-4 0-3.4-3-6-7-6zM16.5 9c1.6 1 2.5 2.4 2.5 4' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.fi-hd{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='3' fill='none' stroke='%23000' stroke-width='1.9'/%3E%3Cpath d='M3 9h18M9 3v18' stroke='%23000' stroke-width='1.9'/%3E%3C/svg%3E")}
.fi-lock{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4.5' y='10' width='15' height='10.5' rx='2.5' fill='none' stroke='%23000' stroke-width='1.9'/%3E%3Cpath d='M8 10V7.5a4 4 0 0 1 8 0V10' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E")}

/* ── generic card ─────────────────────────────────────────── */
.card{
  background:var(--surface);border:1px solid var(--stroke);border-radius:var(--r-xl);
  backdrop-filter:blur(16px);box-shadow:var(--sh-1);overflow:hidden;
}
.hint-text{font-size:13.4px;color:var(--muted);line-height:1.6}

/* ── viewer ───────────────────────────────────────────────── */
.crumbs{display:flex;align-items:center;gap:9px;font-size:13.5px;color:var(--muted);margin-bottom:18px}
.crumbs a:hover{color:var(--text)}
.crumb-here{color:var(--text-2);font-family:var(--font-m);font-size:13px}

.player-head{display:flex;align-items:center;gap:18px;margin-bottom:24px;flex-wrap:wrap}
.ph-avatar{width:72px;height:72px;border-radius:20px;background:var(--surface-3);box-shadow:var(--sh-1),inset 0 0 0 1px var(--stroke)}
.ph-meta{min-width:0;flex:1}
.ph-meta h1{font-size:clamp(1.7rem,4.4vw,2.4rem);overflow-wrap:anywhere}
.ph-sub{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}
.ph-actions{display:flex;gap:9px;flex-wrap:wrap}

.viewer-grid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;align-items:start}

.stage{display:flex;flex-direction:column;min-height:360px}
.stage-canvas{position:relative;flex:1;min-height:280px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 18%,rgba(192,132,252,.14),transparent 70%),
    linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,0));
}
.stage-canvas canvas{display:block;width:100%;height:100%;position:absolute;inset:0;touch-action:none}
.stage-loading,.stage-empty{
  position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;
  color:var(--text-2);font-size:14.5px;text-align:center;padding:24px;
}
.stage-loading[hidden],.stage-empty[hidden]{display:none}
.stage-empty .big-paw{font-size:44px;opacity:.8;animation:pawBob 3.2s ease-in-out infinite}
@keyframes pawBob{50%{transform:translateY(-8px) rotate(6deg)}}
.stage-empty h3{font-size:1.15rem}
.spinner{width:22px;height:22px;border-radius:50%;border:2.5px solid var(--surface-3);border-top-color:var(--pink);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.stage-bar{display:flex;align-items:center;gap:8px;padding:11px 14px;border-top:1px solid var(--stroke);background:color-mix(in srgb,var(--bg-soft) 55%,transparent)}
.stage-hint{margin-left:6px;font-size:12.5px;color:var(--muted)}
.stage-fps{margin-left:auto;font-family:var(--font-m);font-size:11px;color:var(--muted)}

/* panel */
.panel{position:sticky;top:calc(var(--header-h) + 16px)}
.panel-head{
  padding:17px 18px 0;font-size:11.5px;font-weight:600;letter-spacing:.09em;
  text-transform:uppercase;color:var(--muted);
}
.panel-body{padding:16px 18px 18px;max-height:min(64vh,560px);overflow-y:auto}
.panel-body::-webkit-scrollbar{width:8px}
.panel-body::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:99px;border:2px solid transparent;background-clip:padding-box}

.field{margin-bottom:20px}
.field>label{display:block;font-size:11.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);margin-bottom:9px}

.btn-row{display:flex;gap:8px;flex-wrap:wrap}

.dl dd{font-family:var(--font-m);font-size:12.2px;overflow-wrap:anywhere}

/* ── tier columns (single gamemode board) ─────────────────── */
.tier-columns{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;align-items:start}

.tier-col{
  background:var(--surface);border:1px solid var(--stroke);border-radius:var(--r-lg);
  overflow:hidden;
}
.tc-head{
  display:flex;align-items:baseline;gap:9px;padding:14px 16px;
  background:linear-gradient(180deg,color-mix(in srgb,var(--c) 16%,transparent),transparent);
  border-bottom:1px solid color-mix(in srgb,var(--c) 28%,transparent);
}
.tc-head b{font-family:var(--font-d);font-size:14.5px;font-weight:700;letter-spacing:-.02em}
.tc-count{
  margin-left:auto;font-family:var(--font-m);font-size:11px;color:var(--c);
  background:color-mix(in srgb,var(--c) 15%,transparent);
  border:1px solid color-mix(in srgb,var(--c) 32%,transparent);
  border-radius:99px;padding:1px 8px;flex:none;
}
.tc-body{display:flex;flex-direction:column;gap:6px;padding:9px}
.tc-none{margin:6px 4px 9px;font-size:12px;color:var(--muted)}

.tc-card{
  display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:12px;
  background:var(--surface-2);border:1px solid var(--stroke);
  transition:transform .22s var(--ease),border-color .22s,background .22s;
}
.tc-card:hover{transform:translateX(3px);border-color:color-mix(in srgb,var(--c) 55%,transparent);background:var(--surface-3)}
.tc-avatar{width:28px;height:28px;border-radius:9px;flex:none;background:var(--surface-3)}
.tc-meta{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.tc-name{display:block;min-width:0}
.tc-name b{display:block;font-family:var(--font-d);font-size:13px;font-weight:600;letter-spacing:-.01em;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tc-sub{display:flex;align-items:center;gap:6px}
.tc-sub .flag{font-size:11px}
.tc-sub em{font-style:normal;font-family:var(--font-m);font-size:10px;color:var(--muted)}
.tc-sub .tier-badge{min-width:36px;padding:2px 6px;font-size:10.5px;border-radius:6px}

/* Five columns is the point of the board, so it survives well past a
   tablet width before folding down. */
@media (max-width:820px){
  .tier-columns{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:620px){
  .tier-columns{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:430px){
  .tier-columns{grid-template-columns:1fr}
}

/* ── upload ───────────────────────────────────────────────── */
.dropzone{
  display:flex;flex-direction:column;align-items:center;gap:9px;text-align:center;
  padding:54px 24px;border-radius:var(--r-xl);cursor:pointer;
  background:var(--surface);border:2px dashed var(--stroke-2);transition:border-color .25s,background .25s,transform .25s var(--ease);
}
.dropzone:hover,.dropzone:focus-visible{border-color:rgba(192,132,252,.55);background:var(--surface-2)}
.dropzone.drag{border-color:var(--pink);background:rgba(244,114,182,.08);transform:scale(1.01)}
.dz-ico{width:64px;height:64px;display:grid;place-items:center;border-radius:20px;color:#fff;background:var(--brand-grad);box-shadow:0 12px 30px -12px rgba(192,132,252,.9);margin-bottom:6px}
.dropzone h3{font-size:1.2rem}
.dropzone p{font-size:14.5px;color:var(--text-2)}
.dropzone small{font-size:12.2px;color:var(--muted);font-family:var(--font-m);margin-top:4px}

.upload-preview{margin-top:20px;padding:20px}
.up-head{display:flex;align-items:center;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.up-head h3{font-size:1.1rem;margin-right:auto;overflow-wrap:anywhere}
.up-body{display:grid;grid-template-columns:1fr 250px;gap:20px;align-items:start}
.up-canvas{
  position:relative;aspect-ratio:1;border-radius:var(--r);overflow:hidden;border:1px solid var(--stroke);
  background:radial-gradient(ellipse at 50% 30%,rgba(192,132,252,.16),transparent 70%);
}
.up-canvas canvas{position:absolute;inset:0;width:100%;height:100%}
.up-side{display:flex;flex-direction:column;gap:12px}
.up-side .field{margin:0}
.up-side label>span{display:block;font-size:11.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.up-side input[type=text]{
  width:100%;height:40px;padding:0 13px;border-radius:12px;background:var(--surface);border:1px solid var(--stroke);
  outline:none;font-size:14px;transition:border-color .2s;
}
.up-side input[type=text]:focus{border-color:rgba(192,132,252,.55)}

/* ── guide ────────────────────────────────────────────────── */
.guide-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}
.guide{padding:24px}
.guide h3{font-size:1.05rem;margin:13px 0 10px}
.guide ol{margin:0;padding-left:20px;color:var(--text-2);font-size:14px;line-height:1.75}
.guide p{color:var(--text-2);font-size:14.2px;line-height:1.68}

.faq{display:flex;flex-direction:column;gap:10px}
.faq details{
  background:var(--surface);border:1px solid var(--stroke);border-radius:var(--r);overflow:hidden;transition:border-color .2s;
}
.faq details[open]{border-color:var(--stroke-2);background:var(--surface-2)}
.faq summary{padding:16px 20px;cursor:pointer;font-family:var(--font-d);font-weight:600;font-size:15px;list-style:none;position:relative;padding-right:44px}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:20px;font-weight:400;color:var(--muted);transition:transform .25s var(--ease)}
.faq details[open] summary::after{transform:translateY(-50%) rotate(45deg);color:var(--pink)}
.faq details p{padding:0 20px 18px;font-size:14.2px;color:var(--text-2);line-height:1.68}

/* ── footer ───────────────────────────────────────────────── */
.site-footer{border-top:1px solid var(--stroke);margin-top:40px;background:color-mix(in srgb,var(--bg-soft) 55%,transparent);backdrop-filter:blur(10px)}
.foot-inner{display:flex;flex-wrap:wrap;align-items:center;gap:22px;padding-block:30px}
.foot-brand{display:flex;align-items:center;gap:12px}
.foot-brand b{font-family:var(--font-d);font-size:16px;display:block}
.foot-brand p{font-size:13px;color:var(--muted)}
.foot-links{display:flex;gap:18px;margin-left:auto;font-size:14px;color:var(--text-2)}
.foot-links a:hover{color:var(--pink)}
.disclaimer{width:100%;font-size:12.2px;color:var(--muted);line-height:1.6;padding-top:18px;border-top:1px solid var(--stroke)}

/* ── command palette ──────────────────────────────────────── */
.palette-backdrop{
  position:fixed;inset:0;z-index:150;display:grid;place-items:start center;padding:12vh 20px 20px;
  background:rgba(4,3,9,.62);backdrop-filter:blur(8px);animation:fadeIn .18s ease;
}
.palette-backdrop[hidden]{display:none}
@keyframes fadeIn{from{opacity:0}}
.palette{
  width:min(560px,100%);background:var(--bg-soft);border:1px solid var(--stroke-2);
  border-radius:var(--r-lg);box-shadow:var(--sh-2);overflow:hidden;animation:popIn .28s var(--ease-out);
}
@keyframes popIn{from{opacity:0;transform:translateY(-12px) scale(.98)}}
.palette-input{display:flex;align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid var(--stroke);color:var(--muted)}
.palette-input input{flex:1;background:none;border:0;outline:none;font-size:16.5px;color:var(--text)}
.palette-results{max-height:min(46vh,380px);overflow-y:auto;padding:8px}
.palette-results::-webkit-scrollbar{width:8px}
.palette-results::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:99px}
.p-res{display:flex;align-items:center;gap:12px;padding:9px 11px;border-radius:13px;cursor:pointer;transition:background .15s}
.p-res:hover,.p-res.sel{background:var(--surface-2)}
.p-res img{width:36px;height:36px;border-radius:11px;background:var(--surface-3);flex:none}
.p-res .pr-n{font-family:var(--font-d);font-weight:600;font-size:14.5px}
.p-res .pr-u{font-family:var(--font-m);font-size:11px;color:var(--muted)}
.p-res .pr-go{margin-left:auto;color:var(--muted);font-size:12px}
.p-empty{padding:34px 18px;text-align:center;color:var(--muted);font-size:14px}
.p-hint{padding:10px 14px;font-size:12px;color:var(--muted);display:flex;gap:8px;align-items:center}
.palette-foot{display:flex;gap:16px;padding:10px 18px;border-top:1px solid var(--stroke);font-size:11.5px;color:var(--muted)}
.palette-foot span{display:flex;align-items:center;gap:5px}

/* ── toasts ───────────────────────────────────────────────── */
.toasts{position:fixed;bottom:22px;right:22px;z-index:200;display:flex;flex-direction:column;gap:9px;align-items:flex-end}
.toast{
  display:flex;align-items:center;gap:11px;padding:12px 17px;border-radius:14px;max-width:340px;
  background:var(--bg-soft);border:1px solid var(--stroke-2);box-shadow:var(--sh-2);
  font-size:13.8px;animation:toastIn .35s var(--ease-out);
}
.toast.out{animation:toastOut .3s var(--ease) forwards}
@keyframes toastIn{from{opacity:0;transform:translateX(24px) scale(.94)}}
@keyframes toastOut{to{opacity:0;transform:translateX(24px) scale(.94)}}
.toast i{width:7px;height:7px;border-radius:50%;background:var(--pink);flex:none}
.toast.ok i{background:#4ade80}
.toast.err i{background:#fb7185}

/* ── reveal on scroll ─────────────────────────────────────── */
.reveal{opacity:0;transform:translateY(16px);transition:opacity .6s var(--ease-out),transform .6s var(--ease-out)}
.reveal.in{opacity:1;transform:none}

/* ── responsive ───────────────────────────────────────────── */
@media (max-width:1080px){
  .viewer-grid{grid-template-columns:1fr}
  .panel{position:static}
  .panel-body{max-height:none}
  .stage{min-height:400px}
  .stage-canvas{min-height:340px}
}
@media (max-width:900px){
  .admin-grid{grid-template-columns:1fr}
}
@media (max-width:860px){
  .nav{display:none}
  .mini-search span{display:none}
  .mini-search kbd{display:none}
  .mini-search{padding:0 11px}
  .stat-strip{grid-template-columns:repeat(2,1fr)}
  .up-body{grid-template-columns:1fr}
  .foot-links{margin-left:0;width:100%}
  .admin-grid{grid-template-columns:1fr}
}
@media (max-width:560px){
  .wrap{padding-inline:16px}
  .hero{padding:26px 0 20px}
  .searchbar{flex-wrap:wrap;border-radius:var(--r-lg);padding:14px}
  .searchbar input{flex:1 0 100%;height:38px}
  .searchbar .btn{flex:1}
  .sb-ico{display:none}
  .stage{min-height:340px}
  .stage-canvas{min-height:280px}
  .stage-hint{display:none}
  .ph-actions{width:100%}
  .ph-actions .btn{flex:1}
  .toasts{left:16px;right:16px;bottom:16px;align-items:stretch}
  .toast{max-width:none}
  .tr-tiers{display:none}
}

/* ══════════════════════════════════════════════════════════════
   TIER LIST
   ══════════════════════════════════════════════════════════════ */

/* ── gamemode bar ──────────────────────────────────────────── */
/* It sits directly under the sticky header, so the two are drawn as one
   stacked surface: the header drops its own divider and the mode bar
   carries it, which stops it reading as a detached strip on scroll. */
body.has-modebar .site-header{border-bottom-color:transparent;box-shadow:none}
.modebar{
  position:sticky;top:var(--header-h);z-index:80;
  border-bottom:1px solid var(--stroke);
  background:color-mix(in srgb,var(--bg) 82%,transparent);
  backdrop-filter:blur(16px) saturate(160%);-webkit-backdrop-filter:blur(16px) saturate(160%);
  box-shadow:0 12px 28px -26px #000;
}
.modebar[hidden]{display:none}
.modebar>.wrap{display:flex;gap:4px;padding-block:13px;overflow-x:auto;scrollbar-width:none}
.modebar>.wrap::-webkit-scrollbar{display:none}

/* Equal-weight segments fill the row, so no single gamemode reads as
   more important than another by accident. */
/* Grow to share the row, but never shrink below the label's own width —
   "NethPot" must not truncate just to match "UHC". */
.mode-pill{
  position:relative;flex:1 1 auto;min-width:max-content;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:9px 14px;border-radius:12px;cursor:pointer;white-space:nowrap;
  background:transparent;border:1px solid transparent;
  font-family:var(--font-d);font-size:14px;font-weight:600;letter-spacing:-.01em;
  color:var(--muted);
  transition:color .2s,background .2s,border-color .2s,box-shadow .25s;
}
.mode-pill:hover{color:var(--text-2);background:var(--surface)}
.mode-pill.is-active{
  color:var(--text);
  background:color-mix(in srgb,var(--c) 13%,transparent);
  border-color:color-mix(in srgb,var(--c) 40%,transparent);
  box-shadow:inset 0 -2px 0 var(--c);
}
.mode-pill .mp-dot{
  width:7px;height:7px;border-radius:50%;flex:none;
  background:var(--c);opacity:.45;transition:opacity .2s,box-shadow .2s,transform .25s var(--ease);
}
.mode-pill:hover .mp-dot{opacity:.8}
.mode-pill.is-active .mp-dot{opacity:1;transform:scale(1.15);box-shadow:0 0 0 3px color-mix(in srgb,var(--c) 22%,transparent)}
.mode-pill .mp-label{white-space:nowrap}

@media (max-width:820px){
  .modebar>.wrap{gap:6px}
  .mode-pill{flex:0 0 auto;padding:7px 13px;font-size:13.5px}
}

.page-head.left{text-align:left;margin-inline:0;max-width:none}
.page-head.left h1{margin-top:14px}
.page-head.left .lede{margin-inline:0;max-width:60ch}

/* ── mode tiles ───────────────────────────────────────────── */
.mode-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.mode-tile{
  position:relative;display:flex;flex-direction:column;gap:3px;
  padding:18px 17px;border-radius:var(--r-lg);overflow:hidden;
  background:var(--surface);border:1px solid var(--stroke);
  transition:transform .3s var(--ease),border-color .3s,background .3s;
}
.mode-tile::before{
  content:"";position:absolute;inset:0;opacity:0;transition:opacity .3s;
  background:radial-gradient(300px 140px at 20% -20%,color-mix(in srgb,var(--c) 28%,transparent),transparent 70%);
}
.mode-tile:hover{transform:translateY(-5px);border-color:color-mix(in srgb,var(--c) 50%,transparent)}
.mode-tile:hover::before{opacity:1}
.mt-mark{
  width:34px;height:34px;display:grid;place-items:center;border-radius:11px;margin-bottom:8px;
  background:color-mix(in srgb,var(--c) 18%,transparent);color:var(--c);
  font-family:var(--font-d);font-weight:700;font-size:14px;position:relative;
}
.mt-label{font-family:var(--font-d);font-weight:700;font-size:1.02rem;letter-spacing:-.02em;position:relative}
.mt-sub{font-size:12px;color:var(--muted);position:relative}
.mt-go{position:absolute;top:16px;right:16px;color:var(--c);opacity:0;transform:translateX(-5px);transition:opacity .25s,transform .3s var(--ease)}
.mode-tile:hover .mt-go{opacity:1;transform:none}

/* ── podium ───────────────────────────────────────────────── */
.podium{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}
.podium-card{
  position:relative;display:flex;align-items:center;gap:13px;padding:13px 16px 13px 13px;
  border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--stroke);
  transition:transform .28s var(--ease),border-color .28s,background .28s;
}
.podium-card:hover{transform:translateY(-4px);border-color:rgba(192,132,252,.42);background:var(--surface-2)}
.podium-card.rank-1{border-color:rgba(251,191,36,.45);background:linear-gradient(120deg,rgba(251,191,36,.14),transparent 62%),var(--surface)}
.podium-card.rank-2{border-color:rgba(203,213,225,.32)}
.podium-card.rank-3{border-color:rgba(251,146,60,.32)}
.pc-rank{
  font-family:var(--font-d);font-size:1.5rem;font-weight:700;letter-spacing:-.05em;
  color:var(--muted);min-width:34px;text-align:center;flex:none;
}
.podium-card.rank-1 .pc-rank{color:#fbbf24}
.pc-body{display:flex;align-items:center;gap:11px;min-width:0;flex:1}
.pc-avatar{width:44px;height:44px;border-radius:14px;flex:none;background:var(--surface-3)}
.pc-meta{min-width:0;display:flex;flex-direction:column;gap:5px}
.pc-name{display:flex;align-items:center;gap:7px;font-family:var(--font-d);font-size:15px;font-weight:600;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pc-sub{display:flex;align-items:center;gap:8px}
.pc-sub em{font-style:normal;font-family:var(--font-m);font-size:11.5px;color:var(--muted)}
.flag{font-style:normal;font-size:14px;line-height:1}

/* ── tier badges ──────────────────────────────────────────── */
.tier-badge{
  display:inline-flex;align-items:center;justify-content:center;min-width:44px;
  padding:3px 9px;border-radius:8px;font-family:var(--font-m);font-size:12px;font-weight:500;letter-spacing:-.02em;
  color:var(--c);background:color-mix(in srgb,var(--c) 17%,transparent);
  border:1px solid color-mix(in srgb,var(--c) 38%,transparent);flex:none;
}
.tier-badge.none{color:var(--muted);background:var(--surface-3);border-color:var(--stroke);opacity:.7}

.mini-tier{
  display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 4px;border-radius:6px;
  font-style:normal;font-family:var(--font-m);font-size:10.5px;font-weight:500;
  color:var(--c);background:color-mix(in srgb,var(--c) 15%,transparent);
  border:1px solid color-mix(in srgb,var(--c) 30%,transparent);flex:none;
}
.mini-tier.is-empty{color:var(--muted);background:transparent;border-color:var(--stroke);opacity:.45}
.mini-tier.focus{outline:1.5px solid var(--c);outline-offset:1px}

/* ── leaderboard rows ─────────────────────────────────────── */
.tl-toolbar{display:flex;gap:12px;align-items:center;margin-bottom:18px;flex-wrap:wrap}
.tl-toolbar .searchbar.sm{flex:1;min-width:220px}
.tl-count{font-size:13px;color:var(--muted);font-family:var(--font-m);margin-left:auto}

.tier-board{display:flex;flex-direction:column;gap:7px}
.tier-row{
  display:grid;grid-template-columns:40px 44px minmax(90px,1.3fr) auto 52px 74px;
  align-items:center;gap:14px;padding:9px 16px 9px 10px;border-radius:var(--r);
  background:var(--surface);border:1px solid var(--stroke);
  transition:transform .22s var(--ease),border-color .22s,background .22s;
}
.tier-row:hover{transform:translateX(4px);border-color:var(--stroke-2);background:var(--surface-2)}
.tier-row.unranked{opacity:.62}
.tier-row.unranked:hover{opacity:1}
.tr-rank{font-family:var(--font-d);font-weight:700;font-size:1.02rem;color:var(--muted);text-align:center;letter-spacing:-.03em}
.tier-row:nth-child(1) .tr-rank{color:#fbbf24}
.tier-row:nth-child(2) .tr-rank{color:#cbd5e1}
.tier-row:nth-child(3) .tr-rank{color:#fb923c}
.tr-avatar{width:40px;height:40px;border-radius:13px;background:var(--surface-3);flex:none}
.tr-name{display:flex;align-items:center;gap:8px;min-width:0}
.tr-name b{font-family:var(--font-d);font-weight:600;font-size:15px;letter-spacing:-.01em;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tr-tiers{display:flex;gap:4px;flex-wrap:nowrap}
.tr-tier{display:flex;justify-content:center}
.tr-pts{text-align:right;display:flex;flex-direction:column;line-height:1.25}
.tr-pts b{font-family:var(--font-d);font-weight:700;font-size:14.5px;letter-spacing:-.02em}
.tr-pts i{font-style:normal;font-size:10.5px;color:var(--muted);font-family:var(--font-m)}

/* ── player rank panel ────────────────────────────────────── */
.rank-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;margin-bottom:18px}
.rank-card{
  display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;
  background:var(--surface);border:1px solid var(--stroke);
  transition:border-color .22s,background .22s,transform .22s var(--ease);
}
.rank-card:hover{border-color:color-mix(in srgb,var(--c) 55%,transparent);transform:translateY(-2px);background:var(--surface-2)}
.rank-card.blank{opacity:.5}
.rank-card.blank:hover{opacity:.9}
.rc-mark{
  width:28px;height:28px;display:grid;place-items:center;border-radius:9px;flex:none;
  font-family:var(--font-d);font-weight:700;font-size:11px;
  background:color-mix(in srgb,var(--c) 18%,transparent);color:var(--c);
}
.rc-body{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.rc-body b{font-family:var(--font-d);font-size:13.5px;font-weight:600}
.rc-body i{font-style:normal;font-family:var(--font-m);font-size:10.8px;color:var(--muted)}

.overall-box{padding:18px;border-radius:var(--r);background:var(--surface);border:1px solid var(--stroke)}
.ob-top{display:flex;align-items:center;justify-content:space-between}
.ob-label{font-size:11.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}
.ob-rank{font-family:var(--font-d);font-weight:700;font-size:1.4rem;letter-spacing:-.04em;
  background:var(--brand-grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.ob-pts{display:flex;align-items:baseline;gap:7px;margin:8px 0 10px}
.ob-pts b{font-family:var(--font-d);font-size:2.4rem;font-weight:700;letter-spacing:-.05em;line-height:1}
.ob-pts i{font-style:normal;font-size:13px;color:var(--muted)}

/* ── auth ─────────────────────────────────────────────────── */
.auth-wrap{display:grid;place-items:center;padding:20px 0 40px}
.auth-card{width:min(460px,100%);padding:34px 32px;text-align:center}
.auth-mark{margin:0 auto 18px;width:52px;height:52px;border-radius:17px}
.auth-card h1{font-size:1.6rem;margin-bottom:10px}
.auth-card .lede{font-size:14.2px;margin-bottom:26px}
#authForm{display:flex;flex-direction:column;gap:14px;text-align:left}
.auth-field{display:flex;flex-direction:column;gap:7px}
.auth-field>span{font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.auth-field input{
  height:46px;padding:0 15px;border-radius:13px;background:var(--surface);border:1px solid var(--stroke);
  outline:none;font-size:15px;transition:border-color .2s,box-shadow .2s;
}
.auth-field input:focus{border-color:rgba(192,132,252,.6);box-shadow:var(--glow)}
.auth-field input[type=search]{height:34px;width:150px;padding:0 12px;font-size:13.5px;border-radius:10px}
.auth-error{
  padding:10px 13px;border-radius:11px;font-size:13.4px;text-align:left;
  color:#fda4af;background:rgba(251,113,133,.12);border:1px solid rgba(251,113,133,.3);
}
.auth-error[hidden]{display:none}
.auth-submit{width:100%;height:48px;margin-top:4px}
.auth-submit.ghost{height:38px;margin-top:2px;font-size:13px}
.auth-switch{margin-top:18px;font-size:13.6px;color:var(--muted);display:flex;gap:7px;justify-content:center;align-items:center}
.auth-mode{margin-top:20px;padding-top:16px;border-top:1px solid var(--stroke);font-size:12px;color:var(--muted);line-height:1.6}

/* ── admin ────────────────────────────────────────────────── */
.admin-grid{display:grid;grid-template-columns:390px minmax(0,1fr);gap:16px;align-items:start}
.admin-card{padding:20px}
.admin-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.admin-head h3{font-size:1.05rem}
.admin-head .btn-row{align-items:center}
#playerForm{display:flex;flex-direction:column;gap:14px}

.admin-live{
  display:flex;align-items:center;gap:13px;padding:11px;border-radius:14px;
  background:var(--surface);border:1px solid var(--stroke);
}
.admin-live[hidden]{display:none}
.admin-live img{width:56px;height:56px;border-radius:15px;flex:none;background:var(--surface-3);object-fit:cover}
.admin-live b{display:block;font-family:var(--font-d);font-size:15px;margin-bottom:3px;overflow-wrap:anywhere}
.admin-live span{font-size:11.5px;color:var(--muted);font-family:var(--font-m);overflow-wrap:anywhere}

/* ── tier picker ──────────────────────────────────────────── */
.tier-picker{display:flex;flex-direction:column;gap:7px;position:relative}

.tier-pick{
  display:grid;grid-template-columns:24px 64px 1fr;align-items:center;gap:10px;
  padding:3px 3px 3px 0;border-radius:13px;transition:background .2s;
  /* Anchors its dropdown to this row, not to the whole list. */
  position:relative;
}
.tier-pick:hover{background:var(--surface)}
.tier-pick.open{background:var(--surface-2)}

.tp-mark{
  font-style:normal;font-family:var(--font-d);font-weight:700;font-size:10.5px;text-align:center;
  width:24px;height:24px;display:grid;place-items:center;border-radius:8px;
  background:color-mix(in srgb,var(--c) 18%,transparent);color:var(--c);
}
.tp-label{font-size:13px;color:var(--text-2);font-weight:500}

.tp-trigger{
  display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;
  height:38px;padding:0 10px 0 13px;border-radius:11px;cursor:pointer;
  background:var(--surface);border:1px solid var(--stroke);
  font-family:var(--font-d);font-size:13px;font-weight:600;letter-spacing:-.01em;
  transition:border-color .2s,background .2s;
}
.tp-trigger:hover{border-color:var(--stroke-2);background:var(--surface-2)}
.tier-pick.open .tp-trigger{border-color:rgba(192,132,252,.55);box-shadow:var(--glow)}
.tier-pick.set .tp-trigger{border-color:var(--stroke-2)}
.tp-value{color:var(--muted);font-weight:600}
.tier-pick.set .tp-value{color:var(--text)}
.tp-chev-wrap{display:grid;place-items:center;color:var(--muted);flex:none;transition:transform .25s var(--ease)}
.tier-pick.open .tp-chev-wrap{transform:rotate(180deg)}

/* Rendered on <body> (see the note in views.js) so no card can clip it.
   Two columns keep all sixteen tiers visible at once, so picking LT5
   never means scrolling inside the menu. */
.tp-menu{
  position:fixed;z-index:200;
  margin:0;padding:4px;list-style:none;overflow-y:auto;
  display:grid;grid-template-columns:1fr 1fr;gap:1px;
  background:var(--bg-soft);border:1px solid var(--stroke-2);border-radius:13px;
  box-shadow:var(--sh-2);animation:popIn .16s var(--ease-out);
}
.tp-menu.drop-up{animation:popInUp .16s var(--ease-out)}
@keyframes popInUp{from{opacity:0;transform:translateY(6px)}}
.tp-opt.tp-none{grid-column:1 / -1}
.tp-menu::-webkit-scrollbar{width:8px}
.tp-menu::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:99px;border:2px solid transparent;background-clip:padding-box}

.tp-opt{
  display:flex;align-items:center;gap:8px;padding:4px 8px;border-radius:8px;cursor:pointer;
  font-size:12.5px;line-height:1.35;transition:background .14s;white-space:nowrap;
}
.tp-opt:hover,.tp-opt:focus-visible{background:var(--surface-2);outline:none}
.tp-opt.sel{background:color-mix(in srgb,var(--c) 16%,transparent)}
.tp-opt .tp-id{font-family:var(--font-m);font-size:12px;font-weight:600;color:var(--c);flex:none;width:32px}
.tp-label-sm{font-size:11.5px;color:var(--text-2);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.tp-pts{font-family:var(--font-m);font-size:10.5px;color:var(--muted);flex:none}
.tp-opt.tp-none{color:var(--muted)}
.tp-opt.tp-none span{flex:1}
.tp-opt.tp-none .tp-pts{color:var(--muted);opacity:.6}

/* gated owner panel */
.badge-lock{display:inline-flex;align-items:center;gap:5px;color:#fbbf24;
  background:rgba(251,191,36,.14);border-color:rgba(251,191,36,.4);text-transform:uppercase;
  letter-spacing:.07em;font-size:10.5px;font-weight:600;flex:none}
.gate-note{
  font-size:13px;color:var(--text-2);line-height:1.6;margin-bottom:14px;
  padding:12px 14px;border-radius:13px;
  background:rgba(251,191,36,.07);border:1px solid rgba(251,191,36,.24);
}
.gate-note b{color:var(--text);font-weight:600}

.grant-form{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.grant-bar{flex:1;min-width:190px;padding:4px 4px 4px 13px}
.grant-bar input{height:34px;font-size:13.5px}

.filter-bar{
  flex:1;min-width:170px;max-width:250px;padding:4px 4px 4px 13px;
}
.filter-bar input{height:32px;font-size:13px}
.searchbar input[type=search]{-webkit-appearance:none;appearance:none}
.searchbar input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;height:13px;width:13px;
  background:linear-gradient(45deg,transparent 45%,var(--muted) 45%,var(--muted) 55%,transparent 55%),
             linear-gradient(-45deg,transparent 45%,var(--muted) 45%,var(--muted) 55%,transparent 55%);
  background-size:100% 100%;background-position:center;cursor:pointer}

.roster{display:flex;flex-direction:column;gap:6px;max-height:640px;overflow-y:auto}
.roster::-webkit-scrollbar{width:8px}
.roster::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:99px}
.roster-row{
  display:flex;align-items:center;gap:12px;padding:7px 10px;border-radius:13px;
  background:var(--surface);border:1px solid var(--stroke);transition:border-color .2s,background .2s;
}
.roster-row:hover{border-color:var(--stroke-2);background:var(--surface-2)}
.rr-open{display:flex;align-items:center;gap:11px;flex:none;background:none;border:0;cursor:pointer;padding:0;text-align:left;min-width:150px}
.rr-open img{width:34px;height:34px;border-radius:11px;background:var(--surface-3);flex:none}
.rr-meta{display:flex;flex-direction:column;line-height:1.3;min-width:0}
.rr-meta b{font-family:var(--font-d);font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rr-meta i{font-style:normal;font-family:var(--font-m);font-size:10.8px;color:var(--muted)}
.rr-tiers{display:flex;gap:4px;flex-wrap:wrap;margin-left:auto}
.rr-tiers .mini-tier{min-width:26px}
.danger:hover{color:#fb7185;border-color:rgba(251,113,133,.45)}
.muted{color:var(--muted)}
.empty{text-align:center;padding:50px 20px;color:var(--muted)}

/* team list */
.admin-side{display:flex;flex-direction:column;gap:16px}
.team-list{display:flex;flex-direction:column;gap:6px}
.team-row{
  display:flex;align-items:center;gap:12px;padding:9px 12px;border-radius:13px;
  background:var(--surface);border:1px solid var(--stroke);
}
.team-row.pending{border-style:dashed;opacity:.8}
.team-badge{
  flex:none;padding:3px 10px;border-radius:99px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;
}
.team-badge.role-owner{color:#fbbf24;background:rgba(251,191,36,.15);border:1px solid rgba(251,191,36,.4)}
.team-badge.role-admin{color:#c084fc;background:rgba(192,132,252,.15);border:1px solid rgba(192,132,252,.4)}
.team-email{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}
.team-email b{font-size:13.8px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.team-email i{font-style:normal;font-size:11px;color:var(--muted)}

@media (max-width:880px){
  .admin-grid{grid-template-columns:1fr}
}
/* The per-gamemode badges are the point of a row, so they survive
   down to tablet width; only the name/tier/points columns compress. */
@media (max-width:1120px){
  .tier-row{grid-template-columns:34px 40px minmax(80px,1fr) auto 48px 62px;gap:11px;padding:8px 13px 8px 6px}
}
@media (max-width:860px){
  .tier-row{grid-template-columns:32px 38px minmax(70px,1fr) 46px 60px;gap:10px;padding:8px 11px 8px 5px}
  .tier-row .tr-tiers{display:none}
}
@media (max-width:560px){
  .tier-row{grid-template-columns:30px 36px minmax(60px,1fr) 46px;gap:9px;padding:8px 10px 8px 4px}
  .tr-pts{display:none}
  .roster-row{flex-wrap:wrap}
  .rr-tiers{margin-left:0;width:100%}
}
