/* Tag. Panels/buttons/top bar come from ../shared/arcade.css. */

html, body { overflow: hidden; }

#game { position: fixed; inset: 0; }

#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;   /* the whole canvas is the thumbstick */
}

/* Everything below floats over the 3D view, so none of it may eat a drag. */
.hud, .role, .boost, .hud-banner { pointer-events: none; }
.hud .hud-btn { pointer-events: auto; }

.topbar.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  gap: 10px;
}

.scores { display: flex; gap: 8px; }
.sc {
  display: flex;
  align-items: baseline;
  gap: 7px;
  background: rgba(20, 14, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 13px;
  white-space: nowrap;      /* "The bot" used to wrap and make the chip ragged */
}
.sc i { font-style: normal; font-size: 0.82rem; color: #cbbfe0; }
.sc b { font-size: 1.2rem; color: #ffd23f; font-variant-numeric: tabular-nums; }
.sc.me { border-color: rgba(255, 208, 118, 0.55); }
.sc .streak {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ff9b4a;
  animation: streak-pulse 0.9s ease-in-out infinite;
}
@keyframes streak-pulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }

.timer {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f3ecdf;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  min-width: 2.2ch;
  text-align: center;
}
.timer.urgent { color: #ff6b6b; animation: tick 1s steps(2) infinite; }
@keyframes tick { 50% { opacity: 0.45; } }

.shop-state {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: #241a10;
  background: linear-gradient(180deg, #ffd97a, #f5b942);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.shop-state.cool { background: rgba(20, 14, 28, 0.72); color: #9d8bb5; }

/* The top bar is one no-wrap flex row, and at full size it asks for ~416px of
   content inside a bar that only has ~366px on a 390px phone — so the ice
   cream status (the last item, and a live mechanic you need to read) was
   being pushed clean off the right edge on every phone width. Nothing here
   changes the layout on a laptop; it just buys back the ~50px the row was
   over budget by, smallest-loss-first: the decorative word goes, then the
   padding and gaps tighten. */
@media (max-width: 460px) {
  .topbar.hud { gap: 8px; }
  .topbar.hud .hud-btn { padding: 9px 12px; }
  .sc { padding: 5px 10px; gap: 5px; }
  .shop-state { font-size: 0.8rem; padding: 5px 10px; }
  .shop-word { display: none; }
  .timer { font-size: 1.35rem; }
}

/* One more step for the very narrow (a 320px iPhone SE and friends), where
   even the budget above is ~20px short. */
@media (max-width: 340px) {
  .topbar.hud { gap: 6px; }
  .sc { padding: 4px 8px; gap: 4px; }
  .sc i { font-size: 0.74rem; }
  .sc b { font-size: 1.05rem; }
  .timer { font-size: 1.2rem; }
}

/* Who is chasing whom. The single most important thing on screen. */
.role {
  position: absolute;
  top: max(58px, calc(env(safe-area-inset-top) + 50px));
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  font-weight: 700;
  color: #cbbfe0;
  background: rgba(20, 14, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 16px;
  white-space: nowrap;
}
.role.it {
  color: #241a10;
  background: linear-gradient(180deg, #ff8a4d, #ff5d4d);
  border-color: transparent;
}

/* Boost meter, bottom centre and out of the thumb's way. */
.boost {
  position: absolute;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 16px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: min(260px, 62vw);
}
.boost-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(20, 14, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.boost-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffd23f, #ff8a4d);
  transition: width 0.1s linear;
}
#boost-label { font-size: 0.8rem; font-weight: 700; color: #ffd23f; text-shadow: 0 2px 6px rgba(0,0,0,0.6); }

.hud-banner {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hud-banner b {
  font-size: clamp(1.8rem, 8vw, 3rem);
  color: #ffd23f;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
}
.hud-banner span { font-size: 0.95rem; color: #f3ecdf; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }

/* Floating thumbstick: it appears where the thumb lands, not in a fixed corner. */
.stick {
  position: absolute;
  width: 108px;
  height: 108px;
  margin: -54px 0 0 -54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 14, 28, 0.35);
  pointer-events: none;
}
.stick i {
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(255, 210, 63, 0.75);
}

.rules { line-height: 1.55; }
.rules b { color: #ffd23f; }

.final { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.final-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.final-row b { font-size: 1.3rem; color: #ffd23f; }
