:root {
    --bg-dark: #0b071a;
    --card-bg: #150d2e;
    --gold: #ffcf24;
    --gold-light: #fff275;
    --gold-dark: #b8860b;
    --gold-glow: rgba(255, 207, 36, 0.45);
    --neon-pink: #ff007b;
    --neon-cyan: #00f0ff;
    --text-light: #ffffff;
    --reel-bg: #0c061d;
    --reel-border: #441c7a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: radial-gradient(circle at 50% 30%, #1f0f3d 0%, #080313 100%);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.game-wrapper {
    width: 100%;
    max-width: 580px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(26, 13, 53, 0.92) 0%, rgba(10, 4, 22, 0.98) 100%);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 35px var(--gold-glow);
    position: relative;
    padding-bottom: 15px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(15, 7, 34, 0.9);
    border-bottom: 2px solid #3c1e70;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-badge {
    background: linear-gradient(45deg, #ff0055, #ffaa00);
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 900;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.game-title {
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(180deg, #fff 0%, var(--gold) 60%, #ff8800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 207, 36, 0.3);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Jackpot / Ticker Banner */
.jackpot-banner {
    margin: 8px 16px 4px;
    background: linear-gradient(90deg, #2b0b49, #6d1257, #2b0b49);
    border: 1.5px solid var(--gold);
    border-radius: 10px;
    padding: 6px 12px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 0 15px rgba(255, 207, 36, 0.3);
}

.jackpot-item {
    text-align: center;
}

.jackpot-label {
    font-size: 10px;
    color: #ffd7a8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.jackpot-val {
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.8);
}

.jackpot-val.grand {
    color: var(--gold);
    font-size: 16px;
}

/* Multiplier / Combo Streak Bar (Super Ace style) */
.combo-multiplier-bar {
    margin: 4px 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.mult-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    color: #aaa;
    transition: all 0.3s;
}

.mult-badge.active {
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #fff;
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.8);
    transform: scale(1.1);
}

/* Free Spins Banner */
.mode-banner {
    display: none;
    background: linear-gradient(90deg, #ff007b, #ff7b00);
    padding: 8px 12px;
    text-align: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(255, 0, 123, 0.6);
    animation: pulseBanner 1.5s infinite;
}

.mode-banner.active {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@keyframes pulseBanner {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Slot Stage Cabinet */
.slot-stage {
    padding: 6px 14px;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slot-cabinet {
    position: relative;
    background: #080315;
    border: 3px solid #e0ad16;
    border-radius: 14px;
    padding: 6px;
    box-shadow: inset 0 0 25px #000, 0 8px 30px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.reels-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    height: 310px;
    background: var(--reel-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.reel-column {
    background: linear-gradient(180deg, #120926 0%, #1a0e36 50%, #120926 100%);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.reel-strip {
    display: flex;
    flex-direction: column;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    will-change: transform;
}

/* Card Type Symbols */
.symbol-cell {
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    position: relative;
    transition: transform 0.2s;
}

.playing-card {
    width: 92%;
    height: 90px;
    background: linear-gradient(145deg, #1c133a 0%, #0d0720 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.2s;
}

/* Corner Suit & Value */
.card-corner {
    position: absolute;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-corner.top-left {
    top: 4px;
    left: 4px;
}

.card-corner.bottom-right {
    bottom: 4px;
    right: 4px;
    transform: rotate(180deg);
}

.card-center-icon {
    font-size: 34px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.7));
    line-height: 1;
}

.card-title-text {
    font-size: 9px;
    font-weight: 800;
    color: #e2dbf5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

/* SCATTER CARD TYPE (Luxury Gold Hologram Card) */
.symbol-cell.scatter .playing-card {
    background: linear-gradient(135deg, #ffd700 0%, #fff7a1 40%, #e6a800 80%, #946800 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7), inset 0 0 8px rgba(255, 255, 255, 0.8);
    animation: scatterCardGlow 1.2s infinite alternate;
}

.symbol-cell.scatter .card-title-text {
    background: #472600;
    color: #ffd700;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    letter-spacing: 1px;
}

.symbol-cell.scatter .card-corner {
    color: #472600;
}

@keyframes scatterCardGlow {
    from {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    }
    to {
        transform: scale(1.06);
        box-shadow: 0 0 22px rgba(255, 230, 0, 0.95);
    }
}

/* JOKER / WILD CARD */
.symbol-cell.wild .playing-card {
    background: linear-gradient(135deg, #ff0055 0%, #990099 50%, #440066 100%);
    border: 2px solid #ff77aa;
    box-shadow: 0 0 12px rgba(255, 0, 100, 0.6);
}

.symbol-cell.wild .card-title-text {
    background: #ffdd00;
    color: #550022;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 4px;
}

/* ACE OF SPADES GOLDEN */
.symbol-cell.ace .playing-card {
    border-color: #ffd700;
}
.symbol-cell.ace .card-corner {
    color: #ffd700;
}

/* Winning Symbol Pulse */
.symbol-cell.winner .playing-card {
    animation: winCardPulse 0.5s infinite alternate;
    z-index: 10;
}

@keyframes winCardPulse {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.12); filter: brightness(1.4) drop-shadow(0 0 8px #ffd700); }
}

/* Paylines SVG Overlay */
#paylines-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

.reel-strip.spinning {
    filter: blur(2px);
}

/* Meters Bar */
.meters-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 16px;
}

.meter-card {
    background: rgba(22, 11, 46, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 8px;
    text-align: center;
}

.meter-title {
    font-size: 10px;
    text-transform: uppercase;
    color: #9d8ec2;
    font-weight: 700;
}

.meter-number {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    margin-top: 2px;
}

.meter-card.win-meter .meter-number {
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold-glow);
}

/* Controls Section */
.controls-area {
    padding: 8px 16px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bet-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 7, 34, 0.92);
    border: 1px solid #361b63;
    border-radius: 30px;
    padding: 4px 8px;
}

.step-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(180deg, #3a1a6b, #200d3d);
    border: 1px solid #6336ad;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-btn:active {
    transform: scale(0.94);
}

.bet-display {
    text-align: center;
}

.bet-label {
    font-size: 9px;
    color: #aa99cc;
    text-transform: uppercase;
    font-weight: 700;
}

.bet-amount {
    font-size: 16px;
    font-weight: 900;
    color: #fff;
}

/* Spin Deck */
.spin-deck {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.aux-btn {
    flex: 1;
    height: 48px;
    background: linear-gradient(180deg, #2b144e, #180931);
    border: 1px solid #4a2485;
    border-radius: 12px;
    color: #c9bdeb;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s;
}

.aux-btn.active {
    background: linear-gradient(180deg, #ff7b00, #ff0055);
    color: #fff;
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 123, 0, 0.5);
}

.spin-btn {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff7a1 0%, #ffbb00 35%, #e67e00 80%, #994c00 100%);
    border: 4px solid #fff;
    box-shadow: 0 0 25px rgba(255, 187, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 6px 12px rgba(0, 0, 0, 0.6);
    color: #522500;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spin-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(255, 200, 0, 0.9);
}

.spin-btn:active {
    transform: scale(0.95);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 2, 12, 0.88);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: linear-gradient(180deg, #241147 0%, #110526 100%);
    border: 2px solid var(--gold);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 22px;
    position: relative;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.3);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.modal-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 14px;
}

/* CARD PICK BONUS MODAL (3D Flip Mini-Game) */
.card-pick-container {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin: 20px 0;
    perspective: 1000px;
}

.pick-card-wrapper {
    width: 100px;
    height: 150px;
    perspective: 800px;
    cursor: pointer;
}

.pick-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.6);
}

.pick-card-wrapper.flipped .pick-card-inner {
    transform: rotateY(180deg);
}

.pick-card-front, .pick-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
}

/* Facedown back design */
.pick-card-back {
    background: radial-gradient(circle, #381b6e 0%, #150930 100%);
    border: 2px solid var(--gold);
    color: var(--gold);
}

.pick-card-back .card-pattern {
    font-size: 28px;
    animation: rotatePattern 6s linear infinite;
}

@keyframes rotatePattern {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pick-card-back span {
    font-size: 11px;
    font-weight: 800;
    margin-top: 6px;
    text-transform: uppercase;
}

/* Faceup front design */
.pick-card-front {
    background: linear-gradient(135deg, #ffd700 0%, #fff7a1 50%, #e6a800 100%);
    border: 2.5px solid #ffffff;
    color: #422000;
    transform: rotateY(180deg);
    text-align: center;
}

.pick-card-front .bonus-spins {
    font-size: 20px;
    font-weight: 900;
}

.pick-card-front .bonus-mult {
    font-size: 14px;
    font-weight: 800;
    color: #990022;
    margin-top: 4px;
}

.celebration-title {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(180deg, #fff 0%, #ffd700 70%, #ff6600 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    animation: bouncePop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.celebration-amount {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    margin: 14px 0;
    text-shadow: 0 0 15px var(--gold);
}

.celebration-btn {
    background: linear-gradient(180deg, #ffcc00, #ff8800);
    border: 2px solid #fff;
    color: #3b1900;
    font-size: 16px;
    font-weight: 900;
    padding: 12px 32px;
    border-radius: 30px;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 15px;
    box-shadow: 0 6px 15px rgba(255, 136, 0, 0.5);
}

@keyframes bouncePop {
    0% { transform: scale(0.3); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Paytable */
.paytable-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    text-align: left;
    margin: 15px 0;
}

.pay-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pay-icon {
    font-size: 26px;
}

.pay-info {
    font-size: 11px;
    line-height: 1.3;
}

.pay-info strong {
    color: var(--gold);
}

.feature-box {
    background: rgba(255, 0, 123, 0.15);
    border: 1px dashed #ff007b;
    border-radius: 10px;
    padding: 12px;
    margin-top: 12px;
    text-align: left;
    font-size: 12px;
    line-height: 1.4;
}

.feature-box h4 {
    color: #ff55a3;
    font-size: 13px;
    margin-bottom: 4px;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 150;
}
