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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#start-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: linear-gradient(to bottom, #9ad8ff 0%, #77c5fb 60%, #bde7c3 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    color: #fff;
    font-family: sans-serif;
    text-align: center;
    padding: 20px;
}

#start-screen h1 {
    font-size: clamp(1.4rem, 5vw, 2.4rem);
    text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

#start-screen p {
    font-size: clamp(1rem, 3vw, 1.6rem);
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

#btn-start {
    margin-top: 12px;
    padding: 14px 48px;
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: bold;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

#btn-start:hover {
    background: #ddd;
}

.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: max(10px, env(safe-area-inset-bottom, 10px)) 
             max(10px, env(safe-area-inset-right, 10px))
             max(10px, env(safe-area-inset-bottom, 10px))
             max(10px, env(safe-area-inset-left, 10px));
    gap: 10px;
    pointer-events: none;
}

.control-btn {
    pointer-events: auto;
    min-width: 60px;
    min-height: 60px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition: all 0.1s ease;
}

.control-btn:active {
    background: rgba(255, 255, 255, 0.6);
    border-color: white;
    transform: scale(0.95);
}

.btn-left {
    flex: 0 0 60px;
    min-width: 60px !important;
    order: 1;
}

.btn-right {
    flex: 0 0 60px;
    min-width: 60px !important;
    order: 3;
}

.btn-jump {
    flex: 1 1 auto;
    min-width: 80px;
    max-width: none;
    order: 2;
}

.btn-zebra {
    flex: 0 0 60px;
    min-width: 60px !important;
    order: 4;
}

.btn-restart {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100px;
    min-height: 60px;
    background: rgba(255, 100, 100, 0.8) !important;
    border: 3px solid white !important;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    z-index: 2000;
    display: none !important;
}

.btn-restart.show {
    display: block !important;
}

/* Landscape adjustments */
@media (orientation: landscape) {
    .mobile-controls {
        flex-wrap: nowrap;
    }
    
    .btn-jump {
        max-width: 60px;
    }
}
