/*
 * Kasymir TV page. Plain CSS for TV browsers from Chromium 38 on: flexbox
 * (with the -webkit- spellings), viewport units, opacity transitions. No CSS
 * grid, no custom properties. Sizes are in vmin so a 720p and a 1080p TV
 * look the same, and text reads from about 3 metres.
 * Colours: near-black, white, cold greys, one lemon accent (#cff846) used
 * only as a fill under dark text.
 */

/* Two static cuts of Geist (the app's font), not the variable file: engines
   before Chromium 62 cannot pick a weight from a variable font and would
   fake the bold. */
@font-face {
    font-family: 'Geist TV';
    src: url('geist-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Geist TV';
    src: url('geist-semibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0b0c0e;
}

body {
    color: #ffffff;
    font-family: 'Geist TV', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    cursor: none;
    -webkit-user-select: none;
    user-select: none;
}

.tv {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0b0c0e;
}

/* The stage is what turns for a screen that stands up (player.js sets its
   size in pixels: the screen's height becomes its width). */
.stage {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.stage.turned {
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: rotate(90deg) translateY(-100%);
    transform: rotate(90deg) translateY(-100%);
}

/* Moves everything by a few pixels every few minutes (burn-in). */
.shift {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    -webkit-transition: -webkit-transform 2s ease;
    transition: transform 2s ease;
}

.layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: #000000;
    opacity: 0;
    -webkit-transition: opacity 0.6s ease;
    transition: opacity 0.6s ease;
}

.layer.on {
    opacity: 1;
}

.layer img,
video.layer {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Every screen that is not a picture: link, connected, messages. */
.card {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    background: #0b0c0e;
    opacity: 1;
    visibility: visible;
    -webkit-transition: opacity 0.6s ease;
    transition: opacity 0.6s ease;
}

.card.hide {
    opacity: 0;
    visibility: hidden;
    -webkit-transition: opacity 0.6s ease, visibility 0s linear 0.6s;
    transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

.brand {
    position: absolute;
    left: 5vmin;
    top: 5vmin;
    z-index: 2;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.brand img {
    display: block;
    width: 7vmin;
    height: 7vmin;
}

.brand span {
    margin-left: 2vmin;
    font-size: 4.2vmin;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.center {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}

/* Link screen: the code, the three lines, the QR beside them. */
.link-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.code {
    font-size: 21vmin;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: #ffffff;
}

.code-sep {
    color: #4b525c;
}

.steps {
    margin-top: 6vmin;
}

.step {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-top: 2.4vmin;
    font-size: 4.4vmin;
    line-height: 1.2;
    white-space: nowrap;
    color: #c3c8cf;
}

.step:first-child {
    margin-top: 0;
}

.step-n {
    -webkit-box-flex: 0;
    -webkit-flex: none;
    flex: none;
    width: 6.6vmin;
    height: 6.6vmin;
    margin-right: 2.6vmin;
    border-radius: 50%;
    background: #cff846;
    color: #0b0c0e;
    font-size: 3.6vmin;
    font-weight: 600;
    line-height: 6.6vmin;
    text-align: center;
}

.qr {
    -webkit-box-flex: 0;
    -webkit-flex: none;
    flex: none;
    width: 42vmin;
    height: 42vmin;
    margin-left: 10vmin;
    padding: 2.4vmin;
    border-radius: 3.2vmin;
    background: #ffffff;
}

.qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* A screen that stands up: the QR goes under the code. */
.tall .link-row {
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
}

.tall .code {
    font-size: 17vmin;
}

.tall .step {
    font-size: 3.9vmin;
}

.tall .qr {
    width: 50vmin;
    height: 50vmin;
    margin-left: 0;
    margin-top: 9vmin;
}

/* Messages: connected, choose, switched off, press OK. */
.msg {
    max-width: 84%;
    text-align: center;
}

.big {
    font-size: 6.6vmin;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.01em;
    color: #ffffff;
    word-wrap: break-word;
}

.sub {
    margin: 2.4vmin 0;
    font-size: 4.4vmin;
    line-height: 1.25;
    color: #9aa1ab;
    word-wrap: break-word;
}

.check {
    width: 13vmin;
    height: 13vmin;
    margin: 0 auto 5vmin;
    border-radius: 50%;
    background: #cff846;
}

.check svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Waiting for the first answer. */
.dots span {
    display: inline-block;
    width: 2.2vmin;
    height: 2.2vmin;
    margin: 0 1.1vmin;
    border-radius: 50%;
    background: #5b626d;
    -webkit-animation: tv-dot 1.4s ease-in-out infinite;
    animation: tv-dot 1.4s ease-in-out infinite;
}

.dots span:nth-child(2) {
    -webkit-animation-delay: 0.2s;
    animation-delay: 0.2s;
}

.dots span:nth-child(3) {
    -webkit-animation-delay: 0.4s;
    animation-delay: 0.4s;
}

@-webkit-keyframes tv-dot {
    0%,
    80%,
    100% {
        opacity: 0.25;
    }
    40% {
        opacity: 1;
    }
}

@keyframes tv-dot {
    0%,
    80%,
    100% {
        opacity: 0.25;
    }
    40% {
        opacity: 1;
    }
}

/* No answer for a while: a small dot in the corner, nothing else changes. */
.dot {
    position: absolute;
    right: 2.4vmin;
    bottom: 2.4vmin;
    z-index: 200000;
    width: 1.8vmin;
    height: 1.8vmin;
    border-radius: 50%;
    background: #ff5a4f;
    box-shadow: 0 0 0 0.5vmin rgba(11, 12, 14, 0.6);
    opacity: 0;
    -webkit-transition: opacity 0.6s ease;
    transition: opacity 0.6s ease;
}

.dot.on {
    opacity: 0.9;
}
