:root {
  --bt-feedback-cyan: #37c7ff;
  --bt-feedback-green: #70ebb7;
  --bt-feedback-gold: #f3ca55;
  --bt-feedback-violet: #b884ff;
  --bt-feedback-pink: #ff4d89;
}

.bt-feedback-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: visible;
  color: #f7f9ff;
  border: 0;
  border-radius: 22px;
  background: transparent;
  font: inherit;
}

.bt-feedback-dialog::backdrop {
  background: rgb(2 5 13 / 82%);
  backdrop-filter: blur(9px) saturate(.7);
}

.bt-feedback-dialog-shell {
  position: relative;
  overflow: hidden auto;
  max-height: calc(100dvh - 32px);
  padding: 26px;
  border: 1px solid rgb(125 153 194 / 30%);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 0%, rgb(55 199 255 / 13%), transparent 35%),
    linear-gradient(145deg, #111927 0%, #090f19 58%, #080c14 100%);
  box-shadow: 0 30px 90px rgb(0 0 0 / 62%), inset 0 1px 0 rgb(255 255 255 / 5%);
}

.bt-feedback-dialog-shell::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: '';
  background: linear-gradient(90deg, var(--bt-feedback-cyan), var(--bt-feedback-violet), var(--bt-feedback-pink));
}

.bt-feedback-dialog[data-feedback-event="purchase"] .bt-feedback-dialog-shell::before {
  background: linear-gradient(90deg, var(--bt-feedback-gold), #ff8c4b, var(--bt-feedback-pink));
}

.bt-feedback-dialog[data-feedback-event="redeem"] .bt-feedback-dialog-shell::before {
  background: linear-gradient(90deg, var(--bt-feedback-green), var(--bt-feedback-cyan), var(--bt-feedback-violet));
}

.bt-feedback-dialog-header {
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.bt-feedback-art {
  position: relative;
  display: grid;
  min-height: 104px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(116 151 194 / 24%);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 5%), transparent 55%),
    rgb(3 9 16 / 78%);
}

.bt-feedback-art::after {
  position: absolute;
  inset: auto 12% 8px;
  height: 18px;
  content: '';
  border-radius: 50%;
  background: rgb(36 190 255 / 15%);
  filter: blur(12px);
}

.bt-feedback-art img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.bt-feedback-art.is-brand img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.bt-feedback-dialog-copy {
  min-width: 0;
}

.bt-feedback-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--bt-feedback-green);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.bt-feedback-dialog-copy h2,
.bt-celebration-copy h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.04;
}

.bt-feedback-dialog-copy p,
.bt-celebration-copy p {
  margin: 10px 0 0;
  color: #aebbd0;
  font-size: .93rem;
  line-height: 1.52;
}

.bt-feedback-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 9px;
  margin: 22px 0 0;
}

.bt-feedback-detail {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgb(119 149 188 / 20%);
  border-radius: 12px;
  background: rgb(3 8 15 / 44%);
}

.bt-feedback-detail dt {
  color: #73849f;
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.bt-feedback-detail dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: #edf4ff;
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.35;
}

.bt-feedback-dialog-controls,
.bt-celebration-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}

.bt-feedback-dialog-actions {
  display: flex;
  gap: 9px;
}

.bt-feedback-button,
.bt-celebration-close,
.bt-feedback-sound {
  min-height: 42px;
  border-radius: 11px;
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
}

.bt-feedback-button {
  min-width: 132px;
  padding: 0 18px;
  border: 1px solid transparent;
}

.bt-feedback-button.is-secondary,
.bt-celebration-close {
  color: #ccd5e4;
  border-color: rgb(131 153 185 / 30%);
  background: rgb(255 255 255 / 4%);
}

.bt-feedback-button.is-primary {
  color: #04130e;
  border-color: #8bf5ca;
  background: linear-gradient(135deg, #95f4cf, #56dca6);
  box-shadow: 0 9px 28px rgb(68 226 170 / 16%);
}

.bt-feedback-button:hover,
.bt-celebration-close:hover,
.bt-feedback-sound:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.bt-feedback-button:focus-visible,
.bt-celebration-close:focus-visible,
.bt-feedback-sound:focus-visible {
  outline: 3px solid rgb(55 199 255 / 48%);
  outline-offset: 3px;
}

.bt-feedback-sound {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  color: #aab8cc;
  border: 1px solid transparent;
  background: transparent;
}

.bt-feedback-sound-indicator {
  position: relative;
  width: 22px;
  height: 22px;
  border: 1px solid rgb(120 151 190 / 34%);
  border-radius: 50%;
  background: rgb(255 255 255 / 4%);
}

.bt-feedback-sound-indicator::before,
.bt-feedback-sound-indicator::after {
  position: absolute;
  bottom: 5px;
  width: 3px;
  content: '';
  border-radius: 3px;
  background: currentColor;
}

.bt-feedback-sound-indicator::before {
  left: 6px;
  height: 7px;
}

.bt-feedback-sound-indicator::after {
  right: 6px;
  height: 11px;
}

.bt-feedback-sound[aria-pressed="true"] {
  color: var(--bt-feedback-green);
}

.bt-feedback-sound[aria-pressed="false"] .bt-feedback-sound-indicator::after {
  height: 3px;
}

.bt-celebration-layer {
  position: fixed;
  z-index: 12000;
  inset: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.bt-celebration-card {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px;
  width: min(650px, calc(100vw - 36px));
  margin-top: 0;
  padding: 19px;
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid rgb(112 235 183 / 42%);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgb(112 235 183 / 14%), transparent 38%),
    linear-gradient(145deg, rgb(15 28 34 / 98%), rgb(6 12 20 / 98%));
  box-shadow: 0 28px 80px rgb(0 0 0 / 58%), 0 0 42px rgb(78 221 173 / 9%);
  opacity: 0;
  transform: translateY(-18px) scale(.97);
  transition: opacity .28s ease, transform .38s cubic-bezier(.2, .8, .2, 1);
}

.bt-celebration-layer.is-visible .bt-celebration-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.bt-celebration-layer.is-leaving .bt-celebration-card {
  opacity: 0;
  transform: translateY(-10px) scale(.98);
}

.bt-celebration-layer[data-feedback-event="purchase"] .bt-celebration-card {
  border-color: rgb(243 202 85 / 46%);
  background:
    radial-gradient(circle at 0% 0%, rgb(243 202 85 / 16%), transparent 38%),
    linear-gradient(145deg, rgb(31 27 17 / 98%), rgb(7 12 19 / 98%));
}

.bt-celebration-layer[data-feedback-event="tournament_win"] .bt-celebration-card,
.bt-celebration-layer[data-feedback-event="prize_claim"] .bt-celebration-card {
  border-color: rgb(184 132 255 / 48%);
}

.bt-celebration-card .bt-feedback-art {
  min-height: 100px;
}

.bt-celebration-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  min-width: 0;
}

.bt-celebration-copy h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.bt-celebration-footer {
  margin-top: 12px;
}

.bt-celebration-close {
  min-height: 34px;
  padding: 0 13px;
}

.bt-celebration-glow {
  position: absolute;
  z-index: 0;
  inset: -70% auto auto -18%;
  width: 260px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(112 235 183 / 10%);
  filter: blur(26px);
}

.bt-celebration-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bt-celebration-particles i {
  position: absolute;
  top: calc(50% - 190px);
  left: calc(50% + var(--particle-x));
  width: 7px;
  height: 17px;
  border-radius: 4px;
  background: var(--bt-feedback-cyan);
  opacity: 0;
  transform: translateY(10px) rotate(calc(var(--particle-index) * 29deg));
}

.bt-celebration-fireworks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bt-celebration-firework {
  --burst-x: 50%;
  --burst-y: 32%;
  position: absolute;
  top: var(--burst-y);
  left: var(--burst-x);
  width: 8px;
  height: 8px;
}

.bt-celebration-firework:nth-child(1) { --burst-x: 23%; --burst-y: 29%; }
.bt-celebration-firework:nth-child(2) { --burst-x: 77%; --burst-y: 25%; }
.bt-celebration-firework:nth-child(3) { --burst-x: 69%; --burst-y: 69%; }

.bt-celebration-firework i {
  position: absolute;
  inset: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bt-feedback-green);
  box-shadow: 0 0 10px currentColor;
  opacity: 0;
  transform: rotate(var(--spark-angle)) translateY(0) scale(.2);
}

.bt-celebration-firework:nth-child(2) i { background: var(--bt-feedback-gold); }
.bt-celebration-firework:nth-child(3) i { background: var(--bt-feedback-violet); }

.bt-celebration-layer.is-visible .bt-celebration-firework i {
  animation: bt-feedback-firework 1.15s cubic-bezier(.12, .62, .2, 1) both;
  animation-delay: calc(.18s + var(--burst-index) * .32s);
}

.bt-celebration-particles i:nth-child(3n) { background: var(--bt-feedback-gold); }
.bt-celebration-particles i:nth-child(3n + 1) { background: var(--bt-feedback-pink); }

.bt-celebration-layer.is-visible .bt-celebration-particles i {
  animation: bt-feedback-confetti 1.25s cubic-bezier(.15, .65, .25, 1) both;
  animation-delay: calc(var(--particle-index) * 24ms);
}

@keyframes bt-feedback-confetti {
  0% { opacity: 0; transform: translateY(30px) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(245px) translateX(var(--particle-x)) rotate(330deg); }
}

@keyframes bt-feedback-firework {
  0% { opacity: 0; transform: rotate(var(--spark-angle)) translateY(0) scale(.2); }
  18% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--spark-angle)) translateY(-74px) scale(1); }
}

@media (max-width: 620px) {
  .bt-feedback-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
  }

  .bt-feedback-dialog-shell {
    max-height: calc(100dvh - 18px);
    padding: 19px;
    border-radius: 18px;
  }

  .bt-feedback-dialog-header,
  .bt-celebration-card {
    grid-template-columns: 1fr;
  }

  .bt-feedback-dialog-header {
    gap: 14px;
  }

  .bt-feedback-dialog-header .bt-feedback-art {
    min-height: 0;
    max-height: 126px;
  }

  .bt-feedback-dialog-header .bt-feedback-art img {
    max-height: 126px;
  }

  .bt-feedback-details {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .bt-feedback-dialog-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .bt-feedback-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bt-feedback-button {
    min-width: 0;
  }

  .bt-celebration-layer {
    inset: 9px;
  }

  .bt-celebration-card {
    gap: 10px;
    width: calc(100vw - 18px);
    margin-top: 0;
    padding: 14px;
  }

  .bt-celebration-card .bt-feedback-art {
    max-height: 94px;
  }

  .bt-celebration-card .bt-feedback-art img {
    max-height: 94px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-feedback-button,
  .bt-celebration-close,
  .bt-feedback-sound,
  .bt-celebration-card {
    transition: none;
  }

  .bt-feedback-button:hover,
  .bt-celebration-close:hover,
  .bt-feedback-sound:hover,
  .bt-celebration-layer.is-visible .bt-celebration-card,
  .bt-celebration-layer.is-leaving .bt-celebration-card {
    transform: none;
  }

  .bt-celebration-particles,
  .bt-celebration-fireworks {
    display: none;
  }
}
