/* O visualizador, com o aspeto do de 2526: barra lateral escura e compacta, campos pequenos com
   contorno branco e ícones a fazer de rótulos, cartões com a borda da cor da entidade. */

* {
    --mdc-theme-primary: #e63702;
    --mdc-theme-selected: #dea800;
    --mdc-theme-secondary: #dea800;
    --mdc-text-field-focus-line-color: blue;
    --mdc-text-field-label-ink-color: blue;
    --mdc-text-field-caret-color: blue;
}

body {
    padding-top: 25px;
    font-size: 16px;
    color: white;
    background: #0c0607;
}

/* O mapa ocupa a janela toda; fora do mapa vê-se o céu noturno de Marte (img/fundo.jpg, que se
   repete sem costuras e se desloca a metade da velocidade do mapa, como o starfield de 2526). */
.tile-map {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: -1;
    background-color: #0c0607;
    background-image: url(../img/fundo.jpg);
    background-repeat: repeat;
}

.Move-mode .tile-map {
    cursor: move;
}

.Paint-mode .tile-map .tile {
    cursor: crosshair;
}

.Select-mode .tile-map image,
.Select-mode .tile-map .dinamite {
    cursor: pointer;
}

/* A barra lateral tem as ferramentas todas. */
.sidebar {
    width: 350px;
    top: 0;
    left: initial;
    right: 0;
    position: absolute;
    background: rgba(0, 0, 0, 0.70);
    border: none;
    padding: 20px 8px 20px 20px;
    overflow-y: auto;
    color: white;
}

/* Parte do espaço à direita fica dentro da zona com scroll, para as cruzes nos cantos dos cartões,
   que saem do cartão, não serem cortadas. A largura útil é a mesma. */
.sidebar .mdc-drawer__content {
    padding-right: 12px;
}

.sidebar-panel {
    margin-bottom: 0px;
}

/* Barra de deslocamento discreta, também no Firefox. */
.sidebar,
.sidebar .mdc-drawer__content {
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
    scrollbar-width: thin;
}

.sidebar h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

code {
    color: var(--mdc-theme-selected);
}

.item-row {
    flex-direction: row;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.item-row.esquerda {
    justify-content: flex-start;
}

.item-col {
    flex-direction: column;
    display: flex;
    justify-content: space-evenly;
    align-items: stretch;
}

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

/* Botões */

.botao {
    height: 30px;
}

.single-icon {
    padding-left: 25px;
}

.add-botao {
    height: 30px;
    min-width: 40px;
}

/* O botão de remover: uma cruz redonda no canto de cima à direita do cartão, por cima da borda. */
.fechar-cartao {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--mdc-theme-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.fechar-cartao .material-icons {
    font-size: 16px;
}

.fechar-cartao:hover {
    filter: brightness(1.25);
}

.button.selected,
.tile-selector .tile.selected,
.edificio-tipo.selected {
    outline-width: thick;
    outline-color: var(--mdc-theme-selected);
    outline-style: solid;
    outline-offset: -3px;
}

.sidebar .mdc-icon-button {
    color: white;
}

.sidebar .mdc-icon-button:disabled {
    color: rgba(255, 255, 255, 0.35);
}

.sidebar .mdc-icon-button.selected-icon,
.selected-icon {
    color: var(--mdc-theme-selected);
}

.invalid-icon,
.invalido-texto,
.perdeu {
    color: var(--mdc-theme-error);
}

#lock {
    padding-left: 20px;
}

#drawer-button-closed {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
}

.mdc-drawer--open {
    transform: translateX(0);
}

/* Campos numéricos, como o #numero de 2526: pequenos, sem rótulo, com contorno branco. */

.numero {
    width: 60px;
    height: 30px;
    outline: auto;
    outline-color: white;
    margin: 3px;
}

/* O contorno segue o border-radius, e o MDC só arredonda os cantos de cima (como nos campos
   "filled"): arredondam-se os quatro. */
.numero.mdc-text-field {
    border-radius: 6px;
}

.numero * {
    --mdc-theme-primary: var(--mdc-theme-selected);
}

/* O MDC põe 16px de cada lado; com 60px de largura só cabiam 3 algarismos. */
.numero.mdc-text-field--outlined {
    padding-left: 6px;
    padding-right: 6px;
}

.sidebar .numero .mdc-text-field__input {
    width: 60px;
    color: white;
}

.numero.invalido {
    outline-color: var(--mdc-theme-error);
}

.sidebar .numero.invalido .mdc-text-field__input {
    color: var(--mdc-theme-error);
}

.numero.mdc-text-field--disabled {
    outline-color: rgba(255, 255, 255, 0.35);
}

.sidebar .numero.mdc-text-field--disabled .mdc-text-field__input {
    color: rgba(255, 255, 255, 0.6);
}

/* Ícone, valor, separador ou ícone, valor: as colunas dos cartões ficam alinhadas. */
.grelha {
    display: grid;
    grid-template-columns: 32px 72px 32px 72px;
    justify-content: center;
    justify-items: center;
    align-items: center;
}

/* Os ícones que fazem de rótulo. */
.rotulo {
    color: var(--mdc-theme-selected);
    margin: 0 2px;
    vertical-align: middle;
}

.barra-dupla {
    color: #aaa;
}

/* Cartões */

.items-card.mdc-card {
    position: relative;
    overflow: visible;
    margin: 12px 0;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid;
    color: white;
}

/* Paleta de blocos */

.tile-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 0;
    margin: 0;
    list-style: none;
    outline: none;
}

.tile-selector .tile {
    cursor: pointer;
    width: 58px;
    height: 58px;
}

.tile-selector .tile:hover {
    filter: opacity(0.8);
}

.tile-selector .tile img,
.tile-selector .tile .ar {
    display: block;
    width: 58px;
    height: 58px;
}

.tile-selector .tile .ar {
    background: #1a1412;
    color: #aaa;
    line-height: 58px;
    text-align: center;
    font-size: 14px;
}

/* Escavadora, edifícios, dinamites e loja */

.titulo-img {
    width: 32px;
    height: 32px;
}

.carga {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 4px 2px;
}

.vazia {
    color: #aaa;
}

.mini {
    width: 24px;
    height: 24px;
}

.removivel {
    cursor: pointer;
}

.removivel:hover {
    outline: 2px solid var(--mdc-theme-selected);
}

.edificio-tipo {
    width: 34px;
    height: 28px;
    object-fit: contain;
    padding: 2px;
}

.numero-artigo {
    font-size: 18px;
}

.seletor {
    background: #222;
    color: white;
    border: 1px solid #888;
    border-radius: 4px;
    padding: 4px;
    font-size: 14px;
}

/* Informação, reprodução */

.legenda {
    text-align: center;
    font-size: 18px;
    padding: 8px;
    border-radius: 6px;
    background: rgba(222, 168, 0, 0.18);
    color: var(--mdc-theme-selected);
}

#frame-slider {
    flex-grow: 1;
}

.barra {
    width: 100%;
    height: 8px;
    background: #444;
    border-radius: 4px;
    overflow: hidden;
}

.barra-cheia {
    height: 100%;
}

.spread-table {
    width: 100%;
    border-collapse: collapse;
}

.spread-table td:first-child {
    text-align: left;
    white-space: nowrap;
}

.spread-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.spread-table .rotulo {
    font-size: 18px;
    margin-right: 6px;
}

/* Diálogo do texto em Haskell */

#codearea {
    width: 75vw;
}

#codearea > textarea {
    font-family: "Fira Code", "Source Code Pro", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
    tab-size: 4;
    white-space: pre;
    word-wrap: normal;
    overflow-x: auto;
}

.mdc-dialog .mdc-dialog__container .mdc-dialog__surface {
    width: 80vw;
    max-width: 80vw;
}

.mdc-dialog__content {
    display: flex;
    align-content: center;
    justify-content: center;
}
