:root {
    --our-black: #141414;
    --our-white: #faf5f5;
    --background-color: #141414;
    --foreground-color: #faf5f5;
    --highlight-red: #ff3719;
    --highlight-green: #00ff00;
    --highlight-purple: #9673ff;
    --shadow-gray: #878585;
}

@media (prefers-color-scheme: light) {
    :root {
        --background-color: #faf5f5;
        --foreground-color: #141414;
    }
}

/* latin-ext */
@font-face {
  font-family: 'Victor Mono';
  font-style: bold;
  font-weight: 100 700;
  font-display: swap;
  src: url(assets/VictorMono-Bold.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Victor Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url(assets/VictorMono-VariableFont_wght.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
    background-color: var(--background-color);
    color: var(--foreground-color);
    margin: 0;
    padding: 0;
    font-family: "Victor Mono", monospace;
    font-optical-sizing: auto;
    display: flex;
    flex-direction: column;
    height: 100svh;
}

footer {
    padding: 0 2em 2em;
}

.icon {
    height: 2em;
}

.button {
    background-color: var(--shadow-gray);
    padding: 1rem;
    border-color: black;
    border-style: solid;
}

nav .button {
    flex: 1;
}

.button-single {
    border-width: 0.2rem;
    border-radius: 0.5rem;
    text-align: center;
}

.button-right {
    border-radius: 0 0.5rem 0.5rem 0;
}

.button-left {
    border-radius: 0.5rem 0 0 0.5rem;
}

.button-active {
    background-color: var(--highlight-red);
}

nav {
    display: flex;

    .nav-icon {
        display: flex;
        justify-content: center;

        img {
            height: 2em;
        }
    }
    .button-right {
        border-width: 0.2rem 0.2rem 0.2rem 0.1rem;    
    }
    .button-left {
        border-width: 0.2rem 0.1rem 0.2rem 0.2rem;
    }
    .button-middle {
        border-width: 0.2rem 0.1rem;
    }
}

main {
    display: flex;
    flex-direction: column;
    padding: 2em;
    flex-grow: 1;
    overflow: auto;
}

main.qrcode {
    justify-content: center;
    align-items: center;
}

a {
    text-decoration: none;
    color: inherit;
}

/*************
 * home page *
 *************/

#greeting {
    display: flex;
    font-size: 1.8em;
    gap: 0.2em;
    span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

#invite {
    display: block;
    padding: 2em 1em;
    font-weight: bold;
    background: var(--highlight-red);
    color: var(--our-black);
    align-self: center;
}

table.home {
    border-collapse: collapse;
    tr td:nth-child(2) {
        text-align: right;
    }
    td {
        border-bottom: 1px solid var(--shadow-gray);
    }
}

/***************
 * invite page *
 ***************/

#qr-code {
    align-self: center;
}

/****************
 * schnick page *
 ****************/

#overlay {
    position: fixed;
    inset: 0;
    background: var(--shadow-gray);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    cursor: pointer;
    padding: 1em;
    color: var(--our-white);
    justify-content: center;
    text-align: center;
    h1 {
        font-size: 3em;
        margin-bottom: 0;
    }
}

.rules {
    display: flex;
    gap: 2em;
    padding: 0.5em;
    justify-content: center;
}

.rule-icon {
    height: 5em;
}

.weapon {
    width: 3em;
    height: 3em;
}

.weapon-inline {
    width: 1lh;
    height: 1lh;
    vertical-align: middle;
}

.weapon-selection, .outcome-selection {
    display: flex;
    gap: 0.1em;
}

.outcome-selection {
    font-size: 2em;
}

#schnick {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5em;
    width: 100%;
    font-weight: bold;
    color: var(--our-black);
}

#schnick input[type=radio] {
    display: none;
}

#schnick input[type=radio] + label {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--shadow-gray);
    padding: 0.5em;
    flex-grow: 1;
}

#schnick input[type=radio]:checked + label {
    background-color: var(--highlight-purple);
}

#schnick #won:checked + label {
    background-color: var(--highlight-green);
}

#schnick #lost:checked + label {
    background-color: var(--highlight-red);
}

#select {
    appearance: none;
    margin: 0;
    font-size: 2em;
    font-family: inherit;
    height: fit-content;
}

form:valid #select {
    background-color: var(--highlight-purple);
}

/*****************
 * accept invite *
 *****************/

.centered-page {
    margin: auto 0;
    display: flex;
    flex-direction: column;
 }

 #accept-button {
    background: var(--highlight-green);
}
.text-style {
    font-weight: bold;
    color: var(--our-black)
}

 .inline-icon {
    height: 1.5em;
    vertical-align: middle;
    padding-right: 0.1em;
 }


/*****************
 * settings page *
 *****************/

.settings {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    font-size: 1em;
    gap: 0.5em;

    .input {
        display: flex;
        gap: 0.2em;
        width: 100%;
        min-width: 5em;
    }

    button {
        flex: 0 0 auto;
        cursor: pointer;
    }

    button:active {
        background-color: var(--shadow-gray);
    }

    label {
        /* horizontal indent */
        margin: 0 0 0 1em;
    }
}

.settings input, .settings button {
    background-color: var(--foreground-color);
    color: var(--background-color);
    padding: 0.8em 1em;
    border-radius: 0.5em;
    font-size: inherit;
    font-family: inherit;
}

#dect-form {
    position: relative;
}

#info-button {
    position: absolute;
    right: 0;
    border: none;
    background-color: transparent;
}

#dect-info {
    position: absolute;
    top: calc(100% + 1.5em);
    right: 0;
    background-color: var(--shadow-gray);
    border-radius: 0.5em;
    text-align: center;
    display: none;
}

#dect-info::before {
    content: "";
    position: absolute;
    top: -19px;
    right: 5px;
    transform: translateX(-50%);
    border-width: 10px; 
    border-style: solid;
    border-color: transparent transparent var(--shadow-gray) transparent;
}

#dect-info.visible {
    display: block;
}

.settings .error {
    display: none;
    color: var(--highlight-red);
    font-size: inherit;
    margin-top: 0.3em;
}

.settings form:has(input:invalid) .error {
    display: inline;
}

.settings-links {
    display: flex;
    justify-content: center;
    gap: 1.5em;
}

/****************
 * waiting page *
 ****************/

/* https://www.geeksforgeeks.org/css/how-to-move-an-element-in-a-circular-path-using-css/ */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(var(--start)) translateX(100px) rotate(calc(-1 * var(--start)));
    }
    100% {
        transform: translate(-50%, -50%) rotate(calc(360deg + var(--start))) translateX(100px) rotate(calc(-360deg - var(--start)));
    }
}

@keyframes rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.waiting-symbols {
    margin: auto;

    .symbols {
        width: 5em;
        position: absolute;
    }

    #arrows {
        position: absolute;
        animation: rotate 4s linear infinite;
    }

    #rock {
        --start: 120deg;
        animation: spin 4s linear infinite;
    }

    #paper {
        --start: 0deg;
        animation: spin 4s linear infinite;
    }

    #scissors {
        --start: -120deg;
        animation: spin 4s linear infinite;
    }
}

/****************
 * about page *
 ****************/
.about {
    max-width: 400px;
    margin: auto;
    text-align: justify;
}

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

.emoji-text {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-top: 1.2em;
}

 /****************
  * imprint page *
  ****************/
.imprint{
    max-width: 400px;
    margin: auto;
}

/********
 * tabs *
 ********/

#tabs {
    display: flex;
    gap: 0.1em;
    padding-bottom: 0.5em;
}

.tab {
    background-color: var(--shadow-gray);
    border-color: black;
    border-style: solid;
    border-radius: 1em;
    color: var(--foreground-color);
    height: 2em;
    width: 3.7em;
    cursor: pointer;
    text-align: center;
    place-content: center;
    font-weight: bold;
    img {
        width: 1.5em;
        vertical-align: middle;
    }
}

.tab-active {
    background-color: var(--highlight-red);
}

/***********
 * metrics *
 ***********/

#metrics {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    overflow: auto;
    h2 {
        font-size: 1.2em;
        margin-bottom: 0.2em;
        color: var(--highlight-green);
    }
    #losing {
        color: var(--highlight-red);
    }
}

table.metrics {
    display: grid;
    grid-template-columns: auto auto auto;
}

#four-cols {
    grid-template-columns: auto auto auto auto;
}

table.metrics thead,
table.metrics tbody,
table.metrics tr {
    display: contents;
}

table.metrics th,
table.metrics td {
    padding: 2px;
    border-bottom: 1px solid var(--shadow-gray);
    white-space: nowrap;
    overflow-x: auto;
    text-align: center;
}

/***********
 * banners *
 ***********/
.banner {
    display: none;
    font-weight: bold;
    padding: 0.5em 2em;
    color: var(--our-black);
    align-self: center;
    align-items: center;
    border-style: solid;
    border-radius: 1.5em;
    margin-top: auto;
}

#banner-retry {
    position: absolute;
    margin: 0 2em;
}

.banner-green {
    background-color: var(--highlight-green);
}

.banner-red {
    background-color: var(--highlight-red);
}

.fade-out {
    opacity: 0;
    transition: opacity 2s;
}