:root {
	--portal-bg: oklch(17% 0.012 55);
	--portal-surface: oklch(22% 0.018 55);
	--portal-surface-raised: oklch(26% 0.026 55);
	--portal-surface-soft: oklch(29% 0.03 55);
	--portal-border: oklch(36% 0.034 55);
	--portal-border-strong: oklch(48% 0.07 63);
	--portal-text: oklch(94% 0.025 75);
	--portal-muted: oklch(78% 0.03 72);
	--portal-quiet: oklch(67% 0.032 70);
	--portal-accent: oklch(63% 0.19 28);
	--portal-accent-hover: oklch(68% 0.19 28);
	--portal-gold: oklch(76% 0.13 77);
	--portal-gold-soft: oklch(85% 0.105 79);
	--bg: var(--portal-bg);
	--surface: var(--portal-surface);
	--surface-raised: var(--portal-surface-raised);
	--surface-soft: var(--portal-surface-soft);
	--border: var(--portal-border);
	--border-strong: var(--portal-border-strong);
	--text: var(--portal-text);
	--muted: var(--portal-muted);
	--quiet: var(--portal-quiet);
	--accent: var(--portal-accent);
	--accent-hover: var(--portal-accent-hover);
	--gold: var(--portal-gold);
	--gold-soft: var(--portal-gold-soft);
	--board: oklch(78% 0.125 82);
	--board-line: oklch(48% 0.105 78);
	--success: oklch(73% 0.12 151);
	--danger: oklch(69% 0.18 29);
	--content: 1120px;
	--font-body: SUIT, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
	--font-display: "GmarketSans", "NanumSquare Neo", SUIT, Pretendard, sans-serif;
	--space-xs: 4px;
	--space-sm: 8px;
	--space-md: 12px;
	--space-lg: 16px;
	--space-xl: 24px;
	--space-2xl: 32px;
	--space-3xl: 48px;
}

* {
	box-sizing: border-box;
}

html {
	max-width: 100%;
	overflow-x: clip;
	color-scheme: dark;
}

body {
	max-width: 100%;
	min-height: 100vh;
	overflow-x: clip;
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.5;
	text-rendering: optimizeLegibility;
}

.skip-link {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100;
	padding: 10px 14px;
	transform: translateY(-160%);
	border-radius: 8px;
	background: var(--text);
	color: var(--bg);
	font-weight: 850;
}

.skip-link:focus {
	transform: translateY(0);
}

button,
input,
select {
	font: inherit;
}

button,
a {
	-webkit-tap-highlight-color: transparent;
}

a {
	color: inherit;
	text-decoration: none;
}

:focus-visible {
	outline: 3px solid var(--gold-soft);
	outline-offset: 3px;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.content {
	width: 100%;
	max-width: var(--content);
	margin: 0 auto;
	padding-inline: var(--space-xl);
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	border-bottom: 1px solid var(--border);
	background: color-mix(in oklch, var(--bg) 94%, transparent);
	backdrop-filter: blur(12px);
}

.nav-inner {
	display: flex;
	align-items: center;
	height: 64px;
	max-width: var(--content);
	margin: 0 auto;
	padding-inline: var(--space-xl);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-right: 40px;
	font-size: 18px;
	font-weight: 850;
	letter-spacing: 0;
}

.brand-mark {
	position: relative;
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 2px solid var(--gold);
	border-radius: 50%;
	background: oklch(18% 0.006 55);
}

.brand-mark::after {
	position: absolute;
	right: -5px;
	bottom: -2px;
	width: 10px;
	height: 10px;
	border: 1px solid var(--quiet);
	border-radius: 50%;
	background: var(--text);
	content: "";
}

.primary-nav {
	display: flex;
	align-items: stretch;
	align-self: stretch;
	gap: var(--space-xs);
	margin-left: auto;
}

.nav-cta,
.omokland-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 38px;
	padding-inline: 13px 15px;
	border: 1px solid color-mix(in oklch, var(--accent) 64%, var(--border));
	border-radius: 8px;
	background:
		linear-gradient(180deg, color-mix(in oklch, var(--accent) 86%, var(--gold) 14%), var(--accent)),
		var(--accent);
	color: var(--text);
	box-shadow: 0 10px 24px color-mix(in oklch, var(--accent) 18%, transparent);
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 0;
	white-space: nowrap;
}

.nav-inner > .nav-cta {
	margin-left: var(--space-md);
}

.nav-cta:hover,
.omokland-cta:hover {
	border-color: color-mix(in oklch, var(--gold) 58%, var(--accent));
	background:
		linear-gradient(
			180deg,
			color-mix(in oklch, var(--accent-hover) 78%, var(--gold) 22%),
			var(--accent-hover)
		),
		var(--accent-hover);
}

.nav-cta-mark,
.omokland-cta-mark {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--gold-soft);
	box-shadow: 0 0 0 3px color-mix(in oklch, var(--gold-soft) 18%, transparent);
}

.nav-link {
	display: flex;
	align-items: center;
	padding-inline: 14px;
	border-bottom: 2px solid transparent;
	color: var(--muted);
	font-size: 14px;
	font-weight: 700;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
	border-bottom-color: var(--accent);
	color: var(--text);
}

.home-hero {
	border-bottom: 1px solid var(--border);
	background:
		radial-gradient(
			circle at 50% -45%,
			color-mix(in oklch, var(--gold) 18%, transparent),
			transparent 48%
		),
		var(--surface);
}

.hero-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-block: clamp(24px, 3vw, 34px) clamp(22px, 3vw, 30px);
	text-align: center;
}

.eyebrow {
	margin: 0 0 var(--space-md);
	color: var(--gold);
	font-size: 11px;
	font-weight: 850;
	letter-spacing: 0.16em;
}

.home-hero h1,
.tournament-head h1 {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(30px, 4vw, 40px);
	font-weight: 900;
	letter-spacing: 0;
	line-height: 1.12;
}

.hero-description {
	max-width: 58ch;
	margin: var(--space-sm) 0 0;
	color: var(--muted);
	font-size: 15px;
}

.search-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	width: min(680px, 100%);
	height: 52px;
	margin-top: var(--space-lg);
	padding: 5px;
	border: 1px solid var(--border-strong);
	border-radius: 8px;
	background: var(--text);
	box-shadow: 0 18px 48px color-mix(in oklch, var(--bg) 55%, transparent);
	transition:
		border-color 160ms ease,
		box-shadow 160ms ease;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--space-sm);
	margin-top: var(--space-md);
}

.hero-link {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding-inline: 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--gold-soft);
	font-size: 13px;
	font-weight: 850;
}

.hero-link:hover {
	border-color: var(--border-strong);
	background: var(--surface-raised);
}

.search-hero .hero-content {
	padding-block: 20px;
}

.search-hero .eyebrow,
.search-hero .hero-description,
.search-hero .search-guide {
	display: none;
}

.search-hero h1 {
	font-size: 26px;
}

.search-hero .search-form {
	margin-top: var(--space-md);
}

.search-form:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 22%, transparent);
}

.search-form input {
	min-width: 0;
	padding-inline: 17px;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--bg);
	font-size: 16px;
	font-weight: 650;
}

.search-form input::placeholder {
	color: oklch(54% 0.025 65);
	font-weight: 550;
}

.search-button {
	min-width: 86px;
	border: 0;
	border-radius: 8px;
	background: var(--accent);
	color: var(--text);
	cursor: pointer;
	font-size: 14px;
	font-weight: 850;
}

.search-button:hover {
	background: var(--accent-hover);
}

.search-suggestions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	width: min(680px, 100%);
	gap: var(--space-md);
	margin-top: var(--space-md);
}

.suggestion-rail {
	display: grid;
	gap: var(--space-sm);
	min-width: 0;
}

.suggestion-rail[hidden] {
	display: none;
}

.suggestion-rail h2 {
	margin: 0;
	color: var(--quiet);
	font-size: 12px;
	font-weight: 700;
}

.suggestion-rail > div {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
}

.search-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding-inline: 10px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: var(--gold-soft);
	cursor: pointer;
	font-size: 12px;
	font-weight: 800;
}

.search-chip span {
	color: var(--muted);
	font-size: 11px;
	font-weight: 650;
}

.search-chip:hover {
	border-color: var(--border);
	background: var(--surface-raised);
}

.search-guide {
	margin: var(--space-md) 0 0;
	color: var(--quiet);
	font-size: 12px;
}

.search-results {
	display: grid;
	width: min(680px, 100%);
	gap: var(--space-sm);
	margin-top: var(--space-md);
	text-align: left;
}

.search-results:empty {
	display: none;
}

.search-results .item-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 2px var(--space-md);
	padding: var(--space-md) var(--space-lg);
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface-raised);
}

.search-results .item-card h3,
.search-results .item-card p {
	margin: 0;
}

.search-results .item-card p {
	color: var(--muted);
	font-size: 12px;
}

.search-results .item-card a {
	grid-column: 2;
	grid-row: 1 / 3;
	align-self: center;
	color: var(--gold-soft);
	font-size: 13px;
	font-weight: 800;
}

.search-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	color: var(--gold-soft);
	cursor: pointer;
	font-size: 13px;
	font-weight: 850;
}

.search-more:hover {
	border-color: var(--border-strong);
	background: var(--surface-raised);
}

.search-page-panel {
	overflow: hidden;
}

.search-page-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
	gap: var(--space-lg);
	align-items: start;
}

.search-guidance {
	position: sticky;
	top: 84px;
	padding: var(--space-lg);
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
}

.search-guidance h2,
.search-guidance p {
	margin: 0;
}

.search-guidance h2 {
	margin-top: 5px;
	font-size: 16px;
}

.search-guidance p {
	margin-top: var(--space-sm);
	color: var(--muted);
	font-size: 13px;
}

.search-guidance ul {
	display: grid;
	gap: 7px;
	margin: var(--space-md) 0 0;
	padding: 0;
	color: var(--text);
	font-size: 12px;
	list-style: none;
}

.search-guidance li {
	position: relative;
	padding-left: 15px;
}

.search-guidance li::before {
	position: absolute;
	top: 0.62em;
	left: 1px;
	width: 5px;
	height: 5px;
	transform: translateY(-50%);
	border-radius: 50%;
	background: var(--gold);
	content: "";
}

.search-guidance > .omokland-cta {
	width: 100%;
	margin-top: var(--space-lg);
}

.player-result-list {
	display: grid;
}

.player-result {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) auto auto;
	align-items: center;
	gap: var(--space-md);
	min-height: 72px;
	padding: var(--space-md) 18px;
	border-bottom: 1px solid var(--border);
}

.player-result:last-child {
	border-bottom: 0;
}

.player-result:hover {
	background: var(--surface-raised);
}

.player-result-stone {
	display: block;
	width: 28px;
	height: 28px;
	border: 1px solid var(--border-strong);
	border-radius: 50%;
	background: oklch(16% 0.006 55);
	box-shadow: inset -2px -2px 4px color-mix(in oklch, var(--text) 11%, transparent);
}

.player-result-name,
.player-result-meta {
	display: grid;
	gap: 2px;
}

.player-result-name small,
.player-result-meta small {
	color: var(--muted);
	font-size: 12px;
}

.player-result-action {
	color: var(--gold-soft);
	font-size: 12px;
	font-weight: 850;
}

.search-state {
	margin: 0;
	padding: 11px 14px;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--surface-raised);
	color: var(--muted);
	font-size: 13px;
}

.search-state.is-loading {
	border-color: var(--border-strong);
	color: var(--gold-soft);
}

.search-state.is-error {
	border-color: color-mix(in oklch, var(--danger) 55%, var(--border));
	color: oklch(86% 0.08 29);
}

.search-state button {
	display: inline-flex;
	margin-left: var(--space-sm);
	padding: 5px 9px;
	border: 1px solid color-mix(in oklch, var(--danger) 46%, var(--border));
	border-radius: 7px;
	background: transparent;
	color: var(--gold-soft);
	cursor: pointer;
	font-size: 12px;
	font-weight: 850;
}

.search-skeleton {
	display: grid;
	gap: var(--space-sm);
	padding: var(--space-md);
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface-raised);
}

.search-skeleton::before,
.search-skeleton::after {
	display: block;
	height: 12px;
	border-radius: 999px;
	background: linear-gradient(
		90deg,
		color-mix(in oklch, var(--surface-soft) 82%, var(--gold) 18%),
		color-mix(in oklch, var(--surface-soft) 96%, var(--text) 4%),
		color-mix(in oklch, var(--surface-soft) 82%, var(--gold) 18%)
	);
	background-size: 220% 100%;
	animation: skeleton-pulse 1100ms ease-in-out infinite;
	content: "";
}

.search-skeleton::after {
	width: 62%;
}

@keyframes skeleton-pulse {
	0% {
		background-position: 100% 0;
	}

	100% {
		background-position: -100% 0;
	}
}

.home-content {
	padding-bottom: 56px;
}

.season-strip {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	overflow: hidden;
	margin-block: 18px var(--space-xl);
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
}

.season-item {
	padding: 15px 18px;
	border-right: 1px solid var(--border);
}

.season-item:last-child {
	border-right: 0;
}

.season-item strong,
.season-item span {
	display: block;
}

.season-item strong {
	font-size: 17px;
	line-height: 1.25;
}

.season-item span {
	margin-top: 3px;
	color: var(--muted);
	font-size: 12px;
}

.home-main {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
	gap: 18px;
	align-items: start;
}

.home-main > *,
.feature-grid > *,
.profile-card > * {
	min-width: 0;
}

.section-head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: var(--space-md);
	margin-bottom: var(--space-md);
}

.section-head h2,
.history-tabs h2 {
	margin: 0;
	font-size: 18px;
	letter-spacing: 0;
}

.section-head p,
.history-tabs span {
	margin: 2px 0 0;
	color: var(--muted);
	font-size: 12px;
}

.section-caption {
	color: var(--quiet);
	font-size: 10px;
	font-weight: 850;
	letter-spacing: 0.14em;
}

.period-tabs {
	display: flex;
	gap: 4px;
	padding: 3px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
}

.period-tabs a {
	padding: 5px 9px;
	border-radius: 6px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
}

.period-tabs a:hover,
.period-tabs a[aria-current="page"] {
	background: var(--surface-raised);
	color: var(--gold-soft);
}

.section-more {
	flex: none;
	color: var(--gold-soft);
	font-size: 12px;
	font-weight: 850;
}

.section-more:hover {
	color: var(--accent-hover);
}

.feature-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-md);
}

.match-card {
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	transition:
		transform 160ms ease,
		border-color 160ms ease;
}

.match-card:hover {
	transform: translateY(-2px);
	border-color: var(--border-strong);
}

.board-preview,
.mini-board {
	background-color: var(--board);
	background-image:
		linear-gradient(var(--board-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--board-line) 1px, transparent 1px);
	background-position: center;
}

.board-preview {
	position: relative;
	width: 100%;
	aspect-ratio: 1.65 / 1;
	border-bottom: 1px solid var(--border);
	background-size: 6.2857% 6.2857%;
}

.stone {
	position: absolute;
	width: 6.2%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
}

.stone.black,
.mini-stone.black {
	background: oklch(17% 0.005 55);
	box-shadow: inset -2px -2px 3px color-mix(in oklch, var(--text) 12%, transparent);
}

.stone.white,
.mini-stone.white {
	border: 1px solid oklch(55% 0.02 65);
	background: var(--text);
}

.stone.is-last::after {
	position: absolute;
	inset: 30%;
	border: 1px solid var(--accent);
	border-radius: 50%;
	content: "";
}

.match-copy {
	padding: 13px;
}

.match-kicker,
.recent-top {
	display: flex;
	justify-content: space-between;
	gap: var(--space-sm);
	color: var(--muted);
	font-size: 11px;
}

.players {
	display: grid;
	gap: 7px;
	margin-top: var(--space-md);
}

.player-row {
	display: grid;
	grid-template-columns: 16px minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--space-sm);
	font-size: 13px;
}

.player-row.is-winner,
.recent-player.is-winner {
	color: var(--gold-soft);
	font-weight: 760;
}

.mini-stone {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
}

.player-row .score {
	color: var(--muted);
	font-size: 12px;
}

.reason-line {
	margin: var(--space-md) 0 0;
	padding-top: var(--space-md);
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 12px;
}

.reason-line strong {
	color: var(--gold-soft);
}

.recent-panel,
.panel,
.profile-card,
.tournament-detail {
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
}

.recent-panel .section-head {
	margin: 0;
	padding: 14px 14px 8px;
}

.recent-list {
	padding: 0 14px 4px;
}

.recent-match {
	display: block;
	padding-block: 10px;
	border-top: 1px solid var(--border);
}

.recent-match:hover .recent-reason {
	color: var(--gold-soft);
}

.recent-player {
	display: flex;
	justify-content: space-between;
	gap: var(--space-sm);
	margin-top: 5px;
	font-size: 13px;
	font-weight: 650;
}

.recent-player span:last-child {
	color: var(--muted);
	font-size: 12px;
	font-weight: 550;
}

.recent-reason {
	margin-top: 5px;
	color: oklch(78% 0.065 75);
	font-size: 12px;
}

.empty-state {
	padding: var(--space-xl);
	border: 1px dashed var(--border-strong);
	border-radius: 8px;
	color: var(--muted);
	text-align: center;
}

.empty-state strong {
	display: block;
	color: var(--text);
}

.empty-state p {
	max-width: 52ch;
	margin: var(--space-sm) auto 0;
	font-size: 13px;
}

.page-main {
	padding-block: var(--space-xl) 56px;
}

.breadcrumb {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	color: var(--muted);
	font-size: 12px;
}

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

.profile-topline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-lg);
	margin-bottom: 18px;
}

.compact-search {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	width: min(360px, 100%);
	height: 40px;
	padding: 3px;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--text);
}

.compact-search input {
	min-width: 0;
	padding-inline: 10px;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--bg);
	font-size: 13px;
}

.compact-search button {
	padding-inline: 13px;
	border: 0;
	border-radius: 6px;
	background: var(--accent);
	color: var(--text);
	font-size: 12px;
	font-weight: 800;
}

.compact-results {
	margin: -8px 0 18px auto;
}

.context-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
	margin-top: var(--space-md);
	padding: 18px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: linear-gradient(
		90deg,
		color-mix(in oklch, var(--surface-raised) 88%, var(--gold) 12%),
		var(--surface)
	);
	color: var(--muted);
	font-size: 13px;
}

.context-cta .omokland-cta {
	flex: none;
}

.context-cta-copy {
	display: grid;
	gap: 3px;
}

.context-cta-copy > span {
	color: var(--gold);
	font-size: 10px;
	font-weight: 850;
	letter-spacing: 0.14em;
}

.context-cta-copy h2,
.context-cta-copy p {
	margin: 0;
}

.context-cta-copy h2 {
	color: var(--text);
	font-family: var(--font-display);
	font-size: 18px;
}

.context-cta-copy p {
	color: var(--muted);
	font-size: 12px;
}

.profile-record-note {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 10px 2px 0;
	color: var(--quiet);
	font-size: 11px;
}

.profile-record-note > span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--success);
}

.profile-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) minmax(390px, auto);
	align-items: center;
	gap: var(--space-lg);
	padding: 18px;
}

.profile-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(105px, 1fr));
}

.profile-avatar {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border: 2px solid var(--border-strong);
	border-radius: 50%;
	background: oklch(17% 0.005 55);
	color: var(--gold-soft);
	font-size: 22px;
	font-weight: 900;
}

.profile-identity h1 {
	margin: 0;
	font-family: var(--font-display);
	font-size: 26px;
	letter-spacing: 0;
}

.profile-identity p {
	margin: 5px 0 0;
	color: var(--muted);
	font-size: 13px;
}

.profile-stat {
	padding-left: 20px;
	border-left: 1px solid var(--border);
}

.profile-stat strong,
.profile-stat span {
	display: block;
}

.profile-stat strong {
	font-size: 20px;
}

.profile-stat span {
	margin-top: 3px;
	color: var(--muted);
	font-size: 12px;
}

.profile-summary {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
	gap: 0;
	overflow: hidden;
	margin-top: 14px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
}

.summary-panel {
	padding: var(--space-lg);
	border: 0;
	border-radius: 0;
	background: transparent;
}

.summary-panel + .summary-panel {
	border-left: 1px solid var(--border);
}

.panel-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
}

.panel-title h2 {
	margin: 0;
	font-size: 15px;
}

.panel-title span {
	color: var(--muted);
	font-size: 12px;
}

.rating-graph {
	display: block;
	width: 100%;
	height: 150px;
	margin-top: var(--space-md);
}

.placement-copy {
	display: grid;
	place-items: center;
	min-height: 150px;
	color: var(--muted);
	font-size: 13px;
	text-align: center;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-sm);
	margin-top: var(--space-md);
}

.form-stat {
	padding: var(--space-md);
	background: var(--surface-raised);
	text-align: center;
}

.form-stat strong,
.form-stat span {
	display: block;
}

.form-stat strong {
	font-size: 18px;
}

.form-stat span {
	margin-top: 2px;
	color: var(--muted);
	font-size: 11px;
}

.match-history {
	overflow: hidden;
	margin-top: 18px;
}

.history-tabs {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-md);
	padding: var(--space-lg) 18px;
	border-bottom: 1px solid var(--border);
}

.history-row {
	position: relative;
	display: grid;
	grid-template-columns: 4px 58px minmax(150px, 1.2fr) minmax(110px, 0.8fr) minmax(135px, auto) auto;
	align-items: center;
	gap: var(--space-lg);
	min-height: 78px;
	padding: var(--space-md) 18px;
	border-bottom: 1px solid var(--border);
}

.history-row:last-child {
	border-bottom: 0;
}

.history-row:hover {
	background: var(--surface-raised);
}

.result-bar {
	align-self: stretch;
	border-radius: 4px;
	background: var(--success);
}

.history-row.is-loss .result-bar {
	background: var(--danger);
}

.history-row.is-draw .result-bar {
	background: var(--quiet);
}

.mini-board {
	width: 54px;
	height: 54px;
	border-radius: 5px;
	background-size: 14.285% 14.285%;
}

.history-opponent strong,
.history-opponent span,
.history-result strong,
.history-result span {
	display: block;
}

.history-opponent span,
.history-result span,
.history-meta {
	margin-top: 3px;
	color: var(--muted);
	font-size: 12px;
}

.replay-link {
	color: var(--gold-soft);
	font-size: 12px;
	font-weight: 800;
}

.profile-tabs {
	display: flex;
	gap: 6px;
	padding: 0 18px var(--space-md);
	border-bottom: 1px solid var(--border);
}

.history-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
	border-bottom: 1px solid var(--border);
}

.history-controls .profile-tabs,
.history-controls .season-filter {
	border-bottom: 0;
}

.history-controls .profile-tabs {
	padding-block: var(--space-md);
}

.history-controls .season-filter {
	padding-block: var(--space-sm);
}

.history-controls .season-filter label {
	display: flex;
	align-items: center;
	gap: 7px;
}

.profile-tabs a {
	min-height: 34px;
	padding: 7px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
}

.profile-tabs a[aria-selected="true"],
.profile-tabs a:hover {
	border-color: var(--border-strong);
	background: var(--surface-raised);
	color: var(--gold-soft);
}

.season-filter {
	display: flex;
	align-items: end;
	gap: var(--space-sm);
	padding: var(--space-md) 18px;
	border-bottom: 1px solid var(--border);
}

.season-filter label {
	display: grid;
	gap: 4px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 750;
}

.season-filter input,
.season-filter select {
	min-height: 34px;
	padding-inline: 10px;
	border: 1px solid var(--border);
	border-radius: 8px;
	outline: 0;
	background: var(--text);
	color: var(--bg);
	font-size: 13px;
}

.season-filter button {
	min-height: 34px;
	padding-inline: 12px;
	border: 0;
	border-radius: 8px;
	background: var(--accent);
	color: var(--text);
	cursor: pointer;
	font-size: 12px;
	font-weight: 850;
}

.list-pager {
	display: flex;
	justify-content: center;
	padding: var(--space-lg);
	border-top: 1px solid var(--border);
}

.load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding-inline: 18px;
	border: 1px solid var(--border-strong);
	border-radius: 8px;
	background: var(--surface-raised);
	color: var(--gold-soft);
	cursor: pointer;
	font-size: 13px;
	font-weight: 850;
}

.load-more:hover {
	background: var(--surface-soft);
}

.load-more:disabled {
	cursor: wait;
	opacity: 0.68;
}

.tournament-head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: var(--space-md);
	margin-bottom: var(--space-lg);
}

.tournament-head h1 {
	font-size: 32px;
}

.tournament-head > div > p:last-child {
	max-width: 65ch;
	margin: var(--space-sm) 0 0;
	color: var(--muted);
	font-size: 14px;
}

.tournament-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-lg);
	margin-bottom: var(--space-lg);
}

.tournament-search {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.7fr) auto;
	align-items: end;
	gap: var(--space-sm);
	margin-bottom: var(--space-lg);
	padding: var(--space-md);
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
}

.tournament-search label {
	display: grid;
	gap: 5px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 750;
}

.tournament-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-bottom: 0;
}

.tournament-filters a {
	padding: 7px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 750;
}

.tournament-filters a:hover,
.tournament-filters a[aria-current="page"] {
	border-color: var(--border-strong);
	background: var(--surface-raised);
	color: var(--gold-soft);
}

.tournament-inline-filter {
	flex: 0 1 280px;
}

.tournament-search input,
.tournament-search select,
.tournament-inline-filter input {
	width: 100%;
	min-height: 44px;
	padding-inline: 13px;
	border: 1px solid var(--border);
	border-radius: 8px;
	outline: 0;
	background: var(--text);
	color: var(--bg);
	font-size: 13px;
	font-weight: 650;
}

.tournament-search select {
	appearance: none;
}

.tournament-search button {
	min-height: 44px;
	padding-inline: 16px;
	border: 0;
	border-radius: 8px;
	background: var(--accent);
	color: var(--text);
	cursor: pointer;
	font-size: 13px;
	font-weight: 850;
}

.tournament-search input::placeholder,
.tournament-inline-filter input::placeholder {
	color: oklch(54% 0.025 65);
}

.tournament-search input:focus-visible,
.tournament-search select:focus-visible,
.tournament-inline-filter input:focus-visible {
	outline: 3px solid var(--gold-soft);
	outline-offset: 3px;
}

.tournament-layout {
	display: grid;
	grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.archive-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 9px;
}

.tournament-archive {
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
}

.tournament-archive .archive-list {
	padding: 0 var(--space-md) var(--space-md);
}

.archive-card {
	display: block;
	padding: 14px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	transition:
		transform 160ms ease,
		border-color 160ms ease;
}

.archive-card:hover {
	transform: translateY(-2px);
	border-color: var(--border-strong);
}

.archive-card.is-selected {
	border-color: var(--border-strong);
	background: var(--surface-raised);
}

.archive-top,
.archive-bottom {
	display: flex;
	justify-content: space-between;
	gap: var(--space-sm);
	color: var(--muted);
	font-size: 11px;
}

.archive-card h2 {
	margin: var(--space-sm) 0 6px;
	font-size: 16px;
	letter-spacing: 0;
}

.archive-winner {
	color: var(--gold-soft);
	font-size: 13px;
	font-weight: 750;
}

.archive-bottom {
	margin-top: var(--space-md);
	padding-top: var(--space-sm);
	border-top: 1px solid var(--border);
}

.tournament-preview {
	position: sticky;
	top: 82px;
	min-height: 220px;
	padding: var(--space-xl);
	border: 1px solid var(--border);
	border-radius: 8px;
	background:
		radial-gradient(
			circle at 100% 0,
			color-mix(in oklch, var(--gold) 14%, transparent),
			transparent 42%
		),
		var(--surface);
}

.tournament-highlight {
	position: sticky;
	top: 82px;
}

.tournament-preview h2 {
	max-width: 18ch;
	margin: 13px 0 8px;
	font-family: var(--font-display);
	font-size: clamp(22px, 3vw, 30px);
	letter-spacing: 0;
	line-height: 1.18;
}

.tournament-preview > p {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
}

.preview-note {
	display: grid;
	gap: 3px;
	margin-top: var(--space-lg);
	padding: var(--space-md);
	border: 1px solid var(--border);
	background: var(--surface-raised);
}

.preview-note strong {
	color: var(--gold-soft);
	font-size: 13px;
}

.preview-note span {
	color: var(--muted);
	font-size: 12px;
}

.preview-action,
.error-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	margin-top: var(--space-lg);
	padding-inline: 17px;
	border-radius: 8px;
	background: var(--accent);
	color: var(--text);
	font-size: 13px;
	font-weight: 850;
}

.preview-action:hover,
.error-action:hover {
	background: var(--accent-hover);
}

.tournament-detail {
	overflow: hidden;
	margin-top: var(--space-lg);
}

.tournament-hero {
	padding: 18px;
	background: linear-gradient(135deg, var(--surface-raised), var(--surface) 62%);
}

.tournament-label {
	color: var(--gold-soft);
	font-size: 12px;
	font-weight: 800;
}

.tournament-hero h1 {
	margin: 6px 0 3px;
	font-family: var(--font-display);
	font-size: 28px;
	letter-spacing: 0;
}

.tournament-hero > p {
	margin: 0;
	color: var(--muted);
	font-size: 12px;
}

.podium {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-sm);
	margin-top: var(--space-lg);
}

.podium-item {
	display: grid;
	gap: 3px;
	padding: var(--space-md);
	border: 1px solid var(--border);
	background: var(--surface-soft);
}

.podium-item:first-child {
	border-color: var(--border-strong);
}

.podium-item span {
	color: var(--muted);
	font-size: 11px;
}

.podium-item strong {
	color: var(--gold-soft);
	font-size: 14px;
}

.podium-item strong i {
	display: inline-grid;
	width: 21px;
	height: 21px;
	margin-right: 7px;
	place-items: center;
	border: 1px solid var(--border-strong);
	border-radius: 50%;
	color: var(--gold-soft);
	font-size: 10px;
	font-style: normal;
}

.tournament-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-md);
	padding: 17px 18px 13px;
	border-bottom: 1px solid var(--border);
}

.tournament-section-head h2 {
	margin: 0;
	font-size: 15px;
}

.tournament-section-head span {
	color: var(--muted);
	font-size: 11px;
}

.tournament-result {
	padding: 14px 16px;
}

.table-wrap {
	overflow-x: auto;
}

table {
	width: 100%;
	min-width: 620px;
	border-collapse: collapse;
}

th,
td {
	padding: 9px 10px;
	border-bottom: 1px solid var(--border);
	text-align: left;
}

th:nth-child(n + 3),
td:nth-child(n + 3) {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

th {
	color: var(--muted);
	font-size: 11px;
	font-weight: 750;
}

td {
	font-size: 13px;
}

.bracket {
	display: grid;
	grid-auto-columns: minmax(220px, 1fr);
	grid-auto-flow: column;
	gap: var(--space-lg);
	overflow-x: auto;
	padding-bottom: var(--space-sm);
}

.round {
	display: grid;
	align-content: start;
	gap: var(--space-md);
}

.round-title {
	margin: 0;
	color: var(--muted);
	font-size: 12px;
	text-align: center;
}

.bracket-match {
	padding: var(--space-md);
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--surface-raised);
}

.bracket-player {
	display: flex;
	justify-content: space-between;
	gap: var(--space-sm);
	padding-block: 5px;
	font-size: 13px;
}

.bracket-player.is-winner {
	color: var(--gold-soft);
	font-weight: 750;
}

.bracket-replay,
.bracket-pending {
	display: block;
	margin-top: var(--space-sm);
	padding-top: var(--space-sm);
	border-top: 1px solid var(--border);
	color: var(--gold-soft);
	font-size: 11px;
	font-weight: 750;
}

.bracket-pending {
	color: var(--quiet);
}

.replay-section {
	margin-top: var(--space-xl);
	padding-top: var(--space-lg);
	border-top: 1px solid var(--border);
}

.tournament-replays {
	display: grid;
	margin-top: var(--space-md);
	border-top: 1px solid var(--border);
}

.tournament-replay {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) auto auto;
	align-items: center;
	gap: var(--space-md);
	min-height: 56px;
	padding: 9px 3px;
	border-bottom: 1px solid var(--border);
}

.tournament-replay:hover {
	background: var(--surface-raised);
}

.tournament-replay.is-result-only {
	color: var(--muted);
}

.tournament-replay.is-result-only:hover {
	background: transparent;
}

.replay-round,
.replay-result {
	color: var(--muted);
	font-size: 11px;
}

.replay-players {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
}

.replay-players > span {
	color: var(--quiet);
	font-size: 10px;
}

.replay-open {
	color: var(--gold-soft);
	font-size: 11px;
	font-weight: 800;
}

.replay-open.is-result-only {
	color: var(--quiet);
	font-weight: 700;
}

.error-main {
	display: grid;
	min-height: calc(100vh - 64px);
	place-items: center;
}

.error-panel {
	width: min(560px, 100%);
	padding: clamp(28px, 6vw, 52px);
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	text-align: center;
}

.error-code {
	color: var(--gold);
	font-size: 12px;
	font-weight: 850;
	letter-spacing: 0.16em;
}

.error-panel h1 {
	margin: 12px 0 0;
	font-family: var(--font-display);
	font-size: clamp(25px, 5vw, 36px);
	letter-spacing: 0;
}

.error-panel p {
	max-width: 46ch;
	margin: 12px auto 0;
	color: var(--muted);
	font-size: 14px;
}

@media (max-width: 900px) {
	.season-strip {
		grid-template-columns: repeat(2, 1fr);
	}

	.season-item:nth-child(2) {
		border-right: 0;
	}

	.season-item:nth-child(-n + 2) {
		border-bottom: 1px solid var(--border);
	}

	.home-main,
	.profile-summary,
	.tournament-layout {
		grid-template-columns: 1fr;
	}

	.summary-panel + .summary-panel {
		border-top: 1px solid var(--border);
		border-left: 0;
	}

	.tournament-preview {
		position: static;
	}

	.tournament-highlight {
		position: static;
	}

	.tournament-toolbar {
		align-items: stretch;
		flex-direction: column;
	}

	.tournament-search {
		grid-template-columns: 1fr 1fr auto;
	}

	.tournament-search button {
		grid-column: 1 / -1;
	}

	.tournament-inline-filter {
		flex-basis: auto;
	}

	.feature-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.profile-card {
		grid-template-columns: auto minmax(0, 1fr);
	}

	.profile-stats {
		grid-column: 1 / -1;
		margin-top: var(--space-sm);
		border-top: 1px solid var(--border);
	}

	.profile-stat {
		padding: var(--space-md) var(--space-md) 0;
		border-left: 1px solid var(--border);
	}

	.profile-stat:first-child {
		padding-left: 0;
		border-left: 0;
	}

	.history-row {
		grid-template-columns: 4px 54px minmax(130px, 1fr) minmax(100px, auto) auto;
	}

	.replay-link {
		display: none;
	}
}

@media (max-width: 620px) {
	.site-header {
		position: sticky;
	}

	.nav-inner {
		flex-wrap: wrap;
		height: auto;
		gap: var(--space-sm);
		padding: var(--space-sm) var(--space-lg) 0;
	}

	.brand {
		flex: 1;
		width: auto;
		margin: 0;
		font-size: 16px;
	}

	.primary-nav {
		order: 2;
		width: 100%;
		height: 44px;
	}

	.nav-inner > .nav-cta {
		order: 0;
		width: auto;
		min-height: 36px;
		margin: 0;
	}

	.nav-link {
		flex: 1;
		justify-content: center;
		padding-inline: var(--space-sm);
		font-size: 12px;
	}

	.content {
		padding-inline: 14px;
	}

	.hero-content {
		align-items: stretch;
		padding-block: 28px 24px;
		text-align: left;
	}

	.hero-actions,
	.context-cta,
	.tournament-head {
		align-items: stretch;
		flex-direction: column;
	}

	.search-page-layout {
		grid-template-columns: 1fr;
	}

	.search-guidance {
		position: static;
	}

	.home-hero h1 {
		font-size: 34px;
	}

	.hero-description {
		font-size: 14px;
	}

	.search-form {
		grid-template-columns: minmax(0, 1fr) 68px;
		height: 52px;
	}

	.search-form input {
		padding-inline: 11px;
		font-size: 14px;
	}

	.search-button {
		width: 68px;
		min-width: 0;
	}

	.search-guide {
		line-height: 1.55;
	}

	.search-suggestions {
		grid-template-columns: 1fr;
	}

	.player-result {
		grid-template-columns: 30px minmax(0, 1fr) auto;
	}

	.player-result-action {
		display: none;
	}

	.profile-tabs,
	.season-filter {
		padding-inline: 14px;
	}

	.history-controls {
		align-items: stretch;
		flex-direction: column;
		gap: 0;
	}

	.history-controls .profile-tabs {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
	}

	.history-controls .profile-tabs a {
		text-align: center;
	}

	.history-controls .season-filter {
		align-items: center;
		flex-direction: row;
	}

	.history-controls .season-filter label {
		flex: 1;
	}

	.history-controls .season-filter select {
		flex: 1;
	}

	.tournament-search {
		grid-template-columns: 1fr;
	}

	.home-content {
		padding-bottom: var(--space-3xl);
	}

	.season-item {
		padding: 13px 12px;
	}

	.feature-grid {
		grid-template-columns: 1fr;
	}

	.board-preview {
		aspect-ratio: 1.85 / 1;
	}

	.match-kicker {
		font-size: 12px;
	}

	.profile-topline {
		align-items: stretch;
		flex-direction: column;
	}

	.compact-search,
	.compact-results {
		width: 100%;
		max-width: none;
		margin: 0;
	}

	.profile-card {
		gap: 14px;
		padding: 16px;
	}

	.profile-stats {
		gap: 0;
		margin-top: 0;
	}

	.profile-stat {
		padding-inline: 10px;
	}

	.profile-stat strong {
		font-size: 17px;
	}

	.profile-stat span {
		font-size: 10px;
	}

	.profile-avatar {
		width: 58px;
		height: 58px;
	}

	.history-row {
		grid-template-columns: 4px minmax(0, 1fr) auto;
		gap: var(--space-md);
	}

	.history-row .mini-board {
		display: none;
	}

	.history-row .result-bar {
		grid-row: 1 / 3;
	}

	.history-meta {
		display: block;
		grid-column: 2 / 4;
		grid-row: 2;
		margin-top: -5px;
		padding-top: 7px;
		border-top: 1px solid var(--border);
		line-height: 1.5;
	}

	.tournament-replay {
		grid-template-columns: 36px minmax(0, 1fr) auto;
	}

	.replay-result {
		display: none;
	}

	.tournament-hero {
		padding: var(--space-lg);
	}

	.tournament-result {
		padding: 12px;
	}

	.tournament-section-head {
		align-items: start;
		flex-direction: column;
		gap: 3px;
	}

	.bracket {
		grid-auto-flow: row;
		grid-template-columns: 1fr;
		grid-auto-columns: auto;
		overflow-x: visible;
	}

	.round-title {
		text-align: left;
	}

	.podium {
		grid-template-columns: 1fr;
	}

	.archive-list {
		grid-template-columns: 1fr;
	}

	table,
	thead,
	tbody,
	th,
	td {
		display: block;
	}

	table {
		min-width: 0;
	}

	thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	tr {
		display: grid;
		grid-template-columns: 54px minmax(0, 1fr) auto;
		gap: 10px var(--space-md);
		padding: var(--space-md) 0;
		border-bottom: 1px solid var(--border);
	}

	td {
		display: grid;
		gap: 2px;
		padding: 0;
		border-bottom: 0;
		text-align: left;
	}

	td::before {
		color: var(--muted);
		font-size: 10px;
		font-weight: 750;
		content: attr(data-label);
	}

	td:nth-child(3),
	td:nth-child(6) {
		text-align: right;
	}

	td:nth-child(n + 4) {
		padding-top: var(--space-sm);
		border-top: 1px solid var(--border);
	}

	td:nth-child(4) {
		grid-column: 1;
	}

	td:nth-child(5) {
		grid-column: 2;
	}

	td:nth-child(6) {
		grid-column: 3;
	}

	.recent-list .recent-match:nth-child(n + 5) {
		display: none;
	}
}

@media (pointer: coarse) {
	.nav-link,
	.search-chip,
	.profile-tabs a,
	.period-tabs a,
	.load-more,
	.preview-action,
	.error-action {
		min-height: 44px;
	}
}

@media (max-width: 420px) {
	.home-hero h1 {
		font-size: 30px;
	}

	.section-head {
		align-items: start;
	}

	.section-caption {
		display: none;
	}

	.profile-stat {
		padding-top: 10px;
	}

	.archive-list {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
