* {
    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%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    overflow: hidden;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 1000px;
    width: 100%;
    padding: 12px 15px;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 3px;
    font-size: 1.4em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 8px;
    font-size: 0.8em;
}

.score-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 10px;
    color: white;
}

.score-item {
    text-align: center;
}

.score-label {
    font-size: 0.7em;
    opacity: 0.9;
}

.score-value {
    font-size: 1.2em;
    font-weight: bold;
}

.question-info {
    text-align: center;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: rgba(248, 249, 250, 0.95);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.city-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 2px;
}

.multiplier {
    font-size: 0.8em;
    color: #764ba2;
    font-weight: 600;
}

.map-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1836.1431 / 1565.5501;
    border: 3px solid #667eea;
    border-radius: 10px;
    background: #e3f2fd;
    cursor: crosshair;
    overflow: hidden;
}

.map-ui-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    max-width: 280px;
    pointer-events: none;
}

.map-ui-overlay > * {
    pointer-events: none;
}

.map-ui-overlay .buttons {
    pointer-events: auto;
}

.map-ui-overlay button {
    pointer-events: auto;
}

.map-ui-overlay .progress-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.overlay-score-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(240, 147, 251, 0.95);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.overlay-score-item {
    text-align: center;
    flex: 1;
}

.overlay-score-label {
    font-size: 0.7em;
    color: white;
    opacity: 0.9;
    font-weight: 600;
}

.overlay-score-value {
    font-size: 1.2em;
    font-weight: bold;
    color: white;
}

#gameArea {
    display: flex;
    flex-direction: column;
}

.map-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: markerPop 0.3s ease-out;
    margin-left: -10px;
    margin-top: -10px;
}

@keyframes markerPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.marker.guess {
    background: #f5576c;
    z-index: 2;
}

.marker.actual {
    background: #4caf50;
    z-index: 1;
}

@keyframes drawLine {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%;
        opacity: 0.7;
    }
}

.line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, #f5576c, #4caf50);
    transform-origin: left center;
    z-index: 0;
}

.buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 8px 16px;
    font-size: 0.85em;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.result-message {
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    animation: fadeIn 0.5s;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

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

.result-success {
    background: #c8e6c9;
    color: #2e7d32;
}

.result-info {
    background: #fff9c4;
    color: #f57f17;
}

.final-score {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 15px;
}

.final-score h2 {
    font-size: 1.6em;
    margin-bottom: 10px;
}

.final-score .score {
    font-size: 2.5em;
    font-weight: bold;
}

#finalScreen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.final-score-overlay {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 400px;
}

.final-score-overlay h2 {
    font-size: 2em;
    color: #667eea;
    margin-bottom: 20px;
}

.final-score-overlay .score {
    font-size: 3em;
    font-weight: bold;
    color: #764ba2;
    margin-bottom: 15px;
}

.final-score-overlay p {
    color: #666;
    margin-bottom: 0;
}

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

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s;
}

.dot.completed {
    background: #4caf50;
}

.dot.current {
    background: #667eea;
    transform: scale(1.3);
}

/* Stats 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);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
    position: relative;
}

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

.modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    position: absolute;
    right: 20px;
    top: 20px;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85em;
    opacity: 0.9;
}

.stats-history {
    margin-top: 25px;
}

.stats-history h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.history-date {
    font-weight: 500;
    color: #333;
}

.history-score {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.no-history {
    text-align: center;
    color: #999;
    padding: 30px;
    font-style: italic;
}
