/* DG Chance Box — scoped styles only */
.dgcb-box {
  --dgcb-ink: #33280f;
  --dgcb-muted: #786a48;
  --dgcb-gold: #e3a008;
  --dgcb-gold-dark: #b87500;
  --dgcb-soft: #fff9e8;
  --dgcb-border: #efd384;
  direction: rtl;
  position: relative;
  width: 100%;
  margin: 0 0 14px;
  border: 1px solid var(--dgcb-border);
  border-radius: 14px;
  color: var(--dgcb-ink);
  background:
    radial-gradient(circle at 8% 0, rgba(255, 211, 74, .25), transparent 34%),
    linear-gradient(145deg, #fffef9 0%, var(--dgcb-soft) 100%);
  box-shadow: 0 7px 24px rgba(91, 66, 6, .08);
  overflow: hidden;
  font-family: inherit;
  box-sizing: border-box;
}

.dgcb-box *, .dgcb-box *::before, .dgcb-box *::after { box-sizing: border-box; }

.dgcb-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 13px 10px;
  border-bottom: 1px dashed rgba(184, 117, 0, .27);
}

.dgcb-icon {
  display: inline-flex;
  flex: 0 0 39px;
  width: 39px;
  height: 39px;
  align-items: center;
  justify-content: center;
  color: #9e6500;
  border-radius: 11px;
  background: #fff1b7;
}

.dgcb-icon svg { width: 31px; height: 31px; }

.dgcb-heading {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  line-height: 1.5;
}

.dgcb-heading strong { font-size: 14.5px; font-weight: 800; color: #35290d; }
.dgcb-heading small { font-size: 10.5px; color: var(--dgcb-muted); }

.dgcb-quality {
  flex: 0 0 auto;
  max-width: 105px;
  padding: 5px 8px;
  border: 1px solid #eccb6b;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: #855600;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dgcb-body { padding: 11px 13px 12px; }

.dgcb-intro {
  min-height: 35px;
  margin: 0 0 9px;
  color: #6c5d3d;
  font-size: 11.5px;
  line-height: 1.75;
}

.dgcb-showcase {
  position: relative;
  margin-bottom: 10px;
  padding: 9px;
  border: 1px solid rgba(215, 162, 24, .32);
  border-radius: 11px;
  background: rgba(255, 255, 255, .8);
  overflow: hidden;
}

.dgcb-showcase-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #674500;
  line-height: 1.55;
}

.dgcb-showcase-title strong { font-size: 11.5px; font-weight: 800; }
.dgcb-showcase-title small { color: #8b7954; font-size: 9px; }

.dgcb-prizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
}

.dgcb-prize {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  padding: 5px 6px;
  border: 1px solid #ecd181;
  border-radius: 8px;
  color: #805300;
  background: linear-gradient(145deg, #fffdf6, #fff4c9);
  text-align: center;
  transition: transform .2s ease, filter .2s ease;
}

.dgcb-prize strong { font-size: 12px; font-weight: 800; line-height: 1.3; }
.dgcb-prize small { color: #9b7932; font-size: 8.5px; line-height: 1.2; }
.dgcb-prize.is-blank { border-style: dashed; color: #817760; background: #faf8f1; }
.dgcb-prize-loading { grid-column: 1 / -1; padding: 8px; color: #8b7954; text-align: center; font-size: 10.5px; }

.dgcb-box.is-spinning .dgcb-prize {
  animation: dgcbPulse .28s ease-in-out infinite alternate;
  filter: blur(.35px);
}
.dgcb-box.is-spinning .dgcb-prize:nth-child(2n) { animation-delay: .08s; }
.dgcb-box.is-spinning .dgcb-prize:nth-child(3n) { animation-delay: .16s; }

@keyframes dgcbPulse {
  from { transform: translateY(-3px) scale(.98); opacity: .62; }
  to { transform: translateY(3px) scale(1.02); opacity: 1; }
}

.dgcb-picker {
  padding: 10px 9px 9px;
  border: 1px solid rgba(184, 117, 0, .25);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255, 250, 230, .92), rgba(255, 255, 255, .96));
}

.dgcb-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  line-height: 1.55;
}

.dgcb-picker-head strong { flex: 0 0 auto; color: #674500; font-size: 11.5px; font-weight: 800; }
.dgcb-picker-head span { color: #837454; font-size: 9.5px; text-align: left; }

.dgcb-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.dgcb-choice {
  --dgcb-gift-light: #f8c94e;
  --dgcb-gift-dark: #d78a00;
  appearance: none;
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  padding: 7px 3px 5px;
  border: 1px solid rgba(222, 178, 70, .42);
  border-radius: 10px;
  color: #6e4b08;
  background: rgba(255, 255, 255, .72);
  font-family: inherit;
  cursor: pointer;
  opacity: 1;
  transition: transform .18s ease, opacity .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.dgcb-choice:nth-child(2) { --dgcb-gift-light: #d49af2; --dgcb-gift-dark: #8f4ab4; }
.dgcb-choice:nth-child(3) { --dgcb-gift-light: #71d9c7; --dgcb-gift-dark: #218b7d; }
.dgcb-choice:not(:disabled):hover { transform: translateY(-2px); border-color: var(--dgcb-gift-dark); box-shadow: 0 6px 14px rgba(89, 64, 10, .12); }
.dgcb-choice:not(:disabled):active { transform: translateY(0) scale(.98); }
.dgcb-choice:focus-visible { outline: 2px solid #c88700; outline-offset: 2px; }
.dgcb-choice:disabled { cursor: not-allowed; opacity: .52; }
.dgcb-choice.is-opening, .dgcb-choice.is-open { opacity: 1; border-color: var(--dgcb-gift-dark); box-shadow: 0 6px 17px rgba(89, 64, 10, .14); }
.dgcb-choice.is-muted { opacity: .32; }

.dgcb-gift {
  position: relative;
  display: block;
  width: 68px;
  height: 60px;
  transform-origin: 50% 100%;
}

.dgcb-gift-body {
  position: absolute;
  z-index: 1;
  right: 7px;
  bottom: 1px;
  width: 54px;
  height: 38px;
  border: 1px solid rgba(72, 45, 0, .2);
  border-radius: 3px 3px 7px 7px;
  background: linear-gradient(145deg, var(--dgcb-gift-light), var(--dgcb-gift-dark));
  box-shadow: inset 0 5px 8px rgba(255, 255, 255, .2), 0 4px 8px rgba(73, 49, 5, .12);
}

.dgcb-gift-lid {
  position: absolute;
  z-index: 4;
  top: 15px;
  right: 3px;
  width: 62px;
  height: 14px;
  border: 1px solid rgba(72, 45, 0, .22);
  border-radius: 5px;
  background: linear-gradient(145deg, var(--dgcb-gift-light), var(--dgcb-gift-dark));
  box-shadow: 0 3px 5px rgba(73, 49, 5, .14);
  transform-origin: 12% 80%;
  transition: transform .48s cubic-bezier(.2, .9, .25, 1.25);
}

.dgcb-gift-ribbon {
  position: absolute;
  z-index: 3;
  right: 28px;
  bottom: 1px;
  width: 12px;
  height: 52px;
  border-right: 1px solid rgba(93, 55, 0, .13);
  border-left: 1px solid rgba(93, 55, 0, .13);
  background: rgba(255, 248, 199, .78);
}

.dgcb-gift-bow {
  position: absolute;
  z-index: 5;
  top: 1px;
  right: 11px;
  width: 46px;
  height: 20px;
  transition: transform .48s cubic-bezier(.2, .9, .25, 1.25);
}

.dgcb-gift-bow i {
  position: absolute;
  top: 3px;
  width: 23px;
  height: 14px;
  border: 5px solid var(--dgcb-gift-dark);
  border-radius: 70% 45% 65% 45%;
  background: rgba(255, 255, 255, .45);
}
.dgcb-gift-bow i:first-child { right: 3px; transform: rotate(-18deg); }
.dgcb-gift-bow i:last-child { left: 3px; transform: scaleX(-1) rotate(-18deg); }

.dgcb-gift-number {
  position: absolute;
  z-index: 6;
  right: 24px;
  bottom: 9px;
  display: flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #714900;
  background: rgba(255, 252, 226, .92);
  font-size: 11px;
  font-weight: 900;
  transition: opacity .2s ease, transform .2s ease;
}

.dgcb-choice-caption {
  display: block;
  min-height: 28px;
  color: #73551b;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.dgcb-choice.is-opening .dgcb-gift { animation: dgcbGiftShake .22s ease-in-out infinite alternate; }
.dgcb-choice.is-open .dgcb-gift-lid { transform: translate(-8px, -18px) rotate(-12deg); }
.dgcb-choice.is-open .dgcb-gift-bow { transform: translate(-8px, -18px) rotate(-12deg); }
.dgcb-choice.is-open .dgcb-gift-number { opacity: 0; transform: scale(.4); }
.dgcb-choice.is-open .dgcb-gift::after {
  content: '✦';
  position: absolute;
  z-index: 7;
  top: 12px;
  right: 27px;
  color: #e4a20b;
  font-size: 22px;
  text-shadow: -20px 4px 0 #7ecf9c, 18px -2px 0 #cb84e8;
  animation: dgcbGiftSpark .65s ease-out both;
}
.dgcb-choice.is-open .dgcb-choice-caption { color: #17723a; }

@keyframes dgcbGiftShake {
  from { transform: rotate(-3deg) translateY(0); }
  to { transform: rotate(3deg) translateY(-2px); }
}
@keyframes dgcbGiftSpark {
  from { opacity: 0; transform: translateY(8px) scale(.45); }
  to { opacity: 1; transform: translateY(-8px) scale(1); }
}

.dgcb-result {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 9px;
  padding: 10px 11px;
  border: 1px solid #a9dfbd;
  border-radius: 9px;
  color: #176c37;
  background: #effbf3;
  font-size: 11px;
  line-height: 1.7;
}

.dgcb-result[hidden] { display: none !important; }
.dgcb-result strong { font-size: 12.5px; font-weight: 800; }
.dgcb-result span, .dgcb-result small { display: block; }
.dgcb-result.is-blank { border-color: #ddd4be; color: #73664b; background: #faf8f2; }
.dgcb-result.is-locked { border-color: #b9cfe7; color: #315b84; background: #f1f7fd; }
.dgcb-result.is-error { border-color: #f0b6b6; color: #9b3030; background: #fff3f3; }

.dgcb-details { margin-top: 9px; color: #756846; font-size: 10.5px; }
.dgcb-details summary { width: max-content; max-width: 100%; color: #8a610c; cursor: pointer; user-select: none; }
.dgcb-details ul { margin: 8px 0 0; padding: 0 17px 0 0; line-height: 1.9; }
.dgcb-details li { margin: 0; }

.dgcb-box.is-win { border-color: #87d5a4; background: linear-gradient(145deg, #fff 0%, #f2fff6 100%); }
.dgcb-box.is-blank { border-color: #d8cfbb; background: linear-gradient(145deg, #fff 0%, #faf8f2 100%); }

@media (max-width: 575px) {
  .dgcb-box { border-radius: 12px; margin-bottom: 11px; }
  .dgcb-head { padding: 10px; gap: 7px; }
  .dgcb-body { padding: 10px; }
  .dgcb-icon { width: 35px; height: 35px; flex-basis: 35px; }
  .dgcb-icon svg { width: 28px; height: 28px; }
  .dgcb-heading strong { font-size: 13.5px; }
  .dgcb-heading small { font-size: 9.5px; }
  .dgcb-quality { max-width: 92px; padding: 4px 6px; font-size: 9.5px; }
  .dgcb-showcase-title, .dgcb-picker-head { align-items: flex-start; flex-direction: column; gap: 1px; }
  .dgcb-picker-head span { text-align: right; }
  .dgcb-prizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dgcb-choices { gap: 5px; }
  .dgcb-choice { padding-right: 1px; padding-left: 1px; }
  .dgcb-gift { transform: scale(.92); }
  .dgcb-choice.is-opening .dgcb-gift { animation: dgcbGiftShakeSmall .22s ease-in-out infinite alternate; }
}

@keyframes dgcbGiftShakeSmall {
  from { transform: scale(.92) rotate(-3deg) translateY(0); }
  to { transform: scale(.92) rotate(3deg) translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .dgcb-box *, .dgcb-box *::before, .dgcb-box *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
