/* Lucky wheel (play_wheel.php) and the mini-game list (random_wheel.php). Prefix: wh-
   The board and canvas share the active storefront palette. */

/* ---- Stage ---- */
.wh-board { display: grid; place-items: center; padding: var(--sf-space-10) var(--sf-space-4) var(--sf-space-6); border: 1px solid var(--sf-border); border-radius: var(--sf-radius-sm); background: var(--sf-hero-bg); }
/* Capped by the viewport height so the wheel, the pointer and the spin button fit on one screen. */
.wh-wheel { position: relative; width: min(100%, 460px, max(240px, 56vh)); aspect-ratio: 1; }
.wh-wheel__canvas { display: block; width: 100%; height: 100%; border-radius: 50%; }
.wh-wheel__pointer { position: absolute; left: 50%; top: 0; z-index: 1; width: 10%; min-width: 28px; transform: translate(-50%, -64%); pointer-events: none; }
.wh-wheel__pointer svg { display: block; width: 100%; height: auto; overflow: visible; }
.wh-wheel__pin { fill: var(--sf-hero-strong); stroke: var(--sf-hero-bg); stroke-width: 3; stroke-linejoin: round; }
.wh-wheel__pin-dot { fill: var(--sf-red-fill); }
.wh-status { min-height: calc(2 * var(--sf-leading-body) * 1em); color: var(--sf-soft); text-align: center; overflow-wrap: anywhere; }

/* ---- Cost / balance / daily quota ---- */
.wh-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sf-space-3); }
.wh-stats--3 > :last-child { grid-column: 1 / -1; }
.wh-stage .wh-stats .sf-stat { padding: var(--sf-space-3) var(--sf-space-4); background: var(--sf-panel-raised); }
.wh-stats :is(.sf-stat__label, .sf-stat__note, .sf-stat__unit) { color: var(--sf-soft); overflow-wrap: anywhere; }
.wh-stats .sf-stat__label .sf-icon { flex-shrink: 0; }
.wh-stats .sf-stat__value { font-size: var(--sf-text-xl); }
/* Two classes: outranks .sf-stat--sale .sf-stat__value (a free spin is not a price). */
.wh-stage .wh-stats .wh-stats__free { color: var(--sf-success); font-family: var(--sf-font-body); line-height: var(--sf-leading-heading); }
.wh-stats__guest { align-self: center; }
.wh-register { display: inline-flex; align-items: center; justify-content: center; min-width: var(--sf-tap); min-height: var(--sf-tap); padding-inline: var(--sf-space-2); }
.wh-notice { flex-wrap: wrap; align-items: center; }
.wh-notice > .sf-icon { align-self: flex-start; }
.wh-notice > .sf-alert__body { flex: 1 1 200px; }
@media (min-width: 480px) {
  .wh-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wh-stats--3 > :last-child { grid-column: auto; }
}
@media (min-width: 768px) {
  .wh-board { padding: var(--sf-space-12) var(--sf-space-6) var(--sf-space-8); }
}

/* ---- Prize list ---- */
.wh-prizes__thumb { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--sf-radius-sm); color: var(--sf-soft); }
.wh-prizes__end { display: flex; align-items: center; gap: var(--sf-space-2); }
.wh-swatch { flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--sf-hero-bg-alt); box-shadow: 0 0 0 1px var(--sf-border-strong); }
.wh-swatch--red { background: var(--sf-red-fill); }
.wh-swatch--accent { background: var(--sf-accent-fill); }
.wh-swatch--blue { background: var(--sf-blue-fill); }

/* ---- Spin history ---- */
.wh-history__icon.is-win { background: var(--sf-accent-tint); color: var(--sf-accent); }
.wh-history__empty { text-align: center; }
/* Title above its meta line (the shared list leaves both inline). */
.wh-history .sf-list__main { display: grid; }

/* ---- Result dialog ---- */
.wh-result__hero { display: grid; justify-items: center; gap: var(--sf-space-2); text-align: center; }
.wh-result__icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: var(--sf-space-2); border-radius: 50%; background: var(--sf-panel-raised); color: var(--sf-soft); }
.wh-result__icon.is-win { background: var(--sf-accent-tint); color: var(--sf-accent); }
.wh-result__icon .sf-icon { width: 30px; height: 30px; }
.wh-result__label { color: var(--sf-soft); font-size: var(--sf-text-sm); }
.wh-result__name { color: var(--sf-strong); font-size: var(--sf-text-xl); font-weight: var(--sf-weight-bold); line-height: var(--sf-leading-heading); overflow-wrap: anywhere; }
.wh-result__credit { display: grid; justify-items: center; gap: var(--sf-space-1); color: var(--sf-soft); font-size: var(--sf-text-sm); }

/* ---- Mini-game list (random_wheel.php) ---- */
.wh-game { display: grid; overflow: hidden; }
.wh-game__media { background: var(--sf-hero-bg); }
.wh-game__body { display: grid; min-width: 0; gap: var(--sf-space-3); align-content: center; padding: var(--sf-space-5); overflow-wrap: anywhere; }
.wh-game .wh-game__media { border-radius: 0; }
.wh-game__title { font-size: var(--sf-text-xl); }
.wh-game__text { color: var(--sf-soft); }
.wh-game__facts { display: flex; flex-wrap: wrap; gap: var(--sf-space-2); }
.wh-game__cta { justify-self: start; }
@media (min-width: 768px) {
  .wh-game { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); }
  .wh-game__media { aspect-ratio: auto; min-height: 210px; height: 100%; }
  .wh-game__body { padding: var(--sf-space-8); }
}
