@font-face {
    font-family: 'Win95';
    src: url('/media/fonts/W95FA.otf');
    font-weight: normal;
    font-style: normal;
}

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

html {
    font-size: clamp(14px, 1.2vw + 8px, 18px);
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2%;
    min-height: 100vh;
    max-height: 100vh;
    background-image: url(/media/images/whiteboard/bliss.jpg);
    background-size: cover;
    background-position: center;
    overflow-x: hidden;
}

@media screen and (min-width: 700px) {
    body {
        overflow: hidden;
    }
}

.whiteboard-container {
    width: 100%;
    max-width: 1600px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 20px;
    background: linear-gradient(180deg, rgba(5, 131, 250, 1) 0%, #081BCB 10%, #0062EA 100%);
    box-shadow: inset 0.1em 0.1em 0em 0 #0062EA, inset -0.1em -0.1em 0em 0 #0062EA;
    width: 100%;
    padding: 0.5em 1em;
    margin: 0;
    border-radius: 10px 10px 0px 0px;
    user-select: none;
}

h1 {
    color: #EBEBEE;
    font-size: clamp(1.2em, 4vw, 2em);
    text-shadow: rgba(0, 0, 0, 0.5) 2px 2px;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    white-space: nowrap;
}

button {
    font-family: Win95;
    padding: 5px;
    font-size: 1em;
    cursor: pointer;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    gap: 10px;
    box-shadow: inset 0.4em 0.4em 0em 0 #0062EA, inset -0.4em -0em 0em 0 #081BCB, inset -0em -1px 0em 0 grey;
    background-color: #E6EAD8;
    padding: 10px;
    padding-bottom: 5px;
}

.icon {
    width: 2em;
    height: 2em;
    max-width: 32px;
    max-height: 32px;
}

.tool {
    padding: 0;
    flex: 0 0 auto;
}

.tool:active,
.tool:focus,
.tool:default,
.tool:hover {
    box-shadow: inset 0.1em 0.1em 0em 0 #E68B2C, inset -0.1em -0.1em 0em 0 #E68B2C;
}

input[type="color"] {
    width: 2.7em;
    height: 2.8em;
    min-width: 38px;
    min-height: 38px;
}

input[type="color"],
input[type="range"] {
    cursor: pointer;
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.context {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
}

.undo {
    font-weight: bolder;
    font-size: 1em;
    min-width: 35px;
    min-height: 38px;
    padding-right: 2px;
}

.back {
    background: linear-gradient(150deg, #CCFFCC 0%, #99FF66 20%, #66CC33 50%, #009900 90%);
    color: white;
    border: #006600 solid 1px;
    padding: 0;
    padding-top: 3px;
    border-radius: 50px;
    height: 40px;
    width: 40px;
    cursor: pointer;
}

.back:hover {
    background: linear-gradient(150deg, #CCFFCC 0%, #99FF66 30%, #66CC33 60%, #009900 100%);
}

.home {
    padding: 1px;
    background: linear-gradient(150deg, rgba(5, 131, 250, 1) 0%, #0062EA 10%, #081BCB 100%);
    color: white;
    border: white solid 1px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
}

.home:hover {
    background: linear-gradient(150deg, rgba(5, 131, 250, 1) 30%, #0062EA 60%, #081BCB 100%);
}

.clear {
    background: linear-gradient(150deg, rgba(255, 120, 105, 1) 0%, rgba(192, 57, 43, 1) 60%);
    color: white;
    border: white solid 1px;
    border-radius: 5px;
    font-size: 1em;
    padding: 5px 7px;
    font-weight: bolder;
    cursor: pointer;
    white-space: nowrap;
}

.clear:hover {
    background: linear-gradient(150deg, rgba(255, 120, 105, 1) 30%, rgba(192, 57, 43, 1) 100%);
}

.save {
    background: none;
    border: none;
    padding: 10px;
}

.save:hover {
    border: 1px solid rgba(0, 0, 0, 0.5);
    box-shadow: rgba(0, 0, 0, 0.5) 2px 2px;
}

#whiteboard {
    width: 100%;
    height: 94%;
    max-height: 80vh;
    flex: 1 1 auto;
    background-color: white;
    cursor: crosshair;
    touch-action: none;
    box-shadow: inset 0.4em 0em 0em 0 #0062EA, inset -0.4em -0.4em 0em 0 #081BCB;
    border: none;
    margin-bottom: 0;
    font-size: 15px;
    font-family: Win95;
    width: 100%;

    >span {
        padding: 0 10px 0 10px;
    }
}

img {
    width: 1.6em;
    height: 1.6em;
    max-width: 32px;
    max-height: 32px;
}

/**************slide section**************/

input[type=range] {
    -webkit-appearance: none;
    width: 10vw;
    min-width: 80px;
    max-width: 160px;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
}

input[type=range]:focus {
    box-shadow: inset 0.1em 0.1em 0em 0 #E68B2C, inset -0.1em -0.1em 0em 0 #E68B2C;
}

input[type=range]::-ms-track {
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    color: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    border-top: 5px solid #13920D;
    border-bottom: 5px solid #13920D;
    border-radius: 2px;
    height: 2em;
    width: 1em;
    cursor: pointer;
    background: #ffffff;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1) 70%, rgba(166, 166, 166, 1) 100%);
    clip-path: polygon(0% 0%, 100% 0, 100% 80%, 50% 100%, 0 80%);
    margin-top: -0.5em;
}

input[type=range]::-moz-range-thumb {
    border-top: 5px solid #13920D;
    border-bottom: 5px solid #13920D;
    height: 2em;
    width: 1em;
    cursor: pointer;
    background: #ffffff;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1) 70%, rgba(166, 166, 166, 1) 100%);
    clip-path: polygon(0% 0%, 100% 0, 100% 80%, 50% 100%, 0 80%);
}

input[type=range]::-ms-thumb {
    border-top: 5px solid #13920D;
    border-bottom: 5px solid #13920D;
    height: 2em;
    width: 1em;
    cursor: pointer;
    background: #ffffff;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1) 70%, rgba(166, 166, 166, 1) 100%);
    clip-path: polygon(0% 0%, 100% 0, 100% 80%, 50% 100%, 0 80%);
}


input[type=range]::-webkit-slider-runnable-track {
    height: 0.4em;
    cursor: pointer;
    background: white;
    border-radius: 10px;
    box-shadow: inset 1px 1px 1px rgba(166, 166, 166, 1), 0px 0px 1px rgba(166, 166, 166, 1);
}

input[type=range]:focus::-webkit-slider-runnable-track {
    background: white;
}

input[type=range]::-moz-range-track {
    height: 0.4em;
    cursor: pointer;
    background: white;
    border-radius: 10px;
    box-shadow: inset 1px 1px 1px rgba(166, 166, 166, 1), 0px 0px 1px rgba(166, 166, 166, 1);
}

input[type=range]::-ms-track {
    height: 0.4em;
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    border-width: 16px 0;
    color: transparent;
}

input[type=range]::-ms-fill-lower {
    background: white;
    border-radius: 10px;
    box-shadow: inset 1px 1px 1px rgba(166, 166, 166, 1), 0px 0px 1px rgba(166, 166, 166, 1);
}

input[type=range]:focus::-ms-fill-lower {
    background: white;
}

input[type=range]::-ms-fill-upper {
    background: white;
    border-radius: 10px;
    box-shadow: inset 1px 1px 1px rgba(166, 166, 166, 1), 0px 0px 1px rgba(166, 166, 166, 1);
}

input[type=range]:focus::-ms-fill-upper {
    background: white;
}

@media (max-width: 900px) {
    .whiteboard-container {
        height: 92vh;
    }

    header {
        padding: 0.5em 0.8em;
    }

    .toolbar {
        gap: 6px;
        padding: 8px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 3vw;
    }

    .whiteboard-container {
        height: 90vh;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4em;
        border-radius: 8px 8px 0 0;
    }

    h1 {
        font-size: 1.3em;
    }

    .toolbar {
        justify-content: center;
        gap: 6px;
        padding: 6px;
    }

    img {
        width: 1.6em;
        height: 1.6em;
        max-width: 26px;
        max-height: 26px;
    }

    input[type="color"] {
        width: 2.2em;
        height: 2.2em;
        min-width: 32px;
        min-height: 32px;
    }

    input[type=range] {
        width: 20vw;
        min-width: 60px;
    }

    .back,
    .clear {
        font-size: 0.85em;
        padding: 4px 6px;
    }
}


@media (max-width: 420px) {
    html {
        font-size: 14px;
    }

    header {
        border-radius: 6px 6px 0 0;
    }

    .toolbar {
        gap: 4px;
        padding: 4px;
    }

    img {
        width: 1.3em;
        height: 1.3em;
        max-width: 22px;
        max-height: 22px;
    }

    input[type=range] {
        width: 28vw;
        min-width: 50px;
    }
}

@media (max-height: 500px) {
    .whiteboard-container {
        height: 96vh;
    }

    header,
    .toolbar {
        padding: 4px 8px;
    }

    h1 {
        font-size: 1.1em;
    }
}