* {
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0a0c;
    --text-color: #e0f7fa;
    --correct-color: #00ffcc;
    --correct-text: #0a0a0c;
    --incorrect-color: #1a1a1d;
    --empty-color: #0a0a0c;
    --border-color: #00ffcc;
    --input-bg: #111114;
    --neon-glow: 0 0 10px rgba(0, 255, 204, 0.5);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    border-bottom: 4px solid var(--border-color);
    width: 100%;
    text-align: center;
    padding: 10px 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

#rules-btn {
    position: absolute;
    left: 20px;
    background-color: var(--correct-color);
    color: var(--correct-text);
    border: 4px solid var(--border-color);
    padding: 8px 15px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: var(--neon-glow);
}

header h1 {
    margin: 0;
    font-size: 36px;
    letter-spacing: 5px;
    color: var(--correct-color);
    text-shadow: var(--neon-glow);
    text-transform: uppercase;
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        padding: 15px 0;
    }
    
    #rules-btn {
        position: static;
        margin-bottom: 10px;
    }
    
    header h1 {
        font-size: 28px;
        letter-spacing: 2px;
    }
}

main {
    width: 100%;
    max-width: 650px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.map-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--input-bg);
    border: 4px solid var(--border-color);
    box-shadow: var(--neon-glow);
    border-radius: 0;
    overflow: hidden;
}

#map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.8s ease-in-out;
}

#zoom-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 0;
    font-size: 14px;
    font-weight: bold;
}

#guesses-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.guess-box {
    border: 4px solid var(--border-color);
    min-height: 60px; /* Responsive height */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    gap: 10px;
    font-weight: bold;
    border-radius: 0;
    text-transform: uppercase;
    font-size: 18px;
    box-shadow: 0 0 5px rgba(0, 255, 204, 0.2);
}

.guess-hints {
    display: flex;
    gap: 15px;
}

.hint-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hint-item .emoji {
    font-size: 20px;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.hint-item .label {
    text-transform: uppercase;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    margin-top: 2px;
}

.guess-box.correct {
    background-color: #05261e;
    border-color: var(--correct-color);
    color: var(--correct-color);
    box-shadow: var(--neon-glow);
}

.guess-box.incorrect {
    background-color: var(--incorrect-color);
    border-color: #ff003c;
    color: #ff003c;
    box-shadow: 0 0 5px rgba(255, 0, 60, 0.5);
}

#input-container {
    position: relative;
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#city-input {
    flex-grow: 1;
    background-color: var(--input-bg);
    border: 4px solid var(--border-color);
    color: var(--text-color);
    padding: 15px;
    border-radius: 0;
    font-size: 16px;
    font-family: inherit;
    box-shadow: 0 0 5px rgba(0, 255, 204, 0.2);
    outline: none;
}

#city-input:focus {
    box-shadow: var(--neon-glow);
}

#submit-guess {
    background-color: var(--correct-color);
    color: var(--correct-text);
    border: 4px solid var(--border-color);
    padding: 15px 25px;
    border-radius: 0;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: var(--neon-glow);
}

.autocomplete-items {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    background-color: var(--input-bg);
    border: 4px solid var(--border-color);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-items:empty {
    display: none;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 4px solid var(--border-color);
}

.autocomplete-items div:hover {
    background-color: var(--incorrect-color);
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background-color: var(--bg-color);
    padding: 30px;
    border: 4px solid var(--border-color);
    border-radius: 0;
    text-align: center;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

#emoji-grid-container {
    font-size: 24px;
    letter-spacing: 5px;
    margin: 20px 0;
    white-space: pre-wrap;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

#share-btn {
    background-color: var(--correct-color);
    color: var(--correct-text);
    border: 4px solid var(--border-color);
    padding: 15px 24px;
    border-radius: 0;
    font-size: 18px;
    font-family: inherit;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    width: 100%;
    box-shadow: var(--neon-glow);
}

.close-btn, #show-results-btn {
    background-color: var(--bg-color);
    color: var(--border-color);
    border: 4px solid var(--border-color);
    padding: 15px 24px;
    border-radius: 0;
    font-size: 18px;
    font-family: inherit;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    width: 100%;
    box-shadow: var(--neon-glow);
}

@keyframes revealCorrect {
    0% { background-color: var(--input-bg); border-color: var(--border-color); }
    100% { background-color: #05261e; border-color: var(--correct-color); }
}

@keyframes revealIncorrect {
    0% { background-color: var(--input-bg); border-color: var(--border-color); }
    100% { background-color: var(--incorrect-color); border-color: #ff003c; }
}

@keyframes textFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.guess-box.animate-correct {
    animation: revealCorrect 0.6s ease forwards;
}

.guess-box.animate-incorrect {
    animation: revealIncorrect 0.6s ease forwards;
}

.guess-box.animate-correct .guess-name,
.guess-box.animate-incorrect .guess-name,
.guess-box.animate-correct .guess-hints,
.guess-box.animate-incorrect .guess-hints {
    opacity: 0;
    animation: textFadeIn 0.4s ease 0.3s forwards;
}


@media (max-width: 600px) {
    .guess-box {
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }
    .guess-hints {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
}