/* v45 — Stake-style Manual / Auto segmented pill + compact icon rail.
   Presentation only: no game mechanics, no DOM/JS changes. */

/* Scope: the bet-controls panel (identified by its trailing icon rail). */
section:has(> div:last-child > button[aria-label="Game rules"]) {
  --deck-rail-bg: #0b1a24 !important;
  --deck-seg-active: linear-gradient(180deg, #3d5a6d 0%, #35505f 100%) !important;
}

/* ---------- Manual / Auto segmented control ---------- */
section:has(> div:last-child > button[aria-label="Game rules"]) > div:nth-last-child(2) {
  display: flex !important;
  flex-direction: row-reverse !important; /* Auto on the right, Manual on the left */
  gap: 4px !important;
  padding: 3px !important;
  border-radius: 9999px !important;
  background: var(--deck-rail-bg) !important;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  margin-top: 6px !important;
}

section:has(> div:last-child > button[aria-label="Game rules"]) > div:nth-last-child(2) > button {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  border-radius: 9999px !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  padding: 7px 0 !important;
  font-size: 0 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  color: rgba(255, 255, 255, 0.55) !important;
  transition:
    background 0.18s ease,
    color 0.18s ease !important;
}

section:has(> div:last-child > button[aria-label="Game rules"])
  > div:nth-last-child(2)
  > button::after {
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
}

/* Left segment (DOM: settings button) */
section:has(> div:last-child > button[aria-label="Game rules"])
  > div:nth-last-child(2)
  > button:last-child::after {
  content: "Manual";
}

/* Right segment (DOM: autobet button) */
section:has(> div:last-child > button[aria-label="Game rules"])
  > div:nth-last-child(2)
  > button:first-child::after {
  content: "Auto";
}

section:has(> div:last-child > button[aria-label="Game rules"])
  > div:nth-last-child(2)
  > button:last-child {
  background: var(--deck-seg-active) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

section:has(> div:last-child > button[aria-label="Game rules"])
  > div:nth-last-child(2)
  > button:hover {
  color: rgba(255, 255, 255, 0.9) !important;
}

section:has(> div:last-child > button[aria-label="Game rules"])
  > div:nth-last-child(2)
  > button:active {
  transform: scale(0.985) !important;
}

/* ---------- Compact icon rail (Stake sizing) ---------- */
section:has(> div:last-child > button[aria-label="Game rules"]) > div:last-child {
  gap: 6px !important;
  padding: 5px 8px !important;
  margin-top: 6px !important;
  border-radius: 10px !important;
  background: rgba(11, 26, 36, 0.55) !important;
}

section:has(> div:last-child > button[aria-label="Game rules"]) > div:last-child > button {
  height: 28px !important;
  width: 28px !important;
}

section:has(> div:last-child > button[aria-label="Game rules"]) > div:last-child > button svg {
  height: 17px !important;
  width: 17px !important;
}

section:has(> div:last-child > button[aria-label="Game rules"]) > div:last-child > button:last-child {
  height: 28px !important;
  width: auto !important;
  padding: 0 10px !important;
  gap: 6px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}

section:has(> div:last-child > button[aria-label="Game rules"])
  > div:last-child
  > button:last-child
  svg {
  height: 15px !important;
  width: 15px !important;
}
