* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: #1e1e2e;
    color: #f5f5f5;
}

.app {
    min-height: 100vh;
    padding: 28px 3.5vw 18px;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 18px;
}

header h1 {
    margin: 0;
    font-size: clamp(38px, 4vw, 60px);
    font-weight: 800;
    letter-spacing: 1px;
}

header p {
    margin: 8px 0 0;
    font-size: clamp(20px, 2vw, 31px);
    color: #cdd6f4;
}

.game-area {
    flex: 1;
    display: grid;
    grid-template-columns: 38% 1fr;
    gap: 17px;
    min-height: 570px;
}

.left-panel,
.right-panel {
    background: #292940;
}

.left-panel {
    text-align: center;
    padding: 23px 5.5%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.right-panel {
    padding: 23px 2.3%;
    display: flex;
    flex-direction: column;
}

h2 {
    margin: 0 0 18px;
    font-size: clamp(28px, 2.4vw, 42px);
    font-weight: 800;
}

.left-panel h2 {
    color: #cdd6f4;
}

select {
    width: 250px;
    max-width: 90%;
    height: 38px;
    margin-bottom: 18px;
    padding: 2px 8px;
    font-size: 18px;
    font-weight: 700;
    color: #eeeeee;
    background: #969696;
    border: 3px solid #444444;
    border-radius: 4px;
}

.game-button {
    border: 3px solid #3c3c3c;
    border-radius: 2px;
    background: #f4f4f4;
    color: #111111;
    font-size: 21px;
    font-weight: 800;
    padding: 11px 25px;
    cursor: pointer;
    min-width: 270px;
    box-shadow: none;
}

.game-button:hover:not(:disabled) {
    background: #ffffff;
}

.game-button:active:not(:disabled) {
    transform: translateY(1px);
}

.game-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status {
    width: 100%;
    min-height: 54px;
    margin: 18px 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 25px;
    line-height: 1.2;
}

.attempts {
    margin: 2px 0 13px;
    font-size: 27px;
    font-weight: 800;
    color: #f9e2af;
}

.best-score {
    margin-bottom: 18px;
    font-size: 25px;
    font-weight: 800;
    color: #a6e3a1;
}

#guessInput {
    width: 220px;
    height: 50px;
    margin-bottom: 17px;
    padding: 8px;
    text-align: center;
    font-size: 25px;
    color: #ffffff;
    background: #1e1e1e;
    border: 2px solid #315f8f;
    outline: none;
}

#guessInput:focus {
    border-color: #4f8bc9;
}

#guessButton {
    min-width: 245px;
}

.right-panel h2 {
    text-align: center;
}

.history {
    flex: 1;
    min-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
    background: #1c1c2c;
    color: #ffffff;
    font-size: 25px;
    line-height: 1.25;
}

.history-item {
    padding: 0 0 2px 0;
}

.history-item.correct {
    color: #a6e3a1;
    font-weight: 800;
}

.history-item.game-over {
    color: #f38ba8;
    font-weight: 800;
}

.history-placeholder {
    height: 100%;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #77798d;
    font-size: 20px;
}

.bottom-buttons {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 18px;
}

.bottom-button {
    min-width: 190px;
}

@media (max-width: 900px) {
    .app {
        padding: 20px 14px;
    }

    .game-area {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .left-panel {
        min-height: 500px;
    }

    .right-panel {
        min-height: 500px;
    }

    .history {
        min-height: 350px;
    }

    .bottom-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 500px) {
    header h1 {
        font-size: 32px;
    }

    header p {
        font-size: 18px;
    }

    h2 {
        font-size: 27px;
    }

    .status,
    .attempts,
    .best-score {
        font-size: 21px;
    }

    .history {
        font-size: 20px;
    }

    .game-button {
        min-width: 220px;
        font-size: 18px;
    }
}
