/* ============================================================
   CENTRAL DE COMANDO — tema geopolitico / militar (exercitus)
   ============================================================ */

* {
    font-family: 'Rajdhani', 'Oswald', sans-serif;
    box-sizing: border-box;

    /* Paleta: verde-oliva escuro, grafite, latao/dourado, vermelho de alerta */
    --color1: #05070a;   /* preto quase absoluto */
    --color2: #10151a;   /* grafite muito escuro (painéis) */
    --color3: #1f2a24;   /* verde-oliva profundo (bordas/sombra) */
    --color4: #3a4a3c;   /* verde-oliva médio (botões) */
    --color5: #cfd6cc;   /* cinza esverdeado claro (texto secundário) */
    --color6: #f2ede0;   /* bege claro (texto principal) */
    --brass: #b9973f;    /* latão / dourado — acentos */
    --brass-bright: #e3c064;
    --alert-red: #9c2a2a;
    --alert-green: #4c7a3f;
    --select-color1: #b9973f55;
    --select-color2: #f2ede0;
}

.dev-hidden {
    display: none !important;
}

.flexContainer {
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
}
.flexRowContainer {
    display: flex;
    flex-flow: row;
    justify-content: center;
    align-items: center;
}
.flexSpacer { flex-grow: 1; }
.flexDivider { height: 10px; width: 10px; }
.fullWidth { width: 100%; }
.textAlignLeft { text-align: left; }

.mcTextStyle1 {
    color: var(--color5);
    letter-spacing: 0.03em;
}
.mcTextStyle2 {
    color: var(--color6);
    text-shadow: 1px 1px var(--color1);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.9em;
}

/* Botões estilo "console tático": bordas retas, canto cortado, acento de latão */
.mcButtonStyle {
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    height: 42px;
    min-width: max-content;

    background: linear-gradient(180deg, var(--color4), #2b362d);
    border: 1px solid var(--brass);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.mcButtonStyle:hover .mcButtonStyleInner {
    background-color: var(--select-color1);
    color: var(--brass-bright);
    text-shadow: 1px 1px var(--color1);
}
.mcButtonStyle:active .mcButtonStyleInner {
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.6);
}
.mcButtonStyle .mcButtonStyleInner {
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    height: 100%;
    padding: 0 14px;

    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

.mcIconButtonStyle {
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    height: fit-content;

    background: linear-gradient(180deg, var(--color4), #2b362d);
    border: 1px solid var(--brass);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.mcIconButtonStyle:hover .mcIconButtonStyleInner {
    background-color: var(--select-color1);
}
.mcIconButtonStyle .mcIconButtonStyleInner {
    cursor: pointer;
    border: none;
    background: none;
    width: fit-content;
    height: 100%;
    padding: 6px;
}
.mcIconButtonStyle .mcIconButtonStyleInner img {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(88%) sepia(8%) saturate(300%) hue-rotate(50deg) brightness(105%);
}

.mcTextboxStyle {
    cursor: text;
    overflow: hidden;
    white-space: nowrap;
    user-select: text;
    height: 42px;

    color: var(--color6);
    background: var(--color2);
    border: 1px solid var(--color4);
    border-left: 3px solid var(--brass);
    padding: 0 12px;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.03em;
}
.mcTextboxStyle::placeholder {
    color: #6d7a6f;
}
.mcTextboxStyle:hover {
    border-color: var(--brass);
}
.mcTextboxStyle:focus {
    outline: none;
    background: #161c17;
    border-left-color: var(--brass-bright);
    box-shadow: 0 0 0 1px var(--brass-bright) inset;
}
.mcTextviewStyle {
    cursor: text;
    user-select: text;
    height: 150px;
    width: calc(100% - 20px);

    color: var(--color5);
    background: var(--color2);
    border: 1px solid var(--color4);
    border-left: 3px solid var(--brass);
    padding: 8px 10px;

    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9em;
}
.mcCheckboxStyle {
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    height: 42px;

    background: linear-gradient(180deg, var(--color4), #2b362d);
    border: 1px solid var(--brass);
}
.mcCheckboxStyle input:checked + .mcCheckboxStyleInner {
    background-color: var(--brass);
}
.mcCheckboxStyle:hover .mcCheckboxStyleInner {
    background-color: var(--select-color1);
}
.mcCheckboxStyle .mcCheckboxStyleInner {
    height: 42px;
    width: 42px;
}
.mcCheckboxStyle input {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
}

/* Painel principal — estilo "console de comando", cantos cortados + moldura de latão */
.mcContainerStyle {
    --cutout: 14px;

    background: linear-gradient(180deg, #121813, #0c100d);
    border: 1px solid var(--color4);
    box-shadow:
        0 0 0 1px rgba(185, 151, 63, 0.25),
        0 20px 60px rgba(0,0,0,0.55),
        inset 0 1px 0 rgba(255,255,255,0.03);
    clip-path: polygon(
        var(--cutout) 0, calc(100% - var(--cutout)) 0,
        100% var(--cutout), 100% calc(100% - var(--cutout)),
        calc(100% - var(--cutout)) 100%, var(--cutout) 100%,
        0 calc(100% - var(--cutout)), 0 var(--cutout)
    );
    position: relative;
    padding-top: 6px;
}

/* Fundo geral: grid tático escuro + leve efeito de "mapa topográfico" */
.mcDirtBackground {
    background-color: #05070a;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(185, 151, 63, 0.05), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(76, 122, 63, 0.06), transparent 45%),
        linear-gradient(rgba(185,151,63,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(185,151,63,0.05) 1px, transparent 1px);
    background-size: auto, auto, 40px 40px, 40px 40px;
    background-position: 0 0, 0 0, 0 0, 0 0;
}

/* Cabeçalho estilo "faixa de operações" */
.hqHeaderBar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 16px 14px 16px;
}
.hqHeaderLine {
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brass), transparent);
    opacity: 0.7;
}
.hqHeaderText {
    color: var(--brass-bright);
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    letter-spacing: 0.2em;
    font-size: 0.72em;
    white-space: nowrap;
    text-transform: uppercase;
}

/* Emblema / logo central — substitua images/v2/logo-placeholder.png pela sua imagem */
.hqEmblemSlot {
    display: flex;
    justify-content: center;
    margin-top: -34px;
    margin-bottom: 4px;
}
.hqEmblemRing {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: radial-gradient(circle, #171d18, #0a0d0a);
    border: 2px solid var(--brass);
    box-shadow: 0 0 0 4px #05070a, 0 6px 16px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.hqEmblemImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.hqEmblemFallback {
    display: none;
    font-family: 'Oswald', sans-serif;
    font-size: 0.65em;
    letter-spacing: 0.15em;
    color: var(--brass);
}
.hqEmblemRing.empty .hqEmblemFallback { display: block; }

footer {
    padding: 10px;
}
footer, .footerLink {
    gap: 10px;
}
.footerClassification {
    color: var(--brass);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7em;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.8;
}

main {
    height: 100%;
    flex: 1 1 auto;
}
.mainContainer {
    width: min(700px, calc(95vw - 10px));
}

.micActivityIndicator.active {
    filter: brightness(1) sepia(1) saturate(4) hue-rotate(70deg);
}
.micActivityIndicator {
    width: 24px;
    height: 24px;
    padding: 8px;
    cursor: default;
    filter: brightness(0.6);
}

.statusLabel.disconnected {
    color: var(--alert-red);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.05em;
}
.statusLabel.connected {
    color: var(--alert-green);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.05em;
}

.joinLabel {
    font-family: 'Oswald', sans-serif;
    color: var(--color6);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.joinSec {
    text-align: center;
    padding: 4px 10px 10px 10px;
}
.joinForm {
    color: var(--color6);
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    margin: 10px;
    gap: 12px;
}
.joinFormLabel {
    text-align: left;
    padding: 5px;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.08em;
}
.usernameInput, .passwordInput {
    width: 230px;
}
.micSelect, .speakerSelect {
    width: 270px;
}

.connectedSec {
    padding: 0 10px 10px 10px;
}
.pttBindBtnContainer {
    width: calc(100% - 4px);
}

body {
    height: 100vh;
    width: 100vw;
    margin: 0;
}
body.connected .hiddenWhenConnected, body:not(.connected) .connectedSec, body:not(.connected) .statusLabel {
    display: none;
}
body.connected .joinBtnContainer {
    width: fit-content;
}
body.connected .joinSec {
    padding: 10px 10px 0 10px;
}

.floatingWidgetsOverlay {
    position: fixed;
    bottom: 50px;
    width: calc(100% - 20px);
}

.alertOverlay {
    position: fixed;
    top: 0;
    z-index: 67;
    width: 100%;
    background: linear-gradient(180deg, #2a1414, #100a0a);
    border-bottom: 2px solid var(--alert-red);
}
.alertOverlayInner {
    margin: 0 20px 0 20px;
    color: var(--color6);
}

@media (max-width: 600px) {
    body {
        display: block;
        height: auto;
        width: auto;
        margin-top: 15px;
    }

    .flexSpacerWhenMobile { flex-grow: 1; }
    .fullWidthWhenMobile { width: 100%; }
    .flexColumnWhenMobile { flex-flow: column; }

    .usernameInput, .passwordInput {
        width: calc(100% - 22px);
    }
    .micSelect, .speakerSelect, .pttClearBtnContainer {
        width: calc(100% - 4px);
    }
    .micContainer {
        width: calc(100% + 4px);
    }
    .footerLinkText {
        display: none;
    }
    .floatingWidgetsOverlay {
        position: initial;
        bottom: auto;
    }
}

/* PTT Overlay */
body.fullscreen-ptt-active {
    overflow: hidden;
}
.pttFullscreenSec {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    z-index: 1000;
}
.pttFullscreenSec.visible {
    display: flex;
}
.pttFullscreenBtn {
    width: min(82vw, 540px) !important;
    height: min(58vh, 540px) !important;
}
.pttFullscreenBtn .mcButtonStyleInner {
    font-size: clamp(24px, 5vw, 42px) !important;
}
