.history-shelf { margin: 16px 0; }
.history-shelf-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 3px 12px; margin-bottom: 8px; }
.history-shelf h2 { font: clamp(23px, 3vw, 30px) var(--serif); margin: 0; }
.history-shelf-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.history-mode-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  padding: 11px 13px;
  background: #faf8ef;
  border: 1px solid #cbd2bf;
  border-radius: 12px;
  box-shadow: 0 2px 0 #263b2912;
}
.history-mode-card:hover { background: #eef2e3; }
.history-mode-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #c7d0bb;
  border-radius: 9px;
  color: #34543e;
  background: #e9eedf;
}
.history-mode-icon svg { width: 24px; height: 24px; }
.history-mode-card strong { display: block; font: clamp(17px, 2.3vw, 22px) var(--serif); }
.history-mode-card small { display: block; margin-top: 3px; color: #52624f; line-height: 1.35; }
.history-mode-card > span:last-child { color: #36543b; font-size: 19px; }
.history-nav-link, .history-main .game-breadcrumb a, .history-main footer a {
  color: var(--ink);
  text-underline-offset: 4px;
}
.history-intro { margin-bottom: 22px; }
.history-total { text-align: right; }
.history-total .eyebrow { justify-content: end; }
#history-score { font: 34px var(--serif); white-space: nowrap; }
#history-score small { font: 13px var(--sans); color: #697563; }
.history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 17px;
}
.history-modes, .history-date { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.history-controls .secondary { color: var(--ink); margin: 0; min-height: 39px; text-decoration: none; }
.history-modes [aria-current="page"] { color: #f9f8ed; background: #2f4937; border-color: #2f4937; }
.history-date label { color: #455643; font-size: 12px; }
.history-date small { font-size: 9px; }
.history-date input {
  background: #fdfbf3;
  border: 1px solid #c7cebd;
  border-radius: 6px;
  padding: 8px;
  color: var(--ink);
  min-height: 39px;
  font: 13px var(--sans);
}
.history-grid { display: grid; align-items: start; gap: 16px; }
.chrono-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
.photo-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.history-panel {
  min-width: 0;
  border: 1px solid #cdd4c0;
  border-radius: 12px;
  background: #faf8f0;
  padding: clamp(16px, 2.8vw, 28px);
}
.history-panel h2 { font: clamp(28px, 3.7vw, 38px)/1.12 var(--serif); margin: 6px 0 12px; }
.history-round { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin: 0 0 14px; }
.history-round .eyebrow { margin: 0; }
.history-round strong { color: #37513e; font-size: 12px; text-align: right; }
.history-object {
  border: 1px solid #d2d8c8;
  background: #eff0e4;
  padding: 12px;
  border-radius: 9px;
}
.history-object[draggable="true"] { cursor: grab; }
.history-object[draggable="true"]:active { cursor: grabbing; }
.history-object img { display: block; width: 100%; height: clamp(155px, 23vw, 250px); object-fit: contain; border-radius: 5px; background: #e0e4d8; }
.history-object h2 { font-size: clamp(22px, 3vw, 29px); margin: 13px 0 7px; }
.history-object p, .history-instruction, .history-reveal p { font-size: 13px; line-height: 1.55; margin: 10px 0; }
.history-instruction { color: #53614e; }
.history-feedback { margin: 12px 0 0; padding: 11px; background: #f3e5d6; color: #663c2d; border-radius: 7px; font-size: 14px; }
.timeline-panel > .eyebrow { margin: 0 0 8px; }
.timeline-track { display: grid; gap: 8px; padding-left: 13px; border-left: 2px solid #c5cfba; }
.timeline-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  border: 1px solid #d4dcc8;
  background: #eaf0e0;
  padding: 8px 10px;
}
.timeline-card img, .history-result-list img { width: 54px; height: 50px; object-fit: contain; border-radius: 4px; background: #dce2d2; }
.timeline-card strong { display: block; font: 16px/1.2 var(--serif); }
.timeline-year { color: #33523d; font: 700 12px var(--sans); }
.history-badge {
  margin-left: auto;
  color: #37513e;
  border: 1px solid #c3d0ba;
  background: #edf0e5;
  border-radius: 30px;
  padding: 4px 8px;
  font: 700 9px var(--sans);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}
.history-badge[data-tier="medium"] { color: #654d22; background: #f4e9c7; border-color: #e4d4ac; }
.history-badge[data-tier="hard"] { color: #763e32; background: #f0dfd7; border-color: #e8ccbf; }
.timeline-slot {
  width: 100%;
  min-height: 44px;
  text-align: left;
  color: #36523e;
  border: 1px dashed #9eac94;
  border-radius: 7px;
  background: #fcfbf5;
  padding: 8px 11px;
  font: 600 13px var(--sans);
}
.timeline-slot span { margin-right: 6px; }
.timeline-slot:hover, .timeline-slot.drop-over { background: #deebd1; border-style: solid; }
.timeline-slot:disabled { background: #f0ece0; color: #765745; border-color: #d4cbbd; cursor: default; }
.photo-frame {
  max-height: clamp(255px, 54vw, 540px);
  overflow: auto;
  border-radius: 8px;
  background: #e6e7dc;
  overscroll-behavior: contain;
}
.historic-photo-view { width: 100%; overflow: hidden; }
.photo-frame img { display: block; width: 100%; max-width: none; height: auto; }
.photo-frame.zoomed { cursor: grab; }
.photo-frame.zoomed:active { cursor: grabbing; }
.photo-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.photo-tools button { min-width: 40px; min-height: 40px; margin: 0; }
#photo-zoom-level { min-width: 42px; text-align: center; color: #43563f; font-size: 12px; }
.history-label { font-weight: 700; font-size: 14px; color: #304837; }
.photo-year-heading { display: flex; align-items: center; justify-content: space-between; }
#photo-year-number {
  width: 88px;
  background: #fdfbf3;
  border: 1px solid #c7cebd;
  border-radius: 6px;
  color: #36543b;
  font: 18px var(--serif);
  padding: 6px 8px;
}
#photo-year { width: 100%; margin: 9px 0 4px; accent-color: #36543b; cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; font-size: 10px; color: #566451; }
.place-fieldset { display: grid; gap: 6px; padding: 0; margin: 14px 0 0; border: 0; min-width: 0; }
.place-fieldset legend { padding: 0 0 7px; }
.place-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 9px;
  background: #fdfbf3;
  border: 1px solid #d5dbcb;
  border-radius: 7px;
  cursor: pointer;
  font: 13px var(--sans);
}
.place-option:has(:checked) { background: #e9f0dc; border-color: #849c72; }
.place-option input { accent-color: #36543b; }
.photo-clues { display: flex; gap: 6px; align-items: start; flex-wrap: wrap; margin: 10px 0 14px; }
.photo-clues .secondary { margin: 0; }
.photo-hint { width: 100%; background: #ecf0e1; padding: 8px; margin: 0; border-radius: 6px; font-size: 12px; }
.history-reveal { margin: 12px 0; padding: 12px; background: #edf1e3; border-radius: 8px; }
.history-reveal h3 { font: 25px var(--serif); margin: 4px 0; }
.history-reveal .eyebrow { margin: 0; }
.history-credit { color: #4b604a; font-size: 11px; }
.history-credit a, .history-result-list a { color: #31573d; text-underline-offset: 3px; }
.photo-answer { font-weight: 700; color: #3b563e; }
.score-breakdown { display: grid; gap: 5px; font-size: 12px; }
.score-breakdown div { display: flex; gap: 6px; justify-content: space-between; border-bottom: 1px solid #d3dbc9; padding: 5px 0; }
.score-breakdown dd { margin: 0; white-space: nowrap; font-weight: 700; }
.history-result { max-width: 680px; margin: 0 auto; }
.history-result-list { padding: 0; display: grid; gap: 7px; }
.history-result-list li { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; background: #edf0e5; border-radius: 8px; padding: 8px; }
.history-result-list li > div { display: grid; gap: 4px; }
.history-result-list li span, .history-result-list li a { font-size: 12px; }
.history-result > .secondary { display: inline-block; margin: 8px 0 0; text-decoration: none; }
.history-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .history-grid { grid-template-columns: minmax(0, 1fr); }
  .history-intro { display: flex; align-items: end; gap: 10px; }
  .history-total .eyebrow { font-size: 8px; }
  #history-score { font-size: 24px; }
  #history-score small { font-size: 10px; }
}
@media (max-width: 560px) {
  .history-shelf-cards { grid-template-columns: 1fr; }
  .history-mode-card { padding: 14px; }
  .history-mode-card strong { font-size: 22px; }
}
