/* Gra „Krajopis dnia” (/gra/, site/gra.js, dane z build/gra.py) - dokłada się do styles.css (barwy, pismo, nagłówek, stopka, .infilm) */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* układ: kontur po lewej (przyklejony), gra po prawej; na telefonie jedno pod drugim */
.gr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); grid-template-areas: "fig head" "fig main"; grid-template-rows: auto 1fr;
  column-gap: 56px; max-width: 1380px; margin: 0 auto; padding: 36px 24px 88px; }
.gr-head { grid-area: head; padding-top: 6px; }
.gr-main { grid-area: main; display: flex; flex-direction: column; }
.gr-h { margin: 0; font-stretch: 118%; font-weight: 800; font-size: clamp(38px, 4.2vw, 62px); line-height: 0.95; letter-spacing: -0.018em; }
.gr-meta { margin: 12px 0 0; font-stretch: 88%; font-weight: 620; font-size: 16px; color: var(--signal); }
.gr-lead { margin: 12px 0 0; max-width: 34em; font-size: 17px; line-height: 1.45; text-wrap: pretty; }
.gr-sh { margin: 0 0 12px; font-stretch: 108%; font-weight: 740; font-size: 19px; line-height: 1.2; }
.gr-err { grid-column: 1 / -1; margin: 20px 0 0; }

/* ---------- kontur ---------- */
.gr-fig { grid-area: fig; position: sticky; top: calc(var(--top) + 24px); align-self: start; margin: 0;
  height: min(calc(100vh - var(--top) - 60px), 780px); height: min(calc(100dvh - var(--top) - 60px), 780px); min-height: 420px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--deep); overflow: hidden; }
.gr-fig-in { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 34px 26px 44px; }
.gr-fig-in svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gr-k { fill: var(--bone); stroke: var(--bone); stroke-width: 1.4px; vector-effect: non-scaling-stroke; stroke-linejoin: round; fill-rule: evenodd;
  transition: fill 0.6s ease, stroke 0.6s ease; }
.gr-k.is-draw { fill-opacity: 0; stroke: var(--signal); stroke-width: 2.2px; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: gr-draw 1.1s cubic-bezier(0.5, 0, 0.3, 1) 0.15s forwards, gr-fill 0.5s ease 1.15s forwards; }
@keyframes gr-draw { to { stroke-dashoffset: 0; } }
@keyframes gr-fill { to { fill-opacity: 1; stroke: var(--bone); stroke-width: 1.4px; } }
.gr-fig.is-hit .gr-k { fill: var(--signal); stroke: var(--signal); }
.gr-fig.is-shake .gr-fig-in { animation: gr-shake 0.36s ease; }
@keyframes gr-shake { 25% { transform: translateX(-7px); } 60% { transform: translateX(5px); } 85% { transform: translateX(-2px); } }
.gr-fig-t { position: absolute; top: 14px; left: 16px; right: 16px; margin: 0; font-stretch: 88%; font-weight: 620; font-size: 15px; line-height: 1.3; color: var(--line); }
.gr-fig.is-hit .gr-fig-t, .gr-fig.is-miss .gr-fig-t { color: var(--bone); }
.gr-scale { position: absolute; left: 16px; bottom: 14px; display: flex; flex-direction: column; gap: 4px; font-stretch: 85%; font-weight: 620; font-size: 13px; color: var(--line); }
.gr-scale[hidden] { display: none; }
.gr-scale i { display: block; height: 6px; border: 1.5px solid var(--line); border-top: 0; }
.gr-load { margin: 0; font-stretch: 88%; font-size: 15px; color: var(--line); }
.gr-load-err { max-width: 300px; text-align: center; color: var(--bone); }
.gr-load-err p { margin: 0 0 10px; }

/* ---------- wskazówki ---------- */
.gr-hints { margin-top: 28px; }
.gr-hs { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.gr-hint { position: relative; padding: 2px 0 2px 16px; border-left: 3px solid var(--c, var(--line)); scroll-margin-top: calc(var(--top) + 14px); }
.gr-end { scroll-margin-top: calc(var(--top) + 10px); }
.gr-hint p { margin: 0; }
.gr-h-l { display: flex; align-items: baseline; gap: 8px; font-stretch: 88%; font-size: 14.5px; line-height: 1.3; color: var(--line); }
.gr-h-l b { font-weight: 700; color: var(--bone); }
.gr-h-n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--line); }
.gr-h-v { margin-top: 3px !important; font-stretch: 112%; font-weight: 760; font-size: 27px; line-height: 1.1; letter-spacing: -0.005em; font-variant-numeric: tabular-nums; }
.gr-h-t { margin-top: 5px !important; max-width: 36em; font-size: 15.5px; line-height: 1.45; text-wrap: pretty; }
.gr-h-z { margin-top: 5px !important; font-stretch: 85%; font-size: 13px; line-height: 1.35; color: var(--line); }
.gr-h-go { display: inline-block; margin-top: 6px; font-weight: 650; font-size: 15px; }
.gr-hint-s { padding-top: 0; padding-bottom: 0; }
.gr-hint-s .gr-h-l { flex-wrap: wrap; column-gap: 8px; }
.gr-h-sv { font-stretch: 100%; font-weight: 700; font-size: 16px; color: var(--bone); }
.gr-hs { gap: 10px; }
/* nagłówek „Wskazówki” widać dopiero na końcu gry (w trakcie każda wskazówka ma swój numer) */
.gr-sh-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gr.is-end .gr-sh-h { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.gr-hint.is-new { animation: gr-in 0.4s ease-out both; }
.gr-hint.is-new::before { content: ""; position: absolute; inset: -6px -8px -6px 0; border-radius: 0 6px 6px 0; background: rgba(255, 194, 26, 0.13);
  animation: gr-glow 1.6s ease-out 0.2s forwards; pointer-events: none; }
@keyframes gr-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes gr-glow { to { opacity: 0; } }
/* wskazówka 1: województwo na małej mapie Polski */
.gr-hint.has-map { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: center; }
.gr-h-in { min-width: 0; }
.gr-h-pl { display: block; width: 116px; height: auto; overflow: visible; }
.gr-h-pl.is-s { width: 44px; }
.gr-h-pl-k { fill: rgba(127, 163, 174, 0.16); stroke: rgba(230, 223, 204, 0.55); stroke-width: 1.2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.gr-h-pl-w { fill: var(--signal); stroke: var(--deep); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.gr-hint-s.has-map { align-items: center; }
.gr-soon { margin: 14px 0 0; padding: 8px 0 8px 16px; border-left: 3px dashed var(--rule); font-stretch: 88%; font-size: 14.5px; color: var(--line); }
.gr-soon b { color: var(--bone); font-weight: 680; }
.gr-soon[hidden] { display: none; }

/* ---------- odpowiedź ---------- */
.gr-play { margin-top: 28px; }
.gr-play[hidden], .gr-end[hidden], .gr-guesses[hidden] { display: none; }
.gr-find-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.gr-tries { display: flex; align-items: center; gap: 10px; }
.gr-tries-q { display: flex; gap: 5px; }
.gr-tries-q i { display: block; width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--rule); }
.gr-tries-q i[style] { border-color: transparent; background: var(--q); }
.gr-tries-t { font-stretch: 85%; font-weight: 620; font-size: 14px; color: var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gr-find { position: relative; }
.gr-find-l { display: block; margin: 0; font-weight: 650; font-size: 16px; }
.gr-row { display: flex; gap: 8px; }
#gq { flex: 1 1 auto; min-width: 0; height: 58px; padding: 0 14px 0 48px; border: 2px solid var(--line); border-radius: 6px; scroll-margin-top: calc(var(--top) + 46px);
  background: var(--deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237FA3AE' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='M13 13l5 5'/%3E%3C/svg%3E") no-repeat 16px 50% / 20px 20px;
  color: var(--bone); font: 600 19px/1.2 var(--sans); }
#gq::placeholder { color: rgba(127, 163, 174, 0.8); font-weight: 520; }
#gq:focus { outline: none; border-color: var(--signal); }
.gr-btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 18px; border: 1.5px solid var(--bone); border-radius: 6px;
  background: none; color: var(--bone); font-weight: 650; font-size: 16px; text-decoration: none; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.gr-btn:hover { border-color: var(--signal); color: var(--signal); }
.gr-btn-p { border-color: var(--signal); background: var(--signal); color: var(--deep); }
.gr-btn-p:hover { border-color: var(--bone); background: var(--bone); color: var(--deep); }
.gr-row .gr-btn { flex: none; height: 58px; padding: 0 20px; font-weight: 720; font-size: 17px; }
.gr-btn:disabled { border-color: var(--rule); background: transparent; color: var(--line); cursor: default; }
.gr-msg { margin: 8px 0 0; min-height: 1.4em; font-stretch: 88%; font-size: 14.5px; line-height: 1.4; color: var(--line); }

/* podpowiedzi: przy każdej gminie mapka Polski z kropką (jak na stronie głównej) */
.gr-sugg { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 6px 0 0; padding: 4px 0; list-style: none; background: var(--deep);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45); max-height: min(52vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.gr-sugg[hidden] { display: none; }
.gr-sugg li { display: flex; align-items: center; gap: 12px; padding: 7px 14px 7px 10px; cursor: pointer; line-height: 1.25; }
.gr-sugg li[aria-selected="true"] { background: var(--land); }
@media (hover: hover) { .gr-sugg li[data-k]:not(.was):hover { background: var(--land); } }
.gr-sugg li.was { cursor: default; opacity: 0.55; }
.gr-sugg .none { display: block; padding: 10px 14px; cursor: default; color: var(--line); }
.sg-t b { display: block; font-weight: 680; font-size: 17px; }
.sg-t span { display: block; font-stretch: 82%; font-size: 14px; color: var(--line); }
.loc { flex: none; width: 40px; height: 38px; overflow: visible; }
.loc use { fill: rgba(230, 223, 204, 0.17); stroke: rgba(230, 223, 204, 0.62); stroke-width: 26; stroke-linejoin: round; }
.loc circle { fill: var(--signal); stroke: var(--deep); stroke-width: 26; }

/* ---------- próby ---------- */
.gr-guesses { margin-top: 26px; }
.gr-gs { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.gr-g { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 36px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.gr-q { width: 14px; height: 14px; border-radius: 3px; background: var(--q); }
.gr-g-n { min-width: 0; line-height: 1.25; }
.gr-g-n b { display: block; font-weight: 700; font-size: 17px; }
.gr-g-n small { display: block; font-stretch: 82%; font-size: 13.5px; color: var(--line); }
.gr-g-d { font-stretch: 100%; font-weight: 720; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gr-g.is-hit .gr-g-d { color: var(--signal); }
.gr-g-a { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--rule); border-radius: 50%; }
.gr-g-a svg { width: 20px; height: 20px; fill: var(--bone); }
.gr-g.is-hit .gr-g-a { border-color: var(--signal); }
.gr-g.is-hit .gr-g-a svg { fill: none; stroke: var(--signal); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.gr-g.is-new { animation: gr-in 0.35s ease-out both; }
.gr-g.is-new .gr-g-a svg { animation: gr-spin 0.75s cubic-bezier(0.25, 1.2, 0.4, 1) 0.1s both; }
@keyframes gr-spin { from { transform: rotate(0deg); } }
.gr-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; font-stretch: 82%; font-size: 13px; color: var(--line); }
.gr-how { margin: 6px 0 0; font-stretch: 82%; font-size: 13px; line-height: 1.4; color: var(--line); }
.gr-key span { display: inline-flex; align-items: center; gap: 6px; }
.gr-key i { display: block; width: 10px; height: 10px; border-radius: 2px; background: var(--q); }

/* ---------- koniec gry ---------- */
.gr.is-end .gr-end { order: -1; }
.gr.is-end .gr-hints { order: 2; margin-top: 34px; }
.gr-end { margin-top: 28px; }
.gr-res { margin: 0; font-stretch: 92%; font-weight: 700; font-size: 17px; color: var(--signal); }
.gr-name { margin: 4px 0 0; font-stretch: 118%; font-weight: 800; font-size: clamp(34px, 3.6vw, 52px); line-height: 0.98; letter-spacing: -0.018em; text-wrap: balance; }
.gr-sub { margin: 10px 0 0; font-stretch: 88%; font-weight: 520; font-size: 16px; line-height: 1.4; color: var(--line); }
.gr-pl { margin: 20px 0 0; }
.gr-pl-in { position: relative; max-width: 440px; }
.gr-pl-in img { display: block; width: 100%; height: auto; }
.gr-pl-in svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gr-pl-l { stroke: rgba(230, 223, 204, 0.55); stroke-width: 1.4px; vector-effect: non-scaling-stroke; stroke-dasharray: 0.02 0.018; }
.gr-pl-d { stroke: var(--deep); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.gr-pl-r { fill: none; stroke: var(--signal); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.gr-pl-me { fill: var(--signal); stroke: var(--deep); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.gr-pl.is-anim .gr-pl-l { animation: gr-in-o 0.5s ease-out both; animation-delay: calc(0.3s + var(--d, 0s)); }
.gr-pl.is-anim .gr-pl-d { animation: gr-in-o 0.3s ease-out 0.2s both; }
.gr-pl.is-anim .gr-pl-r { transform-box: fill-box; transform-origin: center; animation: gr-ring 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) 0.5s both; }
@keyframes gr-in-o { from { opacity: 0; } }
@keyframes gr-ring { from { opacity: 0; transform: scale(3.2); } }
.gr-pl figcaption { margin: 8px 0 0; font-stretch: 85%; font-size: 13.5px; line-height: 1.4; color: var(--line); }
.gr-fact { margin: 22px 0 0; }
.gr-film { margin: 8px 0 0 !important; font-size: 15px !important; }
.gr-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.gr-act .gr-btn-p { font-weight: 720; }
.gr-toast { margin: 8px 0 0; min-height: 1.4em; font-stretch: 88%; font-size: 14.5px; color: var(--signal); }
.gr-copy { display: block; width: 100%; margin: 6px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--deep); color: var(--bone);
  font: 500 15px/1.4 var(--sans); resize: none; }
.gr-stats { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--rule); }
.gr-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.gr-nums div { display: flex; flex-direction: column-reverse; gap: 2px; }
.gr-nums dt { font-stretch: 85%; font-size: 13.5px; line-height: 1.25; color: var(--line); }
.gr-nums dd { margin: 0; font-stretch: 110%; font-weight: 780; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.gr-dist { display: grid; gap: 5px; max-width: 420px; }
.gr-dr { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: center; font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
.gr-dr-t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gr-dr i { display: block; width: var(--w); height: 18px; border-radius: 3px; background: var(--land); }
.gr-dr b { font-weight: 700; font-size: 14px; }
.gr-dr.zero i { display: none; }
.gr-dr.zero b { font-weight: 560; color: var(--line); }
.gr-dr.me i { background: var(--signal); }
.gr-dr.me b { color: var(--signal); }
.gr-note { margin: 12px 0 0; font-stretch: 85%; font-size: 13.5px; line-height: 1.45; color: var(--line); }
.gr-note a { color: var(--line); }
.gr-next { margin: 20px 0 0; font-size: 16px; }
.gr-next b { font-weight: 760; font-variant-numeric: tabular-nums; color: var(--signal); }

/* ---------- telefon ---------- */
@media (max-width: 900px) {
  .gr { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "fig" "main"; grid-template-rows: none; padding: 20px 16px 60px; }
  .gr-head { padding-top: 0; }
  .gr.is-typing { padding-bottom: 70vh; }
  .gr-h { font-size: clamp(36px, 10.6vw, 54px); }
  .gr-meta { margin-top: 8px; font-size: 15px; }
  .gr-lead { margin-top: 8px; font-size: 15.5px; line-height: 1.42; }
  .gr-fig { position: relative; top: 0; height: min(76vw, 300px); min-height: 0; margin-top: 14px; }
  .gr-fig-in { padding: 32px 16px 34px; }
  .gr-fig-t { top: 11px; left: 13px; font-size: 14px; }
  .gr-scale { left: 13px; bottom: 11px; }
  .gr-hints { margin-top: 16px; }
  .gr-sh { margin-bottom: 10px; font-size: 18px; }
  .gr-h-v { font-size: 24px; }
  .gr-h-t { font-size: 15px; }
  .gr-play { margin-top: 18px; }
  #gq { height: 54px; padding-left: 44px; background-position: 14px 50%; font-size: 18px; }
  .gr-row .gr-btn { height: 54px; padding: 0 16px; font-size: 16px; }
  .gr-g { gap: 10px; grid-template-columns: 12px minmax(0, 1fr) auto 32px; }
  .gr-q { width: 12px; height: 12px; }
  .gr-g-n b { font-size: 16px; }
  .gr-g-n small { font-size: 13px; }
  .gr-g-d { font-size: 16.5px; }
  .gr-g-a { width: 32px; height: 32px; }
  .gr-g-a svg { width: 18px; height: 18px; }
  .gr-end { margin-top: 22px; }
  .gr-name { font-size: clamp(32px, 9.6vw, 46px); }
  .gr-pl-in { max-width: none; }
  .gr-act .gr-btn { flex: 1 1 auto; }
  .gr-nums { gap: 8px; }
  .gr-nums dd { font-size: 26px; }
  .gr-nums dt { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .gr-k, .gr-btn { transition: none; }
  .gr-k.is-draw, .gr-hint.is-new, .gr-hint.is-new::before, .gr-g.is-new, .gr-g.is-new .gr-g-a svg, .gr-pl.is-anim * { animation: none !important; }
  .gr-hint.is-new::before { display: none; }
  .gr-k.is-draw { fill-opacity: 1; stroke: var(--bone); stroke-dasharray: none; }
}
