:root {
    --color-fg:             #d9d4cf;
    --color-bg:             #3c3c3c;
    --color-fg-highlight:   #fffaf5;
    --color-bg-highlight:   #575757;
    --color-border:         #000000;
    --color-shadow:         #000000;

    --color-palette-red:    #c26161;
    --color-palette-green:  #a5c261;
    --color-palette-yellow: #ffc66d;
    --color-palette-blue:   #6d9cbe;
    --color-palette-purple: #9e6dbe;
    --color-palette-orange: #be896d;
    --color-palette-black:  #000000;

    --font-size: 16px;
    --line-height: 22px;
    --font-family: "IBM Plex Sans", sans-serif;
}


/* DEFAULTS */

html, body, .backdrop, .container, div, span, ul, li {
    margin: 0;
    padding: 0;
}

body, input {
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: var(--line-height);
    color: var(--color-fg);
}

.player, .listing, .controls {
    background-color: var(--color-bg);
    user-select: none;
}

.player {
    background-color: var(--color-palette-black);
}

h2 { margin-top: 0; }
a { color: var(--color-fg-highlight); }
a:hover { color: var(--color-fg); }


/* STRUCTURE */

.backdrop {
    position:fixed;
    width: 100%;
    height: 100%;
}

.logo {
    display: none;
}

.container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
}

.column {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.player {
    position: relative;
    flex: 1 1 auto;
}

.controls {
    flex: 0 0 auto;
    height: 38px;
    border-top: 2px solid var(--color-bg-highlight);
}

.listing {
    position: absolute;
    top: 0;
    right: 0;
    height: calc(100% - 40px);
    width: 300px;
    overflow: auto;
    opacity: .9;
}

.listing.collapsed { right: -300px; }


/* VIEWERS */

.viewer, ruffle-player{
    position:absolute;
    width: 100%;
    height: 100%;
}

.player .intro {
    display:flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 32px;
    text-align: center;
    font-size: 1.5rem;
    line-height: 1.5rem;
    vertical-align: middle;
}

.player .audio {
    width: 100%;
    height: auto;
    bottom: 0;
}

.player .options {
    box-sizing: border-box;
    padding: 40px;
    background-color: var(--color-bg);
    opacity: .9;
}

.player .loader {
    background: url("../img/stripes-gray3.webp") repeat;
    background-position-x: 0px;
    animation: loader .5s linear infinite;
}

.player .video, .player .image { object-fit: contain; }
.player.cover .video, .player.cover .image { object-fit: cover; }
.player.fill .video, .player.fill .image { object-fit: fill; }

@keyframes loader {
    0% {background-position-x: 0px;}
    100% {background-position-x: 25px;}
}


/* COMPONENTS */

ul { list-style: none; }
.listing ul { overflow: auto; }
.controls ul { display: flex; }
.options-header ul {
    height: 38px;
    text-align: right;
}
.options .options-header {
    display: flex;
    justify-content: space-between;
}

ul li, label{
    padding: 8px 24px;
    word-break: break-word;
    text-align: center;
}
ul li:not(.spacer), label { cursor: pointer; }
ul li:not(.spacer):hover, label:hover { background-color: var(--color-bg-highlight); }
.listing ul li {
    padding: 16px;
    text-align: left;
}
.controls ul li {
    text-align: center;
    padding: 8px 0;
    flex: 0 1 auto;
    width: 50px;
}
.controls ul li.spacer {
    flex: 1 1 auto;
    min-width: 0px;
    width: 0px; /*Weird fix for range input sizing issues*/
}
.options-header ul li { display:inline-block; }
.options label {
    display: inline-block;
    padding: 8px 0;
    min-width: 120px;
    box-sizing: border-box;
}

.listing ul li.active {
    padding-left: 11px;
    background-color: var(--color-bg-highlight);
    border-left: 5px solid;
}
.listing ul li[data-type=video].active { border-left-color: var(--color-palette-yellow); }
.listing ul li[data-type=audio].active { border-left-color: var(--color-palette-red); }
.listing ul li[data-type=image].active { border-left-color: var(--color-palette-green); }
.listing ul li[data-type=flash].active { border-left-color: var(--color-palette-purple); }
.options-header ul li.active { background-color: var(--color-bg-highlight); }

.listing ul li span {padding-right: 5px;}
.listing ul li[data-type=video] span { color: var(--color-palette-yellow); }
.listing ul li[data-type=audio] span { color: var(--color-palette-red); }
.listing ul li[data-type=image] span { color: var(--color-palette-green); }
.listing ul li[data-type=flash] span { color: var(--color-palette-purple); }

.controls ul li .seeker {
    display: block;
    width: 100%;
    appearance: none;
    outline: none;
    background-color: var(--color-bg-highlight);
    height: 6px;
}

.options table { width: 100%; }
.options table tr td:first-child { max-width: 180px; }

.options input[type=radio] { display: none;}
#tab-options input[type=radio]:checked + label {
    background-color: var(--color-bg-highlight);
    border-left: 5px solid var(--color-fg-highlight);
}


/* UTILITY */

.desktop { display: none !important; }
.hide { display: none !important; }


/* MEDIA QUERIES */

@media only screen and (min-width: 1200px) and (min-height: 540px) {

    .backdrop {
        display: flex;
        justify-content: center;
        align-items: center;
        background-image: url("../img/congruent_outline.png");
        background-repeat: repeat;
        background-attachment: fixed;
        background-position: center;
    }

    .logo {
        display: block;
        position: absolute;
        bottom: 20px;
        left: 20px;
        color: var(--color-fg-highlight);
        opacity: .5;
        font-size: 2rem;
        font-weight: bold;
        font-style: italic;
        text-shadow: 0px 0px 10px rgba(0,0,0,0.7);
    }

    .logo small {
        font-size: 1rem;
    }

    .container {
        width: auto;
        height: 520px;
        border-radius: 5px;
        border: 1px solid var(--color-border);
        overflow:hidden;
        box-shadow: 0px 3px 0px var(--color-shadow);
    }

    .player {
        aspect-ratio: 16 / 9;
        width: 852px;
    }

    .player.normal {
        aspect-ratio: 4 / 3;
        width: 640px;
    }

    .listing {
        position: relative;
        height: 100%;
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
        opacity: 1;
        border-left: 1px solid var(--color-border);
    }

    .listing.collapsed {
        position: absolute;
        right: 0px;
        z-index: -1;
    }

    .listing ul {
        display: block;
        flex: 1 1 auto;
    }

    .mobile { display: none !important; }
    .desktop { display: inherit !important; }
}

@media only screen and (min-width: 1600px) and (min-height: 780px) {
    .container { height: 760px; }
    .player { width: 1280px; }
    .player.normal { width: 960px; }
}

/*@media only screen and (min-width: 1920px) {
    .container { height: 1084px; }
    .player { width: 1440px; }
}*/
