@import url("https://fonts.googleapis.com/css2?family=Lilita+One&family=Caveat:wght@700&family=Outfit:wght@400;600&display=swap");

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    font-family: Outfit, system-ui, sans-serif;
    color: #f5ead6;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 80, 100, 0.22), transparent 60%),
        radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.6) 100%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 9px),
        #4a0b16;
}

/* Strålkastare som sveper över sammeten */
.spotlights {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        conic-gradient(from 200deg at 10% -10%, transparent 0 8deg, rgba(255, 230, 160, 0.10) 12deg, transparent 18deg),
        conic-gradient(from 140deg at 90% -10%, transparent 0 8deg, rgba(255, 230, 160, 0.10) 12deg, transparent 18deg);
    animation: sweep 7s ease-in-out infinite alternate;
}
@keyframes sweep {
    from { transform: translateX(-4%); }
    to   { transform: translateX(4%); }
}

.back {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 12px;
    z-index: 10;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(245, 234, 214, 0.5);
    background: rgba(0, 0, 0, 0.25);
    color: #f5ead6;
    text-decoration: none;
}

.stage {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 0 auto;
    padding: calc(44px + env(safe-area-inset-top, 0px)) 18px calc(28px + env(safe-area-inset-bottom, 0px));
    text-align: center;
}

.eyebrow {
    margin: 0 0 4px;
    font-family: Caveat, cursive;
    font-size: 1.45rem;
    color: #ffd34d;
    transform: rotate(-2deg);
}

/* Neonskylt */
.neon {
    margin: 0 0 18px;
    font-family: "Lilita One", system-ui, sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 16vw, 4.4rem);
    letter-spacing: 0.06em;
    color: #fff6d8;
    text-shadow:
        0 0 6px #fff1b0,
        0 0 16px #ffd34d,
        0 0 32px #ff9a1f,
        0 0 52px #ff5a1f;
    animation: flicker 5s infinite;
}
@keyframes flicker {
    0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; }
    20%, 63% { opacity: 0.55; }
}

/* ---------- Maskinen ---------- */
.machine {
    position: relative;
    padding: 30px 18px 20px;
    border-radius: 26px;
    background: linear-gradient(180deg, #c81e3a, #8e1226 70%, #6d0e1d);
    box-shadow:
        inset 0 0 0 5px #d4a017,
        inset 0 0 0 8px #7a5a0c,
        inset 0 3px 0 9px rgba(255, 255, 255, 0.15),
        0 24px 50px rgba(0, 0, 0, 0.55);
}

/* Lamporna runt kanten som jagar varandra */
.marquee {
    position: absolute;
    top: 12px;
    left: 26px;
    right: 26px;
    display: flex;
    justify-content: space-between;
}
.marquee span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ffe9a8;
    box-shadow: 0 0 8px 2px #ffd34d;
    animation: chase 1.2s linear infinite;
}
.marquee span:nth-child(odd) { animation-delay: -0.6s; }
@keyframes chase {
    50% { background: #7a5a0c; box-shadow: none; }
}
.machine.win .marquee span,
.machine.bigwin .marquee span { animation-duration: 0.25s; }

.reels {
    --sym: 96px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    margin-top: 6px;
    border-radius: 14px;
    background: #1c0a0e;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.7);
}

.reel {
    --sym: 96px;
    position: relative;
    height: var(--sym);
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(180deg, #d9cdb6, #fffaf0 25%, #fffaf0 75%, #d9cdb6);
}
.reel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.35));
}

.strip { will-change: transform; }

.symbol {
    height: var(--sym);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.6rem;
    line-height: 1;
}

.payline {
    position: absolute;
    left: 4px;
    right: 4px;
    top: 50%;
    height: 2px;
    background: rgba(215, 38, 61, 0.55);
    pointer-events: none;
}

.machine.bigwin .reel { animation: reelFlash 0.35s ease-in-out 6 alternate; }
@keyframes reelFlash {
    to { background: #ffe9a8; box-shadow: inset 0 0 18px #ffd34d; }
}

.message {
    min-height: 3em;
    margin: 16px 4px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Caveat, cursive;
    font-size: 1.6rem;
    line-height: 1.1;
    color: #f5ead6;
    text-wrap: balance;
}
.message.pair { color: #ffd34d; }
.message.jackpot {
    color: #fff6d8;
    text-shadow: 0 0 10px #ffd34d, 0 0 22px #ff9a1f;
    animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.message.info { color: #c8f7d8; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.bank {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    font-size: 1rem;
}
.bank b { font-family: "Lilita One", system-ui, sans-serif; font-weight: 400; font-size: 1.3rem; }

.bank-chip {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background:
        radial-gradient(circle, #c81e3a 0 36%, #f5ead6 37% 41%, transparent 42%),
        repeating-conic-gradient(#c81e3a 0 22.5deg, #f5ead6 22.5deg 45deg);
    box-shadow: inset 0 0 0 3px #c81e3a, 0 2px 4px rgba(0, 0, 0, 0.4);
}

.spin {
    flex: 1;
    max-width: 200px;
    padding: 16px 20px;
    border: none;
    border-radius: 999px;
    font-family: "Lilita One", system-ui, sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4a2a00;
    background: linear-gradient(180deg, #ffe58a, #f2b705 60%, #c98d00);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.6),
        0 6px 0 #7a5a0c,
        0 12px 22px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s, box-shadow 0.1s;
}
.spin:active:not(:disabled) {
    transform: translateY(5px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 1px 0 #7a5a0c, 0 4px 10px rgba(0, 0, 0, 0.4);
}
.spin:disabled { filter: saturate(0.5) brightness(0.85); cursor: default; }

/* ---------- Vinsttabell ---------- */
.paytable {
    list-style: none;
    margin: 20px auto 0;
    padding: 0;
    max-width: 300px;
    font-size: 0.92rem;
    color: rgba(245, 234, 214, 0.8);
}
.paytable li {
    display: flex;
    justify-content: space-between;
    padding: 6px 2px;
    border-bottom: 1px dashed rgba(245, 234, 214, 0.2);
}
.paytable .sym { letter-spacing: 0.15em; color: #ffd34d; }

/* ---------- Konfetti ---------- */
.confetti {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    overflow: hidden;
}
.piece {
    position: absolute;
    top: -20px;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    animation: fall linear forwards;
}
@keyframes fall {
    to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); }
}

/* Låga skärmar: lite tätare */
@media (max-height: 700px) {
    .reels, .reel { --sym: 80px; }
    .symbol { font-size: 3rem; }
    .neon { margin-bottom: 12px; font-size: clamp(2.6rem, 13vw, 3.6rem); }
    .stage { padding-top: calc(36px + env(safe-area-inset-top, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    .spotlights, .neon, .marquee span, .machine.bigwin .reel, .message.jackpot { animation: none !important; }
}
