/* --- 7. UI Screens System --- */
#ui-layer {
    z-index: 30;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
    z-index: 20;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Start Screen */
#start-screen {
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title-container {
    width: 30%;
    margin-bottom: 2%;
    animation: title-float 3.5s ease-in-out infinite alternate;
}

#game-title-img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

.start-btn-container {
    width: 10%;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

#start-btn {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    animation: pulse-button 2s infinite ease-in-out;
    transition: filter 0.2s ease;
}

.start-btn-container:hover {
    transform: scale(1.15);
}

.start-btn-container:hover #start-btn {
    filter: drop-shadow(0 8px 18px rgba(255, 215, 0, 0.7));
}

.start-btn-container:active {
    transform: scale(0.93);
}

/* Game Play HUD */
#game-ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Instruction box (horizontal wood/gold banner using Dialogue box.png) */
#instruction-box {
    position: absolute;
    top: 7%;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    animation: banner-float 3s ease-in-out infinite alternate;
    transition: opacity 0.5s ease;
}

.instruction-box-bg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.5));
}

.instruction-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 82%;
    text-align: center;
    z-index: 2;
}

#instruction-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
}


/* Result Screen */
#result-screen {
    background: url('../assets/backgrounds/result%20bg.png') center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 80;
}

/* Game Logo Watermark */
#game-logo {
    position: absolute;
    top: 2.5vmax;
    left: 2.5vmax;
    width: 9vmax;
    max-width: 190px;
    min-width: 70px;
    z-index: 100;
    pointer-events: none;
}

#game-logo img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}