/* Pinned: dark theme. The game sits inside the theme's light page column, so its background is painted out to
   the screen edges with a box-shadow (clip-path keeps it from spilling above/below), without widening the
   layout or causing sideways scroll. */
.st-tg-game {
    --tg-bg: #121615;
    --tg-panel: #181d1c;
    --tg-panel-2: #1d2322;
    --tg-line: #2a312f;
    --tg-text: #e8ece9;
    --tg-muted: #8d9692;
    --tg-dim: #5d6662;
    --tg-accent: #5ab8cd;   /* Singletracks brand blue */
    --tg-accent-dim: #2c5862;
    --tg-green: #3fb950;
    --tg-display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
    --tg-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    --tg-body: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;

    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 0 44px;
    background: var(--tg-bg);
    box-shadow: 0 0 0 100vmax var(--tg-bg);
    clip-path: inset(0 -100vmax);
    color: var(--tg-text);
    font-family: var(--tg-body);
    font-size: 16px;
    line-height: 1.45;
}
.st-tg-game *, .st-tg-game *::before, .st-tg-game *::after { box-sizing: border-box; }
.st-tg-game a { color: var(--tg-accent); }
.st-tg-game h1, .st-tg-game h2 { color: var(--tg-text); margin: 0; }

/* # # # Header */
.st-tg-game-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--tg-line); }
/* the theme gives every <header> article styling (style.css: max-width 800px, centered) */
.st-tg-game .st-tg-game-header { max-width: none; margin-left: 0; margin-right: 0; }
.st-tg-game-kicker { font-family: var(--tg-mono); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--tg-muted); }
.st-tg-game-kicker span { margin: 0 .35em; }
.st-tg-game-kicker #st-tg-game-date { margin: 0; color: var(--tg-accent); }
.st-tg-game .st-tg-game-kicker a { color: inherit; text-decoration: none; }
.st-tg-game .st-tg-game-kicker a:hover { color: var(--tg-accent); text-decoration: underline; }
.st-tg-game .st-tg-game-title { font-family: var(--tg-display); font-weight: 400; font-size: 84px; line-height: .9; letter-spacing: .01em; margin-top: 8px; color: var(--tg-text); }
.st-tg-game-stats { display: flex; gap: 32px; text-align: right; }
.st-tg-game-stat { display: flex; flex-direction: column; align-items: flex-end; }
.st-tg-game-stat-value { font-family: var(--tg-mono); font-weight: 700; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-tg-game-stat-label { font-family: var(--tg-mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--tg-muted); margin-top: 6px; }

.st-tg-game-message { padding: 60px 0; text-align: center; color: var(--tg-muted); font-family: var(--tg-mono); }
.st-tg-game-preview { margin-bottom: 20px; padding: 10px 14px; border: 1px solid var(--tg-accent-dim); border-radius: 6px; background: rgba(90, 184, 205, .08); color: var(--tg-accent); font-family: var(--tg-mono); font-size: 13px; }

/* # # # Panels */
/* grid: the photo and map panels share a row and stretch to the same height, so the map matches the photo */
.st-tg-game-play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "photo map" ". side" "report report"; gap: 20px 32px; align-items: stretch; }
.st-tg-game-panel { background: var(--tg-panel); border: 1px solid var(--tg-line); border-radius: 6px; overflow: hidden; }
.st-tg-game-photo-panel { grid-area: photo; display: flex; flex-direction: column; }
.st-tg-game-map-panel { grid-area: map; display: flex; flex-direction: column; }
.st-tg-game-side { grid-area: side; align-self: start; padding: 20px 24px; }
.st-tg-game-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--tg-line); }
.st-tg-game .st-tg-game-panel-head h2 { font-family: var(--tg-display); font-weight: 400; font-size: 32px; line-height: 1; letter-spacing: .02em; }
.st-tg-game-meta { font-family: var(--tg-mono); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--tg-muted); white-space: nowrap; }
.st-tg-game-panel-foot { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--tg-line); margin-top: auto; }

/* # # # Photo */
.st-tg-game-frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #0b0e0d; }
.st-tg-game-frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; max-width: none; }
/* zoom-out: the current image shrinks from its top-left corner into the wider frame */
#st-tg-game-img { transform-origin: 0 0; will-change: transform; z-index: 1; }
/* blurred stand-in for the wider view while it loads */
.st-tg-game-backdrop { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(16px) brightness(.6); opacity: 0; transition: opacity .2s; }
.st-tg-game-backdrop.on { opacity: 1; }
.st-tg-game-img-next { z-index: 2; opacity: 0; transition: opacity .25s; }
.st-tg-game-img-next.in { opacity: 1; }
.st-tg-game-badge { position: absolute; top: 16px; left: 16px; z-index: 3; padding: 5px 12px; border-radius: 4px; background: rgba(18, 22, 21, .85); color: var(--tg-text); font-family: var(--tg-mono); font-size: 14px; }

.st-tg-game-dots { display: flex; gap: 6px; flex: none; }
.st-tg-game-dots i { display: block; width: 44px; height: 8px; border-radius: 4px; background: var(--tg-line); }
.st-tg-game-dots i.on { background: var(--tg-accent); }
.st-tg-game-stage { flex: 1; color: var(--tg-muted); font-size: 15px; }
/* last row of the play grid, under both panels (and under the results once they show); one cell, links stacked */
.st-tg-game-links { grid-area: report; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.st-tg-game .st-tg-game-report { color: var(--tg-dim); font-size: 13px; text-decoration: underline; }
.st-tg-game .st-tg-game-report:hover { color: var(--tg-muted); }
.st-tg-game-howto summary { cursor: pointer; list-style: none; }
.st-tg-game-howto summary::-webkit-details-marker { display: none; }
.st-tg-game-howto ul { margin: 8px 0 10px 18px; padding: 0; max-width: 640px; color: var(--tg-muted); font-size: 14px; line-height: 1.5; }
.st-tg-game-howto li { margin: 0 0 4px; list-style: disc; }

/* # # # Map */
.st-tg-game-map-wrap { position: relative; flex: 1; min-height: 0; }
.st-tg-game-map { position: absolute; inset: 0; background: #1b2120; cursor: crosshair; }
.st-tg-game-map-hint { position: absolute; left: 16px; bottom: 16px; z-index: 500; padding: 5px 12px; border-radius: 4px; background: rgba(18, 22, 21, .9); color: var(--tg-text); font-family: var(--tg-mono); font-size: 13px; pointer-events: none; }
.st-tg-game-map-hint span { margin: 0 .3em; color: var(--tg-muted); }
.st-tg-game-foot-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-tg-game-pin { font-family: var(--tg-mono); font-size: 15px; color: var(--tg-muted); }
/* phones only: stands in for the hidden map heading */
.st-tg-game-max-foot { display: none; }
.st-tg-game-pin-icon span { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--tg-accent); border: 3px solid #121615; box-shadow: 0 0 0 2px var(--tg-accent), 0 2px 8px rgba(0, 0, 0, .6); }

/* Leaflet controls in the dark theme, zoom buttons top right as in the design */
.st-tg-game .leaflet-bar { border: 0; box-shadow: none; }
.st-tg-game .leaflet-bar a { width: 44px; height: 44px; line-height: 42px; margin-bottom: 8px; background: var(--tg-panel); color: var(--tg-text); border: 1px solid var(--tg-line); border-radius: 6px; font-size: 22px; }
.st-tg-game .leaflet-bar a:hover { background: var(--tg-panel-2); color: var(--tg-text); }
.st-tg-game .leaflet-top .leaflet-control { margin: 16px 16px 0 0; }
.st-tg-game .leaflet-control-attribution { background: rgba(18, 22, 21, .75); color: var(--tg-dim); font-size: 10px; }
.st-tg-game .leaflet-control-attribution a { color: var(--tg-muted); }
.st-tg-game .leaflet-tooltip { background: var(--tg-panel); color: var(--tg-text); border-color: var(--tg-line); font-family: var(--tg-body); }

/* # # # Buttons */
.st-tg-game-btn { flex: none; padding: 11px 22px; border: 1px solid var(--tg-line); border-radius: 6px; background: var(--tg-panel-2); color: var(--tg-text); font-family: var(--tg-body); font-size: 17px; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s; }
.st-tg-game-btn:hover:not(:disabled) { border-color: #3c4542; background: #232a28; }
.st-tg-game-btn:disabled { cursor: default; }
.st-tg-game-primary { background: var(--tg-accent); border-color: var(--tg-accent); color: #0b1d22; }
.st-tg-game-primary:hover:not(:disabled) { background: #7cc8d9; border-color: #7cc8d9; }
.st-tg-game-primary:disabled { background: var(--tg-accent-dim); border-color: var(--tg-accent-dim); color: #9cc3cc; opacity: .9; }
.st-tg-game-link { border: 0; background: none; color: var(--tg-muted); text-decoration: underline; font-weight: 400; padding-left: 0; }
.st-tg-game-link:hover:not(:disabled) { background: none; color: var(--tg-text); }

/* # # # Result and trail-name bonus */
.st-tg-game-score { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.st-tg-game-score-pts { font-family: var(--tg-mono); font-weight: 700; font-size: 40px; line-height: 1; color: var(--tg-accent); }
.st-tg-game-score-lbl { font-family: var(--tg-mono); font-size: 14px; color: var(--tg-muted); }
.st-tg-game-result p { margin: 0 0 12px; }
.st-tg-game-bonus-result { font-family: var(--tg-mono); font-size: 14px; color: var(--tg-muted); }
.st-tg-game-bonus-result.hit { color: var(--tg-green); }
.st-tg-game-answer { font-family: var(--tg-display); font-size: 34px; line-height: 1.05; letter-spacing: .02em; }
.st-tg-game-answer a { color: var(--tg-text); text-decoration: none; }
.st-tg-game-answer a:hover { color: var(--tg-accent); }
.st-tg-game-place { display: block; margin-top: 4px; font-family: var(--tg-body); font-size: 15px; letter-spacing: 0; color: var(--tg-muted); }
.st-tg-game-credit { color: var(--tg-dim); font-size: 14px; }
.st-tg-game-result .st-tg-game-primary { width: 100%; margin-top: 6px; }

.st-tg-game-bonus { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.st-tg-game-bonus-q { margin: 0 0 4px; font-weight: 600; }
.st-tg-game-choice { text-align: left; font-weight: 500; font-size: 16px; }
.st-tg-game-choice:hover:not(:disabled) { border-color: var(--tg-accent); }

/* # # # End screen and leaderboard */
.st-tg-game-summary { max-width: 720px; margin: 0 auto; text-align: center; }
.st-tg-game .st-tg-game-final { font-family: var(--tg-mono); font-weight: 700; font-size: 64px; line-height: 1.1; margin: 8px 0 6px; }
.st-tg-game-squares { font-size: 30px; letter-spacing: 6px; margin: 0 0 22px; }
.st-tg-game-table { width: 100%; margin: 0 auto 20px; border-collapse: collapse; text-align: left; background: var(--tg-panel); border: 1px solid var(--tg-line); border-radius: 6px; overflow: hidden; }
.st-tg-game-table td, .st-tg-game-table th { padding: 12px 16px; border-bottom: 1px solid var(--tg-line); }
.st-tg-game-table tr:last-child td { border-bottom: 0; }
.st-tg-game-table td:nth-child(n+3) { text-align: right; white-space: nowrap; font-family: var(--tg-mono); font-variant-numeric: tabular-nums; }
.st-tg-game-table td:first-child { font-family: var(--tg-mono); color: var(--tg-muted); width: 3em; }
.st-tg-game-table a { color: var(--tg-text); text-decoration: none; }
.st-tg-game-table a:hover { color: var(--tg-accent); }
.st-tg-game-summary .st-tg-game-primary { width: 100%; max-width: 360px; }
.st-tg-game-summary .st-tg-game-practice { width: 100%; max-width: 360px; margin-top: 6px; }
.st-tg-game .st-tg-game-next a { color: var(--tg-accent); }
.st-tg-game-share { display: block; width: 100%; max-width: 360px; height: 120px; margin: 12px auto 0; background: var(--tg-panel); color: var(--tg-text); border: 1px solid var(--tg-line); border-radius: 6px; padding: 10px; font-family: var(--tg-mono); font-size: 13px; }
.st-tg-game-next { color: var(--tg-muted); margin-top: 14px; font-size: 15px; }

.st-tg-game-leaderboard { margin-top: 40px; }
.st-tg-game-tabs { display: inline-flex; margin-bottom: 14px; border: 1px solid var(--tg-line); border-radius: 6px; overflow: hidden; }
.st-tg-game-tab { padding: 8px 22px; border: 0; background: var(--tg-panel); color: var(--tg-muted); font-family: var(--tg-mono); font-size: 13px; letter-spacing: .15em; text-transform: uppercase; cursor: pointer; }
.st-tg-game-tab.active { background: var(--tg-accent); color: #0b1d22; }
.st-tg-game-board th { font-family: var(--tg-mono); font-size: 12px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; color: var(--tg-muted); background: var(--tg-panel-2); }
.st-tg-game-board th:nth-child(n+3) { text-align: right; }
.st-tg-game-me td { background: rgba(90, 184, 205, .1); color: var(--tg-accent); font-weight: 700; }
.st-tg-game-gap td { text-align: center; color: var(--tg-dim); }

.st-tg-game-account { margin-top: 28px; text-align: center; color: var(--tg-muted); font-size: 14px; }

/* # # # Phones */
@media (max-width: 800px) {
    .st-tg-game { padding: 18px 0 32px; font-size: 15px; }
    .st-tg-game-header { flex-direction: column; align-items: flex-start; gap: 14px; padding-bottom: 16px; margin-bottom: 18px; }
    .st-tg-game-kicker { font-size: 11px; letter-spacing: .16em; }
    .st-tg-game .st-tg-game-title { font-size: 60px; }
    .st-tg-game-stats { gap: 28px; }
    .st-tg-game-stat { align-items: flex-start; }
    .st-tg-game-stat-value { font-size: 26px; }
    .st-tg-game-play { grid-template-columns: minmax(0, 1fr); grid-template-areas: "photo" "map" "side" "report"; gap: 16px; }
    .st-tg-game-panel-head, .st-tg-game-panel-foot { padding: 12px 16px; }
    .st-tg-game .st-tg-game-panel-head h2 { font-size: 26px; }
    .st-tg-game-meta { font-size: 11px; letter-spacing: .14em; }
    /* Photo, map and Lock in guess on one screen: the zoom bar moves onto the photo, the map heading is
       dropped (its Max moves to the footer), and the map fills what's left of the screen:
       screen - navbar (84px) - photo (4:3 of the width less ~30px page padding) - map footer and gaps (~100px) */
    .st-tg-game-photo-panel { position: relative; }
    .st-tg-game-photo-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; gap: 10px; padding: 28px 12px 10px; border-top: 0; background: linear-gradient(rgba(12, 15, 14, 0), rgba(12, 15, 14, .85)); }
    .st-tg-game-photo-bar .st-tg-game-btn { padding: 7px 14px; font-size: 15px; background: rgba(18, 22, 21, .85); }
    .st-tg-game-stage { color: var(--tg-text); text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
    .st-tg-game-map-panel .st-tg-game-panel-head { display: none; }
    .st-tg-game-max-foot { display: block; font-size: 11px; }
    .st-tg-game-pin { font-size: 13px; }
    .st-tg-game-map-wrap { flex: none; height: 300px; height: clamp(160px, calc(100svh - 84px - (100vw - 30px) * .75 - 100px), 360px); }
    .st-tg-game-dots i { width: 28px; }
    .st-tg-game-stage { font-size: 13px; }
    .st-tg-game-btn { padding: 10px 16px; font-size: 16px; }
    .st-tg-game-side { padding: 16px; }
    .st-tg-game .st-tg-game-final { font-size: 48px; }
}
