* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: ui-sans-serif, system-ui, sans-serif; }
body { background: #111; color: #eee; }

/* The [hidden] attribute must win over the ID-level display rules below. */
[hidden] { display: none !important; }

#gate {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #111; z-index: 10;
}
#gate-form { text-align: center; max-width: 320px; width: 90%; }
#gate-form h1 { font-size: 1.6rem; margin: 0 0 0.25rem; }
#gate-form p { margin: 0 0 1.25rem; color: #aaa; }
#gate-input {
  width: 100%; padding: 0.75rem 1rem; font-size: 1rem;
  background: #222; color: #eee; border: 1px solid #333; border-radius: 4px;
}
#gate-form button {
  margin-top: 0.75rem; padding: 0.6rem 1rem; width: 100%;
  background: #2a7; color: #fff; border: 0; border-radius: 4px; font-size: 1rem; cursor: pointer;
}
#gate-error { color: #e55; margin-top: 0.5rem; }

#app {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-rows: auto 1fr;
  grid-template-areas: "header header" "map list";
  height: 100vh;
}
header {
  grid-area: header;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid #222; background: #181818;
}
header h1 { font-size: 1.1rem; margin: 0; }
header h1 .tagline { color: #888; font-weight: 400; }
@media (max-width: 700px) {
  header h1 .tagline { display: none; }
}
.controls button {
  background: #222; color: #eee; border: 1px solid #333; border-radius: 4px;
  padding: 0.4rem 0.75rem; cursor: pointer; margin-left: 0.5rem;
}
.controls button:disabled { opacity: 0.5; cursor: not-allowed; }
#map { grid-area: map; background: #222; }
#list { grid-area: list; overflow-y: auto; border-left: 1px solid #222; background: #161616; }

.item {
  padding: 0.75rem 1rem; border-bottom: 1px solid #222; cursor: pointer;
}
.item:hover { background: #1d1d1d; }
.item h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.item .meta { color: #aaa; font-size: 0.85rem; }
.item .dist { color: #6c8; font-size: 0.8rem; margin-left: 0.5rem; }
.item .notes { margin-top: 0.25rem; font-size: 0.9rem; color: #ddd; }

@media (max-width: 700px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 60vh 1fr; grid-template-areas: "header" "map" "list"; }
  #list { border-left: 0; border-top: 1px solid #222; }
}
