/* Static landing overlay (SEO-visible) */
#landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1.0);
    /* Start fully opaque */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: pointer;
    color: white;
    text-align: center;
    transition: background-color 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

#landing-page.world-loaded {
    background-color: rgba(0, 0, 0, 0.7);
    /* Less transparent (darker) after world loads */
}

#landing-page.hiding {
    opacity: 0;
    /* Fully transparent when Play is clicked */
}

#landing-page .landing-content {
    max-width: 760px;
    width: 90%;
    height: 90vh;
    margin: 0;
    padding: 2vh 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vh, 20px);
}

#landing-title {
    margin-bottom: clamp(10px, 2vh, 30px);
    color: #3399ff;
    font-size: clamp(18px, 4vh, 32px);
}

#landing-page h2 {
    margin-bottom: clamp(4px, 1vh, 10px);
    color: #a5d8ff;
    font-size: clamp(14px, 3vh, 24px);
}

#landing-page p {
    line-height: 1.3;
    font-size: clamp(12px, 2vh, 16px);
    margin: 0.3vh 0;
}

#landing-play-button {
    background: linear-gradient(135deg, #3399ff, #0066cc);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: clamp(18px, 4vh, 28px);
    font-weight: bold;
    cursor: pointer;
    margin: clamp(15px, 3vh, 30px) 0;
    box-shadow: 0 4px 15px rgba(51, 153, 255, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#landing-play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(51, 153, 255, 0.4);
}

#landing-world-button {
    background: linear-gradient(135deg, #e2b06e, #c6934b);
    color: #050b14;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: clamp(18px, 4vh, 28px);
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(226, 176, 110, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#landing-world-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(226, 176, 110, 0.5);
    color: #000;
}

.landing-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: clamp(15px, 3vh, 30px) 0;
}

.landing-buttons #landing-play-button {
    margin: 0;
}

.landing-links {
    display: flex;
    gap: 16px;
}

.landing-links a {
    color: #3399ff;
    text-decoration: underline;
    font-size: clamp(12px, 1.8vh, 16px);
}

.landing-dismiss {
    margin-top: clamp(5px, 1vh, 10px);
    color: #888;
    font-style: italic;
    font-size: clamp(10px, 1.5vh, 14px);
}

/* Language selector */
.lang-select {
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    backdrop-filter: saturate(1.2) blur(2px);
    -webkit-backdrop-filter: saturate(1.2) blur(2px);
    cursor: pointer;
}

@media (max-aspect-ratio: 1/1) {
    #landing-page .landing-content {
        width: 95%;
        padding: 2vh 10px;
    }
}

@media (max-height: 600px) {
    #landing-page .landing-content {
        gap: clamp(4px, 1vh, 10px);
    }
}

@media (max-height: 400px) {
    #landing-page .landing-content {
        padding: 1vh 10px;
    }
}


/* Keycaps */
kbd {
    display: inline-block;
    padding: 0.1em 0.35em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1;
    color: #111;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-bottom-width: 2px;
    border-radius: 5px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* Controls table */
.controls-table {
    width: auto;
    max-width: 520px;
    margin: 4px auto 0;
    border-collapse: collapse;
}

.controls-table td {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
    font-size: 0.95em;
    line-height: 1.2;
}

.controls-table td:first-child {
    width: auto;
    color: #a5d8ff;
    font-weight: 600;
}

.controls-table td:last-child {
    width: auto;
}

@media (min-width: 900px) {
    .controls-table td:last-child {
        white-space: nowrap;
    }
}

/* Loading Spinner and Button State */
.landing-loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
    margin-right: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#landing-play-button:disabled {
    opacity: 0.8;
    cursor: wait;
    background: linear-gradient(135deg, #58799c, #3f5872);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#landing-play-button:disabled:hover {
    transform: none;
}

#landing-play-button:disabled .landing-loader {
    display: block;
}
/* Responsive visibility for desktop/mobile instructions */
.desktop-only,
.mobile-only {
    display: none;
}

html.is-desktop .desktop-only {
    display: inline;
}

html.is-mobile .mobile-only {
    display: inline;
}
