/*
 * Fifth circuit: 4 Beginner + 1 Intermediate.
 * Responsive menu lives entirely within the race board, never in a new row.
 * The 320px portrait and short landscape layouts use a 3×2 grid.
 */
.map-menu[hidden] { display: none; }
.map-menu { width: min(355px, calc(100% - 12px)); max-height: min(315px, calc(100% - 63px)); }
.map-option { min-height: 39px; margin-bottom: 2px; }
.map-option-body strong { white-space: normal; }
.map-option-body small { white-space: normal; line-height: 1.1; overflow-wrap: anywhere; }
.map-option[data-circuit="hairpin-hollow"] .map-option-no {
  color: #12283e;
  background: #f9cb8a;
}
.map-option[data-circuit="hairpin-hollow"][aria-current="true"] {
  border-color: #f9cb8a;
  box-shadow: inset 3px 0 0 #f9cb8a;
}
@media (max-width: 920px) and (orientation: portrait) {
  .map-menu:not([hidden]) {
    top: 46px;
    max-height: calc(100% - 50px);
    padding: 3px;
  }
  .map-menu-title { margin: 2px 3px 4px; }
  .map-option { height: 36px; min-height: 36px; padding: 2px 5px; margin-bottom: 2px; }
  .map-option-no { width: 24px; height: 24px; flex: 0 0 24px; }
  .map-option-body strong { font-size: 10px; }
  .map-option-body small { font-size: 8px; }
}
/* At 320 and 360px the course itself is short: compact side-by-side cards. */
@media (max-width: 375px) and (orientation: portrait),
       (max-width: 760px) and (orientation: landscape),
       (max-height: 450px) and (orientation: landscape) {
  .map-menu:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    grid-template-rows: auto repeat(2,51px);
    gap: 3px;
    align-content: start;
    width: calc(100% - 8px);
    max-height: calc(100% - 49px);
    left: 4px;
    top: 45px;
    padding: 3px;
    overflow: hidden;
  }
  .map-menu-title {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0 3px 1px;
  }
  .map-menu-title span { font-size: 7px; }
  .map-option {
    min-width: 0;
    min-height: 51px;
    height: 51px;
    margin: 0;
    padding: 3px 4px;
    gap: 3px;
    overflow: hidden;
  }
  .map-option-no { width: 19px; height: 21px; flex: 0 0 19px; font-size: 9px; }
  .map-option-body { min-width: 0; gap: 2px; }
  .map-option-body strong { font-size: 8px; line-height: 1.05; white-space: normal; }
  .map-option-body small { font-size: 7px; line-height: 1.08; white-space: normal; }
}
/* Preserve legibility in the 667×375 landscape layout. */
@media (min-width: 540px) and (max-height: 450px) and (orientation: landscape) {
  .map-option-body strong { font-size: 10px; }
  .map-option-body small { font-size: 8px; }
  .map-option-no { width: 23px; height: 24px; flex: 0 0 23px; }
}
