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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a1a2e;
    font-family: 'Open Sans', sans-serif;
}

#game-canvas {
    display: block;
    margin: 0 auto;
    background: #16213e;
}

#score-display {
    position: fixed;
    top: 12px;
    right: 16px;
    color: #fbbf24;
    font-size: 24px;
    font-weight: bold;
    z-index: 10;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

#level-display {
    position: fixed;
    top: 12px;
    left: 16px;
    color: #4ade80;
    font-size: 20px;
    font-weight: bold;
    z-index: 10;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

#timer-display {
    position: fixed;
    top: 40px;
    right: 16px;
    color: #e0e0e0;
    font-size: 16px;
    z-index: 10;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.sendmessage {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: #fff;
    cursor: pointer;
}

.sendmessage h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

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

#game-over-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 26, 46, 0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    cursor: pointer;
}

#game-over-overlay.hidden {
    display: none;
}

.game-over-text {
    font-size: 36px;
    font-weight: bold;
    color: #4ade80;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(74,222,128,0.5);
}

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

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

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

#touch-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

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

#touch-controls button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

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

@media (pointer: coarse) {
    #touch-controls {
        display: flex;
    }
}

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