/* Miracle Wheel of Fortune — styles
   Aesthetic: velvet night + brass. Signature: the wheel + gold win moment.
   Dark mode strictly via html[data-theme="dark"] (platform contract). */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

.mwof-root {
  --mwof-bg:        #1a1320;
  --mwof-card:      #241a2e;
  --mwof-card-2:    #2d2138;
  --mwof-ink:       #fdf6e3;
  --mwof-muted:     #b9a7c9;
  --mwof-gold:      #d9a441;
  --mwof-gold-2:    #f4cf6b;
  --mwof-line:      rgba(255,255,255,0.08);
  --mwof-err:       #ff6b6b;
  --mwof-win:       #f4cf6b;

  font-family: 'Inter', system-ui, sans-serif;
  color: var(--mwof-ink);
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.mwof-loading,
.mwof-error {
  padding: 40px;
  text-align: center;
  color: var(--mwof-muted);
}

.mwof-card {
  background: radial-gradient(circle at 50% -10%, var(--mwof-card-2), var(--mwof-card) 60%);
  border: 1px solid var(--mwof-line);
  border-radius: 22px;
  padding: 28px 24px 26px;
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Header */
.mwof-head { text-align: center; margin-bottom: 18px; }
.mwof-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 7vw, 40px);
  letter-spacing: 0.5px;
  margin: 0;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--mwof-gold-2), var(--mwof-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mwof-sub {
  margin: 4px 0 0;
  color: var(--mwof-muted);
  font-size: 14px;
}

/* Stage */
.mwof-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}
.mwof-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,0.45));
}

/* Pointer at top */
.mwof-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid var(--mwof-gold-2);
  z-index: 4;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5));
}

/* Center hub / spin button */
.mwof-hub {
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  border: 4px solid var(--mwof-gold);
  background:
    radial-gradient(circle at 50% 35%, var(--mwof-gold-2), var(--mwof-gold) 55%, #a87c2c 100%);
  color: #2a1d0a;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 3.4vw, 20px);
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45), inset 0 2px 4px rgba(255,255,255,0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mwof-hub:hover:not(:disabled) { transform: scale(1.05); }
.mwof-hub:active:not(:disabled) { transform: scale(0.97); }
.mwof-hub:disabled { opacity: 0.55; cursor: not-allowed; }
.mwof-hub.is-busy { animation: mwof-pulse 0.9s ease-in-out infinite; }
@keyframes mwof-pulse { 50% { box-shadow: 0 6px 26px rgba(244,207,107,0.7); } }

/* Meta row */
.mwof-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 6px;
  font-size: 14px;
  color: var(--mwof-muted);
}
.mwof-meta strong { color: var(--mwof-ink); font-weight: 600; }

/* Status */
.mwof-status {
  min-height: 22px;
  text-align: center;
  font-size: 14px;
  margin-top: 8px;
  color: var(--mwof-muted);
}
.mwof-status a { color: var(--mwof-gold-2); }
.mwof-status.is-error { color: var(--mwof-err); }
.mwof-status.is-win   { color: var(--mwof-win); font-weight: 600; }
.mwof-status.is-info  { color: var(--mwof-muted); }

/* Pending prizes */
.mwof-pending { margin-top: 16px; }
.mwof-pending-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mwof-muted);
  margin-bottom: 8px;
}
.mwof-pending-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--mwof-line);
  border-radius: 12px;
  margin-bottom: 8px;
}
.mwof-pending-amt { font-weight: 700; color: var(--mwof-gold-2); }
.mwof-pending-state { font-size: 13px; color: var(--mwof-muted); margin-left: auto; }
.mwof-pending-claim {
  margin-left: auto;
  border: none;
  background: var(--mwof-gold);
  color: #2a1d0a;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.mwof-pending-claim:disabled { opacity: 0.6; cursor: default; }

/* Win overlay */
.mwof-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 8, 16, 0.78);
  backdrop-filter: blur(4px);
  border-radius: 22px;
  z-index: 10;
}
.mwof-overlay.is-open { display: flex; animation: mwof-fade 0.25s ease; }
@keyframes mwof-fade { from { opacity: 0; } to { opacity: 1; } }

.mwof-prize {
  text-align: center;
  padding: 32px 28px;
  animation: mwof-rise 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes mwof-rise { from { transform: translateY(18px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

.mwof-prize-eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--mwof-gold-2);
}
.mwof-prize-amount {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(52px, 16vw, 84px);
  line-height: 1.05;
  margin: 6px 0 22px;
  background: linear-gradient(180deg, #fff6d8, var(--mwof-gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(244,207,107,0.25);
}
.mwof-claim-btn {
  display: block;
  width: 100%;
  border: none;
  background: linear-gradient(180deg, var(--mwof-gold-2), var(--mwof-gold));
  color: #2a1d0a;
  font-weight: 700;
  font-size: 18px;
  padding: 15px 28px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(244,207,107,0.6);
  transition: transform 0.12s ease;
}
.mwof-claim-btn:hover:not(:disabled) { transform: translateY(-1px); }
.mwof-claim-btn:disabled { opacity: 0.6; cursor: default; }
.mwof-dismiss {
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--mwof-muted);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

/* Light mode (default WP theme without data-theme="dark") gets a softer card */
html:not([data-theme="dark"]) .mwof-root {
  --mwof-bg:     #f6f1ea;
  --mwof-card:   #ffffff;
  --mwof-card-2: #fbf6ef;
  --mwof-ink:    #2a2030;
  --mwof-muted:  #7a6e86;
  --mwof-line:   rgba(0,0,0,0.08);
}
html:not([data-theme="dark"]) .mwof-card {
  box-shadow: 0 20px 50px -28px rgba(60,30,80,0.35);
}
html:not([data-theme="dark"]) .mwof-overlay {
  background: rgba(40, 24, 52, 0.55);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mwof-hub.is-busy { animation: none; }
  .mwof-prize { animation: none; }
}

/* Small screens */
@media (max-width: 480px) {
  .mwof-card { padding: 22px 16px 20px; border-radius: 18px; }
  .mwof-meta { flex-direction: column; gap: 4px; align-items: center; }
}

/* ── Sound toggle ────────────────────────────────────────────────────
   Sits in the top-right corner of the card. The card is the positioning
   context (it already has overflow visible for the pointer). */
.mwof-card { position: relative; }
.mwof-sound-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: var(--mwof-card-2);
  box-shadow: inset 0 0 0 1px var(--mwof-line), 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.mwof-sound-btn:active { transform: scale(0.92); }
.mwof-sound-btn.is-muted { opacity: 0.55; }
