:root {
	--bg: #f6f1e7;
	--panel: #fffdf8;
	--ink: #2b2620;
	--muted: #6f6556;
	--line: #e3d9c6;
	--accent: #8a5a2b;
	--accent-soft: #f0e3cf;
	--code: #efe7d8;
	--shadow: 0 10px 30px rgba(43, 38, 32, 0.15);
	--bar-h: 64px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #1b1916;
		--panel: #24211d;
		--ink: #ece5d8;
		--muted: #a89f90;
		--line: #3a352e;
		--accent: #d9a46a;
		--accent-soft: #3a2f22;
		--code: #2e2a24;
		--shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	}
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 16px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- header + game switcher ------------------------------------------- */

header.site { text-align: center; padding: 36px 0 20px; }
header.site h1 { margin: 0 0 20px; font-size: 2.6rem; line-height: 1.1; letter-spacing: -0.01em; }

.games { display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 900px; margin: 0 auto; padding: 0 8px; }
.game-strip {
	position: relative; display: flex; gap: 10px; min-width: 0;
	overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 4px 2px;
}
.game-strip::-webkit-scrollbar { display: none; }
.game {
	flex: none; scroll-snap-align: center;
	display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 20px;
	border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
	color: var(--muted); font-weight: 650; text-decoration: none; white-space: nowrap;
	transition: color .15s, border-color .15s, background .15s;
}
.game:hover { color: var(--ink); border-color: var(--muted); }
.game.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.game img { display: block; height: 36px; width: auto; }
.game:not(.active) img { opacity: .7; }
.scroll {
	flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
	border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
}
.scroll[hidden] { display: none; }
.scroll:hover { background: var(--accent-soft); }
.scroll:disabled { opacity: .25; cursor: default; background: none; }
.scroll svg { width: 28px; height: 28px; }

/* --- sticky "current update" bar with the list of all updates ---------- */

.notebar {
	position: sticky; top: 0; z-index: 10;
	background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
	margin-bottom: 24px;
}
.picker { position: relative; }
.picker > summary {
	display: flex; align-items: center; gap: 14px; padding: 10px 4px; min-height: 64px;
	list-style: none; cursor: pointer; user-select: none; border-radius: 10px;
}
.picker > summary::-webkit-details-marker { display: none; }
.picker > summary:hover .icon, .picker[open] > summary .icon { color: var(--accent); }
.picker > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.current { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.current-title { font-weight: 600; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-date { color: var(--muted); font-size: 0.85rem; }
.count { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.chevron { color: var(--muted); transition: transform .2s; }
.picker[open] .chevron { transform: rotate(180deg); }

.picker-list {
	position: absolute; left: 8px; right: 8px; top: calc(100% + 1px);
	background: var(--panel); border: 1px solid var(--line); border-radius: 0 0 12px 12px; box-shadow: var(--shadow);
	max-height: min(60vh, 480px); overflow-y: auto; overscroll-behavior: contain;
}
.picker-list ol { position: relative; list-style: none; margin: 0; padding: 6px; }
.picker-list a { display: block; padding: 8px 12px 8px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; line-height: 1.35; border-left: 3px solid transparent; }
.picker-list a:hover { background: var(--accent-soft); }
.picker-list a[aria-current] { border-left-color: var(--accent); background: var(--accent-soft); }
.picker-list time { display: block; color: var(--muted); font-size: 0.82rem; }

/* --- notes -------------------------------------------------------------- */

main { padding-bottom: 64px; }
.note {
	background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px 32px; margin-bottom: 28px;
	scroll-margin-top: calc(var(--bar-h) + 16px);
}
.note > header {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: center;
	border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 12px;
}
.note > header > :not(.copy-link) { grid-column: 1; }
.copy-link {
	grid-column: 2; grid-row: 1 / span 2;
	display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 40px;
	border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
	color: var(--muted); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; white-space: nowrap;
	transition: color .15s, border-color .15s, background .15s;
}
.copy-link svg { width: 18px; height: 18px; }
.copy-link:hover { color: var(--accent); border-color: var(--accent); }
.copy-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-link.done { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.note > header h2 { margin: 0; font-size: 1.7rem; line-height: 1.2; }
.note > header h2 a { color: inherit; text-decoration: none; }
.note > header time { color: var(--muted); font-size: 0.9rem; }

.content h1, .content h2, .content h3 { line-height: 1.25; margin: 1.6em 0 0.5em; }
.content h1 { font-size: 1.5rem; } .content h2 { font-size: 1.3rem; } .content h3 { font-size: 1.1rem; }
.content > :first-child { margin-top: 0; }
.content a { color: var(--accent); }
.content img, .content video { display: block; max-width: 100%; height: auto; border-radius: 8px; margin: 16px 0; }
.content video { width: 100%; background: #000; }
.content iframe { max-width: 100%; border: 0; border-radius: 8px; }
.content ul, .content ol { padding-left: 1.4em; }
.content li { margin: 0.2em 0; }
.content blockquote { margin: 16px 0; padding: 8px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.content code { background: var(--code); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
.content pre { background: var(--code); padding: 14px; border-radius: 8px; overflow-x: auto; }
.content pre code { background: none; padding: 0; }
.content table { border-collapse: collapse; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--line); padding: 6px 10px; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

@media (max-width: 760px) {
	body { font-size: 16px; }
	header.site { padding: 24px 0 14px; }
	header.site h1 { font-size: 2rem; margin-bottom: 14px; }
	.games { gap: 2px; padding: 0 4px; }
	.game { min-height: 46px; padding: 6px 14px; font-size: 0.92rem; }
	.game img { height: 30px; }
	.scroll { width: 34px; }
	.count { display: none; }
	.picker > summary { min-height: 58px; padding: 8px 0; }
	.wrap-narrow { padding: 0 12px; }
	.note { padding: 20px 18px; }
	.note > header h2 { font-size: 1.45rem; }
	.copy-link { padding: 8px 10px; }
}
@media (max-width: 420px) {
	/* Icon only on small phones, so long titles keep their room. */
	.copy-link .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.copy-link { width: 40px; justify-content: center; padding: 0; }
}
