/* ==========================================================================
   Redwood Servers — site theme.
   Colours, fonts and radius come from CSS variables set in the admin panel
   (rendered inline in <head>). Light mode overrides the surface colours.
   ========================================================================== */

:root {
  --primary: #e3262f;
  --on-primary: #fff;
  --accent: #ff4d57;
  --bg: #0a0909;
  --surface: #141212;
  --border: #272222;
  --text: #f5f3f2;
  --muted: #a29b98;
  --radius: 8px;
  --font-heading: 'Oswald', Impact, system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --heading-weight: 700;
  --bg-image: none;
  --bg-overlay: 0.88;

  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --info: #3b82f6;
  --surface-2: color-mix(in srgb, var(--surface) 90%, var(--text) 5%);
  --surface-3: color-mix(in srgb, var(--surface) 80%, var(--text) 10%);
  --primary-soft: color-mix(in srgb, var(--primary) 15%, transparent);
  --primary-hover: color-mix(in srgb, var(--primary) 85%, #000);
  --shadow: 0 18px 40px -18px rgb(0 0 0 / .6);
  --r-sm: calc(var(--radius) * .75);
  --r-lg: calc(var(--radius) * 1.5);
  --header-h: 72px;
  color-scheme: dark;
}
:root[data-theme='light'] { color-scheme: light; --shadow: 0 18px 40px -22px rgb(40 20 20 / .35); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--bg); color: var(--text);
  font: 400 15px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body.has-bg-image {
  background-image: linear-gradient(rgb(0 0 0 / var(--bg-overlay)), rgb(0 0 0 / var(--bg-overlay))), var(--bg-image);
  background-size: cover; background-attachment: fixed; background-position: center;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--heading-weight); line-height: 1.08; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3rem); text-transform: uppercase; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); text-transform: uppercase; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
code, kbd, .mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
::selection { background: var(--primary); color: var(--on-primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
.icon.sm { width: 14px; height: 14px; vertical-align: -2px; }
.icon.lg { width: 24px; height: 24px; }
.icon.xl { width: 34px; height: 34px; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 860px; }
main { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden, [hidden] { display: none !important; }
.text-primary { color: var(--primary); }
.eyebrow { display: block; margin-bottom: 10px; color: var(--primary); font: 600 .82rem var(--font-body); letter-spacing: .16em; text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-3); --btn-fg: var(--text); --btn-border: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 20px; border: 1px solid var(--btn-border); border-radius: var(--r-sm);
  background: var(--btn-bg); color: var(--btn-fg);
  font: 600 .93rem/1.2 var(--font-body); cursor: pointer; white-space: nowrap;
  text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { background: color-mix(in srgb, var(--btn-bg) 85%, var(--text) 15%); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--text); --btn-border: color-mix(in srgb, var(--text) 35%, transparent); }
.btn-outline:hover { background: color-mix(in srgb, var(--text) 8%, transparent); border-color: var(--text); }
.on-image .btn-outline, .btn-outline.light { --btn-fg: #fff; --btn-border: rgb(255 255 255 / .4); }
.on-image .btn-outline:hover, .btn-outline.light:hover { background: rgb(255 255 255 / .1); border-color: #fff; }
.btn-ghost { --btn-bg: transparent; --btn-border: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { --btn-bg: color-mix(in srgb, var(--bad) 16%, transparent); --btn-fg: #f87171; --btn-border: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn-success { --btn-bg: color-mix(in srgb, var(--ok) 16%, transparent); --btn-fg: #4ade80; --btn-border: color-mix(in srgb, var(--ok) 40%, transparent); }
.btn-discord { --btn-bg: #5865f2; --btn-fg: #fff; }
.btn-discord:hover { background: #4752c4; }
.btn-steam { --btn-bg: #1b2838; --btn-fg: #fff; --btn-border: #2a475e; }
.btn-sm { padding: 7px 13px; font-size: .84rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }

/* ---------- Logo ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand .logo-mark { width: 44px; height: 38px; color: var(--primary); }
.brand img.logo-img { height: 42px; width: auto; }
.brand .wordmark { display: grid; line-height: .92; font-family: var(--font-heading); font-weight: var(--heading-weight); text-transform: uppercase; }
.brand .wordmark .l1 { font-size: 1.45rem; letter-spacing: .02em; }
.brand .wordmark .l2 { font-size: 1.02rem; letter-spacing: .14em; color: var(--primary); }
.brand .wordmark.single .l1 { font-size: 1.5rem; }

/* ---------- Header ---------- */
.announcement { display: block; padding: 9px 16px; text-align: center; font-size: .88rem; font-weight: 500; background: var(--primary); color: var(--on-primary); }
.announcement a { color: inherit; text-decoration: underline; }
.announcement.info { background: var(--info); color: #fff; }
.announcement.success { background: #15803d; color: #fff; }
.announcement.warning { background: var(--warn); color: #111; }
.announcement.danger { background: #991b1b; color: #fff; }

.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.site-header .container { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.main-nav { display: flex; justify-content: center; gap: 6px; flex: 1; }
.main-nav a { position: relative; padding: 8px 14px; color: color-mix(in srgb, var(--text) 86%, var(--muted)); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--text); text-decoration: none; }
.main-nav a.active { color: var(--text); }
.main-nav a.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -2px; height: 2px; background: var(--primary); border-radius: 2px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle .moon { display: none; }
:root[data-theme='light'] .theme-toggle .sun { display: none; }
:root[data-theme='light'] .theme-toggle .moon { display: inline; }
.nav-toggle { display: none; }

.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer; font: inherit; }
.user-menu .uname { display: grid; line-height: 1.15; text-align: left; font-size: .88rem; font-weight: 600; }
.user-menu .uname small { font-size: .74rem; font-weight: 500; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; display: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text); background: none; border: 0; font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown .sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown .head { padding: 8px 12px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Mobile menu panel */
.mobile-menu { position: fixed; inset: 0; z-index: 90; display: none; }
.mobile-menu.open { display: block; }
.mobile-menu .scrim { position: absolute; inset: 0; background: rgb(0 0 0 / .6); }
.mobile-menu .panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); padding: 20px 22px; background: var(--bg); border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; animation: slide-left .2s ease; }
.mobile-menu .panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mobile-menu nav a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 500; }
.mobile-menu nav a.active { color: var(--primary); }
.mobile-menu .panel .btn { margin-top: 18px; }
@keyframes slide-left { from { transform: translateX(30px); opacity: 0; } }

.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; font: 700 .8rem var(--font-body); background: var(--primary); color: var(--on-primary); }
.avatar.lg { width: 76px; height: 76px; font-size: 1.4rem; }

/* ---------- Flash / alerts ---------- */
.flash-stack { position: fixed; top: calc(var(--header-h) + 14px); right: 20px; z-index: 100; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); font-size: .92rem; }
.flash-stack .alert { box-shadow: var(--shadow); animation: slide-in .25s ease; background: var(--surface); }
.alert .icon { margin-top: 2px; }
.alert-success { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, var(--surface)) !important; }
.alert-success .icon { color: var(--ok); }
.alert-error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 10%, var(--surface)) !important; }
.alert-error .icon { color: var(--bad); }
.alert-warning { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--surface)) !important; }
.alert-warning .icon { color: var(--warn); }
.alert-info { border-color: color-mix(in srgb, var(--info) 45%, transparent); background: color-mix(in srgb, var(--info) 10%, var(--surface)) !important; }
.alert-info .icon { color: var(--info); }
.alert .close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Cards & sections ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card.pad-sm { padding: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-title h2, .card-title h3 { margin: 0; }
.section { padding: 64px 0; }
.section.tight { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.page-head { padding: 56px 0 28px; }
.page-head p { color: var(--muted); max-width: 640px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; color: #fff; padding: clamp(80px, 12vw, 150px) 0 clamp(150px, 16vw, 210px); margin-top: calc(var(--header-h) * -1); padding-top: calc(var(--header-h) + clamp(70px, 10vw, 130px)); }
.hero-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 40%; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(8 6 6 / .88) 0%, rgb(8 6 6 / .55) 38%, rgb(8 6 6 / 0) 70%),
    linear-gradient(180deg, rgb(8 6 6 / .4) 0%, transparent 25%, transparent 60%, var(--bg) 100%);
}
.hero .eyebrow { color: var(--primary); }
.hero h1 { font-size: clamp(2.8rem, 7.4vw, 5.4rem); line-height: .98; max-width: 820px; margin-bottom: 22px; text-transform: uppercase; }
.hero h1 .accent { display: block; color: var(--primary); }
.hero .lead { font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 520px; color: rgb(255 255 255 / .82); margin-bottom: 30px; }
.hero .live-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; padding: 6px 14px; border-radius: 999px; background: rgb(0 0 0 / .45); border: 1px solid rgb(255 255 255 / .14); font-size: .84rem; color: rgb(255 255 255 / .75); backdrop-filter: blur(6px); }
.hero .live-pill strong { color: #fff; }

/* ---------- Server cards (image style) ---------- */
.cards-overlap { position: relative; z-index: 2; margin-top: -130px; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.server-card {
  --game: var(--primary);
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px;
  overflow: hidden; isolation: isolate; color: #fff;
  border-radius: var(--radius); border: 1px solid rgb(255 255 255 / .08); background: #120d0d;
  box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease;
}
.server-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--game) 60%, transparent); }
.server-card .bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; transition: transform .5s ease; }
.server-card:hover .bg { transform: scale(1.04); }
.server-card .bg.placeholder {
  background-image:
    url('/static/img/forest-strip.svg'),
    radial-gradient(circle at 75% 20%, color-mix(in srgb, var(--game) 70%, #ffb070 10%), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--game) 55%, #1a0a0a), #140a0a 70%);
  background-size: 100% auto, auto, auto; background-position: bottom, center, center; background-repeat: no-repeat;
}
.server-card .bg.placeholder .game-glyph { position: absolute; top: 30px; right: 26px; width: 90px; height: 90px; color: rgb(255 255 255 / .16); }
.server-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(0 0 0 / .05) 0%, rgb(10 6 6 / .35) 35%, rgb(10 6 6 / .92) 72%, #0d0909 100%); }
.server-card .top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; }
.server-card .content { padding: 22px; display: grid; gap: 10px; }
.server-card .logo-row { display: flex; align-items: center; gap: 12px; }
.server-card .logo-row img { width: 54px; height: 54px; object-fit: contain; border-radius: 10px; }
.server-card .logo-row .glyph { width: 50px; height: 50px; display: grid; place-items: center; color: var(--game); }
.server-card .logo-row .glyph .icon { width: 42px; height: 42px; }
.server-card h3 { margin: 0; font-size: clamp(1.7rem, 2.6vw, 2.05rem); line-height: .95; text-transform: uppercase; }
.server-card h3 a { color: #fff; }
.server-card h3 a:hover { text-decoration: none; }
.two-tone .rest { display: block; color: var(--primary); }
.server-card .kind { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.server-card .kind .icon { color: rgb(255 255 255 / .8); }
.server-card .desc { margin: 0; color: rgb(255 255 255 / .78); font-size: .92rem; line-height: 1.5; }
.server-card .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.server-card .actions.single { grid-template-columns: 1fr; }

.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: rgb(0 0 0 / .55); border: 1px solid rgb(255 255 255 / .12); color: #fff; backdrop-filter: blur(8px); }
.address-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font: 500 .78rem ui-monospace, Consolas, monospace; background: rgb(0 0 0 / .55); border: 1px solid rgb(255 255 255 / .12); color: #fff; backdrop-filter: blur(8px); cursor: pointer; }
.address-chip:hover { border-color: rgb(255 255 255 / .4); }
.address-chip.copied { border-color: var(--ok); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #8a8382; display: inline-block; flex-shrink: 0; }
.dot.online { background: var(--ok); box-shadow: 0 0 0 0 rgb(34 197 94 / .6); animation: pulse 2s infinite; }
.dot.offline { background: var(--bad); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.status-text.online { color: var(--ok); }
.status-text.offline { color: var(--bad); }

.badge { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text)); border: 1px solid color-mix(in srgb, var(--c) 38%, transparent); }
.badge .icon { width: 13px; height: 13px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: .76rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Compact server rows (servers page, mobile) */
.server-rows { display: grid; gap: 12px; }
.server-row { --game: var(--primary); display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 12px; padding-right: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.server-row:hover { border-color: color-mix(in srgb, var(--game) 50%, var(--border)); }
.server-row .thumb { width: 120px; height: 80px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--game) 40%, #140a0a) center/cover; display: grid; place-items: center; color: rgb(255 255 255 / .5); overflow: hidden; }
.server-row h3 { margin: 0 0 2px; font-size: 1.25rem; text-transform: uppercase; }
.server-row h3 a { color: var(--text); }
.server-row .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .86rem; }
.server-row .right { display: flex; gap: 8px; align-items: center; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--game, var(--primary)); transition: width .6s ease; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 500; font-size: .9rem; }
.chip:hover { color: var(--text); text-decoration: none; border-color: var(--muted); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.view-toggle a { padding: 7px 10px; color: var(--muted); }
.view-toggle a.active { background: var(--surface-3); color: var(--text); }

/* ---------- Stats row ---------- */
.stats-row { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat { display: flex; gap: 16px; align-items: center; justify-content: center; padding: 28px 16px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat > .icon { width: 36px; height: 36px; color: var(--primary); }
.stat .num { font: var(--heading-weight) 1.7rem/1 var(--font-heading); letter-spacing: .01em; }
.stat .lbl { color: var(--muted); font-size: .86rem; margin-top: 4px; }

/* ---------- Discord / CTA banner ---------- */
.cta-banner { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius); border: 1px solid rgb(255 255 255 / .06); color: #fff; text-align: center; padding: clamp(48px, 7vw, 80px) 24px; }
.cta-banner .bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; }
.cta-banner::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, rgb(10 6 6 / .35), rgb(10 6 6 / .75)); }
.cta-banner h2 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 14px; }
.cta-banner p { max-width: 620px; margin: 0 auto 26px; color: rgb(255 255 255 / .82); }

/* ---------- Server detail ---------- */
.server-hero { position: relative; overflow: hidden; isolation: isolate; color: #fff; margin-top: calc(var(--header-h) * -1); padding: calc(var(--header-h) + 70px) 0 70px; }
.server-hero .bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; }
.server-hero .bg.placeholder { background-image: url('/static/img/hero.svg'); filter: hue-rotate(var(--hue, 0deg)); }
.server-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(8 6 6 / .92) 0%, rgb(8 6 6 / .7) 45%, rgb(8 6 6 / .15) 100%), linear-gradient(180deg, transparent 60%, var(--bg)); }
.server-hero .logo-block { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.server-hero .logo-block img { width: 96px; height: 96px; object-fit: contain; border-radius: 16px; }
.server-hero .logo-block .glyph { width: 84px; height: 84px; display: grid; place-items: center; color: var(--game, var(--primary)); }
.server-hero .logo-block .glyph .icon { width: 72px; height: 72px; }
.server-hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: .95; margin: 0; }
.server-hero .kind { font-size: 1.15rem; font-weight: 500; color: rgb(255 255 255 / .9); margin-bottom: 12px; }
.server-hero .lead { max-width: 560px; color: rgb(255 255 255 / .8); margin-bottom: 26px; }
.server-hero .live { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.feature { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.feature .ico { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.feature strong { display: block; font-size: .98rem; margin-bottom: 2px; }
.feature span { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery a { display: block; aspect-ratio: 16/10; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery a:hover img { transform: scale(1.05); }
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; padding: 24px; background: rgb(0 0 0 / .9); cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 90vh; max-width: 92vw; border-radius: var(--r-sm); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 24px; align-items: start; }
.kv { display: grid; gap: 12px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--border); font-size: .92rem; }
.kv > div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; word-break: break-word; }
.address { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; text-align: left; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--r-sm); font: .9rem ui-monospace, Consolas, monospace; color: var(--text); cursor: pointer; }
.address:hover { border-color: var(--primary); }
.address .icon { color: var(--muted); }
.address.copied { border-color: var(--ok); }
.connect-steps { counter-reset: step; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.connect-steps li { counter-increment: step; display: flex; gap: 10px; font-size: .92rem; }
.connect-steps li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex-shrink: 0; }
.chart { width: 100%; height: 140px; display: block; }
.chart .area { fill: color-mix(in srgb, var(--game, var(--primary)) 22%, transparent); }
.chart .line { fill: none; stroke: var(--game, var(--primary)); stroke-width: 2; vector-effect: non-scaling-stroke; }
.player-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; }
.player-list span { padding: 6px 10px; border-radius: 6px; background: var(--surface-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.motd { white-space: pre-line; }
.mc-favicon { width: 96px; height: 96px; image-rendering: pixelated; border-radius: 16px; }

/* ---------- Prose (markdown) ---------- */
.prose { line-height: 1.75; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose h2 { font-size: 1.7rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .3em; }
.prose li::marker { color: var(--primary); }
.prose img { border-radius: var(--r-sm); margin: 1em 0; }
.prose blockquote { margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.prose pre { background: var(--bg); border: 1px solid var(--border); padding: 14px; border-radius: var(--r-sm); overflow: auto; }
.prose code { background: var(--surface-3); padding: 2px 6px; border-radius: 5px; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.prose iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: var(--r-sm); }
.prose details { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 14px; margin: .6em 0; }
.prose summary { cursor: pointer; font-weight: 600; }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.news-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .2s, border-color .2s; }
.news-card:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.news-card .cover { aspect-ratio: 16/8; background: var(--surface-3) center/cover; }
.news-card .cover.placeholder { background-image: url('/static/img/cta.svg'); }
.news-card .body { padding: 18px 20px 20px; display: grid; gap: 8px; }
.news-card h3 { margin: 0; font-size: 1.3rem; }
.news-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .84rem; }
.post-cover { width: 100%; aspect-ratio: 16/7; object-fit: cover; border-radius: var(--radius); margin-bottom: 28px; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }

/* ---------- About & game groups ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.game-section + .game-section { margin-top: 40px; }
.game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.game-head .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.game-head h3 { margin: 0; text-transform: uppercase; }

/* ---------- Forms ---------- */
form { margin: 0; }
.field { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; }
.field > label, .label { font-weight: 600; font-size: .88rem; }
.help { color: var(--muted); font-size: .8rem; margin: 0; }
input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='url'], input[type='search'], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: .86rem; min-height: 220px; }
select { cursor: pointer; }
input[type='color'] { width: 44px; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; flex-shrink: 0; }
input[type='file'] { font-size: .84rem; color: var(--muted); max-width: 100%; }
input[type='file']::file-selector-button { margin-right: 10px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-3); color: var(--text); cursor: pointer; font: inherit; }
input[type='range'] { width: 100%; accent-color: var(--primary); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin-bottom: 12px; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--primary); flex-shrink: 0; }
.check strong { display: block; font-size: .92rem; }
.check span { color: var(--muted); font-size: .84rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.input-group { display: flex; }
.input-group input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .btn { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.hp { position: absolute; left: -9999px; }
.strength { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ---------- Auth ---------- */
.auth-wrap { position: relative; isolation: isolate; display: grid; place-items: center; padding: 64px 20px 90px; flex: 1; }
.auth-wrap::before { content: ''; position: absolute; inset: 0; z-index: -1; background: url('/static/img/hero.svg') center/cover; opacity: .22; mask-image: linear-gradient(180deg, #000, transparent 85%); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 560px; }
.auth-card .card { padding: 34px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2.1rem; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.oauth-buttons { display: grid; gap: 10px; }
.otp-input { text-align: center; font: 600 1.6rem/1 ui-monospace, Consolas, monospace !important; letter-spacing: .4em; }

/* ---------- Account ---------- */
.account-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding: 40px 0 64px; }
.side-nav { display: grid; gap: 4px; align-content: start; position: sticky; top: calc(var(--header-h) + 20px); }
.side-nav a { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-sm); color: var(--muted); font-weight: 500; }
.side-nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--primary); color: var(--on-primary); }
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 24px; }
.connection { display: flex; gap: 16px; align-items: center; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); flex-wrap: wrap; }
.connection + .connection { margin-top: 12px; }
.connection .logo { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 16px; background: var(--bg); border-radius: var(--r-sm); border: 1px dashed var(--border); }
.codes code { font-size: 1.05rem; text-align: center; padding: 6px; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: 220px; }
.session { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.session:last-child { border-bottom: 0; }
.session .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, var(--bg)); padding: 52px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-family: var(--font-body); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 14px; }
.footer-links { display: grid; gap: 8px; }
.footer-links a { color: var(--text); opacity: .82; }
.footer-links a:hover { opacity: 1; color: var(--primary); text-decoration: none; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.socials a:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; }

/* ---------- Misc pages ---------- */
.error-page { text-align: center; padding: 110px 20px; }
.error-page .code { font: var(--heading-weight) clamp(5rem, 16vw, 9rem)/1 var(--font-heading); color: var(--primary); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 12px; display: block; opacity: .6; }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .detail-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .main-nav, .header-actions .hide-sm { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-header .container { justify-content: space-between; }
  .account-layout { grid-template-columns: 1fr; }
  .side-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
  .side-nav a { white-space: nowrap; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .user-menu .uname { display: none; }
  .user-menu > button { padding-right: 4px; }
  .server-row { grid-template-columns: 84px minmax(0, 1fr); }
  .server-row .thumb { width: 84px; height: 64px; }
  .server-row .right { grid-column: 1 / -1; }
  .server-row .right .btn { flex: 1; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .brand .wordmark .l1 { font-size: 1.2rem; }
  .brand .wordmark .l2 { font-size: .85rem; }
  .brand .logo-mark { width: 36px; height: 32px; }
  .hero { padding-bottom: 150px; }
  .hero .actions .btn { flex: 1; }
  .server-grid, .news-grid { grid-template-columns: 1fr; }
  .server-card { min-height: 340px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat { flex-direction: column; text-align: center; gap: 8px; padding: 20px 8px; }
  .footer-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .auth-card .card { padding: 22px; }
  .codes { grid-template-columns: 1fr; }
  .server-hero .logo-block { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
