/* === Přidáno/Upraveno v style.css === */
body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Jemný gradient na pozadí */
    background: linear-gradient(to bottom, #4a4e69, #22223b);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #f2e9e4; /* Světlejší text */
    overflow: hidden;
}

/* Styly pro hlavní menu */
#main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #22223b, #4a4e69, #22223b);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    z-index: 100;
    overflow: hidden;
}

#menuCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.menu-content {
    position: relative;
    max-width: 800px;
    background-color: rgba(42, 45, 52, 0.85);
    padding: 2rem 3rem;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: fadeIn 1s ease-in-out;
    z-index: 10;
}

.game-title {
    margin-top:0px;
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: #f2e9e4;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(to right, #f2e9e4, #ffd700, #f2e9e4);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s infinite;
}

.map-selection h2 {
    color: #f2e9e4;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.map-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-button {
    padding: 15px 25px;
    font-size: 1.1rem;
    background-color: rgba(107, 107, 138, 0.9);
    color: #f2e9e4;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.map-button:hover {
    transform: translateY(-3px);
    background-color: rgba(154, 140, 152, 0.9);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.map-button:active {
    transform: translateY(1px);
}

.map-difficulty {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.map-description {
    font-size: 0.85rem;
    opacity: 0.9;
}

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

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Konec stylů pro menu */

/* Nový layout pro herní kontejner */
#game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

/* Nový flex layout pro canvas a sidebar */
#game-layout {
    display: flex;
    width: 100%;
}

canvas {
    background-color: #2a2d34;
    display: block;
}

/* Sidebar for tower details - improved layout */
#tower-sidebar {
    width: 250px; /* Increased width */
    background-color: rgba(42, 45, 52, 0.95);
    border-left: 1px solid #6b6b8a;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 600px; /* Fixed height instead of max-height */
    position: relative; /* For absolute positioning of buttons */
    overflow-y: hidden; /* Prevent scrolling of the sidebar itself */
}

#tower-actions {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; /* For proper positioning */
}

/* Scrollable content area - improved styling */
.tower-info-content {
    padding:10px;
    padding-bottom: 40px;
    overflow-y: auto;
    margin-bottom: 15px; /* Space above buttons */
    max-height: calc(100% - 120px); /* Reserve space for buttons */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: rgba(107, 107, 138, 0.5) rgba(0, 0, 0, 0.1); /* For Firefox */
}

/* Custom scrollbar for webkit browsers */
.tower-info-content::-webkit-scrollbar {
    width: 6px;
}

.tower-info-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.tower-info-content::-webkit-scrollbar-thumb {
    background-color: rgba(107, 107, 138, 0.5);
    border-radius: 3px;
}

#selected-tower-details, #tower-upgrade-info {
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px; /* Increased border-radius */
    padding: 15px; /* Increased padding */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Added shadow for depth */
    transition: all 0.3s ease; /* Smooth transitions */
}

#tower-upgrade-info:last-child {
    margin-bottom: 40px;
}

#tower-actions h3 {
    margin: 0 0 15px 0; /* Increased bottom margin */
    border-bottom: 1px solid #555;
    padding-bottom: 10px; /* Increased padding */
    color: #ffea00;
    font-size: 18px;
    text-align: center;
    text-shadow: 0 0 8px rgba(255, 234, 0, 0.3);
}

.tower-stat {
    margin: 12px 0; /* Increased margin */
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    line-height: 1.4; /* Added line height for better readability */
    position: relative; /* For hover effect */
    padding: 4px 6px; /* Add padding around stats */
    border-radius: 4px; /* Rounded corners */
    transition: background-color 0.2s ease; /* Smooth transition for hover */
}

.tower-stat:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Subtle highlight on hover */
}

.tower-stat span {
    font-weight: 600; /* Make value bolder */
    padding-left: 8px; /* Add some space between label and value */
    color: #a5d6a7; /* Lighter green for values */
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.3); /* Subtle text shadow */
}

/* Stylizace ukazatele úrovně věže */
.level-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0 15px 0;
    position: relative;
}

.level-indicator::before {
    content: "";
    position: absolute;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 215, 0, 0.5), transparent);
    width: 100%;
    top: 50%;
    z-index: 0;
}

.level-number {
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.7);
    color: #ffea00;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.level-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.level-dot.active {
    background-color: #ffea00;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.level-dot.current {
    background-color: #ffea00;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Upraveny styl pro detail-level - skrýt původní zobrazení */
#detail-level {
    display: none;
}

/* Specifické styly pro různé úrovně */
.level-max .level-number {
    background-color: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* Úprava levelu v detailu věže */
#selected-tower-details h3 {
    margin-bottom: 10px;
}

/* Special styling for level indicator */
#detail-level {
    color: #ffea00; /* Gold color for level */
    font-weight: 700; /* Extra bold */
}

.special-feature {
    color: #ffea00;
    font-weight: bold;
    margin-top: 15px; /* Increased margin */
    border-top: 1px dashed rgba(255, 234, 0, 0.3);
    padding-top: 12px; /* Increased padding */
}

.special-feature span {
    color: #ffca28; /* Different gold shade for special effects */
    font-style: italic; /* Italicize special effects */
    display: block; /* Display on new line */
}

.tower-price {
    margin-top: 15px; /* Increased margin */
    font-weight: bold;
    color: #4caf50;
    text-align: center;
    font-size: 18px; /* Slightly larger */
    padding: 8px; /* Increased padding */
    background-color: rgba(76, 175, 80, 0.15); /* Slightly darker background */
    border-radius: 4px; /* Rounded corners */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Subtle shadow */
}

#tower-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background-color: rgba(26, 26, 26, 0.5); /* Slightly darker background for button area */
    border-radius: 8px 8px 0 0; /* Rounded top corners */
    position: absolute; /* Fixed at bottom */
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3); /* Stronger shadow for separation */
}

#tower-action-buttons button {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    padding-left: 40px; /* Zvětšeno pro místo na klávesovou zkratku */
    text-align: center; /* Vycentrování textu */
}

#upgrade-tower-button {
    background-color: #4caf50;
    color: white;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.4);
}

#upgrade-tower-button:hover:not(:disabled) {
    background-color: #3e8e41;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.6);
}

#upgrade-tower-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(76, 175, 80, 0.4);
}

#upgrade-tower-button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    box-shadow: none;
}

#sell-tower-button {
    background-color: #f44336;
    color: white;
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.4);
}

#sell-tower-button:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.6);
}

#sell-tower-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(244, 67, 54, 0.4);
}

#cancel-selection-button {
    background-color: #607d8b;
    color: white;
    box-shadow: 0 2px 6px rgba(96, 125, 139, 0.4);
}

#cancel-selection-button:hover {
    background-color: #455a64;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(96, 125, 139, 0.6);
}

#cancel-selection-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(96, 125, 139, 0.4);
}

/* UI panel ve spodní části */
#ui {
    background-color: rgba(42, 45, 52, 0.95);
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    border-top: 1px solid #6b6b8a;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.2);
}

#stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stat-item {
    display: flex;
    align-items: center;
    font-size: 1.2em;
    font-weight: 600;
    color: #f2e9e4;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background-color: rgba(107, 107, 138, 0.3);
}

/* Ikony pro statistiky */
.stat-item i {
    margin-right: 8px;
    font-size: 1.3em;
}

.fa-flag {
    color: #64dfdf;
}

.fa-coins {
    color: #ffd700;
}

.fa-heart {
    color: #e63946;
}

/* Progress bar pro vlnu */
#wave-progress-container {
    position: relative;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin: 5px 0 15px 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

#wave-progress-bar {
    height: 100%;
    width: 0%; /* Bude upraveno JavaScriptem */
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#wave-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #f2e9e4;
    font-size: 0.85em;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Vylepšené styly pro tlačítka věží */
#tower-selection-wrapper {
    flex-grow: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 107, 138, 0.5) rgba(0, 0, 0, 0.1);
    padding-bottom: 5px; /* Space for scrollbar */
}

/* Custom scrollbar for webkit browsers */
#tower-selection-wrapper::-webkit-scrollbar {
    height: 6px;
}

#tower-selection-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

#tower-selection-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(107, 107, 138, 0.5);
    border-radius: 3px;
}

#tower-selection {
    display: flex;
    gap: 10px;
    min-width: max-content; /* Ensure all buttons are shown */
}

.tower-button {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 5px;
    min-width: 85px; /* Fixed width for consistent sizing */
    height: 85px;
    background-color: rgba(107, 107, 138, 0.6);
    border: none;
    border-radius: 8px;
    color: #f2e9e4;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.tower-button:hover {
    background-color: rgba(154, 140, 152, 0.8);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.tower-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tower-button.selected {
    background-color: rgba(107, 107, 138, 0.9);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.5);
}

/* Ikony věží */
.tower-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.gun-icon {
    background-color: #607d8b; /* Aktualizovaná barva z constants.js */
    border-radius: 50%;
    position: relative;
}

.gun-icon::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 12px;
    background-color: #455a64; /* Aktualizovaná barva z constants.js */
}

.laser-icon {
    background-color: #d32f2f; /* Aktualizovaná barva z constants.js */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.laser-icon::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 14px;
    background-color: #b71c1c; /* Aktualizovaná barva z constants.js */
    box-shadow: 0 0 5px #b71c1c;
}

.sniper-icon {
    background-color: #388e3c; /* Aktualizovaná barva z constants.js */
    border-radius: 50%;
    position: relative;
}

.sniper-icon::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background-color: #1b5e20; /* Aktualizovaná barva z constants.js */
    box-shadow: 0 0 5px #1b5e20;
}

.railgun-icon {
    background-color: #1E88E5; /* Aktualizovaná barva z constants.js */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.railgun-icon::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 6px;
    background-color: #0D47A1; /* Aktualizovaná barva z constants.js */
    border-radius: 2px 2px 0 0;
}

.railgun-icon::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 10px;
    background-color: #0D47A1; /* Aktualizovaná barva z constants.js */
}

.freezer-icon {
    background-color: #29B6F6; /* Light blue from constants.js */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 8px rgba(128, 216, 255, 0.5);
}

.freezer-icon::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 18px;
    background-color: #0288D1; /* Medium blue from constants.js */
    box-shadow: 0 0 5px rgba(0, 176, 255, 0.6);
}

.freezer-icon::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(173,216,230,0.4) 70%, rgba(173,216,230,0) 100%);
    z-index: 1;
}

.pulsar-icon {
    background-color: #673AB7; /* Deep purple */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 12px rgba(186, 104, 200, 0.7); /* Purple glow */
}

.pulsar-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #E040FB 0%, #9C27B0 70%, #673AB7 100%);
    border-radius: 50%;
}

.pulsar-icon::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 16px;
    background-color: #4A148C; /* Darker purple */
    box-shadow: 0 0 8px rgba(186, 104, 200, 0.8);
}

@keyframes pulse-pulsar {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; }
}

.tower-name {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 2px;
}

.tower-cost {
    font-size: 0.85em;
    color: #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tower-cost::before {
    content: '\f51e'; /* FontAwesome coin icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 4px;
    font-size: 0.9em;
}

/* Vylepšené tlačítko Start Wave s pulzujícím efektem */
#startWaveButton {
    position: relative;
    width: 140px;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    background: linear-gradient(to bottom, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#startWaveButton i {
    margin-right: 8px;
}

#startWaveButton:hover:not(:disabled) {
    background: linear-gradient(to bottom, #5CBD61, #4CAF50);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

#startWaveButton:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#startWaveButton:disabled {
    background: linear-gradient(to bottom, #a0a0a0, #8a8a8a);
    cursor: default;
    opacity: 0.7;
}

/* Pulzující efekt pro tlačítko Start Wave */
@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

#startWaveButton:not(:disabled) {
    animation: pulse-border 2s infinite;
}

/* Styly pro Game Over / Victory obrazovku - mírné úpravy */
#game-over, #victory {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(42, 45, 52, 0.9);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #6b6b8a;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

#game-over h2 {
    margin-top: 0;
    color: #e56b6f;
    font-size: 2.5em;
}
#victory h2 {
     margin-top: 0;
     color: #61c79a;
     font-size: 2.5em;
}

#game-over p, #victory p {
    font-size: 1.2em;
    margin-bottom: 25px;
}

#game-over button, #victory button {
    padding: 12px 25px;
    font-size: 1.1em;
    cursor: pointer;
    background-color: #6b6b8a;
    border: none;
    color: #f2e9e4;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
#game-over button:hover, #victory button:hover {
     background-color: #7d7d9e;
}

/* Styly pro hvězdičky úrovně věže */
.tower-level-stars {
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.level-star {
    color: #ffd700;
    font-size: 16px;
    margin: 0 2px;
}

.level-star.empty {
    color: #555;
}

/* Indikátor vybrané věže */
.selected-tower-highlight {
    position: absolute;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
    animation: pulse 1.5s infinite;
}

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

/* === Konec přidaných/upravených stylů === */

#selected-tower-info {
    position: absolute;
    bottom: -25px;
    left: 10px;
    font-size: 0.9em;
    color: #c9c9df;
}

/* Responsive styles for smaller screens */
@media screen and (max-height: 800px) {
    /* More compact tower buttons */
    .tower-button {
        height: 68px;
        padding: 6px 5px;
    }
    
    .tower-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 3px;
    }
    
    .tower-name {
        font-size: 0.8em;
        margin-bottom: 1px;
    }
    
    .tower-cost {
        font-size: 0.75em;
    }
    
    /* Compact sidebar */
    #tower-actions h3 {
        margin: 0 0 10px 0;
        padding-bottom: 6px;
        font-size: 16px;
    }
    
    .tower-stat {
        margin: 8px 0;
        line-height: 1.2;
        padding: 3px 5px;
    }
    
    .level-indicator {
        margin: 6px 0 10px 0;
    }
    
    .level-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .level-dots {
        gap: 6px;
        margin-top: 4px;
    }
    
    #selected-tower-details, #tower-upgrade-info {
        margin-bottom: 25px;
        padding: 10px;
    }
    
    .special-feature {
        margin-top: 10px;
        padding-top: 8px;
    }
    
    .tower-price {
        margin-top: 10px;
        padding: 5px;
        font-size: 16px;
    }
    
    /* Horizontal tower action buttons */
    #tower-action-buttons {
        flex-direction: row;
        padding: 8px;
        padding-bottom: 20px;
        gap: 4px;
    }
    
    #tower-action-buttons button {
        padding: 8px 12px;
        font-size: 10px;
        flex: 1;
    }
    
    /* Compact UI panel */
    #ui {
        padding: 10px;
    }
    
    /* More compact stats layout with smaller padding */
    #stats {
        margin-bottom: 5px;
        padding: 4px 6px;
        justify-content: space-between;
    }
    
    .stat-item {
        font-size: 0.95em;
        padding: 2px 6px;
    }
    
    .stat-item i {
        margin-right: 5px;
        font-size: 1.1em;
    }
    
    #wave-progress-container {
        height: 16px;
        margin: 4px 0 10px 0;
    }
    
    #wave-progress-text {
        font-size: 0.8em;
    }
    
    #controls {
        gap: 10px;
    }
    
    /* Compact Start Wave button */
    #startWaveButton {
        width: 120px;
        padding: 8px;
        font-size: 1em;
    }
    
    #startWaveButton i {
        margin-right: 6px;
    }
    
    /* Reduce the sidebar height */
    #tower-sidebar {
        height: 550px; /* Reduced from 600px */
    }
    
    /* Make the tower info content more compact */
    .tower-info-content {
        max-height: calc(100% - 90px); /* Adjusted for smaller action buttons area */
    }
    
    /* Tower level stars more compact */
    .tower-level-stars {
        margin-top: 3px;
    }
    
    .level-star {
        font-size: 14px;
        margin: 0 1px;
    }
    
    /* Reduce game canvas height to match sidebar */
    #gameCanvas {
        height: 550px;
    }
}

/* Note: The compact UI reduces the game container height from 818px to approximately 700px for better usability on smaller screens */

/* Tower help text - appears when no tower is selected */
#tower-help-text {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: #f2e9e4;
    font-size: 18px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(42, 45, 52, 0.95);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    line-height: 1.5;
    animation: fadeIn 0.5s ease-in-out;
}

#tower-actions:not([style*="display: none"]) + #tower-help-text {
    display: none;
}

/* Responsive styles for smaller screens */
@media screen and (max-height: 800px) {
    #tower-help-text {
        font-size: 16px;
        padding: 15px;
    }
}

/* Help Button in Main Menu */
.help-button {
    padding: 10px 20px;
    font-size: 1.1em;
    background: linear-gradient(to bottom, #9575cd, #7e57c2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-button i {
    margin-right: 8px;
    font-size: 1.2em;
}

.help-button:hover {
    background: linear-gradient(to bottom, #b39ddb, #9575cd);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.help-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tower Guide Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    opacity: 0;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal[style*="display: none"] {
    pointer-events: none !important;
    z-index: -1 !important;
}

.modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #1e1e2f;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    padding: 15px 20px;
    background: linear-gradient(to right, #3f51b5, #7986cb);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal:hover {
    color: #ffcc80;
    transform: scale(1.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
    color: #f2e9e4;
}

.tower-guide-intro {
    font-size: 1.1em;
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: center;
}

.tower-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tower-guide-item {
    background: rgba(41, 41, 61, 0.7);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tower-guide-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background: rgba(61, 61, 91, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}

.tower-guide-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    flex-shrink: 0;
}

.tower-guide-info {
    flex-grow: 1;
}

.tower-guide-info h3 {
    margin: 0 0 5px 0;
    color: #ffffff;
    font-size: 1.4em;
}

.tower-cost-info {
    color: #ffd700;
    font-weight: bold;
    margin: 5px 0 10px;
}

.tower-guide-info p {
    margin: 8px 0;
    line-height: 1.5;
    font-size: 0.95em;
}

.tower-upgrades {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.6;
}

.tower-guide-tips {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    padding-top: 20px;
}

.tower-guide-tips h3 {
    margin-bottom: 15px;
}

.tower-guide-tips ul {
    padding-left: 20px;
}

.tower-guide-tips li {
    margin-bottom: 8px;
}

/* Nové styly pro klávesové zkratky */
.tower-guide-shortcuts {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    padding-top: 20px;
}

.tower-guide-shortcuts h3 {
    margin-bottom: 15px;
}

.shortcuts-grid {
    display: flex;
    gap: 30px;
}

.shortcuts-column {
    flex: 1;
}

.shortcuts-column h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #ffd700;
}

.shortcuts-column ul {
    padding-left: 0;
    list-style-type: none;
}

.shortcuts-column li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

kbd {
    display: inline-block;
    padding: 3px 7px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    color: #fff;
    background-color: #444;
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
    margin-right: 8px;
    min-width: 20px;
    text-align: center;
}

/* Modal footer */
.modal-footer {
    display: flex;
    padding: 15px 20px;
    background: rgba(41, 41, 61, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.close-guide-button {
    padding: 10px 25px;
    background: linear-gradient(to bottom, #3f51b5, #303f9f);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-guide-button:hover {
    background: linear-gradient(to bottom, #5c6bc0, #3f51b5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.close-guide-button:active {
    transform: translateY(1px);
}

/* Game controls container */
.game-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* In-game help button */
.in-game-help-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #9575cd, #7e57c2);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.in-game-help-button i {
    font-size: 1.5em;
}

.in-game-help-button:hover {
    background: linear-gradient(to bottom, #b39ddb, #9575cd);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.in-game-help-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Map Editor Styles */
#map-editor {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background-color: #1a1a1a;
    color: #f2e9e4;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #2a2d34;
    border-bottom: 2px solid #4a4e69;
}

.editor-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.validation-message {
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 4px;
}

.validation-message.valid {
    background-color: rgba(0, 128, 0, 0.2);
    color: #a0e7a0;
}

.validation-message.invalid {
    background-color: rgba(255, 0, 0, 0.2);
    color: #ffaaaa;
}

.editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-sidebar {
    width: 250px;
    background-color: #22232a;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow: auto;
}

.editor-tools, .map-settings, .editor-actions {
    background-color: rgba(74, 78, 105, 0.2);
    border-radius: 8px;
    padding: 15px;
}

.editor-tools h3, .map-settings h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #c9ada7;
}

.editor-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background-color: #4a4e69;
    color: #f2e9e4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.editor-btn:hover {
    background-color: #6b6b8a;
}

.editor-btn.active {
    background-color: #9a8c98;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.editor-btn.primary {
    background-color: #4caf50;
    font-weight: bold;
}

.editor-btn.primary:hover {
    background-color: #45a049;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #6b6b8a;
    background-color: rgba(42, 45, 52, 0.8);
    color: #f2e9e4;
    width: 100%;
    box-sizing: border-box;
}

.editor-instructions {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(74, 78, 105, 0.2);
    border-radius: 4px;
    font-size: 0.9rem;
}

#editorCanvas {
    border: 2px solid #4a4e69;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    background-color: #2a2d34;
}

/* Custom maps section styles */
#custom-maps-section {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

#custom-maps-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.custom-map-button {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.map-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 6px;
}

.edit-map-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(74, 144, 226, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}

.edit-map-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.delete-map-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}

.delete-map-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.editor-buttons {
    display: flex;
    width: 100%;
    margin-top: 20px;
}

#create-map-btn {
    width: 100%;
    background-color: #4a4e69;
    color: #f2e9e4;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

#create-map-btn:hover {
    background-color: #6b6b8a;
}

#help-button {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #9575cd, #7e57c2);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    padding: 0;
    font-size: 1rem;
}

#help-button i {
    font-size: 1.5em;
    margin-right: 0;
}

#help-button:hover {
    background: linear-gradient(to bottom, #b39ddb, #9575cd);
    transform: rotate(15deg);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#help-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Map Search Input */
.search-container {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    
}

.map-search-input {
    flex: 1 0 0;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.map-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 8px rgba(129, 199, 132, 0.4);
}

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

/* Custom Maps List */
.custom-maps-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 5px;
}

.custom-map-item {
    background: rgba(41, 41, 61, 0.7);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    height: 140px;
    position: relative;
}

.custom-map-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background: rgba(61, 61, 91, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-map-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    cursor: pointer;
}

.custom-map-name {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-author {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 2px 0;
}

.custom-map-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8em;
    margin: 0 0 2px 0;
}

.map-play-count {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
}

.custom-map-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
}

.map-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 5px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.map-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.map-edit-btn:hover {
    color: #64b5f6;
}

.map-delete-btn:hover {
    color: #ef5350;
}

.no-maps-message {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1em;
}

/* Custom maps button in main menu */
#open-custom-maps-btn {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.2em;
    background: linear-gradient(to bottom, #673ab7, #5e35b1);
    margin-bottom: 20px;
}

#open-custom-maps-btn:hover {
    background: linear-gradient(to bottom, #7e57c2, #673ab7);
}

/* Create map button in modal footer */
#create-map-modal-btn {
    background: linear-gradient(to bottom, #4CAF50, #388E3C);
}

#create-map-modal-btn:hover {
    background: linear-gradient(to bottom, #66BB6A, #4CAF50);
}

/* Custom maps modal height adjustment */
#custom-maps-modal .modal-body {
    max-height: calc(90vh - 180px);
}

/* Custom maps scrollbar styling */
.custom-maps-list::-webkit-scrollbar {
    width: 8px;
}

.custom-maps-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.custom-maps-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.custom-maps-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modal footer buttons */
.modal-footer button {
    padding: 10px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.close-maps-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    
}

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

/* Nový styl pro zobrazení klávesové zkratky */
.tower-hotkey {
    position: absolute;
    top: 3px;
    right: 3px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
    pointer-events: none;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Styl pro klávesové zkratky u tlačítek akcí */
.action-hotkey {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    pointer-events: none;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: none; /* Zrušení velkých písmen pro zkratky */
    letter-spacing: normal; /* Standardní mezery mezi písmeny pro zkratky */
    font-family: 'Courier New', monospace; /* Použití monospace fontu pro zkratky */
}

/* Responsive styly pro menší obrazovky */
@media screen and (max-height: 800px) {
    /* Upravená velikost a padding pro action-hotkey na menších obrazovkách */
    .action-hotkey {
        font-size: 8px;
        padding: 1px 3px;
        left: 3px;
    }
    
    /* Upravený padding pro tlačítka na menších obrazovkách */
    #tower-action-buttons button {
        padding-left: 10px;
        font-size: 10px;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    
    /* Horizontal tower action buttons - upraveno pro lepší zobrazení */
    #tower-action-buttons {
        flex-direction: row;
        padding: 4px;
        padding-bottom: 15px;
        gap: 3px;
    }
    
    #tower-action-buttons button {
        padding: 6px 5px 6px 20px;
        margin-bottom: 0;
    }
    #tower-upgrade-info:last-child {
        margin-bottom: 20px;
    }
}

/* Styles for custom parameters section */
.custom-params {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(42, 45, 52, 0.5);
    border-radius: 5px;
    border: 1px solid rgba(107, 107, 138, 0.5);
}

.custom-params h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #f2e9e4;
    font-size: 0.95rem;
}

.custom-params .form-group {
    margin-bottom: 12px;
}

.custom-params input[type="range"] {
    -webkit-appearance: none;
    width: 80%;
    height: 8px;
    border-radius: 5px;
    background: rgba(107, 107, 138, 0.7);
    outline: none;
    margin-right: 10px;
    vertical-align: middle;
}

.custom-params input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f2e9e4;
    cursor: pointer;
    border: 2px solid #4a4e69;
}

.custom-params input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f2e9e4;
    cursor: pointer;
    border: 2px solid #4a4e69;
}

.custom-params input[type="range"]:hover::-webkit-slider-thumb {
    background: #ffd700;
}

.custom-params input[type="range"]:hover::-moz-range-thumb {
    background: #ffd700;
}

.custom-params input[type="number"] {
    width: 80px;
    text-align: center;
    padding: 5px;
}

.custom-params span {
    font-weight: bold;
    min-width: 30px;
    display: inline-block;
    text-align: center;
}

.input-note {
    font-weight: normal !important;
    font-style: italic;
    color: rgba(242, 233, 228, 0.8);
    font-size: 0.85rem;
    margin-left: 10px;
    text-align: left !important;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#game-over-screen, #victory-screen {
    text-align: center;
    color: white;
}

.game-overlay-content {
    background-color: #3b3b3b;
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

#game-over-screen h2, #victory-screen h2 {
    color: #ff4b4b;
    font-size: 36px;
    margin-bottom: 20px;
}

#victory-screen h2 {
    color: #ffdf00; /* Gold color for victory */
}

#victory-screen .game-overlay-content {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); /* Gold shadow for victory */
}

#retry-button, .play-again-button {
    background-color: #ff4b4b;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

#retry-button:hover, .play-again-button:hover {
    background-color: #ff2525;
}

.play-again-button {
    background-color: #ffdf00; /* Gold color for victory button */
    color: #333;
}

.play-again-button:hover {
    background-color: #ffc107; /* Darker gold on hover */
}

.devastator-icon {
    background-color: #8B4513; /* Hnědá barva z constants.js */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 12px rgba(139, 69, 19, 0.7); /* Hnědá záře */
}

.devastator-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #FF7043 0%, #CD853F 70%, #8B4513 100%);
    border-radius: 50%;
}

.devastator-icon::after {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 18px;
    background-color: #5D4037; /* Tmavší hnědá */
    box-shadow: 0 0 8px rgba(255, 112, 67, 0.8);
}

.hyperUltimate-icon {
    background-color: #1a237e; /* Deep blue from constants.js */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.8); /* Bright cyan glow, more intense */
}

.hyperUltimate-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, #00e5ff 0%, #2979ff 60%, #1a237e 100%);
    border-radius: 50%;
    animation: pulse-hyper 1.5s infinite;
}

.hyperUltimate-icon::after {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 20px;
    background-color: #0d47a1; /* Dark blue from constants.js */
    box-shadow: 0 0 12px rgba(0, 229, 255, 1.0);
}

@keyframes pulse-hyper {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; }
}

/* Settings Button */
.settings-button {
    position: absolute;
    top: 20px;
    right: 70px; /* Position to the left of the help button */
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.settings-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* In-game settings button */
.in-game-settings-button {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.in-game-settings-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Settings Modal */
#settings-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
}

/* Return to Menu button */
.return-to-menu-button {
    background-color: #c93030;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.return-to-menu-button:hover {
    background-color: #a52020;
}

/* Settings container */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

/* Setting item */
.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 5px;
}

.setting-item label {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.setting-description {
    font-size: 14px;
    color: #ccc;
    margin: 0;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Intensity slider styles */
.intensity-slider {
    width: 100%;
    height: 10px;
    margin: 10px 0;
    background: linear-gradient(to right, #ccc, #2196F3);
    outline: none;
    border-radius: 5px;
    -webkit-appearance: none;
    appearance: none;
}

.intensity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2196F3;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: background 0.3s;
}

.intensity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2196F3;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: background 0.3s;
}

.intensity-slider::-webkit-slider-thumb:hover {
    background: #0b7dda;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.intensity-slider::-moz-range-thumb:hover {
    background: #0b7dda;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

/* Nickname Modal */
#nickname-modal .modal-content {
    max-width: 400px;
}

#nickname-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #444;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
}

.error-message {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: -10px;
    margin-bottom: 10px;
    display: none;
}

/* Rating Stars */
.rating-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
}

.rating-stars {
    font-size: 0.9em;
    display: flex;
}

.star {
    font-size: 18px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
    margin-right: 2px;
}

.star.active {
    color: #ffbd2e;
}

.star:hover {
    color: #ffd57e;
}

.rating-info {
    font-size: 0.75em;
    color: #aaa;
    margin-left: 10px;
    display: flex;
    align-items: center;
}

.avg-rating {
    margin-right: 5px;
}

.rating-count {
    color: #888;
}

/* Map Sorting Controls */
.maps-sort-controls {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.maps-sort-controls label {
    margin-right: 5px;
    color: #aaa;
    font-size: 0.9em;
}

#sort-maps {
    padding: 5px;
    background-color: #333;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.9em;
}

.sort-btn {
    background-color: transparent;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 0 5px;
}

.sort-btn:hover {
    color: #fff;
}

/* Map item enhancements */
.custom-map-item {
    position: relative;
}

.map-author {
    font-size: 0.85rem;
    color: #9a8c98;
    margin-bottom: 2px;
}

.map-play-count {
    font-size: 0.85rem;
    color: #9a8c98;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.map-play-count i {
    font-size: 0.85rem;
    color: #4caf50;
}

/* Add user rating indicator */
.user-rated {
    font-size: 0.7rem;
    color: #ffbd2e;
    margin-left: 5px;
}

.rating-stars.disabled .star {
    opacity: 0.5;
    cursor: default !important;
}

.author-note {
    font-size: 0.7rem;
    color: #888;
    margin-left: 5px;
}

/* My Maps Filter */
.my-maps-filter {
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-left: 5px;
}

.my-maps-filter label {
    margin-left: 5px;
    color: #aaa;
    font-size: 0.9em;
}

#my-maps-only {
    cursor: pointer;
}

/* Primary Button Style */
.primary-btn {
    padding: 10px 20px;
    font-size: 1.1em;
    font-weight: bold;
    background: linear-gradient(to bottom, #4CAF50, #388E3C);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: primary-btn-pulse 2s infinite;
}

.primary-btn:hover {
    background: linear-gradient(to bottom, #66BB6A, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.primary-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.primary-btn i {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Pulzující efekt pro tlačítko primary-btn */
@keyframes primary-btn-pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: rgba(42, 45, 52, 0.9);
    color: #f2e9e4;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    max-width: 300px;
    opacity: 0;
    transform: translateY(20px);
    animation: toast-in 0.3s ease forwards, toast-out 0.3s ease forwards 4s;
    border-left: 4px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast.success {
    border-left-color: #4CAF50;
}

.toast.error {
    border-left-color: #F44336;
}

.toast.info {
    border-left-color: #2196F3;
}

.toast-message {
    flex-grow: 1;
    margin-right: 10px;
}

.toast-close {
    font-size: 16px;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}