/**
 * Nu, Pogodi! Game Styles
 * Classic LCD monochrome aesthetic inspired by Soviet Elektronika IM-02
 */

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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.game-container {
    position: relative;
    max-width: 900px;
    width: 100%;
    padding: 20px;
}

.game-screen {
    background: #8b9467;
    border: 15px solid #4a5240;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.1);
    position: relative;
}

#gameCanvas {
    width: 100%;
    height: auto;
    display: block;
    background: #9ca777;
    border: 3px solid #3a4030;
    border-radius: 5px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Score panel */
.score-panel {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding: 10px;
    background: #3a4030;
    border-radius: 8px;
    color: #d4d4aa;
    font-weight: bold;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-item .label {
    font-size: 12px;
    opacity: 0.8;
}

.score-item .value {
    font-size: 24px;
    color: #2d3820;
    background: #d4d4aa;
    padding: 5px 15px;
    border-radius: 5px;
    min-width: 60px;
    text-align: center;
}

/* Mobile controls */
.mobile-controls {
    display: none;
    margin-top: 20px;
    gap: 15px;
    flex-direction: column;
}

.control-row {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.control-btn {
    width: 120px;
    height: 80px;
    background: linear-gradient(145deg, #5a6b4a, #4a5240);
    border: 3px solid #3a4030;
    border-radius: 12px;
    color: #d4d4aa;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.1s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-family: 'Courier New', monospace;
}

.control-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #4a5240, #3a4030);
}

.control-btn.active {
    background: linear-gradient(145deg, #6a7b5a, #5a6b4a);
    border-color: #d4d4aa;
}

.btn-label {
    font-size: 20px;
}

.btn-icon {
    font-size: 24px;
}

/* Game over screen */
.game-over-screen,
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(42, 52, 40, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 20px;
}

.game-over-screen.show,
.start-screen.show {
    display: flex;
}

.game-over-content,
.start-content {
    text-align: center;
    color: #d4d4aa;
    padding: 40px;
    background: #3a4030;
    border-radius: 15px;
    border: 3px solid #d4d4aa;
    max-width: 400px;
}

.game-over-content h2,
.start-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #d4d4aa;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.8;
}

.final-score {
    font-size: 24px;
    margin: 20px 0;
}

.new-record {
    font-size: 20px;
    color: #ffd700;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    51% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.3;
    }
}

.restart-btn,
.start-btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(145deg, #5a6b4a, #4a5240);
    color: #d4d4aa;
    border: 3px solid #d4d4aa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
}

.restart-btn:hover,
.start-btn:hover {
    background: linear-gradient(145deg, #6a7b5a, #5a6b4a);
    transform: scale(1.05);
}

.restart-btn:active,
.start-btn:active {
    transform: scale(0.95);
}

.instructions {
    text-align: left;
    margin: 20px 0;
    padding: 15px;
    background: rgba(42, 52, 40, 0.5);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.instructions p {
    margin: 8px 0;
}

.instructions strong {
    color: #ffd700;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }

    .game-screen {
        border-width: 10px;
        padding: 15px;
    }

    .mobile-controls {
        display: flex;
    }

    .score-panel {
        flex-direction: column;
        gap: 10px;
    }

    .score-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .score-item .value {
        font-size: 20px;
        min-width: 50px;
    }

    .control-btn {
        width: 100px;
        height: 70px;
        font-size: 16px;
    }

    .game-over-content,
    .start-content {
        padding: 30px 20px;
        margin: 20px;
    }

    .game-over-content h2,
    .start-content h1 {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .control-btn {
        width: 80px;
        height: 60px;
        font-size: 14px;
    }

    .btn-label {
        font-size: 16px;
    }

    .btn-icon {
        font-size: 20px;
    }
}

/* Landscape mode for mobile */
@media (max-width: 900px) and (orientation: landscape) {
    body {
        align-items: flex-start;
    }

    .game-container {
        padding: 5px;
    }

    .game-screen {
        border-width: 8px;
        padding: 10px;
    }

    .mobile-controls {
        flex-direction: row;
        margin-top: 10px;
    }

    .control-row {
        flex-direction: column;
        gap: 10px;
    }

    .control-btn {
        width: 70px;
        height: 50px;
    }

    .score-panel {
        flex-direction: row;
        padding: 8px;
    }

    .score-item {
        flex-direction: column;
    }

    .score-item .value {
        font-size: 16px;
        padding: 3px 10px;
    }
}
