/* Static tutorial overlay (SEO-visible) */
#tutorial-overlay {
    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;
}

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

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

#tutorial-overlay .tutorial-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);
}

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

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

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

#tutorial-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;
}

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

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

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

.tutorial-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) {
    #tutorial-overlay .tutorial-content {
        width: 95%;
        padding: 2vh 10px;
    }
}

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

@media (max-height: 400px) {
    #tutorial-overlay .tutorial-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;
    }
}


