.game-area {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 14px;
}

.game-board-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
    padding: 8px;
    border-radius: 14px;
    background: #fafafa;
    border: 1px solid #ececec;
}

#gameCanvas {
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background-color: #ffffff;
    max-width: 100%;
    height: auto;
    display: block;
}

.touch-pad {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 22px 18px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 10;
    display: none;
    width: 70%;
    max-width: 280px;
    border: 1px solid #ececec;
    overflow: hidden;
}

.game-over::before { content: none; }

.game-over h2 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.game-over h2::before, .game-over h2::after { content: ''; display: none; }

.game-over #winnerInfo {
    color: #4a9;
    font-weight: 600;
    font-size: clamp(0.88rem, 2.8vw, 1rem);
    margin: 8px 0;
    display: block;
}

.game-over p {
    margin-bottom: 10px;
    color: #555;
    font-size: clamp(0.84rem, 2.6vw, 0.95rem);
    background: #f7f7f7;
    padding: 6px 14px;
    border-radius: 50px;
    display: inline-block;
    font-weight: 500;
}

.game-over p span.score-val {
    color: #4a9;
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 4px;
}

#playAgainBtn {
    background: #4a9;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: clamp(0.88rem, 2.8vw, 0.95rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 6px auto 0;
}

#playAgainBtn:hover { background: #3a8a6a; }
#playAgainBtn:active { transform: translateY(1px); }

.mobile-controls-wrapper {
    display: none;
    width: 100%;
    justify-content: space-around;
    margin: 10px 0;
    gap: 10px;
}

.mobile-controls {
    display: grid;
    grid-template-areas:
        ". up ."
        "left . right"
        ". down .";
    gap: 6px;
    justify-content: center;
}

.mobile-controls button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #4a9;
    border: 1px solid #4a9;
    transition: all 0.15s;
    -webkit-user-select: none;
    user-select: none;
}

.mobile-controls button:active {
    transform: scale(0.94);
    background: #4a9;
    color: #ffffff;
}

.controls-p2 button {
    color: #4fc3f7;
    border-color: #4fc3f7;
}

.controls-p2 button:active {
    background: #4fc3f7;
    color: #ffffff;
}

.control-up { grid-area: up; }
.control-down { grid-area: down; }
.control-left { grid-area: left; }
.control-right { grid-area: right; }
