:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  color: #f3f0e7;
  background: #17191c;
  --cream: #f3f0e7;
  --muted: #b5bcc3;
  --red: #f38b86;
  --gold: #e5ba79;
  --line: #383e45;
  --panel: #202328;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; min-height: 100vh; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(105deg, #17191c 8%, #17191c80 44%, #17191c11 100%),
    repeating-radial-gradient(ellipse at 83% -17%, transparent 0 16px, #a7b9c21d 17px 18px, transparent 19px 28px),
    repeating-radial-gradient(ellipse at 100% 14%, transparent 0 23px, #929fa710 24px 25px, transparent 26px 37px),
    radial-gradient(ellipse at 78% 0%, #423338, #17191c 68%);
}
.shell { width: min(100% - 64px, 1376px); margin-inline: auto; }
.masthead { background: #181b1fe8; border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.masthead-actions { display: flex; align-items: center; gap: 8px; }
.identity { display: flex; align-items: center; gap: 11px; color: var(--cream); text-decoration: none; }
.identity:hover .wordmark { text-decoration: underline; text-underline-offset: .22em; }
.identity:focus-visible { outline: 2px solid var(--red); outline-offset: 5px; }
.brand-mark { display: block; width: 46px; height: 46px; }
.wordmark {
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .055em;
  white-space: nowrap;
}
.wordmark strong { color: var(--red); }
.masthead-actions .button { min-height: 38px; font-size: .875rem; padding: 7px 11px; }
.home-screen {
  display: flex;
  align-items: center;
  min-height: min(610px, 75vh);
  margin-top: 36px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--red);
  background:
    linear-gradient(90deg, #18191d 0%, #18191df0 33%, #18191d60 67%, #17191c46 100%),
    url("./images/8.webp") center 60% / cover no-repeat #18191d;
}
.home-content { width: 100%; padding: clamp(24px, 5.5vw, 76px); }
.home-content h1 { max-width: 11ch; margin: 0 0 24px; }
.mode-card {
  display: grid;
  justify-items: start;
  gap: 12px;
  width: min(100%, 400px);
  padding: 19px;
  border: 1px solid #525159;
  border-left: 2px solid var(--red);
  background: #202328eb;
}
.mode-card h2 { font-size: 1.15rem; }
.mode-card p { color: var(--muted); line-height: 1.5; }
.mode-card .archive-size { color: var(--cream); font-size: .875rem; }
.mode-card .button { min-width: 120px; }
.mode-card .message { color: var(--gold); }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 37px 0 25px; }
.eyebrow, .panel-head h2 {
  color: var(--red); font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .11em;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.45vw, 4.2rem); line-height: 1.03; letter-spacing: -.05em; margin: 8px 0 10px; }
.intro-copy, .photo-foot p { color: var(--muted); line-height: 1.5; }
.play-options { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.mode { display: flex; align-items: center; gap: 9px; white-space: nowrap; background: #22272d; border: 1px solid #4a535c; padding: 12px; min-height: 44px; font-size: .9375rem; }
.mode input { margin: 0; accent-color: var(--red); width: 17px; height: 17px; }
.board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-top: 2px solid #798b96; background: var(--panel); box-shadow: 0 12px 32px #0004; }
.map-panel { border-top-color: var(--red); }
.panel-head { min-height: 51px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; }
.panel-head h2 { margin: 0; }
.panel-head span { color: var(--muted); font-size: .875rem; text-align: right; }
.photo-controls { display: flex; align-items: center; justify-content: end; gap: 10px; flex-wrap: wrap; }
.photo-controls .button { min-height: 34px; padding: 5px 9px; font-size: .875rem; }
.photo-frame, .map-frame { position: relative; height: clamp(300px, 33vw, 515px); border-block: 1px solid var(--line); background: #101215; }
.photo-frame { display: grid; place-items: center; }
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-frame p { padding: 20px; text-align: center; }
.photo-foot { padding: 15px 16px; min-height: 88px; }
.photo-foot p { margin-top: 5px; }
.hint-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint-bar p { margin: 0; }
.hint-bar .button { flex: none; }
#revealed-hints { margin: 13px 0 2px; padding-left: 23px; color: var(--cream); line-height: 1.5; }
#revealed-hints li + li { margin-top: 5px; }
#hint-status { color: var(--gold); }
#answer p { color: var(--cream); }
#event-date, #event-source, #track-source { display: inline-block; margin: 5px 12px 0 0; font-size: .875rem; }
#event-rating { display: inline-block; margin: 5px 12px 0 0; color: var(--gold); font-size: .875rem; font-weight: 700; }
#photo-credit { margin-top: 10px; font-size: .875rem; }
#photo-license, #photo-edit { margin-left: 7px; }
a { color: var(--red); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#city-search {
  position: relative;
  z-index: 1010;
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}
#city-query { flex: 1; }
#city-search-panel {
  position: absolute;
  top: calc(100% - 7px);
  left: 16px;
  right: 16px;
  max-height: 240px;
  overflow: auto;
  background: #20252a;
  border: 1px solid #5e6972;
  box-shadow: 0 8px 18px #0007;
}
#city-search-status { padding: 10px 12px; color: var(--muted); font-size: .875rem; }
#city-search-results { list-style: none; margin: 0; padding: 0; }
#city-search-results button {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--cream);
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
#city-search-results button:hover, #city-search-results button:focus-visible { background: #38434d; }
#city-search-results button:focus-visible { outline-offset: -2px; }
#map { height: 100%; width: 100%; background: #272729; cursor: crosshair; }
#map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(1.58); }
#map .leaflet-control-zoom a { background: #24292f; color: var(--cream); border-color: #555d66; }
#map .leaflet-control-attribution { background: #191d22ed; color: var(--cream); }
#map .leaflet-control-attribution a { color: var(--red); }
.map-actions { position: absolute; z-index: 500; left: 10px; bottom: 12px; }
.center-crosshair { position: absolute; z-index: 401; pointer-events: none; top: 50%; left: 50%; width: 20px; height: 20px; transform: translate(-50%, -50%); background: linear-gradient(var(--cream), var(--cream)) center/1px 100% no-repeat, linear-gradient(var(--cream), var(--cream)) center/100% 1px no-repeat; filter: drop-shadow(0 0 2px #000); opacity: .8; }
.map-frame .center-crosshair { visibility: hidden; }
.map-frame:not(.revealed):has(#map:focus-visible, #center-target:hover, #center-target:focus-visible) .center-crosshair { visibility: visible; }
.map-frame.revealed #map { cursor: grab; }
.target { border: 2px solid var(--red); border-radius: 50%; background: #17191ce0; display: grid; place-items: center; box-shadow: 0 0 0 2px #14171b; }
.target::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.target.actual { border-color: var(--gold); }
.target.actual::before { background: var(--gold); }
#guess-form { display: grid; gap: 12px; padding: 14px 16px; }
#arcade-score-form { display: grid; gap: 8px; margin: 0 16px 12px; padding: 13px; border: 1px solid var(--line); }
#arcade-run-score { font-weight: 700; }
.arcade-fields { display: flex; gap: 8px; }
.arcade-fields input { width: 0; flex: 1; }
#daily-share-card { display: block; width: 100%; max-height: 56vh; object-fit: contain; }
.daily-share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.daily-share-actions a { text-decoration: none; }
#daily-share-status:empty { display: none; }
#daily-lookup-form, #daily-lookup-result { display: grid; gap: 8px; }
#daily-lookup-form input { width: 100%; }
#daily-lookup-form small, #daily-lookup-score { color: var(--muted); }
#daily-lookup-form .button, #daily-lookup-result .button { justify-self: start; }
#daily-lookup-result { border-top: 1px solid var(--line); padding-top: 12px; }
#next-round { display: block; width: calc(100% - 32px); margin: 0 16px 14px; }
.coming-soon { color: var(--muted); font-size: .875rem; }
.button { background: #292e34; color: var(--cream); border: 1px solid #4d5862; border-radius: 0; min-height: 42px; padding: 9px 13px; font: 700 .9375rem/1.2 Arial, sans-serif; cursor: pointer; }
.button:hover:not(:disabled) { background: #38434d; }
.button:disabled { cursor: default; opacity: .55; }
.button.primary { background: var(--red); border-color: var(--red); color: #231415; }
.button.primary:hover:not(:disabled) { background: #ffaaa4; }
.button.outline { background: #20252a; }
.map-button { background: #22272ef5; font-size: .875rem; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.date-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
small { color: var(--muted); }
input:not([type=checkbox]) { min-height: 42px; min-width: 0; max-width: 100%; padding: 7px 9px; border: 1px solid #5e6972; border-radius: 0; background: #191d21; color: var(--cream); font: inherit; }
.result { display: grid; grid-template-columns: minmax(80px, .4fr) 1fr; gap: 8px; border-left: 2px solid var(--gold); background: #191d21; padding: 12px; }
.result strong { display: block; margin-top: 3px; font-size: 1.8rem; }
[data-grade] { color: var(--grade-color, var(--cream)); }
[data-grade="A"] { --grade-color: #9ee3ae; }
[data-grade="B"] { --grade-color: #9bd9f3; }
[data-grade="C"] { --grade-color: #f1d27c; }
[data-grade="D"] { --grade-color: #f4a76d; }
[data-grade="E"] { --grade-color: #ed9879; }
[data-grade="F"] { --grade-color: #fa858b; }
#date-result { grid-column: 1 / -1; color: var(--muted); }
.message { color: var(--gold); line-height: 1.4; }
.footer { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 16px 20px; padding: 18px 0 26px; color: var(--muted); font-size: .875rem; }
.footer summary { cursor: pointer; color: var(--red); }
.footer details p { margin-top: 8px; max-width: 60ch; line-height: 1.5; }
.site-credit { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 15px; line-height: 1.55; }
.site-credit strong { color: var(--cream); }
.site-credit span { display: inline-block; margin-left: 10px; white-space: nowrap; }
#round-summary { white-space: nowrap; }
dialog { width: min(530px, calc(100% - 28px)); padding: 0; max-height: 85vh; background: var(--panel); border: 1px solid #5e6972; border-top: 2px solid var(--red); color: var(--cream); }
dialog::backdrop { background: #0b0c10bc; }
.photo-dialog { width: min(1100px, calc(100% - 28px)); }
.photo-dialog img { display: block; width: 100%; max-height: calc(85vh - 65px); object-fit: contain; background: #101215; }
.dialog-body { display: grid; gap: 14px; padding: 16px; border-top: 1px solid var(--line); }
#account-form { display: grid; gap: 8px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#sign-out { justify-self: start; }
.score-table { overflow: auto; }
#history h3 { margin: 2px 0 10px; }
.score-table table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; }
.score-table th, .score-table td { border-bottom: 1px solid var(--line); padding: 9px 6px; }
.score-table td:last-child, .score-table th:last-child { text-align: right; }
.current-player { background: #48292c; color: var(--red); }
#leaderboard-rules, #leaderboard-status { line-height: 1.5; }
.leaderboard-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.leaderboard-mode select { min-height: 42px; padding: 7px 9px; color: var(--cream); background: #191d21; border: 1px solid #5e6972; font: inherit; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 28px); }
  .home-screen { margin-top: 21px; background-position: center, 62% center; }
  .board { grid-template-columns: 1fr; }
  .intro { flex-direction: column; align-items: start; gap: 14px; padding-top: 25px; }
  .play-options { justify-content: start; }
  .photo-frame { height: clamp(240px, 60vw, 420px); }
  .map-frame { height: clamp(300px, 75vw, 460px); }
  .wordmark { font-size: 1rem; }
  .masthead-inner { min-height: 62px; }
  .masthead-actions { gap: 6px; }
  .masthead-actions .button { min-height: 36px; font-size: .8125rem; padding: 6px 8px; }
}
@media (max-width: 510px) {
  .masthead-inner { flex-wrap: wrap; gap: 8px; padding-block: 10px; }
  .masthead-actions { flex-wrap: wrap; }
  .brand-mark { width: 38px; height: 38px; }
  .identity { gap: 8px; }
  .wordmark { font-size: .9rem; letter-spacing: .035em; }
  .home-screen {
    align-items: end;
    min-height: 430px;
    background-image: linear-gradient(0deg, #17191c 10%, #17191ca0 64%, #17191c50 100%), url("./images/8.webp");
  }
  .hint-bar { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .wordmark strong { display: block; }
}
@media (max-width: 375px) {
  .panel-head, #guess-form, .photo-foot, #city-search { padding-inline: 10px; }
  .masthead-inner { gap: 6px; }
  .identity { gap: 7px; }
  .brand-mark { width: 34px; height: 34px; }
  .site-credit span { display: block; margin-left: 0; }
}

.player-rank { display: inline-block; padding: 3px 8px; border: 1px solid currentColor; border-radius: 5px; font-weight: 700; white-space: nowrap; color: var(--muted); }
.player-rank[data-rank="EF-5"] { color: #e8b1ff; }
.player-rank[data-rank="EF-4"] { color: var(--red); }
.player-rank[data-rank="EF-3"] { color: var(--gold); }
.player-rank[data-rank="EF-2"] { color: #9bd9ad; }
.player-rank[data-rank="EF-1"] { color: #9fcfff; }
.rank-guide { margin-block: 16px; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.rank-guide summary { cursor: pointer; color: var(--cream); }
.rank-guide p { margin-top: 10px; }
.rank-guide ul { padding-left: 22px; columns: 2; }

.home-content h1 { max-width: none; }
.home-content { padding: clamp(20px, 3vw, 44px); }
.release-notes {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: .875rem;
  line-height: 1.5;
}
.release-notes summary { padding: 10px 13px; cursor: pointer; }
.release-notes summary::marker { color: var(--red); }
.release-notes summary span { margin-inline-start: 10px; color: var(--muted); }
.release-notes p { padding-inline: 13px; color: var(--cream); font-weight: 700; }
.release-notes ul { margin: 0; padding: 4px 16px 12px 32px; color: var(--muted); }
.release-notes li + li { margin-top: 5px; }
.release-notes li strong { color: var(--cream); }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.mode-card { width: 100%; grid-template-rows: auto; align-content: start; --mode-accent: var(--red); border-top: 3px solid var(--mode-accent); border-left-color: var(--mode-accent); }
.mode-card[data-mode="iconic"] { --mode-accent: #f2cd63; background: linear-gradient(145deg, #403820e8, #202328f5); }
.mode-card[data-mode="recent"] { --mode-accent: #82c7ff; background: linear-gradient(145deg, #203b50ed, #202328f5); }
.mode-card[data-mode="daily"] { --mode-accent: #d4b9f2; background: linear-gradient(145deg, #3a2b4bed, #202328f5); }
@media (min-width: 961px) {
  .mode-grid:has(#daily-card:not([hidden])) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mode-card h2, .mode-card .mode-kicker { color: var(--mode-accent); }
.mode-card .mode-kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
.mode-card .primary { background: var(--mode-accent); border-color: var(--mode-accent); color: #17191c; }
.mode-switch-note { margin-top: 18px; font-size: .85rem; color: var(--muted); line-height: 1.5; }
body[data-game-mode="iconic"] .eyebrow { color: #f2cd63; }
body[data-game-mode="recent"] .eyebrow { color: #82c7ff; }
body[data-game-mode="daily"] .eyebrow { color: #d4b9f2; }
@media (max-width: 960px) { .mode-grid { grid-template-columns: 1fr; } .home-screen { min-height: auto; } }
