/* ── You Win / Game Over screens ── */
#you-win-screen {
    display: none;
    position: absolute;
    inset: 0;
    border-radius: 15px;
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
}

#you-win-screen.visible {
    display: flex;
}

#you-win-img {
    width: 40%;
    max-width: 560px;
    object-fit: contain;
    filter: drop-shadow(0 8px 32px rgba(0,0,0,0.9));
}

#you-win-restart,
#game-over-restart {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s;
    position: absolute;
    top: 80%;
    left: 40%;
    transform: translate(-50%, -50%);
    width: 12%;
    aspect-ratio: 1 / 1;
    z-index: 21;
    padding: 0;
}

#you-win-restart img,
#game-over-restart img {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}

#you-win-restart:hover,
#game-over-restart:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

#you-win-home,
#game-over-home {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s;
    position: absolute;
    top: 80%;
    left: 60%;
    transform: translate(-50%, -50%);
    width: 12%;
    aspect-ratio: 1 / 1;
    z-index: 21;
    padding: 0;
}

#you-win-home img,
#game-over-home img {
    width: 100%;
    height: 100%;
    display: block;
}

#you-win-home:hover,
#game-over-home:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

#game-over-screen {
    display: none;
    position: absolute;
    inset: 0;
    border-radius: 15px;
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
}

#game-over-screen.visible {
    display: flex;
}

#game-over-img {
    width: 40%;
    max-width: 560px;
    object-fit: contain;
    filter: drop-shadow(0 8px 32px rgba(0,0,0,0.9));
}

/* ── Start screen ── */
#start-screen {
    position: absolute;
    inset: 0;
    border-radius: 15px;
    overflow: hidden;
    z-index: 10;
}

#start-screen-bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #1a0a00;
}

#start-screen-buttons {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 11;
}

#start-screen-buttons button {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 0px 16px;
    cursor: pointer;
    transition: transform 0.15s;
}

#start-screen-buttons button:hover {
    transform: scale(1.1);
}

#start-screen-buttons img {
    width: 72px;
    height: 72px;
    display: block;
}

#start-screen-buttons span {
    font-family: 'Elliott', sans-serif;
    color: #3a1a00;
    font-size: 25px;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(255,255,255,0.4);
}

/* ── Info overlays ── */
#start-info-overlay {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    z-index: 12;
    border-radius: 15px;
    overflow: hidden;
    background-image: url('../assets/img/5_background/infoControl.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
}

#start-info-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(58,26,0,0.9);
    border: 2px solid #b87202;
    border-radius: 8px;
    color: #b87202;
    font-size: 22px;
    padding: 4px 12px;
    cursor: pointer;
    z-index: 13;
    transition: background 0.2s, color 0.2s;
}

#start-info-close:hover {
    background: #b87202;
    color: #3a1a00;
}

#game-info-overlay {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    z-index: 12;
    border-radius: 15px;
    overflow: hidden;
    background-image: url('../assets/img/5_background/infoControl.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
}

#game-info-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(58,26,0,0.9);
    border: 2px solid #b87202;
    border-radius: 8px;
    color: #b87202;
    font-size: 22px;
    padding: 4px 12px;
    cursor: pointer;
    z-index: 13;
    transition: background 0.2s, color 0.2s;
}

#game-info-close:hover {
    background: #b87202;
    color: #3a1a00;
}

/* ── About modal ── */
#about-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#about-modal.open {
    display: flex;
}

#about-content {
    background: #3a1a00;
    border: 3px solid #b87202;
    border-radius: 12px;
    padding: 40px 48px;
    max-width: 480px;
    width: 90%;
    position: relative;
    color: #f5deb3;
    font-family: sans-serif;
    font-size: 16px;
    line-height: 1.7;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.85), 0 0 32px rgba(184, 114, 2, 0.2);
}

#about-content h2 {
    font-family: 'Elliott', sans-serif;
    color: #b87202;
    margin-top: 0;
    font-size: 32px;
}

#about-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #b87202;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

#about-close:hover {
    color: #fff;
}

/* ── Rotate overlay ── */
#rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
}

#rotate-overlay.visible {
    display: flex;
}

#rotate-overlay .rotate-icon {
    font-size: clamp(3rem, 15vw, 6rem);
    animation: rotate-hint 2s ease-in-out infinite;
    margin-bottom: 1rem;
}

#rotate-overlay h2 {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    margin: 0.5rem 0;
}

#rotate-overlay p {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    opacity: 0.85;
    max-width: 400px;
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}
