/* ============================================================================
   GunMoney — Terminal Console UI
   Terminal / dark aesthetic for the d3frk GunMoney UrT server.

   Design notes
   - Pure CSS, zero external dependencies (works fully offline).
   - Every selector the JS/markup depends on is preserved; this file only
     elevates the presentation layer (depth, motion, typography, a11y).
   - Honors prefers-reduced-motion and prefers-reduced-transparency.
   ========================================================================== */

:root {
  /* ---- Surface ramp (darkest → lightest) ------------------------------- */
  --term-bg:           #07090c;
  --term-bg2:          #0e1217;
  --term-bg3:          #0a0d11;
  --surface-0:         #07090c;
  --surface-1:         #0c0f14;
  --surface-2:         #11161c;
  --surface-3:         #161c24;
  --surface-glass:     rgba(12, 16, 21, 0.72);

  /* ---- Accents --------------------------------------------------------- */
  --term-fg:           #2bffae;   /* primary neon green */
  --term-fg-soft:      #7affce;
  --term-amber:        #ffc149;
  --term-cyan:         #6cf3ff;
  --term-red:          #ff6b6b;
  --term-green:        #2ee089;
  --term-purple:       #b39bff;
  --term-gold:         #facc15;
  --money:             #41ffa6;

  /* ---- Lines / text ---------------------------------------------------- */
  --term-border:       #1a212b;
  --term-border-light: #2b3744;
  --term-dim:          #6b8a7d;
  --text:              #cfe9df;
  --text-strong:       #f3fbf7;

  /* ---- Effects --------------------------------------------------------- */
  --glow-fg:           0 0 0.5px rgba(43,255,174,.9), 0 0 14px rgba(43,255,174,.28);
  --glow-soft:         0 0 22px rgba(43,255,174,.10);
  --ring:              0 0 0 1px rgba(43,255,174,.55), 0 0 0 4px rgba(43,255,174,.14);
  --shadow-card:       0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -24px rgba(0,0,0,.9);
  --shadow-pop:        0 30px 70px -20px rgba(0,0,0,.85);

  --radius:            10px;
  --radius-sm:         7px;
  --ease:             cubic-bezier(.2, .7, .25, 1);

  --maxw:             1200px;

  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'SF Mono', 'Consolas',
               'DejaVu Sans Mono', ui-monospace, 'Courier New', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(43,255,174,.06), transparent 60%),
    radial-gradient(900px 600px at 6% 4%, rgba(108,243,255,.045), transparent 55%),
    var(--term-bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* Faint global grid + vignette — sits behind everything, never interactive. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(43,255,174,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43,255,174,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 92%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 92%);
}

/* keep real content above the decorative layers */
header, .container, footer, .modal, .toast { position: relative; z-index: 1; }

a {
  color: var(--term-cyan);
  text-decoration: none;
  transition: color .15s var(--ease);
}
a:hover { color: var(--text-strong); text-shadow: 0 0 12px rgba(108,243,255,.4); }

::selection { background: rgba(43,255,174,.28); color: #fff; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 4px;
}

/* Custom scrollbars (WebKit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: #2c3a44 transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(#2c3a44, #1c2530);
  border: 2px solid var(--term-bg);
  border-radius: 20px;
}
*::-webkit-scrollbar-thumb:hover { background: #3a4d5a; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================================
   Header / Nav
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--term-border-light);
  box-shadow: 0 1px 0 rgba(43,255,174,.06), 0 12px 30px -20px rgba(0,0,0,.9);
}
/* animated accent hairline under the header */
header::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(43,255,174,.7), rgba(108,243,255,.5), transparent);
  background-size: 200% 100%;
  animation: sweep 6s linear infinite;
  opacity: .6;
}
@keyframes sweep { to { background-position: 200% 0; } }

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--term-amber);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .2px;
  text-shadow: 0 0 18px rgba(255,193,73,.25);
}
.logo .prompt { color: var(--term-fg); font-weight: 400; }
/* dim ":~$" tail + the typed command after the prompt — shared by every page
   header (index "status --live", contact "mail --d3frk", map "map --delay 60") */
.logo .logo-tail { color: #668877; }
.logo .logo-cmd { color: var(--text); font-weight: 400; }
.logo a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
/* "← back" link that sits opposite the logo on the sub-pages */
.nav-back {
  display: inline-flex;
  align-items: center;
  color: var(--text-strong);
  font-size: 13px;
  letter-spacing: .4px;
  white-space: nowrap;
}
/* on sub-pages the back link hugs the right edge of the utility cluster */
.nav-right .nav-back { margin-left: auto; }
/* blinking terminal cursor appended to the logo */
.logo::after {
  content: "";
  width: 9px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--term-fg);
  box-shadow: var(--glow-fg);
  animation: blink 1.15s steps(1) infinite;
  transform: translateY(1px);
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.nav-link {
  position: relative;
  padding: 7px 15px;
  font-size: 14px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  font-family: inherit;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.nav-link::before {
  content: "›";
  color: var(--term-fg);
  opacity: 0;
  margin-right: 0;
  width: 0;
  display: inline-block;
  transition: opacity .15s var(--ease), width .15s var(--ease), margin .15s var(--ease);
}
.nav-link:hover {
  background: var(--surface-2);
  border-color: var(--term-border-light);
  color: var(--text-strong);
}
.nav-link.active {
  background: var(--surface-2);
  border-color: rgba(43,255,174,.45);
  color: var(--text-strong);
  box-shadow: 0 0 18px -6px rgba(43,255,174,.5);
}
.nav-link.active::before { opacity: 1; width: auto; margin-right: 6px; }

/* Utility cluster — a deliberate toolbar that sits to the right of the nav (and
   on its own row beneath it on narrower viewports). All controls share one height
   and a pill silhouette so it reads as a single grouped bar, not stray buttons. */
.nav-right {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end; margin-left: auto;
}
.nav-right > * { height: 34px; }
/* one silhouette for the whole cluster (scoped so .theme-btn etc. keep their own
   shape elsewhere, e.g. the admin header) */
.nav-right .theme-btn,
.nav-right .lock-btn,
.nav-right .connect-btn,
.nav-right .live-pill { display: inline-flex; align-items: center; border-radius: 999px; }
.nav-right .connect-btn { max-width: 100%; padding: 0 15px; }
.nav-right .lock-btn { padding: 0 14px; font-size: 12px; }
.nav-right .connect-btn .connect-addr { max-width: 150px; }

/* Desktop: the utility cluster is its own full-width status row under the nav —
   LOGIN + theme switcher aligned left, the live player count in the middle and
   the connect-copy CTA pinned to the right edge. The hairline above makes it
   read as one deliberate toolbar (mirrors the mobile treatment below). */
@media (min-width: 861px) {
  .nav-right-bar {
    width: 100%;
    order: 5;
    justify-content: flex-start;
    margin-left: 0;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid var(--term-border);
  }
  .nav-right-bar .live-pill { margin-left: auto; margin-right: auto; }
  .nav-right-bar .connect-btn .connect-addr { max-width: none; }
}

.live-pill {
  background: var(--surface-1);
  border: 1px solid var(--term-border-light);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  white-space: nowrap;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.live-pill .count { color: var(--term-green); font-weight: 700; }
.live-pill > span:first-child {
  color: var(--term-green);
  font-size: 10px;
  line-height: 0;
  position: relative;
}
/* pulsing "online" halo on the status dot */
.live-pill > span:first-child::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0 rgba(46,224,137,.6);
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(46,224,137,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(46,224,137,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,224,137,0); }
}
.live-pill:not(.offline) { box-shadow: 0 0 22px -10px rgba(46,224,137,.7); }
.live-pill.offline { border-color: #5a2f2f; color: var(--term-dim); }
.live-pill.offline > span:first-child { color: var(--term-red); }
.live-pill.offline > span:first-child::after { animation: none; }

/* Connect chip — a one-click "copy the connect command" control. */
.connect-btn {
  background: linear-gradient(180deg, var(--term-fg-soft), var(--term-fg));
  color: #042016;
  border: none;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 0 1px rgba(43,255,174,.4), 0 10px 26px -12px rgba(43,255,174,.8);
  transition: transform .12s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease), background .25s var(--ease);
}
.connect-btn:hover { filter: brightness(1.07); box-shadow: 0 0 0 1px rgba(43,255,174,.6), 0 14px 30px -10px rgba(43,255,174,.9); transform: translateY(-1px); }
.connect-btn:active { transform: translateY(0) scale(.985); }
.connect-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--term-bg), 0 0 0 4px var(--term-fg); }

.connect-ic {
  flex: none;
  font-size: 15px;
  line-height: 1;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: rgba(4,32,22,.16);
  transition: transform .15s var(--ease);
}
.connect-btn:hover .connect-ic { transform: scale(1.08); }
.connect-addr {
  display: inline-grid;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
  max-width: 170px;
}
.connect-addr-sizer,
.connect-addr-label {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.connect-addr-sizer {
  visibility: hidden;
  pointer-events: none;
}
/* Success flash after a copy. */
.connect-btn.copied { background: linear-gradient(180deg, #c8ffe2, #4dee94); }
.connect-btn.copied .connect-ic { background: rgba(4,32,22,.24); }

.hamburger {
  display: none;
  background: var(--surface-1);
  border: 1px solid var(--term-border-light);
  color: var(--term-fg);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav { row-gap: 10px; }
  /* logo + hamburger share the top row; controls move to their own row */
  .logo { order: 1; }
  .hamburger { display: block; order: 2; }
  /* The utility controls become a grouped status bar on their own row. A hairline
     above it makes the cluster read as one deliberate toolbar instead of stray
     pills floating under the nav. */
  .nav-right {
    order: 3; width: 100%; justify-content: flex-start; gap: 8px;
    padding-top: 10px; margin-top: 2px;
    border-top: 1px solid var(--term-border);
  }
  /* Two halves: LOGIN + theme switcher on the left, the live player count + connect
     IP pushed to the right edge. The hairline above makes the split read as a
     deliberate status bar rather than scattered pills. */
  .nav-right .live-pill { margin-left: auto; }
  .nav-right .connect-btn .connect-addr { max-width: none; }
  .nav-links {
    order: 4;
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 4px;
    padding-top: 6px;
  }
  .nav-links.open { display: flex; animation: dropIn .2s var(--ease); }
  .nav-links .nav-link { width: 100%; text-align: left; }
}
@media (max-width: 640px) {
  /* The decorative command tail in the logo ("status --live", "map --delay 60",
     "player --full --cid=…", …) is what makes the brand wrap to a second line on
     phones — drop it so "d3frk@GunMoney:~$" stays on ONE line beside the ☰ toggle. */
  .logo .logo-cmd { display: none; }
  /* Copying "/connect ip:port" is a desktop-only action (UrT runs on desktop) —
     drop the connect chip from the header on phones to declutter the status bar.
     The address still lives in the About tab and the footer for anyone who needs it. */
  .nav-right .connect-btn { display: none; }
}
@media (max-width: 520px) {
  /* Tighten the brand + bar so the header isn't oversized on phones. */
  .logo { font-size: 15px; }
  .nav { padding-top: 9px; padding-bottom: 9px; row-gap: 8px; }
  /* The connect CTA now wraps to its own row — let it span full width for a big,
     obvious "join the server" tap target. */
  .nav-right .connect-btn { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 460px) {
  /* icon-only theme button to save room on phones */
  .theme-btn #theme-name { display: none; }
}
@media (max-width: 380px) {
  /* smallest phones: shave the brand a touch more */
  .logo { font-size: 14px; }
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---- Scroll-minimised header --------------------------------------------
   theme.js toggles .gm-min on <header> from the scroll direction: scrolling
   DOWN tightens the nav and fully collapses the status row (LOGIN, theme,
   player count, connect-IP copy) so only the brand + tabs remain; scrolling
   UP — or returning near the top — restores the full layout. The row is
   visibility-hidden while collapsed so it can't be tabbed into or clicked. */
header { transition: box-shadow .25s var(--ease); }
.nav { transition: padding .25s var(--ease); }
.nav-right-bar {
  /* The bar is a single 34px row everywhere (the connect chip is dropped on
     phones before it could wrap) — 64px comfortably covers row + padding and
     gives max-height a number to animate from. */
  max-height: 64px;
  transition: padding .25s var(--ease), margin-top .25s var(--ease),
              border-color .25s var(--ease), max-height .25s var(--ease),
              opacity .18s var(--ease) .05s, transform .25s var(--ease);
}
header.gm-min .nav { padding-top: 5px; padding-bottom: 5px; }
header.gm-min .nav-right-bar {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  border-top-color: transparent;
  visibility: hidden;
  pointer-events: none;
  /* Same timings as the base rule, but delay the visibility flip until the
     collapse animation has finished (it snaps back instantly on expand). */
  transition: padding .25s var(--ease), margin-top .25s var(--ease),
              border-color .25s var(--ease), max-height .25s var(--ease),
              opacity .15s var(--ease), transform .25s var(--ease),
              visibility 0s linear .25s;
}
/* Drop the animated accent hairline while minimised for a flatter, cleaner bar. */
header.gm-min::after { opacity: 0; }
/* Respect reduced-motion: still tighten, just without the animation. */
@media (prefers-reduced-motion: reduce) {
  header, .nav, .nav-right-bar { transition: none; }
}

/* ---- Back-to-top button --------------------------------------------------
   Injected on every public page by theme.js; fades in past a scroll threshold. */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-glass);
  border: 1px solid var(--term-border-light);
  color: var(--term-fg);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 10px 26px -12px rgba(0,0,0,.9), 0 0 0 1px rgba(43,255,174,.08);
  font: inherit;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(.9);
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease),
              border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover {
  border-color: var(--term-fg);
  box-shadow: 0 14px 30px -12px rgba(43,255,174,.5), 0 0 0 1px rgba(43,255,174,.35);
}
.to-top:active { transform: scale(.94); }
.to-top:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--term-bg), 0 0 0 4px var(--term-fg); }
@media (prefers-reduced-motion: reduce) { .to-top { transition: opacity .15s linear; } }
@media (max-width: 520px) {
  .to-top {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 40px; height: 40px;
  }
}

/* ============================================================================
   Terminal primitives
   ========================================================================== */
.terminal-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--surface-1);
  border: 1px solid var(--term-border);
  border-bottom: 1px solid var(--term-border-light);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px;
  color: var(--term-dim);
  margin-bottom: 12px;
}
.prompt {
  color: var(--term-amber);
  font-weight: 700;
  text-shadow: 0 0 14px rgba(255,193,73,.3);
}

.terminal-box {
  border: 1px solid var(--term-border-light);
  background:
    linear-gradient(180deg, rgba(255,255,255,.015), transparent 40%),
    var(--surface-1);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.terminal-box p { color: var(--text); }

.section { margin-bottom: 32px; }

h1, h2, h3 {
  font-family: inherit;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text-strong);
  letter-spacing: .3px;
}
h2 {
  font-size: 20px;
  padding-bottom: 8px;
  margin-top: 4px;
  position: relative;
}
h2::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--term-border-light), transparent 70%);
}

.dim { color: var(--term-dim); }
.mono { font-family: var(--font-mono); }
.green  { color: var(--term-green); }
.cyan   { color: var(--term-cyan); }
.amber  { color: var(--term-amber); }
.red    { color: var(--term-red); }
.purple { color: var(--term-purple); }
.gold   { color: var(--term-gold); }

/* ============================================================================
   Levelshot card
   ========================================================================== */
.levelshot-card {
  border: 1px solid var(--term-border-light);
  background: var(--surface-0);
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), var(--glow-soft);
}

.levelshot-header {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  padding: 8px 14px;
  font-size: 13px;
  color: var(--term-dim);
  border-bottom: 1px solid var(--term-border-light);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.levelshot-header > span:nth-child(2) {
  color: var(--term-fg-soft);
  letter-spacing: 1px;
  text-shadow: var(--glow-fg);
}
.levelshot-header > span:last-child { text-align: right; }
.levelshot-header > span:first-child { justify-self: start; }

/* "Live Map" shortcut living in the header's left cell — jumps to the real-time
   (60s-delayed) map view. Pulsing red dot signals it's a live feed. */
.ls-livebtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--term-fg-soft);
  background: var(--surface-0);
  border: 1px solid var(--term-border-light);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease),
              border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.ls-livebtn .ls-live-dot {
  width: 7px; height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--term-red);
  box-shadow: 0 0 8px var(--term-red);
  animation: livedot 1.6s var(--ease) infinite;
}
.ls-livebtn:hover {
  color: var(--term-bg);
  background: var(--term-fg);
  border-color: var(--term-fg);
  box-shadow: 0 0 16px -5px var(--term-fg);
  text-decoration: none;
}
.ls-livebtn:hover .ls-live-dot { background: var(--term-bg); box-shadow: none; }
@keyframes livedot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* On very narrow cards drop the sv_maxclients label so the Live Map button +
   "CURRENT MAP" title keep their room. */
@media (max-width: 520px) {
  .levelshot-header { grid-template-columns: auto 1fr; }
  .levelshot-header #sv-maxclients { display: none; }
  .levelshot-header > span:nth-child(2) { text-align: right; }
}

.levelshot-image-area {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(43,255,174,.05), transparent 60%),
    repeating-linear-gradient(45deg, #0b0e12 0 14px, #090c10 14px 28px);
  height: 320px;
  max-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.levelshot-image-area img,
.levelshot-image-area .levelshot-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  image-rendering: crisp-edges;
  border: 1px solid rgba(43,255,174,.15);
  border-radius: 4px;
  box-shadow: 0 20px 50px -24px #000;
  animation: imgFade .5s var(--ease);
}
@keyframes imgFade { from { opacity: 0; transform: scale(.985); } }
.levelshot-image-area .placeholder {
  padding: 36px;
  text-align: center;
  color: #4a6258;
  font-size: 13px;
}

/* Levelshot slideshow controls (only present when a map has multiple shots) */
.ls-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 9, 12, .55);
  border: 1px solid var(--term-border-light);
  color: var(--term-fg);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.ls-nav:hover { background: rgba(7,9,12,.8); border-color: var(--term-fg); box-shadow: 0 0 16px -6px var(--term-fg); }
.ls-prev { left: 10px; }
.ls-next { right: 10px; }
.ls-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 7px;
  padding: 5px 9px;
  background: rgba(7, 9, 12, .5);
  border: 1px solid var(--term-border);
  border-radius: 999px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.ls-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3a4a44;
  border: 1px solid #4a5d54;
  cursor: pointer;
  transition: background .14s var(--ease), box-shadow .14s var(--ease);
}
.ls-dot:hover { background: var(--term-fg-soft); }
.ls-dot.active { background: var(--term-fg); box-shadow: 0 0 8px var(--term-fg); border-color: var(--term-fg); }
.ls-counter {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  font-size: 11px;
  color: var(--term-fg);
  background: rgba(7, 9, 12, .55);
  border: 1px solid var(--term-border);
  border-radius: 999px;
  padding: 2px 9px;
  letter-spacing: .5px;
}

.levelshot-footer {
  padding: 11px 14px;
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  color: var(--term-amber);
  border-top: 1px solid var(--term-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  flex-wrap: wrap;
  gap: 6px;
}
.levelshot-footer .mapname { color: var(--term-fg); font-weight: 700; text-shadow: var(--glow-fg); }

/* CRT scanlines + faint flicker */
.scanlines::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,255,157,0.02) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  animation: flicker 7s infinite steps(60);
}
.scanlines { position: relative; }
@keyframes flicker { 0%,97%,100% { opacity: 1; } 98% { opacity: .85; } 99% { opacity: .95; } }

/* ============================================================================
   Stat bar (server view)
   ========================================================================== */
.statbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.statbar .s {
  display: flex;
  align-items: center;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 55%),
    var(--surface-1);
  padding: 12px 16px;
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
  /* size the value to the *tile* width (container query), so big numbers fit even
     when many tiles are packed in (admin dashboard) — see .s-val below. */
  container-type: inline-size;
}
.statbar .s:hover { transform: translateY(-2px); border-color: rgba(43,255,174,.35); }
.statbar .s-ic {
  flex: none;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  color: var(--term-fg);
  border: 1px solid var(--term-border-light);
  border-radius: 9px;
  background: var(--surface-0);
}
.statbar .s-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.statbar .s-label {
  font-size: 10px;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--term-dim);
}
.statbar .s-val {
  /* Scale to the tile width so big values stay readable instead of being clipped
     to "1.284.99…". 9cqi ≈ fits a ~13-digit number in a 190px tile; capped at
     21px so wide tiles (the 3-up public bar) look exactly as before. */
  font-size: clamp(13px, 9cqi, 21px);
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  /* Keep long values (big jackpots, long map names like ut4_alinosperch_a3) inside
     the tile instead of spilling past its edge. .s-meta is min-width:0 so this
     flex child can actually shrink and ellipsis. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.statbar .s-val .s-cur { opacity: .65; font-size: 15px; margin-right: 1px; }
.statbar .s-val .s-unit { font-size: 12px; color: var(--term-dim); font-weight: 600; }
/* Jackpot tile — the headline number, given a gold treatment. */
.statbar .s-jackpot {
  border-color: rgba(250,204,21,.4);
  box-shadow: var(--shadow-card), 0 0 30px -16px rgba(250,204,21,.6);
}
.statbar .s-jackpot:hover { border-color: rgba(250,204,21,.7); }
.statbar .s-jackpot .s-ic { color: var(--term-gold); border-color: rgba(250,204,21,.4); }
.statbar .s-jackpot .s-val {
  font-size: clamp(14px, 11cqi, 24px);
  text-shadow: 0 0 18px rgba(250,204,21,.35);
}

/* ============================================================================
   Live scoreboard
   ========================================================================== */
.terminal-scoreboard {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14.5px;
  background: var(--surface-0);
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.terminal-scoreboard th,
.terminal-scoreboard td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--term-border);
  white-space: nowrap;
}
.terminal-scoreboard tr:last-child td { border-bottom: none; }
.terminal-scoreboard th {
  background: var(--surface-2);
  color: var(--term-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--term-border-light);
  position: sticky;
  top: 0;
}
.terminal-scoreboard tr.player-row { cursor: pointer; transition: background .12s var(--ease); }
.terminal-scoreboard tr.player-row:hover {
  background: linear-gradient(90deg, rgba(43,255,174,.07), transparent);
  color: var(--text-strong);
  box-shadow: inset 2px 0 0 var(--term-fg);
}
.terminal-scoreboard tr.bot { color: #51635c; cursor: default; }
.terminal-scoreboard tr.bot:hover { background: transparent; box-shadow: none; }

.bot-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .6px;
  padding: 1px 6px;
  margin-left: 7px;
  border: 1px solid #5a5030;
  border-radius: 999px;
  color: #e0c065;
  background: rgba(40,33,10,.7);
  vertical-align: middle;
}
.terminal-scoreboard .num   { width: 30px; color: var(--term-dim); text-align: right; }
.terminal-scoreboard .name  { font-weight: 600; }
.terminal-scoreboard .level { color: var(--term-cyan); text-align: right; }
.terminal-scoreboard .score { text-align: right; color: var(--text-strong); }
.terminal-scoreboard .ping  { text-align: right; color: var(--term-dim); }
.terminal-scoreboard .money { text-align: right; color: var(--money); font-weight: 600; }

/* UrT colour codes */
.color-1 { color: #ff5f5f; }
.color-2 { color: #33ff66; }
.color-3 { color: #ffff66; }
.color-4 { color: #6699ff; }
.color-5 { color: #66ffff; }
.color-6 { color: #ff66ff; }
.color-7 { color: #e8e8e8; }
.color-8 { color: #ffaa44; }
.color-9 { color: #aaaaaa; }

/* ============================================================================
   Data tables (leaderboard / mapcycle)
   ========================================================================== */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface-0);
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--term-border);
  text-align: left;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table th {
  background: var(--surface-2);
  color: var(--term-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
  transition: color .12s var(--ease);
}
.data-table th:hover { color: var(--text-strong); }
.data-table th.sortable { cursor: pointer; white-space: nowrap; }
.data-table th .sort-arrow { color: var(--term-cyan); font-size: 10px; }
.data-table tbody tr { transition: background .12s var(--ease); }
.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(108,243,255,.06), transparent);
  box-shadow: inset 2px 0 0 var(--term-cyan);
}
.data-table .rank { width: 46px; color: var(--term-dim); text-align: right; font-weight: 700; }
.data-table .money-col { color: var(--money); text-align: right; }
.data-table .kd { text-align: right; }
.data-table .clickable { cursor: pointer; }

/* Leaderboard top-3 emphasis — medal in the # column + a place-tinted row so the
   leaders stand out from the pack at a glance. Scoped to #lb-table so other
   data-tables (jackpot, mapcycle) are untouched. */
#lb-table .lb-medal { font-size: 16px; line-height: 1; }
#lb-table tbody tr.lb-top td { border-bottom-color: var(--term-border-light); }
#lb-table tbody tr.lb-top td:nth-child(2) { color: var(--text-strong); font-weight: 600; }
#lb-table tbody tr.lb-top-1 { background: linear-gradient(90deg, rgba(250,204,21,.12), transparent 72%); box-shadow: inset 3px 0 0 var(--term-gold); }
#lb-table tbody tr.lb-top-2 { background: linear-gradient(90deg, rgba(196,210,222,.10), transparent 72%); box-shadow: inset 3px 0 0 #c2cdd8; }
#lb-table tbody tr.lb-top-3 { background: linear-gradient(90deg, rgba(205,127,80,.11), transparent 72%); box-shadow: inset 3px 0 0 #cd7f50; }
#lb-table tbody tr.lb-top-1:hover { background: linear-gradient(90deg, rgba(250,204,21,.20), transparent 72%); box-shadow: inset 3px 0 0 var(--term-gold); }
#lb-table tbody tr.lb-top-2:hover { background: linear-gradient(90deg, rgba(196,210,222,.18), transparent 72%); box-shadow: inset 3px 0 0 #c2cdd8; }
#lb-table tbody tr.lb-top-3:hover { background: linear-gradient(90deg, rgba(205,127,80,.19), transparent 72%); box-shadow: inset 3px 0 0 #cd7f50; }

/* ============================================================================
   Filters & search
   ========================================================================== */
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-bar input[type="text"] {
  flex: 1;
  min-width: 220px;
  background: var(--surface-0);
  border: 1px solid var(--term-border-light);
  color: var(--text-strong);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search-bar input[type="text"]::placeholder { color: #50685e; }
.search-bar input:focus {
  outline: none;
  border-color: var(--term-fg);
  box-shadow: 0 0 0 3px rgba(43,255,174,.13);
}

.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pill {
  padding: 5px 14px;
  font-size: 13px;
  background: var(--surface-1);
  border: 1px solid var(--term-border-light);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: all .15s var(--ease);
}
.pill:hover { border-color: var(--term-fg-soft); color: var(--text-strong); }
.pill.active {
  border-color: var(--term-fg);
  background: rgba(43,255,174,.12);
  color: var(--text-strong);
  box-shadow: 0 0 16px -6px rgba(43,255,174,.7);
}

.toggle-group {
  display: inline-flex;
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.toggle-group button {
  background: var(--surface-1);
  color: var(--text);
  border: none;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.toggle-group button:hover { background: var(--surface-3); color: var(--text-strong); }
.toggle-group button.active {
  background: linear-gradient(180deg, var(--term-fg-soft), var(--term-fg));
  color: #042016;
  font-weight: 700;
}

/* radio labels in the buylist */
label { cursor: pointer; }
input[type="radio"] { accent-color: var(--term-fg); }

/* ============================================================================
   Buylist / cards
   ========================================================================== */
.buylist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.buy-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 45%),
    var(--surface-1);
  border: 1px solid var(--term-border-light);
  padding: 13px 14px;
  font-size: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.buy-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(var(--term-fg), var(--term-cyan));
  opacity: 0;
  transition: opacity .14s var(--ease);
}
.buy-card:hover {
  transform: translateY(-2px);
  border-color: rgba(43,255,174,.45);
  box-shadow: var(--shadow-card), 0 16px 34px -22px rgba(43,255,174,.6);
}
.buy-card:hover::before { opacity: 1; }
.buy-card .item-name { font-weight: 700; margin-bottom: 5px; color: var(--text-strong); }
.buy-card .cost { color: var(--money); font-size: 13px; font-weight: 600; }
.buy-card .cost .sc { color: var(--term-purple); }
.buy-card .meta { font-size: 12px; color: var(--term-dim); display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.buy-card .cmd {
  font-size: 12px;
  background: var(--surface-0);
  border: 1px solid var(--term-border);
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--term-amber);
  display: inline-block;
  margin-top: 8px;
}

.badge {
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 999px;
  display: inline-block;
  line-height: 1.3;
}
.badge-weapon   { border-color: #3e7a67; color: #7fd9bd; background: rgba(62,122,103,.12); }
.badge-gear     { border-color: #3f6a96; color: #88b6e0; background: rgba(63,106,150,.12); }
.badge-ability  { border-color: #8a4a5e; color: #e09aa9; background: rgba(138,74,94,.12); }
.badge-map      { border-color: #7a4a7f; color: #d39ad6; background: rgba(122,74,127,.12); }
.badge-prestige { border-color: #5e4f96; color: var(--term-purple); background: rgba(94,79,150,.12); }
.badge-colour   { border-color: #5a6a55; color: #cfe9df; background: rgba(90,106,85,.14); }

/* ============================================================================
   Profile modal
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 7, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal.open { display: flex; animation: fadeIn .18s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
.modal-content {
  background: var(--surface-2);
  border: 1px solid var(--term-border-light);
  max-width: 840px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop), var(--glow-soft);
  animation: popIn .22s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-header {
  padding: 13px 16px;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-1));
  border-bottom: 1px solid var(--term-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
}
.modal-body { padding: 16px; }
.modal-body table th { color: var(--term-dim); font-weight: 600; padding-bottom: 6px; }
.modal-body table td { padding: 3px 0; }
.modal-close {
  background: var(--surface-0);
  border: 1px solid var(--term-border-light);
  color: var(--text);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  transition: all .15s var(--ease);
}
.modal-close:hover { border-color: var(--term-red); color: var(--term-red); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.stat {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.022), transparent 55%),
    var(--surface-0);
  border: 1px solid var(--term-border-light);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
/* accent hairline along the top of each stat card, tinted per metric */
.stat::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--term-border-light);
  opacity: .8;
}
.stat:hover { transform: translateY(-2px); border-color: rgba(43,255,174,.35); }
.stat.s-money::before  { background: linear-gradient(90deg, var(--term-green), transparent); }
.stat.s-sc::before     { background: linear-gradient(90deg, var(--term-purple), transparent); }
.stat.s-kd::before     { background: linear-gradient(90deg, var(--term-cyan), transparent); }
.stat.s-rank::before   { background: linear-gradient(90deg, var(--term-amber), transparent); }
.stat .label { font-size: 10px; color: var(--term-dim); text-transform: uppercase; letter-spacing: .7px; }
.stat .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.stat .value.green  { color: var(--term-green); text-shadow: 0 0 14px rgba(46,224,137,.25); }
.stat .value.purple { color: var(--term-purple); text-shadow: 0 0 14px rgba(179,155,255,.25); }
.stat.stat-wide::before { display: none; }
.stat-wide { box-shadow: none; }

/* Profile modal sections */
.profile-section { margin: 16px 0 0; }
.profile-h {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--text-strong);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--term-border);
}

.progress {
  height: 7px;
  background: var(--surface-0);
  border: 1px solid var(--term-border);
  border-radius: 999px;
  margin-top: 6px;
  position: relative;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--term-cyan), var(--term-fg));
  box-shadow: 0 0 12px rgba(43,255,174,.6);
  border-radius: 999px;
  transition: width .6s var(--ease);
}

/* ============================================================================
   Join box — styled as a small terminal window
   ========================================================================== */
.join-box {
  margin: 18px 0;
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-0);
  box-shadow: var(--shadow-card), 0 0 34px -18px rgba(43,255,174,.6);
}
.join-titlebar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--surface-1);
  border-bottom: 1px solid var(--term-border-light);
  font-size: 13px;
  color: var(--term-dim);
}
.join-body {
  padding: 16px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(43,255,174,.05), transparent 55%),
    var(--surface-0);
}
.join-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 16px;
}
.join-cmd { color: var(--text-strong); }
.join-box .ip {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--term-fg);
  text-shadow: var(--glow-fg);
}
.join-cursor {
  width: 9px;
  height: 1.05em;
  background: var(--term-fg);
  box-shadow: var(--glow-fg);
  animation: blink 1.15s steps(1) infinite;
  transform: translateY(2px);
  display: inline-block;
}
.join-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; }
.join-actions .copy-btn { margin-left: 0; padding: 7px 14px; font-size: 12px; }
.join-hint { font-size: 12px; }

/* ============================================================================
   Footer
   ========================================================================== */
/* NB: the site footers are `<footer class="container">`, so this selector must
   out-rank `.container` (which zeroes margin/padding) — hence footer.container. */
footer,
footer.container {
  margin: 96px auto 0;
  padding: 34px 20px 30px;
  border-top: 1px solid var(--term-border-light);
  font-size: 12px;
  color: var(--term-dim);
  text-align: center;
}

/* ============================================================================
   Toast / buttons / misc
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--term-fg);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-strong);
  z-index: 300;
  display: none;
  box-shadow: var(--shadow-pop), 0 0 24px -8px rgba(43,255,174,.7);
}
.toast.show { display: block; animation: toastIn .22s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.copy-btn {
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid var(--term-border-light);
  border-radius: 5px;
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  margin-left: 4px;
  transition: all .14s var(--ease);
}
.copy-btn:hover { border-color: var(--term-fg); color: var(--term-fg); }

.empty { padding: 24px; color: var(--term-dim); text-align: center; }
.loading { opacity: .6; pointer-events: none; }

/* ============================================================================
   Levelshot lightbox (full / original-size viewer)
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  flex-direction: column;
  background: rgba(3, 5, 7, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox.open { display: flex; animation: fadeIn .18s var(--ease); }
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--term-border-light);
  background: var(--surface-glass);
  font-size: 13px;
  color: var(--term-dim);
}
.lightbox-bar .lightbox-cap { color: var(--term-fg); text-shadow: var(--glow-fg); }
.lightbox-bar .modal-close { margin-left: auto; }
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px;
}
.lightbox-stage img {
  max-width: none;          /* allow original size + scroll */
  border: 1px solid rgba(43,255,174,.2);
  border-radius: 6px;
  box-shadow: var(--shadow-pop);
  image-rendering: crisp-edges;
  cursor: zoom-out;
  animation: popIn .22s var(--ease);
}

/* ============================================================================
   About view
   ========================================================================== */
.about-hero { position: relative; overflow: hidden; }

/* Caution notice — the "modded experience / .pk3 downloads" disclaimer, styled as
   an amber terminal warning panel. */
.term-notice {
  position: relative;
  overflow: hidden;
  margin: 18px 0 4px;
  border: 1px solid rgba(255,193,73,.45);
  border-left: 3px solid var(--term-amber);
  border-radius: var(--radius);
  background:
    radial-gradient(130% 170% at 0% 0%, rgba(255,193,73,.08), transparent 55%),
    var(--surface-1);
  box-shadow: var(--shadow-card), 0 0 32px -18px rgba(255,193,73,.6);
}
.term-notice-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255,193,73,.10), transparent);
  border-bottom: 1px solid rgba(255,193,73,.25);
  color: var(--term-amber);
  font-weight: 700;
  letter-spacing: .9px;
  font-size: 12.5px;
  text-transform: uppercase;
}
.term-notice-head .tn-ic {
  flex: none;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,193,73,.5);
  border-radius: 7px;
  background: rgba(255,193,73,.08);
  font-size: 14px;
  text-shadow: 0 0 10px rgba(255,193,73,.6);
}
.term-notice-body { padding: 14px; }
.term-notice-body p { margin: 0 0 9px; color: var(--text); }
.term-notice-body p:last-child { margin-bottom: 0; }
.term-notice-body code {
  background: var(--surface-0);
  border: 1px solid var(--term-border);
  color: var(--term-amber);
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 13px;
}

/* Screen-reader-only — carries the keyword-rich page H1 for search engines
   without altering the terminal layout. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.about-title { font-size: 30px; margin: 0 0 6px; letter-spacing: .5px; }
.about-lede { font-size: 15.5px; color: var(--text); max-width: 70ch; margin: 0 0 14px; }
.about-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.fact {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 14px;
  background: var(--surface-0);
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius-sm);
}
.fact-k { font-size: 10px; letter-spacing: .8px; color: var(--term-dim); text-transform: uppercase; }
.fact-v { font-size: 15px; font-weight: 700; color: var(--text-strong); }

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.about-card { transition: border-color .15s var(--ease), transform .15s var(--ease); }
.about-card:hover { border-color: rgba(43,255,174,.35); transform: translateY(-2px); }
.about-card p { margin: 8px 0 0; color: var(--text); }
.about-card-head { display: flex; align-items: center; gap: 10px; }
.about-card-head .item-name { font-weight: 700; letter-spacing: .4px; }
.about-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid currentColor;
  border-radius: 7px;
  font-weight: 700;
  flex: none;
}

.cmd-list { list-style: none; margin: 10px 0 0; padding: 0; }
.cmd-list li { padding: 4px 0; border-bottom: 1px dashed var(--term-border); color: var(--text); }
.cmd-list li:last-child { border-bottom: none; }
.cmd-list code,
.about-card code {
  background: var(--surface-0);
  border: 1px solid var(--term-border);
  color: var(--term-amber);
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 13px;
}

.about-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
a.about-link:hover { border-color: rgba(108,243,255,.45); transform: translateY(-2px); text-decoration: none; }
.about-link strong { color: var(--text-strong); }

/* FAQ (About tab) — crawlable <details> Q&A cards; backs the FAQPage JSON-LD. */
.faq-list { display: grid; gap: 10px; }
.faq-item { padding: 0; }
.faq-q {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  font-weight: 700;
  color: var(--text-strong);
  cursor: pointer;
  list-style: none; /* hide the default disclosure triangle (Firefox) */
  transition: color .15s var(--ease);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { color: var(--term-fg); }
.faq-mark {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--term-border-light);
  border-radius: 6px;
  color: var(--term-fg);
  font-size: 13px;
  transition: transform .2s var(--ease), border-color .15s var(--ease);
}
.faq-item[open] .faq-mark { transform: rotate(90deg); border-color: var(--term-fg); }
.faq-item[open] .faq-q { color: var(--term-fg); border-bottom: 1px dashed var(--term-border); }
.faq-a { padding: 12px 16px 14px; }
.faq-a p { margin: 0; color: var(--text); }

/* ============================================================================
   Theme switcher button
   ========================================================================== */
.theme-btn {
  background: var(--surface-1);
  border: 1px solid var(--term-border-light);
  color: var(--term-fg);
  padding: 5px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .3px;
  cursor: pointer;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.theme-btn:hover { border-color: var(--term-fg); box-shadow: 0 0 16px -6px var(--term-fg); }
.theme-btn[aria-expanded="true"] { border-color: var(--term-fg); box-shadow: 0 0 16px -6px var(--term-fg); }
/* live accent dot — theme.js paints it with the active theme's colour */
.theme-btn .theme-dot {
  width: 10px; height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--term-fg);
  box-shadow: 0 0 8px var(--term-fg);
}

/* Theme popover (built by theme.js, appended to <body>, fixed-positioned under
   the button that opened it). One row per theme: swatch · name · hint · ✓. */
.theme-menu {
  position: fixed;
  z-index: 400;
  min-width: 220px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop), var(--glow-soft);
  animation: dropIn .15s var(--ease);
}
.theme-menu[hidden] { display: none; }
.theme-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s var(--ease);
}
.theme-opt:hover, .theme-opt:focus-visible { background: var(--surface-3); }
.theme-opt .sw {
  width: 12px; height: 12px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.theme-opt .nm { color: var(--text-strong); }
.theme-opt .hint {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .3px;
  text-transform: none;
  color: var(--term-dim);
}
.theme-opt .check { flex: none; width: 14px; text-align: right; opacity: 0; color: currentColor; }
.theme-opt.active .check { opacity: 1; }

/* Admin LOGIN button — matches .theme-btn/.connect-btn footprint, links to /admin. */
.lock-btn {
  background: var(--surface-1);
  border: 1px solid var(--term-border-light);
  color: var(--term-amber);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease);
}
.lock-btn:hover { border-color: var(--term-amber); color: var(--term-gold); box-shadow: 0 0 16px -6px var(--term-amber); }

/* ============================================================================
   Chat-colour swatches (profile owned colours)
   ========================================================================== */
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 13px;
  background: var(--surface-0);
  border: 1px solid var(--term-border-light);
  border-radius: 999px;
}
.swatch .color-1,.swatch .color-2,.swatch .color-3,.swatch .color-4,
.swatch .color-5,.swatch .color-6,.swatch .color-7,.swatch .color-8,.swatch .color-9 {
  text-shadow: 0 0 8px currentColor;
}
.swatch.active {
  border-color: var(--term-fg);
  background: rgba(43,255,174,.10);
  box-shadow: 0 0 16px -7px var(--term-fg);
}

/* ============================================================================
   Jackpot Hall of Fame
   ========================================================================== */
.jackpot-now {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-color: var(--term-gold);
  background:
    radial-gradient(130% 180% at 0% 0%, rgba(250,204,21,.12), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.015), transparent 40%),
    var(--surface-1);
  box-shadow: var(--shadow-card), 0 0 40px -16px rgba(250,204,21,.6);
}
.jackpot-now-coin {
  flex: none;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--term-gold);
  background: rgba(250,204,21,.08);
  border: 1px solid rgba(250,204,21,.35);
  border-radius: 12px;
  text-shadow: 0 0 16px rgba(250,204,21,.6);
}
.jackpot-now-main { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.jackpot-now-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.jackpot-now-val {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  letter-spacing: .5px;
  text-shadow: 0 0 20px rgba(250,204,21,.45);
}
.jackpot-now-meta { margin-left: auto; font-size: 12px; }
.jackpot-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
/* Recent winners — a grid of "winning ticket" cards. */
.jackpot-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.jp-win {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  background:
    linear-gradient(180deg, rgba(250,204,21,.04), transparent 60%),
    var(--surface-1);
  border: 1px solid var(--term-border-light);
  border-left: 3px solid rgba(250,204,21,.45);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease);
}
.jp-win:hover {
  transform: translateY(-2px);
  border-color: var(--term-gold);
  border-left-color: var(--term-gold);
  box-shadow: 0 14px 30px -20px rgba(250,204,21,.8);
}
.jp-win-coin {
  flex: none;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--term-gold);
  background: rgba(250,204,21,.08);
  border: 1px solid rgba(250,204,21,.3);
  border-radius: 8px;
  text-shadow: 0 0 10px rgba(250,204,21,.5);
}
.jp-win-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.jp-win-amt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.jp-win-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-win-when {
  margin-left: auto;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 11px;
  color: var(--term-dim);
  white-space: nowrap;
}
.jp-win-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .6px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #1a1505;
  background: linear-gradient(180deg, #ffe07a, var(--term-gold));
}
/* The most-recent win gets a brighter frame + a soft sheen sweep. */
.jp-win.latest {
  border-color: rgba(250,204,21,.55);
  border-left-color: var(--term-gold);
  box-shadow: 0 0 26px -14px rgba(250,204,21,.8);
}
.jp-win.latest::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(250,204,21,.10) 50%, transparent 60%);
  background-size: 250% 100%;
  animation: jpSheen 5s linear infinite;
  pointer-events: none;
}
@keyframes jpSheen { to { background-position: -200% 0; } }

/* ============================================================================
   Server chat feed
   ========================================================================== */
.chatlog {
  background: var(--surface-0);
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  max-height: 60vh;
  min-height: 220px;
  overflow-y: auto;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.7;
  box-shadow: var(--shadow-card);
}
.chat-line {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,.03);
  word-break: break-word;
}
.chat-line:last-child { border-bottom: none; }
.chat-time { color: var(--term-dim); font-size: 11px; margin-right: 8px; }
.chat-name { font-weight: 600; }
.chat-sep { color: var(--term-dim); margin: 0 6px 0 1px; }
.chat-msg { color: var(--text); }
.chat-team {
  color: var(--term-amber);
  font-size: 11px;
  font-weight: 700;
  margin-right: 4px;
}

/* ============================================================================
   Boot sequence overlay
   ========================================================================== */
.boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(900px 600px at 50% 40%, rgba(43,255,174,.06), transparent 60%),
    var(--term-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity .5s var(--ease);
}
.boot.done { opacity: 0; pointer-events: none; }
.boot-log {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(12px, 2.4vw, 16px);
  line-height: 1.7;
  color: var(--term-fg);
  text-shadow: var(--glow-fg);
  white-space: pre-wrap;
  width: min(680px, 92vw);
  min-height: 280px;
}
.boot-log::after {
  content: "▮";
  animation: blink 1.05s steps(1) infinite;
}
.boot-skip {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .5px;
}

/* ============================================================================
   Themes (accent overrides — applied via <html data-theme="…">)
   ========================================================================== */
[data-theme="amber"] {
  --term-fg: #ffc149; --term-fg-soft: #ffd98a; --money: #ffd070;
  --glow-fg: 0 0 0.5px rgba(255,193,73,.9), 0 0 14px rgba(255,193,73,.32);
  --term-fg-rgb: 255,193,73;
}
[data-theme="ice"] {
  --term-fg: #6cf3ff; --term-fg-soft: #b3f8ff; --money: #7fe9ff;
  --glow-fg: 0 0 0.5px rgba(108,243,255,.9), 0 0 14px rgba(108,243,255,.32);
}
[data-theme="matrix"] {
  --term-fg: #00ff41; --term-fg-soft: #74ff97; --money: #2bff6a;
  --glow-fg: 0 0 0.5px rgba(0,255,65,.95), 0 0 16px rgba(0,255,65,.4);
  --term-bg: #050a05; --term-dim: #4f7a5a;
}

/* ============================================================================
   Cross-page transitions
   Same-origin navigations (Contact, Live Map, player profiles) crossfade
   instead of hard-cutting, and the sticky header is morphed as a shared
   element — so moving between pages reads like switching tabs. Progressive
   enhancement: browsers without @view-transition simply navigate as before.
   ========================================================================== */
@view-transition { navigation: auto; }
header { view-transition-name: gm-header; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation-duration: .001ms !important; }
}

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 700px) {
  body { font-size: 14px; }
  .terminal-scoreboard, .data-table { font-size: 13px; }
  .terminal-scoreboard th, .terminal-scoreboard td,
  .data-table th, .data-table td { padding: 8px 9px; }
  .buylist-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  /* Fixed 2-up so the bar never overflows the viewport on phones; minmax(0,1fr)
     lets the tiles shrink and the cqi-sized values reflow to fit. */
  .statbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jackpot-cols { grid-template-columns: 1fr; }
  .levelshot-image-area { height: 220px; }
  .join-box .ip { font-size: 18px; }
}
@media (max-width: 430px) {
  .statbar { grid-template-columns: 1fr; }
}

/* ============================================================================
   Motion / transparency preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .logo::after { opacity: 1; }
}
@media (prefers-reduced-transparency: reduce) {
  header { background: var(--surface-1); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .modal { background: rgba(3,5,7,.96); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ============================================================================
   HALL OF FAME PODIUM (home / server view)
   Server-rendered top-3 by SuperCoins → money. Classic 2-1-3 stage on desktop,
   ranked 1-2-3 stack on phones. Each plinth is clickable → opens the profile.
   ========================================================================== */
.podium-card {
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 50% -20%, rgba(250,204,21,.06), transparent 60%),
    var(--surface-0);
  box-shadow: var(--shadow-card), var(--glow-soft);
  padding: 14px 14px 18px;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
}
.podium-head {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin: 2px 2px 16px; flex-wrap: wrap; text-align: center;
}
.podium-head .ph-title {
  color: var(--term-fg-soft);
  letter-spacing: 2px;
  text-shadow: var(--glow-fg);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}
.podium-head .ph-sub { font-size: 11px; }

.podium {
  display: grid;
  grid-template-columns: 1fr 1.18fr 1fr;
  align-items: end;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}
.plinth {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  padding: 14px 10px 12px;
  position: relative;
  overflow: hidden;             /* clip the top accent + pedestal footer to the radius */
  min-width: 0;                 /* let inner ellipsis work inside the grid track */
  transition: transform .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.plinth:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -22px rgba(0,0,0,.9); }
/* Top accent hairline, tinted per medal. */
.plinth::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--term-border-light); }
.plinth.p1::before { background: linear-gradient(90deg, transparent, var(--term-gold), transparent); }
.plinth.p2::before { background: linear-gradient(90deg, transparent, #c2cdd8, transparent); }
.plinth.p3::before { background: linear-gradient(90deg, transparent, #cd7f50, transparent); }
/* Stage heights — gold tallest, order 2-1-3 so #1 sits centre. */
.plinth.p1 { order: 2; min-height: 250px; justify-content: flex-end; border-color: rgba(250,204,21,.5); box-shadow: var(--shadow-card), 0 0 34px -16px rgba(250,204,21,.55); }
.plinth.p2 { order: 1; min-height: 218px; justify-content: flex-end; border-color: rgba(190,205,215,.4); }
.plinth.p3 { order: 3; min-height: 196px; justify-content: flex-end; border-color: rgba(205,127,80,.4); }

.plinth-medal {
  font-size: 22px; line-height: 1;
  position: absolute; top: 10px; left: 0; right: 0; text-align: center;
}
.plinth.p1 .plinth-medal { filter: drop-shadow(0 0 8px rgba(250,204,21,.7)); }

.avatar {
  width: 58px; height: 58px;
  flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; letter-spacing: .5px;
  margin: 10px auto 8px;
  color: var(--term-bg);
  background: linear-gradient(180deg, var(--term-fg-soft), var(--term-fg));
  box-shadow: 0 0 0 2px var(--surface-0), 0 0 22px -6px var(--term-fg);
  border: 1px solid rgba(255,255,255,.25);
}
.plinth.p1 .avatar { width: 70px; height: 70px; font-size: 26px;
  background: linear-gradient(180deg, #ffe487, var(--term-gold));
  box-shadow: 0 0 0 2px var(--surface-0), 0 0 26px -4px rgba(250,204,21,.8); }
.plinth.p2 .avatar { background: linear-gradient(180deg, #eef3f7, #aebccb); box-shadow: 0 0 0 2px var(--surface-0), 0 0 20px -6px rgba(190,205,215,.7); }
.plinth.p3 .avatar { background: linear-gradient(180deg, #f0b487, #c77b46); box-shadow: 0 0 0 2px var(--surface-0), 0 0 20px -6px rgba(205,127,80,.7); }

/* Wrapper so name + rank + stats stay grouped (and can switch to a side column
   on mobile) instead of every element becoming a flex sibling. */
.plinth-info { display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; }
.plinth-name {
  font-weight: 700; font-size: 15px;
  max-width: 100%; line-height: 1.25;
  /* up to two lines, then ellipsis — long UrT names wrap instead of being cropped */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere; word-break: break-word;
}
.plinth-rank { font-size: 11px; color: var(--term-dim); margin-top: 1px; }
.plinth-stats { margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; min-width: 0; }
.plinth-sc { font-size: 18px; font-weight: 800; color: var(--term-purple); font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(179,155,255,.3); white-space: nowrap; }
.plinth.p1 .plinth-sc { font-size: 21px; }
.plinth-unit { font-size: 11px; }
.plinth-money { font-size: 12.5px; color: var(--money); font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.plinth-lvl { font-size: 11px; color: var(--term-cyan); white-space: nowrap; }
/* Pedestal step — a solid colour-tinted footer spanning the card, instead of the
   old oversized ghost numeral. Reads as the podium block the player stands on. */
.plinth-base {
  margin: 12px -10px -12px;
  font-size: 12px; font-weight: 800; letter-spacing: 2px; line-height: 1;
  text-transform: uppercase; text-align: center;
  padding: 8px 0 9px;
  color: #0a0d11;
  border-top: 1px solid rgba(255,255,255,.14);
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.02));
}
.plinth.p1 .plinth-base { background: linear-gradient(180deg, #ffe487, var(--term-gold)); color: #3a2c00; }
.plinth.p2 .plinth-base { background: linear-gradient(180deg, #eef3f7, #aebccb); color: #1b2733; }
.plinth.p3 .plinth-base { background: linear-gradient(180deg, #f0b487, #c77b46); color: #2a1505; }

/* Mobile: stack as full-width horizontal cards — [medal][avatar][name/stats]. */
@media (max-width: 640px) {
  .podium { grid-template-columns: 1fr; max-width: 480px; gap: 10px; }
  .plinth, .plinth.p1, .plinth.p2, .plinth.p3 {
    min-height: 0; order: initial; justify-content: flex-start;
    flex-direction: row; align-items: center; text-align: left;
    gap: 13px; padding: 12px 14px; overflow: visible;   /* pedestal hidden on mobile; let stats wrap freely */
  }
  .plinth-medal { position: static; font-size: 22px; flex: none; width: 24px; text-align: center; }
  .avatar, .plinth.p1 .avatar { width: 48px; height: 48px; font-size: 18px; margin: 0; }
  .plinth-info { align-items: flex-start; text-align: left; flex: 1 1 auto; min-width: 0; }
  .plinth-name { font-size: 15px; -webkit-line-clamp: 2; }
  .plinth-stats { flex-direction: row; align-items: baseline; gap: 4px 12px; margin-top: 5px; flex-wrap: wrap; align-self: stretch; }
  .plinth.p1 .plinth-sc { font-size: 18px; }
  .plinth-base { display: none; }
}

/* ============================================================================
   PLAYER PROFILE PAGE (player.php) — full-page, state-of-the-art profile.
   Reuses the terminal tokens; adds a hero, a stat deck, weapon bars and a
   right-rail of badges/colours/jackpot. Distinct from the in-page .modal.
   ========================================================================== */
.pp-wrap { margin-top: 6px; }
.pp-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(43,255,174,.07), transparent 55%),
    radial-gradient(120% 120% at 100% 0%, rgba(108,243,255,.05), transparent 55%),
    var(--surface-1);
  box-shadow: var(--shadow-card), var(--glow-soft);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.pp-hero::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,255,157,.018) 50%);
  background-size: 100% 4px; mix-blend-mode: screen;
}
.pp-avatar {
  width: 92px; height: 92px;
  flex: none;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 38px;
  color: var(--term-bg);
  background: linear-gradient(180deg, var(--term-fg-soft), var(--term-fg));
  box-shadow: 0 0 0 2px var(--surface-0), 0 12px 30px -12px var(--term-fg);
  border: 1px solid rgba(255,255,255,.25);
}
.pp-id { min-width: 0; flex: 1; }
.pp-name {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: .3px;
  line-height: 1.15;
  word-break: break-word;
}
.pp-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--term-border-light); background: var(--surface-0);
  color: var(--text);
}
.pp-pill.rank { border-color: var(--term-amber); color: var(--term-amber); }
.pp-pill.rank-owner { border-color: var(--term-red); color: var(--term-red); }
.pp-pill.online { border-color: var(--term-green); color: var(--term-green); box-shadow: 0 0 16px -6px var(--term-green); }
.pp-pill.online .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--term-green); box-shadow: 0 0 8px var(--term-green); }
.pp-pill.discord { border-color: #5865F2; color: #9aa6ff; }
.pp-pill.dim { color: var(--term-dim); }
.pp-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-self: flex-start; }

.pp-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.pp-deck .stat .value { font-size: 22px; }
.pp-deck .stat .sub { font-size: 11px; color: var(--term-dim); margin-top: 2px; }

.pp-xp { margin: 4px 0 18px; }
.pp-xp-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 4px; flex-wrap: wrap; gap: 6px; }

.pp-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 760px) { .pp-cols { grid-template-columns: 1fr; } }

.pp-panel {
  border: 1px solid var(--term-border-light);
  border-radius: var(--radius);
  background: var(--surface-1);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.pp-panel + .pp-panel { margin-top: 16px; }
.pp-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--term-border-light);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--surface-2);
  font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--term-dim);
}
.pp-panel-head .h { color: var(--text-strong); font-weight: 700; }
.pp-panel-body { padding: 14px; }

/* Weapon bars */
.wbar-row { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; }
.wbar-name { font-weight: 700; color: var(--text-strong); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wbar-track { height: 9px; border-radius: 999px; background: var(--surface-0); border: 1px solid var(--term-border); overflow: hidden; position: relative; }
.wbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--term-cyan), var(--term-fg)); box-shadow: 0 0 10px rgba(43,255,174,.5); }
.wbar-fill.hs { background: linear-gradient(90deg, var(--term-amber), var(--term-red)); box-shadow: 0 0 10px rgba(255,107,107,.4); }
.wbar-val { font-size: 12px; color: var(--term-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wbar-val b { color: var(--text-strong); }

.pp-jack { display: flex; flex-direction: column; gap: 8px; }
.pp-jack-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: linear-gradient(180deg, rgba(250,204,21,.05), transparent), var(--surface-0); border: 1px solid var(--term-border); border-left: 3px solid rgba(250,204,21,.5); }
.pp-jack-amt { font-weight: 800; color: var(--term-gold); font-variant-numeric: tabular-nums; }
.pp-jack-when { margin-left: auto; font-size: 11px; color: var(--term-dim); }

.pp-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.pp-meta .k { color: var(--term-dim); }
.pp-meta .v { color: var(--text); text-align: right; }

.pp-back { display: inline-flex; align-items: center; gap: 6px; margin: 20px 0 8px; }

/* ---- Profile page + shared stat tiles — mobile fitting ---------------------- */
@media (max-width: 700px) {
  /* Stat-grid values (profile deck + the in-page modal) shrink so big money
     numbers like $25.000.000 stay inside the tile instead of clipping. */
  .stat .value { font-size: 17px; }
  .pp-deck .stat .value { font-size: 17px; }
  .pp-deck .stat .sub { font-size: 10px; }

  .pp-hero { padding: 16px; gap: 14px; }
  .pp-avatar { width: 72px; height: 72px; font-size: 30px; border-radius: 14px; }
  .pp-hero-actions { margin-left: 0; width: 100%; }
  .pp-hero-actions .copy-btn { width: 100%; text-align: center; }

  .wbar-row { grid-template-columns: 70px 1fr auto; gap: 8px; }
  .wbar-name { font-size: 12px; }
  .wbar-val { font-size: 11px; }
}
@media (max-width: 380px) {
  .stat .value, .pp-deck .stat .value { font-size: 15px; }
  .wbar-row { grid-template-columns: 56px 1fr auto; }
  .pp-meta { grid-template-columns: auto 1fr; font-size: 12px; }
}

/* ============================================================================
   Legal / policy pages  (privacy.php, terms.php)
   Long-form prose in a terminal box: comfortable measure, clear headings,
   dim metadata, and amber callouts for the clauses that matter most.
   ========================================================================== */
.legal { margin: 18px 0 44px; }
.legal .terminal-box { max-width: 840px; }
.legal-meta { color: var(--term-dim); font-size: 12.5px; margin: 0 0 6px; }
.legal-lead { color: var(--text-strong); font-size: 15px; margin: 6px 0 4px; }
/* Anchored jump list at the top of each policy. */
.legal-toc {
  margin: 14px 0 4px; padding: 12px 14px;
  border: 1px solid var(--term-border); border-left: 3px solid var(--term-fg);
  border-radius: var(--radius-sm); background: var(--surface-0);
  columns: 2; column-gap: 26px; font-size: 13px;
}
.legal-toc a { display: block; padding: 2px 0; color: var(--term-cyan); }
.legal-toc a:hover { color: var(--text-strong); }
.legal h2 {
  font-size: 18px; margin: 30px 0 10px; scroll-margin-top: 90px;
}
.legal h2 .n { color: var(--term-fg); font-weight: 700; margin-right: 8px; }
.legal h2:first-of-type { margin-top: 10px; }
.legal h3 { font-size: 14.5px; color: var(--term-amber); margin: 16px 0 4px; letter-spacing: .2px; }
.legal p { color: var(--text); font-size: 14px; line-height: 1.72; margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li { color: var(--text); font-size: 14px; line-height: 1.66; margin: 4px 0; }
.legal a { color: var(--term-cyan); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--text-strong); }
.legal strong { color: var(--text-strong); }
.legal code {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--term-fg);
  background: var(--term-bg2); border: 1px solid var(--term-border);
  border-radius: 4px; padding: 1px 6px;
}
/* Emphasis block for the clauses doing the heavy protective lifting
   (virtual-currency / no-gambling, disclaimer, liability, indemnity). */
.legal-callout {
  margin: 12px 0 16px; padding: 12px 15px;
  border: 1px solid var(--term-border-light); border-left: 3px solid var(--term-amber);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,193,73,.05), transparent 60%), var(--surface-0);
}
.legal-callout p:last-child { margin-bottom: 0; }
.legal-callout strong { color: var(--term-amber); }
@media (max-width: 560px) {
  .legal-toc { columns: 1; }
}
/* ---- Crawlable player-profile links (SEO) -------------------------------
   Real <a> wrappers around player names (podium plinths, leaderboard rows) so
   profile pages aren't crawl orphans. They inherit the terminal look — the
   name colour comes from the ^-code spans inside; hover underlines to hint
   there's a full profile page behind the name. */
.plink { color: inherit; }
.plink:hover { color: inherit; text-shadow: none; text-decoration: underline; text-underline-offset: 2px; }