.wheel-workbench {
  --wheel-size: 340px;
  display: grid;
  gap: 24px;
  min-width: 0;
}
.wheel-stage,
.wheel-input,
.wheel-settings {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}
.wheel-display {
  position: relative;
  width: min(100%, var(--wheel-size));
  align-self: center;
}
.wheel-overlay {
  position: absolute;
  inset: auto 12% 15%;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--ws-ink);
  color: var(--ws);
  font: 400 clamp(1.75rem, 5vw, 3.5rem) / 1 var(--font-display);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.wheel-face {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  align-self: center;
  display: grid;
  place-items: center;
  margin-top: 3px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  touch-action: manipulation;
}
.wheel-face::before,
.wheel-face::after {
  content: '';
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.wheel-face::before {
  top: -5px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 24px solid var(--ws);
}
.wheel-face::after {
  top: -3px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 19px solid var(--ws-ink);
}
.wheel-disc-wrap {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}
.wheel-face canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.wheel-face[aria-disabled='true'] {
  cursor: default;
}
.wheel-play {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: min(100%, var(--wheel-size));
  align-self: center;
}
#wheel-spin {
  flex: 1;
  padding-inline: 10px;
}
#wheel-spin[aria-disabled='true'] {
  opacity: 0.6;
  cursor: default;
}
.wheel-result {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 12px 14px 4px;
  border: 1px solid var(--ws-line-strong);
  border-radius: var(--r-sm);
  background: var(--ws-2);
}
#wheel-winner {
  font: 600 1.125rem / 1.2 var(--font-ui);
  overflow-wrap: anywhere;
  scroll-margin-block: 12px;
}
#wheel-winner.wheel-has-winner { font: 400 2rem / 1.05 var(--font-display); }
.wheel-stage[data-tally] #wheel-winner.wheel-has-winner { font-size: clamp(3rem, 8vw, 5rem); }
.wheel-stage[data-tally] .wheel-result { justify-items: center; text-align: center; }
#wheel-result-question, .wheel-result .zt-explain { overflow-wrap: anywhere; }
.wheel-result .zt-next { margin-block: 0; }
.wheel-small {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--ws-line-strong);
  border-radius: var(--r-xs);
  background: var(--ws);
  color: var(--ws-ink);
  font-size: 0.875rem;
}
.wheel-small:hover:not(:disabled) {
  background: var(--ws-2);
}
.wheel-settings {
  gap: 16px;
}
.wheel-workbench details,
.wheel-tally {
  padding: 0 12px 12px;
  border: 1px solid var(--ws-line);
  border-radius: var(--r-sm);
  min-width: 0;
}
.wheel-workbench details:not([open]) {
  padding-bottom: 0;
}
.wheel-workbench summary {
  align-content: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
#wheel-count {
  margin-inline-start: 4px;
  font-weight: 400;
}
.wheel-workbench .zt-field {
  margin: 4px 0 6px;
}
#wheel-entries {
  display: block;
  min-height: 86px;
  resize: vertical;
  line-height: 1.45;
}
#wheel-entries[aria-invalid='true'] {
  border-color: var(--err);
}
#wheel-hint:not([hidden]) {
  color: var(--err);
}
.wheel-settings .zt-hint {
  margin-block: 6px 0;
}
.wheel-actions,
.wheel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.wheel-actions {
  margin-block: 12px 6px;
}
.wheel-share {
  margin-top: 8px;
}
.wheel-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-block: 4px;
  font-size: 0.875rem;
  cursor: pointer;
}
.wheel-option input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ws-ink);
}
.wheel-tally {
  padding-top: 12px;
}
.wheel-heading {
  justify-content: space-between;
}
.wheel-heading h2 {
  margin: 0;
  font: 400 1.75rem / 1 var(--font-display);
}
.wheel-tally dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}
.wheel-tally dl > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 8px;
  padding: 8px 10px;
  background: var(--ws-2);
  border-radius: var(--r-xs);
}
.wheel-tally dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
#tool.zt-full-window,
#tool:fullscreen {
  overflow: auto;
  border-radius: 0;
  background: var(--ws);
}
#tool.zt-full-window > .wheel-workbench,
#tool:fullscreen > .wheel-workbench {
  --wheel-size: min(75vh, 90vw, calc(100vh - 210px));
  display: block;
  margin-inline: auto;
}
#tool:is(:fullscreen, .zt-full-window) :is(.wheel-input, .wheel-settings, .wheel-tally, .zt-do, .zt-ux-presets, .zt-next) {
  display: none;
}
#tool:is(:fullscreen, .zt-full-window) .wheel-result { width: min(100%, 900px); align-self: center; }
#tool:is(:fullscreen, .zt-full-window) #wheel-winner { font-size: clamp(2.5rem, 6vw, 5rem); }
@media (min-width: 780px) {
  .wheel-workbench {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas: 'stage input' 'stage settings';
    grid-template-rows: auto 1fr;
  }
  .wheel-input { grid-area: input; }
  .wheel-stage { grid-area: stage; }
  .wheel-settings { grid-area: settings; }
}
@media (max-width: 500px) {
  .wheel-workbench {
    --wheel-size: min(280px, 38vh);
    gap: 16px;
  }
  .wheel-stage { gap: 8px; }
}
