/* === BATTLE MENU STYLES === */

.battle-menu-body {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    font-family: Arial, sans-serif;
    margin: 0;
    overflow-x: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
    background: transparent !important;
}

.battle-menu-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/background.jpg') center center / cover no-repeat;
    z-index: -1;
}

/* Alternative background positioning for mobile */
@media (max-width: 768px) {
    .battle-menu-body::before {
        background-position: center center;
        background-size: cover;
    }
}

@media (max-width: 480px) {
    .battle-menu-body {
        padding: 15px;
    }
    
    .battle-menu-body::before {
        background-position: center center;
        background-size: cover;
    }
}

.battle-menu-container {
    max-width: 1200px;
    margin: 0 auto;
}

.battle-header, .battle-settings, .teams-overview, .battle-controls {
    background: rgba(0, 0, 0, 0.85);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    color: white;
    border: 2px solid rgba(231, 76, 60, 0.3);
}

/* Header */
.battle-header {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    color: white;
}

.battle-logo {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));
    margin-bottom: 20px;
}

.battle-title {
    color: #e74c3c;
    text-align: center;
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.battle-subtitle {
    text-align: center;
    color: #ecf0f1;
    margin: 0;
}

/* Battle Settings */
.battle-settings {
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    color: white;
}

.settings-section h2 {
    color: #e74c3c;
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    text-align: center;
}

.setting-item {
    margin-bottom: 30px;
}

.setting-label {
    display: block;
    color: #ecf0f1;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
}

/* Time Options */
.time-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.time-btn {
    background: rgba(52, 73, 94, 0.6);
    color: white;
    border: 2px solid #7f8c8d;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: bold;
    min-width: 80px;
}

.time-btn:hover {
    background: rgba(231, 76, 60, 0.6);
    border-color: #e74c3c;
    transform: translateY(-2px);
}

.time-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
}

/* Size Options */
.size-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.size-btn {
    background: rgba(52, 73, 94, 0.6);
    color: white;
    border: 2px solid #7f8c8d;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: bold;
    min-width: 80px;
}

.size-btn:hover {
    background: rgba(231, 76, 60, 0.6);
    border-color: #e74c3c;
    transform: translateY(-2px);
}

.size-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
}

/* Mode Options */
.mode-options {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.mode-btn {
    background: #3498db;
    border: 2px solid #7f8c8d;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.mode-btn:hover {
    background: rgba(231, 76, 60, 0.6);
    border-color: #e74c3c;
    transform: translateY(-2px);
}

.mode-btn.active {
    background: #e74c3c;
    color: white;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.mode-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.mode-name {
    color: #ecf0f1;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.mode-desc {
    color: #bdc3c7;
    font-size: 0.9rem;
    line-height: 1.3;
}

/* Teams Overview */
.teams-overview {
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    color: white;
}

.teams-overview h2 {
    color: #e74c3c;
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    text-align: center;
}

.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

/* Team Preview */
.team-preview {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    color: #2c3e50;                /* ← Přidáno: tmavý text pro celý preview */
}

.team-preview.red-team {
    border-color: #e74c3c;
}

.team-preview.blue-team {
    border-color: #3498db;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.team-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50 !important;     /* ← Zesíleno: tmavý text */
}

.team-count {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50 !important;     /* ← Změna: tmavý text místo světle šedé */
}

/* Team Status */
.team-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 8px;
    background: #ecf0f1;
}

.team-status.ready {
    background: rgba(46, 204, 113, 0.2);
    color: #1e8449 !important;     /* ← Změna: tmavší zelená pro lepší čitelnost */
}

.team-status.not-ready {
    background: rgba(231, 76, 60, 0.2);
    color: #a93226 !important;     /* ← Změna: tmavší červená pro lepší čitelnost */
}

.status-icon {
    font-size: 1.5rem;
    margin-right: 5px;
}

.status-text {
    font-weight: bold;
    color: inherit;                /* ← Použije barvu od rodiče (.team-status) */
}

/* Team Members */
.team-members {
    min-height: 120px;
    margin-bottom: 20px;
}

.member-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.member-mini.red {
    border-left-color: #e74c3c;
}

.team-member-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.3s ease;
    color: #2c3e50;                /* ← Přidáno: tmavý text */
}

.team-member-mini:hover {
    background: rgba(255, 255, 255, 0.2);
}

.member-mini-image {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.member-mini-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-mini-placeholder {
    font-size: 1.2rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.member-mini-info {
    flex: 1;
    min-width: 0;
}

.member-mini-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #2c3e50 !important;    /* ← Změna: tmavý text místo inherit */
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty Team */
.empty-team {
    text-align: center;
    color: #6c757d !important;     /* ← Zesíleno: středně šedá pro lepší čitelnost */
    font-style: italic;
    padding: 40px 20px;
}

/* Team Actions */
.team-actions {
    text-align: center;
}

.team-edit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.team-edit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    transform: translateY(-2px);
}

/* Battle Controls */
.battle-controls {
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    color: white;
    text-align: center;
}

.battle-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 10px;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.battle-status.ready {
    background: rgba(46, 204, 113, 0.2);
    color: #27ae60;
}

/* Status message text improvements */
.status-message {
    color: #ecf0f1 !important; /* Světle šedý/bílý text pro lepší čitelnost */
    font-weight: 500;
    font-size: 1.1rem;
}

.battle-status.ready .status-message {
    color: #ecf0f1 !important; /* Bílý text i pro ready stav */
}

/* Status icon improvements */
.status-icon {
    font-size: 1.5rem;
    margin-right: 5px;
}

/* Start Battle Modal */
.start-battle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.start-battle-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.start-battle-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.start-battle-overlay.visible .start-battle-content {
    transform: scale(1);
}

.start-battle-content h3 {
    margin: 0 0 25px 0;
    color: #e74c3c;
    font-size: 1.8rem;
}

.battle-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: left;
    border: 2px solid #ecf0f1;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 1rem;
    align-items: center;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item span:first-child {
    color: #2c3e50; /* Tmavý text pro labely */
    font-weight: 600;
}

.summary-item span:last-child {
    color: #e74c3c; /* Červený text pro hodnoty */
    font-weight: bold;
    font-size: 1.1rem;
}

/* Specific styling for summary values */
#summaryMode {
    color: #e74c3c !important;
    font-weight: bold !important;
}

#summarySize {
    color: #3498db !important;
    font-weight: bold !important;
}

#summaryTime {
    color: #f39c12 !important;
    font-weight: bold !important;
}

.battle-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.confirm-start-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirm-start-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

.cancel-start-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-start-btn:hover {
    background: #7f8c8d;
}

.bottom-spacing {
    height: 50px;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.start-battle-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    border: 2px solid transparent;
}

.start-battle-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.start-battle-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-btn {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.3);
    border: 2px solid transparent;
}

.back-btn:hover {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 140, 141, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .battle-menu-container {
        padding: 0 10px;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
    }
    
    .time-options, .size-options {
        justify-content: stretch;
    }
    
    .time-btn, .size-btn {
        flex: 1;
        min-width: auto;
    }
    
    .mode-options {
        grid-template-columns: 1fr;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .battle-header {
        padding: 20px 15px;
    }
    
    .battle-title {
        font-size: 2rem;
    }
    
    .battle-settings, .teams-overview, .battle-controls {
        padding: 20px 15px;
    }
    
    .team-preview {
        padding: 20px 15px;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* === MULTIPLAYER SECTION === */
.multiplayer-section {
    background: rgba(0, 0, 0, 0.85);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    color: white;
    border: 2px solid rgba(231, 76, 60, 0.3);
}

.multiplayer-section h2 {
    color: #e74c3c;
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    text-align: center;
}

.multiplayer-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.multiplayer-option-btn {
    background: rgba(52, 73, 94, 0.6);
    color: white;
    border: 2px solid #7f8c8d;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.multiplayer-option-btn:hover {
    background: rgba(231, 76, 60, 0.6);
    border-color: #e74c3c;
    transform: translateY(-2px);
}

.multiplayer-option-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.multiplayer-option-btn .btn-icon {
    font-size: 1.2rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .multiplayer-controls {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .multiplayer-option-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
}

/* === MULTIPLAYER MODAL === */
.multiplayer-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.multiplayer-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.multiplayer-modal-content {
    background: #2c3e50;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #34495e;
}

.multiplayer-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.multiplayer-modal-header h2 {
    color: #ecf0f1;
    margin: 0;
    text-align: center;
}

.close-btn {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.close-btn:hover {
    color: #e74c3c;
}

.join-input-section {
    text-align: center;
}

.join-input-section h3 {
    color: #ecf0f1;
    margin-bottom: 15px;
}

.join-input-section p {
    color: #bdc3c7;
    margin-bottom: 20px;
}

#roomCodeInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #34495e;
    border-radius: 8px;
    background: rgba(52, 73, 94, 0.5);
    color: #ecf0f1;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.multiplayer-btn {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.multiplayer-btn:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* === MULTIPLAYER INFO STYLES === */
.multiplayer-info {
    background: rgba(39, 174, 96, 0.2);
    border: 2px solid #27ae60;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.multiplayer-status-display {
    text-align: center;
}

#connectionStatus {
    font-weight: bold;
    margin-bottom: 15px;
    color: #ecf0f1;
}

#roomInfo {
    background: rgba(52, 73, 94, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#roomCodeDisplay {
    color: #f39c12;
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: bold;
}

.copy-btn {
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.copy-btn:hover {
    background: #e67e22;
}

#playersInfo {
    margin-top: 15px;
}

.players-count {
    color: #ecf0f1;
    font-weight: bold;
    margin-bottom: 10px;
}

.player-item {
    background: rgba(52, 73, 94, 0.3);
    border-radius: 5px;
    padding: 10px;
    margin: 5px 0;
    color: #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-ready {
    color: #27ae60;
    font-weight: bold;
}

.player-not-ready {
    color: #e74c3c;
}

/* PŘIDÁNO: Guest waiting button style */
button[disabled] {
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

.btn-icon {
    margin-right: 8px;
}

/* === MULTIPLAYER BUTTON STATES === */
.start-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    border: 2px solid transparent;
    min-width: 250px;
}

.start-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Guest waiting state */
.start-btn[style*="background: rgb(243, 156, 18)"] {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3) !important;
    cursor: not-allowed !important;
}

/* Teams not ready state */
.start-btn[style*="background: rgb(127, 140, 141)"] {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6) !important;
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.3) !important;
    cursor: not-allowed !important;
}

.start-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.9 !important;
    transform: none !important;
}