:root {
    --neon-pink: #ff00ff;
    --neon-blue: #00ffff;
    --neon-red: #ff1b1b;
    --background-dark: #0a0a14;
    --text-color: #f0f0f0;
    --asphalt-color: #1a1a2a;
    --reflection-color: rgba(255, 255, 255, 0.05);
}

body {
    background-color: var(--background-dark);
    color: var(--text-color);
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    flex-direction: column;
}

/* Jogo + painel de controles lado a lado */
#main-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
}

#controls-panel {
    flex: 0 0 270px;
    align-self: stretch;
    box-sizing: border-box;
    padding: 18px;
    border: 2px solid var(--neon-pink);
    border-radius: 10px;
    background: rgba(10, 10, 20, 0.85);
    box-shadow: 0 0 14px rgba(255, 0, 255, 0.45);
    overflow-y: auto;
    contain: size; /* fica da altura do jogo (com muitos jogadores, rola por dentro em vez de esticar a página) */
}

#controls-panel h3 {
    margin: 0 0 12px 0;
    color: var(--neon-pink);
    text-shadow: 0 0 8px var(--neon-pink);
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.panel-player {
    margin-bottom: 16px;
}

.panel-player h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}


.panel-device {
    font-family: sans-serif;
    font-size: 0.75rem;
    color: #bbb;
    font-weight: normal;
}

.panel-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-family: sans-serif;
    font-size: 0.85rem;
}

.panel-row .panel-key {
    color: var(--neon-blue);
    font-weight: bold;
    text-align: right;
}

.panel-hint {
    font-family: sans-serif;
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.4;
}

/* Sem espaço sobrando: esconde o painel (os controles continuam na tela de carregamento) */
@media (max-width: 1250px) {
    #controls-panel {
        display: none;
    }
}

#game-container {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 16 / 9;
    position: relative;
    box-shadow: 0 0 20px var(--neon-blue), 0 0 40px var(--neon-pink);
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    overflow: hidden;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background-color: var(--background-dark);
    position: relative;
    z-index: 1;
}

/* --- Telas de Overlay --- */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: safe center; /* conteúdo maior que a tela rola a partir do topo, sem cortar o começo */
    align-items: center;
    z-index: 10;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.5s;
    overflow-y: auto;
}

.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    display: none !important;
}

/* --- HUB (escolha de modo) --- */
#hub-screen h1 {
    font-size: 3rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
    margin: 0 0 10px 0;
}

.hub-section {
    width: 90%;
    max-width: 760px;
    margin-bottom: 14px;
}

.hub-section h3 {
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hub-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.hub-option {
    font-family: 'Orbitron', sans-serif;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 255, 255, 0.4);
    border-radius: 10px;
    color: var(--text-color);
    padding: 14px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.hub-option:hover {
    transform: scale(1.04);
    border-color: var(--neon-blue);
}

.hub-option.selected {
    border-color: var(--neon-pink);
    box-shadow: 0 0 12px var(--neon-pink), inset 0 0 12px rgba(255, 0, 255, 0.25);
}

.hub-option-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-pink);
}

.hub-option-desc {
    font-family: sans-serif;
    font-size: 0.85rem;
    color: #bbb;
}

/* Item selecionado pelo controle nos menus */
.pad-focus {
    outline: 3px solid #fff3a0 !important;
    outline-offset: 3px;
    box-shadow: 0 0 18px #fff3a0 !important;
}

/* Escolha de teclado ou controle para cada jogador */
.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.input-label {
    font-weight: 700;
    width: 2.2em;
}

/* Time de cada jogador (clique troca entre ciano e rosa) */
.team-toggle {
    --team-color: #00ffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    min-width: 8.5em;
    background: color-mix(in srgb, var(--team-color) 15%, rgba(0, 0, 0, 0.5));
    border: 2px solid var(--team-color);
    border-radius: 8px;
    color: var(--team-color);
    padding: 6px 10px;
    cursor: pointer;
}

/* Quantos humanos: seis botões pequenos lado a lado */
.hub-options-count {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.hub-options-count .hub-option {
    padding: 4px;
    gap: 0;
}

.hub-options-count .hub-option-title {
    font-size: 1.2rem;
}

.hub-options-count .hub-option-desc {
    font-size: 0.7rem;
}

/* Linhas dos jogadores em duas colunas (P1 e P2 lado a lado, P3 e P4...) */
#input-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
}

#input-rows .input-row {
    margin: 0;
    gap: 6px;
}

#input-rows .input-option,
#input-rows .team-toggle {
    padding: 5px 8px;
    font-size: 0.75rem;
    min-width: 0;
}

#input-rows .gamepad-status {
    flex-basis: 100%;
    font-size: 0.75rem;
}

#input-rows .gamepad-status:empty {
    display: none;
}

/* Código da sala para os celulares */
.phone-room {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px dashed rgba(0, 255, 255, 0.4);
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 0.85rem;
    color: #bbb;
}

.phone-room:empty {
    display: none;
}

.phone-room strong {
    color: var(--neon-blue);
}

.phone-room-code {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #ffd23f;
    text-shadow: 0 0 8px #ffd23f;
}

.phone-room-new {
    margin-left: auto;
    font-size: 0.75rem;
    background: none;
    border: 1px solid #555;
    border-radius: 6px;
    color: #aaa;
    padding: 3px 8px;
    cursor: pointer;
}

.hub-option:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none;
}

.input-option {
    font-family: 'Orbitron', sans-serif;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 255, 255, 0.4);
    border-radius: 8px;
    color: var(--text-color);
    padding: 6px 14px;
    cursor: pointer;
}

.input-option.selected {
    border-color: var(--neon-pink);
    box-shadow: 0 0 8px var(--neon-pink);
}

.gamepad-status {
    font-family: sans-serif;
    font-size: 0.9rem;
}

.gamepad-status.waiting {
    color: #ffd23f;
    animation: blink 1s infinite;
}

.gamepad-status.connected {
    color: #6dff8a;
}

@keyframes blink {
    50% { opacity: 0.35; }
}

.hub-start:disabled,
.hub-start:disabled:hover {
    background: #444;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.hub-start {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    background: var(--neon-blue);
    color: var(--background-dark);
    border: none;
    padding: 14px 32px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.3s;
}

.hub-start:hover {
    background: var(--neon-pink);
    color: var(--text-color);
    box-shadow: 0 0 15px var(--neon-pink);
}

.back-button {
    position: absolute;
    top: 14px;
    left: 14px;
    font-family: 'Orbitron', sans-serif;
    background: none;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.back-button:hover {
    background: rgba(0, 255, 255, 0.15);
}

/* --- Seleção de personagem ---
   Tudo medido pelo tamanho da tela do jogo (cqw/cqh), para caber sem rolagem em qualquer tamanho */
#character-selection {
    container-type: size;
    justify-content: flex-start;
    gap: 1.6cqh;
    padding: 2cqh 2.5cqw 2.5cqh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 35%, rgba(255, 0, 255, 0.12), transparent 60%),
        linear-gradient(180deg, rgba(10, 10, 20, 0.92), rgba(5, 5, 14, 0.97));
    --class-color: var(--neon-pink);
}

.selection-header {
    position: relative;
    width: 100%;
    text-align: center;
}

.selection-header .back-button {
    top: 0;
    left: 0;
    font-size: 1.8cqh;
}

#character-selection h1 {
    font-size: 4.4cqh;
    letter-spacing: 0.3em;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
    margin: 0;
}

.selection-title {
    font-size: 2.2cqh;
    margin: 0.4cqh 0 0;
    color: var(--neon-blue);
    text-shadow: 0 0 6px var(--neon-blue);
}

/* Selos do cabeçalho: arena escolhida e quem o P1 já pegou */
.selection-chips {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6cqh;
}

.selection-chip {
    --chip-color: var(--neon-blue);
    display: inline-flex;
    align-items: center;
    gap: 0.5cqw;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.7cqh;
    letter-spacing: 0.08em;
    padding: 0.4cqh 1cqw;
    border-radius: 999px;
    color: var(--chip-color);
    border: 1px solid var(--chip-color);
    background: color-mix(in srgb, var(--chip-color) 12%, rgba(0, 0, 0, 0.5));
    box-shadow: 0 0 8px color-mix(in srgb, var(--chip-color) 40%, transparent);
}

/* Quem já escolheu (um selo por jogador, quebrando linha se forem muitos) */
.selection-picks {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5cqh 0.5cqw;
    max-width: 34cqw;
}

.selection-picks canvas {
    width: 3.2cqh;
    height: 3.2cqh;
    image-rendering: pixelated;
}

/* Cores de cada classe */
.melee { --class-color: #ff3b6b; }
.shooter { --class-color: #00e5ff; }
.healer { --class-color: #5dff8a; }
.tank { --class-color: #b07bff; }
.cyber { --class-color: #ff3a2a; }
.random { --class-color: #ffd23f; }

/* Painel do lutador em destaque */
.selection-preview {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    gap: 2.5cqw;
    border: 1px solid color-mix(in srgb, var(--class-color) 55%, transparent);
    border-radius: 12px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--class-color) 16%, transparent), rgba(0, 0, 0, 0.35) 45%);
    box-shadow: inset 0 0 30px color-mix(in srgb, var(--class-color) 18%, transparent);
    padding: 1.5cqh 2cqw;
    box-sizing: border-box;
    transition: border-color 0.25s, background 0.25s;
}

.preview-art {
    flex: 0 0 auto;
    height: 100%;
    aspect-ratio: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Plataforma de luz embaixo do lutador */
.preview-art::before {
    content: '';
    position: absolute;
    bottom: 2%;
    width: 70%;
    height: 12%;
    border-radius: 50%;
    background: radial-gradient(ellipse, color-mix(in srgb, var(--class-color) 70%, transparent), transparent 70%);
}

#preview-canvas {
    position: relative;
    height: 100%;
    aspect-ratio: 1;
    image-rendering: pixelated;
    animation: preview-float 2.4s ease-in-out infinite;
}

@keyframes preview-float {
    50% { transform: translateY(-2.5%); }
}

.preview-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.1cqh;
    font-family: sans-serif;
}

.preview-top {
    display: flex;
    align-items: center;
    gap: 1.5cqw;
}

#preview-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 6cqh;
    margin: 0;
    color: #fff;
    text-shadow: 0 0 12px var(--class-color);
}

.preview-class {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8cqh;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.4cqh 1cqw;
    border-radius: 999px;
    color: var(--class-color);
    border: 1px solid var(--class-color);
}

.preview-style {
    margin: 0;
    font-size: 2.4cqh;
    color: #e8e8f0;
}

.preview-hp {
    display: flex;
    align-items: center;
    gap: 1cqw;
    font-size: 2cqh;
    color: #aaa;
}

.preview-hp-bar {
    flex: 0 1 30cqw;
    height: 1.3cqh;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

#preview-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #39ff7a, #b6ff3a);
    transition: width 0.3s;
}

.preview-hp strong {
    color: #fff;
}

.preview-ult {
    margin: 0;
    font-size: 2.2cqh;
    color: #fff;
}

.preview-ult span {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.7cqh;
    color: #ffd23f;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-right: 0.6cqw;
}

.preview-lore {
    margin: 0;
    font-size: 1.9cqh;
    line-height: 1.45;
    color: #9a9ab0;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Elenco: 2 fileiras de 13, com o nome da classe em cima de cada grupo */
.selection-grid {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(14, 1fr);
    gap: 0.8cqh 0.7cqw;
    width: 100%;
}

.roster-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6cqh;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--class-color);
    border-bottom: 1px solid color-mix(in srgb, var(--class-color) 45%, transparent);
    padding-bottom: 0.3cqh;
}

.character-card {
    position: relative;
    border: 2px solid color-mix(in srgb, var(--class-color) 35%, transparent);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), color-mix(in srgb, var(--class-color) 14%, rgba(0, 0, 0, 0.5)));
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.character-card:hover,
.character-card.active {
    transform: translateY(-3px);
    border-color: var(--class-color);
    box-shadow: 0 0 12px var(--class-color);
}

/* Personagem já escolhido pelo outro jogador */
.character-card.taken {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
}

.thumbnail-canvas {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    max-height: 9cqh;
    object-fit: contain;
    image-rendering: pixelated;
}

/* Card "Aleatório": um ponto de interrogação no lugar do retrato */
.random-icon {
    width: 100%;
    max-height: 9cqh;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 6cqh;
    font-weight: 700;
    color: var(--class-color);
    text-shadow: 0 0 10px var(--class-color);
}

.character-card h2 {
    width: 100%;
    margin: 0;
    padding: 0.4cqh 0;
    text-align: center;
    font-size: 1.45cqh;
    letter-spacing: 0.05em;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Tela de Controles --- */
.loading-controls {
    border: 1px solid var(--neon-blue);
    padding: 25px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    width: 90%;
    box-sizing: border-box;
}

.loading-controls h3 {
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
    margin-top: 0;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
}

.loading-controls p {
    margin: 10px 0;
    font-family: sans-serif;
    font-size: 1.2rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px 20px;
}

/* --- HUD do Jogo --- */
/* Aviso de erro: aparece no canto quando algo dá errado no meio da luta (o jogo continua rodando) */
.error-toast {
    position: fixed;
    left: 12px;
    bottom: 12px;
    max-width: min(560px, calc(100vw - 24px));
    padding: 8px 12px;
    background: rgba(40, 6, 12, 0.92);
    border: 1px solid #ff5a5a;
    border-radius: 8px;
    color: #ffd0d0;
    font: 12px/1.4 monospace;
    white-space: pre-wrap;
    z-index: 1000;
    display: none;
}
.error-toast.show { display: block; }

/* Modo Treino: barra embaixo da arena com o dano no boneco e os botões de trocar lutador e sair */
.training-bar {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 12px;
    background: rgba(10, 8, 24, 0.82);
    border: 1px solid var(--neon-blue);
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: #ddd;
    white-space: nowrap;
    z-index: 6;
}
.training-tag { color: var(--neon-blue); font-weight: bold; }
.training-combo { color: #ffd23f; min-width: 150px; }
.training-best { color: #aaa; }
.training-button {
    font-family: inherit;
    font-size: 11px;
    padding: 4px 10px;
    background: transparent;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
}
.training-button:hover { border-color: var(--neon-pink); color: var(--neon-pink); }

#hud {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

.team-hud {
    width: 45%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.player-hud {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--team-color);
}

.team-0 { --team-color: #00ffff; }
.team-1 { --team-color: #ff4dff; }

.team-1 .player-hud {
    text-align: right;
}

.player-hud h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.controller-tag {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--team-color);
    color: var(--background-dark);
    vertical-align: middle;
}

.player-hud.dead {
    opacity: 0.35;
    filter: grayscale(1);
}

/* Placar compacto para 2v2 e 3v3: os cartões de cada time ficam lado a lado numa linha */
#hud.hud-compact {
    top: 8px;
}

.hud-compact .team-hud {
    flex-direction: row;
}

.hud-compact .player-hud {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
}

.hud-compact .player-hud h3 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-compact .player-hud h3 {
    font-size: 0.8rem;
    margin: 0 0 3px 0;
}

.hud-compact .health-bar-outer,
.hud-compact .energy-bar-outer,
.hud-compact .transform-bar-outer {
    height: 8px;
    padding: 1px;
    margin-top: 2px;
}

.hud-compact .bar-text {
    display: none;
}

.hud-compact .status-effects {
    min-height: 0;
    margin-top: 2px;
}

.hud-compact .status-icon {
    font-size: 13px;
}

.health-bar-outer,
.energy-bar-outer {
    width: 100%;
    height: 20px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 5px;
    margin-top: 5px;
    padding: 2px;
    position: relative; /* Para posicionar o texto */
}

.health-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #aaff00);
    border-radius: 3px;
    transition: width 0.3s;
}

.energy-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), #00aaff);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Ultimate pronta: a barra fica dourada e pisca */
.energy-bar-inner.ready {
    background: linear-gradient(90deg, #ffd23f, #ffef8a);
    animation: ult-ready 0.6s ease-in-out infinite alternate;
}

@keyframes ult-ready {
    from { box-shadow: 0 0 2px #ffd23f; }
    to { box-shadow: 0 0 10px #ffd23f; }
}

/* Barra de transformação do Zarek */
.transform-bar-outer {
    width: 100%;
    height: 14px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 5px;
    margin-top: 5px;
    padding: 2px;
    position: relative;
}

.transform-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #6a4c9c, #b9b2d6);
    border-radius: 3px;
    transition: width 0.3s;
}

.transform-bar-inner.form-red {
    background: linear-gradient(90deg, #8a1020, #ff3b4a);
    box-shadow: 0 0 8px #ff2a3a;
}

.transform-bar-inner.form-blue {
    background: linear-gradient(90deg, #1b4f99, #5fd0ff);
    box-shadow: 0 0 8px #3fb8ff;
}

.transform-bar-outer .bar-text {
    font-size: 11px;
}

.bar-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: white;
    text-shadow: 1px 1px 2px black;
    font-family: sans-serif;
    font-weight: bold;
}

.status-effects {
    min-height: 25px;
    margin-top: 5px;
    display: flex;
    gap: 10px;
}

.team-1 .status-effects {
    justify-content: flex-end;
}

.status-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
}

.status-icon .stack-count {
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px black;
    margin-left: 2px;
}

/* --- Tela de Fim de Jogo --- */
#game-over-screen button {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    background: var(--neon-blue);
    color: var(--background-dark);
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    text-shadow: none;
    transition: all 0.3s;
}

.game-over-buttons {
    display: flex;
    gap: 16px;
}

/* Controles na tela de carregamento (vários jogadores lado a lado) */
.controls-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 30px;
}

.controls-columns h4 {
    margin: 0 0 6px 0;
    font-size: 1.3rem;
}

.controls-hint {
    font-family: sans-serif;
    text-align: center;
    color: #bbb;
    margin-top: 14px;
}

#game-over-screen button:hover {
    background-color: var(--neon-pink);
    color: var(--text-color);
    box-shadow: 0 0 15px var(--neon-pink);
}

/* --- Controle de Volume --- */
#volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 6px 14px;
    border: 1px solid var(--neon-blue);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

#volume-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
}

#volume-slider {
    width: 140px;
    accent-color: var(--neon-pink);
    cursor: pointer;
}

#volume-value {
    min-width: 3.5em;
    font-size: 0.9rem;
    color: var(--neon-blue);
}

#sfx-mode {
    padding: 3px 10px;
    border: 1px solid var(--neon-pink);
    border-radius: 12px;
    background: rgba(255, 0, 170, 0.15);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
}

#sfx-mode.off {
    border-color: var(--neon-blue);
    background: rgba(0, 255, 255, 0.1);
}

#win-text {
    font-size: 6rem;
    text-shadow: 0 0 20px var(--neon-pink);
}

/* Fim de luta: escurece só em cima e embaixo, para a comemoração do vencedor aparecer no meio */
#game-over-screen {
    background: linear-gradient(rgba(10, 10, 20, 0.8), rgba(10, 10, 20, 0.05) 35%, rgba(10, 10, 20, 0.05) 65%, rgba(10, 10, 20, 0.85));
    justify-content: space-between;
    padding: 24px 20px 30px;
}

/* Estatísticas do fim da luta */
#match-stats table {
    margin: 10px auto 14px;
    border-collapse: collapse;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    background: rgba(10, 6, 24, 0.75);
    border: 1px solid rgba(63, 246, 255, 0.35);
    border-radius: 6px;
}
#match-stats th {
    color: #9fa8c8;
    font-weight: 400;
    font-size: 11px;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(63, 246, 255, 0.25);
}
#match-stats td {
    padding: 4px 12px;
    text-align: right;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}
#match-stats td.stats-name {
    text-align: left;
    font-weight: 700;
}

/* Escolha da arena: 5 opções em grade */
.hub-options-maps {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
}
.hub-options-maps .hub-option {
    padding: 8px 6px;
}
.hub-options-maps .hub-option-title {
    font-size: 14px;
}
.hub-options-maps .hub-option-desc {
    font-size: 10px;
}
@media (max-width: 900px) {
    .hub-options-maps { grid-template-columns: repeat(2, 1fr); }
}

/* --- Modo Chefão: barra do Cérbero-X (uma por cabeça) no lugar do time rosa --- */
.boss-option { --class-color: #ff3b3b; border-color: rgba(255, 59, 59, 0.5); }
.boss-hud {
    background: rgba(10, 0, 8, 0.65);
    border: 1px solid #ff3b3b;
    border-radius: 5px;
    padding: 6px 10px;
    box-shadow: 0 0 12px rgba(255, 40, 40, 0.35);
}
.boss-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}
.boss-name {
    font-family: Orbitron, sans-serif;
    font-weight: bold;
    color: #ff3b3b;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(255, 40, 40, 0.8);
}
.boss-phase { font-size: 0.75rem; color: #ffd23f; }
.boss-heads { display: flex; gap: 6px; }
.boss-head { flex: 1; min-width: 0; opacity: 0.75; transition: opacity 0.2s; }
.boss-head.active { opacity: 1; }
.boss-head.active .boss-head-bar { box-shadow: 0 0 8px var(--head-color); }
.boss-head.dead { opacity: 0.3; filter: grayscale(1); }
.boss-head-name {
    display: block;
    font-size: 0.7rem;
    color: var(--head-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.boss-head-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--head-color);
    border-radius: 3px;
    overflow: hidden;
}
.boss-head-fill { height: 100%; width: 100%; background: var(--head-color); transition: width 0.15s; }
#win-text { white-space: pre-line; }

/* Matriarca: barra única e o estado do escudo */
.matri-hud { border-color: #ff2aff; box-shadow: 0 0 12px rgba(255, 42, 255, 0.35); }
.matri-hud .boss-name { color: #ff2aff; text-shadow: 0 0 8px rgba(255, 42, 255, 0.8); }
.matri-bar { --head-color: #ff2aff; height: 12px; }
.matri-shield { margin-top: 4px; font-size: 0.75rem; color: #3ff6ff; }
