:root {
    --size: auto;
    /* 600px */
    --fsize: calc(0.25vw + 0.25vh + 1vmin);
    --bg-color: #f7f0de;
    --bold-color: #541003;
    --accent-color: #09405e;
    --text-color: #151400;
    --bg-alpha: rgba(247, 240, 222, 0.95);
    font-size: calc(2 * var(--fsize));
}

body {
    font-family: sans-serif;
    margin: 0;
    color: var(--text-color);
    background: var(--bg-color);
}

body.modal {
    overflow: hidden;
}

a {
    color: #000;
}

a:focus,
input:focus {
    outline: 4px solid rgba(255, 255, 0, 0.7);
    outline-offset: 4px;
}

#loading {
    text-align: center;
    margin: 1em 0;
    font-size: 2em;
}

#wrap {
    margin: 0 0;
}

#header {
    position: sticky;
    top: 0;
    height: 100%;
    z-index: 10;
    margin: 0 auto;
    width: var(--size);
    background: var(--bg-alpha);
}

h1 {
    font-size: 3rem;
    opacity: 1;
    margin: 0 0.5rem;
    padding: 1rem 0 1rem 0;
    font-variant: small-caps;
    letter-spacing: -2px;
    text-decoration: none;
}

h1 a {
    display: inline-block;
    color: var(--bold-color);
    text-decoration: none;
}

h1 .outline {
    background: var(--accent-color);
    color: var(--bg-color);
    border-radius: 0.2em;
    padding: 0 0.2em 0 0.1em;
    margin-left: 0.1em;
}

h1 .outline span {
    display: inline-block;
}

h1 a::first-letter,
h1 a .outline span::first-letter {
    display: inline-block;
    margin-right: -0.05em;
}

h1 a:hover .triangle {
    animation-name: weee;
    animation-duration: 0.5s;
}

h1 svg.triangle {
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
}

h1 svg.triangle polygon {
    fill: var(--bg-color);
}

@keyframes weee {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}

/* https://dev.to/emmaadesile/how-to-create-a-hamburger-menu-icon-with-css-and-javascript-1kgd */

.menu-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.menu-icon {
    display: grid;
    place-items: center;
    height: 3.3em;
    width: 3em;
    position: relative;
    cursor: pointer;
}

.menu-icon>span {
    width: 3em;
    height: 0.4em;
    background: var(--bold-color);
    display: block;
    transition: all 0.3s ease-in-out;
}

.menu-icon:hover span:nth-child(1) {
    width: 1.8em;
}

.menu-icon:hover span:nth-child(2) {
    width: 2.2em;
}

.menu_active .menu-icon span:nth-child(1) {
    transform-origin: center center;
    transform: rotate(-45deg) translate(-0.74em, 0.7em);
    width: 3.3em;
}

.menu_active .menu-icon span:nth-child(2) {
    transform: translateX(0.6em);
    opacity: 0;
}

.menu_active .menu-icon span:nth-child(3) {
    transform-origin: center center;
    transform: rotate(45deg) translate(-0.9em, -0.84em);
    width: 3.3em;
}

.menu-icon .line-1 {
    width: 2.2em;
    justify-self: end;
}

.menu-icon .line-2 {
    width: 1.8em;
    justify-self: end;
}


/* https://css-tricks.com/solved-with-css-dropdown-menus/ */

#menu {
    margin: 0;
    list-style: none;
    padding: 0;
    display: none;
    position: fixed;
    top: 5rem;
    bottom: 0;
    left: 0;
    right: 0;
    overflow-y: scroll;
    background: var(--bg-alpha);
    font-size: 1.5rem;
}

.menu_active #menu {
    display: block;
}

#menu .menu_checkbox {
    display: flex;
}

#menu .menu_checkbox input[type="checkbox"] {
    width: 0.7rem;
    height: 0.7rem;
    margin-right: 0.5rem;
}

#menu a,
#menu label {
    cursor: pointer;
    color: var(--bold-color)
}

#menu>li {
    list-style: none;
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0);
    position: relative;
    transition-duration: 0.5s;
    z-index: 20;
}

#menu li>* {
    color: #000;
    text-decoration: none;
    padding: 1rem;
    display: block;
}

#menu li ul a {
    text-decoration: none;
}

#menu>li>a {
    font-weight: bold;
}

#menu>li>a::before {
    content: " ";
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
    line-height: 0.75em;
    margin-right: 0.25em;
}

#menu>li.submenus>a[href='#']::before {
    transition: transform 0.1s ease-in-out;
    /* /static/triangle.svg */
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='100,50 25,6.7 25,93.3' /%3E%3C/svg%3E");
    display: inline-block;
}

#menu li:hover,
#menu li:focus-within {
    cursor: pointer;
    border: 1px solid #000;
}

/* #menu li:focus-within a {
    outline: none;
} */

#menu li ul {
    margin: 0;
    padding: 0;
    list-style: none;
    visibility: hidden;
    transition: all 0.5s ease;
    display: none;
}

#menu li ul li {
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0);
    background: var(--bg-alpha);
    border-left-color: #000;
    border-right-color: #000;
}

#menu li ul li:first-child {
    border-top-color: #000;
}

#menu li ul li:last-child {
    border-bottom-color: #000;
}

#menu li ul li.hr {
    box-sizing: border-box;
    border: 1px solid rgb(122, 122, 122);
    border-width: 1px 0 0 0;
    background: rgba(255, 255, 255, 0.95);
}

#menu li.active_hover>ul,
#menu li.active_click>ul {
    visibility: visible;
    display: block;
    transition-duration: 0.5s;
}

#menu>li.active_hover>a[href='#']::before,
#menu>li.active_click>a[href='#']::before {
    transform: rotate(90deg);
}

/* select all/none */
#menu li #channels li>span,
#menu li #channels li label {
    padding: 0.5rem;
    position: relative;
    padding-left: 3em;
    color: #999;
}

#menu li #channels li>a:hover,
#menu li #channels li.checked label {
    color: #000;
}

#channels input {
    position: absolute;
    left: 1rem;
    top: calc(50% - 0.75em);
    height: 1.5em;
    width: 1.5em;
    display: inline-block;
    margin: 0;
}

#channels img {
    left: 1rem;
    top: calc(50% - 0.75em);
    height: 1.5em;
    width: 1.5em;
    position: absolute;
    filter: grayscale(80%);
}

#channels .checked img,
#channels li:hover img {
    filter: unset;
    opacity: 1;
}

#content {
    width: var(--size);
    margin: 0 auto 0 auto;
    position: relative;
}

#videos {
    padding-bottom: 100%;
    margin: 0 1rem;
}

#videos .video {
    margin: 0 0.5rem 2rem 0.5rem;
    position: relative;
    padding: 0.25rem;
    box-shadow: 0.1rem 0.1rem 0.25rem black;
    transition: all 0.5s;
}

#videos .activevid {
    box-shadow: 0.5rem 0.5rem 1.2rem black;
}

#videos .video.expanded {
    overflow: visible;
    min-height: 184px;
    height: auto;
}

#videos h2 {
    margin: 0 0 1em 0;
    text-align: center;
    color: var(--bold-color);
    border: 6px double var(--accent-color);
    border-width: 6px 0;
}

#videos .thumb {
    border: 2px solid #000;
    display: block;
    margin: 0 auto;
    width: 80%;
    height: calc(80vw * 9 / 16);
}

#videos h3 {
    display: flex;
    margin: 0 0 0.25em 0;
    padding: 0;
    font-size: 1em;
}

.vid_link {
    font-size: 1.17em;
}

#videos h3 a {
    text-decoration: none;
}

.vid_ch_logo {
    flex: 0;
    margin-right: 0.5rem;
}

.vid_ch_logo img {
    max-width: 3em;
    max-height: 3em;
    display: inline-block;
}

.vid_desc {
    flex: 10;
}

.channel_subscribe {
    flex: 0;
    font-weight: bold;
    font-size: 0.7em;
    padding: 0.8em 1em;
    margin: 0 0 0 0.5rem;
    border-radius: 0.3em;
    color: white;
    background: #900;
    text-transform: uppercase;
    height: 1em;
    line-height: 1em;
}

#videos h3 .date {
    color: #666;
    margin-left: 0.5em;
}

#videos p {
    display: none;
    margin: 0;
}

#videos .video.expanded p {
    display: block;
}

#videos .showmoreless {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 0.3em;
    padding: 0.8em 1em;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.7em;
    text-transform: uppercase;
    border: 1px solid var(--bg-color);
}

#videos .video:hover a.channel_subscribe {
    background: #f00;
    color: #fff;
}

#modal {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99;
}

#modal .play {
    display: none;
}

#modal.paused .paws {
    display: none;
}

#modal.paused .play {
    display: inline;
}

#player_wrap {
    position: absolute;
    top: 2vh;
    left: 5vw;
    right: 5vw;
    bottom: 8vh;
    z-index: 100;
}

/* Safari workaround */
#modal.fullscreen:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

#modal.fullscreen #player_wrap {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#player_iframe {
    width: 100%;
    padding: 0;
    margin: 0;
}

#modal iframe {
    width: 100%;
    height: 100%;
    margin: 0;
}

#player_controls {
    position: absolute;
    right: 5vw;
    bottom: 1vh;
    color: white;
    text-align: right;
    z-index: 101;
    font-size: 5vh;
}

#modal.fullscreen #player_controls {
    display: none;
    top: calc(50vh - 0.5em);
    left: 0;
    right: 0;
    background: black;
    font-size: 8vw;
    text-align: center;
    height: 1em;
    filter: opacity(0.5);
}

#modal.fullscreen.paused #player_controls {
    display: block;
}

#player_controls .material-icons {
    font-size: inherit;
    cursor: pointer;
}

#modal.fullscreen #player_controls .material-icons {
    margin: 0 0.4em;
}

#modal #form {
    display: none;
    position: absolute;
    top: 5vh;
    height: 0;
    left: 10vh;
    right: 10vh;
    max-width: 40em;
    margin: 0 auto;
    padding: 0 2em;
    background: rgba(247, 240, 222, 0.95);
}

#modal.form #player_controls, #modal.form #player_wrap {
    display: none;
}

#modal.form #form {
    display: block;
    bottom: 5vh;
    height: auto;
    overflow-y: scroll;
    overflow-x: clip;
}

#form label, #form p {
    display: flex;
    padding: 1em;
    border-top: 1px solid #000;
}

#form label {
    cursor: pointer;
}

#form h2 + label, #form h2 + p {
    border-top: 0;
}

#form label span {
    flex-grow: 20;
}

#form label input {
    margin: 0 2em;
}

#form p {
    margin: 0;
}

#form p span.label {
    vertical-align: middle;
    line-height: 24px;
    flex-grow: 20;
    margin: 0;
}

#form p .delete_profile, #form p .rename_profile {
    margin: 0 0 0 0.5em;
    cursor: pointer;
}

#form input[type=text], #form select {
    width: 15em;
    box-sizing: border-box;
}

#form h3 {
    margin-bottom: 0;
    font-size: 1em;
}

#form .action_response {
    padding: 0.5em;
}

@media only screen and (min-width: 62rem) {
    /* 992px */
     :root {
        font-size: 16px;
        --size: 56rem;
        /* 896px */
    }
    .menu-button {
        display: none;
    }
    #menu {
        overflow: visible;
        display: block;
        position: absolute;
        height: 3.5rem;
        top: auto;
        left: auto;
        bottom: 0;
        right: 0;
        font-size: 1rem;
        text-align: right;
        background: transparent;
    }
    #menu>li {
        display: inline-block;
        text-align: left;
    }
    #menu>li>a::before {
        display: none;
    }
    #menu li a#channel_dropdown {
        display: none;
    }
    #menu li ul {
        min-width: 15rem;
        position: absolute;
        top: calc(3rem + 2px);
        left: -1px;
        height: auto;
    }
    #menu li.active_hover>ul {
        visibility: visible;
        display: block;
        transition-duration: 0.5s;
    }
    #menu:first-child {
        display: none;
        border: none !important;
    }
    #menu li ul#channels {
        position: fixed;
        top: 5rem;
        bottom: 0;
        left: 50%;
        margin-left: calc(var(--size) / -2);
        width: 12.5rem;
        /* 200px */
        overflow-y: scroll;
        visibility: visible;
        height: auto;
        display: block;
        opacity: 1;
        background: transparent;
        border: 0;
        z-index: 50;
    }
    #menu #channels li {
        border: 0;
    }
    #videos {
        margin: 0 1rem 0 16rem;
        /* 240px; */
    }
    #videos .video {
        padding-left: 340px;
        height: 184px;
        overflow: hidden;
        margin-left: 5px;
    }
    #videos .thumb {
        position: absolute;
        left: 5px;
        top: 5px;
        width: 320px;
        height: 180px;
    }
    #videos p {
        display: block;
    }
}

@media only screen and (min-width: 80rem) {
    /* 1280px */
     :root {
        --size: 75rem;
        /* 1200px */
    }
}