/* Spin the Wheel. The wheel's canvas fills the stage; the winner's banner
   is laid over the wheel's centre (placed by the script through --sw-cx,
   --sw-cy and --sw-r), the Spin button floats below. */

.sw { overflow: hidden; }
.sw-host {
  cursor: pointer;
  background: radial-gradient(90% 75% at 50% 45%, color-mix(in srgb, var(--cat) 7%, var(--stage-bg)), var(--stage-bg) 70%);
}
.sw.is-spinning .sw-host, .sw.is-empty .sw-host { cursor: default; }

.sw-note { z-index: 3; padding: .6em 1em; border-radius: var(--radius); background: color-mix(in srgb, var(--stage-bg) 88%, transparent); color: var(--ink-soft); font-weight: 600; }

/* ---- the winner ---- */
.sw-banner { position: absolute; inset: 0; z-index: 6; }
.sw-banner[hidden] { display: none; }
.sw-banner-card {
  --sw-win: var(--cat);
  position: absolute; left: var(--sw-cx, 50%); top: var(--sw-cy, 45%); translate: -50% -50%;
  width: max-content; min-width: min(60cqw, calc(var(--sw-r, 200px) * 1.1)); max-width: 92cqw;
  padding: clamp(10px, 3cqmin, 36px) clamp(16px, 5cqmin, 60px) clamp(10px, 2.6cqmin, 30px);
  display: flex; flex-direction: column; align-items: center; gap: clamp(4px, 1.2cqmin, 14px);
  border-radius: clamp(14px, 3cqmin, 32px); text-align: center;
  background: color-mix(in srgb, var(--card) 96%, transparent); color: var(--ink);
  border: 1px solid var(--line); border-top: clamp(5px, 1.3cqmin, 14px) solid var(--sw-win);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(8px);
}
.sw-banner-cap {
  padding-inline: clamp(28px, 6.4cqmin, 60px); white-space: nowrap;
  font: 650 clamp(11px, 2.8cqmin, 30px)/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.sw-banner-name {
  max-width: 100%; overflow-wrap: anywhere;
  font: 700 clamp(26px, 11cqmin, 200px)/1.05 var(--font-display); letter-spacing: -.02em; color: var(--ink);
}
.sw-banner-note { font-size: clamp(11px, 2.4cqmin, 24px); color: var(--muted); }
.sw-banner-note[hidden] { display: none; }
.sw-banner-actions { display: flex; gap: 1cqmin; }
.sw-banner-actions:not(:has(> :not([hidden]))) { display: none; }
.sw-banner .t-btn { min-height: clamp(32px, 6.4cqmin, 64px); font-size: clamp(12px, 2.4cqmin, 24px); }
.sw-banner-close {
  position: absolute; top: clamp(4px, 1.2cqmin, 14px); right: clamp(4px, 1.2cqmin, 14px);
  width: clamp(32px, 6.4cqmin, 60px); padding: 0; border-color: transparent; box-shadow: none; background: transparent; color: var(--muted);
}
.sw-banner-close:hover { color: var(--ink); }

.sw-hint {
  position: absolute; left: 50%; bottom: calc(clamp(36px, 8.4cqmin, 84px) + clamp(16px, 5.2cqmin, 56px));
  transform: translateX(-50%); z-index: 4; pointer-events: none; white-space: nowrap;
  padding: .3em .8em; border-radius: 999px; font-size: clamp(11px, 2.6cqmin, 22px);
  background: rgba(14, 22, 34, .62); color: #fff;
}
.sw.is-empty .sw-hint { display: none; }
.sw-count { min-width: 5em; justify-content: center; }

/* ---- settings ---- */
.sw-removed { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; }
.sw-removed li {
  padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--card-alt); border: 1px solid var(--line); color: var(--ink-soft); text-decoration: line-through;
}
.sw-winners { margin: 0; padding: 0 0 0 1.4em; max-height: 220px; overflow: auto; }
.sw-winners li { padding: 2px 0; }
.sw-winners li.is-empty { list-style: none; margin-left: -1.4em; color: var(--muted); }

@container (max-height: 360px) {
  .sw-hint { display: none; }
}
/* Short and wide (a Board widget in a bottom row): the button moves to the
   right so the wheel can have the whole height. */
@container (max-height: 340px) and (min-aspect-ratio: 8/5) {
  .sw .t-controls { left: auto; top: 0; flex-direction: column; justify-content: center; }
  .sw-count { display: none; }
}
@container (max-width: 420px) {
  .sw-count { display: none; }
}
