:root {
  font-family: Tahoma, Verdana, sans-serif;
  color: #222;
  background: #222;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { width: 100%; height: 100%; margin: 0; }

body { overflow: hidden; }

button { font: inherit; cursor: pointer; }

button:focus-visible, a:focus-visible { outline: 2px solid #d56549; outline-offset: 2px; }
input:focus-visible { outline: 2px solid #d56549; outline-offset: 2px; }
.header-link { padding: 5px 0; border: 0; color: #aaa; background: transparent; font-size: 9px; }
.header-link:hover { color: #fff; }

.app-shell { display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh; min-height: 480px; }

.topbar {
  z-index: 30;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 0 25px;
  color: #fff;
  background: #242424;
  border-bottom: 3px solid #f5f5f5;
  white-space: nowrap;
}

.brand { display: flex; align-items: baseline; min-width: 0; gap: 15px; }
.brand-name { color: #e66b4e; font-family: Verdana, Tahoma, sans-serif; font-size: 25px; line-height: 1; font-weight: 700; letter-spacing: .1px; }
.brand-caption { font-size: 14px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 23px; height: 100%; }
.header-label { color: #aaa; font-size: 10px; font-weight: 700; letter-spacing: .55px; }
.header-label strong { display: block; margin-top: 2px; color: #f5f5f5; font-size: 13px; letter-spacing: 0; }
.header-timer { min-width: 66px; color: #f7f7f7; font-family: "Lucida Console", Monaco, monospace; font-size: 19px; font-weight: 700; letter-spacing: -.6px; text-align: right; font-variant-numeric: tabular-nums; }

.game-screen { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #637283; }
.panorama { position: absolute; inset: 0; }
.panorama > .panorama-instance { width: 100%; height: 100%; }
.panorama .pnlm-container { background: #637283; }
.panorama .pnlm-load-box { border-radius: 0; font-family: Tahoma, Verdana, sans-serif; }
.panorama .pnlm-about-msg { font-family: Tahoma, Verdana, sans-serif; }

.guess-panel { position: absolute; z-index: 15; top: 10px; right: 12px; width: 370px; padding: 9px; border: 1px solid #777; background: #f6f6f4; box-shadow: 0 5px 0 #1d1d1d; }
.map-frame { position: relative; height: 295px; border: 1px solid #999; background: #b7c7d7; overflow: hidden; }
.guess-map { width: 100%; height: 100%; }
.map-expand { position: absolute; z-index: 1000; top: 7px; right: 7px; padding: 5px 7px; border: 1px solid #888; background: #fafafa; color: #222; font-size: 10px; font-weight: 700; letter-spacing: .1px; box-shadow: 0 1px 1px #0003; }
.map-expand:hover { background: #e7e7e7; }
.map-instruction { position: absolute; z-index: 1000; bottom: 48px; left: 8px; padding: 4px 6px; border: 1px solid #999; background: rgba(255,255,255,.93); color: #333; font-size: 10px; font-weight: 700; pointer-events: none; }
.map-instruction.has-pin { background: rgba(242,242,242,.95); }
.guess-panel.is-expanded { width: min(950px, calc(100vw - 24px)); }
.guess-panel.is-expanded .map-frame { height: min(56vh, 470px); }
.guess-panel.is-expanded .map-instruction { bottom: 19px; }

.guess-button { display: block; width: 100%; height: 41px; margin-top: 9px; border: 1px solid #777; background: #aaa; color: #fff; font-size: 16px; font-weight: 700; text-align: center; }
.guess-button:disabled { cursor: default; opacity: 1; }
.guess-button:not(:disabled) { background: #d46248; border-color: #a34432; }
.guess-button:not(:disabled):hover { background: #be533b; }
.guess-button.is-recorded { background: #557653; border-color: #395938; }
.guess-button.is-recorded:not(:disabled):hover { background: #41643f; }
.score-lines { display: grid; gap: 4px; padding: 18px 1px 15px; font-size: 14px; line-height: 1.2; }
.score-lines div { display: flex; justify-content: space-between; gap: 14px; }
.score-lines strong { font-family: "Lucida Console", Monaco, monospace; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.start-button { display: block; width: 100%; height: 40px; border: 1px solid #111; background: #252525; color: #fff; font-size: 14px; font-weight: 700; }
.start-button:hover { background: #444; }
.guess-pin-dot { display: block; width: 19px; height: 19px; border: 3px solid #fff; border-radius: 50%; background: #d64e39; box-shadow: 0 0 0 1px #a13c2c, 0 2px 4px #0007; }
.correct-pin-dot { display: block; width: 24px; height: 24px; border: 4px solid #fff; border-radius: 50%; background: #417645; box-shadow: 0 0 0 2px #294c2c, 0 2px 4px #0007; }
.guess-panel.is-result { top: 50%; right: 50%; bottom: auto; transform: translate(50%, -50%); width: min(1000px, calc(100vw - 32px)); }
.guess-panel.is-result .map-frame { height: min(62vh, 580px); }
.guess-panel.is-result .guess-button, .guess-panel.is-result .start-button, .guess-panel.is-result .map-expand, .guess-panel.is-result .score-lines { display: none; }
.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 14px 20px; }
.result-summary h1 { margin: 5px 0; font-size: 25px; }
.result-summary p { margin: 0; color: #666; font-size: 12px; }
.result-next { text-align: right; white-space: nowrap; }
.result-next span { display: block; color: #777; font-size: 9px; font-weight: bold; }
.result-next strong { display: block; margin-top: 8px; font: 26px "Lucida Console", Monaco, monospace; }
.guess-panel.is-result .map-instruction { bottom: 30px; }
.maplibregl-map { font-family: Tahoma, Verdana, sans-serif; }
.maplibregl-ctrl-group { border: 1px solid #999; border-radius: 0; box-shadow: 0 1px 2px #3338; }
.maplibregl-ctrl-group button { width: 29px; height: 29px; }
.maplibregl-ctrl-attrib { font-size: 9px !important; background: rgba(255,255,255,.8) !important; }

.scene-caption { position: absolute; z-index: 7; bottom: 15px; left: 18px; padding: 5px 8px; background: rgba(0,0,0,.54); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .4px; pointer-events: none; }
.mapillary-mode .scene-caption { top: 15px; bottom: auto; left: 70px; }
.mapillary-mode .photo-credit { display: none; }
.footer-bar { flex: 0 0 25px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 13px; overflow: hidden; background: #242424; color: #d7d7d7; font-size: 10px; white-space: nowrap; }
.footer-divider { color: #777; padding: 0 4px; }
.imagery-credit a { color: #e5e5e5; }
.imagery-credit { margin-left: auto; }
.photo-credit { overflow: hidden; text-overflow: ellipsis; }
.photo-credit a { color: #e5e5e5; text-decoration: none; }
.photo-credit a:hover { text-decoration: underline; }

.session-screen { position: absolute; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; padding: 26px; overflow: auto; background: #deded8; }
.session-card { width: min(490px, 100%); margin: auto; border: 1px solid #999; border-top: 4px solid #d46248; padding: 28px 30px; background: #f6f6f4; box-shadow: 0 5px 0 #bbb; }
.eyebrow { color: #777; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.session-card h1 { margin: 12px 0 10px; font-size: 26px; line-height: 1.2; }
.session-card p { margin: 0; color: #666; font-size: 13px; line-height: 1.6; }
.session-card .session-clock { margin: 20px 0 0; color: #252525; font: 35px "Lucida Console", Monaco, monospace; }
#join-form { margin-top: 27px; }
#join-form label { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 700; color: #666; }
.join-row { display: flex; gap: 8px; }
.join-row input { min-width: 0; flex: 1; height: 39px; padding: 9px; border: 1px solid #888; border-radius: 0; font: 15px "Lucida Console", Monaco, monospace; }
.join-row button, .retry-button { border: 1px solid #9b3f2d; background: #d46248; color: white; padding: 10px 13px; font-size: 11px; font-weight: 700; }
.join-row button:disabled { opacity: .6; cursor: wait; }
.session-card .form-message { min-height: 20px; margin-top: 10px; color: #a13c2c; font-size: 12px; }
.retry-button { margin-top: 20px; }
.standings { margin-top: 26px; border-top: 1px solid #ccc; padding-top: 18px; }
.standings h2 { margin: 0 0 12px; font-size: 10px; color: #666; letter-spacing: .6px; }
.standings ol { margin: 0; padding: 0; list-style: none; max-height: 220px; overflow: auto; counter-reset: standing; }
.standings li { counter-increment: standing; display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid #e0e0dc; font-size: 12px; }
.standings li::before { content: counter(standing, decimal-leading-zero); color: #999; width: 20px; }
.standings li span { flex: 1; overflow-wrap: anywhere; }
.standings li strong { font-family: "Lucida Console", Monaco, monospace; }
.connection-status { position: absolute; z-index: 50; top: 10px; left: 50%; transform: translateX(-50%); padding: 9px 13px; background: #8a3422; color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; }
.scene-caption { max-width: calc(100% - 440px); }

@media (max-width: 500px) {
  .session-screen { padding: 15px; }
  .session-card { padding: 22px; }
  .session-card h1 { font-size: 23px; }
  .join-row { flex-direction: column; }
  .footer-bar > span:last-child { display: none; }
}

@media (max-width: 760px) {
  .topbar { flex-basis: 49px; padding: 0 10px 0 12px; }
  .brand-name { font-size: 20px; }
  .brand-caption, .header-label { display: none; }
  .header-timer { min-width: 55px; font-size: 19px; }
  .guess-panel { top: auto; bottom: 10px; right: 10px; width: min(340px, calc(100vw - 20px)); padding: 7px; }
  .map-frame { height: 180px; }
  .guess-panel.is-expanded { width: calc(100vw - 20px); }
  .guess-panel.is-expanded .map-frame { height: min(47vh, 360px); }
  .score-lines { display: flex; justify-content: space-between; gap: 5px; padding: 10px 1px; font-size: 11px; }
  .score-lines div { display: block; }
  .score-lines span, .score-lines strong { display: block; }
  .start-button { height: 34px; font-size: 11px; }
  .guess-button { height: 36px; font-size: 13px; }
  .scene-caption { top: 12px; bottom: auto; left: 12px; }
  .scene-caption { max-width: calc(100% - 24px); }
  .footer-bar { font-size: 9px; }
  .photo-credit { max-width: 55%; }
}

@media (max-height: 650px) and (min-width: 761px) {
  .map-frame { height: 220px; }
  .score-lines { gap: 2px; padding: 11px 1px; }
}
