/* brick-wheel.css — Adventure wood / cream / gold Brick Wheel dialog + launcher. */
/* Keep the legacy reward row at its original height; Adventure's existing
   higher-specificity rail rule still lays rewards out vertically. */
#gameApp .bonus-group { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 980px) {
  #gameApp .bonus-group { grid-template-columns: repeat(2, minmax(0, 1fr)) 84px; }
}
#brickWheelRotor { transform-box: view-box; transform-origin: 200px 200px; will-change: transform; }
.brick-wheel-art { display: block; width: 100%; height: auto; overflow: visible; }

#brickWheelLauncher {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; min-height: 44px; min-width: 44px;
  padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: #4a2308; background: transparent; box-shadow: none;
  isolation: isolate;
}
#brickWheelLauncher::before {
  content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, #ffe983 20%, #ffcb4599 54%, transparent 72%);
  opacity: 0; transition: opacity .2s;
}
#brickWheelLauncher.is-ready::before { opacity: .85; }
#brickWheelLauncher:hover:not(:disabled)::before { opacity: 1; }
#brickWheelLauncher:hover:not(:disabled) .wheel-launch-icon { transform: scale(1.08) rotate(-7deg); }
#brickWheelLauncher:active:not(:disabled) .wheel-launch-icon { transform: scale(.92) rotate(3deg); }
#brickWheelLauncher:disabled { cursor: not-allowed; opacity: .7; filter: saturate(.4); }
.wheel-launch-icon { display: block; width: 100%; height: 100%; transition: transform .25s cubic-bezier(.2,.8,.3,1.3); }
.wheel-launch-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 1px #59300988); }
/* Inner artwork owns the idle cue; its wrapper keeps deliberate hover/press
   feedback. The hit target, 8h badge, dot and countdown never animate. */
#brickWheelLauncher.is-idle-ready:not(:disabled) .wheel-launch-icon svg {
  animation: wheel-ready-cue 6s ease-in-out infinite;
}
/* Same one-second invitation / five-second neutral rest as the chests.
   Retain the artwork's ordinary depth shadow, but no warm glow in the rest. */
@keyframes wheel-ready-cue {
  0%, 16.6667%, 100% {
    transform: rotate(0deg) scale(1);
    filter: drop-shadow(0 3px 1px #59300988);
  }
  4.1667% { transform: rotate(-3deg) scale(1.03); }
  8.3333% {
    transform: rotate(3deg) scale(1.08);
    filter: drop-shadow(0 3px 1px #59300988) drop-shadow(0 0 9px #ffe474);
  }
  12.5% { transform: rotate(-1deg) scale(1.03); }
}
.wheel-launch-badge {
  position: absolute; right: -5px; bottom: -1px; border: 1.5px solid #fff3b8;
  padding: 1px 4px; border-radius: 7px; background: #9d251e; color: #fff9e3;
  font: 900 10px/1.1 "Trebuchet MS", system-ui, sans-serif; box-shadow: 0 1px 2px #351a0c80;
  pointer-events: none;
}
body[data-theme="adventure"] #brickWheelLauncher { width: 64px; height: 64px; }
body[data-theme="adventure"] .wheel-launch-badge { font-size: 12px; padding: 2px 5px; right: -1px; }

#brickWheelDialog {
  position: fixed; inset: 0; margin: auto; padding: 0;
  width: min(440px, calc(100% - 16px)); max-height: calc(100dvh - 16px);
  overflow-y: auto; overscroll-behavior: contain;
  color: #3b1d08; background: linear-gradient(180deg, #fff6dc, #f1dcae);
  border: 4px solid #d9a21f; border-radius: 22px;
  box-shadow: 0 0 0 2px #5a2e05, 0 18px 46px rgba(40, 20, 4, .5);
  font-family: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
}
#brickWheelDialog::backdrop { background: rgba(36, 20, 6, .66); }
#brickWheelDialog > * { box-sizing: border-box; }
#brickWheelDialog .brick-wheel-inner { position: relative; display: grid; gap: 12px; padding: 18px 16px 18px; justify-items: center; text-align: center; }
.brick-wheel-heading { margin: 0; padding: 0 44px; font-size: 1.45rem; font-weight: 800; line-height: 1.15; color: #8a1f17; overflow-wrap: anywhere; text-shadow: 0 1px 0 #fff6dc; }
.brick-wheel-stage { position: relative; isolation: isolate; width: min(100%, 360px); aspect-ratio: 1; padding: 4px; }
.brick-wheel-stage > svg { position: relative; filter: drop-shadow(0 7px 5px rgba(60, 30, 5, .38)); }
#brickWheelPointer { transform-box: view-box; transform-origin: 200px 8px; }
.brick-wheel-stage::before {
  content: ""; position: absolute; inset: -4%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, #ffdb63 28%, #ffbe323d 55%, transparent 70%);
  opacity: .35;
}
.brick-wheel-stage.is-spinning::before { animation: wheel-charge 4.75s ease-out both; }
.brick-wheel-stage.is-celebrating::before {
  background: repeating-conic-gradient(from 0deg, #ffd76199 0deg 12deg, #fff7c700 12deg 30deg);
  mask-image: radial-gradient(circle, #000 20%, transparent 71%);
  animation: wheel-bloom 850ms ease-out both;
}
@keyframes wheel-charge { 0%, 12% { opacity: .2; transform: scale(.85); } 45% { opacity: .9; } 100% { opacity: .65; transform: scale(1.04); } }
@keyframes wheel-bloom { 0% { opacity: 0; transform: scale(.6) rotate(-9deg); } 40% { opacity: 1; } 100% { opacity: .55; transform: scale(1.04) rotate(7deg); } }
.wheel-spark-layer { position: absolute; inset: -5%; overflow: hidden; border-radius: 50%; pointer-events: none; }
.wheel-spark { position: absolute; top: 48%; left: 50%; width: 8px; height: 13px; border-radius: 2px; }
.wheel-spark-star { width: 16px; height: 16px; clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 58%,80% 96%,50% 73%,20% 96%,32% 58%,2% 35%,39% 35%); }
.wheel-win-pop {
  position: absolute; left: 50%; top: 51%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; width: min(72%, 200px); padding: 10px 14px 12px; gap: 0;
  color: #73301b; background: linear-gradient(#fffbea, #ffe5a3);
  border: 3px solid #fff9dc; border-radius: 24px;
  box-shadow: 0 0 0 2px #be780e, 0 5px 0 #9c4e15, 0 9px 16px #42220759;
  font: 900 .85rem/1.1 "Trebuchet MS", system-ui, sans-serif;
  pointer-events: none;
}
.wheel-win-pop[hidden] { display: none; }
.wheel-win-kicker { color: #8d241d; letter-spacing: .11em; font-size: .7rem; }
.wheel-win-amount { color: #b62669; font-size: clamp(34px, 9vw, 58px); line-height: 1.08; text-shadow: 0 2px #fffdf2; font-variant-numeric: tabular-nums; }

#brickWheelSpin {
  min-height: 48px; min-width: 190px; max-width: 100%; padding: 10px 26px;
  font-size: 1.1rem; font-weight: 800; line-height: 1.1; font-family: inherit; color: #fff6dc; cursor: pointer;
  background: linear-gradient(180deg, #ff7160 0%, #e44234 44%, #c22a20 46%, #b3231b 100%);
  border: 3px solid #fff6dc; border-radius: 999px;
  box-shadow: inset 0 2px #ffffff80, 0 0 0 2px #5a2e05, 0 4px 0 #5a2e05, 0 7px 12px #913b1d38;
  text-shadow: 0 1px 0 #5a0f0b; overflow-wrap: anywhere;
}
#brickWheelSpin:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 2px #5a2e05, 0 1px 0 #5a2e05; }
#brickWheelSpin:disabled { cursor: not-allowed; color: #5d4a30; text-shadow: none; background: linear-gradient(180deg, #eadfc2, #cdbd95); box-shadow: 0 0 0 2px #8a7650; }

#brickWheelStatus { margin: 0; min-height: 1.3em; font-size: .95rem; line-height: 1.35; font-weight: 600; color: #4a2308; overflow-wrap: anywhere; }
#brickWheelResult { margin: 0; font-size: 1.1rem; font-weight: 800; line-height: 1.3; color: #8a1f17; overflow-wrap: anywhere; }
#brickWheelStatus:empty, #brickWheelResult:empty { display: none; }

.brick-wheel-close {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; line-height: 1; color: #8a1f17; cursor: pointer;
  background: #fff6dc; border: 2px solid #c98e1c;
}
.brick-wheel-close:hover { background: #ffe9a8; }

#brickWheelDialog :is(button):focus-visible,
#brickWheelLauncher:focus-visible { outline: 4px solid #21385b; outline-offset: 3px; }
#brickWheelSpin:focus-visible { outline-color: #21385b; box-shadow: 0 0 0 2px #5a2e05, 0 0 0 7px #fff6dc; }

@media (max-width: 360px) {
  #brickWheelDialog .brick-wheel-inner { padding: 14px 10px; }
  .brick-wheel-heading { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  #brickWheelLauncher, #brickWheelSpin, .wheel-launch-icon { transition: none; }
  #brickWheelLauncher:active, #brickWheelSpin:active { transform: none !important; }
  #brickWheelLauncher .wheel-launch-icon { transform: none !important; }
  #brickWheelLauncher .wheel-launch-icon svg { animation: none !important; }
  .brick-wheel-stage::before { animation: none !important; }
}
#brickWheelLauncher.wheel-no-motion .wheel-launch-icon { transition: none; transform: none !important; }
#brickWheelLauncher.wheel-no-motion .wheel-launch-icon svg { animation: none !important; }
#brickWheelDialog.wheel-no-motion *, #brickWheelDialog.wheel-no-motion ::before { animation: none !important; transition: none !important; }
@media (forced-colors: active) {
  #brickWheelDialog, #brickWheelLauncher, #brickWheelSpin, .brick-wheel-close {
    forced-color-adjust: auto; border: 2px solid ButtonText; background: ButtonFace; color: ButtonText; box-shadow: none; text-shadow: none;
  }
  #brickWheelDialog { background: Canvas; color: CanvasText; }
  .wheel-win-pop { background: Canvas; border-color: CanvasText; box-shadow: none; }
  .wheel-win-pop > * { color: CanvasText; text-shadow: none; }
  #brickWheelDialog :is(button):focus-visible, #brickWheelLauncher:focus-visible { outline: 3px solid Highlight; }
}
