/* ==========================================================================
   1. ESTILOS GERAIS E BASE
   ========================================================================== */

/* Importação da fonte Korataki */
@font-face {
    font-family: 'Korataki';
    src: url('../fontes/korataki.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Importação da fonte Gotham Book */
@font-face {
    font-family: 'Gotham Book';
    src: url('../fontes/Gotham-Book.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    background-color: #000;
    /* Fundo global: preto brilhante com leve verde e textura de estrelas */
    background-image: linear-gradient(180deg, rgba(127,181,0,0.10) 0%, rgba(0,0,0,0.0) 60%), url('https://www.transparenttextures.com/patterns/stardust.png');
    background-repeat: no-repeat, repeat;
    background-position: center, top left;
    background-size: cover, auto;
    background-attachment: fixed, scroll; /* gradiente fixo; textura rola normalmente */
    color: white;
    font-family: 'Gotham Book', Arial, sans-serif; /* Fonte padrão do projeto */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow-x: hidden; /* evita scroll horizontal indesejado */
}

/* Sombra verde sutil em camadas no fundo para todas as telas */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(1200px 600px at 50% 15%, rgba(127,181,0,0.14), rgba(0,0,0,0) 60%),
      radial-gradient(900px 480px at 12% 85%, rgba(127,181,0,0.10), rgba(0,0,0,0) 62%),
      radial-gradient(900px 480px at 88% 85%, rgba(127,181,0,0.10), rgba(0,0,0,0) 62%);
}

/* Garante altura mínima para que o gradiente cubra toda a página */
html, body { min-height: 100%; }

/* Workaround para iOS Safari onde background-attachment: fixed não funciona bem */
@supports (-webkit-touch-callout: none) {
  body {
    background-attachment: scroll; /* evita flicker */
  }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, #7FB500 0%, #000 100%);
    pointer-events: none;
  }
}

/* Layout específico quando queremos empilhar logo e conteúdo abaixo */
body.conteudo-centralizado {
    display: flex;
    flex-direction: column;       /* Empilha header acima e cards abaixo */
    align-items: center;          /* Centraliza horizontalmente */
    justify-content: flex-start;  /* Alinha no topo verticalmente */
    min-height: 100vh;
    padding-top: 16px;
}

h1, h2, h3 {
    font-size: 2em;
    font-family: 'Korataki', Arial, sans-serif;
    color: #ffffff; /* Títulos brancos */
}

h4, h5, h6 {
    font-family: 'Korataki', Arial, sans-serif;
    font-size: 1.25em;
    color: #ffffff; /* Títulos brancos */
}

h4{
    font-family: 'Korataki', Arial, sans-serif;
    margin-top: 20px;
    margin-bottom: 20px;
    color: var(--cor-texto-secundario);
    line-height: 1.5;
    text-align: center;
    
}

/* Overrides globais de botão verde com hover invertido */
:root {
    --btn-green: ##7FB500;
    --btn-text: #ffffff;
    --btn-hover-bg: #ffffff;
    --btn-hover-text: #000000;
}

.botao, .action-btn, .share-btn {
    background-color: var(--btn-green);
    color: var(--btn-text);
    border: 1px solid var(--btn-green);
}
.botao:hover, .action-btn:hover, .share-btn:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-bg);
}

/* Utilitários para override local de títulos */
.title-sm { font-size: 1rem !important; }
.title-lg { font-size: 2.5rem !important; }
/* Evita restringir o header; usamos .brand-header para estilização */

/* ==========================================================================
   2. COMPONENTES REUTILIZÁVEIS
   ========================================================================== */

.container {
    text-align: center;
}

.container-grande {
    width: 90%;
    max-width: 1200px;
    text-align: center;
}

/* Empurra levemente o conteúdo para baixo quando há header acima */
body.conteudo-centralizado .container-grande {
    margin-top: clamp(12px, 4vh, 28px);
}

.botao {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #7FB500;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.botao:hover {
    background-color: #ffff; /* Amarelo vibrante ao passar o mouse */
    color: #7FB500;
}

/* Classe utilitária para aplicar Gotham Book */
.font-gotham {
    font-family: 'Gotham Book', Arial, sans-serif;
}

/* ==========================================================================
   3. ESTILOS POR TELA
   ========================================================================== */

/* --- Tela Inicial --- */
.logo {
    width: 300px;
    margin: 20px 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

/* Chamada empolgante na home */
.cta-line {
    font-family: 'Gotham Book', Arial, sans-serif;
    font-size: clamp(1rem, 2.6vw, 1.25rem);
    text-align: center;
    color: #fff;
    margin: 12px 0 0;
    letter-spacing: 0.2px;
}

.cta-line strong {
    color: #7FB500;
    background: rgba(127, 181, 0, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
}

.cta-rocket {
    display: inline-block;
    margin-right: 8px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
    animation: float 2.8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* --- Cabeçalho da marca na Seleção --- */
.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.brand-logo {
    max-width: 220px;
    width: clamp(120px, 24vw, 220px); /* Proporção adequada e responsiva */
    height: auto;
    padding-bottom: 0;
    filter: drop-shadow(0 2px 6px rgba(255,255,255,0.15));
}


/* --- Tela de Seleção de Missão --- */
.missoes-container {
    display: flex;
    gap: 40px;
    margin-top: 50px;
}

.missao-card {
    width: 300px;
    display: flex;
    flex-direction: column;
}

.missao-descricao {
    flex-grow: 1; /* Faz a descrição ocupar o espaço disponível, alinhando os botões */
    font-size: 0.9em;
    line-height: 1.4;
    text-align: left;
    color: var(--cor-texto-secundario);
    margin-top: 10px;
    margin-bottom: 15px;
    font-family: 'Gotham Book', sans-serif;
}

.missao-stats {
    margin-top: auto; /* Garante que os stats fiquem alinhados com a parte de baixo */
    padding-top: 15px;
    border-top: 1px solid var(--cor-primaria-ui);
    font-size: 0.7em;
    text-align: left;
    line-height: 1.5;
}
/* --- Tela de Seleção de Naves --- */
.naves-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.nave-card {
    background-color: #000;
    padding: 20px;
    border-radius: 15px;
    width: 300px;
    display: flex;
    flex-direction: column;
    text-align: left;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 1.5);
}

.nave-card h4 {
    text-align: center;
    font-size: 1.1em;
    margin-top: 0;
}

.nave-imagem-placeholder {
    width: 100%;
    height: clamp(120px, 18vw, 200px);
    border-radius: 10px;
    object-fit: cover; /* ocupa todo o espaço mantendo proporção */
    display: block;
    margin-bottom: 15px;
}

.nave-descricao {
  flex-grow: 1; /* Faz a descrição ocupar o espaço disponível, alinhando os botões */
    font-size: 0.9em;
    line-height: 1.4;
    text-align: left;
    color: var(--cor-texto-secundario);
    margin-top: 10px;
    margin-bottom: 15px;
    font-family: 'Gotham Book', sans-serif;
}

.nave-stats {
   margin-top: auto; /* Garante que os stats fiquem alinhados com a parte de baixo */
    padding-top: 15px;
    border-top: 1px solid var(--cor-primaria-ui);
    font-size: 0.7em;
    text-align: left;
    line-height: 1.5;
}

.modulos-stats{
 margin-top: auto; /* Garante que os stats fiquem alinhados com a parte de baixo */
    padding-top: 5px;
    border-top: 1px solid var(--cor-primaria-ui);
    font-size: 0.7em;
    text-align: left;
    line-height: 1.5;
}

.nave-card .botao {
    text-align: center;
}

/* --- Tela de Seleção de Módulos --- */
.info-nave {
    display: flex;
    justify-content: space-around;
    background-color: #000;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 30px;
    font-size: 1.2em;
}

.sumario-carga {
    background-color: #000;
    padding: 20px;
    border: 1px solid transparent 0.25;
    
    border-radius: 10px;
    margin-bottom: 40px;
}

.sumario-carga h3 {
    margin-top: 0;
}

.sumario-carga p {
    font-size: 1.5em;
}

#massa-total {
    font-weight: bold;
}

.barra-progresso-container {
    width: 100%;
    background-color: #fff;
    border-radius: 10px;
    padding: 5px;
}

.barra-progresso {
    height: 20px;
    width: 0%;
    border-radius: 5px;
    transition: width 0.5s ease, background-color 0.5s ease;
}

.modulos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.modulo-card {
    background-color: #000;
    padding: 15px;
    border-radius: 10px;
    width: 220px;
    text-align: left;
    position: relative; 
    display: flex;
    flex-direction: column;
}

.modulo-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #fff;
    text-align: center;
    font-family: 'korataki', Arial, sans-serif;
}

.modulo-card p {
    margin: 5px 0;
    font-size: 0.9em;
}

.modulo-imagem-container {
    height: clamp(100px, 22vw, 150px);
    background-color: #000;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modulo-imagem-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* mostra a imagem inteira sem cortes */
}

.modulo-info {
    flex-grow: 0.2;
}


.botao-modulo {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 5px;
    background-color: #7FB500;
    color: white;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.botao-modulo:hover {
    background-color: #fff;
    color:#7FB500 ;
}

.botao-modulo.selecionado {
    background-color: #e74c3c;
}

.botao-modulo.selecionado:hover {
    background-color: #c0392b;
}

#botao-lancar {
    margin-top: 40px;
    font-size: 1.5em;
    padding: 15px 30px;
}

/* Tooltip do Módulo */
.modulo-card::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1c2142;
    color: #aeb8de;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #4a6fce;
    width: 250px;
    text-align: center;
    font-size: 0.9em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

.modulo-card:hover::before {
    opacity: 1;
    visibility: visible;
}

/* --- Tela do Diário de Viagem --- */
.diario-container {
    text-align: left;
    margin-top: 30px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #000;
    border-radius: 10px;
    padding: 20px;
}

.diario-entrada {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #1c2142;
    padding: 15px 0;
}

.diario-entrada:last-child {
    border-bottom: none;
}

.turno {
    background-color: #000;
    padding: 5px 10px;
    border-radius: 5px;
    margin-right: 20px;
    font-weight: bold;
    min-width: 90px;
    text-align: center;
}

.evento h4 {
    margin: 0 0 5px 0;
}

.evento p {
    margin: 0;
    color: #aeb8de;
}

.sumario-chegada {
    margin-top: 30px;
    background-color: #000;
    padding: 20px;
    border-radius: 10px;
}

.sumario-chegada ul {
    list-style: none;
    padding: 0;
    text-align: left;
}

.sumario-chegada li {
    padding: 5px 0;
}

/* Estilos para monitoramento de recursos */
.monitoramento-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.monitoramento-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: #ffd700;
    text-align: center;
}

.monitoramento-section h4 {
    margin: 20px 0 10px 0;
    font-size: 1.1em;
    color: #ffd700;
}

.recursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.recurso-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.recurso-label {
    display: block;
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
}

.recurso-valor {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: #4ecdc4;
}

.modulos-ativos {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    min-height: 60px;
}

.nenhum-modulo {
    text-align: center;
    opacity: 0.6;
    font-style: italic;
}

.modulo-ativo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border-left: 4px solid #4ecdc4;
}

.modulo-nome {
    font-weight: 500;
    text-transform: capitalize;
}

.modulo-quantidade {
    background: #4ecdc4;
    color: #1e3c72;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-sistema {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.status-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    margin: 5px 0;
}

.status-ok {
    background: rgba(46, 204, 113, 0.2);
    border-left: 4px solid #2ecc71;
}

.status-erro {
    background: rgba(231, 76, 60, 0.2);
    border-left: 4px solid #e74c3c;
}

.status-icon {
    margin-right: 10px;
    font-weight: bold;
    font-size: 1.2em;
}

.status-ok .status-icon {
    color: #2ecc71;
}

.status-erro .status-icon {
    color: #e74c3c;
}

/* Responsividade */
@media (max-width: 768px) {
    .recursos-grid {
        grid-template-columns: 1fr;
    }
    
    .monitoramento-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .recurso-item {
        padding: 12px;
    }
}

/* Estilos para controles de módulo */
.controles-modulo {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.botao-adicionar,
.botao-remover {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.botao-adicionar {
    background-color: #2ecc71;
    color: white;
}

.botao-adicionar:hover {
    background-color: #27ae60;
    transform: scale(1.1);
}

.botao-remover {
    background-color: #e74c3c;
    color: white;
}

.botao-remover:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}


.botao-modulo:hover {
    background-color: #2980b9;
}

.botao-modulo.selecionado {
    background-color: #f39c12;
}

.botao-modulo.selecionado:hover {
    background-color: #e67e22;
}

/* Esconder botões de +/- inicialmente */
.botao-adicionar,
.botao-remover {
    display: none;
}

/* Mostrar botões de +/- quando o módulo estiver selecionado */
.modulo-card.selecionado .botao-adicionar,
.modulo-card.selecionado .botao-remover {
    display: flex;
}

.modulo-card.selecionado .botao-modulo {
    display: none;
}

/* Contador de módulos */
.contador-modulo {
    margin-left: 8px;
    font-size: 0.9em;
    color: #888;
    font-weight: bold;
}

.status-ok {
    color: #2ecc71; /* Verde */
}

.status-avariado {
    color: #e74c3c; /* Vermelho */
}

/* ===== Ajustes solicitados: seleção de módulos compacta e rolagem interna ===== */
.modulos-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

#filtro-modulos {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid transparent 0.25;
    background-color: #fff;
    color: #aeb8de;
    min-width: 220px;
}

.cards-scroll-inner {
    gap: 16px;
    align-content: flex-start;
    max-height: 58vh;             /* Scroll interno ao invés da página */
    overflow-y: auto;
    padding-right: 6px;           /* Espaço para a barra de rolagem */
}

.cards-scroll-inner.expanded {
    max-height: 75vh;
}

/* Exibir apenas a primeira fileira de cards na página de seleção de módulos */
.selecao-modulos .cards-scroll-inner {
    max-height: clamp(280px, 32vh, 360px); /* limita à altura de uma linha de cards */
}

.modulo-card.compacto {
    padding: 12px;                /* Um pouco menor */
    width: 200px;                 /* Cards menores */
}

.modulo-card.compacto h4 {
    margin-bottom: 3px;
    font-size: 0.8em;
}

.modulo-card.compacto p {
    margin: 4px 0;
    font-size: 0.85em;            /* Tipografia levemente menor */
}

.modulo-card.compacto .modulo-imagem-container {
    height: clamp(80px, 20vw, 120px);
    margin-bottom: 12px;
}

/* Evitar scroll da página inteira apenas na seleção de módulos */
body.conteudo-centralizado.selecao-modulos {
    overflow: auto; /* Permite alcançar o fim da página */
    position: relative;
}

/* Corrigir gradiente quando houver scroll - manter fundo fixo */
/* Removido o pseudo-elemento específico para usar o fundo global */

/* Mantém os cards em uma única linha na montagem com scroll horizontal */
.naves-nowrap {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-x: auto;
}

/* ===== Correções de posicionamento: aproximar módulos do topo da seção ===== */
/* Reduz a margem inferior do sumário para aproximar os cards */
.selecao-modulos .sumario-carga {
    margin-bottom: 10px;
}

/* Reduz a margem inferior da info da nave */
.selecao-modulos .info-nave {
    margin-bottom: 10px;
}

/* Ajusta margens de títulos para diminuir espaçamento vertical */
.selecao-modulos h2,
.selecao-modulos h3 {
    margin-top: 6px;
    margin-bottom: 8px;
}

/* Diminui a margem superior do container apenas nesta página */
.selecao-modulos .container-grande {
    margin-top: clamp(2px, 0.8vh, 8px);
}

/* Redução sutil: cards e títulos levemente menores mantendo o design */
.selecao-modulos .modulo-card {
    width: 210px;            /* antes: 220px */
    padding: 14px;           /* antes: 15px */
}

.selecao-modulos .modulo-card h4 {
    font-size: clamp(0.8rem, 2.1vw, 0.8rem); /* redução suave e responsiva */
}

.selecao-modulos .modulo-imagem-container {
    height: clamp(94px, 21vw, 140px); /* mantém proporção, ligeiramente menor */
}

#texto-Montagem{
  font-family: 'Gotham Book';
    font-size: 1.5em;
}

/* ===== Responsivo: ajustes para tablets e celulares ===== */
@media (max-width: 1024px) {
    .brand-logo { width: clamp(140px, 24vw, 220px); }
    .container-grande { width: min(92%, 1100px); }
    .cards-scroll-inner { max-height: 62vh; }
}

@media (max-width: 768px) {
    .container-grande { width: 94%; }
    .modulos-controls { flex-wrap: wrap; }
    #filtro-modulos { min-width: 180px; }
    .modulo-card { width: calc(50% - 12px); }
    .modulo-card.compacto { width: calc(50% - 12px); }
    .modulo-card.compacto .modulo-imagem-container { height: 90px; }
    .sumario-carga p { font-size: 1.2em; }
}

@media (max-width: 480px) {
    .brand-logo { width: clamp(120px, 40vw, 180px); }
    .container-grande { width: 96%; }
    .modulo-card, .modulo-card.compacto { width: 100%; }
    .modulo-card.compacto .modulo-imagem-container { height: 80px; }
    .botao, .botao-modulo { font-size: 0.95em; }
    .cards-scroll-inner { max-height: none; } /* Em telas muito pequenas, prioriza scroll da página */
}

/* ===== Professor: Dashboard ===== */
.dashboard-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; padding: 20px; background: #000; border-radius: 15px; }
.dashboard-title { color: #64ffda; font-size: 32px; margin: 0; }
.create-room-btn { background: linear-gradient(135deg, #64ffda 0%, #00bcd4 100%); color: #0a192f; padding: 15px 30px; border: none; border-radius: 10px; font-size: 18px; font-weight: bold; cursor: pointer; text-decoration: none; display: inline-block; }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; margin-bottom: 40px; }
.room-card { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); padding: 25px; border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.1); transition: transform 0.2s; }
.room-card:hover { transform: translateY(-5px); }
.room-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.room-code { background: rgba(100, 255, 218, 0.2); color: #64ffda; padding: 8px 15px; border-radius: 20px; font-weight: bold; font-size: 14px; }
.room-title { color: white; font-size: 20px; margin: 0 0 10px 0; }
.room-details { color: #ccc; margin-bottom: 15px; }
.room-detail-item { display: flex; align-items: center; margin-bottom: 8px; }
.room-detail-icon { width: 20px; height: 20px; margin-right: 10px; color: #64ffda; }
.room-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.stat-item { text-align: center; padding: 15px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.stat-number { color: #64ffda; font-size: 24px; font-weight: bold; display: block; }
.stat-label { color: #ccc; font-size: 14px; }
.room-actions { display: flex; gap: 10px; }
.action-btn { flex: 1; padding: 10px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; transition: background 0.2s; }
.view-btn { background: rgba(100, 255, 218, 0.2); color: #64ffda; }
.view-btn:hover { background: rgba(100, 255, 218, 0.3); }
.share-btn { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.share-btn:hover { background: rgba(255, 193, 7, 0.3); }
.empty-state { text-align: center; padding: 60px 20px; color: #ccc; }
.empty-icon { font-size: 48px; margin-bottom: 20px; color: #64ffda; }
.empty-text { font-size: 18px; margin-bottom: 30px; }
@media (max-width: 768px) { .dashboard-header { flex-direction: column; gap: 20px; text-align: center; } .rooms-grid { grid-template-columns: 1fr; } .room-stats { grid-template-columns: 1fr; } }

/* ===== Professor: Sala Detalhes ===== */
.details-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
/* Back button mais consistente com tema da página */
.details-container .back-btn { display: inline-block; margin-bottom: 25px; color: #64ffda; text-decoration: none; font-weight: bold; font-size: 0.9rem; background: rgba(255, 255, 255, 0.08); border: 1px solid #334155; padding: 8px 14px; border-radius: 8px; }
/* Header único/limpo com layout flexível */
.room-header { background: #000; color: #fff; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.room-header .room-left { display: grid; gap: 10px; min-width: 260px; flex: 1 1 420px; }
.room-header .room-title { color: #64ffda; font-size: 1.8rem; font-weight: 700; margin: 0; }
.room-header .room-subtitle { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.room-header .room-destination { color: #94A3B8; font-size: 1rem; font-weight: 500; }
.room-header .room-code-section { display: flex; align-items: center; gap: 10px; }
.room-header .room-code-display { background-color: #334155; color: #fff; padding: 6px 10px; border-radius: 6px; font-family: "Courier New", Courier, monospace; font-weight: 700; font-size: 0.9rem; }
.room-header .share-btn { background-color: var(--btn-green); color: var(--btn-text); border: 1px solid var(--btn-green); padding: 6px 10px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 0.85rem; transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.room-header .share-btn:hover { background-color: var(--btn-hover-bg); color: var(--btn-hover-text); border-color: var(--btn-hover-bg); }
.room-header .room-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.room-header .action-btn { padding: 8px 12px; background-color: #334155; color: #e0e0e0; border: 1px solid #475569; border-radius: 6px; cursor: pointer; transition: background-color 0.2s, transform 0.1s; }
.room-header .action-btn:hover { background-color: #7FB500; transform: translateY(-1px); }
.room-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.info-card { background: rgba(255, 255, 255, 0.05); padding: 20px; border-radius: 10px; text-align: center; }
.info-icon { font-size: 32px; margin-bottom: 15px; color: #64ffda; }
.info-number { color: #64ffda; font-size: 28px; font-weight: bold; display: block; margin-bottom: 5px; }
.info-label { color: #ccc; font-size: 14px; }
.tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.tab { padding: 15px 30px; background: transparent; color: #ccc; border: none; cursor: pointer; font-size: 16px; transition: all 0.3s; }
.tab.active { color: #64ffda; border-bottom: 3px solid #64ffda; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.students-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.student-card { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); padding: 20px; border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.1); }
.student-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.student-name { color: white; font-weight: bold; font-size: 18px; }
.student-progress { background: rgba(100, 255, 218, 0.2); color: #64ffda; padding: 5px 12px; border-radius: 15px; font-size: 14px; }
.student-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.student-stat { text-align: center; padding: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 8px; }
.stat-value { color: #64ffda; font-weight: bold; display: block; }
.stat-label { color: #ccc; font-size: 12px; }
.student-actions { display: flex; gap: 10px; }
.action-btn { flex: 1; padding: 8px; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; transition: background 0.2s; }
.view-btn { background: rgba(100, 255, 218, 0.2); color: #64ffda; }
.view-btn:hover { background: rgba(100, 255, 218, 0.3); }
.challenges-list { display: grid; gap: 15px; }
.challenge-item { background: rgba(255, 255, 255, 0.05); padding: 15px; border-radius: 10px; border-left: 4px solid #64ffda; }
.challenge-title { color: white; font-weight: bold; margin-bottom: 10px; }
.challenge-desc { color: #ccc; font-size: 14px; }
@media (max-width: 768px) { .room-header { padding: 16px; gap: 16px; } .room-header .room-title { font-size: 1.4rem; } .room-header .room-subtitle { gap: 8px; } .room-header .room-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; } }

/* ===== Utilitários Globais ===== */
.toolbar-row { display: flex; gap: 8px; align-items: center; }
.toolbar-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mt-16 { margin-top: 16px; }
.pt-16 { padding-top: 16px; }
.list-clean { margin: 5px 0; padding-left: 20px; }

/* ===== Alertas e painéis ===== */
.alerta { padding: 12px; background: rgba(255, 193, 7, 0.1); border-radius: 8px; border-left: 4px solid #ffc107; }

/* ===== Topbar (Professor) ===== */
.topbar { display:flex; justify-content:flex-start; align-items:center; padding:8px 16px; border-bottom:1px solid rgba(255,255,255,0.08); border-radius: 8px; }
.topbar .user { color:#fff; font-weight:600; font-family: inherit; }
.topbar-actions { display:flex; gap:8px; align-items:center; margin-left: auto; }
.topbar .action-btn { padding: 8px 8px ; background: #7FB500; color: #fff; border: 1px solid ; border-radius: 6px; cursor: pointer; transition: background-color 0.2s, transform 0.1s; text-decoration: none; }
.topbar .action-btn:hover { background: #fff; color: #7FB500 ; transform: translateY(-1px); }
.topbar .action-btn.danger { background: rgba(255, 99, 71, 0.2); color: #ff6b6b; border: 1px solid #ff6b6b; }

/* Barra separada para ações (topo direito) */
.topbar-actions-row { 
  position: fixed; 
  top: 8px; 
  right: 16px; 
  z-index: 1000; 
  display:flex; 
  justify-content:flex-end; 
  align-items:center; 
  padding: 0; 
}
.topbar-actions-row .topbar-actions { display:flex; gap:6px; align-items:center; flex-wrap: wrap; }
/* Botões menores e com fonte do corpo (mesma dos parágrafos) */
.topbar-actions-row .action-btn { 
  padding: 6px 10px; 
  font-size: 0.8rem; 
  font-family: inherit; /* herda do body/p */
  text-transform: none; 
  font-weight: 600; 
  background: #7FB500; 
  color: #fff; 
  border: 1px solid; 
  border-radius: 6px; 
  cursor: pointer; 
  transition: background-color 0.2s, transform 0.1s; 
  text-decoration: none; 
}
.topbar-actions-row .action-btn:hover { background: #fff; color: #7FB500 ; transform: translateY(-1px); }
.topbar-actions-row .action-btn.danger { background: rgba(255, 99, 71, 0.2); color: #ff6b6b; border: 1px solid #ff6b6b; }

@media (max-width: 480px) {
  .topbar-actions-row { top: 6px; right: 10px; }
  .topbar-actions-row .action-btn { padding: 5px 8px; font-size: 0.75rem; }
}

/* Korataki apenas para títulos do dashboard */
.dashboard-container h1,
.dashboard-container h2,
.dashboard-container h3,
.dashboard-container h4,
.dashboard-container h5,
.dashboard-container h6,
.dashboard-container .card-title,
.dashboard-container .sala-title,
.dashboard-container .desafios-title,
.dashboard-container .empty-text {
  font-family: 'Korataki';
  letter-spacing: 0.3px;
}

/* Banner de alerta reutilizável */
.alert-banner { margin:12px 0; padding:10px; border:1px solid #b58900; background:rgba(181,137,0,0.18); color:#ffd27f; border-radius:6px; display:flex; justify-content:space-between; align-items:center; gap:8px; }
.alert-banner .msg { flex:1; }

/* Variações de alert-banner */
.alert-banner.success { border-color: #28a745; background: rgba(40, 167, 69, 0.18); color: #90ee90; }
.alert-banner.warning { border-color: #ffc107; background: rgba(255, 193, 7, 0.18); color: #fff3cd; }
.alert-banner.danger { border-color: #dc3545; background: rgba(220, 53, 69, 0.18); color: #f8d7da; }

/* ===== Seleção de Módulos: painéis ===== */
.info-performance { padding: 12px; background: rgba(100, 255, 218, 0.1); border-radius: 8px; border-left: 4px solid #fff; }
.info-performance h4 { margin: 0 0 8px 0; color: #fff; }
.info-performance p { margin: 5px 0; font-size: 0.9em; }
#explicacao-duracao { margin: 2px 0; font-size: 0.8em; color: #888; }

.info-sobrevivencia { padding: 12px; background: rgba(255, 193, 7, 0.1); border-radius: 8px; border-left: 4px solid #ffc107; }
.info-sobrevivencia h4 { margin: 0 0 8px 0; color: #ffc107; }

/* ===== Viagem: ícones de eventos ===== */
.evento-icone { width: 28px; height: 28px; margin-right: 8px; vertical-align: middle; }

/* ===== Ranking ===== */
.ranking-list { margin-top: 16px; }
.ranking-item { padding: 12px; border: 1px solid #2b2b2b; border-radius: 10px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.02); }
.ranking-index-circle { width: 36px; height: 36px; border-radius: 50%; background: #1f1f1f; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #64ffda; }
.ranking-medal { font-size: 1.1em; }
.kpi-row { display: flex; gap: 16px; align-items: center; font-size: 0.95em; color: #ddd; }
.kpi-icon { width: 18px; height: 18px; vertical-align: middle; margin-right: 6px; }

.section-divider { border-top: 1px solid #ccc; }
.section-title { color: #2c3e50; margin-bottom: 1rem; }
.section-subtitle { color: #7f8c8d; margin-bottom: 1.5rem; }
