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

body {
    font-family: 'Arial', sans-serif;
    background-image: url('background-map.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.control-section {
    flex: 1;
    min-width: 300px;
}

.control-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.config-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.status {
    padding: 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 5px;
    font-size: 0.9rem;
    color: #2c3e50;
}

.pick-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.player-picks, .opponent-picks {
    flex: 1;
    min-width: 200px;
}

.player-picks h4, .opponent-picks h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1rem;
}

.pick-list {
    min-height: 100px;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 10px;
    background: rgba(236, 240, 241, 0.5);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pick-item {
    background: #3498db;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.pick-item.opponent {
    background: #e74c3c;
}

.pick-item .remove-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.pick-item .remove-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.map-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border: 2px solid #bdc3c7;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.map-container h3 {
  width: 100%;
}

.territory-map {
    position: relative;
    max-width: 100%;
    height: 480px;
    overflow: hidden;
    flex: 1;
}

.territory-map.simulation-map {
    height: 240px;
}

.map-background {
    width: 800px;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: calc(50% - 400px);
    z-index: 1;
}

.simulation-map .map-background {
    width: 400px;
    left: calc(50% - 200px);
}

.map-overlay {
    width: 800px;
    position: absolute;
    top: 0;
    left: calc(50% - 400px);
    z-index: 2;
    pointer-events: none;
}

.simulation-map .map-overlay {
    width: 400px;
    left: calc(50% - 200px);
}

.map-overlay svg {
    width: 100%;
    height: 100%;
    pointer-events: all;
}

.map-overlay text {
    pointer-events: none;
}

.map-overlay path {
    fill: rgba(255, 0, 0, 0.2); /* Make paths visible with red tint */
    stroke: rgba(255, 0, 0, 0.5); /* Red border to see territory boundaries */
    stroke-width: 1;
    transition: fill 0.2s ease;
}

.map-overlay#territoryOverlay path {
    cursor: pointer;
}

.map-overlay path:hover {
    fill: rgba(52, 152, 219, 0.5);
    stroke: rgba(52, 152, 219, 0.8);
}

/* Territory overlays */
.territory-overlay {
    position: absolute;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.territory-overlay:hover {
    border-color: #f39c12;
    transform: scale(1.05);
}

.territory-overlay.wasteland {
    background: rgba(149, 165, 166, 0.7);
    border-color: #95a5a6;
}

.territory-overlay.available {
    background: rgba(46, 204, 113, 0.7);
    border-color: #2ecc71;
}

.territory-overlay.selected {
    background: rgba(52, 152, 219, 0.8);
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.territory-overlay.opponent-selected {
    background: rgba(231, 76, 60, 0.8);
    border-color: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Results Panel */
.results-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.results-panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.simulation-results {
    min-height: 100px;
    padding: 15px;
    background: rgba(236, 240, 241, 0.5);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.simulation-result {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.simulation-result.good {
    border-left-color: #2ecc71;
}

.pick-order {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.pick-step {
    background: #3498db;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

.pick-step.opponent {
    background: #e74c3c;
}

/* Pick Dialog */
.pick-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.pick-dialog.hidden {
    display: none;
}

.pick-dialog-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.pick-dialog h4 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.pick-dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-text {
    background: none;
    color: #7f8c8d;
    text-decoration: underline;
    box-shadow: none;
}

.btn-text:hover {
    color: #2c3e50;
    background: none;
    transform: none;
    box-shadow: none;
}

/* Button styles */
.btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f4e79);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

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

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f4e79);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
}

.btn-secondary.active {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

/* Result display */
.result {
    margin-top: 20px;
    padding: 15px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border-left: 4px solid #3498db;
    font-size: 1.1rem;
    color: #2c3e50;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls-panel {
        flex-direction: column;
        gap: 20px;
    }
    
    .control-section {
        min-width: auto;
    }
    
    .pick-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .config-buttons {
        flex-direction: column;
    }
    
    .territory-map {
        height: 300px;
    }
    
    .territory-overlay {
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 12px 24px;
        font-size: 1rem;
    }
}
