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

body {
    font-family: 'Arial', sans-serif;
    color: #ecf0f1;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    /* Přidání pozadí camo.png */
    background: url('/tiny_tactix/img/camo.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
   
    background-position: center, center;
    background-attachment: fixed, fixed;
}


.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(44, 62, 80, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    border: 2px solid #3498db;
    position: relative;
    z-index: 1;
}

/* Header section s logem a tlačítkem zpět */
.header-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.logo-container {
    justify-self: start;
}

.game-logo {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    transition: transform 0.3s ease;
}

.game-logo:hover {
    transform: scale(1.05);
}

h1 {
    text-align: center;
    color: #3498db;
    font-size: 2.2rem;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 2px;
    background: linear-gradient(135deg, #3498db, #5dade2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    justify-self: center;
}

.back-button-container {
    justify-self: end;
}

/* Tlačítko zpět do menu */
.menu-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(52, 152, 219, 0.4);
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-btn-back {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    border-color: #95a5a6;
}

.menu-btn-back:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7a7d);
    box-shadow: 0 8px 16px rgba(149, 165, 166, 0.4);
}

.btn-icon {
    font-size: 16px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    background: rgba(52, 73, 94, 0.3);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: bold;
    color: #ecf0f1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 1rem;
}

select, button {
    padding: 12px 18px;
    border: 2px solid #3498db;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

select {
    background: #34495e;
    color: #ecf0f1;
}

select:focus {
    outline: none;
    border-color: #5dade2;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    cursor: pointer;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(52, 152, 219, 0.4);
}

button:active {
    transform: translateY(0);
}

.terrain-selector {
    margin-bottom: 30px;
    text-align: center;
    background: rgba(52, 73, 94, 0.3);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.terrain-selector h3 {
    color: #ecf0f1;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.terrain-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.terrain-btn {
    padding: 12px 20px;
    background-color: #6c757d;
    border: 3px solid transparent;
    font-size: 13px;
    font-weight: bold;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.terrain-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.terrain-btn:hover::before {
    left: 100%;
}

.terrain-btn.active {
    border-color: #f39c12;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.5);
    transform: scale(1.05);
}

.terrain-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Barvy pro různé typy terénu - více kontrastní */
.terrain-btn[data-terrain="open"] { 
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}
.terrain-btn[data-terrain="light"] { 
    background: linear-gradient(135deg, #f39c12, #d68910);
    color: white;
}
.terrain-btn[data-terrain="heavy"] { 
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
}
.terrain-btn[data-terrain="blocked"] { 
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}
.terrain-btn[data-terrain="red_spawn"] { 
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}
.terrain-btn[data-terrain="blue_spawn"] { 
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}
.terrain-btn[data-terrain="objective"] { 
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.map-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(52, 73, 94, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.map-grid {
    display: grid;
    gap: 2px;
    background-color: #2c3e50;
    border: 3px solid #3498db;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.map-grid.size-5 {
    grid-template-columns: repeat(5, 80px); /* Zvětšeno z 70px */
    grid-template-rows: repeat(5, 80px); /* Zvětšeno z 70px */
}

.map-grid.size-6 {
    grid-template-columns: repeat(6, 70px); /* Zvětšeno z 60px */
    grid-template-rows: repeat(6, 70px); /* Zvětšeno z 60px */
}

.grid-cell {
    background-color: #27ae60;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px;
    border: 2px solid transparent;
}

.grid-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    border-color: #f39c12;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.6);
}

/* Styly pro různé typy terénu v gridu */
.grid-cell.open { 
    background: linear-gradient(135deg, #27ae60, #229954);
}
.grid-cell.light { 
    background: linear-gradient(135deg, #f39c12, #d68910);
}
.grid-cell.heavy { 
    background: linear-gradient(135deg, #e67e22, #d35400);
}
.grid-cell.blocked { 
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}
.grid-cell.red_spawn { 
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
}
.grid-cell.blue_spawn { 
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}
.grid-cell.objective { 
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.6);
}

/* Placeholder mód - nepoužívá background images */
.map-grid.placeholder-mode .grid-cell {
    background-size: auto !important;
    background-image: none !important;
}

/* Styly pro různé typy terénu v gridu - placeholder verze */
.map-grid.placeholder-mode .grid-cell.open { 
    background: linear-gradient(135deg, #27ae60, #229954) !important;
}
.map-grid.placeholder-mode .grid-cell.light { 
    background: linear-gradient(135deg, #f39c12, #d68910) !important;
}
.map-grid.placeholder-mode .grid-cell.heavy { 
    background: linear-gradient(135deg, #e67e22, #d35400) !important;
}
.map-grid.placeholder-mode .grid-cell.blocked { 
    background: linear-gradient(135deg, #95a5a6, #7f8c8d) !important;
}
.map-grid.placeholder-mode .grid-cell.red_spawn { 
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
}
.map-grid.placeholder-mode .grid-cell.blue_spawn { 
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}
.map-grid.placeholder-mode .grid-cell.objective { 
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.6);
}

.export-section {
    margin-top: 30px;
    display: none; /* Skryto podle požadavku */
}

.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid #c0392b;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid #229954;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Generovat a vymazat tlačítka - speciální styly */
#generateMap {
    background: linear-gradient(135deg, #27ae60, #229954);
    border-color: #27ae60;
}

#generateMap:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    box-shadow: 0 8px 16px rgba(39, 174, 96, 0.4);
}

#clearMap {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
}

#clearMap:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    box-shadow: 0 8px 16px rgba(231, 76, 60, 0.4);
}

/* Fixed back button */
.fixed-back-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    backdrop-filter: blur(10px);
}

.fixed-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    max-width: 300px;
    margin: 0 auto;
    border: 2px solid transparent;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.fixed-back-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.4);
    border-color: #5dade2;
}

.fixed-back-btn:active {
    transform: translateY(-1px);
}

/* Map Manager Modal */
.map-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.map-modal-overlay.visible {
    display: flex;
}

.map-modal-content {
    background: rgba(44, 62, 80, 0.95);
    border: 2px solid #3498db;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.3);
    background: rgba(52, 152, 219, 0.1);
}

.map-modal-header h3 {
    color: #3498db;
    margin: 0;
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.map-modal-close {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.map-modal-close:hover {
    background: rgba(231, 76, 60, 0.8);
    color: white;
}

.map-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.saved-maps-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 10px;
    background: rgba(52, 73, 94, 0.3);
}

.saved-map-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.saved-map-item:last-child {
    border-bottom: none;
}

.saved-map-item:hover {
    background: rgba(52, 152, 219, 0.2);
}

.saved-map-item.selected {
    background: rgba(52, 152, 219, 0.4);
    border-left: 4px solid #3498db;
}

.map-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.map-name {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 1.1rem;
}

.map-details {
    color: #bdc3c7;
    font-size: 0.9rem;
}

.map-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.delete-map-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-map-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: scale(1.1);
}

.map-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.modal-btn {
    padding: 12px 25px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.load-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border-color: #27ae60;
}

.load-btn:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
}

.load-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

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

.delete-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

.delete-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

.empty-maps-message {
    text-align: center;
    padding: 40px 20px;
    color: #bdc3c7;
    font-style: italic;
}

/* Upravené tlačítko uložit mapu */
#saveMap {
    background: linear-gradient(135deg, #f39c12, #d68910);
    border-color: #f39c12;
}

#saveMap:hover {
    background: linear-gradient(135deg, #d68910, #b7950b);
    box-shadow: 0 8px 16px rgba(243, 156, 18, 0.4);
}

/* Scrollbar pro seznam map */
.saved-maps-list::-webkit-scrollbar {
    width: 8px;
}

.saved-maps-list::-webkit-scrollbar-track {
    background: rgba(44, 62, 80, 0.3);
    border-radius: 4px;
}

.saved-maps-list::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.6);
    border-radius: 4px;
}

.saved-maps-list::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.8);
}

/* Mobile responsive */
@media (max-width: 768px) {
    body {
        padding: 10px; /* Sníženo z 20px */
    }
    
    .container {
        padding: 15px; /* Sníženo z 20px */
        margin: 5px; /* Sníženo z 10px */
        max-width: 100%; /* Přidáno pro zajištění že nepřesáhne */
        box-sizing: border-box; /* Přidáno */
    }
    
    .header-section {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        text-align: center;
        gap: 15px;
        margin-left: 0; /* Přidáno */
        margin-right: 0; /* Přidáno */
    }
    
    .logo-container {
        justify-self: center;
    }
    
    .game-logo {
        max-width: 80px;
        max-height: 80px;
    }
    
    h1 {
        font-size: 1.8rem;
        letter-spacing: 1px;
        justify-self: center;
    }
    
    .menu-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
        padding: 15px; /* Sníženo z 20px */
        margin-left: 0; /* Přidáno */
        margin-right: 0; /* Přidáno */
    }
    
    .terrain-selector {
        padding: 20px 15px; /* Upraveno - méně horizontální padding */
        margin-left: 0; /* Přidáno */
        margin-right: 0; /* Přidáno */
    }
    
    .map-container {
        padding: 15px 10px; /* Sníženo */
        margin-left: 0; /* Přidáno */
        margin-right: 0; /* Přidáno */
    }
    
    .terrain-buttons {
        gap: 6px; /* Sníženo z 8px */
        padding: 0 5px; /* Přidáno */
    }
    
    .terrain-btn {
        padding: 8px 12px; /* Sníženo z 10px 15px */
        font-size: 11px; /* Sníženo z 12px */
    }
    
    .map-grid.size-5 {
        grid-template-columns: repeat(5, 65px); /* Zvětšeno z 55px */
        grid-template-rows: repeat(5, 65px); /* Zvětšeno z 55px */
    }
    
    .map-grid.size-6 {
        grid-template-columns: repeat(6, 55px); /* Zvětšeno z 45px */
        grid-template-rows: repeat(6, 55px); /* Zvětšeno z 45px */
    }
    
    /* Další úpravy zůstávají... */
}

@media (max-width: 480px) {
    body {
        padding: 5px; /* Ještě více sníženo */
    }
    
    .container {
        padding: 10px; /* Ještě více sníženo */
        margin: 2px; /* Ještě více sníženo */
    }
    
    .controls {
        padding: 10px;
    }
    
    .terrain-selector {
        padding: 15px 10px;
    }
    
    .map-container {
        padding: 10px 5px;
    }
    
    .game-logo {
        max-width: 60px;
        max-height: 60px;
    }
    
    .map-grid.size-5 {
        grid-template-columns: repeat(5, 55px); /* Zvětšeno z 45px */
        grid-template-rows: repeat(5, 55px); /* Zvětšeno z 45px */
    }
    
    .map-grid.size-6 {
        grid-template-columns: repeat(6, 48px); /* Zvětšeno z 38px */
        grid-template-rows: repeat(6, 48px); /* Zvětšeno z 38px */
    }
    
    .grid-cell {
        font-size: 12px;
    }
}

/* ...existing code... (zbytek CSS) */