/* The console's own palette, near enough that the demo and the real thing are
   recognisably the same object, small enough to read on a phone. */
:root {
  --ink: #0a0a0a;
  --panel: #101418;
  --line: rgba(255, 255, 255, 0.1);
  --text: #e5e5e5;
  --muted: #8a8a8a;
  --dim: #5a5a5a;
  --amber: #fcd34d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

#banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.6rem 0.9rem;
  background: rgba(252, 211, 77, 0.12);
  border-bottom: 1px solid rgba(252, 211, 77, 0.35);
  font-size: 13px;
}

#banner strong {
  color: var(--amber);
}

#banner span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#banner a {
  margin-left: auto;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

main {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 300px;
  height: calc(100% - 41px);
}

#map {
  height: 100%;
}

#rail {
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

#rail h2 {
  margin: 0 0 0.4rem;
  font: 600 10px/1 ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

#rail section + section {
  margin-top: 1.1rem;
}

.rows {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.row:first-child {
  border-top: 0;
}

.row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.row .swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
}

.row .label {
  flex: 1;
  font-size: 12px;
}

.row .count {
  font: 11px/1 ui-monospace, monospace;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.row[aria-pressed="false"] {
  color: var(--dim);
}

.row[aria-pressed="false"] .swatch {
  opacity: 0.28;
}

.note {
  margin: 0.5rem 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--dim);
}

#card {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  width: min(340px, calc(100% - 1.8rem));
  padding: 0.85rem;
  background: rgba(10, 10, 10, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

#card-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

#card h3 {
  margin: 0 0 0.15rem;
  font-size: 14px;
}

#card .kind {
  margin: 0 0 0.55rem;
  font: 10px/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

#card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
  font-size: 12px;
}

#card dt {
  font: 10px/1.5 ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

#card dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#card .caveat {
  margin: 0.6rem 0 0;
  font-size: 11px;
  color: var(--dim);
}

.mark {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.mark svg {
  display: block;
}

.chip {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* One column on a phone: the map first, the switches under it. */
@media (max-width: 720px) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh auto;
    height: auto;
  }

  #rail {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  #banner a {
    margin-left: 0;
  }
}
