/* ===== SunZ Spin — wheel & page styles ===== */
:root {
    --wheel-height: 112px;
    --cell-w: 150px;
    --spin-gold: #ffd54f;
    --spin-gold-2: #ffab00;
    --spin-cyan: #00d2d5;
    --spin-bg: #0d1117;
    --spin-card: rgba(255,255,255,.05);
    --spin-border: rgba(255,255,255,.1);
    --spin-text: #fff;
    --spin-muted: #9aa4af;
}

.spin-wrap { max-width: 900px; margin: 0 auto; padding: 110px 16px 40px; }

.spin-hero { text-align: center; margin: 8px 0 22px; }
.spin-hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.spin-hero h1 .sp-ic { color: var(--spin-gold); }
.spin-hero p { color: var(--spin-muted); font-size: 14px; margin: 0; }

/* remaining spins badge */
.spins-badge {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 420px; margin: 0 auto 18px; padding: 10px 16px;
    background: var(--spin-card); border: 1px solid var(--spin-border);
    border-radius: 14px;
}
.spins-badge .sb-title { font-size: 13px; color: var(--spin-muted); }
.spins-badge .sb-value {
    font-size: 22px; font-weight: 800; color: var(--spin-gold);
    min-width: 40px; text-align: center; font-variant-numeric: tabular-nums;
}

/* wheel track */
.wheel-container2222 {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: var(--wheel-height);
    margin: 0 auto 10px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.4));
    border: 1px solid var(--spin-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.45), inset 0 0 24px rgba(0,0,0,.35);
}

.prize-wheel { position: relative; width: 100%; height: 100%; overflow: hidden; }

/* the reel: one long LTR strip, moved leftward (right -> left) via transform */
.prize-list {
    position: absolute; left: 0; top: 0;
    display: flex; flex-direction: row;
    height: 100%; direction: ltr;
    will-change: transform;
    white-space: nowrap;
    align-items: center;
}

.prize-item {
    flex: 0 0 var(--cell-w);
    width: var(--cell-w);
    height: calc(100% - 20px);
    display: flex; align-items: center; justify-content: center;
    margin: 0 6px;
    padding: 0 10px; box-sizing: border-box;
    font-size: 13.5px; font-weight: 700; text-align: center;
    color: var(--spin-text);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
    overflow: hidden; white-space: nowrap;
    user-select: none;
}

.cell-common   { background: linear-gradient(180deg, rgba(120,128,140,.28), rgba(90,96,106,.12)); }
.cell-uncommon { background: linear-gradient(180deg, rgba(56,189,248,.34), rgba(2,132,199,.14)); }
.cell-rare     { background: linear-gradient(180deg, rgba(167,139,250,.38), rgba(109,40,217,.15)); }
.cell-epic     { background: linear-gradient(180deg, rgba(255,213,79,.44), rgba(255,171,0,.16)); box-shadow: inset 0 0 14px rgba(255,213,79,.25); }
.cell-win      { background: linear-gradient(180deg, rgba(0,210,213,.5), rgba(0,105,140,.2)); box-shadow: inset 0 0 18px rgba(0,210,213,.35); }

.prize-item.winner {
    background: linear-gradient(180deg, #ffd54f, #ff9800);
    color: #1f2937; text-shadow: none;
    box-shadow: 0 0 22px rgba(255,171,0,.6);
    transform: scale(1.08);
    z-index: 4;
    border-color: rgba(255,213,79,.9);
}

/* center pointer */
.wheel-pointer {
    position: absolute; left: 50%; top: 0; z-index: 3;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 22px solid var(--spin-gold);
    filter: drop-shadow(0 0 8px rgba(255,213,79,.85));
}
.wheel-pointer::after {
    content: '';
    position: absolute;
    left: -6px; top: -22px;
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 18px solid #c8890d;
}

/* edge fade overlays */
.wheel-container2222::before,
.wheel-container2222::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none;
}
.wheel-container2222::before { left: 0; border-radius: 16px 0 0 16px; background: linear-gradient(to right, #0d1117 0%, rgba(13,17,23,0) 100%); }
.wheel-container2222::after  { right: 0; border-radius: 0 16px 16px 0; background: linear-gradient(to left, #0d1117 0%, rgba(13,17,23,0) 100%); }

/* controls */
.controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 18px 0 6px; }

.spin-button {
    font-family: inherit;
    padding: 13px 34px;
    border: none; border-radius: 12px; cursor: pointer;
    font-size: 15px; font-weight: 700; color: #1f2937;
    background: linear-gradient(135deg, var(--spin-gold), var(--spin-gold-2));
    box-shadow: 0 4px 14px rgba(255,171,0,.35);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.spin-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255,171,0,.5); }
.spin-button:disabled { opacity: .55; cursor: not-allowed; }

.spin-button.ghost {
    color: var(--spin-text);
    background: var(--spin-card);
    border: 1px solid var(--spin-border);
    box-shadow: none;
}
.spin-button.ghost:hover:not(:disabled) { border-color: var(--spin-gold); }

/* result area */
.result {
    margin: 14px auto; max-width: 560px; min-height: 44px;
    padding: 12px 18px; border-radius: 12px;
    background: var(--spin-card); border: 1px solid var(--spin-border);
    color: var(--spin-text); font-size: 16px; font-weight: 700; text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.result.win { border-color: rgba(255,213,79,.5); background: rgba(255,213,79,.08); }
.result .rw-icon { font-size: 22px; }

/* winner template */
.winner-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.winner-box .rw-ic { font-size: 24px; }
.winner-box .rw-prize { color: var(--spin-gold); }

.description {
    margin: 18px auto 0; max-width: 560px;
    color: var(--spin-muted); line-height: 1.7; font-size: 13px; text-align: center;
    padding: 12px 16px; background: var(--spin-card); border-radius: 12px;
}

/* chances modal */
.modal-spin {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(3,6,10,.7); backdrop-filter: blur(4px);
    align-items: center; justify-content: center; padding: 20px;
}
.modal-spin.open { display: flex; }
.modal-content {
    width: 100%; max-width: 560px; max-height: 80vh; overflow: auto;
    background: #161b22; border: 1px solid var(--spin-border); border-radius: 16px;
    color: var(--spin-text); padding: 20px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-title { color: var(--spin-gold); font-size: 17px; font-weight: 800; }
.modal-close {
    border: 1px solid var(--spin-border); background: transparent; color: var(--spin-text);
    width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1;
}
.modal-close:hover { border-color: var(--spin-gold); }
.chance-row {
    display: flex; align-items: center; gap: 12px;
    padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: 13px;
}
.chance-row .ch-name { flex: 0 0 220px; text-align: right; font-weight: 600; }
.chance-row .ch-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.chance-row .ch-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--spin-cyan), var(--spin-gold)); border-radius: 999px; }
.chance-row .ch-pct { flex: 0 0 70px; text-align: left; color: var(--spin-gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.chance-note { font-size: 12px; color: var(--spin-muted); margin-top: 10px; text-align: center; }

.modal-footer { display: flex; justify-content: flex-start; margin-top: 14px; }

@media (max-width: 560px) {
    .spin-hero h1 { font-size: 24px; }
    .chance-row .ch-name { flex-basis: 130px; }
    .prize-item { font-size: 12.5px; }
}