.elg-wheel {
    max-width: 980px;
    margin: 24px auto;
    padding: 20px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: linear-gradient(145deg, #f8fafc, #eef2ff);
    color: #172033;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-shadow: 0 18px 44px rgba(30, 41, 59, .12);
    box-sizing: border-box;
    position: relative;
}
.elg-wheel *, .elg-wheel *::before, .elg-wheel *::after { box-sizing: border-box; }
.elg-wheel [hidden] { display: none !important; }
.elg-wh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.elg-wh-kicker {
    color: #0ea5e9;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}
.elg-wh-title {
    margin: 2px 0 0;
    color: #312e81;
    font-size: 1.35rem;
    font-weight: 900;
}
.elg-wh-pill {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 900;
}
.elg-wh-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.elg-wh-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #fff;
    color: #4338ca;
    cursor: pointer;
    transition: background .2s ease, transform .1s ease;
}
.elg-wh-icon-btn:hover,
.elg-wh-icon-btn:focus-visible {
    background: #eff6ff;
    outline: none;
}
.elg-wh-icon-btn:active {
    transform: scale(.96);
}
.elg-wh-icon-btn svg,
.elg-wh-icon-btn svg path,
.elg-wh-icon-btn svg line,
.elg-wh-icon-btn svg circle {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.elg-wh-setup,
.elg-wh-stage {
    padding: 18px;
    border: 1px solid rgba(199, 210, 254, .9);
    border-radius: 16px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 26px rgba(79, 70, 229, .08);
}
.elg-wh-label {
    display: block;
    color: #312e81;
    font-weight: 900;
}
.elg-wh-input {
    width: 100%;
    min-height: 150px;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-weight: 700;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}
.elg-wh-color-input { min-height: 92px; }
.elg-wh-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .17);
}
.elg-wh-help {
    margin-top: 8px;
    color: #64748b;
    font-size: .9rem;
    font-weight: 700;
}
.elg-wh-setup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .45fr);
    gap: 14px;
    align-items: start;
    margin-top: 14px;
}
.elg-wh-advanced {
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fafc;
}
.elg-wh-advanced summary {
    color: #1d4ed8;
    font-weight: 900;
    cursor: pointer;
}
.elg-wh-advanced .elg-wh-label {
    margin-top: 12px;
}
.elg-wh-check {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding: 13px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 900;
}
.elg-wh-check input {
    width: 20px;
    height: 20px;
    accent-color: #2563eb;
}
.elg-wh-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}
.elg-wh-btn {
    min-height: 44px;
    padding: 11px 18px;
    border: 0;
    border-radius: 12px;
    background: #e2e8f0;
    color: #334155;
    font: inherit;
    font-size: .95rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform .1s ease, filter .2s ease, background .2s ease;
}
.elg-wh-btn-primary,
.elg-wh-spin {
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff;
}
.elg-wh-btn:hover:not(:disabled),
.elg-wh-spin:hover:not(:disabled) { filter: brightness(.98); }
.elg-wh-btn:active:not(:disabled) { transform: scale(.96); }
.elg-wh-spin:active:not(:disabled) { transform: translate(-50%, -50%) scale(.96); }
.elg-wh-message {
    min-height: 28px;
    margin-top: 12px;
    color: #dc2626;
    font-weight: 800;
    text-align: center;
}
.elg-wh-stage {
    display: grid;
    grid-template-columns: minmax(280px, 1.1fr) minmax(250px, .65fr);
    gap: 18px;
    align-items: center;
}
.elg-wh-wheel-wrap {
    position: relative;
    width: min(100%, 560px);
    aspect-ratio: 1;
    margin: 0 auto;
    isolation: isolate;
}
.elg-wh-canvas {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    filter: drop-shadow(0 18px 30px rgba(30, 41, 59, .22));
    pointer-events: none;
}
.elg-wh-pointer {
    position: absolute;
    z-index: 4;
    top: -8px;
    left: 50%;
    width: 36px;
    height: 48px;
    transform: translateX(-50%);
    background: #facc15;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .22));
    pointer-events: none;
}
.elg-wh-spin {
    position: absolute;
    z-index: 5;
    inset: 50% auto auto 50%;
    width: 118px;
    height: 118px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    border: 7px solid #fff;
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(30, 41, 59, .28);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
}
.elg-wh-spin:disabled {
    cursor: wait;
    opacity: .75;
}
.elg-wh-panel {
    display: grid;
    gap: 14px;
}
.elg-wh-result-box {
    padding: 18px;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #eff6ff;
    text-align: center;
}
.elg-wh-result-box span {
    display: block;
    color: #1d4ed8;
    font-size: .85rem;
    font-weight: 900;
    text-transform: uppercase;
}
.elg-wh-result-box strong {
    display: block;
    margin-top: 6px;
    color: #172033;
    font-size: 1.3rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}
.elg-wh-mini-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
}
.elg-wh-chip {
    padding: 8px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #c7d2fe;
    color: #334155;
    font-size: .88rem;
    font-weight: 800;
}
.elg-wh-modal {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, .48);
}
.elg-wh-modal-card {
    width: min(420px, 100%);
    padding: 26px;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    animation: elg-wh-pop .2s ease both;
}
.elg-wh-modal-card span {
    color: #2563eb;
    font-weight: 900;
    text-transform: uppercase;
}
.elg-wh-modal-card strong {
    display: block;
    margin: 10px 0 16px;
    color: #172033;
    font-size: clamp(1.6rem, 5vw, 2.5rem);
    font-weight: 900;
    overflow-wrap: anywhere;
}
@media (max-width: 760px) {
    .elg-wheel { padding: 14px; }
    .elg-wh-header { align-items: flex-start; flex-direction: column; }
    .elg-wh-status { justify-content: flex-start; }
    .elg-wh-setup-grid,
    .elg-wh-stage { grid-template-columns: 1fr; }
    .elg-wh-check { margin-top: 0; }
    .elg-wh-spin {
        width: 96px;
        height: 96px;
        font-size: .92rem;
    }
}
.elg-wheel:fullscreen,
.elg-wheel.is-fullscreen {
    width: 100vw;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    border: 0;
    border-radius: 0;
    overflow: auto;
}
.elg-wheel:fullscreen .elg-wh-wheel-wrap,
.elg-wheel.is-fullscreen .elg-wh-wheel-wrap {
    width: min(82vh, 86vw, 720px);
}
@keyframes elg-wh-pop {
    from { opacity: 0; transform: translateY(8px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
