@font-face {
  font-family: NotoColorEmojiLimited;
  unicode-range: U+1F1E6-1F1FF;
  src: url(https://raw.githack.com/googlefonts/noto-emoji/main/fonts/NotoColorEmoji.ttf);
}

:root {
	/* Light theme (default) */
	--bg: #ffffff;
	--panel: #f8f9fa;
	--card: #ffffff;
	--border: #e9ecef;
	--text: #212529;
	--muted: #6c757d;
	--accent: #ffc857;
	--accent-2: #ffb400;
	--success: #28a745;
	--danger: #dc3545;
	--shadow: 0 6px 20px rgba(0, 0, 0, .1);
	--radius: 16px;
	--radius-sm: 12px;
	--container: 1200px;
}

[data-theme="dark"] {
	/* Dark theme */
	--bg: #0c0c0c;
	--panel: #111111;
	--card: #1a1a1a;
	--border: #262626;
	--text: #f3f3f3;
	--muted: #b6b6b6;
	--accent: #ffc857;
	--accent-2: #ffb400;
	--success: #49d17d;
	--danger: #ff6b6b;
	--shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

* {
	box-sizing: border-box
}

html,
body {
	height: 100%
}

body {
	margin: 0;
	font-family: 'NotoColorEmojiLimited', Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
	color: var(--text);
	background: var(--bg);
	line-height: 1.55;
	transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark theme background gradient for servers section only */
[data-theme="dark"] #servers {
	background:
		radial-gradient(1200px 900px at 10% -10%, #1a1a1a 0%, transparent 60%),
		radial-gradient(1000px 700px at 110% 10%, #111111 0%, transparent 55%),
		var(--bg);
}

/* Dark theme background gradient for grid-section (Rules & Community) */
[data-theme="dark"] .grid-section {
	background:
		radial-gradient(1200px 900px at 10% 110%, #1a1a1a 0%, transparent 60%),
		radial-gradient(1000px 700px at 110% 90%, #111111 0%, transparent 55%),
		var(--bg);
}

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

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, .9);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
	background: rgba(12, 12, 12, .7);
}

.nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 72px
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--text)
}

.brand-logo {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--panel), var(--border));
	border: 1px solid var(--border);
	display: grid;
	place-items: center
}

[data-theme="dark"] .brand-logo {
	background: linear-gradient(135deg, #303030, #0f0f0f);
}

.brand-logo svg {
	width: 22px;
	height: 22px;
	fill: var(--accent)
}

.brand-title {
	font-family: Montserrat, Inter, sans-serif;
	font-weight: 800;
	letter-spacing: .5px
}

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

.nav-links a {
	color: var(--muted);
	text-decoration: none;
	font-weight: 500;
	transition: color .2s ease
}

.nav-links a:hover {
	color: var(--text)
}

.nav-cta {
	display: flex;
	align-items: center;
	gap: 12px
}

/* Theme and Language switches */
.theme,
.lang {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 4px;
	display: flex;
	gap: 2px
}

.theme button,
.lang button {
	background: none;
	border: none;
	padding: 6px 10px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	color: var(--muted);
	transition: all .15s ease;
	min-width: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.theme button[aria-pressed="true"],
.lang button[aria-pressed="true"] {
	background: var(--accent);
	color: #121212;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .12)
}

.theme button:hover,
.lang button:hover {
	color: var(--text)
}

.burger {
	display: none;
	background: none;
	border: 1px solid var(--border);
	color: var(--text);
	font-size: 18px;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	cursor: pointer;
	transition: background .2s ease
}

.burger:hover {
	background: var(--panel)
}

.mobile-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--card);
	border-bottom: 1px solid var(--border);
	padding: 20px 24px;
	flex-direction: column;
	gap: 16px;
	box-shadow: var(--shadow);
	backdrop-filter: saturate(180%) blur(10px);
	z-index: 40;
	transform: translateY(-10px);
	opacity: 0;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu.open {
	display: flex;
	transform: translateY(0);
	opacity: 1;
}

.mobile-menu a {
	color: var(--text);
	text-decoration: none;
	font-weight: 500;
	padding: 12px 0;
	border-bottom: 1px solid var(--border);
	transition: color 0.2s ease;
	border-radius: 8px;
	margin: 0 -8px;
	padding-left: 8px;
	padding-right: 8px;
}

.mobile-menu a:hover {
	color: var(--accent);
	background: var(--panel);
}

.mobile-menu a:last-child {
	border-bottom: none
}

/* Desktop navigation */
@media (min-width: 1400px) {
	.nav-links {
		gap: 28px
	}
	
	.nav-cta {
		gap: 18px
	}
	
	.brand-title {
		font-size: 16px
	}
}

@media (min-width: 1200px) and (max-width: 1399px) {
	.nav-links {
		gap: 24px
	}
	
	.nav-cta {
		gap: 16px
	}
}

/* Tablet navigation */
@media (max-width: 1199px) and (min-width: 901px) {
	.nav-links {
		gap: 16px
	}
	
	.nav-links a {
		font-size: 14px
	}
	
	.brand-title {
		font-size: 14px
	}
}

/* Small tablet navigation */
@media (max-width: 1024px) and (min-width: 769px) {
	.nav-links {
		gap: 14px
	}
	
	.theme,
	.lang {
		scale: 0.95
	}
	
	.container {
		padding: 0 20px
	}
}

/* Large mobile navigation */
@media (max-width: 768px) {
	.nav-links {
		display: none
	}

	.burger {
		display: inline-grid;
		place-items: center
	}

	.theme,
	.lang {
		scale: 0.9
	}
	
	.nav-cta {
		gap: 8px
	}
	
	.brand-title {
		font-size: 13px
	}
	
	.container {
		padding: 0 16px
	}
}

/* Small mobile navigation */
@media (max-width: 480px) {
	.nav {
		height: 60px
	}
	
	.brand {
		gap: 8px
	}
	
	.brand-logo {
		width: 32px;
		height: 32px
	}
	
	.brand-logo svg {
		width: 18px;
		height: 18px
	}
	
	.brand-title {
		font-size: 12px;
		display: none /* Hide on very small screens */
	}
	
	.theme,
	.lang {
		scale: 0.85;
		padding: 3px
	}
	
	.theme button,
	.lang button {
		padding: 4px 6px;
		font-size: 11px;
		min-width: 28px
	}
	
	.burger {
		width: 36px;
		height: 36px;
		font-size: 16px
	}
	
	.nav-cta {
		gap: 6px
	}
	
	.container {
		padding: 0 12px
	}
	
	.mobile-menu {
		padding: 16px 12px
	}
}

/* Extra small screens */
@media (max-width: 360px) {
	.brand-title {
		display: none
	}
	
	.theme,
	.lang {
		scale: 0.8
	}
	
	.burger {
		width: 32px;
		height: 32px;
		font-size: 14px
	}
	
	.container {
		padding: 0 8px
	}
}

.support-buttons .btn {
  font-size: 13px;
  line-height: 1;
}

/* Hero */
.hero {
	padding: 80px 0;
	position: relative;
	overflow: hidden;
	background: 
		linear-gradient(rgba(255, 255, 255, .92), rgba(255, 255, 255, .85)),
		url('assets/hero.webp') center/cover;
}

[data-theme="dark"] .hero {
	background: 
		linear-gradient(rgba(12, 12, 12, .88), rgba(12, 12, 12, .82)),
		url('assets/hero.webp') center/cover;
}

.hero-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-height: 600px;
	justify-content: center;
}

.hero-text {
	z-index: 2;
	max-width: 800px;
}

.hero-visual {
	position: relative;
	z-index: 1;
}

.hero-visual img {
	width: 100%;
	height: auto;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

@media (max-width: 900px) {
	.hero-content {
		min-height: auto;
		padding: 20px 0;
	}
	
	.hero-text {
		max-width: 100%;
	}
	
	.hero-logo-svg {
		height: 60px;
		width: 150px;
	}
}

.hero-logo-container {
	display: flex;
	justify-content: center;
	margin-bottom: 24px;
	position: relative;
}

.hero-logo-svg {
	display: block;
	height: 120px;
	width: 200px;
	margin: 0 auto;
	background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
	-webkit-mask: url('./assets/header_logo.svg') no-repeat center center;
	mask: url('./assets/header_logo.svg') no-repeat center center;
	-webkit-mask-size: contain;
	mask-size: contain;
	transition: all 0.3s ease;
}

.hero-logo-svg:hover {
	transform: scale(1.05);
	background: linear-gradient(135deg, var(--accent) 0%, var(--text) 100%);
}

/* Remove old img styles */
.hero-logo {
	display: none;
}

.hero h1 {
	font-family: Montserrat, Inter, sans-serif;
	font-size: clamp(2.5rem, 5vw, 4rem);
	font-weight: 800;
	margin: 0 0 20px;
	line-height: 1.1;
	background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent
}

.hero p {
	font-size: 1.25rem;
	color: var(--muted);
	margin: 0 0 40px;
	max-width: 520px;
	margin-left: auto;
	margin-right: auto
}

.hero-cta {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 40px;
	justify-content: center;
}

.platforms {
	display: flex;
	gap: 20px;
	opacity: .6;
	margin-top: 40px;
	justify-content: center;
}

@media (max-width: 900px) {
	.platforms {
		flex-wrap: wrap;
	}
}

.platforms a {
	transition: opacity .2s ease, transform .2s ease;
	color: var(--muted);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	border-radius: 8px;
	background: var(--panel);
	border: 1px solid var(--border);
}

.platforms a:hover {
	opacity: 1;
	transform: translateY(-2px);
	color: var(--accent);
	border-color: var(--accent);
}

.platforms a svg {
	transition: fill .2s ease;
}

/* Buttons */
.btn {
	--pad-x: 18px;
	--pad-y: 12px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: var(--pad-y) var(--pad-x);
	border-radius: 12px;
	text-decoration: none;
	border: 1px solid transparent;
	font-weight: 700;
	letter-spacing: .2px;
	cursor: pointer;
	transition: transform .08s ease, background .2s ease, border-color .2s ease, color .2s ease
}

.btn:active {
	transform: translateY(1px)
}

.btn-primary {
	background: var(--accent);
	color: #121212
}

.btn-primary:hover {
	background: var(--accent-2)
}

.btn-ghost {
	background: transparent;
	color: var(--text);
	border-color: var(--border)
}

.btn-ghost:hover {
	background: var(--panel);
	border-color: var(--accent)
}

[data-theme="dark"] .btn-ghost:hover {
	background: #161616;
	border-color: #343434;
}

.btn-sm {
	--pad-y: 10px;
	--pad-x: 14px;
	font-weight: 600;
	border-radius: 10px
}

/* Sections */
section {
	padding: 80px 0
}

/* SEO Content - Hidden from users but visible to search engines */
.seo-content {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
	padding: 0;
}

/* Alternative approach - make it very small and transparent */
@media screen {
	.seo-content {
		position: static;
		width: auto;
		height: auto;
		clip: auto;
		clip-path: none;
		white-space: normal;
		/* Make it nearly invisible */
		font-size: 1px;
		line-height: 1px;
		color: transparent;
		background: transparent;
		opacity: 0.01;
		pointer-events: none;
		user-select: none;
		max-height: 1px;
		overflow: hidden;
	}
}

.section-title {
	font-family: Montserrat, Inter, sans-serif;
	font-size: 2.5rem;
	font-weight: 800;
	text-align: center;
	margin: 0 0 60px;
	background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent
}

.section-description {
	font-size: 1rem;
	color: var(--muted);
	text-align: center;
	margin: -40px auto 40px;
	max-width: 600px;
	line-height: 1.5
}

/* Servers */
.server-list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	align-items: stretch;
	min-height: 200px;
}

.server-loading {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px;
	color: var(--muted);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.server-loading::before {
	content: "";
	width: 20px;
	height: 20px;
	border: 2px solid var(--border);
	border-top: 2px solid var(--accent);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.server-error {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px;
	color: var(--text);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

.retry-button {
	background: var(--accent);
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: var(--radius);
	cursor: pointer;
	font-weight: 600;
	transition: all 0.2s ease;
}

.retry-button:hover {
	background: var(--accent-hover);
	transform: translateY(-1px);
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.server-card {
	display: flex;
	flex-direction: column;
	gap: 18px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px;
	box-shadow: var(--shadow);
	height: 100%;
}

.server-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.server-flag {
	width: 52px;
	height: 52px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: linear-gradient(180deg, var(--accent), var(--accent-2));
	border: 1px solid var(--accent);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1)
}

[data-theme="dark"] .server-flag {
	background: linear-gradient(180deg, #1f2b5b, #14234e);
	border: 1px solid #2b3b7c;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .03);
}

.server-flag svg {
	width: 28px;
	height: 28px;
	fill: #ffffff;
	opacity: .9
}

[data-theme="dark"] .server-flag svg {
	fill: #ffd23f;
	opacity: .95;
}

.server-map {
	width: 100%;
	height: 140px;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	background: var(--panel);
	margin-bottom: 12px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	flex-shrink: 0;
}

.server-map:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.server-map:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.server-map:active {
	transform: translateY(0);
}

.server-map img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-user-drag: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.server-name {
	font-weight: 700;
	font-size: 15px;
	margin-bottom: 8px
}

.server-meta {
	color: var(--muted);
	font-size: 14px;
	display: flex;
	gap: 16px;
	flex-wrap: wrap
}

.status {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	font-weight: 600
}

.dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--success);
	box-shadow: 0 0 10px var(--success)
}

.status.offline .dot {
	background: var(--danger);
	box-shadow: 0 0 10px var(--danger)
}

.server-cta .btn {
	white-space: nowrap
}

.server-ip {
	font-family: 'Courier New', monospace;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 13px;
	color: var(--accent-2);
	cursor: pointer;
	transition: all 0.2s ease;
	user-select: none;
	display: inline-block;
}

.server-ip:hover {
	background: var(--card);
	border-color: var(--accent);
	transform: translateY(-1px);
}

.server-ip:active {
	transform: translateY(0);
}

[data-theme="dark"] .server-ip {
	background: #1a1a1a;
	color: var(--accent);
}

[data-theme="dark"] .server-ip:hover {
	background: #202020;
}

.server-features {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: var(--muted)
}

.server-features li {
	padding: 4px 0;
	position: relative;
	padding-left: 16px
}

.server-features li:before {
	content: "•";
	position: absolute;
	left: 0;
	color: var(--accent)
}

@media (max-width: 1200px) {
	.server-list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 900px) {
	.server-list {
		grid-template-columns: 1fr;
	}
	
	.server-map {
		height: 160px;
	}
}

@media (max-width: 600px) {
	.server-map {
		height: 120px;
	}
}

/* Support */
.support-grid {
	display: grid;
	gap: 18px;
	grid-template-columns: repeat(3, 1fr);
	align-items: start;
}

@media (max-width:900px) {
	.support-grid {
		grid-template-columns: 1fr
	}
}

.support-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px;
	box-shadow: var(--shadow);
	display: grid;
	grid-template-rows: auto 1fr;
	gap: 14px
}

.support-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.support-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px
}

.support-title {
	font-weight: 800;
	letter-spacing: .3px
}

.qr {
	border-radius: var(--radius-sm);
	border: 1px dashed var(--border);
	display: grid;
	place-items: center;
	background: var(--panel);
	color: var(--muted);
	font-size: 13px;
	object-fit: cover;
	width: 100%;
	aspect-ratio: 1;
	height: auto;
}

[data-theme="dark"] .qr {
	background:
		repeating-linear-gradient(45deg, #161616, #161616 6px, #151515 6px, #151515 12px);
	border: 1px dashed #3a3a3a;
}

/* Rules & Community */
.grid-2 {
	display: grid;
	gap: 18px;
	grid-template-columns: 1.1fr .9fr
}

@media (max-width:900px) {
	.grid-2 {
		grid-template-columns: 1fr
	}
}

details.rule {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 16px;
	margin-bottom: 12px;
	box-shadow: var(--shadow)
}

details.rule summary {
	font-weight: 700;
	cursor: pointer;
	user-select: none;
	margin: -8px -6px;
	padding: 8px 6px;
	list-style: none
}

details.rule summary::-webkit-details-marker {
	display: none
}

details.rule[open] summary:before {
	transform: rotate(90deg)
}

.rule-content {
	margin-top: 12px;
	color: var(--muted);
	line-height: 1.6
}

.rule-content h4 {
	margin: 0 0 12px 0;
	color: var(--text);
	font-size: 16px;
	font-weight: 600;
}

.rule-list {
	margin: 0;
	padding: 0 0 0 20px;
	list-style: none;
}

.rule-list li {
	margin-bottom: 8px;
	position: relative;
}

.rule-list li:before {
	content: "•";
	position: absolute;
	left: -16px;
	color: var(--accent);
	font-weight: bold;
}

.community-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	box-shadow: var(--shadow)
}

.spacer {
	height: 24px
}

.links {
	display: flex;
	gap: 24px;
	flex-wrap: wrap
}

.links a {
	color: var(--muted);
	text-decoration: none;
	font-size: 14px;
	transition: color .2s ease
}

.links a:hover {
	color: var(--text)
}

/* Footer */
.site-footer {
	background: var(--panel);
	border-top: 1px solid var(--border);
	padding: 40px 0
}

.footer-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 20px
}

@media (max-width:700px) {
	.footer-inner {
		flex-direction: column;
		text-align: center
	}
}

/* Toast */
.toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(100%);
	background: var(--text);
	color: var(--bg);
	padding: 12px 20px;
	border-radius: 8px;
	font-weight: 600;
	z-index: 1000;
	opacity: 0;
	transition: transform .3s ease, opacity .3s ease
}

.toast.show {
	transform: translateX(-50%) translateY(0);
	opacity: 1
}

/* QR Modal */
.qr-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qr-modal.show {
	opacity: 1;
	visibility: visible;
}

.qr-modal-content {
	background: var(--card);
	border-radius: var(--radius);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	max-width: 400px;
	width: 90%;
	max-height: 90vh;
	overflow: auto;
	transform: scale(0.9);
	transition: transform 0.3s ease;
}

.qr-modal.show .qr-modal-content {
	transform: scale(1);
}

.qr-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--border);
}

.qr-modal-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
}

.qr-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: var(--muted);
	cursor: pointer;
	padding: 4px;
	line-height: 1;
	transition: color 0.2s ease;
}

.qr-modal-close:hover {
	color: var(--text);
}

.qr-modal-body {
	padding: 24px;
	text-align: center;
}

.qr-modal-image {
	width: 200px;
	height: 200px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	margin-bottom: 16px;
	object-fit: cover;
}

/* Map Modal */
.map-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	z-index: 10000;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.map-modal.active {
	display: flex;
}

.map-modal-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	background: var(--card);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.map-modal-header {
	padding: 16px 20px;
	background: var(--panel);
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.map-modal-title {
	font-weight: 600;
	font-size: 16px;
	margin: 0;
}

.map-modal-close {
	background: none;
	border: none;
	color: var(--muted);
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	line-height: 1;
	width: 32px;
	height: 32px;
	outline: none;
}

.map-modal-close:hover {
	background: var(--border);
	color: var(--text);
}

.map-modal-close:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.map-modal-image {
	width: 100%;
	height: auto;
	display: block;
	max-height: 70vh;
	object-fit: contain;
}

@media (max-width: 600px) {
	.map-modal-content {
		max-width: 95vw;
		max-height: 95vh;
	}
	
	.map-modal-header {
		padding: 12px 16px;
	}
	
	.map-modal-title {
		font-size: 14px;
	}
}

.qr-modal-text {
	color: var(--muted);
	margin: 0;
	font-size: 14px;
}

/* Leaderboard */
.leaderboard-controls {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 24px;
	gap: 20px;
	position: relative;
	min-height: 50px; /* Мінімальна висота для стабільності */
}

.server-tabs {
	flex: 1;
	display: flex;
	justify-content: center;
	max-width: 600px; /* Обмежуємо максимальну ширину */
}

.server-tabs-list {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
}

.refresh-button {
	background: var(--card);
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 12px 16px;
	color: var(--text);
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
	white-space: nowrap;
	position: absolute;
	right: 0;
	top: 50%;
	margin-top: -25px;
	justify-content: center;
}

/* Specific color fix for light theme on iOS Safari */
:root .refresh-button {
	color: #212529 !important;
}

[data-theme="light"] .refresh-button {
	color: #212529 !important;
}

/* Dark theme refresh button */
[data-theme="dark"] .refresh-button {
	color: #f3f3f3 !important;
}

/* Ensure refresh button text inherits proper color on all elements */
.refresh-button * {
	color: inherit;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
	:root .refresh-button,
	[data-theme="light"] .refresh-button {
		color: #212529 !important;
		-webkit-text-fill-color: #212529 !important;
	}
	
	[data-theme="dark"] .refresh-button {
		color: #f3f3f3 !important;
	}
}

.refresh-button:hover {
	background: var(--panel);
	border-color: var(--accent);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	color: var(--text);
}

/* Light theme hover state */
:root .refresh-button:hover,
[data-theme="light"] .refresh-button:hover {
	color: #212529 !important;
}

/* Dark theme hover state */
[data-theme="dark"] .refresh-button:hover {
	color: #f3f3f3 !important;
}

.refresh-button:active {
	transform: scale(0.95);
}

.refresh-button.loading {
	opacity: 0.7;
	cursor: not-allowed;
}

.refresh-button.loading .refresh-icon {
	animation: spin 1s linear infinite;
	transform-origin: center center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.2em;
	height: 1.2em;
}

@keyframes spin {
	0% { 
		transform: rotate(0deg);
	}
	100% { 
		transform: rotate(360deg);
	}
}

.refresh-icon {
	width: 16px;
	height: 16px;
	border: 2px solid var(--text);
	border-radius: 50%;
	border-top-color: transparent;
	display: inline-block;
	position: relative;
	transition: transform 0.3s ease;
}

.refresh-icon::before {
	content: '';
	position: absolute;
	top: -2px;
	left: -1px;
	width: 0;
	height: 0;
	border-right: 4px solid var(--text);
	border-top: 2px solid transparent;
	border-bottom: 2px solid transparent;
}

.server-tab {
	background: var(--card);
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 12px 20px;
	color: var(--text);
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: 500;
	min-width: 80px;
	text-align: center;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.server-tab:hover {
	background: var(--panel);
	border-color: var(--accent);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.server-tab.active {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--background);
	box-shadow: 0 4px 15px rgba(255, 200, 87, 0.3);
}

.server-tab.disabled {
	background: var(--panel);
	border-color: var(--border);
	color: var(--muted);
	cursor: not-allowed;
	opacity: 0.5;
	padding-bottom: 20px;
}

.server-tab.disabled::after {
	content: attr(data-status);
	position: absolute;
	bottom: 4px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.65em;
	opacity: 0.8;
	color: var(--muted);
	font-weight: 400;
}

.server-tab.loading {
	position: relative;
	pointer-events: none;
	opacity: 0.7;
}

.server-tab.loading::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 16px;
	height: 16px;
	border: 2px solid transparent;
	border-top: 2px solid var(--accent);
	border-radius: 50%;
	animation: spin-center 1s linear infinite;
	z-index: 1;
}

@keyframes spin-center {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.server-tab .server-name {
	font-size: 0.8em;
	opacity: 0.8;
}

.server-tab .server-id {
	font-size: 1.1em;
	font-weight: bold;
}

.leaderboard-content {
	max-width: 800px;
	margin: 0 auto;
}

.leaderboard-data {
	transition: opacity 0.2s ease;
}

.leaderboard-loading,
.leaderboard-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--muted);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 12px;
}

.leaderboard-loading::before {
	content: "";
	width: 24px;
	height: 24px;
	border: 2px solid var(--border);
	border-top: 2px solid var(--accent);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.match-info {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 24px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
}

.match-stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.stat-label {
	font-size: 13px;
	color: var(--muted);
	font-weight: 500;
}

.stat-value {
	font-size: 18px;
	font-weight: 600;
	color: var(--text);
}

.players-table {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.table-header {
	background: var(--panel);
	border-bottom: 1px solid var(--border);
	display: grid;
	grid-template-columns: 80px 1fr 80px 80px 80px;
	padding: 16px 0;
	font-weight: 600;
	font-size: 14px;
	color: var(--muted);
}

.table-header > div {
	padding: 0 16px;
	text-align: center;
}

.player-col {
	text-align: left !important;
}

.table-row {
	display: grid;
	grid-template-columns: 80px 1fr 80px 80px 80px;
	padding: 16px 0;
	border-bottom: 1px solid var(--border);
	transition: background-color 0.2s ease;
}

.table-row:last-child {
	border-bottom: none;
}

.table-row:hover {
	background: var(--panel);
}

.table-row > div {
	padding: 0 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
}

.rank-col {
	position: relative;
	gap: 8px;
}

.rank-number {
	font-weight: 600;
}

.rank-medal {
	font-size: 16px;
}

.player-col {
	justify-content: flex-start !important;
}

.player-name {
	font-weight: 500;
	color: var(--text);
}

.kills-col {
	font-weight: 600;
	color: var(--success);
}

.deaths-col {
	font-weight: 600;
	color: var(--danger);
}

.kd-col {
	font-weight: 600;
}

/* Top 3 highlighting */
.rank-1 {
	background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
	border-left: 3px solid #ffd700;
}

.rank-2 {
	background: linear-gradient(90deg, rgba(169, 169, 169, 0.15), transparent);
	border-left: 3px solid #a9a9a9;
}

/* Better contrast for rank 2 on light theme */
[data-theme="light"] .rank-2,
:root .rank-2 {
	background: linear-gradient(90deg, rgba(105, 105, 105, 0.2), transparent);
	border-left: 3px solid #696969;
}

.rank-3 {
	background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
	border-left: 3px solid #cd7f32;
}

@media (max-width: 900px) {
	.leaderboard-controls {
		flex-direction: column;
		align-items: center;
		gap: 16px;
		position: static;
	}
	
	.server-tabs {
		width: 100%;
		max-width: none;
	}
	
	.refresh-button {
		position: static;
		top: auto;
		margin-top: 0;
		align-self: center;
		min-width: 120px;
		/* Force proper text color on mobile Safari */
		color: var(--text) !important;
		-webkit-text-fill-color: var(--text) !important;
	}
	
	/* Light theme mobile refresh button */
	[data-theme="light"] .refresh-button {
		color: #212529 !important;
		-webkit-text-fill-color: #212529 !important;
	}
	
	/* Dark theme mobile refresh button */
	[data-theme="dark"] .refresh-button {
		color: #f3f3f3 !important;
		-webkit-text-fill-color: #f3f3f3 !important;
	}
	
	.refresh-button:hover {
		transform: translateY(-2px);
	}
	
	.refresh-button:active {
		transform: translateY(0);
	}
	
	.server-tabs-list {
		gap: 6px;
	}
	
	.server-tab {
		min-width: 60px;
		padding: 10px 16px;
		font-size: 0.9em;
	}
	
	.server-tab .server-name {
		font-size: 0.7em;
	}
	
	.server-tab .server-id {
		font-size: 1em;
	}
	
	.match-info {
		grid-template-columns: 1fr;
		gap: 12px;
		padding: 16px;
	}
	
	.players-table {
		font-size: 13px;
	}
	
	.table-header,
	.table-row {
		grid-template-columns: 60px 1fr 60px 60px 70px;
		padding: 12px 0;
	}
	
	.table-header > div,
	.table-row > div {
		padding: 0 8px;
	}
	
	.stat-value {
		font-size: 16px;
	}
}

@media (max-width: 600px) {
	.leaderboard-controls {
		gap: 12px;
	}
	
	.refresh-button {
		padding: 10px 12px;
		font-size: 0.9em;
		position: static;
		top: auto;
		margin-top: 0;
	}
	
	.refresh-button:hover {
		transform: translateY(-2px);
	}
	
	.refresh-button:active {
		transform: translateY(0);
	}
	
	.server-tabs-list {
		gap: 4px;
	}
	
	.server-tab {
		min-width: 50px;
		padding: 8px 12px;
		font-size: 0.8em;
	}
	
	.server-tab .server-name {
		font-size: 0.6em;
	}
	
	.server-tab .server-id {
		font-size: 0.9em;
	}
	
	.match-info {
		padding: 12px;
	}
	
	.table-header,
	.table-row {
		grid-template-columns: 50px 1fr 50px 50px 60px;
		padding: 10px 0;
	}
	
	.table-header > div,
	.table-row > div {
		padding: 0 6px;
		font-size: 12px;
	}
	
	.rank-medal {
		font-size: 14px;
	}
}

/* System preference color overrides for mobile Safari refresh button */
@media (prefers-color-scheme: light) {
	.refresh-button {
		color: #212529 !important;
		-webkit-text-fill-color: #212529 !important;
	}
}

@media (prefers-color-scheme: dark) {
	.refresh-button {
		color: #f3f3f3 !important;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion:reduce) {
	.btn {
		transition: none
	}

	.toast {
		transition: none
	}
}
