html, body {
    padding: 0;
    margin: 0;
    overflow: hidden;
    overflow-x: hidden;
    -webkit-text-size-adjust: none;
    width: 100%;
    height: 100%;
    position: fixed;
}
input[type=checkbox] {
    cursor: pointer;
}

#overlays, #connecting {
    opacity: 0;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
}
#connecting {
    z-index: 100;
}
#connecting-content {
    width: 350px;
    background-color: #1c1d22;
    margin: 100px auto;
    border-radius: 15px;
    padding: 5px 15px;
}
#title {
    padding: 10px;
}
#nick {
    width: 65%;
}
#skin {
    width: 33%;
    float: right;
}
#nick, #skin {
    display: inline;
}
#gamemode {
    margin-top: 5px;
    width: 100%;
}
#helloDialog {
    width: 400px;
    background-color: #1c1d22;
    margin: 10px auto;
    border-radius: 15px;
    padding: 5px 15px 5px 15px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* A caixa de opcoes faz a janela crescer ao abrir: em tela baixa, rola
       por dentro em vez de vazar pra fora. */
    max-height: 92vh;
    overflow-y: auto;
}
#chat_textbox {
    transition: all .5s ease-in-out;
    position: absolute;
    z-index: 1;
    bottom: 10px;
    background: rgba(0, 0, 0, .2);
    border: 0px;
    outline: none;
    color: #fff;
    height: 30px;
    text-indent: 12px;
    left: 10px;
    width: 300px;
    font-family: "Ubuntu";
}
#chat_textbox:focus {
    background: rgba(0, 0, 0, .5);
}
#footer {
    text-align: center;
    margin-bottom: 10px;
    margin-top: -10px;
}
#play-btn {
    width: 85%;
    margin-bottom: 10px;
}
#spectate-btn {
    width: 13%;
    float: right;
    top: 0;
}
#play-btn, #spectate-button {
    display: inline;
}
#gallery-btn {
    width: 100%;
    margin-bottom: 5px;
    display: none; /* Visible when skins are loaded */
}
#touchpad, #touchCircle, #splitBtn, #ejectBtn {
    position: fixed;
}
#touchpad, #splitBtn, #ejectBtn {
    z-index: 2;
}
#touchpad {
    background: #000;
    opacity: 0.3;
    width: 20vw;
    height: 20vh;
    left: 0;
    bottom: 0;
}
#touchCircle {
    width: 4vw;
    height: 4vw;
    border-radius: 2vw;
    background: #f00;
    opacity: 0.3;
    z-index: 3;
}
#splitBtn, #ejectBtn {
    width: 8vw;
    height: 8vw;
    border-radius: 4vw;
    background: #777;
    opacity: 0.5;
}
#splitBtn {
    right: 18vw;
    bottom: 0;
}
#ejectBtn {
    bottom: 18vw;
    right: 0;
}
#playSounds:checked + #soundsVolume {
    display: inline;
}
#soundsVolume {
    display: none;
    width: 100px;
    height: 18px;
    padding: 0; /* IE fix */
    vertical-align: middle;
}
/* =======================================================================
   Tema escuro da tela inicial.
   Vem depois do bootstrap no index.html, entao sobrescreve o que ele traz.
   ======================================================================= */

#overlays, #connecting, #gallery {
    background-color: rgba(0, 0, 0, 0.72);
}
#helloDialog, #connecting-content {
    color: #e8e9ed;
    border: 1px solid #34363f;
    box-shadow: 0 12px 44px rgba(0, 0, 0, 0.65);
}
#title {
    color: #ffffff;
    font-weight: 700;
}
#helloDialog hr, #connecting-content hr {
    border-top-color: #32343d;
}
#helloDialog .text-muted, #connecting-content p {
    color: #9a9ca6;
}

/* Campos de texto e lista de servidor */
#helloDialog .form-control {
    background-color: #26282f;
    border: 1px solid #3a3d46;
    color: #eceef2;
    box-shadow: none;
}
#helloDialog .form-control:focus {
    border-color: #4d8df0;
    box-shadow: 0 0 0 2px rgba(77, 141, 240, 0.25);
}
#helloDialog .form-control::placeholder {
    color: #797c87;
}
#gamemode option {
    background-color: #26282f;
    color: #eceef2;
}

/* Botoes */
#helloDialog .btn {
    border: none;
    font-weight: 700;
    transition: background-color .15s ease;
}
#play-btn {
    background-color: #3d8bfd;
    color: #fff;
}
#play-btn:hover, #play-btn:focus {
    background-color: #5b9dff;
    color: #fff;
}
#spectate-btn {
    background-color: #b3831f;
    color: #fff;
}
#spectate-btn:hover, #spectate-btn:focus {
    background-color: #cc9727;
    color: #fff;
}
#gallery-btn {
    background-color: #2e313a;
    color: #d8dae0;
}
#gallery-btn:hover, #gallery-btn:focus {
    background-color: #383c47;
    color: #fff;
}

/* -----------------------------------------------------------------------
   Caixa de opcoes que abre e fecha (<details>), para a janela nao ficar
   poluida com 16 caixinhas soltas.
   ----------------------------------------------------------------------- */

#settings-box {
    margin: 8px 0 6px;
    border: 1px solid #32343d;
    border-radius: 10px;
    background-color: #212329;
    overflow: hidden;
}
#settings-box > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    color: #c9ccd3;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    list-style: none; /* tira o triangulo padrao do navegador */
}
#settings-box > summary::-webkit-details-marker {
    display: none; /* mesmo triangulo, no Chrome/Safari */
}
#settings-box > summary::after {
    content: "\25BC";
    font-size: 10px;
    color: #82858e;
    transition: transform .15s ease;
}
#settings-box[open] > summary::after {
    transform: rotate(180deg);
}
#settings-box > summary:hover {
    background-color: #292c33;
    color: #fff;
}

#settings {
    margin: 0;
    padding: 2px 10px 10px;
    border-top: 1px solid #2b2d35;
}
/* Duas colunas alinhadas, em vez de tudo emendado numa linha so */
#settings > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 8px;
}
#settings label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 5px 6px;
    font-weight: 400;
    color: #c4c7cf;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}
#settings label:hover {
    background-color: #2b2e36;
    color: #fff;
}
/* O bootstrap posiciona a caixinha em absolute dentro do label, o que a fazia
   cobrir as primeiras letras do texto. Aqui ela volta a ser um item normal. */
#settings input[type=checkbox] {
    position: static;
    margin: 0;
    flex: none;
}
/* A linha dos sons tem o controle de volume junto, entao ocupa as duas colunas */
#soundsRow {
    grid-column: 1 / -1;
}

/* -----------------------------------------------------------------------
   Caixa da skin: previa, cofre de ate 5 e os botoes. Segue as mesmas cores
   da caixa de Opcoes para nao destoar da janela.
   ----------------------------------------------------------------------- */

#skin-box {
    margin: 8px 0 2px;
    padding: 9px 10px;
    border: 1px solid #32343d;
    border-radius: 10px;
    background-color: #212329;
}
#skin-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* A previa e um circulo, igual a celula no jogo: a imagem e cortada em
   redondo, entao o que aparece aqui e exatamente o que os outros veem. */
#skin-preview {
    flex: none;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: #3d8bfd;
    background-size: cover;
    background-position: center;
    border: 2px solid #4a4d58;
}
#skin-side {
    flex: 1;
    min-width: 0;
}
#skin-msg {
    font-size: 12px;
    line-height: 1.35;
    color: #9a9ca6;
    margin-bottom: 6px;
    word-break: break-word;
}
#skin-msg.erro {
    color: #ff8a8a;
}
#skin-msg.ok {
    color: #7fd48a;
}
#skin-actions {
    display: flex;
    gap: 6px;
}
#skin-actions button {
    flex: 1;
    padding: 5px 6px;
    font-size: 12px;
    font-weight: 700;
    color: #d8dae0;
    background-color: #2e313a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .15s ease;
}
#skin-actions button:hover:not(:disabled) {
    background-color: #383c47;
    color: #fff;
}
#skin-actions button:disabled {
    opacity: .45;
    cursor: default;
}
/* Cofre: as skins guardadas, em circulos clicaveis */
#skin-vault {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}
#skin-vault:empty {
    display: none;
}
.vault-item {
    position: relative;
    width: 40px;
    height: 40px;
}
.vault-item .vault-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #3d8bfd;
    background-size: cover;
    background-position: center;
    border: 2px solid #4a4d58;
    cursor: pointer;
    transition: border-color .15s ease;
}
.vault-item .vault-face:hover {
    border-color: #6f93d8;
}
.vault-item.ativa .vault-face {
    border-color: #3d8bfd;
}
/* O X de apagar, no cantinho de cada circulo */
.vault-item .vault-del {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 17px;
    height: 17px;
    line-height: 15px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #e8e9ed;
    background-color: #4a2b2b;
    border: 1px solid #6b3a3a;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}
.vault-item .vault-del:hover {
    background-color: #7a3b3b;
    color: #fff;
}
