/* Color Variables */
:root {
	--color-primary: #007AFF;
	--color-primary-dark: #0A84FF;
	--color-error: #ff3b30;

	--color-text: #333;
	--color-text-secondary: #555;
	--color-text-muted: #999;

	--color-bg: #fff;
	--color-bg-card: #F2F2F7;
	--color-bg-elevated: #F2F2F7;
	--color-bg-match: #E8F0FE;
	--color-bg-input: #f8f8f8;

	--color-border: rgba(0,0,0,.08);
	--color-border-strong: #D1D1D6;
	--color-link: #0066cc;
	--color-accent: #00BD5A;
}

@media (prefers-color-scheme: dark) {
	:root {
		--color-primary: #0A84FF;
		--color-primary-dark: #0A84FF;
		--color-error: #ff3b30;

		--color-text: #f5f5f5;
		--color-text-secondary: #aaa;
		--color-text-muted: #666;

		--color-bg: #000;
		--color-bg-card: #1C1C1E;
		--color-bg-elevated: #2c2c2e;
		--color-bg-match: #1E2A3A;
		--color-bg-input: #2c2c2e;
		--color-bg-secondary: #1A1A1C;

		--color-border: rgba(255,255,255,.08);
		--color-border-strong: #2C2C2E;
		--color-link: #58a6ff;

		/* 경기 통계 색상 */
		--color-light: #555;
		--color-dark: #999;

		/* 상태 색상 */
		--color-success: #34c759;
		--color-accent: #a6ff00;
	}
}

/* 헤더 h1 오버라이드 */
header .container a h1 {
	font-family: "Paperlogy" !important;
	font-weight: 800 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
}
header .container a .page_title {
	font-family: "Paperlogy";
	font-weight: 300;
	font-size: 19px;
	margin-left: 3px;
}

/* 헤더 레이어 오픈 시 (schedule) — unfold와 동일 패턴 */
header.layer-open {
	height: 100%;
	background-color: rgba(255,255,255,0.5);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
}
@media (prefers-color-scheme: dark) {
	header.layer-open {
		background-color: rgba(0,0,0,0.5);
	}
}

/* 경기 일정 레이어 (공통) — shortcut 패턴 */
.schedule_layer {
	position: absolute;
	top: 50px;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 20px;
	opacity: 0;
	transform: translateY(-20px);
	visibility: hidden;
	transition: all 0.25s cubic-bezier(0.28, 0.11, 0.32, 1);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.schedule_layer.show {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
}
.schedule_layer .schedule_grid {
	display: grid;
	grid-template-columns: auto auto auto auto 1fr auto;
}
.schedule_layer .schedule_item {
	display: contents;
	color: var(--color-text);
	text-decoration: none;
}
.schedule_layer .schedule_item > * {
	padding: 15px 0;
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity .25s cubic-bezier(.28,.11,.32,1), transform .25s cubic-bezier(.28,.11,.32,1);
}
.schedule_layer.show .schedule_item > * {
	opacity: 1;
	transform: translateY(0);
}
.schedule_layer .schedule_item > * {
	border-top: 1px solid var(--color-border);
}
.schedule_layer .schedule_item > *:first-child {
	padding-left: 0;
}
.schedule_layer .schedule_item > *:last-child {
	padding-right: 0;
}
.schedule_layer .schedule_date,
.schedule_layer .schedule_weekday,
.schedule_layer .schedule_time {
	font-size: 13px;
	color: var(--color-text-secondary);
	white-space: nowrap;
	display: flex;
	align-items: center;
}
.schedule_layer .schedule_date {
	padding-right: 6px;
}
.schedule_layer .schedule_weekday {
	padding-right: 6px;
}
.schedule_layer .schedule_time {
	padding-right: 10px;
}
.schedule_layer .schedule_comp {
	display: flex;
	align-items: center;
	justify-content: center;
	padding-right: 10px;
}
.schedule_layer .schedule_comp img {
	width: 20px;
	height: 20px;
	object-fit: contain;
}
.schedule_layer .schedule_comp_empty {
	width: 20px;
	padding-right: 10px;
}
.schedule_layer .schedule_opponent {
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: flex;
	align-items: center;
	padding-right: 10px;
}
.schedule_layer .schedule_ha {
	display: flex;
	align-items: center;
	justify-content: center;
}
.schedule_layer .schedule_ha .material-symbols-rounded {
	font-size: 18px;
	line-height: 1;
	color: var(--color-text-secondary);
}
.schedule_layer .schedule_ha.home .material-symbols-rounded {
	color: var(--color-text);
}
.schedule_layer .schedule_empty {
	grid-column: 1 / -1;
	padding: 20px;
	text-align: center;
	font-size: 14px;
	color: var(--color-text-muted);
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity .25s cubic-bezier(.28,.11,.32,1), transform .25s cubic-bezier(.28,.11,.32,1);
}
.schedule_layer.show .schedule_empty {
	opacity: 1;
	transform: translateY(0);
}
.schedule_layer .schedule_view_all {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 12px 0;
	border-top: 1px solid var(--color-border);
	font-size: 14px;
	font-weight: 500;
	color: var(--color-primary);
	text-decoration: none;
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity .25s cubic-bezier(.28,.11,.32,1), transform .25s cubic-bezier(.28,.11,.32,1);
}
.schedule_layer .schedule_view_all .material-symbols-rounded {
	font-size: 18px;
}
.schedule_layer.show .schedule_view_all {
	opacity: 1;
	transform: translateY(0);
}

/* 순위 레이어 */
.standings_layer {
	position: fixed;
	top: 50px;
	left: 0;
	width: 100%;
	box-sizing: border-box;
	overflow-y: auto;
	max-height: calc(100vh - 50px);
	background: var(--color-bg);
	box-shadow: 0 4px 16px rgba(0,0,0,.15);
	z-index: 200;
	visibility: hidden;
	opacity: 0;
	clip-path: inset(0 0 100% 0);
	transition: clip-path .4s cubic-bezier(.4,0,.2,1), opacity .4s cubic-bezier(.4,0,.2,1), visibility 0s .4s;
	padding: 0 16px 16px;
}
.standings_layer.show {
	visibility: visible;
	opacity: 1;
	clip-path: inset(0 0 0 0);
	transition: clip-path .4s cubic-bezier(.4,0,.2,1), opacity .3s cubic-bezier(.4,0,.2,1), visibility 0s 0s;
}

/* 대회 섹션 */
.standings_section { margin-top: 16px; }
.standings_section_header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
.standings_section_header img { width: 20px; height: 20px; object-fit: contain; }
.standings_section_header span { font-size: 14px; font-weight: 700; }

/* 순위 테이블 */
.standings_table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.standings_table th {
	font-size: 11px;
	font-weight: 600;
	color: var(--color-text-muted);
	text-align: center;
	padding: 4px 0;
	border-bottom: 1px solid var(--color-border);
}
.standings_table th:nth-child(2) { text-align: left; }
.standings_table td {
	padding: 7px 0;
	text-align: center;
	border-bottom: 1px solid var(--color-border);
}
.standings_table td:nth-child(1) { width: 28px; font-weight: 600; color: var(--color-text-muted); }
.standings_table td:nth-child(2) { text-align: left; font-weight: 500; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standings_table td:nth-child(3),
.standings_table td:nth-child(4),
.standings_table td:nth-child(5),
.standings_table td:nth-child(6) { width: 32px; }
.standings_table td:last-child { font-weight: 700; width: 36px; }

/* 레알 마드리드 하이라이트 */
.standings_table tr.my_team td { color: var(--color-accent); font-weight: 700; }
.standings_table tr.my_team td:nth-child(1) { color: var(--color-accent); }

/* 구분선 */
.standings_table tr.separator td {
	padding: 2px 0;
	border-bottom: none;
	text-align: center;
	color: var(--color-text-muted);
	font-size: 11px;
}

/* 로딩/빈 상태 */
.standings_empty {
	padding: 20px;
	text-align: center;
	font-size: 14px;
	color: var(--color-text-muted);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity .3s ease, transform .3s ease;
}
.standings_layer.show .standings_empty {
	opacity: 1;
	transform: translateY(0);
}

/* qual color 마커 */
.standings_table td.qual_marker {
	position: relative;
}
.standings_table td.qual_marker::before {
	content: '';
	position: absolute;
	left: 2px;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 16px;
	border-radius: 2px;
}

/* 헤더 우측 버튼 그룹 */
.header_right { display:flex; align-items:center; flex-shrink:0; }
/* 알림 배지 */
.header_right .notif_btn { position:relative; }
.header_right .notif_btn .material-symbols-rounded { font-variation-settings: 'FILL' 0; }
/* 알림 레이어 */
.notif_layer {
	position: absolute;
	top: 50px;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0;
	opacity: 0;
	transform: translateY(-20px);
	visibility: hidden;
	transition: all 0.25s cubic-bezier(0.28, 0.11, 0.32, 1);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.notif_layer.show {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
}
.notif_layer .notif_list {
	list-style: none;
	margin: 0;
	padding: 20px;
}
.notif_layer .notif_item {
	display: flex;
	gap: 10px;
	padding: 15px 0;
	text-decoration: none;
	color: var(--color-text);
	align-items: flex-start;
	border-top: 1px solid var(--color-border);
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity .25s cubic-bezier(.28,.11,.32,1), transform .25s cubic-bezier(.28,.11,.32,1);
}

.notif_layer .notif_item:last-child { border-bottom: 1px solid var(--color-border); }

.notif_layer.show .notif_item {
	opacity: 1;
	transform: translateY(0);
}
.notif_layer .notif_item.unread {
	background: var(--color-bg-card);
}
.notif_layer .notif_icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--color-bg-elevated);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.notif_layer .notif_icon .material-symbols-rounded {
	font-size: 18px;
	color: var(--color-text-secondary);
}
.notif_layer .notif_item.unread .notif_icon {
	background: var(--color-accent);
}
.notif_layer .notif_item.unread .notif_icon .material-symbols-rounded {
	color: #000;
}
.notif_layer .notif_body {
	flex: 1;
	min-width: 0;
}
.notif_layer .notif_meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 2px;
}
.notif_layer .notif_from {
	font-size: 14px;
	font-weight: 600;
}
.notif_layer .notif_type {
	font-size: 12px;
	color: var(--color-text-muted);
}
.notif_layer .notif_content {
	font-size: 13px;
	color: var(--color-text-secondary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.notif_layer .notif_time {
	font-size: 12px;
	color: var(--color-text-muted);
	flex-shrink: 0;
	margin-top: 2px;
}
.notif_layer .notif_dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--color-primary);
	flex-shrink: 0;
	margin-top: 6px;
}
.notif_layer .notif_empty {
	padding: 40px 16px;
	text-align: center;
	font-size: 14px;
	color: var(--color-text-muted);
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity .25s cubic-bezier(.28,.11,.32,1), transform .25s cubic-bezier(.28,.11,.32,1);
}
.notif_layer.show .notif_empty {
	opacity: 1;
	transform: translateY(0);
}
.notif_badge {
	position:absolute;
	top:2px;
	right:-2px;
	min-width:16px;
	height:16px;
	line-height:16px;
	padding:0 4px;
	border-radius:8px;
	background:#FF3B30;
	color:#fff;
	font-size:10px;
	font-weight:700;
	text-align:center;
	box-sizing:border-box;
}
