* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #1a1a2e;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Image placeholder */
.image-container {
    width: 100%;
    max-width: 320px;
    aspect-ratio: unset;
    max-height: 300px;  
    background-color: #2d2d44;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #3d3d5c;
}

.image-container img {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    width: auto;
}

.image-placeholder {
    color: #6b6b8d;
    font-size: 14px;
}

/* Input section */
.input-section {
    width: 100%;
    display: flex;
    gap: 12px;
    position: relative;
}

.guess-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #3d3d5c;
    border-radius: 8px;
    background-color: #2d2d44;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s;
}

.guess-input::placeholder {
    color: #6b6b8d;
}

.guess-input:focus {
    border-color: #6c63ff;
}

.guess-button {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    background-color: #6c63ff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.guess-button:hover {
    background-color: #5a52d5;
}

.guess-button:active {
    transform: scale(0.98);
}

.guess-button:disabled {
    background-color: #4a4a6a;
    cursor: not-allowed;
}

/* Guess counter */
.guess-counter {
    font-size: 14px;
    color: #8b8ba3;
    margin-top: -12px;
}

/* Answer message (game over) */
.answer-message {
    width: 100%;
    padding: 14px 18px;
    background-color: #3a3a55;
    border: 2px solid #e65c44;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

/* Guess rows */
.guesses-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guess-row {
    width: 100%;
    padding: 14px 18px;
    background-color: #2d2d44;
    border: 2px solid #3d3d5c;
    border-radius: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #8b8ba3;
    transition: all 0.2s;
}

.guess-row.filled {
    color: #ffffff;
    border: none;
    padding: 0;
    gap: 5px;
    align-items: stretch;
    background-color: #1a1a2e;
    border-right: 1px solid white;
    border-radius: 15px;
}

.guess-row.active {
    background-color: #5e5e81;
    border-color: #5e5e81;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guess-row.correct {
    border-right: 1px solid #3d7a4d;
    border-radius: 15px;
}

/* Filled row child elements */
.guess-item {
    background-color: #3f3f58;
    padding: 12px 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid white;
    border-radius: 15px;
}

.guess-item.correct {
    background-color: #2d5a3d;
    border: 2px solid #3d7a4d;
    color: #4ade80;
}

.guess-name {
    flex: 5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guess-distance {
    flex: 2;
    font-size: 13px;
}

.guess-direction {
    flex: 1;
    border-right: none;
}



/* Custom Suggestions Dropdown */
#suggestions-container {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: #2d2d44;
    border: 2px solid #3d3d5c;
    border-radius: 12px;
    box-shadow: 0 6px 18px 0 rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 1000;
}

#suggestions-container.show {
    display: block;
}

.suggestion-item {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 16px;
    color: #e6e7f2;
    background-color: #2d2d44;
    border-bottom: 1px solid #3d3d5c;
    transition: background-color 0.15s;
}

.suggestion-item:first-child {
    border-radius: 10px 10px 0 0;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.suggestion-item:only-child {
    border-radius: 10px;
}

.suggestion-item:hover {
    background-color: #3a3a55;
}

.suggestion-item.selected {
    background-color: #4b4b72;
    color: #ffffff;
}

/* Scrollbar styling for suggestions */
#suggestions-container::-webkit-scrollbar {
    width: 8px;
}

#suggestions-container::-webkit-scrollbar-track {
    background: #25253b;
    border-radius: 4px;
}

#suggestions-container::-webkit-scrollbar-thumb {
    background: #54547a;
    border-radius: 4px;
}

#suggestions-container::-webkit-scrollbar-thumb:hover {
    background: #6a6a94;
}

/* Confetti animation */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}

.confetti {
    position: absolute;
    top: -20px;
    opacity: 0;
    animation: confettiFall ease-out forwards;
}

.confetti.square {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.confetti.circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.confetti.ribbon {
    width: 4px;
    height: 16px;
    border-radius: 2px;
}

@keyframes confettiFall {
    0% {
        top: -20px;
        opacity: 1;
        transform: translateX(0) rotate(0deg) scale(1);
    }
    25% {
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: translateX(calc(-50px + 100px * var(--random, 0.5))) rotate(720deg) scale(0.5);
    }
}