body {
    margin: 0;
    background: #111;
    min-height: 100vh;
    overflow: auto;
    font-family: Arial, sans-serif;
    color: #fff;
}

.app-shell {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto;
    padding: 16px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-panel {
    display: flex;
    justify-content: center;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}

canvas {
    background: black;
    border: 2px solid white;
    aspect-ratio: 1 / 1;
    max-width: 100%;
    max-height: calc(100vh - 280px);
}

.mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.middle-controls {
    display: flex;
    gap: 10px;
}

.side-panel {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.status-card {
    background: #181818;
    border: 1px solid #2d2d2d;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.status-card h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.status-card p {
    margin: 8px 0;
    color: #e7e7e7;
}

.list {
    margin: 0;
    padding-left: 1.1rem;
    color: #f5f5f5;
}

.list li {
    margin: 8px 0;
}

.player-item,
.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.player-score,
.leaderboard-score {
    color: #00ff88;
    font-weight: 700;
}

button {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 12px;
    background: #333;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

button:active {
    background: #666;
}

#start-button {
    width: 200px;
    height: 60px;
    font-size: 24px;
    background: #00aa66;
}

input {
    width: min(90vw, 300px);
    height: 45px;
    border: none;
    border-radius: 10px;
    padding: 0 15px;
    font-size: 18px;
    background: #222;
    color: white;
}

@media (min-width: 900px) {
    .app-shell {
        height: 100vh;
        flex-direction: row;
        align-items: flex-start;
        padding: 12px 0;
        overflow: hidden;
    }

    .game-panel {
        flex: 1 1 60%;
    }

    .game-container {
        gap: 12px;
    }

    .mobile-controls {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
    }

    .control-row {
        display: none;
    }

    #start-button {
        width: 128px;
        height: 45px;
        font-size: 18px;
    }

    canvas {
        max-height: calc(100vh - 88px);
    }

    .side-panel {
        flex: 1 1 40%;
        grid-template-columns: 1fr;
        gap: 12px;
        max-height: calc(100vh - 24px);
        overflow: hidden;
    }

    .status-card {
        padding: 12px;
    }

    .status-card h2 {
        margin-bottom: 8px;
        font-size: 1rem;
    }

    .list li {
        margin: 6px 0;
    }

    body {
        overflow: hidden;
    }
}
