/* map art: a figure-ground plan, charcoal on paper, one survey red accent. */
:root { --paper: #FAFAF7; --ink: #141414; --plan: #4A4A45; --mute: #8B8B85; --hair: #D8D8D1; --tint: #EDEDE7; --red: #C23B2E; --soft: #CF7A70;
  --mono: "Geist Mono", ui-monospace, monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.45 Geist, -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.app { max-width: 1160px; margin: 0 auto; padding: 22px 16px 28px; display: grid; gap: 20px; min-height: 100svh; grid-template-rows: auto 1fr auto; }
.mono, .num, .city, .textbtn, .btn, .sched th, .hint { font-family: var(--mono); }

header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.mark { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 22px; height: 22px; flex: none; fill: var(--ink); } .logo .dot { fill: var(--red); }
.word { font-weight: 600; font-size: 22px; letter-spacing: -0.045em; white-space: nowrap; }
.num { font-size: 12px; color: var(--mute); letter-spacing: .06em; white-space: nowrap; }
.hright { display: flex; align-items: center; gap: 14px; }
.tabs { display: flex; gap: 16px; }
.tab { appearance: none; border: 0; background: none; padding: 3px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.tab .short { display: none; }
.tab.on { color: var(--ink); box-shadow: inset 0 -1px 0 var(--ink); }
.tab i { width: 5px; height: 5px; border-radius: 50%; background: var(--plan); } .tab i.r { background: var(--red); } .tab i.x { background: var(--hair); }
.me { appearance: none; border: 0; padding: 0; width: 26px; height: 26px; background: var(--plan); cursor: pointer; overflow: hidden; flex: none; }
.me img { width: 100%; height: 100%; display: block; }

.game { display: grid; gap: 22px; align-items: start; }
@media (min-width: 900px) { .game { grid-template-columns: 360px minmax(0, 1fr); gap: 40px; } }
.left { display: flex; flex-direction: column; gap: 16px; }
.plate { position: relative; width: 100%; max-width: 360px; aspect-ratio: 1; margin: 0 auto; overflow: hidden; background: var(--tint); }
.plate .plan { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plate .next { opacity: 0; }
.plate .next.in { animation: zoomout 1.1s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes zoomout { from { opacity: 0; transform: scale(1.36); } 35% { opacity: 1; } to { opacity: 1; transform: scale(1); } }
.tries { display: flex; gap: 6px; justify-content: center; }
.tries { align-items: center; } .clock { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-left: 8px; font-variant-numeric: tabular-nums; }
.tries i { width: 6px; height: 6px; border-radius: 50%; background: var(--hair); } .tries i.on { background: var(--ink); } .tries i.win { background: var(--red); }
.last { display: none; }

.sched { max-width: 360px; width: 100%; margin: 0 auto; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sched th { text-align: left; font-weight: 400; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); padding: 0 0 6px; border-bottom: 1px solid var(--ink); }
.sched th:last-child, .sched td:last-child { text-align: right; }
.sched td { padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.sched td.n { font-family: var(--mono); font-size: 11px; color: var(--mute); width: 34px; }
.sched td.dir { width: 40px; }
.sched .temp { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-left: 6px; }
.ov { font-family: var(--mono); font-size: 11.5px; display: inline-block; min-width: 50px; text-align: center; padding: 2px 6px; border: 1px solid var(--hair); }
.ov.near { border-color: var(--ink); }
.ov.win { background: var(--red); color: #fff; border-color: var(--red); }

.right { display: flex; flex-direction: column; gap: 12px; }
.mapwrap { position: relative; }
#map { width: 100%; height: min(64svh, 600px); min-height: 360px; position: relative; background: var(--paper); }
.finder { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); outline: 1px solid rgba(20, 20, 20, .35); pointer-events: none; z-index: 2; }
.finder b { position: absolute; width: 12px; height: 12px; border: 2px solid var(--red); }
.finder b:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; } .finder b:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; }
.finder b:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; } .finder b:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
.finder::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; background: linear-gradient(var(--red), var(--red)) center/1px 100% no-repeat, linear-gradient(var(--red), var(--red)) center/100% 1px no-repeat; }
.finder.off { display: none; }
.finder.tiny { outline: 0; } .finder.tiny b { display: none; }
.bar { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--mute); }
.acts { display: flex; gap: 18px; align-items: center; }
.btn { appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; padding: 12px 22px; cursor: pointer; }
.btn:disabled { opacity: .35; cursor: default; }
.textbtn { appearance: none; border: 0; background: none; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); cursor: pointer; padding: 0; }
.textbtn:hover { color: var(--ink); }
.textbtn:disabled { opacity: .4; cursor: default; }

.result { max-width: 360px; width: 100%; margin: 0 auto; border: 1px solid var(--ink); padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--paper); }
.result .label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.result b { font-weight: 600; font-size: 22px; letter-spacing: -0.035em; line-height: 1.15; }
.result .sub { color: var(--mute); }
.result .crowd { font-size: 13px; }
.share { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-top: 1px solid var(--hair); padding-top: 10px; margin-top: 4px; }
.share pre { margin: 0; font: 12px/1.5 var(--mono); white-space: pre-wrap; }
.share .col { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.next { font-family: var(--mono); font-size: 11px; color: var(--mute); letter-spacing: .06em; }

footer { display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; padding-top: 6px; }
footer a.sib { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--mute); font-size: 12px; padding-left: 14px; border-left: 1px solid var(--hair); }
footer a.sib + a.sib { border-left: 0; padding-left: 0; }
footer a.sib svg { width: 12px; height: 12px; }
footer a.sib:hover { color: var(--ink); }

/* sheets (how to play, about, past spots) and the profile */
.back { position: fixed; inset: 0; background: rgba(20, 20, 20, .28); z-index: 20; }
.sheet { position: fixed; z-index: 21; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 24px)); max-height: calc(100svh - 40px); overflow: auto;
  background: var(--paper); border: 1px solid var(--ink); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { margin: 0; font-size: 20px; letter-spacing: -0.035em; font-weight: 600; }
.sheet p { margin: 0; line-height: 1.55; }
.sheet .x { position: absolute; right: 14px; top: 12px; }
.sheet .steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.sheet .steps li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; counter-increment: s; }
.sheet .steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 11px; color: var(--mute); padding-top: 2px; }
.sheet .btn { align-self: flex-start; }
.past { display: flex; flex-direction: column; }
.past button { appearance: none; border: 0; border-bottom: 1px solid var(--hair); background: none; padding: 10px 0; display: flex; justify-content: space-between; cursor: pointer; text-align: left; }
.past button span:last-child { font-family: var(--mono); font-size: 11px; color: var(--mute); letter-spacing: .06em; text-transform: uppercase; }
.past button:disabled { cursor: default; opacity: .55; }
.pcity { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pcity th, .pcity td { text-align: right; padding: 8px 0; border-bottom: 1px solid var(--hair); font-weight: 400; }
.pcity thead th { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); border-bottom: 1px solid var(--ink); }
.pcity tbody th { text-align: left; font-size: 13px; } .pcity td { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hair); }
.pstats div { padding: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.pstats span { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.pstats b { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.phead { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.atlas { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; }
.atlas button { appearance: none; border: 0; padding: 0; aspect-ratio: 1; cursor: pointer; background: var(--tint); }
.atlas img { width: 100%; height: 100%; display: block; }
.atlas button.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.ainfo { font-size: 12.5px; color: var(--mute); min-height: 18px; }

.maplibregl-ctrl-attrib { font-size: 10px; background: rgba(250, 250, 247, .85) !important; }
.maplibregl-ctrl-group { border-radius: 0 !important; box-shadow: none !important; border: 1px solid var(--ink); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--hair) !important; }

/* Phones: one screen, like a maps app. The map fills it, the plan is a thumbnail you can tap open,
   your last guess is a pill above the Guess button, which sits under your thumb. */
@media (max-width: 700px) {
  html, body { height: 100%; overflow: hidden; }
  .app { padding: 12px 12px 0; gap: 10px; grid-template-rows: auto 1fr; }
  footer { display: none; }
  .word { font-size: 20px; } .num { display: none; }
  header { gap: 10px; } .hright { gap: 10px; min-width: 0; } .tabs { gap: 12px; } .tab .full { display: none; } .tab .short { display: inline; }
  .game { position: relative; display: block; }
  .right { gap: 0; }
  #map { height: calc(100svh - 128px); min-height: 0; margin: 0 -12px; width: calc(100% + 24px); }
  .left { position: absolute; z-index: 5; left: 0; top: 10px; gap: 8px; width: 40%; pointer-events: none; }
  .left > * { pointer-events: auto; }
  .plate { max-width: none; box-shadow: 0 0 0 1px var(--ink), 0 8px 24px rgba(0, 0, 0, .18); transition: width .25s ease; cursor: zoom-in; }
  .left.big { width: 100%; } .left.big .plate { cursor: zoom-out; }
  .tries { justify-content: flex-start; background: var(--paper); padding: 6px 8px; align-self: flex-start; box-shadow: 0 0 0 1px var(--ink); }
  .sched { display: none; }
  .last { display: flex; position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper);
    font-family: var(--mono); font-size: 12px; letter-spacing: .04em; padding: 8px 12px; gap: 10px; align-items: center; white-space: nowrap; }
  .last:empty { display: none; }
  .last svg path { fill: var(--paper); }
  .bar { position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--ink); }
  .hint { display: none; }
  .acts { width: 100%; justify-content: space-between; }
  .btn { flex: 1; padding: 15px; font-size: 13px; }
  #result { position: fixed; z-index: 7; left: 0; right: 0; bottom: 0; max-height: 70svh; overflow: auto; }
  #result .result { max-width: none; border: 0; border-top: 1px solid var(--ink); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  #result .mlinks { display: flex; gap: 16px; padding-top: 8px; }
  .maplibregl-ctrl-top-right { top: auto !important; bottom: 160px; }
}
@media (min-width: 701px) { .mlinks { display: none; } }
@media (prefers-reduced-motion: reduce) { .plate .next.in { animation: none; opacity: 1; } }

/* sister games card (after two past puzzles in a day) */
.sisback { position: fixed; inset: 0; background: rgba(0, 0, 0, .28); display: grid; place-items: center; z-index: 30; padding: 16px; animation: sisfade .18s ease-out; }
.siscard { background: var(--paper); color: var(--ink); width: 100%; max-width: 360px; border: 1px solid var(--hair); padding: 22px; display: flex; flex-direction: column; gap: 12px; animation: sisrise .22s cubic-bezier(.2, .8, .3, 1); }
.siscard > b { font-size: 20px; font-weight: 600; letter-spacing: -0.035em; }
.siscard > p { margin: 0; line-height: 1.5; font-size: 14px; }
.sislink { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: inherit; padding: 12px 0; border-top: 1px solid var(--hair); }
.sislink span { display: flex; flex-direction: column; gap: 1px; } .sislink strong { font-weight: 600; letter-spacing: -0.02em; font-size: 15px; } .sislink small { color: var(--mute); font-size: 12.5px; }
.sislink em { font-style: normal; font-size: 12px; color: var(--mute); } .sislink:hover em { color: var(--ink); }
.sisclose { appearance: none; border: 0; background: none; padding: 6px 0 0; font: inherit; font-size: 12.5px; color: var(--mute); cursor: pointer; align-self: flex-start; text-decoration: underline; text-underline-offset: 3px; }
@keyframes sisfade { from { opacity: 0; } } @keyframes sisrise { from { opacity: 0; transform: translateY(10px); } }

/* start card: nothing is shown and the clock waits until Start */
.plate.wait img { visibility: hidden; }
.startback { position: fixed; inset: 0; z-index: 19; background: rgba(250, 250, 247, .55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; }
.startcard { background: var(--paper); border: 1px solid var(--ink); padding: 22px; width: min(320px, 100%); display: flex; flex-direction: column; gap: 10px; }
.startcard .label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.startcard b { font-size: 24px; font-weight: 600; letter-spacing: -0.04em; }
.startcard p { margin: 0 0 6px; line-height: 1.5; }
.startcard .btn { align-self: stretch; padding: 14px; }

/* the city tabs and profile stay usable above the start card */
header { position: relative; z-index: 20; }
