/* ===== Hits widget - Live views + visitor map =====
   Uses the game's own CSS variables so it inherits the
   Daily Hue light/dark theme automatically. */

.hits-widget {
  --hw-w: 268px;
  width: var(--hw-w);
  flex: 0 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px 16px 13px;
  box-shadow: 0 24px 70px rgba(58, 68, 130, 0.14), 0 2px 8px rgba(58, 68, 130, 0.06);
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: background .3s ease, border-color .3s ease, color .3s ease;
  user-select: none;
}
.hits-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(140px 90px at 88% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(140px 90px at -8% 112%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.hits-widget > * { position: relative; }

.hw-head { display: flex; align-items: center; gap: 8px; }
.hw-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.hw-label {
  font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.hw-count {
  font-size: 29px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.12;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.hw-count b { font-weight: 800; }
.hw-count small {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin-left: 2px;
}
.hw-sub { font-size: 11px; font-weight: 600; color: var(--muted); margin: 1px 0 12px; }

.hw-map-wrap {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  overflow: hidden;
}
.hw-map { display: block; width: 100%; height: auto; }
.hw-land-dot { fill: color-mix(in srgb, var(--ink) 20%, transparent); }

.hw-arc {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 26%, transparent);
  stroke-width: 0.13;
  stroke-linecap: round;
}
.hw-arc-comet {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 0.2;
  stroke-linecap: round;
  stroke-dasharray: 0.09 0.91;
  animation: hw-comet 2.8s linear infinite;
}
.hw-visit-dot {
  fill: var(--accent);
  animation: hw-blink 3.2s ease-in-out infinite;
}
.hw-you-glow {
  fill: url(#hwYouGrad);
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--accent-2) 70%, transparent));
}
.hw-ring {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 0.14;
  transform-box: fill-box;
  transform-origin: center;
  animation: hw-pulse 2.4s ease-out infinite;
}
.hw-ring.d { animation-delay: 1.2s; }

.hw-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; margin-top: 11px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
}
.hw-foot b { color: var(--ink); font-weight: 800; }
.hw-foot .hw-live {
  display: inline-flex; align-items: center; gap: 5px;
  background: color-mix(in srgb, var(--green, #34d399) 14%, transparent);
  color: color-mix(in srgb, var(--green, #34d399) 65%, var(--ink));
  padding: 3px 8px; border-radius: 999px; font-weight: 800; font-size: 9.5px;
  letter-spacing: .04em;
}
.hw-foot .hw-live i {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: hw-blink 1.6s ease-in-out infinite;
}

.hits-widget.hidden { display: none !important; }

@keyframes hw-comet { to { stroke-dashoffset: -1; } }
@keyframes hw-pulse {
  0%   { transform: scale(.55); opacity: .9; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes hw-blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
  .hw-arc-comet, .hw-ring, .hw-visit-dot, .hw-live i { animation: none; }
  .hw-arc-comet { display: none; }
}

/* ===== Layout: widget sits next to the game card =====
   The game card keeps its own width (flex-wrap so the widget
   drops below instead of ever squeezing the game). */
.hits-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}
.hits-layout > .hits-widget { flex: 0 0 auto; }
.hits-layout > :not(.hits-widget) { flex: 0 0 auto; min-width: 0; }
@media (max-width: 860px) {
  .hits-layout { flex-direction: column; align-items: center; }
}
