body {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.35) 0%, rgba(168, 85, 247, 0) 55%),
        linear-gradient(180deg, #1b0b3a 0%, #0d0522 100%);
    background-attachment: fixed;
}

.slot-container {
    --slot-main: #c4001a;
    position: relative;
    padding: 0.5rem 0.5rem 1.25rem;
    text-align: center;
}

/* ── Cabinet ── */
.slot-machine {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 14px 0 12px;
    border-radius: 28px;
    background: var(--slot-main);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--slot-main) 82%, #fff) 0%,
        var(--slot-main) 30%,
        color-mix(in srgb, var(--slot-main) 55%, #000) 100%);
    box-shadow:
        0 0 0 4px #ffd766,
        0 0 0 7px #8a5a08,
        0 24px 44px rgba(0, 0, 0, 0.65),
        0 0 60px color-mix(in srgb, var(--slot-main) 60%, transparent),
        inset 0 3px 0 rgba(255, 255, 255, 0.4),
        inset 0 -10px 20px rgba(0, 0, 0, 0.35);
}

/* ── Marquee (logo) ── */
.slot-marquee {
    position: relative;
    margin: 0 14px 12px;
    padding: 20px 10px 12px;
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 65%),
        linear-gradient(180deg, #2a0a5e 0%, #12042f 100%);
    border: 3px solid #ffd766;
    box-shadow:
        0 0 0 2px #8a5a08,
        inset 0 0 22px rgba(0, 0, 0, 0.7),
        0 0 18px rgba(255, 214, 102, 0.45);
}

.slot-sign {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 62px;
}

.slot-sign img {
    max-width: 100%;
    max-height: 62px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

/* ── Chasing bulbs ── */
.slot-bulbs {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.slot-marquee .slot-bulbs {
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
}

.slot-bulbs-bottom {
    margin-top: 12px;
    padding: 0 18px;
}

.slot-bulbs span {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0%, #ffe680 40%, #f5b301 100%);
    box-shadow: 0 0 6px 2px rgba(255, 214, 102, 0.9);
    animation: slBulb 1s steps(1, end) infinite;
}

.slot-bulbs span:nth-child(even) {
    animation-delay: -0.5s;
}

@keyframes slBulb {
    0%   { opacity: 1;    transform: scale(1); }
    50%  { opacity: 0.25; transform: scale(0.85); box-shadow: 0 0 2px 0 rgba(255, 214, 102, 0.4); }
}

/* ── Reels window ── */
.slot-window {
    position: relative;
    margin: 0 14px;
    padding: 10px;
    border-radius: 16px;
    background: linear-gradient(180deg, #5b5670 0%, #2b2740 50%, #4a4560 100%);
    box-shadow:
        inset 0 0 0 2px #9d97b5,
        inset 0 6px 14px rgba(0, 0, 0, 0.7),
        0 2px 0 rgba(255, 255, 255, 0.35);
}

.slot-reels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 4px;
    border-radius: 10px;
    background: #110a22;
}

.slot-reel {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 2.85;
    border-radius: 6px;
    background: linear-gradient(90deg, #cfc8e2 0%, #fbfaff 18%, #ffffff 50%, #fbfaff 82%, #cfc8e2 100%);
}

/* cylinder shading: dark at top and bottom */
.slot-reel::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg,
        rgba(20, 8, 44, 0.7) 0%,
        rgba(20, 8, 44, 0) 24%,
        rgba(20, 8, 44, 0) 76%,
        rgba(20, 8, 44, 0.7) 100%);
}

.slot-cell {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.slot-cell img {
    width: 74%;
    height: 74%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
    filter: drop-shadow(0 3px 2px rgba(40, 20, 70, 0.4));
}

.slot-reel.spinning .slot-cell img {
    filter: blur(2.5px) drop-shadow(0 3px 2px rgba(40, 20, 70, 0.3));
}

.slot-reel.settle .slot-cell img {
    animation: slSettle 0.32s ease-out;
}

@keyframes slSettle {
    0%   { transform: translateY(-7px); }
    45%  { transform: translateY(4px); }
    75%  { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

/* ── Winning line ── */
.slot-payline {
    position: absolute;
    left: 6px;
    right: 6px;
    top: 50%;
    z-index: 3;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 2px;
    background: #ff2d4a;
    box-shadow: 0 0 8px 1px rgba(255, 45, 74, 0.85);
    opacity: 0.75;
    pointer-events: none;
}

.slot-payline::before,
.slot-payline::after {
    content: '';
    position: absolute;
    top: -6px;
    border: 7.5px solid transparent;
}

.slot-payline::before {
    left: -6px;
    border-left-color: #ffd766;
    border-left-width: 11px;
}

.slot-payline::after {
    right: -6px;
    border-right-color: #ffd766;
    border-right-width: 11px;
}

/* ── Glass reflection ── */
.slot-glass {
    position: absolute;
    inset: 10px;
    z-index: 4;
    border-radius: 10px;
    pointer-events: none;
    background: linear-gradient(118deg,
        rgba(255, 255, 255, 0.24) 0%,
        rgba(255, 255, 255, 0.08) 32%,
        rgba(255, 255, 255, 0) 33%);
}

/* ── Spin button ── */
.slot-panel {
    padding: 16px 14px 0;
}

.slot-spin-btn {
    width: 100%;
    max-width: 240px;
    padding: 14px 20px 16px;
    border: 3px solid #ffd766;
    border-radius: 999px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
    cursor: pointer;
    background: linear-gradient(180deg, #ff6b6b 0%, #e5142b 55%, #a80017 100%);
    box-shadow:
        0 6px 0 #6b0010,
        0 10px 18px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
    animation: slPulse 1.6s ease-in-out infinite;
}

.slot-spin-btn:hover:not(:disabled) {
    filter: brightness(1.08);
}

.slot-spin-btn:active:not(:disabled) {
    transform: translateY(5px);
    box-shadow:
        0 1px 0 #6b0010,
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.slot-spin-btn:disabled {
    cursor: default;
    filter: grayscale(0.7) brightness(0.8);
    animation: none;
}

@keyframes slPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

/* ── Win state ── */
.slot-container.win .slot-payline {
    opacity: 1;
    animation: slLine 0.35s steps(1, end) infinite;
}

.slot-container.win .slot-machine {
    animation: slGlow 0.7s ease-in-out infinite;
}

.slot-container.win .slot-bulbs span {
    animation-duration: 0.3s;
}

.slot-container.win .slot-reel .slot-cell.slot-win-cell img {
    animation: slWinPop 0.5s ease-in-out infinite alternate;
}

@keyframes slLine {
    0%   { background: #ff2d4a; }
    50%  { background: #ffe680; box-shadow: 0 0 12px 3px rgba(255, 230, 128, 0.95); }
}

@keyframes slGlow {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.18); }
}

@keyframes slWinPop {
    from { transform: scale(1); }
    to   { transform: scale(1.18); }
}

/* ── Confetti ── */
.slot-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

.slot-confetti i {
    position: absolute;
    top: -12px;
    width: 8px;
    height: 13px;
    border-radius: 2px;
    animation: slFall linear forwards;
}

@keyframes slFall {
    0%   { top: -12px; transform: rotate(0deg); opacity: 1; }
    100% { top: 105%;  transform: rotate(720deg); opacity: 0.9; }
}

/* ── Small screens ── */
@media (max-width: 360px) {
    .slot-marquee { margin: 0 10px 10px; }
    .slot-window  { margin: 0 10px; padding: 8px; }
    .slot-sign, .slot-sign img { height: 52px; max-height: 52px; }
    .slot-spin-btn { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .slot-bulbs span, .slot-spin-btn { animation: none; }
}
