/*
 * Scorpion Arena — Weighted Circle redesign (v2).
 *
 * Loaded AFTER weighted-wheel-v1/weighted-wheel.css and overrides it. Keeping
 * this as a separate file means the upstream wheel module stays untouched and
 * the whole redesign can be reverted by removing one <link>.
 *
 * Goals, from the reference screenshots:
 *   - a noticeably bigger wheel (the module capped it at 340px)
 *   - bigger, more readable pot / timer / player-count figures
 *   - each player's row tinted with their own wheel colour, showing their
 *     win probability as the primary figure
 *   - a clearly marked stopping point so the winner is unmistakable
 *   - the existing dark + gold palette, cleaner
 */

/* ------------------------------------------------------------------ */
/* palette                                                             */
/* ------------------------------------------------------------------ */

#ag2WheelView {
  --wwg2-gold: #f5c65b;
  --wwg2-gold-deep: #b8862b;
  --wwg2-ink: #05040a;
  --wwg2-panel: rgba(20, 15, 30, .92);
  --wwg2-line: rgba(245, 198, 91, .18);
  --wwg2-text: #f3eeff;
  --wwg2-muted: rgba(226, 216, 255, .55);
}

/* ------------------------------------------------------------------ */
/* 1. a bigger wheel                                                    */
/* ------------------------------------------------------------------ */

#ag2WheelView .wwg-stage {
  /* was max-width: 340px. Fill the phone width, minus a small margin,
     but stay circular and never taller than half the viewport. */
  max-width: min(calc(100vw - 24px), 62vh) !important;
  margin: 10px auto 22px !important;
}

/* the pointer that marks where the wheel stops — larger and gold so the
   landing position is unmistakable */
#ag2WheelView .wwg-tick {
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .75));
  transform: scale(1.35);
  transform-origin: 50% 0;
  z-index: 6 !important;
}

/* ------------------------------------------------------------------ */
/* 2. the centre hub and timer                                          */
/* ------------------------------------------------------------------ */

#ag2WheelView .wwg-hub {
  /* the reference puts the countdown inside the wheel, large and central */
  width: 128px !important;
  height: 128px !important;
  margin: -64px 0 0 -64px !important;
  border-width: 3px !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, .14), transparent 58%),
    radial-gradient(circle at 40% 35%, #1d1529, #0a0713) !important;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, .7),
    0 0 30px rgba(240, 194, 92, .22),
    inset 0 -12px 20px rgba(0, 0, 0, .6) !important;
}

#ag2WheelView .wwg-hub-icon {
  font-size: 30px !important;
}

/* the countdown, rendered inside the hub */
#ag2WheelView .wwg-hub .wwg-hub-timer {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--wwg2-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#ag2WheelView .wwg-hub .wwg-hub-caption {
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--wwg2-muted);
}

/* ------------------------------------------------------------------ */
/* 3. bigger headline numbers                                           */
/* ------------------------------------------------------------------ */

#ag2WheelView .wwg-stats {
  gap: 10px !important;
}

#ag2WheelView .wwg-stat {
  padding: 13px 10px !important;
  border-radius: 16px !important;
  background: var(--wwg2-panel) !important;
  border: 1px solid var(--wwg2-line) !important;
}

#ag2WheelView .wwg-stat .wwg-label {
  font-size: 9.5px !important;
  letter-spacing: .13em !important;
  color: var(--wwg2-muted) !important;
}

#ag2WheelView .wwg-stat .wwg-value {
  font-size: 26px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  font-variant-numeric: tabular-nums;
}

/* the pot is the first stat and the headline figure */
#ag2WheelView .wwg-stats > .wwg-stat:first-child .wwg-value {
  font-size: 30px !important;
  color: var(--wwg2-gold) !important;
  text-shadow: 0 0 22px rgba(245, 198, 91, .35);
}

#ag2WheelView .wwg-timer.wwg-urgent .wwg-value,
#ag2WheelView .wwg-stat.wwg-urgent .wwg-value {
  color: #ff6b6b !important;
}

/* ------------------------------------------------------------------ */
/* 4. clearer player rows                                               */
/* ------------------------------------------------------------------ */

#ag2WheelView .wwg-player {
  /* --wwg-seg-colour is set per row by the JS so the row matches that
     player's slice on the wheel, exactly like the reference */
  padding: 13px 14px !important;
  border-radius: 18px !important;
  border: 1px solid var(--wwg2-line) !important;
  background:
    linear-gradient(
      100deg,
      color-mix(in srgb, var(--wwg-row-colour, #8b5cf6) 26%, transparent),
      rgba(16, 12, 24, .9) 62%
    ) !important;
  margin-bottom: 10px !important;
}

#ag2WheelView .wwg-avatar {
  width: 48px !important;
  height: 48px !important;
  box-shadow:
    0 0 0 2px var(--wwg-row-colour, rgba(255, 255, 255, .2)),
    0 3px 10px rgba(0, 0, 0, .5) !important;
}

#ag2WheelView .wwg-player-name {
  font-size: 15px !important;
  font-weight: 800 !important;
}

#ag2WheelView .wwg-player-user {
  font-size: 12px !important;
  color: var(--wwg2-muted) !important;
}

/* win probability is the number players care about most, so it is the
   largest thing in the row after the name */
#ag2WheelView .wwg-player-prob {
  font-size: 18px !important;
  font-weight: 900 !important;
  color: var(--wwg2-gold) !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

#ag2WheelView .wwg-player-right {
  text-align: right;
  display: grid;
  gap: 3px;
  justify-items: end;
}

/* the colour swatch is redundant once the whole row is tinted */
#ag2WheelView .wwg-swatch {
  width: 4px !important;
  height: 34px !important;
  border-radius: 3px !important;
  flex: 0 0 auto;
}

#ag2WheelView .wwg-player-amt {
  font-size: 16px !important;
  font-weight: 900 !important;
  padding: 7px 13px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .07) !important;
  font-variant-numeric: tabular-nums;
}

/* your own row stands out */
#ag2WheelView .wwg-player.wwg-me {
  border-color: rgba(245, 198, 91, .55) !important;
  box-shadow: 0 0 0 1px rgba(245, 198, 91, .25) inset;
}

/* ------------------------------------------------------------------ */
/* 5. waiting state                                                     */
/* ------------------------------------------------------------------ */

#ag2WheelView .wwg-banner {
  padding: 12px 14px !important;
  border-radius: 14px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
}

/* ------------------------------------------------------------------ */
/* 6. winner reveal                                                     */
/* ------------------------------------------------------------------ */

#ag2WheelView .wwg-winner-card {
  border: 1px solid rgba(245, 198, 91, .5) !important;
  box-shadow: 0 0 44px rgba(245, 198, 91, .3) !important;
}

#ag2WheelView .wwg-winner-name {
  font-size: 21px !important;
  font-weight: 900 !important;
}

#ag2WheelView .wwg-winner-prize {
  font-size: 30px !important;
  font-weight: 900 !important;
  color: var(--wwg2-gold) !important;
}

#ag2WheelView .wwg-winner-avatar {
  width: 76px !important;
  height: 76px !important;
  box-shadow: 0 0 0 3px var(--wwg2-gold), 0 6px 20px rgba(0, 0, 0, .6) !important;
}

/* ------------------------------------------------------------------ */
/* 7. the floating close button from the outer shell                    */
/* ------------------------------------------------------------------ */
/* The shell no longer draws its own header, so its close button is
   positioned on its own and must not overlap the wheel's controls. */

.ag-wheel-original-close-float {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 40;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(12, 9, 18, .82);
  color: #efe8ff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* 8. small screens                                                     */
/* ------------------------------------------------------------------ */

@media (max-width: 380px) {
  #ag2WheelView .wwg-stat .wwg-value { font-size: 22px !important; }
  #ag2WheelView .wwg-stats > .wwg-stat:first-child .wwg-value { font-size: 25px !important; }
  #ag2WheelView .wwg-hub {
    width: 112px !important;
    height: 112px !important;
    margin: -56px 0 0 -56px !important;
  }
  #ag2WheelView .wwg-hub .wwg-hub-timer { font-size: 29px; }
  #ag2WheelView .wwg-avatar { width: 42px !important; height: 42px !important; }
}
