:root {
    color-scheme: dark;
    font-family: Inter, Arial, system-ui, sans-serif;
    background: #100b27;
    color: #f8f4ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow: hidden;
}

.stage {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 10%, rgba(146, 83, 255, 0.3), transparent 40%),
        linear-gradient(145deg, #100b27 0%, #231044 55%, #120a2d 100%);
}

.machine {
    position: relative;
    width: min(680px, 94vw);
    padding: 44px 44px 32px;
    overflow: hidden;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 34px;
    background: linear-gradient(180deg, #523383 0%, #2b1e57 100%);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.machine::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    background: linear-gradient(110deg, transparent 10%, rgba(255, 255, 255, 0.09) 45%, transparent 60%);
}

.eyebrow {
    margin: 0 0 8px;
    color: #cdbfff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.24em;
}

h1 {
    margin: 0;
    color: #ffe173;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    font-size: clamp(44px, 9vw, 70px);
    font-weight: 900;
    letter-spacing: 0.055em;
    line-height: 1;
    text-shadow: 0 5px 0 #9c571b, 0 10px 28px rgba(255, 188, 61, 0.35);
}

.rule {
    margin: 14px 0 30px;
    color: #e5dcff;
    font-size: 18px;
}

.reels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(12, 7, 31, 0.58);
    box-shadow: inset 0 5px 18px rgba(0, 0, 0, 0.32);
}

.reel {
    display: grid;
    aspect-ratio: 1 / 1.08;
    place-items: center;
    overflow: hidden;
    border: 3px solid #edc65d;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf5 0%, #fff4d9 100%);
    box-shadow: inset 0 0 28px rgba(124, 75, 16, 0.18), 0 8px 18px rgba(0, 0, 0, 0.22);
    color: #241833;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    font-size: clamp(54px, 12vw, 88px);
    transform: translateZ(0);
}

.reel.spinning {
    animation: reel-pulse 0.16s linear infinite alternate;
}

.status {
    min-height: 31px;
    margin: 26px 0 18px;
    color: #f5efff;
    font-size: 18px;
    font-weight: 700;
}

.status.win {
    color: #ffe269;
    text-shadow: 0 0 18px rgba(255, 211, 65, 0.55);
}

.status.error {
    color: #ff9696;
}

.spin-button {
    position: relative;
    z-index: 1;
    width: min(280px, 80%);
    padding: 16px 24px;
    cursor: pointer;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffd45f 0%, #f4a52d 100%);
    box-shadow: 0 7px 0 #9d581b, 0 16px 30px rgba(0, 0, 0, 0.28);
    color: #472610;
    font: 800 22px/1 Inter, Arial, sans-serif;
    transition: transform 120ms ease, filter 120ms ease;
}

.spin-button:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.spin-button:active:not(:disabled) {
    box-shadow: 0 3px 0 #9d581b, 0 10px 20px rgba(0, 0, 0, 0.24);
    transform: translateY(4px);
}

.spin-button:disabled {
    cursor: wait;
    filter: saturate(0.6);
    opacity: 0.78;
}

.probability-control {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 54px minmax(150px, 1fr) 54px;
    gap: 10px;
    width: min(340px, 92%);
    margin: 18px auto 0;
}

.probability-arrow {
    display: grid;
    min-height: 48px;
    place-items: center;
    cursor: pointer;
    border: 1px solid #ffdf75;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffd75d 0%, #eda12d 100%);
    box-shadow: 0 4px 0 #8f4d18, 0 8px 18px rgba(0, 0, 0, 0.2);
    color: #40220d;
    font: 900 21px/1 system-ui, sans-serif;
    transition: filter 120ms ease, transform 120ms ease, opacity 120ms ease;
}

.probability-arrow:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.probability-arrow:active:not(:disabled) {
    box-shadow: 0 2px 0 #8f4d18, 0 5px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(2px);
}

.probability-arrow:disabled {
    cursor: not-allowed;
    filter: grayscale(0.9);
    opacity: 0.35;
}

.probability-value {
    display: grid;
    min-height: 48px;
    place-items: center;
    border: 2px solid rgba(255, 225, 115, 0.65);
    border-radius: 14px;
    background: rgba(31, 20, 68, 0.78);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    color: #fff0a8;
    font-size: 17px;
    font-weight: 800;
}

.notice {
    margin: 20px 0 0;
    color: #bcb0df;
    font-size: 13px;
}

@keyframes reel-pulse {
    from { transform: translateY(-4px); filter: blur(0); }
    to { transform: translateY(4px); filter: blur(1px); }
}

@media (max-width: 560px) {
    .machine { padding: 34px 18px 26px; }
    .reels { gap: 9px; padding: 10px; }
    .reel { border-width: 2px; border-radius: 14px; }
}
