* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Times New Roman', serif;
}

body {
    background: linear-gradient(135deg, #0a0a2a 0%, #1a2a6c 100%);
    color: #e0d3b8;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.slot-machine {
    width: 900px;
    background: 
        radial-gradient(circle at 30% 30%, #1a2a6c 0%, #0a0a2a 70%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%235d4037"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%234a342e" stroke-width="2"/></svg>');
    border: 15px solid #5d4037;
    border-radius: 20px;
    box-shadow: 
        0 0 50px rgba(0, 20, 100, 0.8),
        inset 0 0 30px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
}

.slot-machine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(32, 72, 139, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 195, 74, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.header {
    background: linear-gradient(to bottom, #3e2723 0%, #5d4037 100%);
    padding: 20px;
    text-align: center;
    border-bottom: 5px solid #8d6e63;
    position: relative;
}

.header h1 {
    color: #ffd700;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
}

.header h2 {
    color: #e0d3b8;
    font-size: 1.8em;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.reels-container {
    display: flex;
    justify-content: space-between;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    margin: 20px;
    border-radius: 15px;
    border: 3px solid #8d6e63;
    gap: 10px;
    position: relative;
}

.reel-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.reel {
    width: 140px;
    height: 420px;
    background: linear-gradient(45deg, #1a237e 0%, #283593 100%);
    border: 3px solid #ffd700;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.reel-strip {
    position: absolute;
    width: 100%;
    transition: top 0.1s ease-out;
}

.reel-item {
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.reel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.reel-item.win {
    animation: pulse 0.5s ease-in-out 3;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.7);
    z-index: 5;
}

.reel-item.win img {
    transform: scale(1.1);
}

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

.reel-item:last-child {
    border-bottom: none;
}

.reel-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border: 2px solid #ffd700;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.3);
}

.win-line {
    position: absolute;
    background: rgba(255, 0, 0, 0.7);
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.9);
    display: none;
    pointer-events: none;
}

.win-line.horizontal {
    height: 4px;
    left: 0;
}

.win-line.vertical {
    width: 4px;
    top: 0;
}

.win-line.diagonal {
    height: 4px;
    transform-origin: 0 0;
}

.win-combination {
    position: absolute;
    background: rgba(255, 0, 0, 0.1);
    border: 2px dashed rgba(255, 0, 0, 0.5);
    border-radius: 10px;
    z-index: 8;
    display: none;
    pointer-events: none;
}

.controls-panel {
    background: linear-gradient(to bottom, #5d4037 0%, #3e2723 100%);
    padding: 25px;
    margin: 20px;
    border-radius: 15px;
    border: 3px solid #8d6e63;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.balance-info {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #8d6e63;
    text-align: center;
}

.info-label {
    color: #ffd700;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.info-value {
    color: #e0d3b8;
    font-size: 1.2em;
    font-weight: bold;
}

.spin-button {
    background: linear-gradient(to bottom, #ffd700 0%, #ff6f00 100%);
    color: #3e2723;
    border: none;
    padding: 20px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid #ff6f00;
    transition: all 0.3s ease;
}

.spin-button:hover:not(:disabled) {
    background: linear-gradient(to bottom, #ff6f00 0%, #ffd700 100%);
    transform: scale(1.05);
}

.spin-button:disabled {
    background: linear-gradient(to bottom, #666 0%, #999 100%);
    cursor: not-allowed;
    transform: none;
}

.bet-button {
    background: linear-gradient(to bottom, #1a237e 0%, #283593 100%);
    color: #e0d3b8;
    border: 3px solid #3949ab;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 1.2em;
    font-weight: bold;
}

.bet-button:hover {
    background: linear-gradient(to bottom, #283593 0%, #1a237e 100%);
    transform: scale(1.05);
}

.bet-button.all-in {
    background: linear-gradient(to bottom, #b71c1c 0%, #c62828 100%);
    border: 3px solid #f44336;
}

.bet-button.all-in:hover {
    background: linear-gradient(to bottom, #c62828 0%, #b71c1c 100%);
}

.decoration {
    position: absolute;
    width: 60px;
    height: 60px;
    background: #ffd700;
    border-radius: 50%;
    opacity: 0.1;
}

.decoration:nth-child(1) { top: 10%; left: 5%; }
.decoration:nth-child(2) { top: 10%; right: 5%; }
.decoration:nth-child(3) { bottom: 20%; left: 8%; }
.decoration:nth-child(4) { bottom: 15%; right: 10%; }

.water-effect {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent 0%, rgba(32, 72, 139, 0.3) 100%);
    pointer-events: none;
}

.win-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.9);
    color: #3e2723;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 2em;
    font-weight: bold;
    z-index: 100;
    display: none;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
}

.paytable {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #ffd700;
    font-size: 0.8em;
    max-width: 250px;
    display: none;
}

.paytable h3 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 10px;
}

.paytable-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.show-paytable {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid #ffd700;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.combination-info {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.2em;
    display: none;
    z-index: 20;
}

.bet-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.bet-option {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #8d6e63;
    transition: all 0.2s ease;
}

.bet-option:hover {
    background: rgba(255, 215, 0, 0.2);
}

.bet-option.active {
    background: rgba(255, 215, 0, 0.4);
    border-color: #ffd700;
}


.sound-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.sound-button, .music-button {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #ffd700;
    color: #ffd700;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sound-button:hover, .music-button:hover {
    background: rgba(255, 215, 0, 0.4);
    transform: scale(1.1);
}

.sound-button.muted, .music-button.muted {
    opacity: 0.5;
    background: rgba(255, 0, 0, 0.2);
}

/* Стили для магазина */
.shop-button {
    position: absolute;
    top: 20px;
    left: 160px;
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid #ffd700;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.shop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #ffd700;
    font-size: 1em;
    max-width: 400px;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

.shop h3 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.shop-item {
    background: rgba(255, 215, 0, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ffd700;
    margin-bottom: 20px;
    text-align: center;
}

.shop-item-name {
    color: #ffd700;
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 10px;
}

.shop-item-description {
    color: #e0d3b8;
    margin-bottom: 15px;
    font-size: 1em;
}

.shop-item-price {
    color: #ff6f00;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
}

.shop-buy-button {
    background: linear-gradient(to bottom, #ffd700 0%, #ff6f00 100%);
    color: #3e2723;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #ff6f00;
    transition: all 0.3s ease;
    width: 100%;
}

.shop-buy-button:hover:not(:disabled) {
    background: linear-gradient(to bottom, #ff6f00 0%, #ffd700 100%);
    transform: scale(1.05);
}

.shop-buy-button:disabled {
    background: linear-gradient(to bottom, #666 0%, #999 100%);
    cursor: not-allowed;
    transform: none;
}

.shop-balance {
    color: #e0d3b8;
    text-align: center;
    font-size: 1.1em;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    border: 1px solid #8d6e63;
}

.shop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    display: none;
}

.show-paytable, .shop-button {
    position: absolute;
    top: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    border: 2px solid #ffd700;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    z-index: 1000;
    transition: all 0.3s ease;
}

.show-paytable {
    left: 20px;
}

.shop-button {
    left: 200px;
}

.show-paytable:hover, .shop-button:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: scale(1.05);
}
.sound-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.header {
    position: relative;
    z-index: 100;
    padding-top: 60px; 
}

.paytable {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px;
    border-radius: 10px;
    border: 3px solid #ffd700;
    font-size: 0.9em;
    max-width: 300px;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.shop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #ffd700;
    font-size: 1em;
    max-width: 400px;
    display: none;
    z-index: 1001;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    display: none;
}

.character-container {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    z-index: 1000;
    max-width: 400px;
}

.character-image {
    width: 140px;
    height: 140px;
    border-radius: 10px;
    border: 3px solid #ffd700;
    object-fit: cover;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    order: 2; 
}

.character-message {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    max-width: 280px;
    position: relative;
    display: none;
    order: 1; 
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.character-message::before {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #ffd700;
}

.character-text {
    color: #e0d3b8;
    font-size: 0.95em;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Times New Roman', serif;
}

/* Стили для рекламных баннеров */
#adContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
}

.ad-banner {
    position: absolute;
    width: 300px; 
    height: 400px; 
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #ff0000;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
    overflow: hidden;
    display: none;
    pointer-events: all;
    animation: fadeIn 0.5s ease-out;
}

.ad-banner img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05); 
}

.ad-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff0000;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.ad-close:hover {
    background: #cc0000;
    transform: scale(1.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.slot-machine {
    z-index: 1000;
}

.character-container {
    z-index: 1500;
}