:root {
  --bg: #0d0f14;
  --panel: #161a22;
  --panel-2: #1e2430;
  --line: #2a3140;
  --text: #e8ebf1;
  --muted: #8a93a6;
  --accent: #f5a524;
  --accent-ink: #1a1204;
  --t: #d9a441;
  --ct: #5b8def;
  --ok: #3ccf91;
  --err: #ff5d5d;
  --radius: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #39414f transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
/* The Huns: team tab with its logo in place of an icon, and a light sweep on hover */
.nav a.huns-link { position: relative; overflow: hidden; color: var(--text); isolation: isolate; box-shadow: inset 0 0 0 1px rgba(214, 28, 28, .4); transition: color .2s, background .2s, box-shadow .25s, transform .25s var(--ease); }
.huns-link::before { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: -60%; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 70, 70, .4), transparent); transform: skewX(-18deg); transition: left .55s var(--ease); }
.huns-link .huns-logo { width: 24px; height: 24px; object-fit: contain; flex: none; transition: transform .3s var(--ease), filter .3s; }
.nav a.huns-link:hover, .nav a.huns-link[aria-current="page"] { background: rgba(187, 0, 0, .2); box-shadow: inset 0 0 0 1px rgba(235, 45, 45, .85), 0 0 20px -5px #e02020; transform: translateX(2px); }
.huns-link:hover::before { left: 115%; }
.huns-link:hover .huns-logo { transform: scale(1.22) rotate(-6deg); filter: brightness(1.35) drop-shadow(0 0 7px rgba(255, 45, 45, .95)); }
.huns-link .huns-logo { filter: brightness(1.2); }

/* The Huns page: the whole page in the tab's red, with its glow and light sweep. Other pages are untouched. */
.huns-page { --accent: #e02020; --accent-ink: #fff; --panel: #1b1113; --panel-2: #291517; --bg: #120b0c; --line: rgba(214, 28, 28, .38); --err: #ff8080; --muted: #a8939a; }
/* The header borrows the logo's broken bracket frame. */
.huns-head { position: relative; display: flex; align-items: center; gap: 24px; margin: 6px 0 16px; padding: 22px 34px; }
.huns-head::before, .huns-head::after { content: ''; position: absolute; top: 0; bottom: 0; width: 34%; border: 4px solid #bb0000; pointer-events: none; transition: border-color .25s, box-shadow .25s; }
.huns-head::before { left: 0; border-right: 0; }
.huns-head::after { right: 0; border-left: 0; }
.huns-head:hover::before, .huns-head:hover::after { border-color: #eb2d2d; }
.huns-head .huns-logo { width: 104px; height: 104px; object-fit: contain; flex: none; filter: brightness(1.2) drop-shadow(0 0 14px rgba(224, 32, 32, .45)); transition: transform .3s var(--ease), filter .3s; }
.huns-head:hover .huns-logo { transform: scale(1.12) rotate(-6deg); filter: brightness(1.35) drop-shadow(0 0 12px rgba(255, 45, 45, .95)); }
.huns-head h1 { margin: 0; font-size: clamp(30px, 5vw, 46px); font-weight: 800; line-height: 1.05; letter-spacing: -.01em; }
.huns-head p { margin: 6px 0 0; }
.huns-page .admin-main { grid-template-columns: minmax(0, 1fr); }
/* Every panel gets the header's broken bracket frame in place of its rounded outline. */
.huns-page .admin-card, .huns-page .admin-hero, .huns-page .admin-hero.offline { position: relative; border: 0; border-radius: 0; background: none; } /* no fill, like the header */
.huns-page .admin-card::before, .huns-page .admin-card::after, .huns-page .admin-hero::before, .huns-page .admin-hero::after { content: ''; position: absolute; top: 0; bottom: 0; width: 34%; border: 3px solid #bb0000; pointer-events: none; transition: border-color .25s, filter .25s; }
.huns-page .admin-card::before, .huns-page .admin-hero::before { left: 0; border-right: 0; }
.huns-page .admin-card::after, .huns-page .admin-hero::after { right: 0; border-left: 0; }
.huns-page .admin-card:hover::before, .huns-page .admin-card:hover::after, .huns-page .admin-hero:hover::before, .huns-page .admin-hero:hover::after { border-color: #eb2d2d; filter: drop-shadow(0 0 6px rgba(235, 45, 45, .8)); }
.huns-page .admin-players-list .avatar { background: rgba(224, 32, 32, .18); color: #ff8080; }
.huns-page .map-tile span { color: #ff8080; }
.huns-page :focus-visible { outline: 2px solid #ff8080; outline-offset: 2px; }
/* Buttons and map tiles get the same sweep and glow as the tab. */
.huns-page .btn, .huns-page .map-tile, .huns-page .tool { position: relative; overflow: hidden; isolation: isolate; }
.huns-page .btn::before, .huns-page .map-tile::before, .huns-page .tool::before { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: -60%; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 90, 90, .42), transparent); transform: skewX(-18deg); transition: left .55s var(--ease); }
.huns-page .btn:hover::before, .huns-page .map-tile:hover::before, .huns-page .tool:hover::before { left: 115%; }
.huns-page .btn:hover, .huns-page .map-tile:hover, .huns-page .tool:hover { border-color: rgba(235, 45, 45, .9); box-shadow: 0 0 18px -5px #e02020; }
.huns-page .btn.primary::before { background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .34), transparent); }
@media (max-width: 560px) { .huns-head { gap: 14px; padding: 16px 18px; } .huns-head .huns-logo { width: 68px; height: 68px; } }
@media (prefers-reduced-motion: reduce) { .huns-link::before, .huns-page .btn::before, .huns-page .map-tile::before, .huns-page .tool::before { display: none; } .huns-link, .huns-link .huns-logo, .huns-head .huns-logo { transition: none; } .huns-head:hover .huns-logo { transform: none; } }

/* Our Clans: square cards with the Huns tab's red edge, glow and light sweep on hover. */
.clans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 480px)); gap: 16px; margin-top: 16px; }
.clan { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; aspect-ratio: 1; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); transition: border-color .25s, box-shadow .25s, background .25s, transform .25s var(--ease); }
.clan::before { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: -60%; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 70, 70, .28), transparent); transform: skewX(-18deg); transition: left .6s var(--ease); }
.clan:hover { border-color: rgba(235, 45, 45, .85); background: color-mix(in srgb, #bb0000 13%, var(--panel)); box-shadow: 0 0 26px -6px #e02020; transform: translateY(-2px); }
.clan:hover::before { left: 115%; }
.clan-head { display: flex; align-items: center; gap: 18px; }
.clan-logo { width: 104px; height: 104px; flex: none; object-fit: contain; transition: transform .3s var(--ease), filter .3s; }
.clan:hover .clan-logo { transform: scale(1.08) rotate(-5deg); filter: drop-shadow(0 0 10px rgba(255, 45, 45, .8)); }
.clan h2 { margin: 0; font-size: 30px; line-height: 1.1; }
.clan-tag { color: #ff6b6b; font-size: 20px; font-weight: 700; }
.clan-captain { display: grid; gap: 1px; margin: 10px 0 0; }
.clan-captain span { color: var(--muted); font-size: 13px; }
.clan h3 { margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); font-weight: 600; }
.clan-members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.clan-members li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 500px) { .clan { aspect-ratio: auto; } } /* a phone-width square can't fit every member */
@media (prefers-reduced-motion: reduce) { .clan::before { display: none; } .clan, .clan-logo { transition: none; } .clan:hover, .clan:hover .clan-logo { transform: none; } }

/* Charm Pattern Guide */
.cg { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.cg-side { position: sticky; top: 72px; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.cg-side .search { width: 100%; margin: 0; }
.cg-list { display: grid; gap: 2px; max-height: calc(100vh - 170px); overflow-y: auto; }
.cg-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.cg-list button:hover { background: var(--panel-2); }
.cg-list button.on { color: var(--accent); background: rgba(245, 165, 36, .1); box-shadow: inset 0 0 0 1px rgba(245, 165, 36, .35); }
.cg-list img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.cg-main { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); min-width: 0; }
.cg-stage { display: grid; place-items: center; height: 340px; border-radius: 10px; background: radial-gradient(70% 90% at 50% 45%, #232a38, #0d0f14); overflow: hidden; }
.cg-stage { position: relative; }
.cg-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cg-main h2 { margin: 0; color: var(--text); font-size: 22px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.cg-track { width: 100%; height: 22px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.cg-track::-webkit-slider-runnable-track { height: 14px; border-radius: 7px; background: var(--cg-bar, var(--panel-2)); border: 1px solid var(--line); }
.cg-track::-moz-range-track { height: 14px; border-radius: 7px; background: var(--cg-bar, var(--panel-2)); border: 1px solid var(--line); }
.cg-track::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; margin-top: -4px; border-radius: 50%; background: #fff; border: 3px solid var(--bg); box-shadow: 0 1px 5px rgba(0, 0, 0, .6); }
.cg-track::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--bg); }
.cg-pattern { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.cg-pattern label { display: grid; gap: 4px; font-size: 13px; }
.cg-pattern .text { width: 130px; }
@media (max-width: 900px) {
  .cg { grid-template-columns: 1fr; }
  .cg-side { position: static; }
  .cg-list { grid-auto-flow: column; grid-auto-columns: 130px; max-height: none; overflow-x: auto; padding-bottom: 4px; }
  .cg-stage { height: 240px; }
}

/* Easter egg: the Join button, taped off like a crime scene. */
.btn.taped { position: relative; color: var(--muted); border-color: #5c4a17; cursor: not-allowed; }
.btn.taped:hover { transform: none; border-color: #5c4a17; }
.btn.taped:active { transform: none; }
/* Each strip stops exactly at the button's edges (skew, not rotate), shades as it turns the corner, and folds behind. */
.tape { position: absolute; z-index: 1; left: -1px; right: -1px; height: 12px; background: linear-gradient(90deg, rgba(0, 0, 0, .3), transparent 9%, transparent 91%, rgba(0, 0, 0, .3)), repeating-linear-gradient(135deg, #ffc61a 0 9px, #e8ad00 9px 18px); box-shadow: 0 1px 3px rgba(0, 0, 0, .6); pointer-events: none; }
.tape i { display: block; overflow: hidden; color: #15120a; font: 800 7px/12px system-ui, sans-serif; letter-spacing: .6px; white-space: pre; text-align: center; }
.tape::before, .tape::after { content: ''; position: absolute; top: 0; width: 4px; height: 100%; background: #7d5e00; }
.tape::before { right: 100%; transform-origin: right; transform: skewY(42deg); }
.tape::after { left: 100%; transform-origin: left; transform: skewY(-42deg); }
/* One strip above the word and one below, so "Join" stays readable. */
.tape-top { top: 3px; transform: skewY(-5deg); }
.tape-bottom { bottom: 3px; transform: skewY(4deg); }
.btn.taped.shake { animation: tape-shake .4s var(--ease); }
@keyframes tape-shake { 20% { transform: translateX(-4px) rotate(-1.5deg); } 45% { transform: translateX(4px) rotate(1.5deg); } 70% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .btn.taped.shake { animation: none; } }
/* Our own dropdown (dropdown() in app.js) */
.dd { position: relative; min-width: 0; }
.dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 100%; text-align: left; cursor: pointer; }
.dd-btn span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn .ico { color: var(--muted); transition: transform .2s var(--ease); }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); }
.dd-btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
.dd-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: 320px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: menu-open .18s var(--ease); }
.dd.up .dd-list { top: auto; bottom: calc(100% + 6px); }
.dd-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.dd-opt .ico { width: 15px; height: 15px; visibility: hidden; color: var(--accent); }
.dd-opt.active { background: var(--panel-2); }
.dd-opt.on { color: var(--accent); font-weight: 600; }
.dd-opt.on .ico { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .dd-list { animation: none; } }
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- icons ---------- */
.ico { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; overflow: visible; }
.ico.big { width: 34px; height: 34px; color: var(--accent); }
.ico g, .ico path, .ico circle { transform-box: fill-box; transform-origin: center; }
/* Hover-driven: the icon moves when its button or card is hovered */
:is(a, button):hover .a-spin, .spin-always .a-spin-y { animation: spin 1.2s var(--ease); }
.spin-always .a-spin-y { animation: spin-y 1.6s linear infinite; }
:is(a, button):hover .a-spin-y { animation: spin-y 1s var(--ease); }
:is(a, button):hover .a-slash { animation: slash .5s var(--ease); }
:is(a, button):hover .a-wave { animation: wave .6s ease-in-out 2; transform-origin: 50% 100%; }
:is(a, button):hover .a-bob { animation: bob .6s ease-in-out 2; }
:is(a, button):hover .a-nudge { animation: nudge .5s var(--ease) 2; }
:is(a, button):hover .a-peel { animation: peel .7s var(--ease); transform-origin: 0 100%; }
:is(a, button):hover .a-flash { animation: flash .6s ease 2; }
:is(a, button):hover .a-door { animation: bob .5s ease; }
/* Always-on: these loop gently */
.a-eq { transform-origin: 50% 100% !important; animation: eq 1.1s ease-in-out infinite; }
.a-eq.a2 { animation-delay: -.3s; } .a-eq.a3 { animation-delay: -.6s; } .a-eq.a4 { animation-delay: -.9s; }
.a-blink { animation: blink 1.6s steps(2) infinite; } .a-blink.b2 { animation-delay: -.8s; }
.a-swing { transform-origin: 50% 0 !important; animation: swing 2.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-y { to { transform: rotateY(360deg); } }
@keyframes slash { 40% { transform: translate(-2px, 2px) rotate(-12deg); } }
@keyframes wave { 50% { transform: rotate(-14deg); } }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes nudge { 50% { transform: translateX(3px); } }
@keyframes peel { 50% { transform: skewX(-10deg) scaleY(.9); } }
@keyframes flash { 50% { opacity: .3; } }
@keyframes eq { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes swing { 50% { transform: rotate(14deg); } 0%, 100% { transform: rotate(-14deg); } }

/* ---------- header ---------- */
.shell { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side { --w: 248px; position: sticky; top: 0; flex: none; width: var(--w); height: 100vh; overflow-y: auto; padding: 14px 12px; background: #0a0c10; border-right: 1px solid var(--line); transition: width .2s var(--ease); z-index: 6; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.side-toggle { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.side-toggle:hover { color: var(--text); }
.side-backdrop { display: none; }
.top .menu-btn { display: none; }
.side-small .side { --w: 68px; }
.side-small .side .lbl, .side-small .nav-caret, .side-small .nav-sub { display: none; }
.side-small .side-head { flex-direction: column; }
.side-small .logo { height: 20px; }
.side-small .nav a { justify-content: center; padding: 11px 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: rgba(13, 15, 20, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.online-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: rgba(60, 207, 145, .1); color: var(--ok); font-weight: 700; font-size: 13px; white-space: nowrap; }
.online-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.site-search { position: relative; flex: 0 1 380px; display: flex; align-items: center; gap: 8px; margin: 0 auto; padding: 0 12px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.site-search:focus-within { border-color: var(--accent); }
.site-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); }
.site-search kbd { padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; font: 12px/18px inherit; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.search-results p { margin: 0; padding: 10px; }
.search-results button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer; }
.search-results button:hover, .search-results button:focus-visible { background: var(--panel-2); }
.search-results img, .search-noimg { width: 42px; height: 32px; object-fit: contain; flex: none; }
.search-results span { min-width: 0; }
.search-results b, .search-results small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results small { color: var(--muted); }
.me-menu { position: relative; }
.me-menu summary { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; cursor: pointer; list-style: none; }
.me-menu summary::-webkit-details-marker { display: none; }
.me-menu .name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 220px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.me-pop p { margin: 0 0 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-pop a, .me-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); text-decoration: none; text-align: left; cursor: pointer; }
.me-pop a:hover, .me-pop button:hover { background: var(--panel-2); }
.me-menu summary .ico { transition: transform .2s var(--ease); }
.me-menu[open] summary .ico { transform: rotate(180deg); }
.me-menu[open] .me-pop { transform-origin: top right; animation: menu-open .2s var(--ease); }
.me-menu[open] .me-pop > * { animation: menu-item .25s var(--ease) backwards; }
.me-pop > :nth-child(2) { animation-delay: .03s !important; }
.me-pop > :nth-child(3) { animation-delay: .06s !important; }
.me-pop > :nth-child(4) { animation-delay: .09s !important; }
.me-pop > :nth-child(5) { animation-delay: .12s !important; }
.me-pop > :nth-child(6) { animation-delay: .15s !important; }
.me-pop > :nth-child(7) { animation-delay: .18s !important; }
@keyframes menu-open { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
@keyframes menu-item { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .me-menu[open] .me-pop, .me-menu[open] .me-pop > * { animation: none; } }
.foot { margin-top: auto; padding: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot p { margin: 0 0 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--text); opacity: .75; text-decoration: none; }
.foot a:hover { opacity: 1; color: var(--accent); }
.promo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.promo-cards.one { grid-template-columns: 1fr; }
.promo { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-radius: 14px; text-decoration: none; transition: transform .2s var(--ease), filter .2s; }
.promo:hover { transform: translateY(-2px); filter: brightness(1.08); }
.promo b { display: block; font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.promo .ico { width: 44px; height: 44px; padding: 10px; border-radius: 12px; }
.promo.discord { background: var(--accent); color: var(--accent-ink); }
.promo.discord .ico { background: rgba(26, 18, 4, .14); }
.promo.insta { background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.promo.insta small { color: var(--muted); }
.promo.insta .ico { background: var(--panel-2); color: var(--accent); }
.info-page { max-width: 720px; margin: 0 auto; padding: 16px 0; }
.info-page h2 { font-size: 16px; margin: 22px 0 4px; color: var(--accent); }
.info-page p { margin: 0; color: var(--text); opacity: .85; }
.leaderboard .who a { color: inherit; text-decoration: none; }
.leaderboard .who a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s var(--ease); --w: 248px !important; }
  .side-open .side { transform: none; }
  .side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 5; background: rgba(0, 0, 0, .55); }
  .side-toggle { display: none; }
  .top .menu-btn { display: grid; flex: none; }
  .top { padding: 8px 12px; }
  .site-search kbd, .me-menu .name, .me-menu summary .ico { display: none; }
  .promo-cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .online-pill { padding: 6px 9px; font-size: 12px; }
  #discord-btn { display: none; }
  .promo { padding: 16px; }
  .promo b { font-size: 17px; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: .3px; color: var(--text); text-decoration: none; }
/* 999 dot-matrix display: lit dots glow amber, unlit ones stay faintly visible. */
.dm .on { fill: #ffb21f; filter: drop-shadow(0 0 3px rgba(255, 160, 20, .85)); }
.dm .off { fill: #2b2116; }
.logo { display: block; height: 30px; transition: transform .3s var(--ease), filter .3s; }
.logo svg { display: block; height: 100%; width: auto; }
.brand:hover .logo { transform: scale(1.06); filter: brightness(1.2); }
/* The logo already says 999; the name stays for screen readers. */
#site-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Loading screen: counter rolls 000000 -> 000999, flashes, fades. */
#boot { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: radial-gradient(60% 50% at 50% 50%, #1d150b, #07080b 70%); transition: opacity .6s ease, visibility .6s; }
#boot svg { width: min(620px, 86vw); height: auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .6)); }
#boot.done svg { animation: boot-flash .5s ease-out; }
#boot.hide { opacity: 0; visibility: hidden; transition-delay: .3s; }
@keyframes boot-flash { 40% { filter: drop-shadow(0 0 28px rgba(255, 170, 30, .7)) brightness(1.35); } }
@media (prefers-reduced-motion: reduce) { #boot.done svg { animation: none; } }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.nav a[aria-current="page"] .ico { color: var(--accent); }
.nav-group { position: relative; }
.nav-group.here > a { color: var(--text); }
.nav-caret { position: absolute; right: 6px; top: 7px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.nav-caret:hover { color: var(--text); background: var(--panel-2); }
.nav-caret[aria-expanded="true"] .ico { transform: rotate(180deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin-left: 20px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-sub a { padding: 8px 10px; font-size: 14px; }
.nav-sub a[aria-current="page"] { color: var(--accent); background: rgba(245, 165, 36, .1); box-shadow: inset 0 0 0 1px rgba(245, 165, 36, .35); }
#account { display: flex; align-items: center; gap: 10px; }
#account img { width: 30px; height: 30px; border-radius: 7px; }
#account form { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 600; white-space: nowrap; transition: transform .15s var(--ease), border-color .2s, filter .2s, box-shadow .2s; }
.btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 6px 24px -8px var(--accent); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 13px 22px; font-size: 16px; }
.btn.danger:hover { border-color: var(--err); color: var(--err); }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px; transition: color .2s, transform .2s; }
.icon-btn:hover { color: var(--text); transform: rotate(90deg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.tier { position: relative; display: flex; flex-direction: column; padding: 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.tier.hot { border-color: var(--accent); box-shadow: 0 0 40px -18px var(--accent); }
.tier-hot { position: absolute; top: -11px; left: 22px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.tier-logo svg { display: block; height: 34px; width: auto; }
.tier h2 { margin: 14px 0 2px; font-size: 22px; }
.tier p { margin: 0; }
.tier-price { margin: 16px 0 !important; padding: 12px 0; border-block: 1px solid var(--line); color: var(--accent); font-weight: 800; font-size: 18px; }
.tier-price small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.tier ul { flex: 1; margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 9px; align-content: start; }
.tier li { display: flex; gap: 9px; align-items: flex-start; }
.tier li .ico { color: var(--accent); }
.tier-how { margin-top: 16px; }
/* Owner page member list, grouped by tier. */
.admin-title ~ .admin-card + .admin-card { margin-top: 14px; }
.member-groups { display: grid; gap: 14px; margin-top: 4px; }
.member-group.t1 { --tier: var(--accent); }
.member-group.t2 { --tier: #d9770f; }
.member-group.t3 { --tier: #ffc97a; }
.member-group h3 { margin: 0 0 6px; color: var(--tier); font-size: 14px; font-weight: 700; }
.member-group ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.member-group li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.member-name { flex: 1 1 180px; min-width: 0; color: var(--tier); font-weight: 700; overflow-wrap: anywhere; }
/* Memberships closed: the tiers sit behind two strips of warning tape. */
/* Sale banner and prices. */
.tier-sale { margin: 14px 0 0; color: var(--muted); }
.tier-sale b { margin-right: 4px; background: linear-gradient(100deg, var(--accent) 35%, #fff2cf 50%, var(--accent) 65%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: tier-sheen 3.4s linear infinite; }
.tier-price s { display: block; color: var(--muted); font-size: 14px; font-weight: 500; }
.tier-now { display: block; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tier-off { position: absolute; top: 16px; right: 16px; z-index: 1; padding: 4px 10px; border-radius: 8px; background: #e0361c; color: #fff; font-size: 15px; font-weight: 800; transform: rotate(6deg); }

/* Cards rise in turn, the -20% stamps down, then each tier keeps its own live glow: stronger the higher it goes. */
.tiers.pre .tier { opacity: 0; }
.tiers:not(.pre) .tier { animation: tier-in .7s var(--ease) both, tier-glow var(--pace) ease-in-out .9s infinite; }
.tiers:not(.pre) .tier-off { animation: tier-stamp .5s cubic-bezier(.3, 1.6, .5, 1) both, tier-wiggle 4s ease-in-out 2s infinite; }
.tier.t1 { --glow: rgba(245, 165, 36, .3); --pace: 4s; --at: .1s; }
.tier.t2 { --glow: rgba(245, 165, 36, .5); --pace: 3.2s; --at: .32s; }
.tier.t3 { --glow: rgba(255, 201, 122, .75); --pace: 2.4s; --at: .54s; }
.tiers:not(.pre) .tier { animation-delay: var(--at), calc(var(--at) + .8s); }
.tiers:not(.pre) .tier-off { animation-delay: calc(var(--at) + .55s), calc(var(--at) + 2.5s); }
.tier:hover { transform: translateY(-4px); }
.tier { transition: transform .2s var(--ease), border-color .2s; }
.tier .tier-logo svg { animation: tier-led var(--pace) ease-in-out infinite; }
/* A band of light crosses each price. */
.tier-price { position: relative; overflow: hidden; }
.tier-price::after { content: ''; position: absolute; inset: 0 auto 0 -40%; width: 30%; background: linear-gradient(100deg, rgba(255, 233, 176, 0), rgba(255, 233, 176, .14), rgba(255, 233, 176, 0)); mix-blend-mode: screen; pointer-events: none; transform: skewX(-18deg); animation: tier-band calc(var(--pace) * 1.5) ease-in-out calc(var(--at) + 1.6s) infinite; }
@keyframes tier-in { from { opacity: 0; transform: translateY(46px) scale(.94); } }
@keyframes tier-glow { 50% { box-shadow: 0 0 34px -6px var(--glow); border-color: var(--glow); } }
@keyframes tier-stamp { from { opacity: 0; transform: rotate(-14deg) scale(2.6); } }
@keyframes tier-wiggle { 0%, 88%, 100% { transform: rotate(6deg) scale(1); } 92% { transform: rotate(-3deg) scale(1.14); } 96% { transform: rotate(9deg) scale(1.08); } }
@keyframes tier-led { 50% { filter: brightness(1.35) drop-shadow(0 0 5px rgba(255, 178, 31, .7)); } }
@keyframes tier-band { 0% { left: -40%; } 55%, 100% { left: 130%; } }
@keyframes tier-sheen { to { background-position: -300% 0; } }

/* The grand opening: curtains and the tape cover the whole screen until the tape is cut. */
.ceremony { position: fixed; inset: 0; z-index: 999; overflow: hidden; cursor: pointer; }
.ceremony.open { background: none; }
.cer-curtain { position: absolute; top: 0; bottom: 0; width: 50.5%; background: linear-gradient(rgba(10, 8, 6, .35), rgba(10, 8, 6, .75)), repeating-linear-gradient(90deg, #1d150b 0 34px, #2b2013 54px, #150f07 88px); transition: transform 1.25s cubic-bezier(.7, 0, .2, 1); }
.cer-curtain.l { left: 0; border-right: 3px solid var(--accent); box-shadow: 8px 0 34px rgba(245, 165, 36, .35); }
.cer-curtain.r { right: 0; border-left: 3px solid var(--accent); box-shadow: -8px 0 34px rgba(245, 165, 36, .35); }
.ceremony.open .cer-curtain.l { transform: translateX(-104%); }
.ceremony.open .cer-curtain.r { transform: translateX(104%); }
.cer-mark { position: absolute; left: 50%; top: 50%; display: grid; justify-items: center; gap: 6px; width: min(460px, 82vw); text-align: center; opacity: 0; transform: translate(-50%, -50%); transition: opacity .5s, transform .9s var(--ease); }
.ceremony.ready .cer-mark { opacity: 1; } /* hidden until the loading screen is gone, so the two 999s never overlap */
.cer-mark svg { width: min(300px, 62vw); height: auto; filter: drop-shadow(0 0 22px rgba(255, 170, 30, .45)); }
.cer-mark strong { margin-top: 118px; color: var(--accent); font-size: clamp(30px, 6vw, 52px); font-weight: 800; letter-spacing: .5px; opacity: 0; transform: translateY(14px); transition: opacity .35s, transform .5s var(--ease); }
.cer-mark span { color: #eadfc8; opacity: 0; transition: opacity .35s .1s; }
.ceremony.cut .cer-mark strong { opacity: 1; transform: none; }
.ceremony.cut .cer-mark span { opacity: 1; }
.ceremony.open .cer-mark { opacity: 0; transform: translate(-50%, -50%) scale(1.25); transition-delay: .55s; }
.cer-tape { position: absolute; left: -10%; width: 120%; height: 46px; pointer-events: none; }
.cer-tape.a { top: 44%; transform: rotate(-6deg); }
.cer-tape.b { top: 56%; transform: rotate(4deg); }
.ceremony.ready .cer-tape { animation: cer-tense 1.4s ease-in both; }
.cer-half { position: absolute; inset: 0; display: block; overflow: hidden; background: repeating-linear-gradient(135deg, #ffc61a 0 24px, #e8ad00 24px 48px); box-shadow: 0 3px 14px rgba(0, 0, 0, .7); }
.cer-half i { display: block; color: #15120a; font: 800 21px/46px system-ui, sans-serif; font-style: normal; letter-spacing: 1.5px; white-space: pre; text-align: center; }
.cer-half.l { clip-path: inset(-20px 50% -20px -20px); transform-origin: 8% 50%; }
.cer-half.r { clip-path: inset(-20px -20px -20px 50%); transform-origin: 92% 50%; }
.ceremony.cut .cer-half.l { animation: cer-fall-l 1.25s cubic-bezier(.45, 0, .9, .6) forwards; }
.ceremony.cut .cer-half.r { animation: cer-fall-r 1.25s cubic-bezier(.45, 0, .9, .6) .06s forwards; }
.cer-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 233, 176, .95), rgba(255, 178, 31, .35) 28%, transparent 62%); opacity: 0; pointer-events: none; }
.ceremony.cut .cer-flash { animation: cer-flash .6s ease-out; }
.cer-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@keyframes cer-tense { 0%, 55% { translate: 0 0; } 70% { translate: -2px 1px; } 80% { translate: 3px -1px; } 90% { translate: -3px 2px; } 100% { translate: 3px -2px; } }
@keyframes cer-fall-l { 18% { rotate: 7deg; } 100% { rotate: 50deg; translate: -14% 115vh; } }
@keyframes cer-fall-r { 18% { rotate: -7deg; } 100% { rotate: -46deg; translate: 14% 115vh; } }
@keyframes cer-flash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tier, .tier-off, .tier .tier-logo svg, .tier-price::after, .tier-sale b { animation: none !important; }
  .tier-sale b { color: var(--accent); background: none; }
}
.tier-mine { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; color: var(--accent); font-weight: 700; }
.admin-players-list li.muted { display: block; }
.member-form { display: grid; grid-template-columns: 2fr 2fr 1.2fr .8fr auto; gap: 8px; margin: 10px 0; }
@media (max-width: 760px) { .member-form { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .tiers { grid-template-columns: 1fr; } }
main.fade-in { animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }

/* ---------- home ---------- */
.hero { position: relative; text-align: center; padding: 80px 0 50px; isolation: isolate; }
.hero-glow { position: absolute; inset: 0 10%; z-index: -1; background: radial-gradient(40% 50% at 30% 40%, rgba(245, 165, 36, .18), transparent 70%), radial-gradient(35% 45% at 70% 55%, rgba(91, 141, 239, .16), transparent 70%); filter: blur(20px); animation: drift 12s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(4%, -4%) scale(1.08); } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; margin: 0 0 14px; }
.hero h1 { font-size: clamp(32px, 6vw, 60px); margin: 0 0 14px; line-height: 1.05; animation: rise .6s var(--ease) both; }
.hero h1 em { color: var(--accent); font-style: normal; }
.lead { color: var(--muted); max-width: 560px; margin: 0 auto 30px; font-size: 17px; animation: rise .6s .1s var(--ease) both; }
.hero .actions { display: flex; gap: 12px; margin-top: 28px; justify-content: center; flex-wrap: wrap; animation: rise .6s .2s var(--ease) both; }

#servers { scroll-margin-top: 80px; }
.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.server { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); transition: border-color .2s, transform .2s var(--ease); }
.server:hover { border-color: var(--muted); transform: translateY(-2px); }
.server.offline { opacity: .7; }
.server.skeleton { min-height: 190px; background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.server-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.server h3 { margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 700; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 1.8s infinite; }
.live.off { color: var(--muted); }
.live.off::before { animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } }
.server-meta { display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
.server-meta span { display: inline-flex; align-items: center; gap: 6px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--accent)); border-radius: 3px; transition: width .8s var(--ease); }
.server-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.server-actions .btn:last-child { flex: 1; min-width: 0; }


/* ---------- loadout ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 14px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 600; transition: color .2s, background .2s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); }
.tabs button[aria-selected="true"] .ico { color: var(--accent); }
.teams { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.teams button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; transition: color .2s, background .25s var(--ease); }
.teams button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
.teams button[data-team="t"][aria-pressed="true"] { color: var(--t); box-shadow: inset 0 -2px var(--t); }
.teams button[data-team="ct"][aria-pressed="true"] { color: var(--ct); box-shadow: inset 0 -2px var(--ct); }
.hint { color: var(--muted); font-size: 13px; margin: -8px 0 16px; }
.hint code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; color: var(--accent); }

section > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 28px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
/* One line under a card's name: wear, StatTrak, stickers, charm. */
.card-tags { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.card-tags .st { color: #ff9a3c; }
/* Profile: T and CT loadouts side by side. */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 26px 0 12px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; }
.loadout-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .loadout-sides { grid-template-columns: 1fr; } }
.side-loadout { --team: #e7b45a; padding: 14px; border: 1px solid var(--line); border-top: 3px solid var(--team); border-radius: 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--team) 7%, var(--panel)), var(--panel) 120px); }
.side-loadout.ct { --team: #6ea8ff; }
.side-loadout > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.side-loadout > header b { color: var(--team); font-size: 17px; letter-spacing: .02em; }
.side-group h3 { margin: 12px 0 8px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.card { position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 2px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; min-width: 0; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); transition: border-color .2s, background .2s, transform .2s var(--ease), box-shadow .2s; }
.card:hover { border-color: var(--muted); background: var(--panel-2); transform: translateY(-3px); box-shadow: 0 10px 30px -14px #000; }
.card.equipped { border-color: var(--accent); }
.card .img { aspect-ratio: 4 / 3; display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, #252c3a, transparent 70%); border-radius: 6px; margin-bottom: 6px; overflow: hidden; }
.card img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .35s var(--ease); }
.card:hover img { transform: scale(1.08) rotate(-3deg); }
.card .placeholder { color: var(--muted); font-size: 12px; }
.card-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.equipped .card-sub { color: var(--accent); }
.badge { position: absolute; top: 8px; right: 8px; z-index: 1; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; animation: pop .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }

.search { width: 100%; max-width: 360px; padding: 9px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; transition: border-color .2s; }
.search:focus { border-color: var(--accent); outline: none; }
.empty { color: var(--muted); padding: 12px 0; grid-column: 1 / -1; }

/* ---------- dialog ---------- */
dialog { width: min(960px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 14px; }
dialog.wide { width: min(1180px, calc(100vw - 24px)); }
dialog[open] { animation: dlg-in .3s var(--ease); }
dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(3px); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.dlg-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 18px; }
#dlg-body { padding: 18px; }

/* ---------- skin editor ---------- */
dialog.editor { width: calc(100vw - 24px); height: calc(100vh - 24px); max-height: none; border-radius: 16px; background: #0b0d11; }
dialog.editor .dlg-head { display: none; }
dialog.editor #dlg-body { padding: 0; height: 100%; }
.ed { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.ed-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #0f1218; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { background: none; border: 0; padding: 6px 14px; border-radius: 6px; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.ed-title { display: flex; gap: 6px; align-items: baseline; font-size: 16px; min-width: 0; }
.ed-title span { color: var(--muted); }
.ed-title span::after { content: " |"; }
.ed-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-team { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 3px 8px; border-radius: 99px; }
.ed-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.esc { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--muted); font-weight: 600; cursor: pointer; padding: 6px; }
.esc-x { display: grid; place-items: center; width: 28px; height: 28px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 12px; transition: transform .25s var(--ease); }
.esc:hover { color: var(--text); }
.esc:hover .esc-x { transform: rotate(90deg); }

.ed-stage { position: relative; overflow: hidden; background: radial-gradient(60% 60% at 40% 50%, rgba(91, 141, 239, .07), transparent 70%), radial-gradient(circle, rgba(255, 255, 255, .06) 1px, transparent 1.2px) 0 0 / 22px 22px, #0b0d11; }
.ed-view, .ed-flat { position: absolute; inset: 0; }
.ed-view canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; touch-action: none; }
.ed-view canvas:active { cursor: grabbing; }
.ed-flat { display: grid; place-items: center; padding: 60px 360px 60px 40px; }
.ed-flat img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .5)); animation: pop .4s var(--ease); }
.ed-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); padding-right: 340px; pointer-events: none; }
.ed-loading .ico { width: 44px; height: 44px; color: var(--accent); }

.ed-strip { position: absolute; top: 16px; left: calc(50% - 173px); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; background: rgba(22, 26, 34, .85); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; animation: rise .4s var(--ease) both; }
.strip-slot { display: grid; place-items: center; width: 52px; height: 44px; border-radius: 8px; border: 1px solid transparent; background: var(--panel-2); color: var(--muted); cursor: pointer; transition: border-color .2s, transform .2s var(--ease), background .2s; }
.strip-slot:hover { transform: translateY(-2px); color: var(--text); }
.strip-slot.active { border-color: var(--accent); background: #2a2416; }
.strip-slot img { width: 38px; height: 38px; object-fit: contain; animation: pop .3s var(--ease); }
.strip-sep { width: 1px; height: 28px; background: var(--line); margin: 0 4px; }

.ed-panel { position: absolute; top: 16px; right: 16px; bottom: 16px; width: 330px; display: flex; flex-direction: column; gap: 12px; overflow: auto; pointer-events: none; }
.ed-panel > * { pointer-events: auto; }
.ed-side-extra:empty { display: none; }
.ed-card { background: rgba(22, 26, 34, .92); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; animation: rise .35s var(--ease) both; }
.ed-card > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ed-card > header b { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-card > header img { width: 32px; height: 32px; object-fit: contain; }
.card-body { padding: 14px; display: grid; gap: 16px; }
.card-body[hidden] { display: none; }
.icon-btn.small { font-size: 14px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: var(--panel-2); padding: 0; }
.icon-btn.small:hover { transform: none; color: var(--text); }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.row { display: flex; gap: 8px; }

.ctl { display: grid; gap: 8px; }
.ctl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ctl .num { width: 76px; padding: 5px 8px; text-align: right; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; color: var(--text); }
.ctl input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; background: var(--panel-2); outline-offset: 6px; }
.ctl input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; transition: transform .15s; }
.ctl input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.ctl input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
.ctl input.float-track { background: linear-gradient(90deg, #2fa4c9 0 7%, #5bbf55 7% 15%, #e3c34a 15% 38%, #f08a3a 38% 45%, #e5483f 45% 100%); }
.quality { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.quality button { padding: 7px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-weight: 700; font-size: 12px; cursor: pointer; transition: all .2s; }
.quality button:hover { color: var(--text); }
.quality button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); border-color: var(--muted); }
.text { width: 100%; padding: 9px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
/* Quality buttons and the StatTrak kill-count box side by side. */
.quality-row { display: grid; grid-template-columns: 1fr 112px; gap: 12px; align-items: end; }
.text.stattrak { text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .08em; padding: 7px 8px; }
.text.stattrak:disabled { opacity: .4; }
.st-toggle { position: relative; width: 30px; height: 17px; padding: 0; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; transition: background .2s, border-color .2s; }
.st-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s; }
.st-toggle[aria-checked="true"] { background: #f5a52433; border-color: var(--accent); }
.st-toggle[aria-checked="true"]::after { transform: translateX(13px); background: var(--accent); }
.st-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chooser .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 46vh; overflow: auto; padding: 2px; gap: 6px; }
.chooser .card { padding: 6px; }
.chooser .card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; min-height: 3.9em; font-size: 11px; font-weight: 500; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.chooser .search { max-width: none; margin-bottom: 10px; }

.ed-hints { position: absolute; left: calc(50% - 173px); bottom: 16px; transform: translateX(-50%); display: flex; gap: 16px; padding: 8px 14px; background: rgba(22, 26, 34, .85); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ed-hints > span { display: inline-flex; align-items: center; gap: 7px; }
.ed-hints .mouse { display: inline-block; width: 14px; height: 20px; }
.ed-hints .mouse svg { display: block; width: 100%; height: 100%; }
.ed-hints .mouse .body { fill: var(--panel-2); stroke: var(--muted); stroke-width: 1.2; }
.ed-hints .mouse .line { fill: none; stroke: var(--muted); stroke-width: 1; }
.ed-hints .mouse .wheel { fill: var(--muted); }
.ed-hints .mouse .lit { fill: var(--accent); }
.hint-two { display: grid; line-height: 1.15; }
.hint-two b { color: var(--text); font-size: 12px; }
.ed-tools { position: absolute; right: 362px; bottom: 16px; display: grid; gap: 6px; padding: 6px; background: rgba(22, 26, 34, .85); border: 1px solid var(--line); border-radius: 12px; }
.tool { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--panel-2); border: 0; color: var(--text); cursor: pointer; transition: background .2s, transform .15s; }
.tool:hover { background: #2a3242; }
.tool:active { transform: scale(.94); }
/* Selected sticker on the 3D gun: outline, rotate handle, toolbar. Only the controls take clicks. */
.sel { position: absolute; inset: 0; pointer-events: none; }
/* Corner brackets like the site's frames. The dark shadow keeps them readable on bright skins as well as dark ones. */
.sel-box {
  --c: var(--accent); --len: 16px; --w: 2.5px;
  position: absolute; border: 1px solid rgba(245, 165, 36, .28);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--len) var(--w), linear-gradient(var(--c), var(--c)) 0 0 / var(--w) var(--len),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--len) var(--w), linear-gradient(var(--c), var(--c)) 100% 0 / var(--w) var(--len),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--len) var(--w), linear-gradient(var(--c), var(--c)) 0 100% / var(--w) var(--len),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--len) var(--w), linear-gradient(var(--c), var(--c)) 100% 100% / var(--w) var(--len);
  background-repeat: no-repeat; background-origin: border-box; filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .95));
  animation: sel-fade .15s ease-out;
}
@keyframes sel-fade { from { opacity: 0; } }
.sel-handle { position: absolute; left: 50%; top: -36px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; color: var(--accent); background: #161a22; border: 1.5px solid var(--accent); cursor: grab; pointer-events: auto; touch-action: none; transition: background .12s, color .12s, transform .12s; }
/* Rotate arrow, drawn with currentColor so it follows the hover colors. */
.sel-handle::before { content: ''; position: absolute; inset: 3px; background: currentColor; -webkit-mask: var(--rotate-ico) center / contain no-repeat; mask: var(--rotate-ico) center / contain no-repeat; --rotate-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.5-5.8'/%3E%3Cpath d='M20 3v5h-5'/%3E%3C/svg%3E"); }
.sel-handle::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 11px; margin: 1.5px 0 0 -.75px; background: var(--accent); }
.sel-handle:hover { background: var(--accent); color: #161a22; transform: scale(1.1); }
.sel-handle:active { cursor: grabbing; background: var(--accent); color: #161a22; }
@media (prefers-reduced-motion: reduce) { .sel-box { animation: none; } .sel-handle { transition: none; } }
.sel-bar, .sel-pop { position: absolute; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: rgba(22, 26, 34, .92); border: 1px solid var(--line); border-radius: 12px; pointer-events: auto; animation: sel-in .15s ease-out; }
.sel-pop { width: 240px; padding: 8px 12px; }
.sel-pop .ctl { width: 100%; }
.sel-bar .tool.danger { color: #f05252; }
@keyframes sel-in { from { opacity: 0; transform: translateX(-50%) translateY(4px); } }
.a-nudge-back { animation: none; }
:is(a, button):hover .a-nudge-back { animation: nudge-back .5s var(--ease) 2; }
@keyframes nudge-back { 50% { transform: translateX(-3px); } }
.a-draw { stroke-dasharray: 22; stroke-dashoffset: 0; }
:is(a, button):hover .a-draw { animation: draw .5s var(--ease); }
@keyframes draw { from { stroke-dashoffset: 22; } }
.a-slide { animation: slide 2.4s ease-in-out infinite; }
.a-slide.b2 { animation-delay: -1.2s; }
@keyframes slide { 50% { transform: translateX(-5px); } }

@media (max-width: 900px) {
  dialog.editor { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; margin: 0; }
  .ed-stage { display: flex; flex-direction: column; overflow: auto; }
  .ed-view, .ed-flat { position: relative; inset: auto; height: 46vh; flex: none; }
  .ed-flat { padding: 24px; }
  .ed-loading { position: absolute; inset: 0 0 auto; height: 46vh; padding: 0; }
  .ed-strip { position: relative; top: auto; left: auto; transform: none; align-self: center; margin: 10px; order: 2; }
  .ed-panel { position: relative; inset: auto; width: auto; overflow: visible; padding: 0 12px 16px; order: 3; }
  .ed-hints { display: none; }
  .ed-tools { position: absolute; right: 10px; top: calc(46vh - 180px); bottom: auto; }
  .ed-actions .btn:nth-child(2) { display: none; }
  .ed-team { display: none; }
}

#toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; transform: translate(-50%, 20px); background: var(--panel-2); border: 1px solid var(--ok); padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s var(--ease); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { border-color: var(--err); }

@media (max-width: 760px) {
  .site-search { flex: 1 1 0; min-width: 0; }
  .online-pill { flex: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .servers { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- profile ---------- */
#account .me { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; border-radius: 8px; padding: 2px 6px 2px 2px; transition: background .2s; }
#account .me:hover { background: var(--panel-2); }
.profile-card { position: relative; display: flex; gap: 28px; align-items: center; padding: 28px; margin-top: 12px; background: radial-gradient(80% 120% at 0% 0%, rgba(245, 165, 36, .12), transparent 60%), var(--panel); border: 1px solid var(--line); border-radius: 16px; animation: rise .4s var(--ease) both; }
.profile-avatar { position: relative; flex: none; width: 128px; height: 128px; border-radius: 16px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; font-size: 48px; font-weight: 700; color: var(--accent); box-shadow: 0 0 0 3px var(--line); }
.profile-avatar.online { box-shadow: 0 0 0 3px var(--ok); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-main { display: grid; gap: 12px; min-width: 0; }
.profile-main h1 { margin: 0; font-size: clamp(24px, 4vw, 36px); line-height: 1.1; overflow-wrap: anywhere; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { display: grid; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; min-width: 110px; }
.stat b { font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }
.profile-main .row { flex-wrap: wrap; }
.note { font-size: 12px; }
@media (max-width: 640px) {
  .profile-card { flex-direction: column; align-items: flex-start; padding: 20px; }
  .profile-avatar { width: 96px; height: 96px; }
}
.empty a, .muted a { color: var(--accent); }

/* ---------- admin ---------- */
.admin-title { margin: 8px 0 18px; }
.admin-title h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.01em; }
.admin-title p { margin: 0; }
/* Status banner: server name and live info on the left, player count on the right. */
.admin-hero { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: radial-gradient(80% 140% at 0% 0%, rgba(255, 178, 31, .12), transparent 60%), var(--panel); animation: rise .35s var(--ease) both; }
.admin-hero.offline { background: var(--panel); }
.admin-hero-main { display: grid; gap: 8px; min-width: 0; }
.admin-hero-main h2 { margin: 0; font-size: 28px; letter-spacing: -.01em; }
.admin-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: 13px; text-transform: capitalize; }
.pill .ico { width: 14px; height: 14px; }
.pill.warn { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.admin-hero-players { display: grid; gap: 6px; min-width: 180px; text-align: right; }
.admin-hero-players b { font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.admin-hero-players small { font-size: 18px; color: var(--muted); font-weight: 600; }
.admin-status > .dd { max-width: 260px; margin-bottom: 12px; }
/* Controls on the left, players on the right; one column on small screens. */
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; margin: 14px 0; align-items: start; }
.admin-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 640px) { .admin-main { grid-template-columns: 1fr; } }
.admin-main > .admin-card:last-child { grid-column: 1 / -1; }
.admin-side { position: sticky; top: 76px; }
@media (max-width: 900px) { .admin-layout { grid-template-columns: 1fr; } .admin-side { position: static; } }
.admin-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; animation: rise .35s var(--ease) both; }
.admin-card > header { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.admin-card > header .ico { color: var(--accent); }
.admin-card-body { padding: 16px; display: grid; gap: 12px; align-content: start; }
.admin-card-body .muted { margin: 0; font-size: 13px; }
.admin-card .btn { justify-content: center; min-width: 0; }
.admin-card .btn .arm-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stepper { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px auto; gap: 8px; align-items: center; }
.step-value { display: grid; place-items: center; height: 38px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-variant-numeric: tabular-nums; }
.send-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.admin-players-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.admin-players-list li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.admin-players-list .avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 178, 31, .14); color: var(--accent); font-weight: 800; font-size: 13px; }
.admin-players-list .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
/* Map tiles; the current map is highlighted. */
.map-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 8px; }
/* The map's picture sits behind the name, darkened at the bottom so the text stays readable. */
.map-tile { display: grid; align-content: end; gap: 2px; aspect-ratio: 16 / 9; padding: 8px 10px; text-align: left; border-radius: 8px; border: 1px solid var(--line); background: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, .15) 70%), var(--map) center / cover, var(--panel-2); color: #fff; cursor: pointer; transition: border-color .2s, transform .15s var(--ease); }
.map-tile b { text-transform: capitalize; font-size: 15px; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.map-tile span { display: none; font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.map-tile:hover { border-color: var(--muted); transform: translateY(-1px); }
.map-tile.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); cursor: default; }
.map-tile.current span { display: block; }
/* Waiting for the second click that confirms. */
.map-tile.armed { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.map-tile.armed span { display: block; }
.btn.armed { border-color: var(--err); color: var(--err); background: color-mix(in srgb, var(--err) 12%, var(--panel-2)); }

/* ---------- 999 ranks ---------- */
.rank-badge { display: inline-grid; width: 40px; height: 40px; flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.rank-badge svg { width: 100%; height: 100%; overflow: visible; }
.rank-badge.big { width: 104px; height: 104px; animation: rise .5s var(--ease) both; }
.rank-card { display: flex; gap: 24px; align-items: center; padding: 22px 26px; margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.rank-card.g6 { background: radial-gradient(70% 140% at 0% 50%, rgba(255, 79, 163, .16), transparent 70%), var(--panel); }
.rank-card.g5 { background: radial-gradient(70% 140% at 0% 50%, rgba(167, 92, 255, .14), transparent 70%), var(--panel); }
.rank-card h2 { margin: 0 0 2px; font-size: 26px; }
.rank-card p { margin: 0 0 10px; }
.rank-info { flex: 1; min-width: 0; display: grid; gap: 4px; }
.rank-info .bar { height: 8px; margin-bottom: 10px; max-width: 420px; }
.rank-ladder { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; margin-bottom: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; justify-content: center; }
.rank-ladder .rank-badge { width: 34px; height: 34px; }
.ranks-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.leaderboard { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.leaderboard li { display: grid; grid-template-columns: 30px 40px minmax(0, 1fr) 80px 70px 60px; gap: 12px; align-items: center; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; animation: rise .35s var(--ease) both; }
.leaderboard li.me { border-color: var(--accent); }
.leaderboard .pos { font-weight: 700; color: var(--muted); text-align: center; }
.leaderboard li:nth-child(-n+3) .pos { color: var(--accent); }
.leaderboard .who, .leaderboard .num { display: grid; min-width: 0; }
.leaderboard .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard small { font-size: 12px; }
.leaderboard .num { text-align: right; }
.xp-rules ul { list-style: none; margin: 0; padding: 8px 16px 14px; }
.xp-rules li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.xp-rules li:last-child { border-bottom: 0; }
.xp-rules b { color: var(--ok); white-space: nowrap; }
.xp-rules b.neg { color: var(--err); }
@media (max-width: 760px) {
  .ranks-layout { grid-template-columns: minmax(0, 1fr); }
  .leaderboard li { grid-template-columns: 24px 34px minmax(0, 1fr) 64px; gap: 8px; padding: 8px 10px; }
  .leaderboard .hide-sm { display: none; }
  .rank-card { flex-direction: column; text-align: center; padding: 20px 16px; }
  .rank-info .bar { margin-inline: auto; width: 100%; }
  .rank-card .stats { justify-content: center; }
}

/* ---------- owner moderation log ---------- */
.log-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.log-tools .text { flex: 1 1 220px; max-width: 340px; }
.log-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13px; }
.chip small { color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.on small { color: inherit; opacity: .7; }
.log-rows, .log-active-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.log-row, .log-active-list li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 10px; animation: rise .3s var(--ease) both; }
.log-active-list li { background: var(--bg); }
.log-row.bad { border-left-color: var(--err); }
.log-row.warn { border-left-color: var(--accent); }
.log-row.good { border-left-color: var(--ok); }
.log-row.info { border-left-color: var(--ct); }
.log-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.log-row.bad .log-kind, .log-kind.bad { color: var(--err); }
.log-row.warn .log-kind, .log-kind.warn { color: var(--accent); }
.log-row.good .log-kind { color: var(--ok); }
.log-row.info .log-kind { color: var(--ct); }
.log-main { min-width: 0; }
.log-main a { color: var(--text); font-weight: 600; }
.log-main .muted a { color: var(--muted); font-weight: 400; }
.log-detail { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.log-row time { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .log-row, .log-active-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .log-kind { grid-column: 1 / -1; }
  .log-tools .text { max-width: none; }
}

/* Skins pages for visitors who aren't signed in: a few skins behind a lock, then how it works. */
.signin-wall { position: relative; isolation: isolate; overflow-x: clip; display: grid; justify-items: center; text-align: center; padding: 40px 0 60px; }
.signin-wall h1 { margin: 6px 0 12px; font-size: clamp(28px, 5vw, 46px); line-height: 1.1; animation: rise .6s .15s var(--ease) both; }
.signin-wall h1 em { color: var(--accent); font-style: normal; }
.signin-wall .lead { margin-bottom: 22px; animation-delay: .25s; }
.signin-fan { position: relative; width: min(560px, 100%); height: 170px; margin-bottom: -12px; }
.signin-skin { position: absolute; left: 50%; bottom: 0; width: 230px; margin: 0 0 0 -115px; padding: 12px 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); filter: saturate(.75); animation: signin-deal .8s var(--ease) both; }
.signin-skin img { display: block; width: 100%; height: 92px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)); }
.signin-skin figcaption { margin-top: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signin-skin.s0 { --to: translateX(-62%) rotate(-11deg); }
.signin-skin.s1 { --to: translateY(-14px); z-index: 1; filter: none; border-color: rgba(245, 165, 36, .5); }
.signin-skin.s2 { --to: translateX(62%) rotate(11deg); }
.signin-skin { transform: var(--to); }
.signin-skin.s1 { animation-delay: .08s; }
.signin-skin.s2 { animation-delay: .16s; }
@keyframes signin-deal { from { opacity: 0; transform: translateY(40px) rotate(0deg) scale(.9); } }
.signin-lock { position: relative; z-index: 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 6px var(--bg), 0 0 30px rgba(245, 165, 36, .55); animation: pop .5s .45s var(--ease) both, signin-pulse 2.6s 1.2s ease-in-out infinite; }
.signin-lock .ico { width: 24px; height: 24px; }
@keyframes signin-pulse { 50% { box-shadow: 0 0 0 6px var(--bg), 0 0 46px rgba(245, 165, 36, .85); } }
.signin-wall .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; animation: rise .6s .45s var(--ease) both; }
@media (max-width: 700px) {
  .signin-fan { height: 140px; }
  .signin-skin { width: 170px; margin-left: -85px; }
  .signin-skin img { height: 68px; }
  .signin-skin.s0 { --to: translateX(-46%) rotate(-10deg); }
  .signin-skin.s2 { --to: translateX(46%) rotate(10deg); }
}
@media (prefers-reduced-motion: reduce) { .signin-skin, .signin-lock, .signin-wall h1, .signin-wall .actions { animation: none; } }

/* Home only: a glow fixed behind the page, so the content scrolls over still light, and the 999 logo lit like a sign. */
body.page-home::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 46% at 26% 22%, rgba(245, 165, 36, .22), transparent 70%),
    radial-gradient(38% 42% at 82% 30%, rgba(255, 120, 30, .10), transparent 72%),
    radial-gradient(46% 40% at 60% 92%, rgba(70, 110, 220, .10), transparent 70%); }

.home-sign svg { display: block; width: 100%; height: auto; overflow: visible; }
.home-sign .dm .on { fill: #ffbf3a; filter: drop-shadow(0 0 4px rgba(255, 186, 60, .95)) drop-shadow(0 0 14px rgba(255, 150, 20, .75)) drop-shadow(0 0 34px rgba(255, 130, 10, .45)); animation: sign-hum 5s ease-in-out infinite; }
.home-sign .dm .off { fill: #2a2016; }
/* A lit sign hums: a slow breath, and now and then one short flicker. */
@keyframes sign-hum { 0%, 100% { opacity: 1; } 47% { opacity: .9; } 48% { opacity: .55; } 49% { opacity: 1; } 51% { opacity: .75; } 52% { opacity: 1; } 75% { opacity: .93; } }
@media (prefers-reduced-motion: reduce) { .home-sign .dm .on { animation: none; } }

/* Home: a compact lit header, the server numbers as tiles, then every server as a wide tile on its map. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home-head { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); padding: clamp(20px, 3vw, 36px) 0 clamp(22px, 3vw, 34px); }
.home-sign { flex: none; width: clamp(170px, 18vw, 250px); animation: rise .7s var(--ease) both; }
.home-head h1 { margin: 0; font-size: clamp(26px, 3vw, 42px); line-height: 1.05; letter-spacing: -.025em; animation: rise .6s .1s var(--ease) both; }
.home-head h1 em { color: var(--accent); font-style: normal; }
.home-head .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; animation: rise .6s .18s var(--ease) both; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 18px 20px; border-radius: 16px; background: rgba(22, 26, 34, .82); animation: rise .5s var(--ease) both; }
.stat:nth-child(2) { animation-delay: .04s; } .stat:nth-child(3) { animation-delay: .08s; } .stat:nth-child(4) { animation-delay: .12s; } .stat:nth-child(5) { animation-delay: .16s; } .stat:nth-child(6) { animation-delay: .2s; }
.stat span { display: grid; gap: 2px; min-width: 0; }
.stat small { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .ico { flex: none; width: 30px; height: 30px; color: var(--accent); opacity: .9; }
.stat.hot { box-shadow: inset 0 0 0 2px var(--accent), 0 0 28px -8px rgba(245, 165, 36, .7); }
.stat.hot small { color: #ffe0a6; }

.server-board { margin-top: 18px; scroll-margin-top: 80px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 8px; border-radius: 16px; background: rgba(22, 26, 34, .82); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 9px 16px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.chips button:hover { color: var(--text); background: var(--panel-2); }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.chips button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-note { padding-right: 10px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.tile { position: relative; isolation: isolate; display: grid; grid-template-rows: 1fr auto; min-height: 116px; overflow: hidden; border-radius: 16px; background: var(--panel); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); transition: transform .2s var(--ease); }
.tile:hover { transform: translateY(-3px); }
.tile.skeleton { background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.tile-pic { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tile:hover .tile-pic { transform: scale(1.06); }
.tile::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10, 11, 15, .9) 0%, rgba(10, 11, 15, .62) 55%, rgba(10, 11, 15, .35) 100%); } /* keeps the text readable on any map */
.tile.offline .tile-pic { filter: grayscale(1) brightness(.6); }
.tile-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 18px; }
.tile-text { min-width: 0; }
.tile h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.tile p { margin: 0; color: #d9d4ca; font-size: 14px; letter-spacing: .02em; }
.tile p b { color: var(--text); }
.tile-copy { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #d9d4ca; cursor: pointer; transition: background .15s, color .15s; }
.tile-copy .ico { width: 17px; height: 17px; }
.tile-copy:hover { background: rgba(255, 255, 255, .1); color: var(--accent); }
.tile-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tile-ip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 0; border-radius: 999px; background: rgba(10, 11, 15, .72); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.tile-ip .ico { width: 16px; height: 16px; }
.tile-ip:hover { background: var(--accent); color: var(--accent-ink); }
.tile-play { position: relative; overflow: hidden; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: rgba(10, 11, 15, .72); color: var(--text); cursor: pointer; }
.tile-play .ico { width: 18px; height: 18px; }
.tile-play .tape { position: absolute; left: -20%; right: -20%; top: 40%; transform: rotate(-24deg); }
.tile-bar { height: 4px; margin: 0 18px 14px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.tile-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 10px rgba(245, 165, 36, .8); transition: width .6s var(--ease); }
.tile:focus-within { box-shadow: 0 0 0 2px var(--accent); }

.home-close { display: grid; gap: 14px; margin-top: 18px; }
.home-close.two { grid-template-columns: 1fr 1fr; }
.home-close .promo { padding: 18px 24px; border-radius: 16px; }
.home-close .promo b { font-size: 22px; text-transform: none; letter-spacing: -.01em; }
.home-close .promo small { font-size: 14px; }
.home-close .promo .ico { width: 44px; height: 44px; padding: 10px; }

@media (max-width: 1150px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .home-head { flex-direction: column; align-items: flex-start; }
  .home-sign { width: 170px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 22px; }
  .tiles { grid-template-columns: 1fr; }
  .tile-ip span, .tile-ip { font-size: 13px; }
  .home-close.two { grid-template-columns: 1fr; }
  .filter-note { padding: 0 8px 4px; }
}
@media (prefers-reduced-motion: reduce) { .home-sign, .home-head h1, .home-head .actions, .stat, .tile { animation: none; } .tile:hover, .tile:hover .tile-pic { transform: none; } }

/* Sidebar hover: an amber bar slides in on the left, a warm wash fades in, the icon lights and steps forward.
   The current page keeps the bar lit. The Huns link keeps its own red look. */
.nav a:not(.huns-link) { position: relative; isolation: isolate; overflow: hidden; transition: color .2s, background .2s, transform .25s var(--ease); }
.nav a:not(.huns-link)::before { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 10px rgba(245, 165, 36, .9); transform: scaleY(0); transition: transform .25s var(--ease); }
.nav a:not(.huns-link)::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(245, 165, 36, .16), rgba(245, 165, 36, 0) 75%); opacity: 0; transition: opacity .25s; }
.nav a:not(.huns-link) .ico { transition: color .2s, transform .25s var(--ease), filter .25s; }
.nav a:not(.huns-link):hover { color: var(--text); background: transparent; transform: translateX(2px); }
.nav a:not(.huns-link):hover::before, .nav a[aria-current="page"]:not(.huns-link)::before { transform: scaleY(1); }
.nav a:not(.huns-link):hover::after { opacity: 1; }
.nav a:not(.huns-link):hover .ico { color: var(--accent); transform: translateX(2px) scale(1.1); filter: drop-shadow(0 0 6px rgba(245, 165, 36, .75)); }
.nav a[aria-current="page"]:not(.huns-link) { background: transparent; }
.nav a[aria-current="page"]:not(.huns-link)::after { opacity: .75; }
.nav a:not(.huns-link):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-sub a[aria-current="page"] { box-shadow: none; }
.side-small .nav a:not(.huns-link):hover { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .nav a:not(.huns-link), .nav a:not(.huns-link) .ico { transition: color .2s; }
  .nav a:not(.huns-link):hover, .nav a:not(.huns-link):hover .ico { transform: none; }
}
