* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.container {
    max-width: 450px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin: 10px;
}

.telegram-header {
    background: #0088cc;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
}

.game-container {
    padding: 20px;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.score-board {
    display: flex;
    justify-content: space-around;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #0088cc;
}

.game-area {
    position: relative;
    margin-bottom: 20px;
}

#game-canvas {
    display: block;
    margin: 0 auto;
    border: 3px solid #0088cc;
    border-radius: 10px;
    background: #222;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 30px;
}

.overlay-content h2 {
    margin-bottom: 10px;
    font-size: 28px;
    color: #4CAF50;
}

.overlay-content p {
    margin-bottom: 20px;
    font-size: 16px;
    opacity: 0.8;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #0088cc, #006699);
    color: white;
}

.btn-control {
    background: #f0f0f0;
    color: #333;
    flex: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    display: none;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: block;
    }
}

.control-row {
    display: flex;
    justify-content: center;
    margin: 5px 0;
}

.control-btn {
    width: 60px;
    height: 60px;
    margin: 0 10px;
    font-size: 24px;
    border: none;
    border-radius: 50%;
    background: #0088cc;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:active {
    transform: scale(0.95);
    background: #006699;
}

.game-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.instructions {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

.instructions h3 {
    color: #333;
    margin-bottom: 10px;
}

.instructions ul {
    list-style: none;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 5px;
    color: #555;
}

.food-sample {
    color: #ff4444;
    font-weight: bold;
}

.telegram-info {
    text-align: center;
    margin-top: 10px;
    color: #0088cc;
    font-weight: bold;
    font-size: 14px;
}

/* Добавьте в конец style.css */

/* Анимации */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-primary {
    animation: pulse 2s infinite;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .container {
        margin: 5px;
        border-radius: 15px;
    }

    .game-header h1 {
        font-size: 20px;
    }

    .score-board {
        padding: 8px;
        flex-direction: column;
        gap: 10px;
    }

    .score-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .score-value {
        font-size: 20px;
    }

    #game-canvas {
        width: 95vw;
        height: 95vw;
        max-width: 350px;
        max-height: 350px;
    }

    .control-btn {
        width: 50px;
        height: 50px;
        margin: 0 5px;
    }

    .game-controls {
        flex-wrap: wrap;
    }

    .btn-control {
        min-width: 100px;
    }
}

/* Эффекты для кнопок */
.btn:active {
    transform: scale(0.95);
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    animation: fadeIn 0.5s ease-out;
}

/* Подсветка нового рекорда */
@keyframes highlight {
    0% { background-color: #4CAF50; color: white; }
    100% { background-color: transparent; color: #0088cc; }
}

.new-record {
    animation: highlight 1s ease-out;
}
