/* The bases carousel (bases.js): top centre, "‹ [head] username ›" and nothing else, plain on the
   world (no card); a tap on the name drops the list of bases under it. Clear of the top left (the
   panel, 320 px, and the buttons right of it, to 434 px), the players top right, the compass and the
   phone's camera button. */
#bases {
  top: calc(var(--gap) + var(--sat)); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar));
  display: flex; align-items: center; height: 44px; z-index: 2;
  text-shadow: var(--shade); pointer-events: auto; touch-action: none;
}
#bases[hidden] { display: none; }
#bases button, #bases button:hover { text-decoration: none; }
#bases button { margin: 0; border: 0; border-radius: 0; background: none; color: var(--text); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* two simple arrows, each a 44 px target */
#bases .arrow { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: var(--text); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85)); }
#bases .arrow svg { width: 18px; height: 18px; }
#bases .arrow:active { opacity: 0.6; }
#bases .label { flex: 0 1 auto; min-width: 0; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 2px; touch-action: none; }
#bases .label .head { flex: none; width: 26px; height: 26px; display: block; image-rendering: pixelated; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
#bases .label .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
/* the list: under the name, the most interesting first, with what makes each so */
#bases .list {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: max(100%, 260px); margin: 4px 0 0; padding: 4px; list-style: none;
  max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: rgba(0, 0, 0, 0.72);
}
#bases .list li { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px; cursor: pointer; }
#bases .list li:hover, #bases .list li.on { background: rgba(255, 255, 255, 0.1); }
#bases .list .rk { flex: none; width: 18px; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
#bases .list .head { flex: none; width: 22px; height: 22px; image-rendering: pixelated; }
#bases .list .lines b { font-weight: 600; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bases .list .sub { font-size: 11px; color: var(--dim); white-space: nowrap; }

/* a narrower computer: centred in the room between the top left (to 434 px) and the players */
@media (max-width: 1240px) {
  :root:not(.m-compact) #bases { left: calc(var(--gap) + var(--sal) + 434px); right: calc(var(--gap) + var(--sar) + 180px); transform: none; width: auto; justify-content: center; }
}
/* narrower still: under the buttons right of the panel */
:root:not(.m-compact).m-medium #bases { top: calc(var(--gap) + var(--sat) + 52px); left: calc(var(--gap) + var(--sal) + 334px); }

/* a phone held upright, a visitor: the top line is the world's alone, the carousel in its middle
   (clear of the compass, top right) */
.m-compact:not(.m-land) #bases { max-width: calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar) - 2 * 48px); }
/* a player's phone: their name and buttons (the map among them) are on the top line and the players
   down the right, so the carousel is the second line, left of the players */
.m-compact.playing:not(.m-land) #bases {
  top: calc(var(--gap) + var(--sat) + 52px); left: calc(var(--gap) + var(--sal)); transform: none;
  max-width: calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar) - 150px - 8px);
}
.m-compact.playing:not(.m-land) #bases .label .nm { font-size: 14px; }
/* (narrow there, beside the players: slimmer arrows, a smaller head, the most room for the name) */
.m-compact.playing:not(.m-land) #bases .arrow { width: 30px; }
.m-compact.playing:not(.m-land) #bases .label { gap: 6px; padding: 0; }
.m-compact.playing:not(.m-land) #bases .label .head { width: 20px; height: 20px; }
.m-compact.playing:not(.m-land) #bases .list { left: 0; transform: none; }
/* a phone on its side: top centre, between the panel and the players */
.m-compact.m-land #bases { max-width: 42vw; }

/* one thing at a time: not over the big map, an open checklist or the list of players on a phone,
   nor in a frame that shows the picture alone */
.map-big #bases, .m-compact.check-open #bases, .m-compact.players-open #bases, .embed #bases { display: none; }
@media (prefers-reduced-motion: reduce) { #bases .arrow, #bases .label { transition: none; } }
/* no live world in this browser (the picture instead, ui.js `noWorld`): no camera to fly, so no arrows;
   the most interesting base's head and name, which open the ranking (the leaderboard there) */
.no-gpu #bases .arrow { display: none; }
.no-gpu #bases .list li { cursor: default; }
.no-gpu #bases .list li:hover { background: none; }
