@import url(./normalize.css);

body {
    color: white;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    font-size: 1rem;
    background: black;
    /* Prevent zooming on mobile, since it's usually accidental or from double taps */
    touch-action: none;
}

h1 {
    font-size: 3rem;
}

h1,
.h1 {
    font-size: calc(3rem + 1.5vw);
}

@media (min-width: 1200px) {

    h1,
    .h1 {
        font-size: 2.5rem;
    }
}

h2,
.h2 {
    font-size: calc(2rem + 0.9vw);
}

@media (min-width: 1200px) {

    h2,
    .h2 {
        font-size: 2rem;
    }
}

h3,
.h3 {
    font-size: calc(1.3rem + 0.6vw);
}

@media (min-width: 1200px) {

    h3,
    .h3 {
        font-size: 1.75rem;
    }
}

p {
    margin-bottom: 0.8rem;
}

.lead {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.fill-screen {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    perspective: 800px;
}

.btn {
    background: linear-gradient(180deg, gold 0%, rgb(255 246 223) 49%, #bb8d39 50%, #e9bf42 100%);
    border-radius: 100%;
    padding: 1rem;
    box-shadow: 0 5px 5px white;
    transition: all .5s;
    border: 3px solid rgb(95, 67, 53);
    border-top-color: lightgoldenrodyellow;
    border-bottom-color: rgb(41, 25, 15);
    font-weight: bold;
    cursor: pointer;
    margin-top: 50px;
    font-size: 1.3rem;
}

.username {
    text-align: center;
    font-size: 2rem;
}

.btn:hover {
    box-shadow: 0 10px 25px white;
    font-style: italic;
}

.btn:active {
    background: linear-gradient(0deg, gold 0%, rgb(255 246 223) 49%, #bb8d39 50%, #e9bf42 100%);
}

.btn:disabled {
    background: grey !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

.intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10vw;
    text-align: center;
    user-select: none;
    transition: all 1s;
    max-width: 800px;
    margin: auto;
}

.intro.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    perspective: 500;
}

.resume-list {
    margin-top: 1rem;
    width: min(90vw, 720px);
    max-height: 36vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resume-list .lead {
    margin-bottom: 0.3rem;
}

.resume-list .resume-btn {
    margin-top: 0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.hidden h1 {
    transform: rotate3d(0, 1, 0, 180deg);
    transition: all 1s;
}

.container {
    /* background: magenta; */
    display: flex;
    flex-direction: row;
}

.video-player {
    width: auto;
    flex-grow: 1;
    flex-basis: 50%;
    height: 100%;
    position: relative;
    background: black;
    transition: all .5s ease-in;
}

.video-player-left {
    transform: rotate3d(0, 1, 0, 6deg) scale(0.8);
}

.video-player-right {
    transform: rotate3d(0, 1, 0, -6deg) scale(0.8);
}

.video-player-right.lost {
    animation: video-lost-right 1s forwards ease-in;
    opacity: 0;
}

.video-player-left.lost {
    animation: video-lost-left 1s forwards ease-in;
    opacity: 0;
}

.video-player-right.won {
    /* animation: video-won 2s .5s forwards ease-in; */
    transform: rotate3d(0, 1, 0, 0deg) scale(0.85) translateX(-50%);
}

.video-player-left.won {
    transform: rotate3d(0, 1, 0, 0deg) scale(0.85) translateX(50%);
}

.video-player-right.hidden {
    transform: rotate3d(0, 1, 0, -10deg) scale(0.5);
    opacity: 0;
}

.video-player-left.hidden {
    transform: rotate3d(0, 1, 0, 10deg) scale(0.5);
    opacity: 0;
}

.video-player-left.hidden.won {
    transform: rotate3d(0, 1, 0, 0deg) scale(0.5) translateX(100%);
}

.video-player-right.hidden.won {
    transform: rotate3d(1, 0, 0, 90deg) scale(0.5) translateX(-100%);
}


.video-player.won .media-element {
    box-shadow: 0 0 50px 10px gold;
}

.media-element {
    object-fit: contain;
    background: black;
    width: 100%;
    height: 100%;
    transition: transform .3s ease-out, box-shadow .5s ease-in-out;
}

@keyframes video-won {
    0% {
        transform: scale(0.8);
        border: 0px solid gold;
    }

    50% {
        transform: scale(0.8);
    }

    100% {
        transform: scale(0.8) translateY(150%);
        border: 10px solid yellow;
    }
}

@keyframes video-lost-right {
    0% {
        transform: scale(0.8) rotate3d(0, 1, 0, -6deg);
    }

    50% {}

    100% {
        transform: scale(0.7) rotate3d(0, 1, 0, -90deg) translateX(100%);
    }
}

@keyframes video-lost-left {
    0% {
        transform: scale(0.8) rotate3d(0, 1, 0, 6deg);
    }

    50% {}

    100% {
        transform: scale(0.7) rotate3d(0, 1, 0, 90deg) translateX(-100%);
    }
}

.versus {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 100px;
    width: auto;
    height: auto;
    font-family: 'impact';
}

.versus span {
    transition: all .3s .6s ease-out;
    display: block;
}

.versus.hidden span {
    transform: scale(0.1);
    opacity: 0;
    transition: all .5s ease-in;
}

.scrim {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 100%);
    /* Blur the background */
    backdrop-filter: blur(50px);
}

.scrim {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.4) 100%);
    /* Blur the background */
    backdrop-filter: blur(5px);
}

.paused .media-element {
    transform: scale(0.95);
}

.unplayed .scrim {
    backdrop-filter: blur(50px);
}

.scrim.hidden {
    opacity: 0;
}

.winner.hidden {
    display: none;
}

#debug {
    font-family: monospace;
    white-space: pre;
    position: fixed;
    background: rgba(255, 255, 255, 0.8);
    color: black;
    font-size: 0.3rem;
    display: none;
}

.login-container {
    margin-top: 2rem;
}

.login-container.loading {
    opacity: 0.5;
}

.login-container.hidden {
    display: none;
}

.user-votes {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 50px;
    pointer-events: none;
    transition: opacity .2s;
}

.user-votes.hidden {
    opacity: 0;
}

.user {
    max-width: 200px;
    background: blue;
    color: white;
    font-family: monospace;
    border-radius: 50px;
    padding: 0.2rem 1rem;
    margin: 5px 0;
    transition: margin .5s ease-in-out;
    display: flex;
    align-items: center;
}

.user-votes:not(.hidden) .user.left {
    margin-left: -50%;
}

.user-votes:not(.hidden) .user.right {
    margin-left: 50%;
}

.user.voting {
    animation: user-voting 1s ease-in-out infinite alternate;
    opacity: 0.5;
}

@keyframes user-voting {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

input[type="text"] {
    font-size: 2rem;
    text-align: center;
}

.username-display {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    font-size: 2rem !important;
}

.waiting-to-start {
    color: goldenrod;
}

[hidden] {
    display: none !important;
}

.voting-container {
    position: fixed;
    top: calc(3rem + env(safe-area-inset-top, 0px));
    bottom: 0.75rem;
    right: 0;
    left: 0;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vote-btn {
    border-radius: 20px;
    background: grey;
    width: 100%;
    height: 100%;
    margin: 1rem;
    position: relative;
    overflow: hidden;
}

.vote-btn .media-element {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    object-fit: cover;
    filter: blur(8px);
    transition: background-color .2s ease-out, outline .1s, transform .1s;
}

.vote-btn.selected .media-element {
    filter: blur(8px) brightness(1.5);
}

.vote-btn.selected {
    background: white;
    transition: background-color .2s ease-out, outline .1s, transform .1s;
    transform: scale(1.1);
    outline: 5px solid gold;
}

.connection-status {
    position: fixed;
    bottom: 0;
    padding: 1rem;
    color: lime;
}

.flex {
    display: flex;
    ;
}

.flex-row {
    flex-direction: row;
}

.flex-column {
    flex-direction: column;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.flex-space-between {
    justify-content: space-between;
}

.flex-space-around {
    justify-content: space-around;
}

.flex-grow {
    flex-grow: 1;
}

.flex-shrink {
    flex-shrink: 1;
}

.flex-wrap {
    flex-wrap: wrap;
}

.text-center {
    text-align: center;
}

.round-header {
    position: absolute;
    top: 0;
    text-align: center;
    right: 0;
    left: 0;
    padding: 10px;
    opacity: 1;
    transition: opacity 1s .5s;
}

.round-header .muted {
    opacity: 0.5;
}

.round-header .small {
    font-size: 0.8rem;
}

.round-header[hidden] {
    opacity: 0;
    display: block !important;
}

.lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.lds-ellipsis div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.lds-ellipsis div:nth-child(1) {
    left: 8px;
    animation: lds-ellipsis1 0.6s infinite;
}

.lds-ellipsis div:nth-child(2) {
    left: 8px;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(3) {
    left: 32px;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(4) {
    left: 56px;
    animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes lds-ellipsis3 {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

@keyframes lds-ellipsis2 {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(24px, 0);
    }
}

.user-votes .user {
    min-height: 35px;
}

.user .name {
    
}

.user:not(.voting) .loading-spinner {
    display: none;
}

.loading-spinner {
    display: block;
    width: 30px;
    height: 30px;
    position: relative;
    margin-left: -6px;
    margin-right: 5px;
}

.loading-spinner .lds-ellipsis {
    transform: scale(0.375);
    transform-origin: top left;
}

.admin-commands 
{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top: 0;
    /* position: fixed; */
    top: calc(3rem + env(safe-area-inset-top, 0px));
    padding-top: 0.5rem;
    left: 0;
    right: 0;
    padding: 0 0.5rem;
    z-index: 200;
}

body.is-admin .voting-container {
    top: calc(8.2rem + env(safe-area-inset-top, 0px));
}

.video-strip {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 1.2vw;
    align-items: stretch;
    padding: 2vw;
}

.video-strip .video-player {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    opacity: 0.55;
    transition: transform .2s ease-out, opacity .2s ease-out, flex .2s ease-out, max-width .2s ease-out;
}

.video-strip .video-player.focused {
    transform: scale(1.03);
    opacity: 1;
    flex: 2.8 1 0;
    z-index: 2;
}

.video-strip .video-player.dimmed {
    flex: 0.7 1 0;
    max-width: 11vw;
    opacity: 1;
    z-index: 1;
    margin-left: -1vw;
    margin-right: -1vw;
}

.video-strip .video-player .media-element {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
    transition: opacity .2s ease-out, border-color .2s ease-out, box-shadow .2s ease-out;
}

.video-strip .video-player .username,
.video-strip .video-player .submitted-by {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    text-align: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-strip .video-player .username {
    top: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.video-strip .video-player .submitted-by {
    bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.video-strip .video-player.focused .media-element {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.video-strip .video-player.dimmed:not(.unplayed) .media-element {
    opacity: 0.35;
}

.video-strip .video-player.won .media-element {
    box-shadow: 0 0 50px 10px gold;
}

.video-strip .video-player.result-winner {
    flex: 2.4 1 0;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    opacity: 1;
    transform: scale(1.02);
    z-index: 3;
}

.video-strip .video-player.result-loser {
    flex: 0.55 1 0;
    max-width: 9vw;
    opacity: 0.2;
    transform: scale(0.72);
}

.video-strip .video-player.lost {
    opacity: 0.2;
    transform: scale(0.75);
}

.vote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(42vw, 170px), 1fr));
    gap: 0.9rem;
    align-content: stretch;
    overflow-y: auto;
    padding: 0.25rem;
    grid-auto-rows: 1fr;
}

.vote-grid.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vote-grid .vote-btn {
    margin: 0;
    min-height: 0;
    aspect-ratio: 9 / 16;
    height: 100%;
}

.vote-grid .vote-btn .media-element {
    object-fit: contain;
    filter: blur(0px) brightness(0.85);
}

.vote-grid .vote-btn.revealed .media-element {
    filter: blur(0px) brightness(0.9);
}

.vote-grid .vote-btn.selected {
    transform: scale(1.04);
}

.vote-grid .vote-btn.selected .media-element {
    filter: blur(0px) brightness(1.2);
}

.vote-grid .vote-btn.unrevealed {
    opacity: 0.55;
}

.vote-grid .vote-btn.unrevealed .media-element {
    filter: blur(12px) brightness(0.55);
}

.vote-grid .vote-btn.pulse-limit {
    animation: vote-limit-pulse 0.18s ease-in-out 2;
}

@keyframes vote-limit-pulse {
    0% {
        transform: scale(1.04);
    }
    50% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1.04);
    }
}

.vote-heading {
    margin: 0.2rem 0 0.6rem;
}

.user-votes .user.selected {
    outline: 3px solid rgba(255, 215, 0, 0.9);
}
