@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --background: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --text: #172033;
    --text-muted: #718096;

    --primary: #4f46e5;
    --primary-hover: #4338ca;

    --border: #e7eaf0;

    --shadow-sm: 0 4px 14px rgba(30, 41, 59, 0.06);
    --shadow-lg: 0 20px 50px rgba(30, 41, 59, 0.1);

    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: "Inter", sans-serif;
    color: var(--text);

    background:
        radial-gradient(
            circle at top left,
            rgba(79, 70, 229, 0.08),
            transparent 30%
        ),
        var(--background);
}

/* =========================
   APP
   ========================= */

.app {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 30px;
}

/* =========================
   HEADER
   ========================= */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 8px;

    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

h1 {
    margin: 0;

    font-size: clamp(34px, 5vw, 52px);
    line-height: 1;
    letter-spacing: -0.04em;
}

h1 span {
    color: var(--primary);
}

.subtitle {
    margin: 12px 0 0;

    color: var(--text-muted);
    font-size: 15px;
}

/* =========================
   SCORE
   ========================= */

.score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 110px;
    height: 100px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow: var(--shadow-sm);
}

.score-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.score-card strong {
    margin-top: 4px;

    color: var(--primary);
    font-size: 34px;
    line-height: 1;
}

/* =========================
   GAME CARD
   ========================= */

.game-card {
    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow-lg);
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 24px 26px;
}

.map-header h2 {
    margin: 0;

    font-size: 19px;
    letter-spacing: -0.02em;
}

.map-header p {
    margin: 5px 0 0;

    color: var(--text-muted);
    font-size: 13px;
}

.answer-result {
    display: none;
    align-items: center;
    gap: 10px;

    margin-top: 14px;
    padding: 13px 16px;

    border-radius: 12px;

    font-size: 14px;
    font-weight: 600;

    animation: resultIn 0.25s ease;
}

.answer-result.success {
    display: flex;

    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.answer-result.error {
    display: flex;

    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

@keyframes resultIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.round-badge {
    flex-shrink: 0;

    padding: 9px 13px;

    color: var(--primary);
    background: #eef2ff;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

/* =========================
   MAP
   ========================= */

#map {
    width: 100%;
    height: 520px;

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);

    background: #e8f0f7;
}

/* Leaflet */

.leaflet-control-zoom {
    margin: 16px !important;

    border: none !important;
    box-shadow: var(--shadow-sm) !important;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;

    color: var(--text) !important;
    background: white !important;

    border: none !important;
}

.leaflet-control-zoom a:first-child {
    border-radius: 10px 10px 0 0;
}

.leaflet-control-zoom a:last-child {
    border-radius: 0 0 10px 10px;
}

/* =========================
   ANSWER
   ========================= */

.answer-section {
    padding: 26px;
}

.answer-section label {
    display: block;
    margin-bottom: 9px;

    font-size: 13px;
    font-weight: 700;
}

.answer-row {
    display: flex;
    gap: 10px;
}

#countryNameInput {
    flex: 1;
    min-width: 0;

    height: 52px;
    padding: 0 16px;

    color: var(--text);
    background: var(--surface);

    border: 1px solid #dfe3eb;
    border-radius: 12px;

    outline: none;

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#countryNameInput::placeholder {
    color: #a1a9b8;
}

#countryNameInput:hover {
    border-color: #c8ceda;
}

#countryNameInput:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* =========================
   BUTTONS
   ========================= */

.primary-button {
    height: 52px;
    padding: 0 24px;

    color: white;
    background: var(--primary);

    border: none;
    border-radius: 12px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    box-shadow: 0 5px 12px rgba(79, 70, 229, 0.2);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.primary-button:hover {
    background: var(--primary-hover);

    transform: translateY(-1px);

    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.25);
}

.primary-button:active {
    transform: translateY(0);
}

.skip-button {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-top: 14px;
    padding: 5px 0;

    color: var(--text-muted);
    background: none;

    border: none;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        color 0.2s ease,
        gap 0.2s ease;
}

.skip-button:hover {
    color: var(--primary);
    gap: 11px;
}

/* =========================
   FOOTER
   ========================= */

.footer {
    display: flex;
    justify-content: center;
    gap: 8px;

    margin-top: 22px;

    color: #98a1b2;

    font-size: 11px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 700px) {
    .app {
        width: min(100% - 20px, 1100px);
        padding-top: 24px;
    }

    .header {
        align-items: flex-start;
    }

    .score-card {
        min-width: 82px;
        height: 78px;
    }

    .score-card strong {
        font-size: 28px;
    }

    #map {
        height: 420px;
    }

    .map-header {
        align-items: flex-start;
        padding: 20px;
    }

    .round-badge {
        display: none;
    }

    .answer-section {
        padding: 20px;
    }
}

@media (max-width: 520px) {
    .header {
        gap: 15px;
    }

    h1 {
        font-size: 36px;
    }

    .subtitle {
        font-size: 13px;
    }

    .score-card {
        min-width: 72px;
    }

    .answer-row {
        flex-direction: column;
    }

    #countryNameInput,
    .primary-button {
        width: 100%;
    }

    #map {
        height: 360px;
    }

    .footer {
        flex-wrap: wrap;
        text-align: center;
    }
}
