/* The inner conic spinner leaks through the transparent live choice layout. */
.ebz-choice-shell span[class*="conic-gradient"]:not(.ebz-choice-spin) {
  display: none !important;
}

/* Restrict the replacement treatment to cards that had that inner spinner. */
.ebz-choice-shell:has(span[class*="conic-gradient"]:not(.ebz-choice-spin)) label.ebz-booster-choice {
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  transition: transform .3s cubic-bezier(.2,.8,.2,1),
              border-color .3s ease, background-color .3s ease !important;
}

.ebz-choice-shell:has(span[class*="conic-gradient"]:not(.ebz-choice-spin)) label.ebz-booster-choice::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 1px solid rgba(255, 211, 104, .46);
  border-radius: inherit;
  opacity: .18;
  pointer-events: none;
  animation: ebz-booster-border-breathe 5.5s ease-in-out infinite;
}

.ebz-choice-shell:has(span[class*="conic-gradient"]:not(.ebz-choice-spin)) label.ebz-booster-choice::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -45%;
  z-index: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, rgba(255, 229, 148, .045), rgba(255, 241, 190, .095), rgba(255, 229, 148, .045), transparent);
  opacity: 0;
  transform: translate3d(0,0,0) skewX(-18deg);
  transition: opacity .2s ease, transform 0s .2s;
  pointer-events: none;
}

.ebz-choice-shell:has(span[class*="conic-gradient"]:not(.ebz-choice-spin)) label.ebz-booster-choice > * {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ebz-choice-shell:has(span[class*="conic-gradient"]:not(.ebz-choice-spin)) label.ebz-booster-choice:hover {
    border-color: rgba(255, 214, 117, .38) !important;
    background: rgba(255, 255, 255, .042) !important;
    transform: translateY(-1px) !important;
  }

  .ebz-choice-shell:has(span[class*="conic-gradient"]:not(.ebz-choice-spin)) label.ebz-booster-choice:hover::after {
    opacity: 1;
    transform: translate3d(450%,0,0) skewX(-18deg);
    transition: opacity .18s ease, transform .8s cubic-bezier(.18,.62,.24,1);
  }
}

@keyframes ebz-booster-border-breathe {
  0%, 100% { opacity: .16; }
  50% { opacity: .52; }
}

@media (prefers-reduced-motion: reduce) {
  .ebz-choice-shell:has(span[class*="conic-gradient"]:not(.ebz-choice-spin)) label.ebz-booster-choice::before {
    animation: none;
    opacity: .28;
  }
  .ebz-choice-shell:has(span[class*="conic-gradient"]:not(.ebz-choice-spin)) label.ebz-booster-choice::after {
    display: none;
  }
}

/* All service extras use the same quiet price treatment as Booster Seçimi. */
main span[class*="border-yellow-400/35"][class*="bg-yellow-500/15"],
main button[aria-expanded] > span > span[class*="border-yellow-400/35"][class*="bg-yellow-400/10"] {
  min-width: 0 !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: linear-gradient(105deg, #d79c2b 0%, #fff0ad 48%, #d99f2e 100%) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  font-family: Spiegel, "Segoe UI", system-ui, sans-serif !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: normal !important;
  letter-spacing: .01em !important;
  text-shadow: 0 1px 9px rgba(250, 204, 21, .14) !important;
}

/* Match the seven-second Koç Seçimi edge sweep on Duo Boost extras only. */
@property --ebz-duo-edge-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

main label:has(> button[role="checkbox"][id*="duo" i]),
main .ebz-choice-card[data-ebz-choice="duo"] > button {
  position: relative !important;
  isolation: isolate;
}

main label:has(> button[role="checkbox"][id*="duo" i])::before,
main .ebz-choice-card[data-ebz-choice="duo"] > button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--ebz-duo-edge-angle),
    transparent 0% 30%, rgba(251, 191, 36, .9) 42%,
    rgba(239, 68, 68, .72) 48%, transparent 58% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: ebz-duo-edge-sweep 7s linear infinite;
}

@keyframes ebz-duo-edge-sweep {
  to { --ebz-duo-edge-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  main label:has(> button[role="checkbox"][id*="duo" i])::before,
  main .ebz-choice-card[data-ebz-choice="duo"] > button::before {
    animation: none;
  }
}

/* Keep Flash Tuşu ahead of the other extras wherever that option exists. */
main .space-y-4 > .grid > :has(img[alt="Flash"]) {
  order: -1;
  grid-column: 1 / -1;
}

/* Duo Boost is always the first extra card (after Flash, when Flash exists). */
main .ebz-lp-options-grid > [data-ebz-choice="duo"],
main .ebz-win-options-grid label[for="duoBoostPremiumWin"] {
  order: 1 !important;
}

main .ebz-lp-options-grid label[for="offlinePremiumLp"],
main .ebz-win-options-grid label[for="offlinePremiumWin"] { order: 2 !important; }
main .ebz-lp-options-grid label[for="livePremiumLp"],
main .ebz-win-options-grid label[for="liveStreamPremiumWin"] { order: 3 !important; }
main .ebz-lp-options-grid label[for="priorityPremiumLp"],
main .ebz-win-options-grid label[for="priorityPremiumWin"] { order: 4 !important; }
main .ebz-lp-options-grid > .ebz-choice-shell,
main .ebz-win-options-grid > .ebz-choice-shell { order: 5 !important; }
main .ebz-lp-options-grid > [data-ebz-choice="champion"],
main .ebz-win-options-grid > [data-ebz-choice="champion"] { order: 6 !important; }

/* Native placement cards: keep the full-width Flash strip first. */
main .space-y-4:not(.ebz-lp-options-grid):not(.ebz-win-options-grid)
  > .grid > label {
  order: 1 !important;
}
main .space-y-4:not(.ebz-lp-options-grid):not(.ebz-win-options-grid)
  > .grid > label:has(> button[role="checkbox"][id*="duo" i]) {
  order: 0 !important;
}

/* Valorant RR/Win: flatten the native row so the overlay Duo card can lead it. */
main .space-y-4:has(> .ebz-choice-card[data-ebz-choice="duo"]):not(.ebz-lp-options-grid) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
main .space-y-4:has(> .ebz-choice-card[data-ebz-choice="duo"]) > * {
  min-width: 0 !important;
  margin-top: 0 !important;
}
main .space-y-4:has(> .ebz-choice-card[data-ebz-choice="duo"]) > .grid {
  display: contents !important;
}
main .space-y-4:has(> .ebz-choice-card[data-ebz-choice="duo"]) > .grid > * {
  order: 1 !important;
  min-width: 0 !important;
}
main .space-y-4:has(> .ebz-choice-card[data-ebz-choice="duo"]) > [data-ebz-choice="duo"] {
  order: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}
main .space-y-4:has(> .ebz-choice-card[data-ebz-choice="duo"]) > .ebz-choice-shell {
  order: 2 !important;
  grid-column: 1 / -1;
  width: 100% !important;
  margin: 0 !important;
}

/* Valorant Elo: keep the agent picker full-width above the reordered extras. */
main div:has(> h3):has(> .ebz-choice-card[data-ebz-choice="duo"]) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
main div:has(> h3):has(> .ebz-choice-card[data-ebz-choice="duo"]) > h3 {
  order: 0 !important;
  grid-column: 1 / -1;
  margin-bottom: 0 !important;
}
main div:has(> h3):has(> .ebz-choice-card[data-ebz-choice="duo"]) > .relative.z-40 {
  order: 1 !important;
  grid-column: 1 / -1;
  margin-bottom: 0 !important;
}
main div:has(> h3):has(> .ebz-choice-card[data-ebz-choice="duo"]) > .grid {
  display: contents !important;
}
main div:has(> h3):has(> .ebz-choice-card[data-ebz-choice="duo"]) > .grid > * {
  order: 3 !important;
  min-width: 0 !important;
}
main div:has(> h3):has(> .ebz-choice-card[data-ebz-choice="duo"]) > [data-ebz-choice="duo"] {
  order: 2 !important;
  width: 100% !important;
  margin: 0 !important;
}
main div:has(> h3):has(> .ebz-choice-card[data-ebz-choice="duo"]) > .ebz-choice-shell {
  order: 4 !important;
  width: 100% !important;
  margin: 0 !important;
}

@media (max-width: 639px) {
  main .space-y-4:has(> .ebz-choice-card[data-ebz-choice="duo"]):not(.ebz-lp-options-grid),
  main div:has(> h3):has(> .ebz-choice-card[data-ebz-choice="duo"]) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* The match-count slider does not need a second framed card. */
main div:has(> span[data-orientation="horizontal"] [role="slider"]) {
  border: 0 !important;
}

/* Placement: tighten only the oversized gaps between badge, emblem, fields and extras. */
main:has(a[href="/lol-placement"].border-yellow-400)
  .lol-order-theme div.relative.min-w-0.overflow-visible:has([role="slider"]) > .relative.z-20.mb-5.flex {
  margin-bottom: 12px !important;
}

main:has(a[href="/lol-placement"].border-yellow-400)
  .lol-order-theme div.relative.z-20:has(> .mb-6.text-center):has([role="slider"]) > .mb-6.text-center {
  margin-bottom: 12px !important;
}

main:has(a[href="/lol-placement"].border-yellow-400)
  .lol-order-theme div.relative.z-20:has(> .mb-6.text-center):has([role="slider"]) > .rounded-xl {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

main:has(a[href="/lol-placement"].border-yellow-400)
  .lol-order-theme div.relative.z-20:has(> .mb-6.text-center):has([role="slider"]) > .rounded-xl > .grid {
  margin-bottom: 18px !important;
}

main:has(a[href="/lol-placement"].border-yellow-400)
  .lol-order-theme div:has(> span[data-orientation="horizontal"] [role="slider"]) {
  margin-bottom: 18px !important;
  padding-top: 15px !important;
  padding-bottom: 15px !important;
}

main:has(a[href="/lol-placement"].border-yellow-400)
  .lol-order-theme div.relative.min-w-0.overflow-visible:has([role="slider"]) > .relative.z-20.mt-7 {
  margin-top: 16px !important;
  margin-bottom: 12px !important;
}

@media (min-width: 768px) {
  main:has(a[href="/lol-placement"].border-yellow-400)
    .lol-order-theme div.relative.z-20:has(> .mb-6.text-center):has([role="slider"]) > .mb-6.text-center img {
    width: 10.5rem !important;
    height: 10.5rem !important;
  }
}

@media (min-width: 1024px) {
  main:has(a[href="/lol-placement"].border-yellow-400)
    .lol-order-theme div.relative.min-w-0.overflow-visible:has([role="slider"]) {
    padding-top: 26px !important;
    padding-bottom: 28px !important;
  }
}

/* Extra-option cards are controls, so dragging or double-clicking must not select their copy. */
main label:has(> button[role="checkbox"]),
main label:has(> button[role="checkbox"]) *,
main .ebz-choice-card,
main .ebz-choice-card *,
main .ebz-choice-shell label.ebz-booster-choice,
main .ebz-choice-shell label.ebz-booster-choice *,
main .space-y-4 > .grid > :has(img[alt="Flash"]),
main .space-y-4 > .grid > :has(img[alt="Flash"]) * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent;
}
