/* Create By Asking: spin the wheel / random name picker. Loaded after style.css, tools.css and family.css. */

#wheel-tool { scroll-margin-top: 84px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 22px 28px; }
.wheel > * { min-width: 0; }
.wh-main { position: relative; display: grid; gap: 12px; justify-items: center; }
.wh-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; width: 100%; }
.wh-hint { font-size: var(--step--1); color: #CBBFE8; }
.wh-stage { position: relative; width: min(100%, 540px); aspect-ratio: 1; outline: none; touch-action: manipulation; }
.wh-stage canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.is-spinning .wh-stage canvas { cursor: default; }
.wh-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 20%; aspect-ratio: 1; border-radius: 50%; border: 4px solid #0F0827; background: #fff; color: #1C0F3F; font: 800 clamp(0.85rem, 3.4vw, 1.3rem)/1 var(--display); letter-spacing: 0.02em; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); touch-action: manipulation; }
.wh-hub:hover { background: #FFC93C; }
.wh-hub:focus-visible { outline: 3px solid #FFC93C; outline-offset: 3px; }
.wh-hub:disabled { cursor: default; background: #fff; }

/* winner pop-up */
.wh-pop { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 8, 39, 0.72); border-radius: 14px; padding: 12px; z-index: 2; }
.wh-card { position: relative; background: #fff; color: #1C0F3F; border-radius: 18px; padding: 26px 24px 22px; width: min(100%, 380px); text-align: center; display: grid; gap: 12px; justify-items: center; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.6); animation: wh-pop 0.32s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes wh-pop { from { transform: scale(0.85); opacity: 0; } }
.wh-card .eyebrow { color: #5F5580; margin: 0; }
.wh-card strong { font: 800 clamp(1.9rem, 6vw, 3rem)/1.08 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.wh-card p { margin: 0; color: #5F5580; font-size: var(--step--1); }
.wh-card .f-row { justify-content: center; margin-top: 4px; }
.wheel .wh-card .btn { background: #1C0F3F; color: #fff; }
.wheel .wh-card .btn-ghost { background: #F1EBFF; color: #1C0F3F; }
.wheel .wh-card .btn-ghost:hover { background: #E4DCF3; }
.wh-x { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: #5F5580; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.wh-x:hover { background: #F1EBFF; }

/* side panel */
.wh-side { display: grid; gap: 16px; align-content: start; }
.wh-block { display: grid; gap: 8px; }
.wh-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wh-label label, .wh-label > span:first-child { font: 600 0.68rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #A597CC; }
.wh-label [data-count] { font-size: 0.78rem; color: #CBBFE8; }
.wheel textarea { width: 100%; min-height: 190px; line-height: 1.45; }
.wheel textarea[readonly] { opacity: 0.6; }
.wh-side .f-row > span { min-width: 4.6em; }
.wh-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.3); }
.chip-dark[aria-pressed="true"] .wh-swatch { box-shadow: 0 0 0 1.5px rgba(28, 15, 63, 0.55); }
.wh-check { display: flex !important; align-items: center; gap: 10px !important; cursor: pointer; color: #F2ECFF !important; }
.wh-check input { width: 18px; height: 18px; accent-color: #FFC93C; padding: 0; margin: 0; }
.wh-link { border: 0; background: none; padding: 0; color: #FFC93C; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.wh-small { border: 0; background: none; padding: 0; color: #A597CC; font: 500 0.78rem/1 var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.wh-small:hover { color: #fff; }
[data-msg]:empty { display: none; }
.wh-history ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; max-height: 172px; overflow-y: auto; }
.wh-history li:not(.tool-empty) { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: var(--step--1); }
.wh-history li b { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-history li span { color: #A597CC; font: 500 0.75rem/1.6 var(--mono); flex: none; }
.wheel > .tool-note { grid-column: 1 / -1; margin: 0; }

/* full screen for the classroom (native, or a fixed overlay where phones don't support it) */
#wheel-tool.is-full { position: fixed; inset: 0; z-index: 1000; border-radius: 0; grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: center; overflow: auto; padding: 16px; }
.wheel.is-full .wh-side, .wheel.is-full > .tool-note { display: none; }
.wheel.is-full .wh-main { width: 100%; }
.wheel.is-full .wh-top { max-width: 900px; }
.wheel.is-full .wh-stage { width: min(94vw, calc(100vh - 90px), 900px); }
.wheel.is-full .wh-card strong { font-size: clamp(2.4rem, 8vw, 4.4rem); }
.wheel:fullscreen { width: 100%; height: 100%; }
html.wh-lock, html.wh-lock body { overflow: hidden; }

@media (max-width: 860px) {
  #wheel-tool { grid-template-columns: minmax(0, 1fr); }
  .wheel textarea { min-height: 150px; }
}
