/* Copyright (c) 2026 Yoda Games. All rights reserved.
   Darts — the board's square (#arena): the canvas (js/ui/arena.js draws the board, the darts and
   the sight), a soft spotlight on the wall behind it, the score pops by each dart, the banner when
   a visit ends and the how-to-aim tip for a first visit. Sizes follow --side, so everything scales
   with the board.
     #arena.can-aim  — your throw: no system cursor (the sight is the cursor)
     #arena.can-skip — the pause between visits: a click goes on */

#arena {
  position: relative;
  width: var(--side);
  height: var(--side);
  border-radius: 50%;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
  outline: none;
  background: radial-gradient(closest-side, rgba(255, 236, 190, 0.1), rgba(255, 236, 190, 0.035) 78%, transparent 100%);
}
#arena.can-aim { cursor: none; }
#arena.can-skip { cursor: pointer; }
#arena:focus-visible { box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.75); }
#board { position: absolute; inset: 0; display: block; pointer-events: none; }

/* ── The pops: a dart's score by the dart, rising and fading ── */
.callouts { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.pop {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border-radius: 9px;
  background: rgba(8, 15, 26, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 800;
  font-size: clamp(13px, calc(var(--side) * 0.036), 22px);
  line-height: 1.3;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  animation: pop-rise 1.1s ease-out forwards;
}
.pop.is-t { color: var(--gold-soft); border-color: rgba(255, 215, 0, 0.6); }
.pop.is-d, .pop.is-hit { color: var(--mint); border-color: rgba(126, 240, 166, 0.55); }
.pop.is-miss { color: var(--muted); }
.pop.is-bust { color: var(--bad); border-color: rgba(255, 122, 114, 0.6); }
.pop.is-cpu { box-shadow: inset 0 -2px 0 var(--cpu); }
@keyframes pop-rise {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.85); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  70% { opacity: 1; transform: translate(-50%, -95%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -125%) scale(1); }
}

/* ── The banner: the visit's total (100+ in gold), Bust, Game shot! ── */
.banner {
  position: absolute;
  left: 50%;
  top: 70%;
  transform: translate(-50%, -50%);
  max-width: 92%;
  padding: 0.18em 0.6em 0.22em;
  border-radius: 0.5em;
  background: rgba(8, 15, 26, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-weight: 900;
  font-size: clamp(24px, calc(var(--side) * 0.08), 60px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  color: #fff;
  text-transform: uppercase;
  pointer-events: none;
  animation: banner-in 1.25s ease both;
}
.banner.is-ton, .banner.is-win { color: #2a1a00; background: linear-gradient(135deg, var(--gold), var(--gold-2)); border-color: #fff3c4; box-shadow: 0 0 34px rgba(255, 215, 0, 0.45); }
.banner.is-bust { color: #fff; background: linear-gradient(135deg, #e5484d, #b3261e); border-color: #ffb0a8; }
.banner.is-none { color: var(--muted); font-size: clamp(20px, calc(var(--side) * 0.06), 44px); }
@keyframes banner-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  22% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(1); }
}

/* ── The first-visit tip: under the bull, never in the way of a click ── */
.coach {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 88%;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(8, 15, 26, 0.9);
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: var(--ink);
  font-size: clamp(14px, calc(var(--side) * 0.032), 17px);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: coach-in 0.5s 0.4s ease both;
}
.coach b { color: var(--gold-soft); font-weight: 800; }
@keyframes coach-in { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (prefers-reduced-motion: reduce) {
  .pop { animation: pop-fade 1.1s linear forwards; }
  .banner { animation: pop-fade 1.25s linear both; }
  .coach { animation: none; }
  @keyframes pop-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
}
