html, body {
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Open Sans', sans-serif;
}

#game-canvas {
    display: block;
    background: #16213e;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

#score-display {
    position: fixed;
    top: 16px;
    right: 20px;
    color: #e2e8f0;
    font-size: 24px;
    font-family: 'Open Sans', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Start overlay */
.sendmessage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
}

.sendmessage h1 {
    color: #4ade80;
    font-size: 28px;
    margin: 0;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.niokbutton {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.hidden {
    display: none !important;
}

/* Game over overlay */
#game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 90;
}

.game-over-text {
    color: #f87171;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(248, 113, 113, 0.4);
}

.game-over-score {
    color: #e2e8f0;
    font-size: 22px;
    margin-bottom: 20px;
}

.game-over-hint {
    color: #94a3b8;
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Touch controls — hidden by default, shown only on touch devices */
#touch-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 50;
    display: none;
}

.touch-row {
    display: flex;
    gap: 60px;
}

#touch-controls button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(74, 222, 128, 0.4);
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.15s;
}

#touch-controls button:active {
    background: rgba(74, 222, 128, 0.3);
}

/* Show touch controls only on actual touch devices */
@media (hover: none) and (pointer: coarse) {
    #touch-controls {
        display: flex !important;
    }
}

@media (max-width: 500px) {
    .game-over-text {
        font-size: 28px;
    }
}
