@font-face {
    font-family: 'minecraft-font';
    src: url('fonts/minecraft.ttf'); 
}

/* BRON: Voor de uitleg en indeling van de @layers:  https://css-tricks.com/css-cascade-layers/ */

/* LAYER VOLGORDE - latere layers winnen bij conflicten */
@layer reset, colors, base, layout, components, themes, utilities;

/* RESET - basis layout dingen*/
@layer reset {
    *, *::before, *::after {
        box-sizing: border-box;
    }
 
    body {
        margin: 0;
    }
}

/* COLORS - kleuren */
@layer colors {
    :root {
        /* tekst */
        --color-text: #fff;
 
        /* bloem kleuren */
        --f1-light-red: rgb(236, 38, 38);
        --f1-red:       rgb(180, 28, 28);
        --f1-dark-red:  rgb(114, 12, 12);
 
        --f1-green:      rgb(8, 124, 58);
        --f1-dark-green: rgb(11, 95, 19);

        --pot-light: rgb(200, 100, 60);
        --pot-mid:   rgb(160, 75, 40);
        --pot-dark:  rgb(110, 50, 25);
 
        /* control panel kleuren */
        /* BRON: ChatGPT prompt: Geef voor mijn ontwerp minecraft kleuren */
        --color-sky:        #a4d0ed;
        --color-grass:      #41a76b;
        --color-grass-dark: #2f5f28;
        --color-dirt:       #8b5a2b;
        --color-dirt-dark:  #5a3a1b;
        --color-dirt-light: #a36a35;
        --color-stone:      #c6c6c6;
        --color-stone-dark: #5c5c5c;
    }
}

/* BASE - typografie en basis elementen */
@layer base {
    body {
        background: linear-gradient(rgb(124, 195, 232) 0%, rgb(169, 220, 240) 45%, rgb(191, 231, 194) 60%, rgb(111, 181, 106) 60%, rgb(78, 154, 87) 100%);
        font-family: Arial, Helvetica, sans-serif;
    }

    /* --- Zon & Maan --- */
    main div.sun {
        position: absolute;
        top: 10px;
        right: 10%;
        width: 70px;
        height: 70px;
        background: rgb(255, 228, 94);
        box-shadow: rgba(255, 228, 94, 0.55) 0px 0px 60px 20px;
    }

    /* --- Regenboog --- */
    .rainbow {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 190px;
        margin-inline: auto;
        width: fit-content;
        display: grid;
        grid-template-columns: repeat(16, 1rem);
        grid-template-rows: repeat(9, 1rem);
        opacity: 0; /*zorgt ervoor dat hij niet laat zien, opacity wordt 1 als regenboog gecheckt is*/
        pointer-events: none;
    }

    h1 {
        font-family: 'minecraft-font';
        margin: 1em auto;
        background-color: rgba(0, 0, 0, 0.25);
        padding: 0.5em;
        text-align: center;
        color: var(--color-text);
        letter-spacing: 0.05rem;
    }
 
    h2 {
        font-family: 'minecraft-font';
        color: var(--color-text);
        text-align: center;
        letter-spacing: 0.1rem;
    }
 
    fieldset {
        border: 3px solid var(--color-dirt-dark);
        padding: 0.5rem;
    }
 
    legend {
        padding: 0.3rem 0.6rem;
        color: var(--color-text);
        text-transform: uppercase;
        letter-spacing: 1px;
        font-size: 0.7rem;
    }
 
    input[type="radio"] {
        display: none;
    }
}

/* LAYOUT - pagina structuur en grid */
@layer layout {
    body {
        display: grid;
        grid-template-columns: 1fr 14rem;
        grid-template-rows: 12rem auto;
    }
 
    header {
        grid-area: 1 / 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
 
    main {
        perspective: 60em;
        min-height: 80dvh;
        grid-area: 2 / 1;
    }
 
    aside {
        grid-area: span 2 / 2;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0.75rem;
    }
 
    /* 3D context voor alles binnen main */
    main, main * {
        transform-style: preserve-3d;
    }
}

/* COMPONENTS - herbruikbare UI-onderdelen */
@layer components {
 
    /* --- Bloem grid --- */
    section {
        --s: 2em;

        width: 100%;
        height: 100%;
        display: grid;
        grid-template-columns: repeat(7, var(--s));
        grid-template-rows: auto auto;
        place-items: center;
        place-content: center;

        transition: 1.5s ease;
    }

    .flower {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(7, var(--s));
        grid-template-rows: repeat(11, var(--s));
        place-items: center;

        scale: 0;
        transition: scale 0.6s;
    }

    html:has(#geplant:checked) .flower {
        scale: 1;
    }

    .pot {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(7, var(--s));
        grid-template-rows: repeat(3, var(--s));
        place-items: center;
    }
 
   /* --- Kubus --- */
    /* BRON: samen met Sanne calculaties gemaakt */
    cube {
        width: var(--s);
        aspect-ratio: 1;
        display: grid;
    }

    cube:hover {
        translate: 0px 10px;
    }
 
    .flower cube {
        /* START LAAG */
        &:nth-of-type(1)  { --color: var(--f1-red);        grid-area: 1/4; } /* rij 1 */
        &:nth-of-type(2)  { --color: var(--f1-red);        grid-area: 1/5; } /* rij 1 */

        &:nth-of-type(3)  { --color: var(--f1-red);        grid-area: 2/2; } /* rij 2 */
        &:nth-of-type(4)  { --color: var(--f1-dark-red);   grid-area: 2/3; } /* rij 2 */
        &:nth-of-type(5)  { --color: var(--f1-red);        grid-area: 2/4; } /* rij 2 */
        &:nth-of-type(6)  { --color: var(--f1-red);        grid-area: 2/5; } /* rij 2 */
        &:nth-of-type(7)  { --color: var(--f1-light-red);  grid-area: 2/6; } /* rij 2 */

        &:nth-of-type(8)  { --color: var(--f1-red);        grid-area: 3/1; } /* rij 3 */
        &:nth-of-type(9)  { --color: var(--f1-red);        grid-area: 3/2; } /* rij 3 */
        &:nth-of-type(10) { --color: var(--f1-red);        grid-area: 3/3; } /* rij 3 */
        &:nth-of-type(11) { --color: var(--f1-dark-red);   grid-area: 3/4; } /* rij 3 */
        &:nth-of-type(12) { --color: var(--f1-red);        grid-area: 3/5; } /* rij 3 */
        &:nth-of-type(13) { --color: var(--f1-dark-red);   grid-area: 3/6; } /* rij 3 */

        &:nth-of-type(14) { --color: var(--f1-light-red);  grid-area: 4/1; } /* rij 4 */
        &:nth-of-type(15) { --color: var(--f1-light-red);  grid-area: 4/2; } /* rij 4 */
        &:nth-of-type(16) { --color: var(--f1-red);        grid-area: 4/3; } /* rij 4 */
        &:nth-of-type(17) { --color: var(--f1-dark-red);   grid-area: 4/4; } /* rij 4 */
        &:nth-of-type(18) { --color: var(--f1-dark-red);   grid-area: 4/5; } /* rij 4 */

        &:nth-of-type(19) { --color: var(--f1-light-red);  grid-area: 5/2; } /* rij 5 */
        &:nth-of-type(20) { --color: var(--f1-green);      grid-area: 5/3; } /* rij 5 */
        &:nth-of-type(21) { --color: var(--f1-dark-green); grid-area: 5/4; } /* rij 5 */

        &:nth-of-type(22) { --color: var(--f1-green);      grid-area: 6/4; } /* rij 6 */

        &:nth-of-type(23) { --color: var(--f1-green);      grid-area: 7/4; } /* rij 7 */

        &:nth-of-type(24) { --color: var(--f1-green);      grid-area: 8/4; } /* rij 8 */

        &:nth-of-type(25) { --color: var(--f1-dark-green); grid-area: 9/1; } /* rij 9 */
        &:nth-of-type(26) { --color: var(--f1-green);      grid-area: 9/2; } /* rij 9 */
        &:nth-of-type(27) { --color: var(--f1-green);      grid-area: 9/4; } /* rij 9 */
        &:nth-of-type(28) { --color: var(--f1-green);      grid-area: 9/6; } /* rij 9 */
        &:nth-of-type(29) { --color: var(--f1-green);      grid-area: 9/7; } /* rij 9 */

        &:nth-of-type(30) { --color: var(--f1-dark-green); grid-area: 10/2; } /* rij 10 */
        &:nth-of-type(31) { --color: var(--f1-dark-green); grid-area: 10/4; } /* rij 10 */
        &:nth-of-type(32) { --color: var(--f1-green);      grid-area: 10/5; } /* rij 10 */

        &:nth-of-type(33) { --color: var(--f1-green);      grid-area: 11/3; } /* rij 11 */
        &:nth-of-type(34) { --color: var(--f1-dark-green); grid-area: 11/4; } /* rij 11 */
 
        /* TWEEDE LAAG: naar voren */
        &:nth-of-type(35) { --color: var(--f1-light-red);  grid-area: 1/4;  translate: 0 0 var(--s); } /* rij 1 */

        &:nth-of-type(36) { --color: var(--f1-red);        grid-area: 2/3;  translate: 0 0 var(--s); } /* rij 2 */
        &:nth-of-type(37) { --color: var(--f1-red);        grid-area: 2/4;  translate: 0 0 var(--s); } /* rij 2 */
        &:nth-of-type(38) { --color: var(--f1-red);        grid-area: 2/5;  translate: 0 0 var(--s); } /* rij 2 */

        &:nth-of-type(39) { --color: var(--f1-light-red);  grid-area: 3/2;  translate: 0 0 var(--s); } /* rij 3 */
        &:nth-of-type(40) { --color: var(--f1-red);        grid-area: 3/3;  translate: 0 0 var(--s); } /* rij 3 */
        &:nth-of-type(41) { --color: var(--f1-red);        grid-area: 3/4;  translate: 0 0 var(--s); } /* rij 3 */
        &:nth-of-type(42) { --color: var(--f1-dark-red);   grid-area: 3/5;  translate: 0 0 var(--s); } /* rij 3 */

        &:nth-of-type(43) { --color: var(--f1-red);        grid-area: 4/3;  translate: 0 0 var(--s); } /* rij 4 */
        &:nth-of-type(44) { --color: var(--f1-dark-red);   grid-area: 4/4;  translate: 0 0 var(--s); } /* rij 4 */

        &:nth-of-type(45) { --color: var(--f1-dark-red);   grid-area: 5/4;  translate: 0 0 var(--s); } /* rij 5 */

        &:nth-of-type(46) { --color: var(--f1-green);      grid-area: 9/6;  translate: 0 0 var(--s); } /* rij 9 */

        &:nth-of-type(47) { --color: var(--f1-dark-green); grid-area: 10/5; translate: 0 0 var(--s); } /* rij 10 */

        &:nth-of-type(48) { --color: var(--f1-dark-green); grid-area: 11/3; translate: 0 0 var(--s); } /* rij 11 */
        &:nth-of-type(49) { --color: var(--f1-dark-green); grid-area: 11/4; translate: 0 0 var(--s); } /* rij 11 */
 
        /* DERDE LAAG: naar voren */
        &:nth-of-type(50) { --color: var(--f1-light-red);  grid-area: 2/4;  translate: 0 0 calc(var(--s) * 2); } /* rij 2 */

        &:nth-of-type(51) { --color: var(--f1-red);        grid-area: 3/3;  translate: 0 0 calc(var(--s) * 2); } /* rij 3 */
        &:nth-of-type(52) { --color: var(--f1-red);        grid-area: 3/4;  translate: 0 0 calc(var(--s) * 2); } /* rij 3 */

        &:nth-of-type(53) { --color: var(--f1-dark-red);   grid-area: 4/4;  translate: 0 0 calc(var(--s) * 2); } /* rij 4 */
 
        /* TWEEDE LAAG: naar achter */
        &:nth-of-type(54) { --color: var(--f1-light-red);  grid-area: 2/3;  translate: 0 0 calc(var(--s) * -1); } /* rij 2 */
        &:nth-of-type(55) { --color: var(--f1-light-red);  grid-area: 2/4;  translate: 0 0 calc(var(--s) * -1); } /* rij 2 */
        &:nth-of-type(56) { --color: var(--f1-red);        grid-area: 2/5;  translate: 0 0 calc(var(--s) * -1); } /* rij 2 */

        &:nth-of-type(57) { --color: var(--f1-light-red);  grid-area: 3/2;  translate: 0 0 calc(var(--s) * -1); } /* rij 3 */
        &:nth-of-type(58) { --color: var(--f1-red);        grid-area: 3/3;  translate: 0 0 calc(var(--s) * -1); } /* rij 3 */
        &:nth-of-type(59) { --color: var(--f1-red);        grid-area: 3/4;  translate: 0 0 calc(var(--s) * -1); } /* rij 3 */
        &:nth-of-type(60) { --color: var(--f1-red);        grid-area: 3/5;  translate: 0 0 calc(var(--s) * -1); } /* rij 3 */

        &:nth-of-type(61) { --color: var(--f1-light-red);  grid-area: 4/2;  translate: 0 0 calc(var(--s) * -1); } /* rij 4 */
        &:nth-of-type(62) { --color: var(--f1-red);        grid-area: 4/3;  translate: 0 0 calc(var(--s) * -1); } /* rij 4 */
        &:nth-of-type(63) { --color: var(--f1-red);        grid-area: 4/4;  translate: 0 0 calc(var(--s) * -1); } /* rij 4 */
        &:nth-of-type(64) { --color: var(--f1-dark-red);   grid-area: 4/5;  translate: 0 0 calc(var(--s) * -1); } /* rij 4 */

        &:nth-of-type(65) { --color: var(--f1-dark-green); grid-area: 10/3; translate: 0 0 calc(var(--s) * -1); } /* rij 10 */
        &:nth-of-type(66) { --color: var(--f1-green);      grid-area: 10/4; translate: 0 0 calc(var(--s) * -1); } /* rij 10 */
        &:nth-of-type(67) { --color: var(--f1-dark-green); grid-area: 10/5; translate: 0 0 calc(var(--s) * -1); } /* rij 10 */

        &:nth-of-type(68) { --color: var(--f1-green);      grid-area: 11/4; translate: 0 0 calc(var(--s) * -1); } /* rij 11 */
 
        /* DERDE LAAG: naar achter */
        &:nth-of-type(69) { --color: var(--f1-red); grid-area: 3/4; translate: 0 0 calc(var(--s) * -2); } /* rij 3 */
        &:nth-of-type(70) { --color: var(--f1-red); grid-area: 3/5; translate: 0 0 calc(var(--s) * -2); } /* rij 3 */
    }

    .pot cube {
        /* POT */
        /* rij 1: rand */
        &:nth-of-type(1) { --color: var(--pot-light); grid-area: 1/2; }
        &:nth-of-type(2) { --color: var(--pot-dark);   grid-area: 1/3; }
        &:nth-of-type(3) { --color: var(--pot-dark); grid-area: 1/4; }
        &:nth-of-type(4) { --color: var(--pot-dark);   grid-area: 1/5; }
        &:nth-of-type(5) { --color: var(--pot-light); grid-area: 1/6; }

        /* rij 2: lichaam */
        &:nth-of-type(6)  { --color: var(--pot-mid);  grid-area: 2/3; }
        &:nth-of-type(7)  { --color: var(--pot-dark); grid-area: 2/4; }
        &:nth-of-type(8)  { --color: var(--pot-mid);  grid-area: 2/5; }

        /* rij 3: bodem */
        &:nth-of-type(9)  { --color: var(--pot-mid); grid-area: 3/3; }
        &:nth-of-type(10) { --color: var(--pot-mid); grid-area: 3/4; }
        &:nth-of-type(11) { --color: var(--pot-mid); grid-area: 3/5; }

        /* TWEEDE LAAG: naar voren */
        /* rij 1: rand */
        &:nth-of-type(12) { --color: var(--pot-light); grid-area: 1/2; translate: 0 0 var(--s); }
        &:nth-of-type(13) { --color: var(--pot-dark);   grid-area: 1/3; translate: 0 0 var(--s); }
        &:nth-of-type(14) { --color: var(--pot-dark); grid-area: 1/4; translate: 0 0 var(--s); }
        &:nth-of-type(15) { --color: var(--pot-dark);   grid-area: 1/5; translate: 0 0 var(--s); }
        &:nth-of-type(16) { --color: var(--pot-light); grid-area: 1/6; translate: 0 0 var(--s); }

        /* rij 2: lichaam */
        &:nth-of-type(17)  { --color: var(--pot-light);  grid-area: 2/3; translate: 0 0 var(--s); }
        &:nth-of-type(18)  { --color: var(--pot-mid); grid-area: 2/4; translate: 0 0 var(--s); }
        &:nth-of-type(19)  { --color: var(--pot-light);  grid-area: 2/5; translate: 0 0 var(--s); }

        /* rij 3: bodem */
        &:nth-of-type(20)  { --color: var(--pot-mid); grid-area: 3/3; translate: 0 0 var(--s); }
        &:nth-of-type(21) { --color: var(--pot-mid); grid-area: 3/4; translate: 0 0 var(--s); }
        &:nth-of-type(22) { --color: var(--pot-mid); grid-area: 3/5; translate: 0 0 var(--s); }

        /* DERDE LAAG: naar voren */
        /* rij 1: rand */
        &:nth-of-type(23) { --color: var(--pot-light); grid-area: 1/2; translate: 0 0 calc(var(--s) * 2); }
        &:nth-of-type(24) { --color: var(--pot-light); grid-area: 1/3; translate: 0 0 calc(var(--s) * 2); }
        &:nth-of-type(25) { --color: var(--pot-light); grid-area: 1/4; translate: 0 0 calc(var(--s) * 2); }
        &:nth-of-type(26) { --color: var(--pot-light); grid-area: 1/5; translate: 0 0 calc(var(--s) * 2); }
        &:nth-of-type(27) { --color: var(--pot-light); grid-area: 1/6; translate: 0 0 calc(var(--s) * 2); }

        /* TWEEDE LAAG: naar achter */
        /* rij 1: rand */
        &:nth-of-type(28) { --color: var(--pot-light); grid-area: 1/2; translate: 0 0 calc(var(--s) * -1); }
        &:nth-of-type(29) { --color: var(--pot-dark); grid-area: 1/3; translate: 0 0 calc(var(--s) * -1); }
        &:nth-of-type(30) { --color: var(--pot-dark); grid-area: 1/4; translate: 0 0 calc(var(--s) * -1); }
        &:nth-of-type(31) { --color: var(--pot-dark); grid-area: 1/5; translate: 0 0 calc(var(--s) * -1); }
        &:nth-of-type(32) { --color: var(--pot-light); grid-area: 1/6; translate: 0 0 calc(var(--s) * -1); }

        /* rij 2: lichaam */
        &:nth-of-type(33)  { --color: var(--pot-light); grid-area: 2/3; translate: 0 0 calc(var(--s) * -1);}
        &:nth-of-type(34)  { --color: var(--pot-mid); grid-area: 2/4; translate: 0 0 calc(var(--s) * -1); }
        &:nth-of-type(35)  { --color: var(--pot-light); grid-area: 2/5; translate: 0 0 calc(var(--s) * -1); }

        /* rij 3: bodem */
        &:nth-of-type(36)  { --color: var(--pot-mid); grid-area: 3/3; translate: 0 0 calc(var(--s) * -1); }
        &:nth-of-type(37) { --color: var(--pot-mid); grid-area: 3/4; translate: 0 0 calc(var(--s) * -1); }
        &:nth-of-type(38) { --color: var(--pot-mid); grid-area: 3/5; translate: 0 0 calc(var(--s) * -1); }

        /* DERDE LAAG: naar achter */
        /* rij 1: rand */
        &:nth-of-type(39) { --color: var(--pot-light); grid-area: 1/2; translate: 0 0 calc(var(--s) * -2); }
        &:nth-of-type(40) { --color: var(--pot-light); grid-area: 1/3; translate: 0 0 calc(var(--s) * -2);}
        &:nth-of-type(41) { --color: var(--pot-light); grid-area: 1/4; translate: 0 0 calc(var(--s) * -2); }
        &:nth-of-type(42) { --color: var(--pot-light); grid-area: 1/5; translate: 0 0 calc(var(--s) * -2); }
        &:nth-of-type(43) { --color: var(--pot-light); grid-area: 1/6; translate: 0 0 calc(var(--s) * -2); }
    }

    /* --- Kubus zijkanten --- */
    /* BRON: samen met Sanne gemaakt */
    side {
        grid-area: 1/1;
        width: 100%;
        aspect-ratio: 1;
        background-image: linear-gradient(45deg, var(--color, white), #fff1); /* gradient simuleert lichtinval */
 
        &:nth-of-type(1) /* voorkant */  { transform: translateZ(calc(var(--s) / 2)); }
        &:nth-of-type(2) /* rechts */    { transform: rotateY(90deg)  translateZ(calc(var(--s) / 2)); }
        &:nth-of-type(3) /* achter */    { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
        &:nth-of-type(4) /* links */     { transform: rotateY(270deg) translateZ(calc(var(--s) / 2)); }
        &:nth-of-type(5) /* boven */     { transform: rotateX(90deg)  translateZ(calc(var(--s) / 2)); }
        &:nth-of-type(6) /* onder */     { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
    }
 
    /* --- Control panel --- */
    aside {
        background: var(--color-dirt);
        box-shadow:
            inset 4px 0 0 var(--color-dirt-light),
            -6px 0 0 var(--color-dirt-dark);
    }

    fieldset {
        background: rgba(0, 0, 0, 0.2);
        box-shadow:
            inset 2px 2px 0 rgba(255, 255, 255, 0.08),
            inset -2px -2px 0 rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }
 
    legend {
        background: var(--color-grass);
        border: 3px solid var(--color-grass-dark);
        box-shadow: 3px 3px 0 #1a1a1a;
    }
 
    /* labels voor bloem + tijd fieldsets */
    fieldset:nth-of-type(1) label,
    fieldset:nth-of-type(2) label,
    fieldset:nth-of-type(3) label  {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.35rem 0.5rem;
        color: var(--color-text);
        font-size: 0.85rem;
        border: 2px solid transparent;
        cursor: pointer;
 
        &:hover {
            background: rgba(255, 255, 255, 0.07);
        }
    }
 
    fieldset:nth-of-type(1) input[type="radio"]:checked + label,
    fieldset:nth-of-type(2) input[type="radio"]:checked + label, 
    fieldset:nth-of-type(3) input[type="radio"]:checked + label{
        background: rgba(255, 255, 255, 0.12);
        border-color: var(--color-grass);
    }
 
    /* rotatie fieldset als pijlen-grid */
    fieldset:nth-of-type(4) {
        display: grid;
        grid-template-columns: repeat(3, 50px);
        grid-template-rows: repeat(3, 50px);
        gap: 0.3rem;
        padding: 0.75rem;
        place-content: center;
 
        & button:nth-of-type(1) { grid-area: 2/1; }
        & button:nth-of-type(2) { grid-area: 1/2; }
        & button:nth-of-type(3) { grid-area: 2/2; }
        & button:nth-of-type(4) { grid-area: 3/2; }
        & button:nth-of-type(5) { grid-area: 2/3; }
    }

    button.knop {
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        background: var(--color-stone);
        border: 3px solid var(--color-stone-dark);
        color: var(--color-stone-dark);
        box-shadow:
            inset 2px 2px 0 var(--color-stone),
            inset -2px -2px 0 var(--color-stone-dark); /* BRON: Claude 'ik krijg de radio button niet gestijld, kan je me helpen?' */
        cursor: pointer;
    }
 
    button.knop:hover {
        transform: scale(1.1);
    }
 
    button.knop:focus {
        background: var(--color-grass);
        border-color: var(--color-grass-dark);
        color: var(--color-text);
        box-shadow:
            inset 2px 2px 0 var(--color-grass),
            inset -2px -2px 0 var(--color-grass-dark);
    }

    /* disable fieldsets 2, 3, 4 als geen bloem geplant */
    fieldset:nth-of-type(2),
    fieldset:nth-of-type(3),
    fieldset:nth-of-type(4) {
        opacity: 0.4;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    html:has(#geplant:checked) fieldset:nth-of-type(2),
    html:has(#geplant:checked) fieldset:nth-of-type(3),
    html:has(#geplant:checked) fieldset:nth-of-type(4) {
        opacity: 1;
        pointer-events: auto;
    }
}
 
/* THEMES - kleur en themawisselingen van de control panel */
@layer themes {

    /* bloem: blauw */
    html:has(#blauw:checked) cube {
        --f1-light-red: rgb(100, 149, 237);
        --f1-red:       rgb(30, 90, 180);
        --f1-dark-red:  rgb(10, 40, 120);
    }
 
    /* bloem: geel */
    html:has(#geel:checked) cube {
        --f1-light-red: rgb(255, 230, 80);
        --f1-red:       rgb(220, 170, 0);
        --f1-dark-red:  rgb(150, 100, 0);
    }
 
    /* nacht thema */
    html:has(#nacht:checked) {
        --color-sky:        #0d1b2a;
        --color-grass:      #1a3a22;
        --color-grass-dark: #0d2212;
        --color-dirt:       #3a2510;
        --color-dirt-dark:  #1e1208;
        --color-dirt-light: #5a3820;
        --color-stone:      #444;
        --color-stone-dark: #222;
    }
 
    html:has(#nacht:checked) body {
        background: linear-gradient(rgb(30, 50, 90) 0%, rgb(50, 70, 120) 45%, rgb(30, 60, 30) 60%, rgb(25, 55, 25) 60%, rgb(20, 45, 20) 100%);
    }

    html:has(#nacht:checked) main div.sun {
        background: rgb(200, 200, 255);
        box-shadow: rgba(200, 200, 255, 0.55) 0px 0px 60px 20px;
    }
 
    html:has(#nacht:checked) main .pot {
        --pot-light: rgb(150, 63, 28);
        --pot-mid:   rgb(114, 43, 12);
        --pot-dark:  rgb(58, 23, 8);
    }
    html:has(#regenboog:checked) .rainbow {
        opacity: 0.5;
    }

    html:has(#regenboog:checked) .rainbow div {
        animation: fadeIn 0.3s ease forwards;
        opacity: 0;
    }
    
    html:has(#regenboog:checked) .rainbow .rood { background: rgb(255, 80, 80); }
    html:has(#regenboog:checked) .rainbow .oranje { background: rgb(255, 160, 40); }
    html:has(#regenboog:checked) .rainbow .geel { background: rgb(255, 220, 40); }
    html:has(#regenboog:checked) .rainbow .groen { background: rgb(80, 200, 80); }
    html:has(#regenboog:checked) .rainbow .blauw { background: rgb(60, 160, 220); }
    html:has(#regenboog:checked) .rainbow .paars { background: rgb(120, 80, 200); }
    /* BRON: Claude 'geef mij regenboog kleuren voor een minecraft regenboog, kleuren rood oranje geel groen blauw paars in css' */

    html:has(#regenboog:checked) .rainbow .rood   { animation-delay: 1.4s; }
    html:has(#regenboog:checked) .rainbow .oranje { animation-delay: 1.1s; }
    html:has(#regenboog:checked) .rainbow .geel   { animation-delay: 0.8s; }
    html:has(#regenboog:checked) .rainbow .groen  { animation-delay: 0.6s; }
    html:has(#regenboog:checked) .rainbow .blauw  { animation-delay: 0.4s; }
    html:has(#regenboog:checked) .rainbow .paars  { animation-delay: 0.2s; }

    @keyframes fadeIn {
        to { opacity: 1; }
    }
}
 
/* UTILITIES - responsive overrides */
@layer utilities {

    /* Normaal Mobile first onwerpen maar deze functie hoeft alleen op mobiel gebruikt te worden!!  */
    @media (max-width: 599px) {
        aside {
            position: fixed;
            right: 0;
            top: 0;
            height: 100dvh;
            width: 14rem;
            z-index: 10;
            transform: translateX(90%);
            transition: transform 0.3s ease;
        }

        aside.open {
            transform: translateX(0);
        }

        #aside-toggle {
            position: absolute;
            left: -2.5rem;
            top: 10%;
            transform: translateY(-50%);
            width: 2.5rem;
            height: 4rem;
            background: var(--color-dirt);
            border: none;
            color: var(--color-text);
            box-shadow:
                inset 4px 0 0 var(--color-dirt-light),
                -6px 0 0 var(--color-dirt-dark);
        }
        /* Geinspireerd op header nav van portfolio */
    }

    /* Desktop */
    @media (min-width: 600px) {
        .rainbow {
            top: 100px;
            grid-template-columns: repeat(16, 1.6rem);
            grid-template-rows: repeat(9, 1.6rem);
        }

        #aside-toggle {
            display: none;
        }
    }

    @media (min-width: 800px) {
        .rainbow {
            top: 0px;
            grid-template-columns: repeat(16, 2.2rem);
            grid-template-rows: repeat(9, 2.2rem);
        }

        section {
            --s: 2.5em;
        }
    }

    @media (min-width: 1200px) {
        .rainbow {
            grid-template-columns: repeat(16, 2.7rem);
            grid-template-rows: repeat(9, 2.7rem);
        }

        section {
            --s: 3em;
        }
    }
}