/* Line98 Leaderboard UI - light theme (matches light game background) */

#lb-btn {
	position: fixed;
	top: calc(env(safe-area-inset-top, 0px) + 8px);
	right: 10px;
	z-index: 9990;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #ffffff;
	color: #d19a00;
	font-size: 24px;
	line-height: 44px;
	text-align: center;
	cursor: pointer;
	border: 1px solid #d3dce6;
	box-shadow: 0 2px 8px rgba(30, 50, 80, 0.18);
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

#lb-btn:active {
	transform: scale(0.94);
}

#lb-modal {
	position: fixed;
	inset: 0;
	z-index: 9991;
	background: rgba(20, 35, 55, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
	padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
	box-sizing: border-box;
}

#lb-modal.lb-hidden {
	display: none;
}

.lb-box {
	width: 100%;
	max-width: 420px;
	max-height: 100%;
	background: linear-gradient(180deg, #ffffff, #f2f7fc);
	border: 1px solid #d3dce6;
	border-radius: 14px;
	box-shadow: 0 10px 34px rgba(30, 50, 80, 0.22);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.lb-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid #e2e8ef;
}

.lb-title {
	color: #b8860b;
	font-size: 18px;
	font-weight: bold;
}

.lb-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lb-share {
	color: #5f7184;
	font-size: 13px;
	cursor: pointer;
	padding: 5px 10px;
	border: 1px solid #cdd7e2;
	border-radius: 8px;
	background: #ffffff;
	-webkit-tap-highlight-color: transparent;
}

.lb-share:active {
	background: #eaf1f8;
	color: #2c3e50;
}

.lb-close {
	color: #5f7184;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
}

#lb-toast {
	position: fixed;
	left: 50%;
	bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
	transform: translateX(-50%);
	background: linear-gradient(180deg, #ffe080, #f0b429);
	color: #5b3d00;
	font-weight: bold;
	font-size: 14px;
	padding: 10px 18px;
	border-radius: 20px;
	z-index: 9999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s;
	box-shadow: 0 4px 14px rgba(30, 50, 80, 0.25);
}

#lb-toast.lb-toast-show {
	opacity: 1;
}

.lb-name-wrap {
	display: flex;
	padding: 12px 16px;
	gap: 8px;
}

#lb-name {
	flex: 1;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #cdd7e2;
	border-radius: 8px;
	background: #ffffff;
	color: #223142;
	font-size: 15px;
	outline: none;
	-webkit-user-select: text;
	user-select: text;
	-webkit-touch-callout: default;
}

#lb-name:focus {
	border-color: #e0a800;
	box-shadow: 0 0 0 3px rgba(224, 168, 0, 0.18);
}

#lb-name-save {
	height: 40px;
	padding: 0 16px;
	border: none;
	border-radius: 8px;
	background: linear-gradient(180deg, #ffe080, #f0b429);
	color: #5b3d00;
	font-size: 15px;
	font-weight: bold;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(224, 168, 0, 0.35);
}

#lb-name-save:active {
	transform: scale(0.97);
}

.lb-tabs {
	display: flex;
	gap: 6px;
	padding: 10px 16px 0;
}

.lb-tab {
	flex: 1;
	height: 34px;
	border: 1px solid #cdd7e2;
	border-radius: 8px;
	background: #ffffff;
	color: #5f7184;
	font-size: 13px;
	cursor: pointer;
}

.lb-tab.active {
	background: linear-gradient(180deg, #ffe080, #f0b429);
	border-color: #e0a800;
	color: #5b3d00;
	font-weight: bold;
	box-shadow: 0 2px 6px rgba(224, 168, 0, 0.3);
}

.lb-list {
	flex: 1;
	overflow-y: auto;
	padding: 10px 16px;
	min-height: 120px;
	max-height: 55vh;
	touch-action: pan-y;
}

.lb-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	color: #2c3e50;
	font-size: 15px;
}

.lb-row:nth-child(odd) {
	background: #f0f5fa;
}

.lb-row:nth-child(even) {
	background: #ffffff;
}

.lb-row-mine {
	outline: 2px solid #e0a800;
	background: #fdf3d7 !important;
}

.lb-rank {
	width: 40px;
	text-align: center;
	font-weight: bold;
	color: #b8860b;
	flex-shrink: 0;
}

.lb-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lb-score {
	font-weight: bold;
	color: #b8860b;
	flex-shrink: 0;
}

.lb-msg {
	color: #6b7c8e;
	text-align: center;
	padding: 24px 0;
	font-size: 14px;
}

.lb-mine {
	padding: 10px 16px;
	border-top: 1px solid #e2e8ef;
	color: #b8860b;
	font-size: 14px;
	text-align: center;
}

/* --- Right sidebar: Daily Ranking --- */

.lb-sidebar {
	width: 300px;
	max-width: 30vw;
	flex-shrink: 0;
	min-height: 0;
	max-height: 100%;
	margin: 1.5rem 0;
	background: linear-gradient(180deg, #ffffff, #f2f7fc);
	border: 1px solid #d3dce6;
	border-radius: 14px;
	color: #2c3e50;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(30, 50, 80, 0.18);
}

.lb-sb-title {
	padding: 12px 16px;
	color: #b8860b;
	font-size: 16px;
	font-weight: bold;
	letter-spacing: 0.5px;
	text-align: center;
	border-bottom: 1px solid #e2e8ef;
}

.lb-sb-tabs {
	display: flex;
	gap: 6px;
	padding: 10px 12px 0;
}

.lb-sb-tabs .lb-tab {
	height: 28px;
	font-size: 12px;
	padding: 0 2px;
}

.lb-sb-list {
	flex: 1 1 0;
	min-height: 0;
	overflow-y: auto;
	padding: 8px 12px;
	touch-action: pan-y;
}

.lb-sb-list .lb-row {
	padding: 6px 8px;
	font-size: 13px;
	gap: 8px;
}

.lb-sb-list .lb-rank {
	width: 30px;
	font-size: 13px;
}

.lb-sb-list .lb-score {
	font-size: 13px;
}

.lb-sb-mine {
	padding: 8px 12px;
	border-top: 1px solid #e2e8ef;
	color: #b8860b;
	font-size: 12px;
	text-align: center;
}

/* Narrow / portrait: sidebar stacks below the board, always visible */
@media (max-width: 640px) {
	#container {
		flex-direction: column;
	}

	.lb-sidebar {
		width: 100%;
		max-width: none;
		height: min(360px, 40vh);
		flex: none;
		margin: 0;
		border-radius: 0;
		box-shadow: none;
	}
}
