/* proximity.css — the bottom-bar styles for trivia.html's per-question countdown +
   ghost avatar lane. The bar is always fixed to the viewport bottom and pinned via
   proximity.js (visualViewport + rAF loop). trivia.html layers its own .trivia-bar
   rules on top of these.

   (versus.html used this bar too — the COLD/HOT end labels, the .versus-active lane,
   and the me / avg / dnf / anon-self / pulsing avatar states were its. It stopped on
   chore/wiki-versus, and those rules went with it on 2026-09-14.)

   LIVE, NOT WIKI BLITZ. This began as Wiki Blitz's "warmth" bar — hence the
   proximity / warmer / cold-hot names and the cool-to-hot gradient on the mask,
   which trivia.html overrides with its countdown colours. The names are historical;
   do not delete this file as a wiki leftover.

   Requires CSS custom properties: --bg, --surface, --rule, --faint, --text,
   --muted, --cool, --gold, --green, --accent. */

.proximity-wrap {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 150;
  will-change: transform;
  display: none;
  flex-direction: column;
  background: rgba(255, 252, 247, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
  padding: 15px 12px calc(15px + env(safe-area-inset-bottom, 0px));
  gap: 8px;
}
.proximity-wrap.active { display: flex; }

.proximity-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proximity-track-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.proximity-bar-track {
  height: 12px;
  background: #F2E8D6;
  border-radius: 6px;
  position: relative;
}
.proximity-bar-mask {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  border-radius: 6px;
  transition: width 1.5s ease;
  background: linear-gradient(90deg,
    var(--cool) 0%,
    var(--gold) 50%,
    var(--accent) 80%,
    #C44A1F 100%);
  background-size: 100vw 100%;
  background-attachment: local;
}

/* Avatar lane — avatars ride on top of the track, inset so an avatar at 0% or
   100% sits fully inside it. trivia.html turns it on via .trivia-bar. */
.proximity-avatars-row {
  display: none;
  position: absolute;
  top: 50%; left: 17px; right: 17px;
  height: 0;
  pointer-events: none;
  z-index: 2;
}

.proximity-avatar {
  position: absolute;
  top: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #FFF;
  border: 2px solid var(--faint);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  overflow: hidden;
  transform: translate(-50%, -50%);
  /* PLC FLIP-friendly easing — matches the leaderboard's row-reorder
     transition so the bar and the list move on the same beat. */
  transition: left 650ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 650ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 260ms ease-out,
              filter 260ms ease-out;
  box-shadow: 0 2px 6px rgba(31, 26, 20, 0.18);
}
.proximity-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* In-round bar: KEEP the coloured ring + light centre. The ring
   is a LIVE STATUS signal here — it flashes green (done) / red (wrong) as players
   answer — so this must NOT become a solid identity disc (that treatment is for
   the static identity surfaces: lobby, countdown, leaderboards, ended standings). */
.proximity-avatar.friend {
  border-color: var(--pcolor, var(--text));
  color: var(--pcolor, var(--text));
}
.proximity-avatar.done   { border-color: var(--green); }
/* Trivia ghost bar: a wrong answer rings the avatar red (works for photo
   avatars, where we can't tint the fill). */
.proximity-avatar.wrong  { border-color: var(--danger, #D1544A); }
