@import url('https://fonts.googleapis.com/css2?family=Cutive+Mono&family=Ewert&display=swap');

:root {
    /* Main page color scheme */
    --pink-light: rgb(253, 229, 236);
    --pink-medium: rgb(252, 186, 173);
    --pink-dark: rgb(228, 133, 134);
    --purple: rgb(145, 109, 179);
    --text-dark: #2d3748;
    --text-light: #4a5568;
    --white: #ffffff;
    --gold: #d69e2e;

    /* Game specific variables */
    --success: #00ff88;
    --danger: #ff4757;
    --bg: rgba(145, 109, 179, 0.9);
    --text: var(--pink-light);
    --radius: 12px;
    --spacing: 20px;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth loading state */
html.loading body {
    opacity: 0;
}

html:not(.loading) body {
    opacity: 1;
}

body {
    font-family: 'Cutive Mono', monospace;
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--pink-medium) 50%, var(--pink-dark) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-size: 16px;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity 0.4s ease-in-out;
    overflow-x: hidden;
}

.game-container {
    background: var(--bg);
    border-radius: var(--radius);
    padding: var(--spacing);
    box-shadow: var(--shadow);
    max-width: 800px;
    width: 100%;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out;
    min-height: 600px;
    position: relative;
    border: 3px solid var(--purple);
}

/* Fade-in animation for smooth loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevent content jumps during loading */
.game-container>* {
    animation: fadeIn 0.8s ease-out 0.2s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    border: 2px solid var(--pink-light);
}

.balance {
    font-family: 'Ewert', cursive;
    font-size: 1.2rem;
    color: var(--pink-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.amount {
    color: var(--gold);
    font-weight: bold;
    font-size: 1.4rem;
}

.bet-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bet-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bet-form label {
    color: var(--pink-light);
    font-weight: bold;
}

.bet-form input {
    background: var(--pink-light);
    border: 2px solid var(--purple);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-dark);
    font-family: 'Cutive Mono', monospace;
    font-weight: bold;
    width: 80px;
}

.bet-form button {
    background: linear-gradient(45deg, var(--purple), var(--pink-dark));
    color: var(--pink-light);
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-family: 'Cutive Mono', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bet-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(145, 109, 179, 0.6);
}

.slot-machine {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    border: 3px solid var(--pink-light);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.reels-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.reel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: var(--radius);
    border: 2px solid var(--gold);
}

.symbol {
    width: 80px;
    height: 80px;
    background: var(--pink-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--purple);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.symbol img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.symbol.winning {
    background: var(--gold);
    border-color: var(--pink-light);
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--gold);
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1.2);
    }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.spin-form button,
.reset-form button {
    background: linear-gradient(45deg, var(--gold), #f6ad55);
    color: var(--pink-light);
    border: none;
    border-radius: var(--radius);
    padding: 15px 30px;
    font-family: 'Cutive Mono', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(214, 158, 46, 0.5);
    min-width: 150px;
}

.spin-form button:hover,
.reset-form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(214, 158, 46, 0.7);
}

.spin-form button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.win-message {
    background: linear-gradient(45deg, var(--success), #00cc6a);
    color: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    margin: 20px 0;
    border: 3px solid var(--gold);
    animation: celebrate 0.6s ease-in-out;
}

.win-message h2 {
    font-family: 'Ewert', cursive;
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

@keyframes celebrate {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.no-money-message {
    background: linear-gradient(45deg, var(--danger), #e74c3c);
    color: var(--white);
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
    margin: 20px 0;
    border: 2px solid var(--pink-light);
}

.no-money-message h3 {
    font-family: 'Ewert', cursive;
    font-size: 1.4rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.rules {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: var(--radius);
    border: 2px solid var(--pink-light);
    margin-top: 20px;
}

.rules h3 {
    font-family: 'Ewert', cursive;
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.rules ul {
    list-style: none;
    padding: 0;
}

.rules li {
    color: var(--pink-light);
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    font-weight: bold;
}

.rules li::before {
    content: '★';
    color: var(--gold);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
        padding: 15px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .reels-container {
        gap: 5px;
    }

    .symbol {
        width: 60px;
        height: 60px;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .spin-form button,
    .reset-form button {
        width: 100%;
        max-width: 200px;
    }

    .win-message h2 {
        font-size: 1.4rem;
    }

    .no-money-message h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        margin: 5px;
        padding: 10px;
    }

    .symbol {
        width: 50px;
        height: 50px;
    }

    .bet-form {
        flex-direction: column;
        gap: 5px;
    }

    .bet-form input {
        width: 100%;
    }

    .win-message h2 {
        font-size: 1.2rem;
    }

    .rules h3 {
        font-size: 1.3rem;
    }
}