/* Wheel of Names — scoped styles (uses ToolHex theme variables from style.css) */

.wheel-tool {
    font-family: var(--poppins);
}

.wheel-tool__layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 860px) {
    .wheel-tool__layout {
        grid-template-columns: 1fr;
    }
}

.wheel-tool__section {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.wheel-tool__wrap {
    position: relative;
    width: min(620px, 100%);
    aspect-ratio: 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 50%;
    box-shadow: 0 4px 24px rgba(127, 86, 217, 0.12), inset 0 0 0 6px #fff, inset 0 0 0 10px var(--primary-color-light);
}

.wheel-tool__wrap.spinning { cursor: wait; }

.wheel-tool__canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.wheel-tool__pointer {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.wheel-tool__pointer svg { display: block; }

.wheel-tool__hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff, var(--primary-color-light));
    box-shadow: 0 2px 8px rgba(127, 86, 217, 0.2), inset 0 1px 0 #fff;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.04em;
}

.wheel-tool__hint {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--gray-text);
    text-align: center;
}

.wheel-tool__hint kbd {
    background: var(--primary-color-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.wheel-tool__spin-controls {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    z-index: 5;
    display: none;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(127, 86, 217, 0.18);
    border: 1px solid var(--primary-color-light);
}

.wheel-tool__spin-controls.visible {
    display: flex;
    animation: wheelSpinControlsIn 0.25s ease;
}

@keyframes wheelSpinControlsIn {
    from { opacity: 0; transform: translateX(-50%) translateY(calc(100% + 8px)); }
    to { opacity: 1; transform: translateX(-50%) translateY(100%); }
}

.wheel-tool__ctrl {
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    font-family: var(--poppins);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}

.wheel-tool__ctrl:active { transform: scale(0.96); }

.wheel-tool__ctrl--pause {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.wheel-tool__ctrl--pause:hover { background: #fde68a; }

.wheel-tool__ctrl--stop {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.wheel-tool__ctrl--stop:hover { background: #fecaca; }

.wheel-tool__actions {
    display: flex;
    gap: 8px;
    margin-top: 52px;
    width: min(620px, 100%);
}

.wheel-tool__actions .wheel-tool__btn { flex: 1; }

.wheel-tool__btn {
    padding: 10px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-family: var(--poppins);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wheel-tool__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.wheel-tool__btn--secondary {
    background: var(--primary-color-light);
    color: var(--primary-color);
    border-color: transparent;
}

.wheel-tool__btn--secondary:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
}

.wheel-tool__btn--primary {
    background: var(--primary-color);
    color: #fff;
    padding: 14px;
    font-size: 1rem;
    width: 100%;
}

.wheel-tool__btn--primary:hover:not(:disabled) {
    background: var(--primary-color-hover);
    color: #fff;
}

.wheel-tool__btn--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.wheel-tool__btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Side panel */
.wheel-tool__panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 480px;
    border: 1px solid var(--primary-color-light);
    border-radius: 12px;
    padding: 16px;
    background: var(--primary-light-background);
}

.wheel-tool__tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--primary-color-light);
    border-radius: 10px;
    margin-bottom: 16px;
}

.wheel-tool__tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: var(--poppins);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-text);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wheel-tool__tab:hover { color: var(--primary-text-color); }

.wheel-tool__tab.active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(127, 86, 217, 0.12);
}

.wheel-tool__tab-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.7);
    color: var(--gray-text);
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
}

.wheel-tool__tab.active .wheel-tool__tab-badge {
    background: var(--primary-color);
    color: #fff;
}

.wheel-tool__pane {
    display: none;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.wheel-tool__pane.active { display: flex; }

.wheel-tool__pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wheel-tool__pane-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-text);
}

.wheel-tool__count {
    font-size: 0.8rem;
    color: var(--gray-text);
    background: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--primary-color-light);
}

.wheel-tool__toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

.wheel-tool__toolbar .wheel-tool__btn { flex: 1; min-width: 0; }

.wheel-tool__entries {
    width: 100%;
    min-height: 220px;
    flex: 1;
    resize: vertical;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 12px;
    font-family: var(--poppins);
    font-size: 0.95rem;
    line-height: 1.5;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wheel-tool__entries:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(127, 86, 217, 0.15);
}

.wheel-tool__option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--primary-text-color);
}

.wheel-tool__option input { accent-color: var(--primary-color); }

.wheel-tool__status {
    font-size: 0.85rem;
    color: #dc2626;
    min-height: 1.2em;
}

.wheel-tool__link-btn {
    background: none;
    border: none;
    font-family: var(--poppins);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.wheel-tool__link-btn:hover { background: var(--primary-color-light); }

.wheel-tool__link-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.wheel-tool__results {
    list-style: none;
    flex: 1;
    min-height: 280px;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--primary-color-light);
    border-radius: 8px;
    background: #fff;
}

.wheel-tool__results-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: var(--gray-text);
    font-size: 0.9rem;
    text-align: center;
    padding: 24px;
    gap: 6px;
}

.wheel-tool__results-empty span { font-size: 2rem; opacity: 0.4; }

.wheel-tool__result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--primary-color-light);
}

.wheel-tool__result-item:first-child {
    background: var(--primary-light-background);
    border-left: 3px solid var(--primary-color);
}

.wheel-tool__result-item:last-child { border-bottom: none; }

.wheel-tool__result-rank {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color-light);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-tool__result-item:first-child .wheel-tool__result-rank {
    background: var(--primary-color);
    color: #fff;
}

.wheel-tool__result-name {
    font-weight: 600;
    font-size: 0.95rem;
    word-break: break-word;
    color: var(--primary-text-color);
}

.wheel-tool__result-time {
    font-size: 0.75rem;
    color: var(--gray-text);
    margin-top: 2px;
}

/* Modal & confetti (inside fullscreen root) */
.wheel-tool__confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 900;
    overflow: hidden;
}

.wheel-tool__modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 44, 65, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    padding: 20px;
}

.wheel-tool__modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.wheel-tool__modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(127, 86, 217, 0.25);
    transform: scale(0.9);
    transition: transform 0.25s;
}

.wheel-tool__modal-backdrop.open .wheel-tool__modal { transform: scale(1); }

.wheel-tool__modal-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-text);
    margin-bottom: 8px;
}

.wheel-tool__modal-winner {
    font-size: 2rem;
    font-weight: 800;
    word-break: break-word;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.wheel-tool__modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.wheel-tool__modal-actions .wheel-tool__btn { flex: 1; }

.wheel-tool__confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: wheelConfettiFall linear forwards;
}

@keyframes wheelConfettiFall {
    to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Fullscreen */
.wheel-tool__section:fullscreen,
.wheel-tool__section:-webkit-full-screen {
    background: var(--primary-light-background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 32px 24px;
}

.wheel-tool__section:fullscreen .wheel-tool__wrap,
.wheel-tool__section:-webkit-full-screen .wheel-tool__wrap {
    width: min(88vmin, 780px);
}

.wheel-tool__section:fullscreen .wheel-tool__actions,
.wheel-tool__section:-webkit-full-screen .wheel-tool__actions {
    width: min(88vmin, 780px);
}

/* Legacy class names used by wheel-of-names.js */
.wheel-tool .panel-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: var(--poppins);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.wheel-tool .spin-controls.visible { display: flex; animation: wheelSpinControlsIn 0.25s ease; }
.wheel-tool .wheel-wrap.spinning { cursor: wait; }
.wheel-tool .panel-tab.active { background: #fff; color: var(--primary-color); box-shadow: 0 1px 3px rgba(127, 86, 217, 0.12); }
.wheel-tool .panel-tab-pane { display: none; flex-direction: column; gap: 14px; flex: 1; }
.wheel-tool .panel-tab-pane.active { display: flex; }
.wheel-tool .modal-backdrop.open { opacity: 1; visibility: visible; }
.wheel-tool .modal-backdrop.open .modal { transform: scale(1); }
.wheel-tool .results-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 280px; color: var(--gray-text); font-size: 0.9rem; text-align: center; padding: 24px; gap: 6px; }
.wheel-tool .result-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--primary-color-light); background: #fff; }
.wheel-tool .result-item:first-child { background: var(--primary-light-background); border-left: 3px solid var(--primary-color); }
.wheel-tool .result-rank { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-color-light); color: var(--primary-color); font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.wheel-tool .result-item:first-child .result-rank { background: var(--primary-color); color: #fff; }
.wheel-tool .result-name { font-weight: 600; font-size: 0.95rem; word-break: break-word; color: var(--primary-text-color); }
.wheel-tool .result-time { font-size: 0.75rem; color: var(--gray-text); margin-top: 2px; }
.wheel-tool .confetti-piece { position: absolute; width: 10px; height: 10px; top: -10px; animation: wheelConfettiFall linear forwards; }
.wheel-tool .modal { background: #fff; border-radius: 16px; padding: 36px 32px 28px; text-align: center; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(127, 86, 217, 0.25); transform: scale(0.9); transition: transform 0.25s; }
.wheel-tool .modal-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-text); margin-bottom: 8px; }
.wheel-tool .modal-winner { font-size: 2rem; font-weight: 800; word-break: break-word; line-height: 1.2; margin-bottom: 24px; color: var(--primary-color); }
.wheel-tool .modal-actions { display: flex; gap: 10px; justify-content: center; }
.wheel-tool .modal-actions .wheel-tool__btn { flex: 1; }
.wheel-tool .btn-spin-ctrl { padding: 12px 22px; border: none; border-radius: 8px; font-family: var(--poppins); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.wheel-tool .btn-pause { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.wheel-tool .btn-stop { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
