@font-face {
    font-family: 'CustomFont';
    src: url('../assets/fonts/font.ttf') format('truetype');
}

body {
    margin: 0;
    font-family: 'CustomFont', sans-serif;
    background: linear-gradient(135deg, #e0e0e0, #34495e);
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
    touch-action: manipulation;
    padding: 16px 0 120px;
}

.game-container {
    width: 88vw;
    max-width: 390px;
    background: #1e1e1e;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    text-align: center;
    position: relative;
    font-family: 'CustomFont', sans-serif;
    border: 1px solid #333;
}

.home-link {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #333;
    border: 2px solid #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #ecf0f1;
    font-size: 0.9em;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
}

.home-link:active {
    background: #1EE6FF;
    border-color: #1EE6FF;
    transform: scale(0.9);
}

.score-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.score-box {
    background: linear-gradient(145deg, #2a2a2a, #222);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #e6e6e6;
    min-width: 75px;
    text-align: center;
    border: 1px solid #3a3a3a;
}

.bet-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.bet-btn {
    width: 34px;
    height: 34px;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: 2px solid #555;
    border-radius: 50%;
    color: #ecf0f1;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'CustomFont', sans-serif;
    transition: all 0.15s;
}

.bet-btn:active {
    background: #1EE6FF;
    border-color: #1EE6FF;
    color: #1e1e1e;
    transform: scale(0.9);
}

.bet-display {
    background: linear-gradient(145deg, #2a2a2a, #222);
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #FFE300;
    min-width: 85px;
    text-align: center;
    border: 1px solid #3a3a3a;
    font-weight: bold;
}

.machine {
    background: linear-gradient(180deg, #111, #1a1a1a, #111);
    border: 3px solid #333;
    border-radius: 16px;
    padding: 16px 10px;
    margin-bottom: 14px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
}

.machine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFE300, transparent);
    border-radius: 1px;
}

.slots {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.reel {
    width: 82px;
    height: 90px;
    background: linear-gradient(180deg, #f8f8f8, #e8e8e8, #f8f8f8);
    border: 2px solid #555;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    transition: transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.reel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(180deg, rgba(0,0,0,0.06), transparent);
    pointer-events: none;
    border-radius: 8px 8px 0 0;
}

.card-symbol {
    font-size: 1em;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-symbol.red { color: #c0392b; }
.card-symbol.black { color: #1e1e1e; }
.card-symbol.gold { color: #b8860b; }

.reel.spinning {
    animation: reelSpin 0.08s linear infinite;
}

@keyframes reelSpin {
    0% { background-position: 0 0; }
    100% { background-position: 0 90px; }
}

.reel.landed {
    animation: land 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes land {
    0% { transform: scale(1.2) translateY(-8px); }
    50% { transform: scale(0.95) translateY(2px); }
    100% { transform: scale(1) translateY(0); }
}

.reel.jackpot {
    border-color: #FFE300;
    box-shadow: 0 0 20px rgba(255, 227, 0, 0.6), inset 0 0 10px rgba(255, 227, 0, 0.1);
    animation: jackpotGlow 0.4s ease infinite alternate;
}

@keyframes jackpotGlow {
    0% { box-shadow: 0 0 15px rgba(255, 227, 0, 0.4); }
    100% { box-shadow: 0 0 30px rgba(255, 227, 0, 0.9); }
}

.status {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #ecf0f1;
    font-family: 'CustomFont', sans-serif;
}

.result {
    font-size: 1.15em;
    font-weight: bold;
    display: none;
    color: #ecf0f1;
    margin-bottom: 8px;
    font-family: 'CustomFont', sans-serif;
    min-height: 1.4em;
}

.result.win {
    color: #66FF0E;
    animation: pulse 0.5s ease;
}

.result.jackpot {
    color: #FFE300;
    animation: jackpotText 0.4s ease infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes jackpotText {
    0% { transform: scale(1); text-shadow: 0 0 8px rgba(255, 227, 0, 0.5); }
    100% { transform: scale(1.08); text-shadow: 0 0 25px rgba(255, 227, 0, 1); }
}

.result.lose {
    color: #888;
}

.paytable {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 14px;
    font-size: 0.65em;
    color: #777;
    margin-bottom: 14px;
    text-align: left;
    padding: 10px 14px;
    background: #151515;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
}

.paytable .sym {
    color: #bbb;
}

.paytable .mult {
    color: #1EE6FF;
    text-align: right;
    font-weight: bold;
}

.button-container {
    display: flex;
    justify-content: center;
}

.spin-btn {
    border-radius: 30px;
    padding: 14px 44px;
    font-size: 1.25em;
    cursor: pointer;
    font-family: 'CustomFont', sans-serif;
    background: linear-gradient(145deg, #c0392b, #e74c3c, #c0392b);
    color: #fff;
    border: 2px solid #e74c3c;
    font-weight: bold;
    letter-spacing: 2px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.spin-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.4);
}

.spin-btn:disabled {
    background: linear-gradient(145deg, #444, #333);
    color: #777;
    border-color: #555;
    box-shadow: none;
}

*:focus, *:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ecf0f1;
    font-size: 0.8em;
    position: fixed;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    padding: 10px 20px;
    box-sizing: border-box;
    background: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    font-family: 'CustomFont', sans-serif;
}

.footer-content {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 10px;
}

.footer-links {
    text-align: center;
    margin-top: 10px;
}

.terms-link {
    color: #8a2be2;
    text-decoration: none;
}

@media (max-width: 420px) {
    .game-container {
        padding: 14px;
    }
    .reel {
        width: 68px;
        height: 76px;
        font-size: 2.4em;
    }
    .score-box {
        padding: 8px 12px;
        min-width: 65px;
        font-size: 0.85rem;
    }
}
