.shkw-dialog,
.shkw-member,
.shkw-launch {
    --shkw-ink: #21141c;
    --shkw-plum: #321d29;
    --shkw-gold: #d9bd86;
    --shkw-gold-light: #f0d9ac;
    --shkw-white: #fff5e8;
    --shkw-muted: #dbcbbe;
    --shkw-rule: #d9bd8654;
    --shkw-serif: Georgia, "Songti SC", "Noto Serif SC", SimSun, serif;
    box-sizing: border-box;
    font-family: var(--sans, Arial, sans-serif);
}

.shkw-launch {
    position: fixed;
    inset-inline-start: max(14px, env(safe-area-inset-left));
    inset-block-end: max(18px, env(safe-area-inset-bottom));
    z-index: 32;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 7px 16px 7px 9px;
    border: 1px solid #b79265;
    border-radius: 2px;
    background: #2d1a25;
    color: var(--shkw-white);
    box-shadow: 0 4px 18px #170a125e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}
.shkw-launch span {
    display: grid;
    place-items: center;
    inline-size: 24px;
    block-size: 24px;
    border: 1px solid #c9a674;
    border-radius: 50%;
    color: var(--shkw-gold-light);
    font: 19px/1 var(--shkw-serif);
}
.shkw-launch:hover { background: #442639; }
.shkw-launch[hidden] { display: none; }

.shkw-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    max-width: 66rem;
    margin: 1.5rem auto;
    padding: 18px clamp(16px, 3vw, 28px);
    border: 1px solid #b9946a;
    background: var(--shkw-plum);
    color: var(--shkw-white);
}
.shkw-member h2 { margin: 0; color: inherit; font: 400 1.45rem/1.25 var(--shkw-serif); }
.shkw-member p { margin: .35rem 0 0; color: var(--shkw-muted); }
.shkw-member button {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--shkw-gold);
    border-radius: 2px;
    background: var(--shkw-gold-light);
    color: #2c1a21;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

#shk-wheel-dialog {
    position: fixed;
    inset: 0;
    z-index: 102;
    width: min(900px, calc(100vw - 36px));
    max-width: none;
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    margin: auto;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #9e795b;
    border-radius: 5px;
    background: var(--shkw-ink);
    color: var(--shkw-white);
    color-scheme: dark;
    box-shadow: 0 28px 100px #100810b0;
}
#shk-wheel-dialog::backdrop {
    background: #120b11b8;
    overflow: hidden;
    overscroll-behavior: contain;
}
#shk-wheel-dialog * { box-sizing: border-box; }
#shk-wheel-dialog [hidden] { display: none; }

#shk-wheel-dialog .shkw-close {
    position: absolute;
    z-index: 3;
    inset: 10px 10px auto auto;
    display: grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    margin: 0;
    padding: 0 0 3px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: #241721;
    color: var(--shkw-white);
    font: 400 27px/1 Arial, sans-serif;
    cursor: pointer;
}
#shk-wheel-dialog .shkw-close:hover { border-color: var(--shkw-rule); }

.shkw-content {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 505px;
}

.shk-wheel-stage {
    --shkw-spin-time: 3100ms;
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-width: 0;
    padding: clamp(35px, 5vw, 70px);
    border-inline-end: 1px solid var(--shkw-rule);
    background:
        radial-gradient(ellipse at 48% 42%, #5c3646 0%, #3b2231 54%, #271823 95%);
}
.shk-wheel-stage::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: clamp(10px, 2vw, 20px);
    border: 1px solid #c9a67452;
    background:
        linear-gradient(115deg, #eed5b00f, #0b060c21),
        repeating-linear-gradient(143deg, #ffebd702 0 1px, transparent 1px 4px);
    pointer-events: none;
}

.shkw-wheel {
    position: relative;
    isolation: isolate;
    inline-size: min(100%, 375px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        conic-gradient(from -27deg, #dfc295 0%, #75513b 17%, #f2ddb4 30%, #906d4d 44%, #f6e2b7 60%, #99704a 74%, #eed2a1 88%, #dfc295 100%);
    box-shadow:
        0 0 0 1px #f0d7ab,
        0 2px 0 3px #2d1720,
        0 18px 28px #1309129c;
}
.shkw-wheel::before,
.shkw-wheel::after {
    content: "";
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
}
.shkw-wheel::before {
    z-index: 2;
    inset: 1.1%;
    background: repeating-conic-gradient(#4d2e22b0 0deg .42deg, transparent .42deg 6deg);
    mask-image: radial-gradient(transparent 0 87%, #000 88% 98%, transparent 99%);
}
.shkw-wheel::after {
    z-index: 2;
    inset: 5.4%;
    border: 1px solid #f4d5a3;
    box-shadow: 0 0 0 2px #3e2730, inset 0 0 0 1px #2918229a;
}
.shkw-face {
    position: absolute;
    inset: 5.6%;
    border-radius: 50%;
    overflow: hidden;
    transform: rotate(var(--shkw-angle, 0deg));
    background:
        radial-gradient(circle, #21132045 0%, transparent 51%, #12081168 100%),
        conic-gradient(
            #4d2738 0 59.87%, #d9bd86 59.87% 60%,
            #6b3c50 60% 89.87%, #d9bd86 89.87% 90%,
            #846343 90% 99.87%, #d9bd86 99.87% 100%
        );
}
.shkw-face::after {
    content: "";
    position: absolute;
    inset: 9%;
    border: 1px solid #e5c19150;
    border-radius: 50%;
    pointer-events: none;
}
.shkw-face > :is(.shkw-n0, .shkw-n1, .shkw-n2) {
    position: absolute;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 1px;
    color: #fff0cf;
    text-shadow: 0 1px 2px #2a1419;
    transform: translate(-50%, -50%) rotate(var(--shkw-label-turn, 0deg));
}
.shkw-face strong {
    font: 400 clamp(29px, 3.8vw, 51px)/.95 var(--shkw-serif);
    font-variant-numeric: lining-nums;
}
.shkw-face small {
    color: #f6dfab;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    line-height: 1.2;
}
.shkw-n0 { left: 79%; top: 59.4%; }
.shkw-n1 { left: 19.5%; top: 50%; }
.shkw-n2 { left: 40.1%; top: 19.6%; }

.shkw-hub {
    position: absolute;
    z-index: 3;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    inline-size: 20%;
    aspect-ratio: 1;
    border: 1px solid #f1d5a0;
    border-radius: 50%;
    background:
        radial-gradient(circle, #422936 0 56%, #ab8456 57% 59%, #2d1b29 60% 68%, #e3c497 69% 70%, #745239 71%);
    color: #f4d9aa;
    box-shadow: 0 3px 6px #140c13c7, inset 0 0 2px #f1dfbc;
    font: 400 clamp(27px, 3.2vw, 42px)/1 var(--shkw-serif);
}
.shkw-index {
    position: absolute;
    z-index: 4;
    inset: -4% auto auto 50%;
    inline-size: 10%;
    aspect-ratio: .82;
    translate: -50%;
    transform-origin: 50% 15%;
    filter: drop-shadow(0 2px 3px #1b0a15b0);
}
.shkw-index::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(102deg, #7c593c 2%, #d6b277 21%, #fff0c5 49%, #ae8557 51%, #e7c788 90%);
    clip-path: polygon(50% 0, 96% 35%, 50% 100%, 4% 35%);
}
.shk-wheel-stage[data-landed] .shkw-wheel {
    box-shadow:
        0 0 0 1px #fff0c6,
        0 0 28px #f4c97a49,
        0 18px 28px #1309129c;
}
.shk-wheel-stage[data-landed="1"] .shkw-n0,
.shk-wheel-stage[data-landed="5"] .shkw-n1,
.shk-wheel-stage[data-landed="10"] .shkw-n2 {
    color: #fffaf1;
    text-shadow: 0 0 15px #fae7aeae, 0 1px 2px #270f20;
}

.shkw-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-width: 0;
    padding: 48px clamp(24px, 4vw, 54px) 44px;
}
.shkw-mini {
    position: relative;
    width: fit-content;
    max-width: 100%;
    padding-block-end: 12px;
    margin: 0 0 18px;
    color: var(--shkw-gold-light);
    font: 400 15px/1.2 var(--shkw-serif);
    letter-spacing: .15em;
}
.shkw-mini::after {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: 38px;
    border-bottom: 1px solid #b09262;
}
#shk-wheel-dialog h2 {
    max-width: 100%;
    margin: 0 0 16px;
    color: var(--shkw-white);
    font: 400 clamp(30px, 4vw, 49px)/1.09 var(--shkw-serif);
    letter-spacing: -.035em;
    text-wrap: balance;
}
#shk-wheel-dialog h2:focus { outline: 0; }
#shk-wheel-dialog p {
    margin: 0 0 12px;
    color: var(--shkw-muted);
    line-height: 1.55;
}
#shk-wheel-dialog .shkw-note { font-size: 13px; }
#shk-wheel-dialog .shkw-status {
    min-height: 0;
    margin: 0;
    color: var(--shkw-gold-light);
    font-size: 13px;
}
#shk-wheel-dialog .shkw-status:empty { margin: 0; }
#shk-wheel-dialog[data-phase="credited"] .shkw-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
#shk-wheel-dialog .shkw-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    border-block: 1px solid var(--shkw-rule);
}
.shkw-info li {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px 4px;
    text-align: center;
}
.shkw-info li + li { border-inline-start: 1px solid var(--shkw-rule); }
.shkw-info strong {
    color: var(--shkw-white);
    font: 400 19px/1.1 var(--shkw-serif);
}
.shkw-info span { color: var(--shkw-gold-light); font-size: 12px; }
.shkw-actions { display: grid; gap: 8px; margin-block: 18px 0; }
#shk-wheel-dialog .shkw-primary,
#shk-wheel-dialog .shkw-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #c5a579;
    border-radius: 2px;
    text-align: center;
    font: 700 14px/1.35 var(--sans, Arial, sans-serif);
    text-decoration: none;
    cursor: pointer;
}
#shk-wheel-dialog .shkw-primary {
    background: linear-gradient(108deg, #daba85, #f1d9ac 62%, #ddbd85);
    color: #261822;
    box-shadow: inset 0 0 0 1px #f8e3b77a;
}
#shk-wheel-dialog .shkw-primary:hover { background: #f6e0b5; }
#shk-wheel-dialog .shkw-secondary {
    border-color: var(--shkw-rule);
    background: transparent;
    color: var(--shkw-white);
}
#shk-wheel-dialog .shkw-secondary:hover { border-color: var(--shkw-gold); }
#shk-wheel-dialog .shkw-primary:disabled { opacity: .68; cursor: wait; }
#shk-wheel-dialog :is(a, button):focus-visible,
.shkw-member button:focus-visible,
.shkw-launch:focus-visible {
    outline: 2px solid #f4d79e;
    outline-offset: 3px;
}

#shk-wheel-dialog .shkw-receipt h2 { margin-block-end: 8px; }
.shkw-award {
    display: flex;
    align-items: baseline;
    gap: .04em;
    margin: 0 0 2px;
    color: #f1d198;
    font: 400 clamp(66px, 8vw, 106px)/.94 var(--shkw-serif);
    font-variant-numeric: lining-nums;
}
.shkw-plus { font-size: .55em; }
#shk-wheel-dialog .shkw-unit { color: var(--shkw-gold-light); font-size: 14px; }
#shk-wheel-dialog .shkw-balance {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px 14px;
    margin-block: 16px 0;
    padding: 10px 0;
    border-block: 1px solid var(--shkw-rule);
    font-size: 13px;
}
.shkw-balance [data-wheel-balance] {
    color: var(--shkw-white);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: no-preference) {
    #shk-wheel-dialog[open] { animation: shkw-enter 330ms cubic-bezier(.2,.7,.3,1) both; }
    #shk-wheel-dialog[open]::backdrop { animation: shkw-fade 250ms ease-out both; }
    #shk-wheel-dialog[data-phase="claiming"] .shkw-index { animation: shkw-ready 620ms ease-in-out both; }
    .shk-wheel-stage[data-landed] .shkw-index { animation: shkw-settle 440ms ease-out both; }
    .shkw-receipt { animation: shkw-reveal 380ms cubic-bezier(.2,.7,.3,1) both; }
}
@keyframes shkw-enter {
    from { opacity: 0; transform: translateY(10px) scale(.99); }
    to { opacity: 1; transform: none; }
}
@keyframes shkw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shkw-ready { 45% { transform: rotate(-10deg); } }
@keyframes shkw-settle { 25% { transform: rotate(9deg); } 60% { transform: rotate(-3deg); } }
@keyframes shkw-reveal {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 680px) {
    #shk-wheel-dialog { width: min(430px, calc(100vw - 24px)); }
    .shkw-content { grid-template-columns: minmax(0,1fr); min-height: 0; }
    .shk-wheel-stage {
        border-inline-end: 0;
        border-block-end: 1px solid var(--shkw-rule);
        padding: 25px 30px 19px;
    }
    .shk-wheel-stage::before { inset: 8px; }
    .shkw-wheel { inline-size: min(100%, 244px, 39svh); }
    .shkw-copy { padding: 19px 22px 23px; }
    .shkw-mini { margin-block-end: 11px; padding-block-end: 8px; font-size: 13px; }
    #shk-wheel-dialog h2 { margin-block-end: 12px; font-size: clamp(26px, 7.2vw, 35px); }
    #shk-wheel-dialog .shkw-info { margin-block-end: 10px; }
    .shkw-info li { padding-block: 8px; }
    .shkw-actions { margin-block-start: 13px; }
    #shk-wheel-dialog .shkw-close { inset: 6px 6px auto auto; }
    .shkw-face strong { font-size: clamp(24px, 8vw, 33px); }
    .shkw-face small { font-size: 9px; }
    .shkw-hub { font-size: 29px; }
    .shkw-award { font-size: 64px; }
    #shk-wheel-dialog .shkw-balance { margin-block-start: 12px; }
    .shkw-launch {
        inset-inline-start: max(9px, env(safe-area-inset-left));
        inset-block-end: max(9px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 360px) {
    .shkw-copy { padding-inline: 16px; }
}
