:root {
    --game-w: 1536px;
    --game-h: 1024px;
    --topbar-h: 56px;
    --scene-h: 1024px;
    --ink: #fff8ef;
    --muted: rgba(255, 248, 239, 0.76);
    --gold: #ffd15f;
    --pink: #ff58b7;
    --blue: #35cfff;
    --green: #60ff8f;
    --violet: #a76bff;
    --panel: rgba(21, 10, 42, 0.78);
    --panel-strong: rgba(16, 7, 36, 0.92);
    --line: rgba(255, 255, 255, 0.18);
    --shadow: 0 24px 80px rgba(25, 5, 45, 0.48);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: var(--game-w);
    min-height: var(--game-h);
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: #080719;
    overflow: auto;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: -2;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 18px),
        #080719;
}

body::after {
    z-index: -1;
    background: linear-gradient(90deg, rgba(255, 88, 183, 0.05), transparent 22%, transparent 78%, rgba(53, 207, 255, 0.05));
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

button:disabled {
    cursor: default;
    opacity: 0.62;
}

a {
    color: inherit;
}

.slot-shell {
    position: relative;
    width: var(--game-w);
    height: var(--game-h);
    min-height: var(--game-h);
    margin: 0 auto;
    padding-top: 0;
    overflow: hidden;
}

.slot-topbar {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--game-w);
    z-index: 30;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 16px 8px;
    background: rgba(20, 10, 36, 0.9);
    border-bottom: 1px solid rgba(255, 209, 95, 0.28);
    box-shadow: 0 12px 26px rgba(20, 5, 36, 0.35);
}

.slot-topbar::before {
    content: "";
    position: absolute;
    inset: -24px 10px -24px;
    z-index: -1;
    background: url("media/lollipop-frame-wide.png") center / 100% 100% no-repeat;
    opacity: 0.72;
    pointer-events: none;
}

.brand,
.top-actions,
.modal-head {
    position: relative;
    z-index: 1;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #210808;
    background: linear-gradient(135deg, #fff6bc, var(--gold), #ff71bf);
    font-weight: 950;
    box-shadow: 0 0 28px rgba(255, 209, 95, 0.36);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand small {
    color: rgba(255, 248, 239, 0.82);
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-btn,
.step-btn,
.auto-btn,
.buy-btn {
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0 14px;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
        rgba(26, 14, 52, 0.72);
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: transform 0.14s ease, border-color 0.14s ease, filter 0.14s ease, background 0.14s ease;
}

.chip-btn:hover,
.step-btn:hover,
.auto-btn:hover,
.buy-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 209, 95, 0.82);
}

.account-chip.is-authenticated {
    color: #102619;
    border-color: rgba(96, 255, 143, 0.8);
    background: linear-gradient(135deg, #baffce, #60ff8f);
    font-weight: 900;
}

.slot-hero {
    position: relative;
    width: var(--game-w);
    height: var(--scene-h);
    min-height: var(--scene-h);
    overflow: hidden;
}

.slot-machine {
    position: relative;
    width: var(--game-w);
    height: var(--scene-h);
    min-height: var(--scene-h);
    overflow: hidden;
    background: url("media/celestial-candy-bg.png") 0 0 / var(--game-w) var(--game-h) no-repeat;
}

.slot-machine::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(16, 3, 32, 0.18), rgba(255, 255, 255, 0.02) 28%, rgba(255, 255, 255, 0.02) 70%, rgba(16, 3, 32, 0.2)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(6, 2, 22, 0.18) 76%, rgba(6, 2, 22, 0.44));
    pointer-events: none;
}

.machine-header,
.stage-wrap,
.message-bar,
.control-panel,
.title-lockup,
.side-info {
    position: absolute;
}

.machine-header {
    left: 18px;
    top: 74px;
    z-index: 7;
    width: 300px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.machine-header > div {
    min-height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 8px 10px;
    background:
        linear-gradient(180deg, rgba(255, 88, 183, 0.14), rgba(28, 10, 60, 0.88)),
        var(--panel);
    box-shadow: 0 14px 30px rgba(34, 8, 55, 0.24);
    backdrop-filter: blur(10px);
}

.machine-header strong {
    display: block;
    margin-top: 4px;
    color: #ffffff;
    font-size: 1.08rem;
    text-shadow: 0 0 18px rgba(255, 209, 95, 0.34);
}

.kicker {
    display: block;
    color: #fff2a7;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    margin-top: 8px;
    font-size: 3rem;
    line-height: 0.92;
    text-transform: uppercase;
    text-shadow: 0 6px 0 rgba(95, 33, 101, 0.58), 0 22px 46px rgba(0, 0, 0, 0.42);
}

.title-lockup {
    left: 20px;
    top: 736px;
    bottom: auto;
    z-index: 8;
    width: 320px;
    min-width: 270px;
    padding: 34px 32px 30px;
    background: rgba(17, 8, 38, 0.88);
    backdrop-filter: blur(10px);
}

.title-lockup::before,
.side-info article::before {
    content: "";
    position: absolute;
    inset: -16px;
    z-index: -1;
    background: url("media/lollipop-frame-info.png") center / 100% 100% no-repeat;
    pointer-events: none;
}

.title-lockup p,
.side-info p,
.rules p {
    color: var(--muted);
    line-height: 1.48;
}

.side-info {
    left: 1274px;
    right: auto;
    top: 128px;
    z-index: 8;
    width: 252px;
    display: grid;
    gap: 10px;
}

.side-info article {
    position: relative;
    min-height: 128px;
    padding: 34px 30px 30px;
    background: rgba(15, 8, 38, 0.9);
    backdrop-filter: blur(10px);
}

.side-info article strong {
    display: block;
    margin: 6px 0;
    color: var(--gold);
    font-size: 1.28rem;
}

.side-info p {
    font-size: 0.78rem;
}

.stage-wrap {
    left: 344px;
    top: 197px;
    z-index: 5;
    width: 848px;
    height: 685px;
    transform: none;
    isolation: isolate;
}

.stage-wrap::before,
.stage-wrap::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.stage-wrap::before {
    display: none;
}

.stage-wrap::after {
    display: none;
}

.slot-grid {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    background: transparent;
}

.symbol-cell {
    min-height: 0;
    position: relative;
    overflow: visible;
    pointer-events: none;
}

.symbol-art {
    position: absolute;
    inset: -5%;
    background-image: var(--symbol-image, url("media/celestial-candy-symbols.png"));
    background-size: 300% 300%;
    background-position: var(--pos);
    background-repeat: no-repeat;
    mix-blend-mode: normal;
    filter:
        drop-shadow(0 12px 9px rgba(42, 16, 52, 0.42))
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.2))
        saturate(1.22);
    will-change: transform, opacity;
}

.symbol-art--asset {
    inset: 2%;
    background-position: center;
    background-size: contain;
}

.symbol-art[data-tier="low"] {
    opacity: 0.8;
    filter:
        drop-shadow(0 10px 8px rgba(42, 16, 52, 0.32))
        drop-shadow(0 0 5px rgba(255, 255, 255, 0.1))
        brightness(0.76)
        saturate(0.62);
}

.symbol-art[data-tier="high"] {
    filter:
        drop-shadow(0 13px 10px rgba(42, 16, 52, 0.48))
        drop-shadow(0 0 13px rgba(255, 222, 120, 0.42))
        brightness(1.08)
        saturate(1.42);
}

.symbol-art.is-winning {
    z-index: 4;
    animation: symbolPulse 0.72s ease-in-out infinite alternate;
    filter:
        drop-shadow(0 12px 9px rgba(42, 16, 52, 0.42))
        drop-shadow(0 0 22px rgba(255, 209, 95, 0.96))
        saturate(1.34);
}

.symbol-art.is-removing {
    z-index: 5;
    animation: symbolBurst 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.symbol-art.is-suspense {
    z-index: 6;
    animation: scatterSway 0.58s ease-in-out infinite alternate;
    filter:
        drop-shadow(0 12px 9px rgba(42, 16, 52, 0.42))
        drop-shadow(0 0 28px rgba(255, 209, 95, 0.98))
        saturate(1.42);
}

.slot-grid.is-resolving::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 24%, rgba(255, 88, 183, 0.08));
    transition: opacity 0.28s ease;
}

.slot-grid.is-resolving::after {
    opacity: 1;
}

.multiplier-orbit {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}

.floating-multi {
    position: absolute;
    left: var(--x);
    top: var(--y);
    min-width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: conic-gradient(from 40deg, #ff58b7, #ffd15f, #35cfff, #60ff8f, #a76bff, #ff58b7);
    border: 3px solid rgba(255, 255, 255, 0.72);
    font-size: 1.35rem;
    font-weight: 1000;
    text-shadow: 0 2px 5px rgba(58, 9, 94, 0.64);
    box-shadow: 0 0 24px rgba(255, 88, 183, 0.52);
    animation: floatMulti 2.2s ease-in-out infinite;
}

.free-spins-badge {
    position: absolute;
    right: 4%;
    top: 4%;
    z-index: 7;
    min-width: 110px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;
    padding: 10px;
    color: white;
    background: linear-gradient(145deg, rgba(255, 88, 183, 0.78), rgba(84, 56, 190, 0.78));
    box-shadow: 0 14px 28px rgba(69, 31, 77, 0.28);
    text-align: center;
}

.free-spins-badge span,
.free-spins-badge strong {
    display: block;
}

.free-spins-badge strong {
    font-size: 2rem;
}

.message-bar {
    left: 403px;
    top: 858px;
    bottom: auto;
    z-index: 10;
    width: 730px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 8px 16px;
    color: var(--ink);
    background: rgba(18, 8, 40, 0.72);
    text-align: center;
    backdrop-filter: blur(8px);
}

.control-panel {
    left: 383px;
    top: 842px;
    bottom: auto;
    z-index: 9;
    width: 770px;
    min-height: 120px;
    display: grid;
    grid-template-columns: minmax(230px, 1fr) auto 116px auto;
    gap: 12px;
    align-items: end;
    transform: none;
    padding: 40px 34px 18px;
    background: rgba(25, 12, 50, 0.82);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -14px 44px rgba(16, 4, 34, 0.34);
    backdrop-filter: blur(12px);
}

.control-panel::before {
    content: "";
    position: absolute;
    inset: -34px -50px -42px;
    z-index: -1;
    background: url("media/lollipop-frame-wide.png") center / 100% 100% no-repeat;
    pointer-events: none;
}

.bet-controls {
    min-height: 58px;
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    padding: 6px;
    background: rgba(18, 8, 40, 0.64);
}

.bet-controls label {
    display: grid;
    gap: 2px;
    text-align: center;
}

.bet-controls span {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bet-controls input {
    width: 100%;
    border: 0;
    color: var(--ink);
    background: transparent;
    text-align: center;
    font-weight: 900;
    outline: none;
}

.step-btn {
    width: 50px;
    padding: 0;
    font-size: 1.3rem;
    font-weight: 900;
}

.buy-btn {
    min-width: 144px;
    display: grid;
    align-content: center;
    gap: 0;
    color: #2d0d10;
    border-color: transparent;
    background: linear-gradient(135deg, #fff6bd, var(--gold), #ff8f40);
    font-weight: 1000;
}

.buy-btn span {
    font-size: 0.72rem;
}

.spin-btn {
    width: 116px;
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    color: white;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.76), transparent 18%),
        linear-gradient(135deg, #ff58b7, #ff4f66 48%, #ffd15f);
    font-size: 1.18rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.11), 0 0 34px rgba(255, 88, 183, 0.68), 0 16px 30px rgba(79, 25, 88, 0.36);
    transition: transform 0.12s ease, filter 0.12s ease;
}

.spin-btn:hover {
    transform: scale(1.04);
    filter: brightness(1.07);
}

.spin-btn.is-spinning {
    animation: spinButton 0.9s linear infinite;
}

.auto-btn.is-active {
    color: #1b0c35;
    border-color: transparent;
    background: linear-gradient(135deg, var(--blue), var(--green));
    font-weight: 950;
}

.win-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, rgba(255, 209, 95, 0.18), rgba(11, 4, 29, 0.62));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.win-overlay.show {
    opacity: 1;
}

.win-overlay div {
    min-width: min(540px, calc(100% - 36px));
    display: grid;
    place-items: center;
    border-radius: 26px;
    border: 2px solid rgba(255, 255, 255, 0.62);
    padding: 28px;
    background: linear-gradient(145deg, rgba(255, 88, 183, 0.9), rgba(255, 209, 95, 0.92));
    box-shadow: 0 0 90px rgba(255, 209, 95, 0.56);
    transform: scale(0.9);
    animation: overlayPop 0.42s ease both;
}

.win-overlay span {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 1000;
}

.win-overlay strong {
    font-size: 4rem;
    text-shadow: 0 7px 0 rgba(116, 35, 77, 0.38);
}

.bonus-modal {
    width: min(580px, calc(100% - 36px));
    border: 0;
    padding: 0;
    color: var(--ink);
    overflow: visible;
    background: transparent;
}

.bonus-modal::backdrop {
    background: rgba(7, 2, 20, 0.82);
    backdrop-filter: blur(6px);
}

.bonus-modal-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 15px;
    padding: 56px 60px 50px;
    overflow: visible;
    text-align: center;
    background: rgba(23, 8, 52, 0.96);
    box-shadow: 0 0 100px rgba(255, 88, 183, 0.34);
    animation: bonusCardPop 0.48s cubic-bezier(0.2, 0.9, 0.25, 1.12) both;
}

.bonus-modal-card::before {
    content: "";
    position: absolute;
    inset: -36px;
    z-index: -1;
    pointer-events: none;
    background: url("media/lollipop-frame-card.png") center / 100% 100% no-repeat;
}

.bonus-modal-card h2 {
    color: #fff9e2;
    font-size: 2.35rem;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 5px 0 rgba(119, 35, 103, 0.62);
}

.bonus-modal-card p {
    max-width: 410px;
    color: var(--muted);
    line-height: 1.5;
}

.bonus-count {
    color: var(--gold);
    font-size: 2.4rem;
    text-transform: uppercase;
    text-shadow: 0 0 26px rgba(255, 209, 95, 0.54);
}

.bonus-count span {
    font-size: 3.7rem;
}

.bonus-action-btn {
    min-width: 230px;
    min-height: 58px;
    border: 0;
    border-radius: 999px;
    color: #391019;
    background: linear-gradient(135deg, #fff8c9, #ffd15f 46%, #ff7dba);
    box-shadow: 0 12px 28px rgba(255, 88, 183, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.74);
    font-size: 1rem;
    font-weight: 1000;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: transform 0.14s ease, filter 0.14s ease;
}

.bonus-action-btn:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.07);
}

.bonus-summary-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.bonus-summary-grid div {
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 8px;
    background: rgba(10, 4, 28, 0.52);
}

.bonus-summary-grid span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.bonus-summary-grid strong,
.bonus-total strong {
    color: var(--gold);
    font-size: 1.2rem;
}

.bonus-total {
    display: grid;
    gap: 4px;
    text-transform: uppercase;
    font-weight: 900;
}

.bonus-total strong {
    font-size: 2.25rem;
}

.paytable-modal {
    width: 850px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 0;
    color: var(--ink);
    background: rgba(17, 7, 39, 0.98);
    box-shadow: var(--shadow);
}

.paytable-modal::backdrop {
    background: rgba(4, 1, 16, 0.72);
}

.paytable-modal form {
    padding: 18px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.4rem;
}

.paytable-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pay-symbol {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.pay-icon {
    height: 76px;
    border-radius: 14px;
    background-image: var(--symbol-image, url("media/celestial-candy-symbols.png"));
    background-size: 300% 300%;
    background-position: var(--pos);
}

.pay-icon--asset {
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.pay-icon[data-tier="low"] {
    filter: brightness(0.76) saturate(0.62);
}

.pay-icon[data-tier="high"] {
    filter: brightness(1.08) saturate(1.34) drop-shadow(0 0 8px rgba(255, 222, 120, 0.35));
}

.pay-symbol strong,
.pay-symbol span {
    display: block;
}

.pay-symbol span {
    color: var(--muted);
    font-size: 0.82rem;
}

.rules {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

@keyframes symbolPulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.07);
    }
}

@keyframes symbolBurst {
    45% {
        opacity: 1;
        transform: scale(1.17) rotate(-4deg);
    }
    to {
        opacity: 0;
        transform: scale(1.55) rotate(14deg);
        filter: blur(5px);
    }
}

@keyframes scatterSway {
    from {
        transform: scale(1) rotate(-2deg);
    }
    to {
        transform: scale(1.11) rotate(2deg);
    }
}

@keyframes floatMulti {
    0%, 100% {
        transform: translateY(0) rotate(-4deg);
    }
    50% {
        transform: translateY(-12px) rotate(5deg);
    }
}

@keyframes spinButton {
    to {
        transform: rotate(360deg);
    }
}

@keyframes overlayPop {
    to {
        transform: scale(1);
    }
}

@keyframes bonusCardPop {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.82);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
