/* Accordion disclosures (Airport details, ATIS, Live feeds), Collection, Attribution, Sponsor & Mobile */

#hud button:focus:not(:focus-visible),
#hud summary:focus:not(:focus-visible) {
  outline: none;
}

#hud details {
  margin: 0;
}

#hud summary {
  height: 26px;
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  color: #555;
  cursor: pointer;
}

#hud summary::-webkit-details-marker {
  display: none;
}

#hud summary:hover {
  color: #111827;
}

#hud summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  margin-right: 3px;
  border-top: 1.5px solid #888;
  border-right: 1.5px solid #888;
  transform: rotate(45deg);
}

#hud details[open] > summary::after {
  transform: rotate(135deg);
}

#airport-intro {
  color: #777;
  margin: 0 0 8px;
}

#airport-intro a {
  color: inherit;
}

#runways div,
#feeds div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

#runways b.closed,
#feeds .bad {
  color: #c0392b;
}

#counts {
  margin: 8px 0;
  color: #3c4a58;
}

#achievements:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 8px;
}

#achievements span {
  padding: 2px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 600;
}

#atis-details,
#atc-details,
#feeds-details {
  margin: 4px 0;
}

#atis-text {
  margin: 6px 0 4px;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #3c4a58;
}

#radio-lines {
  margin: 6px 0 4px;
  max-height: 160px;
  overflow-y: auto;
  scrollbar-width: none;
  font-size: 11.5px;
  line-height: 1.38;
  color: #3c4a58;
}

#radio-lines::-webkit-scrollbar {
  display: none;
}

#radio-lines div {
  margin-bottom: 5px;
}

#radio-lines button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #d6247e;
  font: 600 11.5px/1.38 inherit;
  cursor: pointer;
}

#radio-lines button:hover {
  text-decoration: underline;
}

#feeds {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #dde2e7;
  color: #5b6875;
  font-size: 11px;
}

#attribution-page p {
  margin: 2px 0 7px;
  font-size: 10px;
  line-height: 1.45;
  color: #888;
}

#attribution-page a {
  color: inherit;
}

#collection-page .panel-header h2 {
  flex: 1;
}

#collection-special {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  margin-right: -6px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #888;
  cursor: pointer;
}

#collection-special svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

#collection-special:hover {
  background: #f3f5f6;
}

#collection-special[aria-pressed="true"] {
  color: #c9932e;
}

#collection-special[aria-pressed="true"] svg {
  fill: currentColor;
}

#collection-count {
  margin: 0 0 8px;
  color: #666;
}

#collection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#collection-grid li {
  min-width: 0;
  padding: 4px 4px 6px;
  border-radius: 6px;
  background: #f3f5f6;
}

#collection-grid canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 107 / 67;
  pointer-events: none;
}

#collection-grid b,
#collection-grid span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#collection-grid b {
  margin-top: 3px;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.35;
  color: #222;
}

#collection-grid span {
  color: #777;
  font-size: 10px;
  line-height: 1.3;
}

#collection-grid .special b::after {
  content: " ★";
  color: #c9932e;
}

#collection-empty {
  margin: 8px 0 4px;
  color: #666;
}

body.tv #hud:not([data-view="plane"]),
body.tv #panel-toggle {
  display: none;
}

@media (max-width: 600px) {
  #hud {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    width: min(260px, calc(100vw - 56px));
  }

  #hud[data-collapsed="true"] {
    opacity: 0;
    pointer-events: none;
  }

  #panel-toggle {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    top: max(8px, env(safe-area-inset-top));
    left: calc(max(8px, env(safe-area-inset-left)) + min(260px, 100vw - 56px) + 8px);
    min-inline-size: 28px;
    min-block-size: 36px;
    padding: 0 8px;
  }

  #panel-toggle[aria-expanded="true"] span {
    display: none;
  }

  #panel-toggle[aria-expanded="false"] {
    left: max(8px, env(safe-area-inset-left));
    padding: 0 11px;
  }

  #panel-toggle[aria-expanded="false"] svg {
    transform: rotate(180deg);
  }

  .panel-page {
    max-height: min(360px, 48dvh);
  }

  #flight-search {
    font-size: 16px;
  }

  #hud[data-view="collection"] #collection-page {
    max-height: min(520px, 70dvh);
  }
}

@media (prefers-reduced-motion: reduce) {
  #hud,
  .panel-page,
  .chat-fade {
    transition: none;
  }
  #truck-lights i {
    animation: none;
    opacity: 0.6;
  }
}
