/* ==========================================================================
   Mature Gaming — main stylesheet
   Design tokens, layout primitives, and components.
   ========================================================================== */

/* ----- Design tokens ----- */
:root {
	--mg-red:           #8B0000;   /* logo red */
	--mg-red-bright:    #B22222;   /* hover / highlight */
	--mg-red-deep:      #5c0000;   /* very dark red for gradients */
	--mg-black:         #070707;
	--mg-ink:           #0f0f10;   /* page background */
	--mg-surface:       #161617;   /* panel background */
	--mg-surface-2:     #1e1e20;   /* elevated panel */
	--mg-border:        #2a2a2c;
	--mg-border-strong: #3a3a3c;
	--mg-text:          #ece7de;   /* warm cream text */
	--mg-text-muted:    #9a968d;
	--mg-text-dim:      #6a675f;
	--mg-gold:          #c9a96a;   /* a touch for tier accents */
	--mg-shadow:        0 20px 60px rgba(0,0,0,0.55);

	--mg-radius:        8px;
	--mg-radius-lg:     14px;
	--mg-gutter:        clamp(16px, 3vw, 32px);
	--mg-container:     1200px;

	--mg-font-display:  'Playfair Display', 'Libre Caslon Text', Georgia, serif;
	--mg-font-body:     'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* ----- Reset-ish ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--mg-ink);
	color: var(--mg-text);
	font: 16px/1.6 var(--mg-font-body);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	background-image:
		radial-gradient(1200px 600px at 75% -10%, rgba(139,0,0,0.18), transparent 60%),
		radial-gradient(900px 500px at -10% 110%, rgba(139,0,0,0.12), transparent 60%);
	background-attachment: fixed;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--mg-red-bright); text-decoration: none; transition: color .2s; }
a:hover, a:focus-visible { color: #e06868; text-decoration: underline; }
h1, h2, h3, h4 {
	font-family: var(--mg-font-display);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 .6em;
	color: #fff;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* Skip link */
.mg-skiplink {
	position: absolute; left: -9999px; top: 0;
	background: var(--mg-red); color: #fff; padding: 12px 20px; z-index: 1000;
}
.mg-skiplink:focus { left: 16px; top: 16px; }

/* ----- Container ----- */
.mg-wrap {
	max-width: var(--mg-container);
	margin: 0 auto;
	padding: 0 var(--mg-gutter);
}

/* ==========================================================================
   Site header
   ========================================================================== */
.mg-site-header {
	position: sticky; top: 0; z-index: 50;
	background: linear-gradient(180deg, rgba(7,7,7,0.95), rgba(7,7,7,0.75));
	backdrop-filter: saturate(140%) blur(8px);
	-webkit-backdrop-filter: saturate(140%) blur(8px);
	border-bottom: 1px solid var(--mg-border);
}
.mg-site-header__inner {
	max-width: var(--mg-container);
	margin: 0 auto;
	padding: 14px var(--mg-gutter);
	display: flex;
	align-items: center;
	gap: 24px;
}
.mg-brand {
	display: flex; align-items: center; gap: 14px;
	text-decoration: none; color: inherit;
}
.mg-brand__logo { width: 56px; height: 56px; flex: 0 0 auto; }
.mg-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.mg-brand__name {
	font-family: var(--mg-font-display);
	font-weight: 900;
	font-size: 1.35rem;
	letter-spacing: 0.02em;
	color: #fff;
}
.mg-brand__tagline {
	font-size: .72rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--mg-red-bright);
}

.mg-primary-nav { margin-left: auto; }
.mg-menu {
	list-style: none; padding: 0; margin: 0;
	display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.mg-menu li { position: relative; }
.mg-menu a {
	display: inline-block;
	padding: 10px 14px;
	color: var(--mg-text);
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: .82rem;
	border-radius: var(--mg-radius);
	text-decoration: none;
	transition: background .2s, color .2s;
}
.mg-menu a:hover, .mg-menu a:focus-visible,
.mg-menu > li.current-menu-item > a,
.mg-menu > li.current-menu-ancestor > a,
.mg-menu > li.current-menu-parent > a {
	background: rgba(139,0,0,0.25);
	color: #fff;
}
/* Suppress the current-page highlight inside dropdowns — it looks like a permanent bug */
.mg-menu .sub-menu .current-menu-item > a {
	background: transparent;
	color: inherit;
}
.mg-menu .sub-menu {
	position: absolute; top: 100%; left: 0;
	background: var(--mg-surface); border: 1px solid var(--mg-border);
	min-width: 200px; padding: 6px; border-radius: var(--mg-radius);
	display: none; list-style: none; margin: 0;
}
/* Invisible bridge above the dropdown so slow mouse movement doesn't close it */
.mg-menu .sub-menu::before {
	content: '';
	position: absolute;
	top: -8px; left: -4px; right: -4px;
	height: 8px;
}
.mg-menu li:hover > .sub-menu, .mg-menu li:focus-within > .sub-menu { display: block; }
.mg-menu .sub-menu a { display: block; }

.mg-nav-toggle {
	display: none;
	background: transparent; border: 1px solid var(--mg-border);
	color: var(--mg-text); padding: 8px 10px; border-radius: var(--mg-radius);
	cursor: pointer;
}
.mg-nav-toggle span {
	display: block; width: 22px; height: 2px; background: var(--mg-text); margin: 4px 0;
	transition: transform .2s;
}

@media (max-width: 860px) {
	.mg-nav-toggle { display: block; margin-left: auto; }
	.mg-primary-nav {
		display: none;
		position: absolute; top: 100%; left: 0; right: 0;
		background: var(--mg-black); border-bottom: 1px solid var(--mg-border);
		padding: 12px var(--mg-gutter);
	}
	.mg-primary-nav.is-open { display: block; }
	.mg-menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.mg-menu a { padding: 14px; }
}

/* ==========================================================================
   Main / layout
   ========================================================================== */
.mg-main { min-height: 60vh; }
.mg-section { padding: clamp(48px, 8vw, 96px) 0; }
.mg-section__inner {
	max-width: var(--mg-container);
	margin: 0 auto;
	padding: 0 var(--mg-gutter);
}
.mg-section-head {
	margin-bottom: clamp(28px, 4vw, 48px);
	text-align: center;
}
.mg-eyebrow {
	display: inline-block;
	font-size: .72rem;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--mg-red-bright);
	margin-bottom: 10px;
}
.mg-lead {
	max-width: 680px;
	margin: 0 auto;
	color: var(--mg-text-muted);
	font-size: 1.05rem;
}

/* Buttons */
.mg-btn {
	display: inline-block;
	padding: 12px 22px;
	border-radius: var(--mg-radius);
	font: 600 .9rem/1 var(--mg-font-body);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: transform .12s, background .2s, border-color .2s, color .2s;
}
.mg-btn--primary {
	background: var(--mg-red);
	color: #fff;
	border-color: var(--mg-red);
}
.mg-btn--primary:hover, .mg-btn--primary:focus-visible {
	background: var(--mg-red-bright);
	border-color: var(--mg-red-bright);
	text-decoration: none;
	color: #fff;
}
.mg-btn--ghost {
	background: transparent;
	color: var(--mg-text);
	border-color: var(--mg-border-strong);
}
.mg-btn--ghost:hover, .mg-btn--ghost:focus-visible {
	background: rgba(139,0,0,0.2);
	color: #fff;
	border-color: var(--mg-red);
	text-decoration: none;
}
.mg-btn + .mg-btn { margin-left: 12px; }

/* ==========================================================================
   Hero (home)
   ========================================================================== */
.mg-hero {
	position: relative;
	padding: clamp(64px, 10vw, 140px) 0 clamp(48px, 8vw, 96px);
	text-align: center;
	overflow: hidden;
}
.mg-hero::before {
	content: '';
	position: absolute; inset: 0;
	background:
		radial-gradient(600px 300px at 50% 40%, rgba(139,0,0,0.35), transparent 60%);
	pointer-events: none;
	z-index: 0;
}
.mg-hero__inner {
	position: relative; z-index: 1;
	max-width: 860px; margin: 0 auto;
	padding: 0 var(--mg-gutter);
}
.mg-hero__logo {
	width: clamp(120px, 18vw, 180px);
	margin: 0 auto clamp(16px, 2vw, 28px);
	filter: drop-shadow(0 0 40px rgba(139,0,0,0.45));
}
.mg-hero__title {
	font-size: clamp(2.6rem, 7vw, 5rem);
	line-height: 1.05;
	font-weight: 900;
	color: #fff;
	margin-bottom: .2em;
}
.mg-hero__title em {
	font-style: italic;
	color: var(--mg-red-bright);
	background: linear-gradient(180deg, var(--mg-red-bright), var(--mg-red));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.mg-hero__slogan {
	font-family: var(--mg-font-display);
	font-style: italic;
	font-size: clamp(1rem, 2.2vw, 1.35rem);
	color: var(--mg-text-muted);
	letter-spacing: 0.02em;
	margin: 0 0 2em;
}
.mg-hero__ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.mg-hero__ctas .mg-btn + .mg-btn { margin-left: 0; }

/* ==========================================================================
   Highlights grid
   ========================================================================== */
.mg-highlights {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: clamp(10px, 1.5vw, 18px);
}
.mg-highlight {
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius-lg);
	padding: clamp(16px, 2vw, 28px);
	position: relative;
	overflow: hidden;
	transition: border-color .2s, transform .2s;
}
.mg-highlight::before {
	content: '';
	position: absolute; top: 0; left: 0; width: 3px; height: 100%;
	background: linear-gradient(180deg, var(--mg-red), var(--mg-red-deep));
	opacity: 0.9;
}
.mg-highlight:hover { border-color: var(--mg-red); transform: translateY(-2px); }
.mg-highlight__num {
	font-family: var(--mg-font-display);
	font-weight: 900;
	font-size: clamp(1.6rem, 2.5vw, 2.6rem);
	color: var(--mg-red-bright);
	line-height: 1;
	margin-bottom: 6px;
}
.mg-highlight__title {
	font-family: var(--mg-font-display);
	font-weight: 700;
	font-size: clamp(.95rem, 1.2vw, 1.25rem);
	color: #fff;
	margin: 0 0 8px;
}
.mg-highlight__body { color: var(--mg-text-muted); font-size: clamp(.8rem, 1vw, .95rem); margin: 0; }
@media (max-width: 860px) {
	.mg-highlights {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 480px) {
	.mg-highlights {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Games strip (home)
   ========================================================================== */
.mg-games {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: clamp(14px, 2vw, 22px);
}
.mg-game-card {
	display: block;
	position: relative;
	border: 1px solid var(--mg-border);
	background: linear-gradient(180deg, var(--mg-surface-2), var(--mg-surface));
	border-radius: var(--mg-radius-lg);
	padding: 26px;
	text-decoration: none;
	color: var(--mg-text);
	transition: border-color .2s, transform .2s;
	overflow: hidden;
}
.mg-game-card::after {
	content: '';
	position: absolute; right: -40px; top: -40px;
	width: 120px; height: 120px; border-radius: 50%;
	background: radial-gradient(circle, rgba(139,0,0,0.35), transparent 60%);
}
.mg-game-card:hover { border-color: var(--mg-red); transform: translateY(-2px); text-decoration: none; color: #fff; }
.mg-game-card__label {
	display: inline-block;
	font-size: .7rem; letter-spacing: 0.2em; text-transform: uppercase;
	color: var(--mg-red-bright); margin-bottom: 8px;
}
.mg-game-card__title {
	font-family: var(--mg-font-display);
	font-weight: 700;
	font-size: 1.3rem;
	color: #fff;
	margin: 0 0 6px;
}
.mg-game-card__count {
	color: var(--mg-text-muted);
	font-size: .9rem;
}

/* ==========================================================================
   Server cards
   ========================================================================== */
.mg-servers-group { margin-bottom: clamp(36px, 5vw, 64px); }
.mg-servers-group__head {
	display: flex; align-items: baseline; justify-content: space-between;
	flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
	border-bottom: 1px solid var(--mg-border);
	padding-bottom: 14px;
}
.mg-servers-group__title {
	font-family: var(--mg-font-display);
	font-weight: 700; color: #fff; margin: 0;
	font-size: clamp(1.4rem, 2.5vw, 1.8rem);
}
.mg-servers-group__count { color: var(--mg-text-muted); font-size: .9rem; }
.mg-servers-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: clamp(14px, 2vw, 22px);
}
.mg-server-card {
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius-lg);
	padding: 22px;
	display: flex; flex-direction: column; gap: 14px;
	transition: border-color .2s, transform .2s;
}
.mg-server-card:hover { border-color: var(--mg-red); transform: translateY(-2px); }
.mg-server-card--offline { opacity: 0.72; }
.mg-server-card__head {
	display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.mg-server-card__titleblock { flex: 1 1 auto; min-width: 0; }
.mg-server-card__game {
	display: inline-block; font-size: .7rem; letter-spacing: 0.2em;
	text-transform: uppercase; color: var(--mg-red-bright);
}
.mg-server-card__name {
	font-family: var(--mg-font-display);
	font-size: 1.2rem; color: #fff; margin: 4px 0 2px;
}
.mg-server-card__map { color: var(--mg-text-muted); font-size: .9rem; }
.mg-server-card__desc { color: var(--mg-text-muted); font-size: .92rem; }
.mg-server-card__tags {
	list-style: none; padding: 0; margin: 0;
	display: flex; flex-wrap: wrap; gap: 6px;
}
.mg-server-card__tags li {
	font-size: .72rem; letter-spacing: 0.06em;
	padding: 3px 9px;
	background: rgba(139,0,0,0.15); border: 1px solid rgba(139,0,0,0.4);
	color: #f4d0d0; border-radius: 99px;
}
.mg-server-card__connect {
	display: flex; align-items: center; gap: 10px;
	margin-top: auto;
	padding-top: 12px; border-top: 1px solid var(--mg-border);
}
.mg-server-card__address {
	flex: 1 1 auto; min-width: 0;
	background: var(--mg-black);
	border: 1px solid var(--mg-border-strong);
	padding: 10px 12px;
	border-radius: var(--mg-radius);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .85rem;
	color: #fff;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	cursor: text;
}

/* Status chips */
.mg-chip {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: .72rem; letter-spacing: 0.12em; text-transform: uppercase;
	padding: 4px 10px; border-radius: 99px;
	border: 1px solid var(--mg-border-strong);
	color: var(--mg-text-muted);
}
.mg-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mg-text-dim); }
.mg-chip--online { color: #c2f1cc; border-color: rgba(80,200,120,0.4); }
.mg-chip--online .mg-chip__dot { background: #4ecb71; box-shadow: 0 0 10px #4ecb71; }
.mg-chip--offline { color: #f1c2c2; border-color: rgba(200,80,80,0.4); }
.mg-chip--offline .mg-chip__dot { background: #cb4e4e; }
.mg-chip--maintenance { color: #f1e4c2; border-color: rgba(200,170,80,0.4); }
.mg-chip--maintenance .mg-chip__dot { background: #cba24e; }

/* Copy button feedback */
.mg-copy-btn.is-copied { background: rgba(80,200,120,0.18); border-color: #4ecb71; color: #d7f7df; }

/* ==========================================================================
   VIP — Monthly funding bar
   ========================================================================== */

.mg-funding-section {
	padding: clamp(40px, 6vw, 72px) 0;
	background: var(--mg-surface);
	border-top: 1px solid var(--mg-border-strong);
	border-bottom: 1px solid var(--mg-border-strong);
}

/* Centred header block */
.mg-funding-header {
	text-align: center;
	margin-bottom: 28px;
}
.mg-funding-header .mg-eyebrow { display: block; margin-bottom: 8px; }
.mg-funding-header__month {
	font-family: var(--mg-font-display);
	font-size: clamp(1.6rem, 3.5vw, 2.4rem);
	color: #fff;
	margin: 0 0 16px;
}
.mg-funding-meta {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
}
.mg-funding-amount { font-size: 1.1rem; color: var(--mg-text-muted); }
.mg-funding-amount__raised { font-size: 1.7rem; font-weight: 800; color: #fff; }
.mg-funding-amount--unknown { font-style: italic; color: var(--mg-text-muted); }
.mg-funding-pct {
	font-family: var(--mg-font-display);
	font-size: 2.2rem;
	font-weight: 900;
	color: var(--mg-red-bright);
	line-height: 1;
}
.mg-funding-pct--complete { color: #2ecc71; }
.mg-funding-unknown { text-align: center; color: var(--mg-text-muted); font-style: italic; margin: 0; }

/* Progress track — tall enough to read, high-contrast background */
.mg-funding-track {
	width: 100%;
	height: 36px;
	background: #1a1a1c;
	border: 1px solid var(--mg-border-strong);
	border-radius: 999px;
	overflow: hidden;
	position: relative;
	box-shadow: inset 0 2px 6px rgba(0,0,0,.5);
}

/* Inline label centred inside the track */
.mg-funding-track__label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .06em;
	color: rgba(255,255,255,.7);
	text-shadow: 0 1px 3px rgba(0,0,0,.8);
	pointer-events: none;
	z-index: 2;
}

/* Animated fill */
@keyframes mg-funding-grow {
	from { width: 0; }
	to   { width: var(--mg-funding-pct, 0%); }
}
.mg-funding-fill {
	position: absolute;
	top: 0; left: 0;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--mg-red-deep) 0%, var(--mg-red) 50%, var(--mg-red-bright) 100%);
	animation: mg-funding-grow 1.6s cubic-bezier(.22,.61,.36,1) .4s forwards;
	box-shadow: 0 0 18px rgba(139,0,0,.6);
}
/* Shimmer sweep */
.mg-funding-fill::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,.2) 50%, transparent 80%);
	background-size: 200% 100%;
	animation: mg-funding-shimmer 2.2s linear 2s infinite;
}
@keyframes mg-funding-shimmer {
	0%   { background-position: -200% 0; }
	100% { background-position:  200% 0; }
}
.mg-funding-fill--complete {
	background: linear-gradient(90deg, #1a6e3a 0%, #27ae60 60%, #2ecc71 100%);
	box-shadow: 0 0 18px rgba(46,204,113,.5);
}

/* Token explanation — centred, max width so text doesn't span too wide */
.mg-funding-tokens {
	max-width: 720px;
	margin: 56px auto 0;
	text-align: center;
}
.mg-funding-tokens__title {
	font-family: var(--mg-font-display);
	font-size: clamp(1.1rem, 2vw, 1.4rem);
	color: #fff;
	margin: 0 0 16px;
}
.mg-funding-tokens__body {
	color: var(--mg-text-muted);
	font-size: .95rem;
	line-height: 1.7;
	margin: 0 0 12px;
}
.mg-funding-tokens__body:last-of-type { margin-bottom: 0; }
.mg-funding-tokens__cta {
	display: inline-block;
	margin-top: 32px;
	font-size: 1.05rem;
	padding: 16px 40px;
}

/* Extra gap between the funding section and the VIP tier cards below */
.mg-funding-section + .mg-section {
	padding-top: clamp(40px, 6vw, 72px);
}

/* ==========================================================================
   VIP tiers
   ========================================================================== */
.mg-vip-game { margin-bottom: clamp(40px, 6vw, 72px); }
.mg-vip-game__head {
	border-bottom: 1px solid var(--mg-border);
	padding-bottom: 14px; margin-bottom: 24px;
}
.mg-vip-game__title {
	font-family: var(--mg-font-display); color: #fff; margin: 0;
	font-size: clamp(1.5rem, 3vw, 2rem);
}
.mg-tier-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: clamp(14px, 2vw, 22px);
}
.mg-tier-card {
	position: relative;
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius-lg);
	padding: 28px;
	display: flex; flex-direction: column; gap: 14px;
	overflow: hidden;
	transition: border-color .2s, transform .2s;
}
.mg-tier-card:hover { border-color: var(--mg-red); transform: translateY(-2px); }
.mg-tier-card::before {
	content: '';
	position: absolute; top: 0; left: 0; right: 0; height: 4px;
	background: var(--mg-red);
}
.mg-tier-card--t1::before { background: linear-gradient(90deg, #6a6a6a, #aaa); }
.mg-tier-card--t2::before { background: linear-gradient(90deg, var(--mg-red-deep), var(--mg-red)); }
.mg-tier-card--t3::before { background: linear-gradient(90deg, var(--mg-red), var(--mg-gold)); }
.mg-tier-card__level {
	display: inline-block;
	font-size: .72rem; letter-spacing: 0.22em; text-transform: uppercase;
	color: var(--mg-red-bright);
}
.mg-tier-card--t3 .mg-tier-card__level { color: var(--mg-gold); }
.mg-tier-card__name {
	font-family: var(--mg-font-display);
	font-size: 1.4rem; color: #fff; margin: 4px 0 2px;
}
.mg-tier-card__price {
	color: #fff; font-weight: 600;
}
.mg-tier-card__perks {
	list-style: none; padding: 0; margin: 0;
	display: flex; flex-direction: column; gap: 10px;
}
.mg-tier-card__perks li {
	position: relative;
	padding-left: 24px;
	color: var(--mg-text);
	font-size: .95rem;
}
.mg-tier-card__perks li::before {
	content: '';
	position: absolute; left: 0; top: 7px;
	width: 12px; height: 12px;
	border: 2px solid var(--mg-red); border-radius: 50%;
}
.mg-tier-card--t3 .mg-tier-card__perks li::before { border-color: var(--mg-gold); }

/* ==========================================================================
   Site footer
   ========================================================================== */
.mg-site-footer {
	margin-top: clamp(64px, 8vw, 120px);
	border-top: 1px solid var(--mg-border);
	background: #050505;
}
.mg-site-footer__inner {
	max-width: var(--mg-container);
	margin: 0 auto;
	padding: clamp(32px, 5vw, 56px) var(--mg-gutter);
	display: flex; flex-wrap: wrap; gap: 24px;
	align-items: center; justify-content: space-between;
}
.mg-site-footer__brand { display: flex; gap: 14px; align-items: center; }
.mg-site-footer__logo { width: 48px; height: 48px; }
.mg-site-footer__name { font-family: var(--mg-font-display); font-weight: 700; color: #fff; margin: 0; }
.mg-site-footer__tagline { font-size: .8rem; color: var(--mg-red-bright); letter-spacing: 0.2em; text-transform: uppercase; margin: 0; }
.mg-site-footer__nav .mg-menu { justify-content: center; }
.mg-site-footer__copy { color: var(--mg-text-dim); font-size: .85rem; margin: 0; }

/* ==========================================================================
   Page content (generic)
   ========================================================================== */
.mg-page-hero {
	padding: clamp(48px, 7vw, 96px) 0 clamp(24px, 3vw, 40px);
	text-align: center;
}
.mg-page-hero h1 { margin-bottom: 8px; }

.mg-content {
	max-width: 820px;
	margin: 0 auto;
}
.mg-content img { border-radius: var(--mg-radius); }
.mg-content hr { border: 0; border-top: 1px solid var(--mg-border); margin: 2em 0; }
.mg-content blockquote {
	border-left: 3px solid var(--mg-red);
	padding: 8px 18px;
	color: var(--mg-text-muted);
	font-style: italic;
	margin: 1.4em 0;
}

/* Empty-state */
.mg-empty {
	text-align: center;
	padding: 40px 20px;
	color: var(--mg-text-muted);
	border: 1px dashed var(--mg-border);
	border-radius: var(--mg-radius-lg);
}

/* CTA band */
.mg-cta-band {
	text-align: center;
	padding: clamp(48px, 7vw, 80px) var(--mg-gutter);
	background:
		linear-gradient(180deg, rgba(139,0,0,0.25), rgba(139,0,0,0.05)),
		var(--mg-black);
	border-top: 1px solid var(--mg-border);
	border-bottom: 1px solid var(--mg-border);
}
.mg-cta-band h2 { font-style: italic; }

/* Focus ring */
:focus-visible { outline: 2px solid var(--mg-red-bright); outline-offset: 2px; border-radius: 2px; }

/* ==========================================================================
   Header user widget (top-right login/avatar)
   ========================================================================== */
.mg-site-header__user {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

/* Shared base */
.mg-user {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--mg-text);
	font-family: var(--mg-font-body);
}

/* Logged-out → styled as a compact "Log in" button */
.mg-user--out {
	padding: 9px 16px;
	border: 1px solid var(--mg-red);
	background: rgba(139,0,0,0.2);
	color: #fff;
	border-radius: var(--mg-radius);
	font-weight: 600;
	font-size: .82rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: background .2s, border-color .2s, color .2s;
}
.mg-user--out:hover,
.mg-user--out:focus-visible {
	background: var(--mg-red);
	border-color: var(--mg-red-bright);
	color: #fff;
	text-decoration: none;
}
.mg-user__icon {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

/* Logged-in row */
.mg-user--in {
	gap: 10px;
	padding: 6px 10px 6px 6px;
	border: 1px solid var(--mg-border);
	border-radius: 999px;
	background: var(--mg-surface);
}
.mg-user__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	flex: 0 0 auto;
	border: 1px solid var(--mg-border-strong);
	object-fit: cover;
}
.mg-user__label {
	display: inline-flex;
	flex-direction: column;
	line-height: 1.1;
	font-size: .8rem;
	max-width: 220px;
}
.mg-user__prefix {
	color: var(--mg-text-muted);
	font-size: .68rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.mg-user__name {
	color: #fff;
	font-weight: 600;
	font-size: .92rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mg-user__account {
	margin-left: 4px;
	padding: 6px 10px;
	font-size: .72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mg-text-muted);
	border-radius: var(--mg-radius);
	border: 1px solid var(--mg-border);
	transition: color .2s, border-color .2s, background .2s;
}
.mg-user__account:hover,
.mg-user__account:focus-visible {
	color: #fff;
	border-color: var(--mg-border-strong);
	background: var(--mg-surface-2);
	text-decoration: none;
}
.mg-user__logout {
	margin-left: 4px;
	padding: 6px 10px;
	font-size: .72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mg-text-muted);
	border-radius: var(--mg-radius);
	border: 1px solid transparent;
	transition: color .2s, border-color .2s, background .2s;
}
.mg-user__logout:hover,
.mg-user__logout:focus-visible {
	color: #fff;
	border-color: var(--mg-red);
	background: rgba(139,0,0,0.25);
	text-decoration: none;
}

/* On narrow screens the nav collapses — pull the user widget back next to the
   nav toggle so it's still reachable, and shrink the "Logged in as" label. */
@media (max-width: 860px) {
	.mg-site-header__inner { gap: 12px; }
	.mg-primary-nav { margin-left: 0; }
	.mg-site-header__user { margin-left: auto; order: 2; }
	.mg-nav-toggle { margin-left: 0; order: 3; }

	.mg-user--in { padding: 4px 8px 4px 4px; }
	.mg-user__avatar { width: 28px; height: 28px; }
	.mg-user__label { display: none; } /* avatar + logout stay, label hides to save space */
	.mg-user__account { font-size: .68rem; padding: 5px 8px; }
	.mg-user__logout { font-size: .68rem; padding: 5px 8px; }
}

/* ==========================================================================
   Header Discord button
   --------------------------------------------------------------------------
   Sits between the primary nav and the user widget. Restrained at rest in
   the cream/text colour, lifts to the site's accent red on hover/focus so
   it nudges users toward Discord without competing with the brand.
   ========================================================================== */
.mg-discord-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 7px 12px 7px 10px;
	color: var(--mg-text);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
	text-decoration: none;
	font-family: var(--mg-font-body);
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
	line-height: 1;
}
.mg-discord-link__icon {
	width: 22px;
	height: 17px;
	display: block;
	flex: 0 0 auto;
}
.mg-discord-link__label {
	display: inline-block;
}
.mg-discord-link:hover,
.mg-discord-link:focus-visible {
	color: var(--mg-red-bright);
	border-color: var(--mg-red-bright);
	background: rgba(178, 34, 34, 0.10);
	transform: translateY(-1px);
}
.mg-discord-link:active {
	transform: translateY(0);
}

/* On narrow screens collapse the label so just the mark shows — the icon
   alone still reads as Discord, and we save the horizontal real estate for
   the user widget + nav toggle. */
@media (max-width: 860px) {
	.mg-discord-link {
		padding: 7px;
		gap: 0;
		order: 2;
	}
	.mg-discord-link__label {
		display: none;
	}
	.mg-site-header__user { order: 3; }
	.mg-nav-toggle { order: 4; }
}

/* ==========================================================================
   Login page (/login)
   ========================================================================== */
.mg-login {
	min-height: 70vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(48px, 8vw, 96px) var(--mg-gutter);
	position: relative;
}
.mg-login::before {
	content: '';
	position: absolute; inset: 0;
	background: radial-gradient(500px 300px at 50% 20%, rgba(139,0,0,0.22), transparent 65%);
	pointer-events: none;
	z-index: 0;
}
.mg-login__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 480px;
}
.mg-login__card {
	background: linear-gradient(180deg, var(--mg-surface-2), var(--mg-surface));
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius-lg);
	padding: clamp(28px, 4vw, 44px);
	box-shadow: var(--mg-shadow);
	text-align: center;
}
.mg-login__card--welcome { padding-top: clamp(24px, 3vw, 36px); }
.mg-login__avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	margin: 0 auto 18px;
	border: 2px solid var(--mg-red);
	box-shadow: 0 0 30px rgba(139,0,0,0.35);
	object-fit: cover;
}
.mg-login__title {
	font-size: clamp(1.8rem, 3vw, 2.3rem);
	margin: 0 0 10px;
	color: #fff;
}
.mg-login__subtitle {
	color: var(--mg-text-muted);
	margin: 0 0 28px;
	font-size: 1rem;
	line-height: 1.5;
}
.mg-login__subtitle strong { color: #fff; }

/* Discord-branded CTA */
.mg-login__discord-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	padding: 14px 22px;
	background: #5865F2;
	color: #fff;
	border: 1px solid #5865F2;
	border-radius: var(--mg-radius);
	font: 600 .95rem/1 var(--mg-font-body);
	letter-spacing: 0.04em;
	text-decoration: none;
	transition: background .2s, border-color .2s, transform .12s;
}
.mg-login__discord-btn:hover,
.mg-login__discord-btn:focus-visible {
	background: #4752c4;
	border-color: #4752c4;
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
}
.mg-login__discord-icon { flex: 0 0 auto; }

.mg-login__fineprint {
	margin: 22px 0 0;
	font-size: .85rem;
	color: var(--mg-text-muted);
}
.mg-login__admin-note {
	margin: 28px 0 0;
	padding-top: 18px;
	border-top: 1px dashed var(--mg-border);
	font-size: .78rem;
	color: var(--mg-text-dim);
}
.mg-login__admin-note a { color: var(--mg-text-muted); }
.mg-login__admin-note a:hover { color: var(--mg-text); }

.mg-login__actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}
.mg-login__actions .mg-btn + .mg-btn { margin-left: 0; }

/* ==========================================================================
   Account page (/account)
   ========================================================================== */
.mg-account {
	padding: clamp(48px, 8vw, 96px) var(--mg-gutter);
}
.mg-account__inner {
	max-width: var(--mg-container);
	margin: 0 auto;
}

/* Profile header */
.mg-account__profile {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: clamp(32px, 5vw, 56px);
}
.mg-account__avatar {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	border: 2px solid var(--mg-border-strong);
	object-fit: cover;
	flex: 0 0 auto;
}
.mg-account__name {
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	margin: 0 0 4px;
}
.mg-account__meta {
	color: var(--mg-text-muted);
	font-size: .9rem;
	margin: 0;
}

/* Card grid */
.mg-account__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}
.mg-account__card {
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius-lg);
	padding: clamp(20px, 3vw, 32px);
}
.mg-account__card--full {
	grid-column: 1 / -1;
}
.mg-account__card-title {
	font-size: 1rem;
	font-family: var(--mg-font-body);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--mg-text-muted);
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--mg-border);
}

/* Token balance */
.mg-account__card--tokens { text-align: center; }
.mg-account__token-balance {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 8px;
	padding: 12px 0 4px;
}
.mg-account__token-amount {
	font-family: var(--mg-font-display);
	font-size: clamp(2.8rem, 5vw, 4rem);
	font-weight: 900;
	color: var(--mg-gold);
	line-height: 1;
}
.mg-account__token-label {
	font-size: .85rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--mg-text-muted);
}

/* Account linking list */
.mg-account__link-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.mg-account__link-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: var(--mg-surface-2);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
}
.mg-account__link-game {
	font-weight: 600;
	font-size: .92rem;
}
.mg-account__link-status {
	font-size: .78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
}
.mg-account__link-status--linked {
	color: #c2f1cc;
	background: rgba(80,200,120,0.15);
	border: 1px solid rgba(80,200,120,0.3);
}
.mg-account__link-status--unlinked {
	color: var(--mg-text-dim);
	background: rgba(255,255,255,0.04);
	border: 1px solid var(--mg-border);
}
.mg-account__link-status--unknown {
	color: var(--mg-text-dim);
	background: transparent;
	border: 1px dashed var(--mg-border);
	letter-spacing: 0;
}

/* "Link here →" button — shown when a game has a linking flow but the
   current user isn't linked yet. Colour mirrors the Discord brand so the
   user associates the action with the Discord handoff it performs. */
.mg-account__link-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 6px 14px;
	border-radius: 999px;
	color: #fff;
	background: #5865F2;
	border: 1px solid #5865F2;
	transition: background-color .15s ease, transform .15s ease;
}
.mg-account__link-btn:hover,
.mg-account__link-btn:focus {
	background: #4752c4;
	border-color: #4752c4;
	color: #fff;
	transform: translateY(-1px);
}

/* Subscriptions */
.mg-account__subs-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}
@media (max-width: 640px) {
	.mg-account__subs-grid { grid-template-columns: 1fr; }
}
.mg-account__subs-heading {
	font-size: .88rem;
	font-family: var(--mg-font-body);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--mg-text-muted);
	margin: 0 0 14px;
}
.mg-account__empty {
	color: var(--mg-text-dim);
	font-size: .9rem;
	font-style: italic;
	margin: 0;
}
.mg-account__subs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9rem;
}
.mg-account__subs-table th,
.mg-account__subs-table td {
	padding: 8px 12px;
	text-align: left;
	border-bottom: 1px solid rgba(255,255,255,.07);
}
.mg-account__subs-table th {
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--mg-text-muted);
	border-bottom-color: rgba(255,255,255,.15);
}
.mg-account__subs-table td:first-child { font-weight: 600; }
.mg-account__subs-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 560px) {
	.mg-account__profile { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Primary nav — Servers dropdown polish
   ========================================================================== */

/*
 * Use a caret on menu items that have children so people know there's more.
 * We target the generic `menu-item-has-children` class that WP adds (and that
 * we mirror on our synthesised Games) rather than our theme class.
 */
.mg-menu .menu-item-has-children > a::after {
	content: "▾";
	margin-left: 6px;
	font-size: .7em;
	opacity: .75;
	transform: translateY(-1px);
	display: inline-block;
}
.mg-menu .sub-menu a {
	padding: 8px 12px;
	font-size: .78rem;
	white-space: nowrap;
}
.mg-menu .sub-menu a:hover { background: rgba(139,0,0,.4); }
/* Hairline divider after the "All servers" first item so it feels like a section. */
.mg-menu .sub-menu li:first-child a { border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 4px; padding-bottom: 10px; }

@media (max-width: 860px) {
	/* On mobile the dropdown becomes inline — no absolute positioning,
	   always visible when the parent menu is open. */
	.mg-menu .sub-menu {
		position: static;
		display: block;
		background: transparent;
		border: none;
		padding-left: 14px;
		margin: 4px 0 8px;
	}
	.mg-menu .sub-menu a { font-size: .85rem; padding: 8px 10px; }
	.mg-menu .menu-item-has-children > a::after { display: none; }
}

/* ==========================================================================
   Page hero — small label alongside the H1
   ========================================================================== */

.mg-page-hero__short {
	display: inline-block;
	margin-left: .5em;
	padding: 4px 10px;
	font-size: .55em;
	letter-spacing: .12em;
	text-transform: uppercase;
	background: rgba(255,255,255,.06);
	border: 1px solid var(--mg-border);
	border-radius: 999px;
	color: var(--mg-text-muted);
	vertical-align: middle;
	font-weight: 600;
	font-family: var(--mg-font-body, inherit);
}

/* Player count badge — sits inline after the game title on stats pages */
.mg-page-hero__player-count {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	margin-left: .75em;
	padding: 6px 18px;
	background: rgba(139,0,0,.18);
	border: 1px solid rgba(139,0,0,.4);
	border-radius: 12px;
	vertical-align: middle;
	line-height: 1;
	gap: 3px;
}
.mg-page-hero__player-count-value {
	font-size: .6em;
	font-weight: 800;
	color: #e05555;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.01em;
}
.mg-page-hero__player-count-label {
	font-size: .22em;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: rgba(255,255,255,.45);
	font-family: var(--mg-font-body, inherit);
}

/* ==========================================================================
   Single-game page — button nav (Info / Challenge / Stats)
   ========================================================================== */

.mg-game-nav {
	display: flex; flex-wrap: wrap; gap: 10px;
	margin: 0 0 32px;
	padding: 6px;
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
}
.mg-game-nav__btn {
	flex: 1 1 auto;
	text-align: center;
	padding: 12px 18px;
	border-radius: calc(var(--mg-radius) - 2px);
	color: var(--mg-text-muted);
	text-decoration: none;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	font-size: .82rem;
	transition: background .2s, color .2s;
}
.mg-game-nav__btn:hover, .mg-game-nav__btn:focus-visible {
	background: rgba(139,0,0,.18);
	color: var(--mg-text);
}
.mg-game-nav__btn.is-active {
	background: rgba(139,0,0,.55);
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

/* Server-cards block on a game page */
.mg-game-servers { margin-bottom: 40px; }
.mg-game-servers__title {
	font-size: 1.1rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--mg-text-muted);
	margin: 0 0 14px;
	font-weight: 600;
}

/* ==========================================================================
   Single-game page — jump-to-section index (ARK pages)
   ========================================================================== */

.mg-toc {
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
	padding: 18px 22px;
	margin: 0 0 36px;
}
.mg-toc__title {
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: var(--mg-text-muted);
	margin: 0 0 10px;
	font-weight: 700;
}
.mg-toc__list {
	list-style: none;
	padding: 0; margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 4px 18px;
	counter-reset: mg-toc;
}
.mg-toc__list li { counter-increment: mg-toc; }
.mg-toc__list a {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	color: var(--mg-text);
	text-decoration: none;
	padding: 6px 0;
	border-bottom: 1px solid transparent;
	transition: border-color .15s, color .15s;
}
.mg-toc__list a::before {
	content: counter(mg-toc, decimal-leading-zero);
	font-family: 'Playfair Display', serif;
	color: var(--mg-accent, #8B0000);
	font-size: .85em;
	font-weight: 700;
}
.mg-toc__list a:hover, .mg-toc__list a:focus-visible {
	color: #fff;
	border-bottom-color: var(--mg-accent, #8B0000);
}

/* Give H2s within the main content enough scroll-margin that the sticky
   header doesn't clip the heading when anchor-scrolling. */
.mg-game-content h2 {
	scroll-margin-top: 96px;
	margin-top: 1.8em;
}
.mg-game-content h2:first-child { margin-top: 0; }
.mg-game-content .mg-lede {
	font-size: 1.1rem;
	color: var(--mg-text-muted);
	line-height: 1.6;
	margin-bottom: 2em;
	padding-left: 16px;
	border-left: 3px solid var(--mg-accent, #8B0000);
}
.mg-game-content pre {
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
	padding: 14px 16px;
	overflow-x: auto;
	font-size: .9rem;
}
.mg-game-content code {
	background: rgba(255,255,255,.07);
	padding: 1px 6px;
	border-radius: 4px;
	font-size: .92em;
}
.mg-game-content pre code { background: transparent; padding: 0; }
.mg-game-content ul, .mg-game-content ol { margin: 1em 0 1em 1.4em; }
.mg-game-content li { margin-bottom: 6px; line-height: 1.5; }

/* Stats-page leaderboard table */
.mg-stats-table {
	width: 100%; border-collapse: collapse; margin: 1em 0 2em;
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
	overflow: hidden;
}
.mg-stats-table th, .mg-stats-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--mg-border);
}
.mg-stats-table thead th {
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--mg-text-muted);
	background: rgba(255,255,255,.03);
}
.mg-stats-table tbody tr:last-child td { border-bottom: none; }
.mg-stats-table tbody td:first-child { font-weight: 600; }
.mg-stats-table tbody td:last-child { font-variant-numeric: tabular-nums; text-align: right; }

/* Personal-stats block (Stats sub-page) */
.mg-personal-stats {
	margin-top: 48px;
	padding: 28px;
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
}
.mg-personal-stats > h2 {
	margin: 0 0 22px;
	font-size: 1.3rem;
}
.mg-personal-stats__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 16px;
}
.mg-personal-stats__cell {
	padding: 22px;
	text-align: center;
	background: var(--mg-black);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
}
.mg-personal-stats__num {
	display: block;
	font-family: 'Playfair Display', serif;
	font-size: 2.6rem;
	color: var(--mg-accent, #8B0000);
	font-weight: 700;
	line-height: 1;
}
.mg-personal-stats__label {
	display: block;
	margin-top: 8px;
	text-transform: uppercase;
	letter-spacing: .1em;
	font-size: .72rem;
	color: var(--mg-text-muted);
}
.mg-personal-stats__login {
	text-align: center;
	padding: 18px;
}
.mg-personal-stats__login p {
	margin: 0 0 14px;
	color: var(--mg-text-muted);
}

/* ==========================================================================
   Servers page — game "jumpcards"
   --------------------------------------------------------------------------
   One box per game at the top of /servers/. Two interactive regions:

   1. `.mg-jumpcard__main`  — the card body; clicking navigates to the
      per-game page (/games/{slug}/).
   2. `.mg-jumpcard__jump`  — a drop-down tab below the card that appears
      on hover (or focus-within) and anchors to #game-{slug} further
      down the same /servers/ page.

   On touch devices (no hover) the tab is revealed permanently via a
   `@media (hover: none)` override so mobile users retain access.
   ========================================================================== */
.mg-jumpcards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: clamp(14px, 2vw, 22px);
	margin-bottom: clamp(36px, 6vw, 64px);
}
.mg-jumpcard {
	position: relative;
	/* Reserve room underneath so the drop-tab doesn't overlap the next row.
	   Collapses on mobile where the tab is inline (see hover-none rules). */
	padding-bottom: 0;
}
.mg-jumpcard__main {
	display: block;
	position: relative;
	border: 1px solid var(--mg-border);
	background: linear-gradient(180deg, var(--mg-surface-2), var(--mg-surface));
	border-radius: var(--mg-radius-lg);
	padding: 22px 24px;
	text-decoration: none;
	color: var(--mg-text);
	transition: border-color .2s, transform .2s, box-shadow .2s;
	overflow: hidden;
	z-index: 1;
}
.mg-jumpcard__main::after {
	content: '';
	position: absolute; right: -40px; top: -40px;
	width: 120px; height: 120px; border-radius: 50%;
	background: radial-gradient(circle, rgba(139,0,0,0.35), transparent 60%);
	pointer-events: none;
}
.mg-jumpcard:hover .mg-jumpcard__main,
.mg-jumpcard:focus-within .mg-jumpcard__main {
	border-color: var(--mg-red);
	transform: translateY(-2px);
	color: #fff;
	text-decoration: none;
	box-shadow: var(--mg-shadow);
}
.mg-jumpcard__short {
	display: inline-block;
	font-size: .68rem;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--mg-red-bright);
	margin-bottom: 6px;
}
.mg-jumpcard__title {
	font-family: var(--mg-font-display);
	font-weight: 700;
	font-size: 1.35rem;
	color: #fff;
	margin: 0 0 6px;
	line-height: 1.15;
}
.mg-jumpcard__meta {
	color: var(--mg-text-muted);
	font-size: .88rem;
	display: block;
}
.mg-jumpcard__arrow {
	position: absolute;
	right: 18px;
	bottom: 16px;
	color: var(--mg-red-bright);
	font-size: 1.1rem;
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity .2s, transform .2s;
}
.mg-jumpcard:hover .mg-jumpcard__arrow,
.mg-jumpcard:focus-within .mg-jumpcard__arrow {
	opacity: 1;
	transform: translateX(0);
}

/* The "Jump to server IP" drop-tab.
   Default: tucked behind the main card, transparent, pointer-events off.
   On hover/focus: slides down below the card and becomes clickable. */
.mg-jumpcard__jump {
	position: absolute;
	left: 10px;
	right: 10px;
	top: 100%;
	margin-top: -6px;          /* slight overlap for a "tab" feel */
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	background: var(--mg-red);
	color: #fff;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	border-bottom-left-radius: var(--mg-radius);
	border-bottom-right-radius: var(--mg-radius);
	opacity: 0;
	transform: translateY(-8px);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
	z-index: 2;
	box-shadow: 0 10px 24px rgba(0,0,0,0.5);
}
.mg-jumpcard__jump::before {
	content: '↓';
	display: inline-block;
	font-size: 1rem;
	line-height: 1;
	transform: translateY(-1px);
}
.mg-jumpcard:hover .mg-jumpcard__jump,
.mg-jumpcard:focus-within .mg-jumpcard__jump {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}
.mg-jumpcard__jump:hover,
.mg-jumpcard__jump:focus-visible {
	background: var(--mg-red-bright);
	color: #fff;
	text-decoration: none;
}

/* Touch devices have no hover — show the tab permanently, inline below
   the card, so taps still reach it. */
@media (hover: none) {
	.mg-jumpcard__jump {
		position: static;
		margin-top: 6px;
		opacity: 1;
		transform: none;
		pointer-events: auto;
		box-shadow: none;
		border-radius: var(--mg-radius);
	}
	.mg-jumpcard__arrow { opacity: 1; transform: none; }
}

/* Keep a little breathing room below the row so the dropped tab (on
   hover-capable viewports) doesn't visually collide with whatever is
   immediately below the grid. */
@media (hover: hover) {
	.mg-jumpcards { padding-bottom: 48px; }
}

/* Make the server-group title anchor in the lower list click-to-game. */
.mg-servers-group__link {
	color: inherit;
	text-decoration: none;
}
.mg-servers-group__link:hover,
.mg-servers-group__link:focus-visible {
	color: var(--mg-red-bright);
	text-decoration: none;
}

/* Smooth-scroll anchor jumps from the drop-tabs, and clear the sticky
   header when the browser lands on the target. */
html { scroll-behavior: smooth; }
.mg-servers-group {
	scroll-margin-top: 100px;
}

/* ==========================================================================
   Game Stats → personal dashboard
   --------------------------------------------------------------------------
   Three visual states share one layout via the root modifier class:
     .mg-dashboard--live   → unlocked (user is logged in + linked)
     .mg-dashboard--link   → locked, shows link CTA overlay
     .mg-dashboard--login  → locked, shows login CTA overlay
   ========================================================================== */
.mg-dashboard {
	position: relative;
	margin: clamp(32px, 5vw, 48px) 0 0;
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius-lg);
	padding: clamp(20px, 3vw, 32px);
	overflow: hidden;
}
.mg-dashboard__header {
	margin-bottom: 22px;
}
.mg-dashboard__title {
	font-family: var(--mg-font-display);
	font-weight: 700;
	color: #fff;
	margin: 0 0 6px;
	font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}
.mg-dashboard__sub {
	color: var(--mg-text-muted);
	margin: 0;
	font-size: .95rem;
}

.mg-dashboard__profile {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
	margin-bottom: 22px;
}
.mg-dashboard__profile-cell {
	background: var(--mg-black);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.mg-dashboard__profile-label {
	text-transform: uppercase;
	letter-spacing: .14em;
	font-size: .7rem;
	color: var(--mg-text-muted);
}
.mg-dashboard__profile-value {
	font-family: var(--mg-font-display);
	font-weight: 700;
	font-size: 1.3rem;
	color: #fff;
}

/* Stats summary bar — sits above the side-by-side grid. */
.mg-stats-summary {
	display: flex;
	gap: 20px;
	margin-bottom: 32px;
}
.mg-stats-summary__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: var(--mg-surface, #1e1e2e);
	border: 1px solid var(--mg-border, rgba(255,255,255,.08));
	border-radius: 14px;
	padding: 28px 48px;
	gap: 8px;
	position: relative;
	overflow: hidden;
}
/* Subtle accent glow behind the number */
.mg-stats-summary__item::before {
	content: '';
	position: absolute;
	top: -40px; left: 50%;
	transform: translateX(-50%);
	width: 120px; height: 120px;
	background: radial-gradient(circle, rgba(139,0,0,.25) 0%, transparent 70%);
	pointer-events: none;
}
.mg-stats-summary__value {
	font-size: 3.8rem;
	font-weight: 800;
	line-height: 1;
	color: var(--mg-accent, #c0392b);
	font-variant-numeric: tabular-nums;
	letter-spacing: -.02em;
}
.mg-stats-summary__label {
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--mg-text-muted, rgba(255,255,255,.45));
}

/* ASE stats page: global leaderboard + personal dashboard side by side.
   Both children stretch to the same height so the panels visually align. */
.mg-ase-stats-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	align-items: stretch;
	margin-top: 8px;
}
@media ( max-width: 960px ) {
	.mg-ase-stats-layout {
		grid-template-columns: 1fr;
	}
}
.mg-ase-stats-layout > .mg-stats-panel {
	min-width: 0; /* prevent grid blowout on long table content */
}

/* "Decayed" label — past decay date */
.mg-dashboard__decayed {
	color: #ff6b6b;
	font-weight: 700;
}

/* Decay imminent — highlight the cell red when < 3 days remain */
.mg-dashboard__profile-cell--danger {
	border-color: #c0392b;
	background: rgba(192, 57, 43, 0.12);
}
.mg-dashboard__profile-cell--danger .mg-dashboard__profile-label {
	color: #e57373;
}
.mg-dashboard__profile-cell--danger .mg-dashboard__profile-value {
	color: #ff6b6b;
}
.mg-dashboard__decay-warn {
	display: inline-block;
	margin-left: 6px;
	font-size: 1rem;
	color: #ff6b6b;
	vertical-align: middle;
}

/* Right-align numeric column in the global stats table */
.mg-stats-table__num {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.mg-dashboard__table {
	width: 100%;
	border-collapse: collapse;
	background: var(--mg-black);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
	overflow: hidden;
}
.mg-dashboard__table th,
.mg-dashboard__table td {
	padding: 12px 18px;
	text-align: left;
	border-bottom: 1px solid var(--mg-border);
}
.mg-dashboard__table thead th {
	background: var(--mg-surface-2);
	color: var(--mg-text-muted);
	font-size: .72rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 600;
}
.mg-dashboard__table tbody tr:last-child td {
	border-bottom: none;
}
.mg-dashboard__table-num {
	font-family: var(--mg-font-display);
	font-weight: 700;
	color: #fff;
	text-align: right;
	font-size: 1.1rem;
	font-variant-numeric: tabular-nums;
}

/* Locked states — fade the body and drop a clickable overlay in front
   of it. The body is still there (for layout stability + screen readers),
   just dimmed and non-interactive. */
.mg-dashboard--login .mg-dashboard__body,
.mg-dashboard--link  .mg-dashboard__body {
	opacity: .25;
	filter: grayscale(0.9);
	pointer-events: none;
	user-select: none;
}

.mg-dashboard__lock {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 3vw, 32px);
	background: linear-gradient(
		180deg,
		rgba(15,15,16,0.55) 0%,
		rgba(15,15,16,0.85) 100%
	);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: 2;
}
.mg-dashboard__lock-inner {
	text-align: center;
	max-width: 440px;
}
.mg-dashboard__lock-title {
	font-family: var(--mg-font-display);
	font-weight: 700;
	color: #fff;
	margin: 0 0 10px;
	font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}
.mg-dashboard__lock-text {
	color: var(--mg-text-muted);
	margin: 0 0 18px;
	font-size: .95rem;
	line-height: 1.5;
}

/* ==========================================================================
   Stats Panel — shared chrome for ASE Global Leaderboard + Personal Stats
   --------------------------------------------------------------------------
   Both panels on /games/ark-survival-evolved/stats/ share the same shell so
   side-by-side they read as a matched set:
     • mg-stats-panel               — outer card (positioning, padding, bg)
     • mg-stats-panel__header       — title + sub copy at the top
     • mg-stats-panel__body         — content area (profile + table)
     • mg-stats-panel__table        — table styling (used by both panels)
     • mg-stats-panel__profile      — Character / Tribe / Last Login / Decay
     • mg-stats-panel__lock         — overlay for login/link state
     • mg-stats-panel--login/link   — modifier states (greys out body)
   This system replaces the older .mg-stats-table on the leaderboard side.
   ========================================================================== */

.mg-stats-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--mg-surface);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius-lg);
	padding: clamp(20px, 2.4vw, 28px);
	overflow: hidden;
	height: 100%;
}

/* Header — title + lede */
.mg-stats-panel__header {
	margin: 0 0 20px;
	padding: 0 0 18px;
	border-bottom: 1px solid var(--mg-border);
}
.mg-stats-panel__title {
	font-family: var(--mg-font-display);
	font-weight: 700;
	color: #fff;
	margin: 0 0 8px;
	font-size: clamp(1.35rem, 2.2vw, 1.65rem);
	line-height: 1.2;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.mg-stats-panel__title-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--mg-font-body);
	font-size: .68rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--mg-accent, #c0392b);
	border: 1px solid var(--mg-accent, #c0392b);
	background: rgba(192, 57, 43, 0.10);
	padding: 4px 10px;
	border-radius: 999px;
	line-height: 1;
}
/* Pulsing dot before "Live" — quiet visual cue that data is fresh. */
.mg-stats-panel__title-badge::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 0 currentColor;
	animation: mg-stats-pulse 2s ease-out infinite;
}
.mg-stats-panel__title-badge--you {
	color: var(--mg-text-muted);
	border-color: var(--mg-border-strong);
	background: rgba(255,255,255,0.04);
}
.mg-stats-panel__title-badge--you::before {
	display: none;
}
@keyframes mg-stats-pulse {
	0%   { box-shadow: 0 0 0 0   rgba(192, 57, 43, 0.55); }
	70%  { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0);    }
	100% { box-shadow: 0 0 0 0   rgba(192, 57, 43, 0);    }
}
.mg-stats-panel__sub {
	color: var(--mg-text-muted);
	margin: 0;
	font-size: .92rem;
	line-height: 1.55;
}

/* Body — fills remaining height so both panels equalise */
.mg-stats-panel__body {
	display: flex;
	flex-direction: column;
	gap: 18px;
	flex: 1 1 auto;
}

/* Empty state */
.mg-stats-panel__empty {
	color: var(--mg-text-muted);
	margin: 0;
	padding: 24px;
	text-align: center;
	background: var(--mg-black);
	border: 1px dashed var(--mg-border);
	border-radius: var(--mg-radius);
}

/* Profile cells (personal panel only) */
.mg-stats-panel__profile {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
}
.mg-stats-panel__profile-cell {
	background: var(--mg-black);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.mg-stats-panel__profile-label {
	text-transform: uppercase;
	letter-spacing: .14em;
	font-size: .66rem;
	color: var(--mg-text-muted);
	font-weight: 600;
}
.mg-stats-panel__profile-value {
	font-family: var(--mg-font-display);
	font-weight: 700;
	font-size: 1.1rem;
	color: #fff;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Decay state markers (preserved from .mg-dashboard pattern) */
.mg-stats-panel__decayed { color: #ff6b6b; font-weight: 700; }
.mg-stats-panel__profile-cell--danger {
	border-color: #c0392b;
	background: rgba(192, 57, 43, 0.12);
}
.mg-stats-panel__profile-cell--danger .mg-stats-panel__profile-label { color: #e57373; }
.mg-stats-panel__profile-cell--danger .mg-stats-panel__profile-value { color: #ff6b6b; }
.mg-stats-panel__decay-warn {
	display: inline-block;
	margin-left: 6px;
	font-size: 1rem;
	color: #ff6b6b;
	vertical-align: middle;
}

/* Shared table — used for BOTH the leaderboard and the personal stats. */
.mg-stats-panel__table {
	width: 100%;
	border-collapse: collapse;
	background: var(--mg-black);
	border: 1px solid var(--mg-border);
	border-radius: var(--mg-radius);
	overflow: hidden;
	margin: 0;
	table-layout: fixed;
}
.mg-stats-panel__table th,
.mg-stats-panel__table td {
	padding: 10px 14px;
	text-align: left;
	border-bottom: 1px solid var(--mg-border);
	font-size: .94rem;
	vertical-align: middle;
}
.mg-stats-panel__table thead th {
	background: var(--mg-surface-2);
	color: var(--mg-text-muted);
	font-size: .66rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 700;
	padding: 11px 14px;
}
.mg-stats-panel__th--num { text-align: right; }
.mg-stats-panel__table tbody tr:last-child td { border-bottom: none; }
.mg-stats-panel__table tbody tr:hover td {
	background: rgba(255,255,255,0.025);
}

/* First column: stat label — readable, high contrast */
.mg-stats-panel__cell--label {
	font-weight: 600;
	color: #fff;
}
/* Player name (leaderboard only) — muted so the score reads first */
.mg-stats-panel__cell--player {
	color: var(--mg-text-muted);
	font-size: .9rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* Numeric / score cells — display font, right-aligned, tabular-nums */
.mg-stats-panel__cell--num {
	font-family: var(--mg-font-display);
	font-weight: 700;
	color: #fff;
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-size: 1rem;
	white-space: nowrap;
}
/* Personal "Top" comparison column — dimmed so the user's own score wins */
.mg-stats-panel__cell--top {
	color: var(--mg-text-muted);
	font-weight: 600;
	font-size: .92rem;
}

/* Column widths — fixed table layout means we can hint proportions */
.mg-stats-panel__table--leaderboard col,
.mg-stats-panel__table--personal col { display: none; }
.mg-stats-panel__table--leaderboard th:nth-child(1),
.mg-stats-panel__table--leaderboard td:nth-child(1) { width: 46%; }
.mg-stats-panel__table--leaderboard th:nth-child(2),
.mg-stats-panel__table--leaderboard td:nth-child(2) { width: 34%; }
.mg-stats-panel__table--leaderboard th:nth-child(3),
.mg-stats-panel__table--leaderboard td:nth-child(3) { width: 20%; }

.mg-stats-panel__table--personal th:nth-child(1),
.mg-stats-panel__table--personal td:nth-child(1) { width: 56%; }
.mg-stats-panel__table--personal th:nth-child(2),
.mg-stats-panel__table--personal td:nth-child(2) { width: 22%; }
.mg-stats-panel__table--personal th:nth-child(3),
.mg-stats-panel__table--personal td:nth-child(3) { width: 22%; }

/* Locked states — fade body, drop a clickable overlay in front. */
.mg-stats-panel--login .mg-stats-panel__body,
.mg-stats-panel--link  .mg-stats-panel__body {
	opacity: .25;
	filter: grayscale(0.9);
	pointer-events: none;
	user-select: none;
}
.mg-stats-panel__lock {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 3vw, 32px);
	background: linear-gradient(
		180deg,
		rgba(15,15,16,0.55) 0%,
		rgba(15,15,16,0.88) 100%
	);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: 2;
}
.mg-stats-panel__lock-inner {
	text-align: center;
	max-width: 440px;
}
.mg-stats-panel__lock-title {
	font-family: var(--mg-font-display);
	font-weight: 700;
	color: #fff;
	margin: 0 0 10px;
	font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}
.mg-stats-panel__lock-text {
	color: var(--mg-text-muted);
	margin: 0 0 18px;
	font-size: .95rem;
	line-height: 1.5;
}

/* Tighten paddings on narrow screens so the table doesn't squeeze copy */
@media ( max-width: 540px ) {
	.mg-stats-panel { padding: 18px; }
	.mg-stats-panel__table th,
	.mg-stats-panel__table td { padding: 9px 10px; font-size: .88rem; }
	.mg-stats-panel__cell--num { font-size: .95rem; }
	.mg-stats-panel__profile-value { font-size: 1rem; }
}
