/* Global reset */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html, body {
	height: 100%;
	background: #0b0b0f;
}

body {
	font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	color: #fff;
	overflow: hidden;
}

.background {
	position: fixed;
	inset: 0;
	background-image: url('./header-md-6tXH1jdN.png');
	background-size: cover;
	background-position: center;
	filter: blur(18px) saturate(120%);
	transform: scale(1.06);
	z-index: 0;
}

.overlay {
	position: fixed;
	inset: 0;
	background: radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.6) 55%, rgba(0,0,0,0.85) 100%);
	backdrop-filter: blur(2px);
	z-index: 1;
}

.content {
	position: relative;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	padding: 24px;
	padding-top: clamp(24px, 8vh, 96px);
	gap: 16px;
	z-index: 2;
}

.title {
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.05;
	font-size: clamp(36px, 6vw, 72px);
	text-shadow: 0 10px 30px rgba(0,0,0,0.55);
	margin-bottom: 4px;
}

/* Tabs */
.tabs {
	margin-top: 4px;
	display: inline-flex;
	gap: 8px;
	background: rgba(255,255,255,0.06);
	padding: 6px;
	border-radius: 12px;
	backdrop-filter: blur(6px);
}
.tab {
	appearance: none;
	border: 0;
	background: transparent;
	color: rgba(255,255,255,0.85);
	padding: 8px 14px;
	border-radius: 10px;
	cursor: pointer;
	font-weight: 800;
	font-family: 'Sora', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
	letter-spacing: 0.2px;
	transition: background 200ms ease, color 200ms ease, transform 120ms ease;
}
.tab.active {
	background: rgba(0,0,0,0.35);
	color: #fff;
}
.tab:hover { background: rgba(0,0,0,0.25); }

/* Card base (for calculator) */
.card {
	width: min(820px, 92vw);
	margin-top: 12px;
	background: rgba(18, 18, 24, 0.65);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	backdrop-filter: blur(6px);
	box-shadow: 0 20px 60px rgba(0,0,0,0.35);
	text-align: left;
	transition: transform 200ms ease, box-shadow 300ms ease, border-color 200ms ease, background 300ms ease;
}

.calc-body { padding: 18px 20px 20px 20px; }

.input-label { display: block; font-weight: 600; margin-bottom: 8px; }

.input-row { display: grid; grid-template-columns: 1.4fr 0.8fr auto; gap: 10px; }

.input {
	width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
	background: rgba(0,0,0,0.35); color: #fff;
	transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease, transform 150ms ease;
}

/* Fully custom select */
.custom-select { position: relative; }
.select-trigger {
	width: 100%; height: 100%;
	padding: 12px 40px 12px 14px;
	border-radius: 10px;
	border: 1px solid rgba(255,255,255,0.12);
	background: rgba(0,0,0,0.35);
	color: #fff;
	text-align: left;
	cursor: pointer;
	font-weight: 600;
	font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
	transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
.select-trigger::after {
	content: '';
	position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
	width: 14px; height: 14px; pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-size: 14px 14px; background-repeat: no-repeat;
}
.select-trigger:hover { border-color: rgba(255,255,255,0.22); background: rgba(0,0,0,0.42); }
.select-trigger:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.35); }

.select-menu {
	position: absolute; left: 0; right: 0; top: calc(100% + 6px);
	background: rgba(18,18,24,0.98);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 12px;
	box-shadow: 0 18px 60px rgba(0,0,0,0.45);
	padding: 6px;
	list-style: none;
	max-height: 320px;
	overflow-y: auto;
	display: none;
	z-index: 5;
}
.custom-select.open .select-menu { display: block; }

.select-option { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background 150ms ease, color 150ms ease; }
.select-option:hover { background: rgba(255,255,255,0.06); }
.select-option.is-active { background: rgba(255,255,255,0.1); }

.btn {
	padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
	background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
	color: #fff; font-weight: 800; font-family: 'Sora', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
	cursor: pointer; transition: transform 120ms ease, box-shadow 200ms ease, border-color 200ms ease, background 200ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,0.35); border-color: rgba(255,255,255,0.2); }
.btn:active { transform: translateY(0); }

.calc-result { margin-top: 16px; }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.result-item { padding: 12px; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; background: rgba(255,255,255,0.03); }

.result-label { font-size: 12px; color: rgba(255,255,255,0.7); }

.result-value { margin-top: 6px; font-size: 20px; font-weight: 800; }

.small { font-size: 11px; }

/* Modal */
.modal-open .background,
.modal-open .overlay,
.modal-open .content { filter: blur(10px) saturate(110%); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); z-index: 10; }

.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, 92vw); background: rgba(18,18,24,0.9); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); z-index: 11; }

.modal-header { padding: 16px 18px 6px 18px; }
.modal-body { padding: 0 18px 18px 18px; }
.modal-row { margin-top: 10px; display: grid; grid-template-columns: 1fr; gap: 10px; }

/* Primary button variant (used in modal) */
.btn-primary {
	background: linear-gradient(180deg, rgba(80,140,255,0.35), rgba(80,140,255,0.18));
	border-color: rgba(120, 160, 255, 0.45);
}
.btn-primary:hover { background: linear-gradient(180deg, rgba(100,160,255,0.45), rgba(80,140,255,0.24)); border-color: rgba(150,180,255,0.6); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; box-shadow: none; transform: none; }

/* Toast notifications */
.toasts { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast { min-width: 260px; max-width: 360px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12); background: rgba(18,18,24,0.9); color: #fff; box-shadow: 0 14px 40px rgba(0,0,0,0.45); font-size: 14px; }
.toast-success { border-color: rgba(60, 200, 120, 0.45); background: linear-gradient(180deg, rgba(60,200,120,0.16), rgba(18,18,24,0.9)); }
.toast-error { border-color: rgba(255, 120, 120, 0.45); background: linear-gradient(180deg, rgba(255,120,120,0.16), rgba(18,18,24,0.9)); }
.toast-info { border-color: rgba(120, 160, 255, 0.35); background: linear-gradient(180deg, rgba(120,160,255,0.16), rgba(18,18,24,0.9)); }

/* Leaderboard */
.leaderboard-card { width: min(820px, 92vw); margin-top: 12px; background: rgba(18, 18, 24, 0.65); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; backdrop-filter: blur(6px); box-shadow: 0 20px 60px rgba(0,0,0,0.35); text-align: left; transition: transform 200ms ease, box-shadow 300ms ease, border-color 200ms ease, background 300ms ease; }

.leaderboard-header { padding: 18px 20px 8px 20px; }
.leaderboard-header h2 { font-size: clamp(18px, 3.6vw, 24px); font-weight: 700; }
.muted { margin-top: 4px; color: rgba(255,255,255,0.7); font-size: 12px; }

.table-wrap { width: 100%; overflow: hidden; border-top: 1px solid rgba(255, 255, 255, 0.08); }

.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.leaderboard-table thead th { text-align: left; font-weight: 600; padding: 14px 20px; color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.02); }

.leaderboard-table tbody td { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, 0.06); }

.leaderboard-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.leaderboard-table tbody tr td:first-child { width: 74px; color: rgba(255,255,255,0.8); }

/* Hover elevation */
.leaderboard-card:hover, .card:hover { transform: translateY(-2px); box-shadow: 0 26px 70px rgba(0,0,0,0.45); border-color: rgba(255,255,255,0.12); background: rgba(22,22,28,0.72); }

@media (prefers-reduced-motion: no-preference) {
	.title { animation: fadeIn 900ms ease-out both; }
	.background { animation: panZoom 40s ease-in-out infinite alternate; }
	.leaderboard-card, .card { animation: floatIn 700ms ease-out both; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes subtleZoom { from { transform: scale(1.04); } to { transform: scale(1.08); } }
@keyframes panZoom { 0% { transform: scale(1.04) translate3d(0, 0, 0); background-position: 50% 50%; } 50% { transform: scale(1.07) translate3d(0.5%, -0.5%, 0); background-position: 51% 49%; } 100% { transform: scale(1.10) translate3d(1%, -1%, 0); background-position: 52% 48%; } }
@keyframes floatIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 840px) {
	.input-row { grid-template-columns: 1fr 1fr; }
	.btn { grid-column: 1 / -1; width: 100%; }
	.result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
	.tabs { gap: 6px; padding: 5px; border-radius: 10px; }
	.tab { padding: 7px 12px; }
	.title { font-size: clamp(32px, 8vw, 56px); }
	.leaderboard-header { padding: 16px 16px 8px 16px; }
	.calc-body { padding: 16px; }
}


