:root {
	--bg: #f5f3ee; --card: #ffffff; --ink: #1d2433; --muted: #6b7280; --line: #e3e0d8;
	--accent: #b5482a; --accent-ink: #ffffff; --shape: #2c3e50; --good: #2e8b57; --warm: #e0a526; --cold: #c9ccd3;
	--map-fill: #ece8de; --map-line: #c9c3b4; --map-hit: #2e8b57; --map-guess: #b5482a;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #15181e; --card: #1f242c; --ink: #e8e6e1; --muted: #9aa0ab; --line: #2f3540;
		--accent: #e07a5f; --accent-ink: #15181e; --shape: #dfe3ea; --cold: #3a404b;
		--map-fill: #262c35; --map-line: #3c4450; --map-hit: #4cc38a; --map-guess: #e07a5f;
	}
}
:root[data-theme="dark"] {
	--bg: #15181e; --card: #1f242c; --ink: #e8e6e1; --muted: #9aa0ab; --line: #2f3540;
	--accent: #e07a5f; --accent-ink: #15181e; --shape: #dfe3ea; --cold: #3a404b;
	--map-fill: #262c35; --map-line: #3c4450; --map-hit: #4cc38a; --map-guess: #e07a5f;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
.g-wrap { max-width: 520px; margin: 0 auto; padding: 16px; }
.g-head { text-align: center; }
.g-head h1 { margin: 6px 0 2px; font-size: 34px; letter-spacing: .02em; color: var(--accent); }
.g-sub { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.g-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.g-tabs button { flex: 1; max-width: 220px; padding: 8px 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; font-size: 14px; cursor: pointer; }
.g-tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.g-tabs button .g-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-left: 6px; vertical-align: 1px; }
.g-board { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.g-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.g-practice-toggle { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; }
.g-shape-box { display: flex; justify-content: center; padding: 8px 0 12px; }
.g-shape { width: 100%; max-width: 240px; height: auto; }
.g-shape path { fill: var(--shape); fill-rule: evenodd; }
.g-form { display: flex; gap: 8px; }
.g-input-wrap { position: relative; flex: 1; }
.g-input { width: 100%; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.g-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.g-go { padding: 0 16px; font-size: 15px; font-weight: 700; border: none; border-radius: 8px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.g-go:disabled, .g-input:disabled { opacity: .5; cursor: default; }
.g-suggest { position: absolute; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 8px; max-height: 220px; overflow-y: auto; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.g-suggest:empty { display: none; }
.g-suggest li { padding: 8px 12px; cursor: pointer; font-size: 15px; }
.g-suggest li.on, .g-suggest li:hover { background: var(--bg); }
.g-msg { min-height: 20px; margin: 8px 0 4px; font-size: 14px; color: var(--accent); text-align: center; }
.g-guesses { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.g-guesses li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
.g-guesses li.empty { color: transparent; min-height: 38px; }
.g-guesses li.hit { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); font-weight: 700; }
.g-gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-gdist { color: var(--muted); font-variant-numeric: tabular-nums; }
.g-garrow { width: 22px; height: 22px; display: inline-block; }
.g-garrow svg { width: 22px; height: 22px; fill: var(--ink); }
.g-gpct { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.g-end { margin-top: 14px; text-align: center; }
.g-result { font-size: 17px; margin: 4px 0 10px; }
.g-map { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto 10px; }
.g-map .base { fill: var(--map-fill); stroke: var(--map-line); stroke-width: 1.2; }
.g-map .hit { fill: var(--map-hit); stroke: var(--map-hit); }
.g-map .guess { fill: var(--map-guess); opacity: .55; }
.g-map .pin { stroke: var(--card); stroke-width: 3; }
.g-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.g-actions button { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; }
.g-share { background: var(--accent); color: var(--accent-ink); }
.g-next { background: transparent; color: var(--accent); }
.g-next:empty { display: none; }
.g-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 12px; color: var(--muted); }
.g-stats b { display: block; font-size: 20px; color: var(--ink); }
.g-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0 4px; }
@media (max-width: 400px) { .g-guesses li { grid-template-columns: 1fr auto auto; } .g-gdist { display: none; } }

/* links between the games (both pages) */
.p-games { display: flex; gap: 14px; justify-content: center; font-size: 13px; margin-top: 4px; }
.p-games a { color: var(--muted); text-decoration: none; padding-bottom: 2px; }
.p-games a.on { color: var(--accent); border-bottom: 2px solid var(--accent); font-weight: 700; }
