/* public/styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
/* Archive grid layout */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    padding: 1.5rem 0;
}

.archive-photo {
    background: #222;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.15s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.archive-photo:hover {
    transform: scale(1.04);
}

.archive-photo img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.archive-photo-info {
    padding: 0.7rem 1rem;
    width: 100%;
    color: #fff;
    text-align: center;
}
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

.title {
    font-size: 4rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
    text-align: center;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.menu-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 250px;
}

.menu-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.menu-button.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

/* Upload Button Styles */
.upload-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
}

.upload-button {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #667eea;
    border: none;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Upload Modal Styles */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem 0;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8f0fe;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-area p {
    margin: 0.5rem 0;
    color: #666;
}

.upload-note {
    font-size: 0.9rem;
    color: #999 !important;
}

.upload-info {
    text-align: center;
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.95rem;
}

.upload-progress {
    text-align: center;
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #667eea;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.upload-result {
    text-align: center;
    margin: 1rem 0;
}

.result-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.game-container {
    display: flex;
    height: 100vh;
}

.photo-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.map-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Photo Zoom Styles */
.photo-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.photo-container.zoomed {
    cursor: move;
}

#game-photo {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f0f0f0;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.photo-controls {
    padding: 1rem;
    background: white;
    border-top: 1px solid #eee;
}

.hint-button {
    background: #ffd700;
    color: #333;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.hint-button:hover {
    background: #ffed4a;
    transform: scale(1.05);
}

.hint-text {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #fff3cd;
    border-left: 4px solid #ffd700;
    border-radius: 4px;
    font-style: italic;
}

.hidden {
    display: none;
}

#game-map, #result-map {
    flex: 1;
    min-height: 400px;
}

.map-controls {
    padding: 1rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.guess-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 250px;
    margin-right: 1rem;
}

.guess-button:hover:not(:disabled) {
    background: #218838;
    transform: scale(1.05);
}

.guess-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.back-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #545b62;
}

.result-content {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.score-display {
    margin-bottom: 1rem;
}

.score {
    font-size: 4rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.score-label {
    font-size: 1.2rem;
    color: white;
    margin-top: 0.5rem;
}

.distance-info {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: white;
}

#result-map {
    background: white;
    border-radius: 10px;
    margin: 2rem 0;
    height: 300px;
}

/* Photo Preview Styles */
.photo-preview {
    text-align: center;
    margin-bottom: 2rem;
}

.photo-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#archive-detail-map {
    background: white;
    border-radius: 10px;
    margin: 2rem 0;
    height: 400px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
}

.archive-photo {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.archive-photo:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.archive-photo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.archive-photo-info {
    padding: 1rem;
    text-align: center;
}

.archive-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.archive-date {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.leaderboard-section {
    margin: 2rem 0;
    text-align: center;
}

.leaderboard-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.leaderboard {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.leaderboard-entry:hover {
    background-color: #f8f9fa;
}

.leaderboard-entry.current-player {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.leaderboard-rank {
    font-weight: bold;
    color: #666;
    margin-right: 1rem;
    min-width: 30px;
}

.leaderboard-rank.first { color: #ffd700; }
.leaderboard-rank.second { color: #c0c0c0; }
.leaderboard-rank.third { color: #cd7f32; }

.leaderboard-player {
    flex: 1;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.leaderboard-score {
    font-weight: bold;
    color: #667eea;
    margin-right: 1rem;
}

.leaderboard-distance {
    font-size: 0.9rem;
    color: #666;
    min-width: 80px;
    text-align: right;
}

.play-indicator {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.average-score {
    font-size: 1rem;
    color: #666;
    margin-top: 0.3rem;
    font-style: italic;
}

.player-name-section {
    margin-bottom: 2rem;
    text-align: center;
}

.player-name-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 600;
}

.player-name-section input {
    padding: 0.8rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    text-align: center;
    min-width: 250px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.modal-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-container {
        top: 10px;
        left: 10px;
    }
    
    .upload-button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .game-container {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    .photo-section {
        flex: 1;
        min-height: 40vh;
    }
    
    .map-section {
        flex: none;
        min-height: 40vh;
    }
    
    .map-container {
        aspect-ratio: 4/3;
        min-height: 250px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .archive-grid {
        grid-template-columns: 1fr;
    }
    
    .map-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .guess-button {
        margin-right: 0;
        max-width: none;
    }
    
    .modal-content {
        margin: 1rem;
        min-width: auto;
        max-width: calc(100vw - 2rem);
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}