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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #2a1f1a 0%, #3d2f27 100%);
    min-height: 100vh;
    padding: 20px;
    color: #f4e4c1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.upload-new-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(61, 47, 39, 0.2));
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header {
    text-align: center;
    color: #d4af37;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: linear-gradient(135deg, #d4af37, #f4e4c1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.2em;
    color: #c9a961;
    opacity: 0.9;
}

.upload-section {
    background: #1a1511;
    border: 2px solid #3d2f27;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #d4af37;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(212, 175, 55, 0.05);
}

.upload-area:hover {
    border-color: #f4e4c1;
    background: rgba(212, 175, 55, 0.1);
}

.upload-area.dragover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #f4e4c1;
}

.upload-area h3 {
    color: #d4af37;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.upload-area p {
    color: #c9a961;
    margin-bottom: 20px;
}

#fileInput {
    display: none;
}

.btn {
    background: linear-gradient(135deg, #8b6914 0%, #b4a037 100%);
    color: #f4e4c1;
    border: 1px solid #d4af37;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #b4a037 0%, #d4af37 100%);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #3d2f27;
    border-top: 4px solid #d4af37;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    display: none;
}

.results.active {
    display: block;
}

.card {
    background: #1a1511;
    border: 2px solid #3d2f27;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card h2 {
    color: #d4af37;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3d2f27;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: linear-gradient(135deg, #3d2f27 0%, #4a3a30 100%);
    color: #d4af37;
    border: 1px solid #5a4a40;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-box h3 {
    font-size: 2em;
    margin-bottom: 5px;
}

.stat-box p {
    color: #c9a961;
    opacity: 0.9;
    font-size: 0.9em;
}

.player-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.player-card {
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.player-card.player-0 {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-color: #8b6914;
}

.player-card.player-1 {
    background: linear-gradient(135deg, rgba(180, 160, 140, 0.1) 0%, rgba(180, 160, 140, 0.05) 100%);
    border-color: #7a6a5a;
}

.player-card h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.player-card.player-0 h3 {
    color: #d4af37;
}

.player-card.player-1 h3 {
    color: #b4a08c;
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

.insight-box {
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid #d4af37;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    color: #f4e4c1;
}

.error {
    background: rgba(139, 69, 19, 0.2);
    border-left: 4px solid #8b4513;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    color: #cd853f;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #3d2f27;
    color: #f4e4c1;
}

th {
    background: #3d2f27;
    color: #d4af37;
    font-weight: 600;
}

.tech-table {
    width: 100%;
    margin: 20px 0;
}

.tech-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    text-align: center;
}

.tech-table td {
    padding: 10px;
    border: 1px solid #3d2f27;
}

.tech-table tr:nth-child(even) {
    background: rgba(61, 47, 39, 0.3);
}

.tech-empty {
    color: #ccc;
    font-style: italic;
}

.tech-match {
    background: rgba(139, 105, 20, 0.3) !important;
}

.tech-unique-cell {
    background: rgba(212, 175, 55, 0.2) !important;
}

/* Hover effects for tech table */
.tech-table td.tech-empty:hover {
    background: rgba(61, 47, 39, 0.3) !important;
    cursor: default;
}

.tech-hover-match {
    background: rgba(76, 175, 80, 0.5) !important;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
    transition: all 0.2s ease;
}

/* Individual tech hover effects */
.tech-hover {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-block;
    margin: 1px;
}


.tech-hover-highlight {
    background: rgba(76, 175, 80, 0.7) !important;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.8);
    transform: scale(1.03);
}

/* Shared tech highlighting (green for both players have it) */
.tech-hover.tech-hover-shared {
    background: rgba(76, 175, 80, 0.7) !important;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.8) !important;
    transform: scale(1.03) !important;
    color: white !important;
}

/* Unique tech highlighting (blue for only one player has it) */
.tech-hover.tech-hover-unique {
    background: rgba(33, 150, 243, 0.7) !important;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.8) !important;
    transform: scale(1.03) !important;
    color: white !important;
}

.player-name-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    margin-left: 10px;
}

.badge-human {
    background: #28a745;
    color: white;
}

.badge-ai {
    background: #6c757d;
    color: white;
}

.nation-name {
    font-weight: normal;
    color: #666;
    font-size: 0.9em;
}

.turn-badge {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-left: 10px;
}

.event-log {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #3d2f27;
    border-radius: 8px;
    padding: 15px;
    background: rgba(26, 21, 17, 0.5);
}

.event-item {
    padding: 8px;
    margin: 5px 0;
    background: rgba(61, 47, 39, 0.4);
    border-radius: 5px;
    border-left: 3px solid #d4af37;
}

.event-turn {
    display: inline-block;
    background: #8b6914;
    color: #f4e4c1;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.8em;
    margin-right: 10px;
}

.tech-tree-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    transition: transform 0.2s;
}

.tech-tree-link:hover {
    transform: translateY(-2px);
}

.timeline-container {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.timeline-turn {
    min-width: 60px;
    font-weight: bold;
    color: #d4af37;
}

.timeline-event {
    flex: 1;
    padding: 8px 12px;
    background: rgba(61, 47, 39, 0.3);
    border-radius: 8px;
    margin-left: 10px;
}

.bonus-card {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid #d4af37;
    border-radius: 4px;
    font-size: 0.9em;
    margin: 2px 0;
}

.wonder-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.wonder-item {
    padding: 15px;
    background: rgba(26, 21, 17, 0.5);
    border-radius: 8px;
    border-left-width: 4px;
    border-left-style: solid;
}

.wonder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wonder-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #d4af37;
}

.wonder-turn {
    background: rgba(212, 175, 55, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    color: #c9a961;
}

.wonder-details {
    display: flex;
    gap: 15px;
    font-size: 0.95em;
}

.wonder-player {
    font-weight: 600;
}

.wonder-city {
    color: #c9a961;
    font-style: italic;
}

@media (max-width: 768px) {
    .player-comparison {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}