/* NaN2 2026 theme - dark oriental fantasy.
   Loaded after bootstrap + the old style.css, so it overrides every existing page. */

:root {
	--ink: #0e0b09;
	--stone: #16110d;
	--panel: #1d1712;
	--panel-hi: #251d16;
	--bronze: #5f4222;
	--bronze-soft: rgba(214, 170, 90, .18);
	--gold: #d6aa5a;
	--gold-hi: #f7d991;
	--red: #bc493c;
	--red-hi: #d35243;
	--text: #e8dcc4;
	--muted: #a8977a;
	--radius: 6px;
	--display: 'Cinzel', 'Times New Roman', serif;
	--body: 'Open Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--ink);
	color: var(--text);
	font-family: var(--body);
	font-size: 16px;
	line-height: 1.6;
}
body::before { /* page texture on one fixed layer, strongly darkened */
	content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background: linear-gradient(180deg, rgba(14,11,9,.9), rgba(14,11,9,.97)), url('backgrounds/background_page.jpg') center top / cover no-repeat;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4, h5 { font-family: var(--display); color: var(--gold-hi); letter-spacing: .02em; }
p { max-width: 72ch; }

/* ---------- navigation ---------- */
.n2-nav {
	position: sticky; top: 0; z-index: 50;
	background: rgba(14, 11, 9, .9);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--bronze);
}
.n2-nav-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 68px; display: flex; align-items: center; gap: 28px; }
.n2-brand img { height: 38px; display: block; }
.n2-links { display: flex; align-items: center; gap: 4px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.n2-links a { display: block; white-space: nowrap; padding: 8px 12px; color: var(--text); font-family: var(--display); font-size: 15px; font-weight: 600; border-radius: var(--radius); }
.n2-links a:hover { color: var(--gold-hi); background: var(--bronze-soft); }
.n2-links a.active { color: var(--gold-hi); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.n2-lang { position: relative; }
.n2-lang select { background: transparent; color: var(--muted); border: 1px solid var(--bronze); border-radius: var(--radius); padding: 6px 8px; font-size: 14px; }
.n2-lang select option { background: var(--stone); color: var(--text); }
.n2-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--bronze); color: var(--gold); border-radius: var(--radius); padding: 6px 12px; font-size: 18px; }

.n2-btn {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 12px 26px; border-radius: var(--radius);
	font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .03em;
	border: 1px solid transparent; cursor: pointer;
	transition: background-color .2s, box-shadow .2s, color .2s;
}
.n2-btn-red { background: var(--red); color: #fff !important; border-color: #e0786b33; }
.n2-btn-red:hover { background: var(--red-hi); box-shadow: 0 0 24px rgba(188, 73, 60, .45); }
.n2-btn-gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a1c0c !important; }
.n2-btn-gold:hover { box-shadow: 0 0 26px rgba(247, 217, 145, .45); }
.n2-btn-ghost { background: rgba(14,11,9,.55); color: var(--gold-hi) !important; border-color: var(--gold); }
.n2-btn-ghost:hover { background: var(--bronze-soft); }
.n2-links .n2-btn { padding: 8px 18px; font-size: 14px; }

@media (max-width: 1199px) {
	.n2-toggle { display: block; }
	.n2-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--ink); border-bottom: 1px solid var(--bronze); padding: 10px 20px 18px; }
	.n2-nav.open .n2-links { display: flex; }
	.n2-links a { padding: 12px 8px; }
}

.n2-announce { background: var(--red); color: #fff; text-align: center; font-size: 14px; padding: 8px 16px; }

/* ---------- hero ---------- */
.n2-hero {
	position: relative; overflow: hidden;
	min-height: min(88vh, 820px);
	display: flex; align-items: center;
	perspective: 1200px;
	isolation: isolate;
}
.n2-hero-bg {
	position: absolute; inset: -4%; z-index: -2;
	background: url('backgrounds/hero_clean_2560x793.jpg') 62% center / cover no-repeat;
	transform: translate3d(var(--px, 0), var(--py, 0), 0) scale(1.06);
	transition: transform .25s ease-out;
}
.n2-hero::after { /* dark left side for legibility + fade into the page */
	content: ''; position: absolute; inset: 0; z-index: -1;
	background:
		linear-gradient(90deg, rgba(14,11,9,.96) 0%, rgba(14,11,9,.82) 34%, rgba(14,11,9,.15) 62%, rgba(14,11,9,0) 100%),
		linear-gradient(0deg, var(--ink) 0%, rgba(14,11,9,0) 30%);
}
#n2-embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; } /* above the hero text so sparks drift over the logo */
.n2-hero-inner { position: relative; z-index: 1; max-width: 1240px; width: 100%; margin: 0 auto; padding: 60px 20px; }
.n2-hero-copy { max-width: 560px; transform: translate3d(calc(var(--px, 0) * -0.6), calc(var(--py, 0) * -0.6), 0); transition: transform .25s ease-out; }
.n2-hero-logo { width: min(460px, 86vw); height: auto; display: block; filter: drop-shadow(0 8px 30px rgba(0,0,0,.6)); }
.n2-hero-slogan { font-family: var(--display); font-size: clamp(20px, 2.4vw, 28px); color: var(--text); margin: 14px 0 6px; }
.n2-hero-sub { color: var(--muted); margin: 0 0 30px; }
.n2-hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.n2-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; color: var(--muted); font-size: 14px; }
.n2-status i { width: 9px; height: 9px; border-radius: 50%; background: #58c26b; box-shadow: 0 0 10px #58c26b; }
.n2-status.off i { background: var(--red); box-shadow: 0 0 10px var(--red); }

/* ---------- sections ---------- */
.n2-section { max-width: 1240px; margin: 0 auto; padding: 80px 20px; }
.n2-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 30px; border-bottom: 1px solid var(--bronze); padding-bottom: 14px; }
.n2-section-head h2 { font-size: clamp(26px, 3vw, 36px); margin: 0; }
.n2-section-head a { font-size: 15px; }

/* ornamented stone panel (corner marks, used only on primary panels) */
.n2-panel {
	position: relative;
	background: linear-gradient(180deg, var(--panel-hi), var(--panel));
	border: 1px solid var(--bronze);
	border-radius: var(--radius);
	padding: 28px;
}
.n2-panel::before, .n2-panel::after {
	content: ''; position: absolute; width: 14px; height: 14px; border-color: var(--gold); border-style: solid;
}
.n2-panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.n2-panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ---------- metin stone + stats ---------- */
.n2-metin { display: grid; grid-template-columns: minmax(280px, 1fr) 1.1fr; gap: 40px; align-items: center; }
.n2-metin-stage { position: relative; aspect-ratio: 1; max-width: 480px; width: 100%; margin: 0 auto; }
.n2-metin-stage { perspective: 900px; --glow: .85; }
.n2-metin-glow { position: absolute; inset: 12% 18% 8%; border-radius: 50%; background: radial-gradient(closest-side, rgba(70,230,190,.38), rgba(40,150,140,.12) 60%, transparent); filter: blur(18px); opacity: var(--glow); }
.n2-metin-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; z-index: 1; }
.n2-metin-wisps { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.n2-metin-rock { position: absolute; left: 50%; top: 50%; height: 86%; width: auto; margin: 0; translate: -50% -50%; transform-style: preserve-3d; filter: drop-shadow(0 0 22px rgba(70,230,190,.35)) drop-shadow(0 24px 22px rgba(0,0,0,.55)); z-index: 1; }
.n2-metin-stage::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: 6%; height: 10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(70,230,190,.25), transparent); z-index: 0; }
.n2-metin-copy h2 { font-size: clamp(28px, 3.4vw, 42px); margin: 0 0 10px; }
.n2-metin-copy > p { color: var(--muted); margin-bottom: 26px; }
.n2-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--bronze); border: 1px solid var(--bronze); border-radius: var(--radius); overflow: hidden; }
.n2-stat { background: var(--panel); padding: 18px 20px; }
.n2-stat b { display: block; font-family: var(--display); font-size: 30px; color: var(--gold-hi); line-height: 1.1; }
.n2-stat span { color: var(--muted); font-size: 14px; }
.n2-stat-live b { color: #7fd48d; }
@media (max-width: 860px) { .n2-metin { grid-template-columns: 1fr; } .n2-metin-stage { max-width: 320px; } }

/* ---------- news ---------- */
.n2-news { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.n2-news-list { display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 991px) { .n2-news { grid-template-columns: 1fr; } }

.news-slider-panel {
	background: var(--panel) !important; border: 1px solid var(--bronze) !important; border-radius: var(--radius) !important;
	box-shadow: none !important; padding: 24px 26px !important; color: var(--text) !important; width: auto !important; height: auto !important; margin: 0 !important;
	text-align: left; position: relative; overflow: visible !important;
}
.news-slider-panel:first-child { border-color: var(--gold) !important; }
.news-slider-panel .news-title { font-family: var(--display); color: var(--gold-hi) !important; font-size: 22px !important; margin: 0 0 4px !important; text-transform: none !important; }
.news-slider-panel .news-author { color: var(--muted) !important; font-family: var(--body); font-size: 13px !important; margin-bottom: 14px !important; }
.news-slider-panel img { max-width: 100%; height: auto; border-radius: var(--radius); }
.news-button { position: static !important; display: inline-block; width: auto !important; height: auto !important; margin-top: 16px; color: var(--gold) !important; font-weight: 700; background: none !important; padding: 0 !important; transform: none !important; }
.news-button:hover { color: var(--gold-hi) !important; }
.news-slider, .news-slider-container { all: unset; display: contents; }
.news-slider-text { display: none; }

/* ---------- ranking (home) ---------- */
.n2-rank-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.n2-rank-tabs button { flex: 1; background: transparent; color: var(--muted); border: 1px solid var(--bronze); border-radius: var(--radius); padding: 8px; font-family: var(--display); font-weight: 700; }
.n2-rank-tabs button[aria-selected="true"] { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.n2-rank-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.n2-rank-table td, .n2-rank-table th { padding: 9px 6px; border-bottom: 1px solid rgba(95,66,34,.55); text-align: left; }
.n2-rank-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.n2-rank-table td:first-child { color: var(--gold); font-family: var(--display); font-weight: 700; width: 34px; }
.n2-rank-table tr:nth-child(-n+3) td:first-child { color: var(--gold-hi); }
.n2-flag { width: 22px; height: auto; vertical-align: middle; }

/* ---------- classes (3D tilt cards) ---------- */
.n2-classes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 991px) { .n2-classes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .n2-classes { grid-template-columns: repeat(2, 1fr); } }
.n2-class {
	position: relative; aspect-ratio: 3 / 4.4; border: 1px solid var(--bronze); border-radius: var(--radius);
	background: radial-gradient(120% 80% at 50% 100%, rgba(188,73,60,.35), transparent 60%), var(--panel);
	transform-style: preserve-3d; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transition: transform .15s ease-out, border-color .2s;
	overflow: hidden;
}
.n2-class:hover { border-color: var(--gold); }
.n2-class img { position: absolute; left: 50%; bottom: 44px; height: 78%; width: auto; transform: translateX(-50%) translateZ(40px); filter: drop-shadow(0 12px 18px rgba(0,0,0,.6)); }
.n2-class h3 { position: absolute; left: 0; right: 0; bottom: 12px; margin: 0; text-align: center; font-size: 19px; transform: translateZ(30px); }

/* ---------- discord / register band ---------- */
.n2-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.n2-band h2 { margin: 0 0 6px; font-size: clamp(24px, 2.6vw, 32px); }
.n2-band p { margin: 0; color: var(--muted); }

/* ---------- footer ---------- */
.n2-footer { border-top: 1px solid var(--bronze); background: rgba(14,11,9,.92); margin-top: 40px; }
.n2-footer-inner { max-width: 1240px; margin: 0 auto; padding: 40px 20px; display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; }
.n2-footer img { height: 44px; }
.n2-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: flex-end; }
.n2-footer nav a { color: var(--text); font-size: 15px; }
.n2-footer small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; border-top: 1px solid rgba(95,66,34,.5); padding-top: 18px; }
@media (max-width: 700px) { .n2-footer-inner { grid-template-columns: 1fr; } .n2-footer nav { justify-content: flex-start; } }

/* ============================================================
   Existing pages (login, register, ranking, account, coins, admin)
   ============================================================ */
.page { padding: 60px 0 40px; background: none !important; }
.page .container { max-width: 1140px; }
.page-title { font-family: var(--display) !important; color: var(--gold-hi) !important; font-size: clamp(30px, 4vw, 44px) !important; text-transform: none !important; text-align: left !important; margin-bottom: 4px !important; }
.page-subtitle { color: var(--muted) !important; text-align: left !important; font-family: var(--body); font-size: 16px; font-weight: 400; margin-bottom: 26px; }
.panel, .panel-login, .panel-box, .panel-ranking {
	background: linear-gradient(180deg, var(--panel-hi), var(--panel)) !important;
	border: 1px solid var(--bronze) !important; border-radius: var(--radius) !important;
	box-shadow: none !important; color: var(--text) !important;
}
.panel-login { padding: 28px !important; }
.panel-login .row > div { margin-left: 0 !important; width: 100% !important; max-width: 420px; }
.panel-login-submit, .panel-button, .panel-button-green, .btn-primary {
	background: var(--red) !important; border: none !important; border-radius: var(--radius) !important;
	color: #fff !important; font-family: var(--display); font-weight: 700; width: auto;
}
.panel-login-submit:hover, .panel-button:hover, .btn-primary:hover { background: var(--red-hi) !important; }
.panel-button-active { background: var(--gold) !important; color: var(--ink) !important; }

.form-control, .form-select, input[type=text], input[type=password], input[type=email], textarea, select.form-control {
	background: var(--ink) !important; color: var(--text) !important;
	border: 1px solid var(--bronze) !important; border-radius: var(--radius) !important;
	padding: 11px 14px !important; margin-bottom: 12px;
}
.form-control::placeholder { color: #7d6f59 !important; }
.form-control:focus { border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(214,170,90,.2) !important; }
.panel-login img { border-radius: var(--radius); border: 1px solid var(--bronze); margin-bottom: 12px; max-width: 100%; }

.table, .section-ranking-table, .panel-ranking-table, .section-ranking-panel-table { color: var(--text) !important; background: transparent !important; --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-hover-bg: rgba(214,170,90,.07); --bs-table-hover-color: var(--gold-hi); --bs-table-striped-bg: rgba(255,255,255,.02); }
.table th, .table td, .panel-ranking-table th, .panel-ranking-table td { border-color: rgba(95,66,34,.55) !important; color: inherit; }
.table thead th, .thead-inverse th { color: var(--muted) !important; background: transparent !important; font-weight: 600; }

.alert { border-radius: var(--radius) !important; border: 1px solid; }
.alert-info { background: rgba(214,170,90,.08) !important; border-color: var(--bronze) !important; color: var(--text) !important; }
.alert-success { background: rgba(88,194,107,.1) !important; border-color: #3e7b48 !important; color: #b9e8c1 !important; }
.alert-danger { background: rgba(188,73,60,.12) !important; border-color: var(--red) !important; color: #f2c3bc !important; }
.alert-warning { background: rgba(247,217,145,.1) !important; border-color: var(--gold) !important; color: var(--gold-hi) !important; }
.alert .close { color: inherit; opacity: .7; background: none; border: 0; float: right; }

.list-group-item { background: var(--panel) !important; color: var(--text) !important; border-color: var(--bronze) !important; }
.list-group-item:hover { color: var(--gold-hi) !important; background: var(--panel-hi) !important; }
.dropdown-menu { background: var(--stone); border: 1px solid var(--bronze); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: var(--bronze-soft); color: var(--gold-hi); }
.pagination .page-link { background: var(--panel); border-color: var(--bronze); color: var(--gold); }
.pagination .active .page-link, .pagination .page-link:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }

.download-button { background: var(--red) !important; border-radius: var(--radius) !important; font-family: var(--display) !important; max-width: 520px; }
.download-button:hover { background: var(--red-hi) !important; }
.download-requirements { color: var(--text); background: #000; border: 1px solid #3a2a1a; margin-top: 30px; }
.download-requirements td { padding: 4px 18px 4px 0; }

/* old decorative blocks not used by the new theme */
.topbar, #invite-panel, .page-hd, .header, .section-stats, .section-register, .footer { display: none !important; }

/* Dragon Coins page on the dark theme */
.md-card { background: linear-gradient(180deg, var(--panel-hi), var(--ink)) !important; border-color: var(--bronze) !important; color: var(--text); }
.md-card:hover { border-color: var(--gold) !important; box-shadow: 0 0 28px rgba(214,170,90,.18) !important; }
.md-card .md-coins { color: var(--gold-hi) !important; font-family: var(--display) !important; }
.md-card .md-price { color: var(--text) !important; }
.md-card .md-unit { color: var(--muted) !important; }
.md-balance { background: var(--ink) !important; border-color: var(--bronze) !important; }
.md-balance b { color: var(--gold-hi) !important; }
.md-history th, .md-history td { border-color: rgba(95,66,34,.55) !important; }

@media (prefers-reduced-motion: reduce) {
	.n2-hero-bg, .n2-hero-copy, .n2-class { transition: none; transform: none !important; }
}

/* bootstrap tables: striped / active rows keep the light text */
.table { --bs-table-striped-color: var(--text); --bs-table-active-color: var(--text); --bs-table-hover-color: var(--gold-hi); }
.table > :not(caption) > * > * { color: var(--text); background-color: transparent; }
.panel-bar { background: transparent !important; border-color: var(--bronze) !important; color: var(--text) !important; }

/* login / register form: left aligned like the rest of the page */
.panel-login center { text-align: left; }
.panel-login-submit { padding: 12px 30px !important; margin-top: 6px; }
.md-card { padding-top: 38px !important; }

/* small screens: the character sits behind the text, so darken the whole hero */
@media (max-width: 700px) {
	.n2-hero::after { background: linear-gradient(180deg, rgba(14,11,9,.55) 0%, rgba(14,11,9,.82) 45%, var(--ink) 100%); }
	.n2-hero-bg { background-position: 70% center; }
}

/* news: full article inside a scrollable box (no "read more") */
.news-slider-panel .news-content {
	max-height: 240px;
	overflow-y: auto;
	padding-right: 10px;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--gold) rgba(95, 66, 34, .35);
}
.news-slider-panel .news-content::-webkit-scrollbar { width: 6px; }
.news-slider-panel .news-content::-webkit-scrollbar-track { background: rgba(95, 66, 34, .35); border-radius: 3px; }
.news-slider-panel .news-content::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
.news-slider-panel .news-content p:last-child { margin-bottom: 0; }
.news-slider-panel .news-button { display: none !important; }
.news-slider-panel .news-content { display: flow-root; }
.news-slider-panel .news-content > :first-child { margin-top: 0; }
.news-slider-panel .news-content > :last-child { margin-bottom: 0; }

/* class cards: description panel on hover / keyboard focus */
.n2-class:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.n2-class-info { position: absolute; inset: 0 0 46px; padding: 18px 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
	background: linear-gradient(180deg, rgba(14,11,9,.25) 0%, rgba(14,11,9,.92) 45%, rgba(14,11,9,.97) 100%); color: var(--text); font-size: 14px; line-height: 1.5;
	opacity: 0; transform: translateY(12px) translateZ(50px); transition: opacity .2s ease-out, transform .2s ease-out; pointer-events: none; }
.n2-class-info p { margin: 0; }
.n2-class-info ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.n2-class-info b { color: var(--gold); font-weight: 600; }
.n2-class:hover .n2-class-info, .n2-class:focus .n2-class-info, .n2-class:focus-within .n2-class-info { opacity: 1; transform: translateY(0) translateZ(50px); }
@media (max-width: 575px) { .n2-class-info { font-size: 12px; line-height: 1.45; padding: 10px; bottom: 40px; } .n2-class-info ul { display: none; } }
@media (prefers-reduced-motion: reduce) { .n2-class-info { transition: none; transform: none; } }

/* metin stone: HP bar + damage numbers */
.n2-metin-hp { position: absolute; left: 30%; right: 30%; top: 4%; height: 7px; border: 1px solid rgba(214,170,90,.6); border-radius: 4px; background: rgba(0,0,0,.55); z-index: 3; overflow: hidden; }
.n2-metin-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #b3261e, #e0503a); transition: width .15s ease-out; }
.n2-metin-dmg { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.n2-dmg { position: absolute; font-family: 'Cinzel', serif; font-weight: 800; font-size: 20px; color: #fff4d6; text-shadow: 0 0 3px #000, 0 2px 4px #000; animation: n2-dmg-up 1.1s ease-out forwards; }
.n2-dmg.crit { color: #ff5a3c; font-size: 27px; }
@keyframes n2-dmg-up { 0% { opacity: 0; transform: translateY(8px) scale(.7); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-46px) scale(1); } }
