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

body, html {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    /* Important: Allow vertical scrolling */
    overflow-y: auto;
    background: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#scroll-container {
    /* This container will hold the scrollable sections */
    position: relative;
    width: 100%;
    height: 100vh; /* Each viewport height */
    overflow-y: scroll; /* Enable vertical scrolling */
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch; /* For iOS smooth scrolling */
}

/* Hide scrollbar but keep functionality */
#scroll-container::-webkit-scrollbar {
    display: none;
}

#sections {
    position: relative;
    height: auto;
    min-height: 100vh;
    display: block;
    scroll-snap-align: none;
}

.section {
    width: 100%;
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    padding: 2rem;
    scroll-snap-align: none;
    letter-spacing: 2px;
}

/* Debug info styling */
#debug-info {
    font-size: 0.9rem;
    line-height: 1.4;
}

#debug-info div {
    margin: 4px 0;
}

#mobile-rotate-overlay,
#mobile-controls {
    display: none;
}

#controls-toggle-button {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 1900;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.78);
    color: #f4f8ff;
    font-family: monospace;
    font-size: 12px;
    letter-spacing: 0.02em;
    padding: 8px 12px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}

#controls-toggle-button:active {
    transform: scale(0.98);
}

#mobile-rotate-overlay {
    position: fixed;
    inset: 0;
    z-index: 2200;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 14, 0.88);
    backdrop-filter: blur(4px);
    padding: 24px;
}

.mobile-rotate-card {
    width: min(88vw, 360px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: rgba(14, 18, 30, 0.92);
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.42);
    color: #eef3ff;
    font-family: monospace;
    padding: 16px 14px;
    text-align: center;
}

.mobile-rotate-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.mobile-rotate-body {
    font-size: 12px;
    line-height: 1.45;
    opacity: 0.9;
    margin-bottom: 12px;
}

#mobile-orientation-lock {
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.12);
    color: #f4f8ff;
    border-radius: 999px;
    padding: 8px 14px;
    font-family: monospace;
    font-size: 12px;
}

#mobile-controls {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 56px;
    z-index: 1800;
    display: none;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

.mobile-controls-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.mobile-controls-row button {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(8, 12, 20, 0.8);
    color: #edf3ff;
    font-family: monospace;
    font-size: 12px;
    letter-spacing: 0.02em;
    padding: 10px 8px;
    touch-action: manipulation;
    user-select: none;
}

.mobile-controls-row button:active {
    transform: scale(0.98);
    background: rgba(22, 30, 46, 0.88);
}

.mobile-steer-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.mobile-device #mobile-controls {
    display: flex;
}

body.mobile-device.mobile-portrait #mobile-rotate-overlay {
    display: flex;
}

body.mobile-device.mobile-portrait #mobile-controls {
    opacity: 0.34;
    pointer-events: none;
}

body.mobile-device #controls-tooltip {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section h1 {
        font-size: 2rem;
    }

    #debug-info {
        font-size: 0.8rem;
        padding: 8px;
    }

    #mobile-controls {
        left: 8px;
        right: 8px;
        bottom: 52px;
    }

    #controls-toggle-button {
        left: 8px;
        bottom: 8px;
        padding: 8px 11px;
    }
}