/* Games hub (/games/) and "Where in the Fox Valley?" (/games/where/). Loaded only on those pages. */
.gh-wrap, .wg-wrap { padding-bottom: 2.5rem; }
.gh-lead, .wg-lead { max-width: 46rem; margin: 0.6rem 0 0; font-size: 1.05rem; line-height: 1.55; color: var(--muted); }

/* Hub: even card grid; a lone card is centered at a fixed width. */
.gh-grid { display: grid; gap: 1.25rem; margin-top: 1.6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.gh-grid--1 { grid-template-columns: minmax(0, 26rem); justify-content: center; }
.gh-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gh-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--paper); border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(11, 61, 92, 0.08); color: var(--ink); text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.gh-card:hover { color: var(--ink); box-shadow: 0 14px 32px rgba(11, 61, 92, 0.14); transform: translateY(-2px); }
.gh-card:focus-visible { outline: none; box-shadow: var(--focus); }
.gh-card__art { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--navy); }
.gh-card__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gh-card__badge, .gm-home__badge {
  position: absolute; left: 0.75rem; top: 0.75rem; padding: 0.3rem 0.65rem; border-radius: 999px;
  background: rgba(7, 40, 60, 0.86); color: #fff; font: 700 0.78rem/1.2 var(--font-ui); letter-spacing: 0.02em;
}
.gh-card__body { display: flex; flex-direction: column; gap: 0.45rem; padding: 1.1rem 1.2rem 1.25rem; flex: 1; }
.gh-card__meta { font: 600 0.75rem/1.3 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-text); }
.gh-card__title { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.2; color: var(--navy); }
.gh-card__blurb { font-size: 0.98rem; line-height: 1.5; }
.gh-card__btn { align-self: flex-start; margin-top: auto; min-height: 44px; padding: 0.65rem 1.2rem; }

/* Where game */
.wg-crumbs { margin: 0 0 0.75rem; font: 600 0.85rem/1.4 var(--font-ui); color: var(--muted); }
.wg-crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--navy); }
.wg-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem 2rem; align-items: end; }
.wg-stats { display: grid; grid-template-columns: repeat(4, minmax(4.6rem, 1fr)); gap: 0.5rem; margin: 0; }
.wg-stats > div {
  padding: 0.55rem 0.5rem; text-align: center; background: var(--paper);
  border: 1px solid var(--card-border); border-radius: var(--radius-sm);
}
.wg-stats dt { font: 600 0.68rem/1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.wg-stats dd { margin: 0.15rem 0 0; font: 700 1.45rem/1.1 var(--font-ui); color: var(--navy); }

.wg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; margin-top: 1.4rem; align-items: stretch; }
.wg-photo, .wg-play {
  margin: 0; min-width: 0; background: var(--paper); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: 0 10px 26px rgba(11, 61, 92, 0.07); overflow: hidden;
}
.wg-photo { display: flex; flex-direction: column; }
.wg-photo__frame { position: relative; aspect-ratio: 4 / 3; background: var(--navy-deep); overflow: hidden; }
.wg-photo__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wg-photo.is-full .wg-photo__frame { aspect-ratio: auto; }
.wg-photo.is-full .wg-photo__frame img { height: auto; object-fit: contain; }
.wg-photo__cap { padding: 0.7rem 1rem 0.85rem; font-size: 0.9rem; line-height: 1.45; color: var(--muted); }
.wg-photo__cap a { color: var(--navy); }

.wg-play { display: flex; flex-direction: column; padding: 1rem; gap: 0.75rem; }
.wg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; padding: 0.3rem; background: var(--cream); border-radius: 999px; border: 1px solid var(--card-border); }
.wg-tab {
  min-height: 44px; padding: 0.5rem 0.75rem; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 600 0.92rem/1.2 var(--font-ui); color: var(--navy); -webkit-tap-highlight-color: transparent;
}
.wg-tab[aria-selected="true"] { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(11, 61, 92, 0.25); }
.wg-tab:focus-visible { outline: none; box-shadow: var(--focus); }
.wg-panel { display: flex; flex-direction: column; gap: 0.65rem; flex: 1; min-height: 0; }
.wg-panel[hidden] { display: none; }
.wg-hint { margin: 0; font-size: 0.95rem; color: var(--muted); }
.wg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; flex: 1; align-content: start; }
.wg-opt {
  display: flex; align-items: center; gap: 0.6rem; min-height: 64px; padding: 0.6rem 0.75rem; text-align: left;
  background: #fff; border: 2px solid var(--card-border); border-radius: var(--radius-sm); cursor: pointer;
  font: 600 0.95rem/1.3 var(--font-body); color: var(--ink); -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wg-opt:hover:not(:disabled) { border-color: var(--river); background: #F2F8F9; }
.wg-opt:focus-visible { outline: none; box-shadow: var(--focus); }
.wg-opt:disabled { cursor: default; opacity: 0.6; }
.wg-opt__key {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem;
  border-radius: 50%; background: var(--cream); color: var(--navy); font: 700 0.85rem/1 var(--font-ui);
}
.wg-opt__label { min-width: 0; overflow-wrap: anywhere; }
.wg-opt.is-right { border-color: #2E7D4F; background: #EAF5EE; opacity: 1; }
.wg-opt.is-right .wg-opt__key { background: #2E7D4F; color: #fff; }
.wg-opt.is-wrong { border-color: #B3261E; background: #FBECEB; opacity: 1; }
.wg-opt.is-wrong .wg-opt__key { background: #B3261E; color: #fff; }
.wg-map { flex: 1; min-height: 300px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); background: #E8EEF0; z-index: 0; }
.wg-map:focus-visible { outline: none; box-shadow: var(--focus); }
.wg-lock { min-height: 44px; width: 100%; justify-content: center; }
.wg-lock:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.wg-msg { margin: 0; min-height: 1.4em; font-size: 0.95rem; color: var(--muted); }
.wg-msg.is-error { color: #B3261E; }
.wg-pin { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.wg-pin--guess { background: var(--gold-deep); }
.wg-pin--answer { background: #2E7D4F; }

.wg-result {
  margin-top: 1.25rem; padding: 1.1rem 1.25rem 1.2rem; background: var(--paper);
  border: 1px solid var(--card-border); border-left: 6px solid #2E7D4F; border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(11, 61, 92, 0.07);
}
.wg-result.is-miss { border-left-color: #B3261E; }
.wg-result__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.wg-verdict { margin: 0; font: 700 1.1rem/1.3 var(--font-ui); color: #2E7D4F; }
.wg-result.is-miss .wg-verdict { color: #B3261E; }
.wg-share { min-height: 44px; padding: 0.6rem 1.1rem; }
.wg-answer { margin: 0.6rem 0 0.2rem; font-family: var(--font-display); font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.2; color: var(--navy); }
.wg-detail, .wg-fact, .wg-crowd, .wg-next { margin: 0.35rem 0 0; line-height: 1.5; }
.wg-detail { font-weight: 600; }
.wg-fact a, .wg-credits a, .wg-past__credit a { color: var(--navy); }
.wg-crowd { color: var(--muted); }
.wg-next { font-size: 0.9rem; color: var(--muted); }

.wg-section { margin-top: 2rem; }
.wg-section__title { margin: 0 0 0.9rem; font-family: var(--font-display); font-size: clamp(1.3rem, 2vw, 1.6rem); color: var(--navy); }
.wg-archive { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.wg-past { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--card-border); border-radius: var(--radius-sm); }
.wg-past img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.wg-past__body { padding: 0.7rem 0.85rem 0.85rem; }
.wg-past__meta { margin: 0; font: 600 0.75rem/1.3 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-text); }
.wg-past__name { margin: 0.25rem 0 0; font-size: 1.05rem; line-height: 1.3; color: var(--navy); }
.wg-past__city { margin: 0.1rem 0 0; font-size: 0.92rem; color: var(--muted); }
.wg-past__credit { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--muted); }
.wg-empty { margin: 0; padding: 1rem 1.1rem; background: var(--paper); border: 1px dashed var(--light-line); border-radius: var(--radius-sm); color: var(--muted); }
.wg-how__list { margin: 0; padding-left: 1.2rem; line-height: 1.55; }
.wg-how__list li + li { margin-top: 0.35rem; }
.wg-credits { margin: 0.9rem 0 0; font-size: 0.9rem; line-height: 1.5; color: var(--muted); }
.leaflet-container a { color: var(--navy); }

@media (max-width: 900px) {
  .wg-head { grid-template-columns: 1fr; align-items: start; }
  .wg-grid { grid-template-columns: 1fr; }
  .wg-archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wg-map { min-height: 320px; }
}
@media (max-width: 560px) {
  .wg-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.35rem; }
  .wg-stats dd { font-size: 1.2rem; }
  .wg-stats dt { font-size: 0.6rem; letter-spacing: 0.04em; }
  .wg-opts { grid-template-columns: 1fr; }
  .wg-opt { min-height: 52px; }
  .wg-archive { grid-template-columns: 1fr; }
  .wg-result__top { flex-direction: column; align-items: stretch; }
  .wg-share { justify-content: center; }
  .gh-grid--2 { grid-template-columns: 1fr; }
}

/* Three hub cards: one even row on wide screens, one column on phones (no orphan card). */
.gh-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .gh-grid--3 { grid-template-columns: 1fr; max-width: 30rem; margin-inline: auto; } }
