:root {
    --color-primary: #6e7577;
    --color-secondary: #3d4243;
    --color-tertiary: #555555;
    --color-button: #383a3c;
    --color-joystick: #8f9196;

    --color-red: #ec777d;
    --color-blue: #5690cc;
    --color-green: #0a9e6e;
    --color-yellow: #c3b241;

    /* Open normaal: 142mm x 154mm */
    /* Dicht normaal: 142mm x 90mm */
    /* Dimensies bron: https://www.dimensions.com/element/new-nintendo-3ds */
    --section-width: 770px;
    --section-height: 380px;
    --mid-height: 50px;

    /* Bovenste scherm: 107mm x 65mm */
    /* Onderste scherm: 83mm x 65mm */
    --screen-height: 325px;
    --screen-width-top: 535px;
    --screen-width-bottom: 415px;
}

.camera {
    width: 30px;
    aspect-ratio: 1;
    background: var(--color-secondary);
    border-radius: 50%;
    position: relative;
    list-style: none;

    &::before {
        content: "";
        position: absolute;
        inset: 0.3rem;
        background: black;
        border-radius: 50%;
    }

    &::after {
        content: "";
        position: absolute;
        inset: 0.7rem;
        background: var(--color-primary);
        border-radius: 50%;
    }

}

.DS3-controller {
    perspective: 2000px;
    transform-style: preserve-3d;

    #top-section {
        position: relative;
        width: var(--section-width);
        height: calc(var(--section-height) + var(--mid-height));
        transform-origin: center calc(100% - (var(--mid-height) / 2));
        transform-style: preserve-3d;
        transition: transform 0.5s ease;
        transform: rotateX(0deg);

        &.closed {
            transform: rotateX(-180deg);
        }

        .face {
            position: absolute;
            inset: 0;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            background: var(--color-primary);

        }

        .front {
            transform: translateZ(2px);
            corner-bottom-left-shape: notch;
            corner-bottom-right-shape: notch;
            border-radius: 5rem 5rem 13% 13%;
        }

        .back {
            transform: rotateX(180deg) translateZ(2px);
            corner-top-left-shape: notch;
            corner-top-right-shape: notch;
            border-radius: 15% 15% 5rem 5rem;
        }

        #top-screen {
            width: var(--screen-width-top);
            height: var(--screen-height);
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            border: 1rem solid var(--color-secondary);
            border-radius: 1rem;
        }

        #holes-container {
            position: absolute;
            width: 100%;
            top: 45%;
            left: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            justify-content: space-between;
            padding: 0 2rem;

            ul {
                display: grid;
                grid-template-columns: repeat(3, auto);
                list-style: none;
                justify-content: center;
                gap: 0.6rem;

                li {
                    width: 10px;
                    aspect-ratio: 1;
                    background: black;
                    border-radius: 50%;

                    &:nth-child(1),
                    &:nth-child(3),
                    &:nth-child(5) {
                        grid-column: 2;
                    }

                    &:nth-child(2) {
                        grid-column: 1;
                    }

                    &:nth-child(4) {
                        grid-column: 3;
                    }
                }
            }
        }

        #screw-covers {
            width: 100%;
            height: 100%;
            display: grid;
            grid-template-columns: repeat(2, auto);
            list-style: none;
            padding: 2rem 3rem 5rem 3rem;

            li {
                width: 20px;
                aspect-ratio: 1;
                border-radius: 5px;
                background: var(--color-tertiary);

                &:nth-of-type(2n) {
                    justify-self: end;
                }

                &:nth-of-type(3),
                &:nth-of-type(4) {
                    align-self: end;
                }
            }
        }

        .camera-container {
            position: absolute;
            top: 1rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 0.6rem;
            align-items: center;


            #infrared {
                width: 15px;
                aspect-ratio: 1;
                border-radius: 50%;
                background: black;
            }
        }

        .softclose-container {
            position: absolute;
            top: 1.2rem;
            width: 100%;
            display: flex;
            justify-content: space-evenly;
            gap: 0.6rem;
            list-style: none;

            li {
                width: 20px;
                aspect-ratio: 1;
                background: var(--color-secondary);
                border-radius: 50%;
            }
        }

        .side-slider {
            height: 5rem;
            width: 0.8rem;
            background: var(--color-secondary);
            position: absolute;
            top: 55%;

            .slider {
                width: 110%;
                height: 2rem;
            }

            .illustration {
                position: absolute;
                height: 100%;
                width: 2rem;
                top: 0;
                background: var(--color-tertiary);
                color: var(--color-tertiary);
                font-family: "Jost";
                text-transform: uppercase;

                &::before {
                    position: absolute;
                    top: 50%;
                    transform: translateY(-50%);
                }

                &::after {
                    position: absolute;
                    top: 95%;
                }
            }
        }

        #volume-control {
            left: 0;

            .slider {
                background: var(--color-button);
                margin-left: -0.2rem;
            }

            .illustration {
                left: 1rem;
                corner-bottom-right-shape: bevel;
                border-bottom-right-radius: 100%;

                &::before {
                    content: "vol.";
                    left: 1.5rem;
                }

                &::after {
                    content: "off";
                    left: 0;
                }
            }

        }

        #D3-control {
            right: 0;

            .slider {
                background: var(--color-joystick);
                margin-right: -0.2rem;
            }

            .illustration {
                right: 1rem;
                corner-bottom-left-shape: bevel;
                border-bottom-left-radius: 100%;

                &::before {
                    content: "3d";
                    right: 1.5rem;
                }

                &::after {
                    content: "off";
                    right: 0;
                }
            }
        }

        .back {
            position: relative;
            width: 100%;
            height: 100%;

            ul {
                display: flex;
                position: absolute;
                bottom: 1.5rem;
                left: 50%;
                transform: translateX(-50%);
                gap: 15rem;
            }
        }

    }

    .middle-section {
        position: relative;
        width: var(--section-width);
        height: var(--mid-height);
        background: var(--color-primary);
        border-radius: 2rem;
        margin-top: calc(var(--mid-height) * -1);
        z-index: 1;
        border: 2px solid black;

        .notification-light {
            width: 15px;
            aspect-ratio: 1;
            background: var(--color-secondary);
            position: absolute;
            top: 50%;
            right: 7%;
            transform: translateY(-50%);
        }

        &::before,
        &::after {
            content: "";
            position: absolute;
            height: 100%;
            width: 4px;
            background: black;
        }

        &::before {
            left: 6rem;
        }

        &::after {
            right: 6rem;
        }
    }

    .bottom-section {
        position: relative;
        width: var(--section-width);
        height: calc(var(--section-height) + var(--mid-height));
        background: var(--color-primary);
        border-radius: 2rem 2rem 5rem 5rem;
        margin-top: calc(var(--mid-height) * -1);
        display: flex;
        justify-content: space-evenly;

        .left-side {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2rem;
            margin-top: var(--mid-height);

            .joystick {
                width: 7rem;
                aspect-ratio: 1;
                background: var(--color-tertiary);
                border-radius: 50%;
                display: flex;
                justify-content: center;
                align-items: center;
                margin-top: 2rem;

                .stick {
                    width: 60%;
                    aspect-ratio: 1;
                    background: var(--color-joystick);
                    border-radius: 50%;
                }
            }

            .dpad {
                display: grid;
                grid-template-columns: repeat(3, 1fr);
                grid-template-rows: repeat(3, 1fr);
                width: 120px;
                aspect-ratio: 1;

                button {
                    aspect-ratio: 1;
                    border: none;
                    background: var(--color-button);
                    padding: 0.5rem;
                }

                #dpad-up {
                    grid-area: 1 / 2;
                    border-radius: 5px 5px 0 0;
                }

                #dpad-left {
                    grid-area: 2 / 1;
                    border-radius: 5px 0 0 5px;
                }

                div {
                    grid-column: 2;
                    grid-row: 2;
                    background: var(--color-button);
                }

                #dpad-right {
                    grid-area: 2 / 3;
                    border-radius: 0 5px 5px 0;

                }

                #dpad-down {
                    grid-area: 3 / 2;
                    border-radius: 0 0 5px 5px;
                }

                hr {
                    border: 2px solid var(--color-joystick);
                }

                #dpad-up,
                #dpad-down {
                    hr {
                        rotate: 90deg;
                    }
                }
            }

        }

        #bottom-screen-container {
            padding: 1rem;
            height: calc(100% - var(--mid-height));
            display: flex;
            flex-direction: column;
            align-items: center;
            background: #747a7c;
            border: 2px solid var(--color-secondary);
            border-bottom: none;
            border-top: none;
            border-radius: 0 0 3rem 3rem;
            margin-top: var(--mid-height);
            gap: 0.5rem;

            #bottom-screen {
                width: var(--screen-width-bottom);
                height: var(--screen-height);
                border-radius: 1rem;
                overflow: hidden;
                position: relative;
                border: 1px solid black;
            }

            #home-button {
                width: 3rem;
                height: 2rem;
                border-radius: 2rem;
                display: flex;
                justify-content: center;
                align-items: center;
                background: var(--color-button);
                color: var(--color-tertiary);
                font-size: 1.3rem;
                border: none;
            }
        }

        .right-side {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            font-family: "Jost";
            display: flex;
            flex-direction: column;
            margin-top: var(--mid-height);

            .c-stick {
                width: 2.5em;
                aspect-ratio: 1;
                border: 4px solid var(--color-tertiary);
                border-radius: 50%;
                background: var(--color-joystick);
                margin-top: 1rem;
            }

            .abxy-container {
                display: grid;
                grid-template-columns: repeat(3, 1fr);
                grid-template-rows: repeat(3, 1fr);
                width: 125px;
                aspect-ratio: 1;

                button {
                    border: none;
                    width: 2.5rem;
                    aspect-ratio: 1;
                    border-radius: 50%;
                    background: var(--color-button);
                    box-shadow: 0px 5px 0px 0px black;
                    font-size: 1.5rem;

                    &:active {
                        box-shadow: 0px 2px 0px 0px black;
                        transform: translateY(3px);
                    }
                }

                button:first-of-type {
                    grid-column: 2;
                    color: var(--color-blue)
                }

                button:nth-of-type(2) {
                    grid-column: 1;
                    grid-row: 2;
                    color: var(--color-green);
                }

                button:nth-of-type(3) {
                    grid-column: 3;
                    grid-row: 2;
                    color: var(--color-red);
                }

                button:nth-of-type(4) {
                    grid-column: 2;
                    grid-row: 3;
                    color: var(--color-yellow)
                }
            }

            .start-select-container {
                display: flex;
                flex-direction: column;
                gap: .5rem;
                margin-top: 3rem;

                div {
                    display: flex;
                    gap: 1rem;
                    align-items: center;
                    text-transform: uppercase;
                    color: var(--color-tertiary);
                }

                a {
                    width: 1.4rem;
                    aspect-ratio: 1;
                    border: none;
                    border-radius: 50%;
                    background: var(--color-button);
                    box-shadow: 0px 3px 0px 0px black;
                }
            }
        }

        #information-lights {
            display: flex;
            gap: 2rem;
            position: absolute;
            bottom: 0;
            right: 12%;

            div {
                width: 8px;
                height: 15px;
                background: var(--color-secondary);
                position: relative;

                &:first-of-type::after {
                    content: "mic";
                    position: absolute;
                    font-family: "Jost";
                    text-transform: uppercase;
                    left: -100%;
                    top: -130%;
                    color: var(--color-tertiary);
                }
            }
        }
    }
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-family: "Jost";
    transform: translateZ(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;

    &:has(:not(img)) {
        padding: 1.2rem;
    }

    &.active {
        opacity: 1;
        transform: translateX(0);
    }

    h2 {
        color: #1b2035;
        font-size: 1.7rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;

        position: relative;
        z-index: 2;

        /* 3D embossed look */
        text-shadow:
            0 1px 0 rgba(255,255,255,0.6),
            0 2px 6px rgba(0,0,0,0.25);

        transform: perspective(400px) translateZ(10px);

        &::after {
            content: "";
            width: 3.5rem;
            height: 3px;
            background: rgba(27,32,53,0.4);
            position: absolute;
            left: 50%;
            bottom: -0.5rem;
            transform: translateX(-50%);
            border-radius: 999px;
        }
    }

    p {
        font-size: 1rem;
        line-height: 1.3;
        color: #1d2c17;
        max-width: 40ch;
        padding: 1rem;
        border-radius: 1rem;
        background: rgba(255,255,255,0.22);
        backdrop-filter: blur(3px);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.5),
            inset 0 -2px 10px rgba(0,0,0,0.05),
            0 10px 18px rgba(0,0,0,0.18);
    }

    img {
        width: 100%;
        height: auto;
        overflow: hidden;
    }
}