* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: block;
}

/* Centralizar apenas a tela do jogo */
#gameScreen {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

#gameScreen.active {
    display: flex;
}

/* Tela de vitória deve aparecer sobre todas as outras */
#winnerScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

#winnerScreen.active {
    display: flex;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #764ba2;
    margin: 20px 0 15px 0;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

h3 {
    color: #555;
    margin: 15px 0 10px 0;
    font-size: 1.2em;
}

/* Navegação de Steps */
.steps-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.step-btn {
    flex: 1;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    color: #666;
    transition: all 0.3s;
}

.step-btn:hover {
    background: #e9ecef;
    color: #333;
}

.step-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* Conteúdo dos Steps */
.step-content {
    display: none;
    animation: fadeIn 0.3s;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.step-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #667eea;
}

.player-config {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.config-group {
    margin-bottom: 15px;
}

.config-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.config-group input[type="text"],
.config-group input[type="number"],
.config-group input[type="color"],
.config-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.config-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.9em;
    font-style: italic;
}

.required {
    color: #f44336;
    font-weight: bold;
}

.optional {
    color: #888;
    font-size: 0.9em;
    font-weight: normal;
    font-style: italic;
}

.config-group audio {
    width: 100%;
    margin-top: 10px;
}

.config-group input[type="color"] {
    height: 50px;
    cursor: pointer;
}

.image-preview {
    margin-top: 10px;
    width: 150px;
    height: 150px;
    border: 2px solid #ddd;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.abilities-config,
.keys-config {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.keys-group {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.key-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.key-item label {
    min-width: 120px;
    font-weight: bold;
}

.key-input {
    flex: 1;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    background: #f8f9fa;
}

.set-key-btn {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.set-key-btn:hover {
    background: #5568d3;
}

.set-key-btn.active {
    background: #ff6b6b;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.config-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.save-load-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.save-load-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #667eea;
}

.save-load-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.save-controls,
.load-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.config-name-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.saved-configs-select {
    flex: 1;
    min-width: 250px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    background: white;
}

.btn-save {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-save:hover {
    background: #45a049;
}

.btn-load {
    padding: 10px 20px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-load:hover {
    background: #1976d2;
}

.btn-delete {
    padding: 10px 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #d32f2f;
}

/* Estilos para Combos */
.combos-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.combo-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.combo-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.combo-name {
    flex: 1;
    min-width: 150px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.combo-key-config {
    display: flex;
    align-items: center;
    gap: 10px;
}

.combo-key-config label {
    font-weight: bold;
    margin: 0;
}

.combo-key-input {
    width: 60px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    background: #f8f9fa;
}

.set-combo-key-btn {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.set-combo-key-btn:hover {
    background: #5568d3;
}

.set-combo-key-btn.active {
    background: #ff6b6b;
}

.btn-remove-combo {
    padding: 8px 15px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-remove-combo:hover {
    background: #d32f2f;
}

.combo-actions {
    margin: 15px 0;
}

.combo-actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.combo-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.combo-action-type {
    flex: 1;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
}

.combo-action-delay {
    width: 100px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
}

.btn-remove-action {
    width: 30px;
    height: 30px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-remove-action:hover {
    background: #d32f2f;
}

.btn-add-action {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-add-action:hover {
    background: #45a049;
}

.btn-add-combo {
    padding: 12px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.btn-add-combo:hover {
    background: #5568d3;
}

.combo-preview {
    margin-top: 15px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.combo-preview strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
}

.combo-preview-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.combo-preview-action {
    padding: 5px 10px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
}

.combo-preview-empty {
    color: #888;
    font-style: italic;
}

/* Estilos para Lista de Sons */
.sounds-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.sound-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.sound-file-input {
    flex: 1;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.sound-preview {
    flex: 1;
    max-width: 300px;
}

.btn-remove-sound {
    padding: 8px 15px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-remove-sound:hover {
    background: #d32f2f;
}

.btn-add-sound {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    margin-top: 5px;
}

.btn-add-sound:hover {
    background: #45a049;
}

.btn-secondary {
    padding: 12px 25px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Tela de Jogo */
.game-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.player-info {
    flex: 1;
}

.player-info.left {
    text-align: left;
}

.player-info.right {
    text-align: right;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.player-info.left .player-header {
    justify-content: flex-start;
}

.player-info.right .player-header {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #333;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.player-name {
    font-size: 1.5em;
    font-weight: bold;
}

.health-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.health-bar {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    height: 32px;
    background: #e8e8e8;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #d0d0d0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #66bb6a 50%, #81c784 100%);
    transition: width 0.5s ease;
    width: 100%;
    position: relative;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.health-fill.low {
    background: linear-gradient(90deg, #f44336 0%, #ef5350 50%, #e57373 100%);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

.health-text {
    font-weight: bold;
    font-size: 1em;
    min-width: 70px;
    text-align: right;
    color: #333;
    font-variant-numeric: tabular-nums;
}

.player-info.right .health-text {
    text-align: left;
}

.special-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.special-bar-label {
    font-weight: bold;
    font-size: 0.9em;
    min-width: 60px;
}

.special-bar {
    width: 300px;
    height: 20px;
    background: #2c2c2c;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #555;
}

.special-fill {
    height: 100%;
    background: linear-gradient(90deg, #9c27b0 0%, #e91e63 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.special-fill.ready {
    background: linear-gradient(90deg, #ffeb3b 0%, #ff9800 100%);
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.8);
    animation: specialReadyPulse 1s ease-in-out infinite;
}

@keyframes specialReadyPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 235, 59, 0.8);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 235, 59, 1);
    }
}

.special-text {
    font-weight: bold;
    font-size: 0.9em;
    color: #333;
}

.turn-indicator {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0 15px;
    min-width: 150px;
}

.game-arena {
    position: relative;
    width: 100%;
    height: 800px;
    background: linear-gradient(to bottom, #87ceeb 0%, #98d8c8 100%);
    border-radius: 10px;
    border: 3px solid #333;
    overflow: visible;
    margin-bottom: 20px;
}

#damageContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.player-character {
    position: absolute;
    bottom: 50px;
    width: 500px;
    height: 350px;
    transition: left 0.3s ease, right 0.3s ease;
}

#player1Character {
    left: 100px;
}

#player2Character {
    right: 100px;
}

.character-sprite {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    image-rendering: pixelated;
}

.action-indicator {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
}

.action-indicator.show {
    opacity: 1;
}

.game-controls {
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Tela de Resultado */
.result-container {
    max-width: 1000px;
    margin: 30px auto;
    background: white;
    border-radius: 15px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10000;
}

.winner-celebration {
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 15px;
    border: 3px solid rgba(102, 126, 234, 0.3);
}

.winner-large-image {
    width: 400px;
    height: 500px;
    margin: 0 auto 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 15px;
    border: 5px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: winnerPulse 2s ease-in-out infinite;
}

@keyframes winnerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
    }
}

.winner-message {
    font-size: 4em;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.winner-instructions {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    font-size: 1.1em;
    color: #666;
}

.key-hint {
    display: inline-block;
    padding: 5px 15px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.2em;
    margin: 0 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#winnerTitle {
    font-size: 3em;
    color: #4caf50;
    margin-bottom: 30px;
}

.result-characters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.character-result {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    padding: 20px;
    border-radius: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.winner-character {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
    transform: scale(1.05);
}

.loser-character {
    background: linear-gradient(135deg, #f44336 0%, #ff9800 100%);
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.3);
    opacity: 0.8;
}

.character-result-image {
    width: 200px;
    height: 250px;
    margin: 0 auto 15px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.character-result-name {
    font-size: 1.8em;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.character-result-label {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.vs-divider {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 80px;
}

.winner-name {
    font-size: 2em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Animações */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.character-sprite.shake {
    animation: shake 0.5s;
}

@keyframes attack {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes attackMirrored {
    0%, 100% { transform: scaleX(-1) scale(1); }
    50% { transform: scaleX(-1) scale(1.2); }
}

.character-sprite.attack {
    animation: attack 0.3s;
}

.character-sprite.attack.mirrored {
    animation: attackMirrored 0.3s;
}

@keyframes hit {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.character-sprite.hit {
    animation: hit 0.3s;
}

/* Animação de Dano */
.damage-number {
    position: absolute;
    font-size: 2.5em !important;
    font-weight: bold;
    color: #ff0000;
    text-shadow: 
        2px 2px 0px #000,
        -2px -2px 0px #000,
        2px -2px 0px #000,
        -2px 2px 0px #000,
        0px 0px 10px rgba(255, 0, 0, 0.8);
    pointer-events: none;
    z-index: 1001;
    user-select: none;
    animation: damageFloat 1s ease-out forwards;
    transform-origin: center;
}

/* Animação de Cura */
.heal-number {
    position: absolute;
    font-size: 2.5em !important;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 
        2px 2px 0px #000,
        -2px -2px 0px #000,
        2px -2px 0px #000,
        -2px 2px 0px #000,
        0px 0px 10px rgba(0, 255, 0, 0.8);
    pointer-events: none;
    z-index: 1001;
    user-select: none;
    animation: damageFloat 1s ease-out forwards;
    transform-origin: center;
}

/* Modal de Gerenciamento */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
    border: none;
    padding: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.config-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.config-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.config-info {
    flex: 1;
}

.config-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.config-date {
    color: #666;
    font-size: 0.9em;
}

.config-actions {
    display: flex;
    gap: 10px;
}

.btn-edit, .btn-delete-item, .btn-load-item {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-edit {
    background: #4caf50;
    color: white;
}

.btn-edit:hover {
    background: #45a049;
}

.btn-load-item {
    background: #2196f3;
    color: white;
}

.btn-load-item:hover {
    background: #1976d2;
}

.btn-delete-item {
    background: #f44336;
    color: white;
}

.btn-delete-item:hover {
    background: #d32f2f;
}

.btn-update {
    background: #ff9800;
    color: white;
}

.btn-update:hover {
    background: #f57c00;
}

.btn-cancel {
    background: #9e9e9e;
    color: white;
}

.btn-cancel:hover {
    background: #757575;
}

.btn-manage {
    background: #9c27b0;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-manage:hover {
    background: #7b1fa2;
}

.configs-management {
    margin-top: 15px;
}

.empty-configs {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-configs p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

@keyframes missAnimation {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(-50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-30px) translateX(-50%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translateY(-50px) translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-70px) translateX(-50%) scale(0.8);
    }
}

@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(-50%) scale(0.8);
    }
    30% {
        opacity: 1;
        transform: translateY(-20px) translateX(-50%) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) translateX(-50%) scale(0.6);
    }
}


/* Estilos para Mensagens do Jogo */
.message-container {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 80%;
    pointer-events: none;
}

.game-message {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 2px solid #ffd700;
    animation: messageSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 100%;
    word-wrap: break-word;
}

.game-message.fade-out {
    animation: messageFadeOut 0.5s forwards;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes messageFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Barras de Fila de Ataques */
.queue-bar-container {
    position: absolute;
    top: 50px;
    bottom: 50px;
    width: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    z-index: 5;
    display: flex;
    flex-direction: column-reverse; /* Encher de baixo para cima */
}

.queue-bar-container.left {
    left: 20px;
}

.queue-bar-container.right {
    right: 20px;
}

.queue-bar-fill {
    width: 100%;
    height: 0%;
    transition: height 0.3s ease-out, background-color 0.3s;
}

.queue-bar-container.left .queue-bar-fill {
    background-color: #ff4444; /* Vermelho para Player 1 */
    box-shadow: 0 0 10px #ff4444;
}

.queue-bar-container.right .queue-bar-fill {
    background-color: #4444ff; /* Azul para Player 2 */
    box-shadow: 0 0 10px #4444ff;
}

/* Overlay de Top Doadores */
.top-donors-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.top-donors-panel {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.top-donors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.top-donors-header h2 {
    color: #667eea;
    margin: 0;
    font-size: 28px;
}

.close-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.top-donors-content {
    min-height: 200px;
}

.loading-donors {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.donor-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.donor-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.donor-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.donor-rank {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.donor-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    flex: 1;
}

.donor-item.rank-1 {
    border-left-color: #ffd700;
    background: #fffbf0;
}

.donor-item.rank-1 .donor-rank {
    color: #ffd700;
}

.donor-item.rank-2 {
    border-left-color: #c0c0c0;
    background: #f5f5f5;
}

.donor-item.rank-2 .donor-rank {
    color: #c0c0c0;
}

.donor-item.rank-3 {
    border-left-color: #cd7f32;
    background: #faf5f0;
}

.donor-item.rank-3 .donor-rank {
    color: #cd7f32;
}

.empty-donors {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.queue-count {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px black;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Prompt de Comando */
.command-prompt {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #667eea;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 400px;
    max-width: 500px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.command-prompt-content {
    padding: 15px;
}

.command-prompt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.command-prompt-icon {
    font-size: 20px;
}

.command-prompt-label {
    flex: 1;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

.command-prompt-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background 0.2s;
}

.command-prompt-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.command-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #667eea;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.command-input:focus {
    outline: none;
    border-color: #764ba2;
    background: rgba(255, 255, 255, 0.15);
}

.command-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.command-suggestions {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.command-suggestion {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #667eea;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    font-size: 13px;
}

.command-suggestion:hover,
.command-suggestion.selected {
    background: rgba(102, 126, 234, 0.3);
    border-left-color: #764ba2;
    transform: translateX(5px);
}

.command-help {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
    max-height: 300px;
    overflow-y: auto;
}

.command-help-title {
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
}

.command-help-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.command-help-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #764ba2;
}

.command-help-command {
    color: #667eea;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    margin-bottom: 5px;
}

.command-help-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

/* ============================================
   RESPONSIVIDADE PARA DISPOSITIVOS MÓVEIS
   ============================================ */

@media screen and (max-width: 768px) {
    /* Ajustes gerais */
    body {
        padding: 10px;
    }
    
    .screen {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 10px;
    }
    
    /* Títulos */
    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    
    h2 {
        font-size: 1.3em;
        margin: 15px 0 10px 0;
    }
    
    h3 {
        font-size: 1em;
    }
    
    /* Navegação de Steps */
    .steps-navigation {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .step-btn {
        padding: 8px 12px;
        font-size: 0.85em;
        flex: 1 1 calc(50% - 5px);
        min-width: calc(50% - 5px);
    }
    
    /* Formulários */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9em;
    }
    
    input[type="text"],
    input[type="number"],
    input[type="url"],
    select,
    textarea {
        padding: 8px;
        font-size: 14px;
    }
    
    /* Botões */
    button,
    .btn-primary,
    .btn-secondary {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    /* Tela do Jogo */
    .game-screen {
        padding: 10px;
    }
    
    .game-container {
        padding: 10px;
    }
    
    /* Informações dos Players */
    .player-info {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .player-avatar {
        width: 40px;
        height: 40px;
    }
    
    .player-name {
        font-size: 1.1em;
    }
    
    .health-bar {
        width: 100%;
        max-width: 200px;
        height: 25px;
    }
    
    .health-text {
        font-size: 0.9em;
    }
    
    .special-bar {
        width: 100%;
        max-width: 200px;
        height: 18px;
    }
    
    .special-bar-label,
    .special-text {
        font-size: 0.8em;
    }
    
    .turn-indicator {
        font-size: 1em;
        padding: 8px 15px;
    }
    
    /* Arena do Jogo */
    .game-arena {
        height: 400px;
        min-height: 400px;
        border-radius: 8px;
        border-width: 2px;
    }
    
    /* Players na Arena */
    .player-character {
        width: 200px;
        height: 200px;
        bottom: 30px;
    }
    
    #player1Character {
        left: 10px;
    }
    
    #player2Character {
        right: 10px;
    }
    
    .action-indicator {
        top: -25px;
        font-size: 0.8em;
        padding: 3px 10px;
    }
    
    /* Barras de Fila de Ataques */
    .queue-bar-container {
        width: 15px;
        top: 30px;
        bottom: 30px;
    }
    
    .queue-bar-container.left {
        left: 5px;
    }
    
    .queue-bar-container.right {
        right: 5px;
    }
    
    .queue-count {
        font-size: 0.7em;
    }
    
    /* Controles do Jogo */
    .game-controls {
        gap: 5px;
        padding: 10px 0;
    }
    
    .game-controls button {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    /* Mensagens e Animações */
    .message-container {
        font-size: 0.9em;
    }
    
    /* Tela de Resultado */
    .result-container {
        padding: 20px;
        margin: 20px auto;
    }
    
    .winner-name {
        font-size: 2em;
    }
    
    .winner-avatar {
        width: 120px;
        height: 120px;
    }
    
    /* Modal de Top Doadores */
    .top-donors-panel {
        padding: 20px;
        max-width: 95%;
        max-height: 90vh;
    }
    
    .top-donors-header h2 {
        font-size: 1.5em;
    }
    
    /* Prompt de Comando */
    .command-prompt {
        padding: 15px;
    }
    
    .command-prompt input {
        font-size: 16px; /* Evita zoom no iOS */
        padding: 10px;
    }
    
    .command-help {
        max-height: 50vh;
    }
    
    /* Tabelas */
    table {
        font-size: 0.85em;
    }
    
    table th,
    table td {
        padding: 8px 5px;
    }
    
    /* Grid de Configuração */
    .config-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Cards */
    .card {
        padding: 15px;
    }
}

@media screen and (max-width: 480px) {
    /* Ajustes para telas muito pequenas */
    h1 {
        font-size: 1.5em;
    }
    
    .container {
        padding: 10px;
    }
    
    .step-btn {
        font-size: 0.75em;
        padding: 6px 8px;
    }
    
    .player-character {
        width: 150px;
        height: 150px;
    }
    
    .game-arena {
        height: 350px;
        min-height: 350px;
    }
    
    .health-bar {
        max-width: 150px;
        height: 20px;
    }
    
    .special-bar {
        max-width: 150px;
        height: 15px;
    }
    
    .player-name {
        font-size: 1em;
    }
    
    .turn-indicator {
        font-size: 0.9em;
        padding: 6px 12px;
    }
    
    #player1Character {
        left: 5px;
    }
    
    #player2Character {
        right: 5px;
    }
    
    .queue-bar-container {
        width: 12px;
    }
}

/* Ajustes para orientação landscape em mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .game-arena {
        height: 300px;
        min-height: 300px;
    }
    
    .player-character {
        width: 180px;
        height: 180px;
    }
    
    .screen {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
    }
}
