* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root { 
    --color-blue: #264653;
    --color-green: #2a9d8f;
    --color-yellow: #e9c46a;
    --color-orange: #f4a261;
    --color-red: #e76f51;
    --color-white: #fcfcfc;
    --color-light-grey: #26465328;
    --shadow-color: rgba(0, 0, 0, 0.29);

    --font-title: 'Grotesk';
    --font-text: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

input[type="number"] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* KEYFRAME */

@keyframes appear {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake-fade {
    /* 1. Secousse forte (début) */
    0% { transform: rotate(0deg); }
    10% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    
    /* 2. Secousse moyenne */
    30% { transform: rotate(8deg); }
    40% { transform: rotate(-8deg); }
    
    /* 3. Secousse faible */
    50% { transform: rotate(6deg); }
    60% { transform: rotate(-6deg); }
    
    /* 4. Micro-secousse */
    70% { transform: rotate(3deg); }
    80% { transform: rotate(-3deg); }
    
    /* 5. Stabilisation (fin) */
    90% { transform: rotate(1deg); }
    100% { transform: rotate(0deg); }
}

@keyframes dice-pop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* GENERAL */

html {
    height: 100%;
}

body {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
}

/* HEADER */
header {
    /* position */
    width: 100%;
    height: auto;
    padding: 1rem;
    /* display */
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* other */
    box-shadow: 3px 17px 18px -11px var(--shadow-color);
    -webkit-box-shadow: 3px 17px 18px -11px var(--shadow-color);
    -moz-box-shadow: 3px 17px 18px -11px var(--shadow-color);
    /* color */
    background-color: var(--color-blue);
}

h1 {
    font-family: var(--font-title);
    font-weight: 400;
    font-size: 2.5rem;
    color: var(--color-white);
}

/* MAIN */
main {
    width: 100%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}


/* MODE SELECTION */
.numberGenerator__modeContainer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.numberGenerator__modeButton {
    padding: 0.5rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
    font-family: var(--font-text);
    transition: all 0.2s ease-out;
    cursor: pointer;
    /* color */
    background-color: var(--color-white);
}
.numberGenerator__modeButton--blue {
    color: var(--color-blue);
    border-color: var(--color-blue);
}
.numberGenerator__modeButton--blue:hover,
.numberGenerator__modeButton--blue.active {
    background-color: var(--color-blue);
    color: var(--color-white);
}
.numberGenerator__modeButton--yellow {
    color: var(--color-green);
    border-color: var(--color-green);
}
.numberGenerator__modeButton--yellow:hover,
.numberGenerator__modeButton--yellow.active {
    background-color: var(--color-green);
    color: var(--color-white);
}
.numberGenerator__modeButton--red {
    color: var(--color-red);
    border-color: var(--color-red);
}
.numberGenerator__modeButton--red:hover,
.numberGenerator__modeButton--red.active {
    background-color: var(--color-red);
    color: var(--color-white);
}

/* SECTION MODE */
.numberGenerator__sectionMode {
    flex: 1;
    max-width: 800px;
    width: 100%;
    display: none;
}
.numberGenerator__sectionMode.active {
    display: block;
}



/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒           NUMBER           ▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* Parameter container */
.numberGenerator__sectionNumberMode {
    height: auto;
}
.numberGenerator__sectionNumberMode .numberGenerator__parameterContainer {
    display: grid;
    grid-template-areas:
        "labelMin"
        "inputMin"
        "labelMax"
        "inputMax";
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}
/* Number Input */
/* label */
.numberGenerator__sectionNumberMode .numberGenerator__numberMinLabel {
    grid-area: labelMin;
    margin: auto;
    font-family: var(--font-text);
    font-size: 1.5rem;
}
.numberGenerator__sectionNumberMode .numberGenerator__numberMaxLabel {
    grid-area: labelMax;
    margin: auto;
    font-family: var(--font-text);
    font-size: 1.5rem;
}
/* input */
.numberGenerator__sectionNumberMode .numberGenerator__numberMinInput {
    grid: inputMin;
    display: inline-flex;

    border-radius: 0.5rem;
    border: 2px solid var(--color-light-grey);
}
.numberGenerator__sectionNumberMode .numberGenerator__numberMaxInput {
    grid: inputMax;
    display: inline-flex;

    border-radius: 0.5rem;
    border: 2px solid var(--color-light-grey);
}
  
.numberGenerator__sectionNumberMode .numberGenerator__numberMinInput button,
.numberGenerator__sectionNumberMode .numberGenerator__numberMaxInput button {
    width: 3rem;
    height: 3rem;
    position: relative;
    margin: 0;
    
    align-items: center;
    justify-content: center;

    outline:none;
    border: none;
    border-radius: 0.3rem 0 0 0.3rem;
    cursor: pointer;
    font-family: var(--font-title);
    font-size: 2rem;
    transition: all 0.2s ease-out;
    
    color: var(--color-green);
    background-color: transparent;
}
.numberGenerator__sectionNumberMode .numberGenerator__numberMinInput button.plus,
.numberGenerator__sectionNumberMode .numberGenerator__numberMaxInput button.plus {
    border-radius: 0 0.3rem 0.3rem 0;
}
.numberGenerator__sectionNumberMode .numberGenerator__numberMinInput button:active,
.numberGenerator__sectionNumberMode .numberGenerator__numberMaxInput button:active {
    background-color: var(--color-light-grey);
}
.numberGenerator__sectionNumberMode .numberGenerator__numberMinInput button:focus,
.numberGenerator__sectionNumberMode .numberGenerator__numberMaxInput button:focus {
    border-color: var(--color-blue);
}
  
.numberGenerator__sectionNumberMode .numberGenerator__numberMinInput input[type=number],
.numberGenerator__sectionNumberMode .numberGenerator__numberMaxInput input[type=number] {
    max-width: 5rem;
    padding: .5rem;
    border: solid var(--color-light-grey);
    border-width: 0 2px;
    font-size: 2rem;
    height: 3rem;
    text-align: center;
    
    font-family: var(--font-text);
    font-weight: 500;
    font-size: 2rem;
}
/* result */
.numberGenerator__sectionNumberMode .numberGenerator__resultContainer {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.numberGenerator__sectionNumberMode .numberGenerator__result {
    font-family: var(--font-title);
    font-size: 6rem;
    color: var(--color-blue);
}
.numberGenerator__sectionNumberMode .numberGenerator__result.animate {
    animation: appear 0.2s ease-out;
}
/* generate */
.numberGenerator__sectionNumberMode .numberGenerator__generateNumberContainer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}
.numberGenerator__sectionNumberMode .numberGenerator__generatebutton {
    padding: 0.5rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
    font-family: var(--font-text);
    transition: all 0.2s ease-out;
    cursor: pointer;
    /* color */
    background-color: var(--color-white);
    color: var(--color-red);
    border-color: var(--color-red);
}
.numberGenerator__sectionNumberMode .numberGenerator__generatebutton:hover {
    background-color: var(--color-red);
    color: var(--color-white);
}
.numberGenerator__sectionNumberMode .numberGenerator__generateText {
    font-family: var(--font-text);
    text-decoration: underline;
    color: var(--color-blue);
    font-style: italic;
}







/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒            DICE            ▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */

.numberGenerator__sectionDiceMode .numberGenerator__parameterContainer {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
}
/* animation parameter */
.numberGenerator__sectionDiceMode .numberGenerator__animationChoiceContainer {
    /* position */
    width: 100%;
    /* display */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
.numberGenerator__sectionDiceMode .numberGenerator__animationChoiceContainer>label {
    font-size: 1.5rem;
    font-family: var(--font-text);
}
.numberGenerator__sectionDiceMode .numberGenerator__animationChoiceContainer input {
    appearance: none;
    background-color: var(--color-white);
    cursor: pointer;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.45rem;
    height: 1.45rem;
    border: 2px solid var(--color-blue);
    border-radius: 0.15rem;
    display: grid;
    place-content: center;
}
.numberGenerator__sectionDiceMode .numberGenerator__animationChoiceContainer input::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--color-blue);
}
.numberGenerator__sectionDiceMode .numberGenerator__animationChoiceContainer input:checked::before {
    transform: scale(1);
}

/* dice choice parameter */
.numberGenerator__sectionDiceMode .numberGenerator__diceChoiceContainer {
    /* position */
    width: 100%;
    /* display */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
.numberGenerator__sectionDiceMode .numberGenerator__diceChoiceContainer>label {
    font-size: 1.5rem;
    font-family: var(--font-text);
}
.numberGenerator__sectionDiceMode .numberGenerator__diceChoiceContainer select {
    font-family: var(--font-text);
}
.numberGenerator__selectDiceContainer>select {
    appearance: none;
    background-color: transparent;
    border: none;
    padding: 0 1em 0 0;
    margin: 0;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    cursor: inherit;
    line-height: inherit;
    z-index: 1;
    outline: none;
    grid-area: select;
}
.numberGenerator__selectDiceContainer>select::-ms-expand {
    display: none;
}
.numberGenerator__selectDiceContainer {
    display: grid;
    grid-template-areas: "select";
    align-items: center;
    position: relative;
    min-width: 15ch;
    max-width: 30ch;
    border: 1px solid var(--color-blue);
    border-radius: 0.25em;
    padding: 0.25em 0.5em;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1.1;
    background-color: #fff;
    background-image: linear-gradient(to top, #f9f9f9, #fff 33%);
}
.numberGenerator__selectDiceContainer::after {
    content: "";
    grid-area: select;
    justify-self: end;
    width: 0.8em;
    height: 0.5em;
    background-color: var(--color-red);
    clip-path: polygon(100% 0%, 0 0%, 50% 100%);
}
.numberGenerator__selectDiceContainer>select:focus + .focus {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 2px solid var(--color-blue);
    border-radius: inherit;
}
.numberGenerator__selectDiceContainer label {
    font-size: 1.125rem;
    font-weight: 500;
}
.numberGenerator__selectDiceContainer + label {
    margin-top: 2rem;
}

/* dice result */
.numberGenerator__sectionDiceMode .numberGenerator__resultContainer {
    max-width: 600px;
    aspect-ratio: 100/80;
    margin: auto;
    position: relative;
}
.numberGenerator__sectionDiceMode .numberGenerator__diceSvg {
    position: absolute;
    width: 100%;
    cursor: pointer;
}
.numberGenerator__sectionDiceMode .numberGenerator__diceSvg.animate {
    animation: shake-fade 0.5s ease-out;
}
.numberGenerator__sectionDiceMode .numberGenerator__diceNumber {
    position: absolute;
    font-family: var(--font-title);
    user-select: none;
    color: var(--color-white);
    transform: translate(-50%, -50%);
}
.numberGenerator__sectionDiceMode .numberGenerator__diceNumber.rolling {
    opacity: 0;
    display: none;
}
.numberGenerator__sectionDiceMode .numberGenerator__diceNumber.animate {
    animation: dice-pop 0.2s ease-out;
}


/* dice generate button */
.numberGenerator__sectionDiceMode .numberGenerator__rollDiceContainer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}
.numberGenerator__sectionDiceMode .numberGenerator__generatebutton {
    padding: 0.5rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
    font-family: var(--font-text);
    transition: all 0.2s ease-out;
    cursor: pointer;
    /* color */
    background-color: var(--color-white);
    color: var(--color-red);
    border-color: var(--color-red);
}
.numberGenerator__sectionDiceMode .numberGenerator__generatebutton:hover {
    background-color: var(--color-red);
    color: var(--color-white);
}
.numberGenerator__sectionDiceMode .numberGenerator__generateText {
    font-family: var(--font-text);
    text-decoration: underline;
    color: var(--color-blue);
    font-style: italic;
}







/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒           OTHER            ▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */
/* ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ */

.numberGenerator__sectionOtherMode .numberGenerator__parameterContainer {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
}

.numberGenerator__sectionOtherMode .numberGenerator__otherTextContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.numberGenerator__sectionOtherMode .numberGenerator__otherTextLabel {
    font-size: 1.5rem;
    font-family: var(--font-text);
}

.numberGenerator__sectionOtherMode .numberGenerator__otherTextInput {
    
}





























/* RESPONSIVE */

@media (min-width: 800px) {
    h1 {
        font-size: 4rem;
    }
    /* NUMBER */
    .numberGenerator__sectionNumberMode .numberGenerator__parameterContainer {
        grid-template-areas:
            "labelMin labelMax"
            "inputMin inputMax";
        gap: 2rem;
    }

    
    /* DICE */
    .numberGenerator__sectionDiceMode .numberGenerator__diceChoiceContainer {
        flex-direction: row;
    }
    .numberGenerator__sectionDiceMode .numberGenerator__animationChoiceContainer {
        flex-direction: row;
    }

    /* OTHER */
    .numberGenerator__sectionOtherMode .numberGenerator__otherTextContainer {
        flex-direction: row;
    }

}