/* ==========================================================================
   NEMESIS — WebEngine template (black, gold & white)
   ========================================================================== */
:root {
	--nm-bg: #070708;
	--nm-bg-2: #0b0b0c;
	--nm-bg-3: #0c0c0d;
	--nm-surface: #0f0f10;
	--nm-surface-2: #111112;
	--nm-input: #08080a;
	--nm-line: #241f14;
	--nm-line-2: #2c2618;
	--nm-line-3: #4a3f26;
	--nm-gold: #D4A84B;
	--nm-gold-text: #E6C068;
	--nm-gold-hover: #F7DFA0;
	--nm-on-gold: #0a0806;
	--nm-white: #ffffff;
	--nm-text: #f5f3ee;
	--nm-text-2: #d8d4cb;
	--nm-text-3: #bdb8ae;
	--nm-muted: #a8a39a;
	--nm-online: #7fd15a;
	--nm-radius: 6px;
	--nm-display: 'Cinzel', Georgia, serif;
	--nm-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---- base ---------------------------------------------------------------- */
html, body { background: var(--nm-bg); }
body.nm {
	margin: 0;
	font-family: var(--nm-body);
	font-size: 15px;
	line-height: 1.55;
	color: var(--nm-text);
	background: var(--nm-bg);
	-webkit-font-smoothing: antialiased;
}
body.nm *, body.nm *::before, body.nm *::after { box-sizing: border-box; }
body.nm a { color: var(--nm-gold-text); text-decoration: none; }
body.nm a:hover, body.nm a:focus { color: var(--nm-gold-hover); text-decoration: none; }
body.nm img { max-width: 100%; }
body.nm h1, body.nm h2, body.nm h3, body.nm h4 { color: var(--nm-white); }
.nm-container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.nm-display { font-family: var(--nm-display); font-weight: 800; letter-spacing: .5px; }
.nm-skip { position: absolute; left: -9999px; top: 0; }
.nm-skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--nm-gold); color: var(--nm-on-gold) !important; padding: 10px 16px; border-radius: 4px; }

/* ---- buttons ------------------------------------------------------------- */
.nm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 44px; padding: 12px 18px; border-radius: 4px;
	font: 700 14px/1 var(--nm-body); text-transform: uppercase; letter-spacing: 1px;
	border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
body.nm .nm-btn-gold { background: var(--nm-gold); color: var(--nm-on-gold); }
body.nm .nm-btn-gold:hover { background: var(--nm-gold-hover); color: var(--nm-on-gold); }
body.nm .nm-btn-ghost { background: rgba(7,7,8,.55); color: var(--nm-white); border-color: var(--nm-gold); }
body.nm .nm-btn-ghost:hover { border-color: var(--nm-gold-hover); color: var(--nm-gold-hover); }
body.nm .nm-btn-line { background: transparent; color: var(--nm-text); border-color: var(--nm-line-3); text-transform: none; letter-spacing: 0; font-weight: 600; }
body.nm .nm-btn-line:hover { border-color: var(--nm-gold); color: var(--nm-white); }
.nm-btn-lg { padding: 16px 28px; font-size: 16px; }
.nm-btn svg { flex: 0 0 auto; }

/* ---- header -------------------------------------------------------------- */
.nm-header { position: sticky; top: 0; z-index: 50; background: rgba(7,7,8,.9); border-bottom: 1px solid var(--nm-line-2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.nm-header-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding-top: 8px; padding-bottom: 8px; }
.nm-logo img { height: 64px; width: auto; display: block; }
.nm-nav { flex: 1 1 auto; }
.nm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 26px; }
.nm-nav a { display: block; padding: 12px 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; color: var(--nm-text-2) !important; }
.nm-nav a:hover, .nm-nav a.active { color: var(--nm-gold-text) !important; }
.nm-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.nm-actions .nm-btn { text-transform: none; letter-spacing: 0; }
.nm-menu-toggle { display: none; margin-left: auto; background: transparent; border: 1px solid var(--nm-line-3); color: var(--nm-text); border-radius: 4px; width: 44px; height: 44px; cursor: pointer; }

/* ---- hero ---------------------------------------------------------------- */
.nm-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--nm-line-2); background: var(--nm-bg) center/cover no-repeat; }
.nm-hero-bg { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.nm-hero::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(7,7,8,.96) 0%, rgba(7,7,8,.82) 38%, rgba(7,7,8,.25) 70%, rgba(7,7,8,.1) 100%); }
.nm-hero::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(180deg, rgba(7,7,8,0) 0%, var(--nm-bg) 100%); }
.nm-hero-in { position: relative; z-index: 2; padding-top: 96px; padding-bottom: 128px; }
.nm-hero-copy { max-width: 580px; display: flex; flex-direction: column; gap: 24px; }
.nm-hero h1 { margin: 0; font-family: var(--nm-display); font-weight: 800; font-size: clamp(38px, 6vw, 70px); line-height: 1.04; letter-spacing: 1px; color: var(--nm-white); }
.nm-hero h1 span { color: var(--nm-gold-text); }
.nm-hero p { margin: 0; font-size: 18px; line-height: 1.6; color: #e2ded5; }
.nm-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.nm-pill { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--nm-text); background: rgba(7,7,8,.6); border: 1px solid var(--nm-line-3); padding: 8px 14px; border-radius: 999px; }
.nm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nm-online); }
.nm-dot.off { background: #c0503c; }

/* compact banner for inner pages */
.nm-banner { position: relative; overflow: hidden; border-bottom: 1px solid var(--nm-line-2); }
.nm-banner .nm-hero-bg { object-position: 70% 45%; }
.nm-banner::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(7,7,8,.95) 0%, rgba(7,7,8,.7) 50%, rgba(7,7,8,.45) 100%); }
.nm-banner-in { position: relative; z-index: 2; padding-top: 40px; padding-bottom: 40px; }

/* ---- status strip -------------------------------------------------------- */
.nm-stats { background: var(--nm-bg-3); border-bottom: 1px solid var(--nm-line-2); }
.nm-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.nm-stat { padding: 22px 16px; border-right: 1px solid #1f1c15; }
.nm-stat:last-child { border-right: 0; }
.nm-stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--nm-gold-text); }
.nm-stat-value { font-size: 22px; font-weight: 700; margin-top: 6px; color: var(--nm-white); }
.nm-stat-value small { font-size: 13px; color: var(--nm-muted); font-weight: 500; }

/* ---- sections ------------------------------------------------------------ */
.nm-section { padding-top: 80px; padding-bottom: 80px; }
.nm-section-alt { background: var(--nm-bg-2); border-top: 1px solid var(--nm-line-2); border-bottom: 1px solid var(--nm-line-2); }
.nm-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.nm-section-head h2 { margin: 0; font-family: var(--nm-display); font-size: 30px; font-weight: 800; }
.nm-section-head a { font-size: 14px; font-weight: 600; }
.nm-split { display: flex; flex-wrap: wrap; gap: 32px; }
.nm-main { flex: 999 1 560px; min-width: 0; }
.nm-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* ---- cards --------------------------------------------------------------- */
.nm-card { border: 1px solid var(--nm-line); border-radius: var(--nm-radius); background: var(--nm-surface); padding: 24px; }
.nm-card-strong { border-color: var(--nm-line-3); background: var(--nm-surface-2); padding: 28px; }
.nm-card h3 { margin: 0 0 8px; font-family: var(--nm-display); font-size: 20px; font-weight: 800; }
.nm-card p { margin: 0 0 12px; color: var(--nm-text-3); font-size: 14px; }

/* news */
.nm-news { display: flex; flex-direction: column; gap: 16px; }
.nm-news-item { display: flex; flex-wrap: wrap; gap: 20px; padding: 20px; border: 1px solid var(--nm-line); border-radius: var(--nm-radius); background: var(--nm-surface); color: var(--nm-text) !important; transition: border-color .15s; }
.nm-news-item:hover { border-color: var(--nm-line-3); }
.nm-news-body { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.nm-news-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--nm-muted); }
.nm-tag { color: var(--nm-on-gold); background: var(--nm-gold); font-weight: 700; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: .5px; }
.nm-news-title { font-size: 18px; font-weight: 600; color: var(--nm-white); }
.nm-news-text { font-size: 14px; line-height: 1.55; color: var(--nm-text-3); }
.nm-empty { padding: 24px; border: 1px dashed var(--nm-line-3); border-radius: var(--nm-radius); color: var(--nm-muted); text-align: center; }

/* login card */
.nm-tabs { display: flex; gap: 4px; background: var(--nm-input); border-radius: 4px; padding: 4px; margin-bottom: 16px; }
.nm-tab { flex: 1; min-height: 44px; border: 0; border-radius: 3px; font: 600 14px var(--nm-body); cursor: pointer; background: transparent; color: var(--nm-muted); }
.nm-tab[aria-selected="true"] { background: #2a2417; color: var(--nm-white); }
.nm-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.nm-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--nm-text-2); margin: 0; }
.nm-input, body.nm .form-control {
	min-height: 44px; padding: 0 14px; width: 100%;
	background: var(--nm-input) !important; border: 1px solid #3a3322 !important; border-radius: 4px !important;
	color: var(--nm-white) !important; font: 15px var(--nm-body); box-shadow: none !important;
}
body.nm textarea.form-control { padding: 10px 14px; min-height: 120px; }
.nm-input:focus, body.nm .form-control:focus { outline: none; border-color: var(--nm-gold) !important; box-shadow: 0 0 0 3px rgba(212,168,75,.2) !important; }
.nm-input::placeholder, body.nm .form-control::placeholder { color: #7d786e; }
.nm-form .nm-btn { width: 100%; min-height: 48px; font-size: 15px; }
.nm-form-foot { font-size: 13px; text-align: center; }
.nm-user { display: flex; flex-direction: column; gap: 12px; }
.nm-user ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nm-user li a { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--nm-line); border-radius: 4px; color: var(--nm-text) !important; font-size: 13px; }
.nm-user li a:hover { border-color: var(--nm-line-3); }
.nm-user li img { width: 18px; height: 18px; }

/* discord card */
.nm-discord { display: flex; align-items: center; gap: 14px; color: var(--nm-white) !important; }
.nm-discord span { display: block; }
.nm-discord .t { font-weight: 700; font-size: 16px; }
.nm-discord .s { font-size: 13px; color: var(--nm-muted); }

/* rankings widgets */
.nm-rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.nm-rank { border: 1px solid var(--nm-line-2); border-radius: var(--nm-radius); background: var(--nm-surface-2); overflow: hidden; display: flex; flex-direction: column; }
.nm-rank-head { padding: 18px 20px; border-bottom: 1px solid var(--nm-line-2); display: flex; justify-content: space-between; align-items: center; }
.nm-rank-head h3 { margin: 0; font-family: var(--nm-display); font-weight: 700; font-size: 17px; }
.nm-rank-head span { font-size: 12px; color: var(--nm-gold-text); text-transform: uppercase; letter-spacing: 1px; }
.nm-rank ol { list-style: none; margin: 0; padding: 0; flex: 1; }
.nm-rank li { display: flex; align-items: center; gap: 14px; padding: 11px 20px; border-bottom: 1px solid #1b1915; }
.nm-rank li:last-child { border-bottom: 0; }
.nm-pos { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: #1d1b17; color: var(--nm-text-2); }
.nm-rank li:first-child .nm-pos { background: var(--nm-gold); color: var(--nm-on-gold); }
.nm-rank-name { flex: 1; min-width: 0; }
.nm-rank-name b { display: block; font-weight: 600; font-size: 15px; color: var(--nm-white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-rank-name small { font-size: 12px; color: var(--nm-muted); }
.nm-rank-val { font-weight: 700; font-size: 15px; color: var(--nm-gold-text); }
.nm-rank-ico { width: 26px; height: 30px; object-fit: contain; }
.nm-rank-foot { padding: 14px 20px; border-top: 1px solid var(--nm-line-2); }
.nm-rank-foot a { font-size: 13px; font-weight: 600; }
.nm-rank-empty { padding: 20px; color: var(--nm-muted); font-size: 14px; }

/* races */
.nm-races { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.nm-race { border: 1px solid var(--nm-line-2); border-radius: var(--nm-radius); overflow: hidden; background: var(--nm-surface); }
.nm-race-art { height: 240px; background: #0d0c0a center/cover no-repeat; border-bottom: 1px solid var(--nm-line-2); }
.nm-race-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nm-race-body { padding: 24px; }
.nm-race-body h3 { margin: 0 0 8px; font-family: var(--nm-display); font-size: 22px; font-weight: 800; color: var(--nm-gold-text); }
.nm-race-body p { margin: 0; font-size: 14px; color: var(--nm-text-3); line-height: 1.6; }

/* ---- footer -------------------------------------------------------------- */
.nm-footer { border-top: 1px solid var(--nm-line-2); background: #050506; color: var(--nm-muted); font-size: 13px; }
.nm-footer-in { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; padding-top: 32px; padding-bottom: 32px; }
.nm-footer img { height: 72px; width: auto; display: block; }
.nm-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.nm-footer nav a { color: var(--nm-text-2) !important; }
.nm-footer nav a:hover { color: var(--nm-gold-text) !important; }
.nm-powered { font-size: 11px; opacity: .6; }
.nm-powered a { color: var(--nm-muted) !important; }

/* ---- login modal --------------------------------------------------------- */
.nm-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.75); }
.nm-modal.open { display: flex; }
.nm-modal-box { position: relative; width: 100%; max-width: 400px; }
.nm-modal-close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--nm-text-2); cursor: pointer; font-size: 22px; line-height: 1; }
.nm-modal-logo { display: block; margin: 0 auto 12px; height: 90px; width: auto; }

/* ---- inner pages (WebEngine modules, Bootstrap 3 markup) ---------------- */
.nm-page { padding-top: 48px; padding-bottom: 80px; }
.nm-page-grid { display: flex; flex-wrap: wrap; gap: 32px; }
.nm-page-main { flex: 999 1 600px; min-width: 0; }
.nm-page-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.nm-page-main > :first-child { margin-top: 0; }

body.nm .page-title { margin: 0 0 24px; padding: 0 0 14px; border-bottom: 1px solid var(--nm-line-2); background: none; }
body.nm .page-title span, body.nm .page-title { font-family: var(--nm-display); font-size: 28px; font-weight: 800; color: var(--nm-white); text-transform: none; }
body.nm .panel, body.nm .panel-default, body.nm .panel-sidebar, body.nm .panel-news, body.nm .panel-general {
	background: var(--nm-surface) !important; border: 1px solid var(--nm-line-2) !important; border-radius: var(--nm-radius) !important; box-shadow: none !important; color: var(--nm-text);
}
body.nm .panel-heading { background: var(--nm-surface-2) !important; border-bottom: 1px solid var(--nm-line-2) !important; color: var(--nm-white) !important; border-radius: var(--nm-radius) var(--nm-radius) 0 0 !important; padding: 14px 18px; }
body.nm .panel-title, body.nm .panel-title a { color: var(--nm-white) !important; font-family: var(--nm-display); font-weight: 700; font-size: 17px; }
body.nm .panel-body { color: var(--nm-text-2); }
body.nm .panel-footer { background: var(--nm-surface-2) !important; border-top: 1px solid var(--nm-line-2) !important; color: var(--nm-muted); }
body.nm .table, body.nm table { color: var(--nm-text-2); background: transparent !important; }
body.nm .table > thead > tr > th, body.nm .table > tbody > tr > th, body.nm .table th { color: var(--nm-gold-text) !important; border-color: var(--nm-line-2) !important; background: var(--nm-surface-2) !important; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; }
body.nm .table > tbody > tr > td, body.nm .table td { border-color: #1b1915 !important; background: transparent !important; vertical-align: middle !important; }
body.nm .table-striped > tbody > tr:nth-of-type(odd), body.nm .table-hover > tbody > tr:hover { background: rgba(255,255,255,.02) !important; }
body.nm .rankings-table tr:first-child td { color: var(--nm-gold-text); font-size: 13px; text-transform: uppercase; letter-spacing: .8px; background: var(--nm-surface-2) !important; }
body.nm .general-table-ui, body.nm .myaccount-table, body.nm .usercp-table, body.nm .rankings_menu, body.nm .castle-siege-banner, body.nm .profiles_player_card, body.nm .profiles_guild_card {
	background: var(--nm-surface) !important; border: 1px solid var(--nm-line-2) !important; border-radius: var(--nm-radius); color: var(--nm-text-2);
}
body.nm .rankings_menu a, body.nm .btn-default {
	background: transparent !important; color: var(--nm-text-2) !important; border: 1px solid var(--nm-line-3) !important; border-radius: 4px !important; text-shadow: none !important; box-shadow: none !important;
}
body.nm .rankings_menu a.active, body.nm .rankings_menu a:hover, body.nm .btn-default:hover { color: var(--nm-on-gold) !important; background: var(--nm-gold) !important; border-color: var(--nm-gold) !important; }
body.nm .btn-primary, body.nm .btn-success, body.nm .btn-info, body.nm button[type="submit"], body.nm input[type="submit"] {
	background: var(--nm-gold) !important; border: 1px solid var(--nm-gold) !important; color: var(--nm-on-gold) !important; font-weight: 700; border-radius: 4px !important; text-shadow: none !important; box-shadow: none !important; background-image: none !important;
}
body.nm .btn-primary:hover, body.nm .btn-success:hover, body.nm button[type="submit"]:hover { background: var(--nm-gold-hover) !important; border-color: var(--nm-gold-hover) !important; }
body.nm .btn-danger { background: #8e2b22 !important; border-color: #8e2b22 !important; color: #fff !important; }
body.nm .btn { min-height: 38px; }
body.nm .btn-xs { min-height: 0; }
body.nm .control-label, body.nm label { color: var(--nm-text-2); font-weight: 500; }
body.nm .help-block { color: var(--nm-muted); }
body.nm .alert { border-radius: var(--nm-radius); border: 1px solid; background-image: none !important; text-shadow: none; }
body.nm .alert-success { background: rgba(127,209,90,.08) !important; border-color: rgba(127,209,90,.35) !important; color: #c9ecb6 !important; }
body.nm .alert-danger, body.nm .alert-error { background: rgba(192,80,60,.1) !important; border-color: rgba(192,80,60,.45) !important; color: #f2c0b6 !important; }
body.nm .alert-info, body.nm .alert-warning { background: rgba(212,168,75,.08) !important; border-color: var(--nm-line-3) !important; color: #efdcae !important; }
body.nm .pagination > li > a, body.nm .pagination > li > span { background: var(--nm-surface) !important; border-color: var(--nm-line-2) !important; color: var(--nm-text-2) !important; }
body.nm .pagination > .active > a, body.nm .pagination > .active > span { background: var(--nm-gold) !important; border-color: var(--nm-gold) !important; color: var(--nm-on-gold) !important; }
body.nm hr { border-color: var(--nm-line-2); }
body.nm .well { background: var(--nm-surface); border-color: var(--nm-line-2); color: var(--nm-text-2); box-shadow: none; }
body.nm .text-muted { color: var(--nm-muted) !important; }
body.nm .news-title, body.nm .news-title a { color: var(--nm-white) !important; }
body.nm .modal-content { background: var(--nm-surface-2); border: 1px solid var(--nm-line-3); color: var(--nm-text); }
body.nm .tooltip-inner { background: #1d1b17; color: var(--nm-text); }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
	.nm-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
	.nm-nav, .nm-actions { display: none; flex-basis: 100%; }
	.nm-header.open .nm-nav, .nm-header.open .nm-actions { display: flex; }
	.nm-nav ul { flex-direction: column; gap: 0; width: 100%; }
	.nm-nav a { padding: 12px 0; border-bottom: 1px solid var(--nm-line); }
	.nm-actions { padding-bottom: 12px; }
	.nm-logo img { height: 52px; }
	.nm-hero-in { padding-top: 64px; padding-bottom: 96px; }
	.nm-hero::before { background: linear-gradient(180deg, rgba(7,7,8,.7) 0%, rgba(7,7,8,.92) 60%, var(--nm-bg) 100%); }
	.nm-section { padding-top: 56px; padding-bottom: 56px; }
	.nm-stat { border-right: 0; border-bottom: 1px solid #1f1c15; }
}
@media (max-width: 480px) {
	.nm-container { padding-left: 16px; padding-right: 16px; }
	.nm-hero-cta .nm-btn { width: 100%; }
	.nm-user ul { grid-template-columns: minmax(0, 1fr); }
	.nm-races, .nm-rank-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
