/* Pinpoint. Street View fills the screen; the game floats over it in flat,
   ink-bordered cards. Type, tables, keys and buttons follow the State Navigate
   feature-idea shell: ink text only, mono figures, tinted table rows with a colored left
   border, text keys in bordered boxes, soft orange buttons that go ink on hover. */
.wh-page [hidden] { display: none !important; }

.wh-page {
  --wh-ink: #242220;
  --wh-paper: #fafaf7;
  --wh-orange: #de7441;
  --wh-soft: #f2b08e;
  --wh-rule: #c3c3c3;
  --wh-tint: #efeeea;
  --wh-tint2: #e6e4de;
  --wh-sel: #fbe3d6;
  --wh-sans: "IBM Plex Sans", sans-serif;
  --wh-mono: "JetBrains Mono", monospace;
  --wh-line: 1.11px;
  --wh-gap: 16px;
}

/* Dark mode follows the site's dark palette. */
:root[data-theme="dark"] .wh-page {
  --wh-ink: #f9f9f9;
  --wh-paper: #1d1d1d;
  --wh-rule: #4a4a4a;
  --wh-tint: #2a2a2a;
  --wh-tint2: #3a3a3a;
  --wh-sel: #4a3328;
}

.wh-main { color: var(--wh-ink); font-family: var(--wh-sans); }
.wh-card, .wh-card td, .wh-card th, .wh-card h2, .wh-card h3, .wh-card p, .wh-card li, .wh-card pre, .wh-gt td { color: var(--wh-ink); }
:where(.wh-main) span,
:where(.wh-main) label,
:where(.wh-main) strong,
:where(.wh-main) b,
:where(.wh-main) p { font-family: inherit; color: inherit; }
.wh-main b { font-family: var(--wh-mono); font-weight: 650; font-size: 0.94em; }

/* Stage */
.wh-stage { position: relative; height: calc(100dvh - var(--wh-head, 72px)); min-height: 480px; background: #1d1d1d; overflow: hidden; }
.wh-pano { position: absolute; inset: 0; display: grid; place-items: center; }
.wh-main .wh-pano-note { color: #fff; font: 12px var(--wh-mono); padding: 20px; text-align: center; max-width: 420px; margin: 0; }

.wh-card {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  background: var(--wh-paper);
  border: var(--wh-line) solid var(--wh-ink);
}
.wh-main .wh-card h2 { font-size: 20px !important; font-weight: 600 !important; letter-spacing: -0.02em !important; line-height: 1.2 !important; margin: 0; }

/* Left column on wide screens: the title card with the hints card under it. Phones undo
   the column and place each card themselves. */
@media (min-width: 821px) {
  .wh-left {
    position: absolute; z-index: 2; top: var(--wh-gap); left: var(--wh-gap); width: 320px;
    max-height: calc(100% - var(--wh-gap) - 34px);
    display: flex; flex-direction: column; gap: 8px;
  }
  .wh-left .wh-card { position: static; }
  .wh-top { flex: none; }
  .wh-hints-panel { min-height: 0; overflow: auto; }
}

/* Title card */
.wh-top { padding: 14px 16px; display: grid; gap: 8px; }
.wh-main .wh-title { font-size: 26px; font-weight: 700; line-height: 1.02; letter-spacing: -0.045em; margin: 0; }
.wh-main .wh-top-line { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font: 650 12px var(--wh-mono); }
.wh-main .wh-pips { display: flex; gap: 4px; margin: 0; }
.wh-pip { flex: 1; min-width: 0; height: 16px; border: var(--wh-line) solid var(--wh-ink); display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; font: 650 10px/1 var(--wh-mono); }
.wh-pip.is-now { background: var(--wh-sel); }
.wh-main .wh-answer-line { margin: 2px 0 0; font-size: 14px; font-weight: 650; line-height: 1.3; }
.wh-edition-pick { display: block; max-width: 280px; }
.wh-sync { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--wh-ink); }
.wh-sync a { color: inherit; text-decoration: underline; text-decoration-color: var(--wh-orange); text-underline-offset: 3px; }
.wh-main .wh-select {
  height: 38px; width: 100%; margin: 0; padding: 0 10px;
  border: var(--wh-line) solid var(--wh-ink); border-radius: 0;
  background: var(--wh-paper); color: var(--wh-ink);
  font: 12px var(--wh-mono); text-align: left;
}

/* Hints card */
.wh-hints-panel { padding: 14px 16px; }
.wh-hints { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.wh-main .wh-hint-title { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 15px; }
.wh-hint-body { margin-top: 8px; font-size: 14px; line-height: 1.45; }
.wh-main .wh-locked { margin: 4px 0 0; font: 12px var(--wh-mono); }
.wh-hint.is-new .wh-hint-title::after {
  content: "New"; margin-left: auto; padding: 2px 6px;
  background: var(--wh-orange); color: #fff; font: 750 11px var(--wh-mono);
}
.wh-num {
  display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px;
  border: var(--wh-line) solid var(--wh-ink); background: var(--wh-paper); color: var(--wh-ink);
  font: 750 10px var(--wh-mono);
}
.wh-hint.is-open .wh-num { background: var(--wh-ink); color: var(--wh-paper); }

.wh-t { width: 100%; border-collapse: collapse; font: 12px var(--wh-mono); }
.wh-t td { padding: 5px 8px; background: var(--wh-tint); border-bottom: var(--wh-line) solid var(--wh-paper); }
.wh-t .r { text-align: right; white-space: nowrap; font-weight: 650; }
.wh-t .wh-bc { width: 72px; padding-right: 0; }
.wh-bar { display: block; width: 72px; height: 8px; background: var(--wh-tint2); }
.wh-bar > span { display: block; height: 100%; background: #3e9685; }
.wh-party { padding: 1px 6px; font: 650 0.94em var(--wh-mono); color: #242220; }
.wh-party.D { background: #dce4f3; border-left: 4.44px solid #3f67b5; }
.wh-party.R { background: #f3dcdc; border-left: 4.44px solid #b64545; }

/* Map card */
.wh-map-panel { right: var(--wh-gap); bottom: 34px; width: 400px; padding: 14px 16px; display: grid; gap: 10px; transition: width 0.2s ease; }
@media (hover: hover) and (min-width: 821px) {
  .wh-map-panel:hover, .wh-map-panel:focus-within { width: 640px; }
}
/* Wide touch screens have no hover to widen the card, so it starts wider. */
@media (hover: none) and (min-width: 821px) {
  .wh-map-panel { width: 520px; }
}
@media (min-width: 821px) {
  .wh-map-panel { max-width: calc(100% - 320px - 3 * var(--wh-gap)); max-height: calc(100% - 34px - var(--wh-gap)); overflow: auto; }
}
.wh-main .wh-feedback { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; }
.wh-main .wh-feedback b { font-family: inherit; font-size: inherit; font-weight: 700; font-variant-numeric: tabular-nums; }
.wh-tag { display: inline-block; margin-right: 6px; padding: 2px 7px; font: 750 12px var(--wh-mono); vertical-align: 1px; }
.wh-tag.is-yes { background: #2e8b6e; color: #fff; }
.wh-gt td.wh-right { background: #2e8b6e; color: #fff; }
.wh-tag.is-no { background: var(--wh-soft); color: #242220; }
.wh-map-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: var(--wh-line) solid var(--wh-rule); }
.wh-mapwrap { position: relative; background: var(--wh-paper); border: var(--wh-line) solid var(--wh-rule); }
.wh-map { display: block; width: 100%; height: auto; max-height: min(420px, calc(100dvh - var(--wh-head, 72px) - 310px)); touch-action: none; }
.wh-zoom { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; }
.wh-main .wh-color-mode { position: absolute; z-index: 1; top: 6px; left: 6px; }
.wh-main .wh-color-mode[aria-pressed="true"] { background: var(--wh-ink); color: var(--wh-paper); }
.wh-map-label { font-family: var(--wh-mono); font-weight: 650; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.wh-zoom .wh-btn + .wh-btn { border-top: 0; }
.wh-head-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.wh-district-pick { display: block; }
.wh-main .wh-district-pick .wh-select { width: auto; min-width: 64px; max-width: 150px; height: 30px; padding: 0 6px; font-size: 11px; font-weight: 650; }
.wh-main .wh-map-help { font: 11px var(--wh-mono); margin: 0; }

.wh-key { display: flex; flex-wrap: wrap; gap: 6px; }
.wh-key span { border: var(--wh-line) solid var(--wh-rule); border-left-width: 4.44px; padding: 4px 8px; font: 11px/1.3 var(--wh-mono); }

.wh-state { fill: var(--wh-tint); stroke: var(--wh-ink); stroke-width: 0.8; vector-effect: non-scaling-stroke; cursor: pointer; }
.wh-state:not(.is-guessed):not(.is-off):hover { fill: var(--wh-soft); }
.wh-state.is-found { stroke-width: 2.5; }
.wh-state.is-off { fill: transparent; stroke: #6f6a64; cursor: default; }

.wh-district { fill: var(--wh-tint); stroke: #6f6a64; stroke-width: 0.7; vector-effect: non-scaling-stroke; cursor: pointer; }
.wh-district:hover { fill: var(--wh-soft); }
.wh-district.is-guessed { stroke: var(--wh-ink); stroke-width: 1.4; }
.wh-district.is-picked { fill: var(--wh-orange) !important; stroke: var(--wh-ink); stroke-width: 2.5; }
.wh-district.is-answer { fill: var(--wh-ink) !important; stroke: var(--wh-orange); stroke-width: 2.5; }
.wh-pin { fill: var(--wh-orange); stroke: var(--wh-paper); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }

/* Buttons */
.wh-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 16px;
  border: var(--wh-line) solid var(--wh-ink); border-radius: 0;
  background: var(--wh-paper); color: var(--wh-ink);
  font: 650 12px var(--wh-mono); cursor: pointer; text-decoration: none;
}
.wh-btn:hover { background: var(--wh-ink); color: var(--wh-paper); }
.wh-btn-soft { background: var(--wh-soft); border-color: var(--wh-soft); color: #242220; }
.wh-btn-soft:hover { background: var(--wh-ink); border-color: var(--wh-ink); color: var(--wh-paper); }
.wh-btn-small { min-height: 30px; padding: 0 10px; font-size: 11px; }
.wh-btn-icon { width: 32px; min-height: 32px; height: 32px; padding: 0; font-size: 15px; }
.wh-guess { width: 100%; min-height: 44px; padding: 6px 12px; font-size: 13px; line-height: 1.3; text-align: center; }
.wh-btn.wh-guess:disabled, .wh-btn.wh-guess:disabled:hover { background: var(--wh-paper); border-color: var(--wh-rule); color: var(--wh-ink); cursor: default; }

/* Loading and result cards */
.wh-status { top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; padding: 14px 18px; font: 12px var(--wh-mono); }
.wh-result {
  top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3;
  width: min(500px, calc(100% - 2 * var(--wh-gap))); max-height: calc(100% - 2 * var(--wh-gap));
  overflow: auto; padding: 20px 22px;
  /* Dims the street and the other cards while the result is up. The stage clips it. */
  box-shadow: 0 0 0 100vmax rgba(29, 29, 29, 0.55);
}
.wh-main .wh-result h2 { font-size: 32px !important; font-weight: 650 !important; letter-spacing: -0.04em !important; margin: 0 0 10px; padding-right: 110px; }
.wh-result-close { position: absolute; top: 14px; right: 14px; }
.wh-main .wh-answer { font-size: 20px; font-weight: 600; line-height: 1.35; letter-spacing: -0.02em; margin: 0 0 12px; }
.wh-main .wh-note { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.wh-share { margin: 0 0 10px; border: 0; padding: 10px 12px; background: var(--wh-tint); font: 12px/1.6 var(--wh-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--wh-ink); }
.wh-main .wh-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.wh-main .wh-result .wh-note:last-child { margin-bottom: 0; }

/* Side card: Hints or Your guesses */
.wh-side-seg { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.wh-seg {
  min-height: 34px; border: var(--wh-line) solid var(--wh-ink); border-radius: 0;
  background: var(--wh-paper); color: var(--wh-ink); font: 650 12px var(--wh-mono); cursor: pointer;
}
.wh-seg + .wh-seg { border-left: 0; }
.wh-seg:hover { background: var(--wh-tint2); }
.wh-seg[aria-pressed="true"] { background: var(--wh-ink); color: var(--wh-paper); }
.wh-side:not([data-view="guesses"]) .wh-side-guesses,
.wh-side[data-view="guesses"] .wh-side-hints { display: none; }
.wh-side-guesses { display: grid; gap: 10px; }
.wh-gp-how { justify-self: start; }

/* Below the game */
.wh-below { padding: 8px 0 64px; max-width: 860px; }
.wh-block { margin-top: 40px; }
.wh-main .wh-block h2 { font-size: 24px !important; font-weight: 600 !important; letter-spacing: -0.04em !important; padding-bottom: 10px; border-bottom: var(--wh-line) solid var(--wh-rule); margin: 0 0 14px; }
.wh-block > p { font-size: 15px; line-height: 1.55; }
.wh-scroll { overflow-x: auto; }
.wh-gt { width: 100%; border-collapse: collapse; font: 12px var(--wh-mono); }
.wh-gt th { text-align: left; font-weight: 750; padding: 0 8px 6px; }
.wh-gt td { padding: 7px 8px; background: var(--wh-tint); border-bottom: var(--wh-line) solid var(--wh-paper); }
.wh-gt td:first-child { border-left: 4.44px solid transparent; }
.wh-gt .r { text-align: right; white-space: nowrap; font-weight: 650; }
.wh-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; line-height: 1.5; list-style: decimal; }

.wh-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phone tabs (hidden on desktop) */
.wh-tabs, .wh-more-panel { display: none; }

/* Phones: the street fills the screen between the title bar and a bottom tab bar. Map,
   Hints and Guesses each open full screen over the street; tapping the open tab again
   goes back to the street. */
@media (max-width: 820px) {
  .wh-page { --wh-gap: 8px; --wh-tabh: 48px; --wh-toph: 70px; }
  .wh-page.wh-done { --wh-toph: 90px; }
  .wh-main .wh-answer-line { font-size: 13px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wh-stage { height: calc(100dvh - var(--wh-head, 64px)); min-height: 520px; }
  .wh-pano { top: var(--wh-toph); bottom: var(--wh-tabh); }

  /* Title bar sits above the street, not on it */
  .wh-top {
    top: 0; left: 0; right: 0; width: auto; height: var(--wh-toph);
    border-width: 0 0 var(--wh-line);
    grid-template-columns: minmax(0, 1fr); align-items: center; align-content: center; padding: 6px 12px; gap: 3px;
  }
  .wh-main .wh-title { font-size: 17px; }
  .wh-main .wh-top-line { font-size: 11px; }
  .wh-pip { height: 15px; font-size: 9px; }
  .wh-main .wh-select { font-size: 16px; height: 36px; padding: 0 6px; }

  .wh-tabs {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: var(--wh-tabh);
    background: var(--wh-paper); border-top: var(--wh-line) solid var(--wh-ink);
  }
  .wh-tab {
    border: 0; border-right: var(--wh-line) solid var(--wh-rule); border-radius: 0; background: var(--wh-paper); color: var(--wh-ink);
    font: 650 13px var(--wh-mono); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  }
  .wh-tab:last-child { border-right: 0; }
  .wh-tab[aria-pressed="true"] { background: var(--wh-ink); color: var(--wh-paper); }
  .wh-tab-new { padding: 1px 5px; background: var(--wh-orange); color: #fff; font: 750 10px var(--wh-mono); }
  .wh-tab-x { font-size: 16px; line-height: 1; }

  /* Each panel fills the screen between the title bar and the tabs */
  .wh-map-panel, .wh-hints-panel {
    top: var(--wh-toph); left: 0; right: 0; bottom: var(--wh-tabh); width: auto; height: auto; max-height: none;
    border-width: 0; padding: 12px;
  }
  .wh-stage:not([data-tab="map"]) .wh-map-panel { display: none; }
  .wh-stage:not([data-tab="hints"]):not([data-tab="guesses"]) .wh-hints-panel { display: none; }
  .wh-side-seg { display: none; }

  /* More: how to play, the data notes, other days and the site footer */
  .wh-stage[data-tab="more"] .wh-more-panel {
    display: block; position: absolute; z-index: 2; top: var(--wh-toph); left: 0; right: 0; bottom: var(--wh-tabh);
    background: var(--wh-paper); overflow: auto; -webkit-overflow-scrolling: touch;
  }
  .wh-more-panel .wh-below { padding: 0 16px 32px; margin: 0; }
  .wh-more-panel .wh-block:first-child { margin-top: 20px; }

  .wh-hints-panel { overflow: auto; }
  .wh-hints { gap: 10px; }
  .wh-main .wh-hint-title { font-size: 15px; }
  .wh-hint-body { margin-top: 6px; font-size: 14px; }
  .wh-t td { padding: 4px 8px; }
  .wh-t .wh-bc, .wh-bar { width: 64px; }

  .wh-mapwrap { min-height: 0; display: flex; }
  .wh-map { max-height: 100%; height: 100%; }
  .wh-zoom .wh-btn-icon { width: 30px; height: 30px; min-height: 30px; font-size: 14px; }
  .wh-main .wh-map-help { display: none; }
  .wh-key { display: none !important; }
  .wh-main .wh-card .wh-map-head h2 { font-size: 15px !important; }
  .wh-map-panel { grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 6px; padding: 8px 12px 10px; }
  .wh-main .wh-feedback { font-size: 13px; line-height: 1.35; }
  .wh-map-head { padding-top: 6px; min-height: 34px; }
  .wh-btn-small { min-height: 34px; }
  .wh-main .wh-district-pick .wh-select { font-size: 11px; height: 34px; }

  /* The result takes the sheet's place, leaving the street clear to walk */
  .wh-result {
    top: var(--wh-toph); left: 0; right: 0; bottom: var(--wh-tabh); transform: none; width: auto;
    height: auto; max-height: none;
    border-width: var(--wh-line) 0 0; padding: 14px 14px; box-shadow: none;
  }
  .wh-main .wh-result h2 { font-size: 24px !important; padding-right: 120px; margin-top: 0; }
  .wh-main .wh-answer { font-size: 16px; }
}
