/* Shared game-page styles, used by every country instance (paired with game.js). */

html, body {
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-app);
}

header {
    text-align: center;
    padding: 28px 20px 4px;
}

header img {
    width: clamp(220px, 34vw, 326px);
    height: auto;
    filter: drop-shadow(0 6px 16px rgba(20, 28, 46, .22));
}

h1 {
    margin-top: 14px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.4rem, 4.5vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink);
    text-shadow: 0 2px 8px rgba(20, 28, 46, .14);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 16px 20px 32px;
    text-align: center;
}

#map {
    width: min(900px, 100%);
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
}

#map svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 60vh;
}

.map-loading,
.map-error {
    color: var(--ink-3);
    padding: 32px;
}

.guessable-region {
    cursor: pointer;
}

.guessable-region:focus {
    outline: none;
}

.guessable-region:focus-visible {
    filter: drop-shadow(0 0 8px rgba(31, 37, 48, 0.55));
}

.completed-state {
    cursor: auto;
    pointer-events: none;
}

.selected-state {
    animation: pulse 1s infinite;
    stroke: none !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
    }
    50% {
        transform: scale(0.96);
        filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.7));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
    }
}

#inputs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(440px, 100%);
}

#answerInput {
    flex: 1;
    height: 3rem;
    min-width: 0;
    padding: 0 14px;
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    transition: border-color .15s ease, box-shadow .15s ease;
}

#answerInput::placeholder {
    color: var(--ink-3);
}

#answerInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(95, 168, 13, .22);
}

.stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.stats p {
    padding: 0.4rem 0.95rem;
    font-size: 0.95rem;
    color: var(--ink-2);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-1);
}

.stats span {
    font-weight: 700;
    color: var(--ink);
}

footer {
    padding: 14px 20px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.92);
    background: var(--footer-bg);
}

footer a {
    color: #6fd0ff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Answer feedback */
#answerInput.is-wrong {
    border-color: #d64545;
    box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.22);
    animation: input-shake 0.4s ease;
}

#answerInput.is-correct {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(95, 168, 13, 0.30);
    animation: input-pop 0.4s ease;
}

@keyframes input-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes input-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Completion dialog */
.game-complete {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 28, 46, 0.55);
    backdrop-filter: blur(3px);
    animation: overlay-in 0.2s ease;
}

.game-complete[hidden] {
    display: none;
}

.game-complete__panel {
    width: min(420px, 100%);
    padding: 32px 28px;
    text-align: center;
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-3);
    animation: panel-in 0.25s ease;
}

.game-complete__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink);
}

.game-complete__message {
    margin-top: 10px;
    color: var(--ink-2);
}

.game-complete__stats {
    margin-top: 6px;
    font-size: 0.95rem;
    color: var(--ink-3);
}

.game-complete__again {
    margin-top: 22px;
}

@keyframes overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes panel-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* Respect reduced-motion: keep the cues, drop the movement */
@media (prefers-reduced-motion: reduce) {
    #answerInput.is-wrong,
    #answerInput.is-correct,
    .game-complete,
    .game-complete__panel {
        animation: none;
    }

    .selected-state {
        animation: none;
        filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.7));
    }
}
