:root {
	--sudoku-border: #333;
	--sudoku-given-bg: #eef1f5;
	--sudoku-peer-bg: #e8f0fe;
	--sudoku-selected-bg: #bfdbfe;
	--sudoku-same-bg: #d7e9ff;
	--sudoku-conflict-bg: #fde2e2;
	--sudoku-conflict-color: #c0392b;
}

body {
	background-color: #eef0f3;
}

.game-card {
	background-color: #fff;
}

.brand-icon {
	width: 56px;
	height: 56px;
	object-fit: contain;
}

.stats-row {
	font-size: 0.95rem;
}
.stats-row .stat-box {
	min-width: 84px;
	text-align: center;
}
.stats-row .stat-label {
	display: block;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6c757d;
	font-style: normal;
}
.stats-row .stat-value {
	font-size: 1.15rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------- */
/* Spielbrett                                            */
/* --------------------------------------------------- */

.sboard {
	width: min(94vw, 440px);
	aspect-ratio: 1 / 1;
	display: grid;
	grid-template-columns: repeat(9, 1fr);
	grid-template-rows: repeat(9, 1fr);
	border: 3px solid var(--sudoku-border);
	border-radius: 6px;
	overflow: hidden;
	background-color: #fff;
	touch-action: manipulation;
	user-select: none;
	box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

@media (min-width: 576px) {
	.sboard { width: 440px; }
}
@media (min-width: 992px) {
	.sboard { width: 486px; }
}

.scell {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #d5d9de;
	cursor: pointer;
	font-size: clamp(15px, 4.6vw, 26px);
	color: #1c2733;
	background-color: #fff;
}

.scell.br { border-right: 2px solid var(--sudoku-border); }
.scell.bb { border-bottom: 2px solid var(--sudoku-border); }

.scell.given {
	background-color: var(--sudoku-given-bg);
	font-weight: 700;
	color: #101820;
	cursor: default;
}

.scell.peer { background-color: var(--sudoku-peer-bg); }
.scell.same-number { background-color: var(--sudoku-same-bg); }
.scell.selected { background-color: var(--sudoku-selected-bg); }

.scell.conflict {
	background-color: var(--sudoku-conflict-bg);
	color: var(--sudoku-conflict-color);
}
.scell.conflict.selected { background-color: #f6b8b8; }

.scell .sval {
	line-height: 1;
}

.scell .snotes {
	position: absolute;
	inset: 0;
	display: none;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(3, 1fr);
}
.scell .snote {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: clamp(7px, 2vw, 11px);
	color: #5a6472;
	line-height: 1;
}

/* --------------------------------------------------- */
/* Nummernblock                                          */
/* --------------------------------------------------- */

.numpad {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 6px;
	max-width: 420px;
	width: 100%;
}
.numpad button {
	min-height: 46px;
	font-size: 1.15rem;
	font-weight: 600;
}
.numpad button#btn-erase {
	font-size: 1rem;
}

#btn-notes.active {
	background-color: #6f42c1;
	border-color: #6f42c1;
	color: #fff;
}

/* --------------------------------------------------- */
/* Verlauf                                               */
/* --------------------------------------------------- */

#history-table td, #history-table th {
	vertical-align: middle;
}

/* --------------------------------------------------- */
/* Footer (bestehend)                                    */
/* --------------------------------------------------- */

.footer {
	background-color: #777;
	color: #efefef;
	padding-top: 12px;
}
.footer a {
	background-color: #777;
	color: #efefef;
}

@media (max-width: 400px) {
	.numpad { max-width: 320px; }
	.numpad button { min-height: 42px; font-size: 1rem; }
}

/* --------------------------------------------------- */
/* Navigation, Footer, Ratgeberseiten                    */
/* --------------------------------------------------- */

.site-footer {
	background-color: #2b3035;
	color: #d6d9dc;
	margin-top: 1rem;
}
.site-footer a { color: #fff; }
.site-footer hr { border-color: #6c757d; }

.guide-card {
	display: block;
	height: 100%;
	padding: 1.1rem 1.2rem;
	background: #fff;
	border-radius: 1rem;
	box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
	color: inherit;
	text-decoration: none;
	border-top: 4px solid #0d6efd;
	transition: transform .15s ease, box-shadow .15s ease;
}
.guide-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.1); }
.guide-card .guide-title { display: block; font-weight: 600; margin-bottom: .35rem; color: #0d6efd; }
.guide-card .guide-text { display: block; font-size: .92rem; color: #495057; }

.article { max-width: 920px; margin-left: auto; margin-right: auto; line-height: 1.65; }
.article h2 { margin-top: 2.2rem; margin-bottom: .9rem; scroll-margin-top: 1rem; }
.article .lead { font-size: 1.12rem; }
.article .toc { background: #f4f6f9; border-radius: .75rem; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.article .callout { background: #fff8e1; border-left: 4px solid #ffc107; border-radius: .5rem; padding: 1rem 1.25rem; margin: 1.5rem 0; }

/* Beispielgitter */
.mini-figure { margin: 0 auto; max-width: 300px; }
.mini-figure figcaption { font-size: .85rem; color: #6c757d; text-align: center; margin-top: .5rem; }
.mini-grid {
	display: grid;
	grid-template-columns: repeat(9, 1fr);
	aspect-ratio: 1 / 1;
	grid-template-rows: repeat(9, 1fr);
	border: 2px solid var(--sudoku-border);
	background: #fff;
}
.mini-grid .mcell {
	display: flex; align-items: center; justify-content: center;
	border: 1px solid #d5d9de;
	font-size: clamp(11px, 3.4vw, 17px);
	aspect-ratio: 1 / 1;
	min-width: 0;
	font-weight: 600;
	color: #1c2733;
}
.mini-grid .mcell.br { border-right: 2px solid var(--sudoku-border); }
.mini-grid .mcell.bb { border-bottom: 2px solid var(--sudoku-border); }
.mini-grid .mcell.mark { background: var(--sudoku-selected-bg); }
.mini-grid .mcell.target { background: #c7f0d2; color: #146c2e; font-weight: 700; }
.mini-grid .mcell.shade { background: repeating-linear-gradient(45deg, #eceff3, #eceff3 3px, #dfe3e8 3px, #dfe3e8 6px); }

/* Kandidatenzeile */
.cand-row .ccell, .cand-row { box-sizing: border-box; }
.mini-figure:has(.cand-row) { max-width: 520px; margin: 1.25rem auto; }
.cand-row {
	display: grid;
	grid-template-columns: repeat(9, 1fr);
	border: 2px solid var(--sudoku-border);
	background: #fff;
}
.cand-row .ccell {
	aspect-ratio: 1 / 1;
	border-right: 1px solid #d5d9de;
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: clamp(13px, 3.6vw, 22px);
}
.cand-row .ccell:last-child { border-right: 0; }
.cand-row .ccell.br { border-right: 2px solid var(--sudoku-border); }
.cand-row .ccell.given { background: var(--sudoku-given-bg); }
.cand-row .ccell.hl { background: #c7f0d2; }
.cand-row .cands {
	display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%;
}
.cand-row .cands span {
	display: flex; align-items: center; justify-content: center;
	font-size: clamp(7px, 1.8vw, 11px); font-weight: 500; color: #3d4a59; line-height: 1;
}
.cand-row .cands span.struck { color: #c0392b; text-decoration: line-through; opacity: .75; }

/* Zeitleiste & Fakten */
.timeline { border-left: 3px solid #0d6efd; margin: 2rem 0 1rem .5rem; padding-left: 1.25rem; }
.tl-item { position: relative; margin-bottom: 1.5rem; }
.tl-item::before {
	content: ""; position: absolute; left: -1.25rem; top: .35rem;
	width: 13px; height: 13px; margin-left: -8px;
	border-radius: 50%; background: #fff; border: 3px solid #0d6efd;
}
.tl-year { font-weight: 700; color: #0d6efd; }
.tl-item h2 { margin-top: .2rem; }
.fact-box { background: #f4f6f9; border-radius: .75rem; padding: 1rem; height: 100%; }
.fact-box .fact-value { display: block; font-size: 1.35rem; font-weight: 700; color: #0d6efd; }
.fact-box .fact-label { display: block; font-size: .88rem; color: #495057; }
