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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

.coin-container {
    perspective: 1000px;
    margin: 30px auto;
    width: 150px;
    height: 150px;
}

.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.coin.flipping {
    animation: flip 2s ease-out;
}

.side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.front {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #8B4513;
    border: 4px solid #8B4513;
}

.back {
    background: linear-gradient(45deg, #C0C0C0, #A9A9A9);
    color: #333;
    border: 4px solid #666;
    transform: rotateY(180deg);
}

@keyframes flip {
    0% {
        transform: rotateY(0);
    }
    50% {
        transform: rotateY(1800deg);
    }
    100% {
        transform: rotateY(3600deg);
    }
}

.controls {
    margin: 30px 0;
}

.btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 5px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn.secondary {
    background: #f44336;
}

.btn.secondary:hover {
    background: #da190b;
}

.btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.stats {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 1.1em;
}

.stat span:first-child {
    font-weight: bold;
    color: #666;
}

.stat span:last-child {
    font-weight: bold;
    color: #333;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.result.heads {
    background: #e8f5e8;
    color: #2e7d32;
}

.result.tails {
    background: #fff3e0;
    color: #ef6c00;
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .coin-container {
        width: 120px;
        height: 120px;
    }
}


.install-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.install-content {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    max-width: 300px;
    margin: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.install-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.install-buttons .btn {
    padding: 10px 15px;
    font-size: 0.9em;
}

/* Улучшаем анимацию монеты */
.coin.flipping {
    animation: flip-coin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes flip-coin {
    0% {
        transform: rotateY(0deg) scale(1);
    }
    50% {
        transform: rotateY(1800deg) scale(1.1);
    }
    100% {
        transform: rotateY(3600deg) scale(1);
    }
}

/* Состояния монеты после броска */
.coin.heads .front,
.coin.tails .back {
    transform: rotateY(0deg);
}

.coin.heads .back,
.coin.tails .front {
    transform: rotateY(180deg);
}

/* Улучшаем отображение результата */
.result {
    margin: 20px auto;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.result.heads {
    background: #e8f5e8;
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

.result.tails {
    background: #fff3e0;
    color: #ef6c00;
    border: 2px solid #ef6c00;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}