* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    padding: 0;
}

.kreis {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    font-family: sans-serif, 'Times New Roman';
    color: #06f;
    font-weight: bold;
    text-shadow: 5px 5px 10px #005, -5px -5px 10px #005;
    user-select: none;
    font-size: 5em;
}

.kreuz {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: sans-serif, 'Times New Roman';
    color: #f32;
    font-weight: bold;
    text-shadow: 3px 3px 10px #500, -3px -3px 10px #500;
    user-select: none;
    font-size: 7em;
}

.feld {
    position: relative;
    width: 7rem;
    height: 7rem;
    border: solid 2px #334;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #050510;
    cursor: pointer;
}

#all {
    top: 0;
    left: 0;
    position: fixed;
    width: 100%;
    height: 100%;
    display: grid;
}

#nameDisplay {
    padding: 1.5rem 0 0.5rem 1.5rem;
    font-size: 1.5rem;
    color: #ccd;
    font-family: sans-serif;
    font-weight: bold;
}

.message {
    margin: 0.4em 0;
    padding-left: 1.5em;
    text-indent: -1.5em;
}

.messageOwnName {
    font-weight: bolder;
    color: #2278e5;
    margin-right: 7px;
}

.messageName {
    font-weight: bolder;
    color: #da3c3c;
    margin-right: 7px;
}

.popUp {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(7px);
}

.popUp div {
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
    border: solid 3px #445;
    padding: 2rem;
    background-color: rgba(0,0,0,0.7);
    text-align: center;
    font-size: 20px;
    border-radius: 10px;
}

#nameField {
    display: none;
}

.inputFieldName {
    padding: 0.8em 1em;
    margin: 1rem 0;
    font-size: 1rem;
    border: solid 2px #334;
    border-radius: 5px;
}

.inputFieldName:focus {
    outline: none;
    border: solid 2px #667;
}

.inputNameButton {
    padding: 0.8rem 1.3rem;
    cursor: pointer;
    border: solid 2px #334;
    border-radius: 5px;
}

#chatWrapper {
    border: solid 3px #112;
    position: relative;
    background: rgba(0,0,0,0.4);
    grid-column: 1;
    grid-row: 1;
}

#spielfeldWrapper {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#lobby {
    display: block;
    padding: 2rem;
    font-family: sans-serif;
    color: #ddd;
    overflow-y: scroll;
}

.rightWrapper {
    position: relative;
    grid-column: 2;
    grid-row: 1;
}

#spielfeld {
    position: relative;
    border: solid 2px #334;
    display: grid;
    margin: 2rem;
}

#werIstDran {
    position: relative;
    border: solid 3px #334;
    padding: 1rem;
    text-align: center;
    color: #ddd;
    font-family: sans-serif;
    font-size: 20px;
    user-select: none;
    background-color: #050510;
}

#chatbox {
    border: solid 3px #334;
    margin: 1rem;
    border-radius: 1.5rem;
    height: calc(100% - 11rem);
    color: #ddd;
    font-family: sans-serif;
    padding: 0;
    overflow: hidden;
}

#chatContent {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0 0.5em 0.5em 0.5em;
    overflow-y: scroll;
    font-size: 15px;
}

#chatInputBox {
    position: relative;
    padding: 1rem;
    width: 100%;
}

#chatInput {
    border: solid 3px #334;
    border-radius: 2rem;
    padding: 1rem 2.7rem 1rem 1rem;
    width: 100%;
    background: transparent;
    color: #ddd;
    font-size: 15px;
}

#chatSendButton {
    position: absolute;
    font-size: 25px;
    background: transparent;
    color: #556;
    border: none;
    cursor: pointer;
    right: 1.7rem;
    top: 50%;
    transform: translateY(-50%);
}

#chatInput:focus {
    outline: none;
}

.roomButton {
    position: relative;
    width: 100%;
    text-align: center;
    padding: 1rem;
    background: #0a70ff;
    font-size: 20px;
    font-family: sans-serif;
    font-weight: bold;
    border-radius: 1rem;
    margin: 1rem 0 0 0;
    cursor: pointer;
    overflow: hidden;
    color: #fff;
    user-select: none;
    border: none;
}

.roomButton:after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 0;
    background: rgba(255, 255, 255, 0.3);
    transition: 150ms;
    transform: translate(-50%);
}

.roomButton:hover:after {
    width: 100%;
}

.roomButton span {
    font-weight: lighter;
    font-style: italic;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: right;
    position: absolute;
    right: 1rem;
    bottom: 0.8rem;
    color: #bbb;
    font-size: 15px;
}

.roomButtonElm {
    text-align: left;
}

#roomNameField {
    display: none;
}

#roomErrorOutput {
    color: #f11;
    font-size: 12px;
}

.closeButton {
    position: absolute;
    top: 0;
    right: 0;
    font-family: sans-serif;
    color: #666;
    cursor: pointer;
    font-size: 20px;
    border-radius: 5px;
    width: 2rem;
    height: 2rem;
    text-align: center;
    align-items: center;
    justify-content: center;
    display: flex;
    user-select: none;
}

.closeButton:hover {
    background-color: rgba(255,255,255,0.1);
}

#headFont {
    position: absolute;
    top: 1rem;
    font-family: sans-serif;
    color: #ccc;
    letter-spacing: 0.3em;
}

.startButton {
    position: relative;
    padding: 0.8rem 1rem;
    font-size: 17px;
    border: none;
    border-radius: 0.8rem;
    background-color: #0a70ff;
    cursor: pointer;
}

.startButton:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    height: 0;
    width: 0;
    background: rgba(255, 255, 255, 0.3);
    transition: 100ms;
    transform: translate(-50%, -50%);
    border-radius: 0.8rem;
}

.startButton:hover:after {
    width: 100%;
    height: 100%;
}

#leave {
    position: absolute;
    top: 2.3rem;
    right: 2.3rem;
    cursor: pointer;
    border: solid 2px #334;
    padding: 0.5rem 1rem;
    font-size: 20px;
    color: #556;
    background-color: rgba(0,0,0,0.2);
    transition: 100ms;
}

#leave:hover {
    background-color: rgba(0,0,0,0.4);
}

#win {
    background-image: url("congratulation.gif");
    background-size: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 100;
    text-align: center;
    align-items: center;
    justify-content: center;
    font-size: 9em;
    font-family: sans-serif;
    background-color: rgba(0,0,0,0.6);
    animation: winBG 2.2s forwards;
    display: none;
}

@keyframes winBG {
    0% {
        background-image: url("congratulation.gif");
    }

    99% {
        background-image: url("congratulation.gif");
    }

    100% {
        background-image: none;
    }
}

#gameStatus {
    font-family: sans-serif;
    color: #bbb;
    text-align: center;
}

#playerList {
    position: absolute;
    bottom: 1rem;
    white-space: nowrap;
    /*display: flex;*/
}

.player {
    display: inline-block;
    font-size: 15px;
    color: #668;
    font-family: sans-serif;
    border: solid 2px #333344;
    padding: 0.5rem 0.8rem;
    border-radius: 2rem;
    margin-inline: 0.5rem;
    background-color: rgba(0,0,0,0.3);
}

.activePlayer {
    background-color: rgba(0,0,0,0.5);
    animation: playerBlink 1s infinite;
}

@keyframes playerBlink {
    0% {
        scale: 1;
    }

    50% {
        scale: 1.08;
    }

    100% {
        scale: 1;
    }
}


/* media query ------------------------------------*/

@media (orientation: landscape) {
    #all {
        grid-template-columns: 25rem auto;
        grid-template-rows: 100%;
    }

    #chatWrapper {
        grid-column: 1;
        grid-row: 1;
    }

    .rightWrapper {
        grid-column: 2;
        grid-row: 1;
    }

}

@media (orientation: portrait) {
    #all {
        grid-template-columns: 100%;
        grid-template-rows: 50% 50%;
    }

    .rightWrapper {
        grid-column: 1;
        grid-row: 1;
    }

    #chatWrapper {
        grid-column: 1;
        grid-row: 2;
    }

    .feld {
        width: 8vh;
        height: 8vh;
    }

    .kreis {
        font-size: 3em;
    }

    .kreuz {
        font-size: 4em;
    }

    #leave {
        top: 0;
        right: 0;
    }

    #headFont {
        display: none;
    }

    #playerList {
        bottom: 0.4rem;
        overflow-x: auto;
        overflow-y: hidden;
        max-width: 100%;
    }

    .player {
        white-space: nowrap;
    }

    #win {
        font-size: 3em;
    }
}
