body {
    background-color: #181818;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
}

h1 {
    color: #8bc34a;
}

.search-container {
    position: relative;
    width: 350px;
    margin: 30px auto;
}

#enemy-search {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #555;
    background-color: #282828;
    color: white;
}

#suggestions {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 100;

    max-height: 300px;
    overflow-y: auto;

    background-color: #252525;
    border-radius: 6px;
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
}

.suggestion-image {
    width: 45px;
    height: 45px;
    object-fit: contain;
    flex-shrink: 0;
}

.suggestion:hover {
    background-color: #444;
}

#guess-button {
    margin-top: 15px;
    padding: 10px 25px;
    background-color: #8bc34a;
    color: #181818;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

#guess-button:hover {
    background-color: #a5d66a;
}

.results-container {
    width: 95%;
    margin: 30px auto;
    overflow-x: auto;
}

#guess-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 5px;
}


#guess-table th,
#guess-table td {
    box-sizing: border-box;
    min-width: 0;
    padding: 6px 4px;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Enemy */
#guess-table th:nth-child(1),
#guess-table td:nth-child(1) {
    width: 125px;
}

/* Family */
#guess-table th:nth-child(2),
#guess-table td:nth-child(2) {
    width: 85px;
}

/* Games */
#guess-table th:nth-child(3),
#guess-table td:nth-child(3) {
    width: 65px;
}

/* Weight */
#guess-table th:nth-child(4),
#guess-table td:nth-child(4) {
    width: 65px;
}

/* Health */
#guess-table th:nth-child(5),
#guess-table td:nth-child(5) {
    width: 65px;
}

/* Attacks */
#guess-table th:nth-child(6),
#guess-table td:nth-child(6) {
    width: 120px;
}

/* Movement */
#guess-table th:nth-child(7),
#guess-table td:nth-child(7) {
    width: 100px;
}


#guess-table th {
    background-color: #383838;
}

#guess-table td {
    min-width: 85px;
}

#guess-table td.correct {
    background-color: #388e3c;
}

#guess-table td.incorrect {
    background-color: #c62828;
}

#guess-table td.partial {
    background-color: #f9a825;
    color: #181818;
}

#guess-table td.neutral {
    background-color: #282828;
}

#victory-message {
    margin: 20px auto;
    color: #8bc34a;
    font-size: 20px;
    font-weight: bold;
}

#guess-button:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
}

#enemy-search:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.enemy-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.enemy-image {
    width: 55px;
    height: 55px;
    object-fit: contain;
    flex-shrink: 0;
}

.enemy-cell span {
    text-align: left;
}

#hints-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

#hints-container button {
    padding: 10px 16px;
    cursor: pointer;
}

#hints-container button:disabled {
    opacity: 1;
    background-color: #444;
    color: #ddd;
    cursor: not-allowed;
}

#hints-container button:not(:disabled) {
    background-color: #4caf50;
    color: white;
    cursor: pointer;
}

#hint-display {
    text-align: center;
    margin: 15px auto;
}

#hint-display img {
    width: 180px;
    height: 180px;
    object-fit: contain;
}

#hints-container button.used {
    background-color: #444;
    color: #ddd;
    cursor: default;
}

.enemy-silhouette {
    filter: brightness(0);
}

#louie-note-display {
    max-width: 600px;
    margin: 15px auto;
    line-height: 1.6;
    white-space: pre-line;
}

#silhouette-display {
    margin: 15px auto;
}

.louie-hint-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: left;
}

.louie-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

.louie-hint-content p {
    flex: 1;
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .louie-hint-content {
        flex-direction: column;
        text-align: center;
    }

    .louie-image {
        width: 100px;
        height: 100px;
    }
    .louie-speech::before {
    left: 50%;
    top: -12px;
    transform: translateX(-50%);

    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid #333;
    border-top: 0;
    }
}

.louie-speech {
    position: relative;
    background-color: #333;
    color: #fff;
    padding: 18px 22px;
    border-radius: 16px;
    line-height: 1.6;
}

/* Triangle pointing toward Louie */
.louie-speech::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);

    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 12px solid #333;
}

#guess-counter {
    text-align: center;
    color: #bbb;
    font-size: 14px;
    margin: 12px 0;
}

#share-button {
    display: block;
    margin: 15px auto;
    padding: 12px 24px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

#share-button:hover {
    background-color: #388e3c;
}

#share-button[hidden] {
    display: none;
}

#scroll-hint {
    display: none;
}

@media (max-width: 768px) {
    .results-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #guess-table {
        width: 625px;
        min-width: 625px;
        table-layout: fixed;
        border-spacing: 3px;
    }

    #guess-table th,
    #guess-table td {
        box-sizing: border-box;
        min-width: 0;
        width: 105px;
        padding: 8px;
        font-size: 13px;
        white-space: normal;
        overflow-wrap: break-word;
    }

    .enemy-image {
        width: 35px;
        height: 35px;
    }

    .enemy-cell {
        gap: 4px;
    }

    .enemy-cell span {
        font-size: 11px;
    }

    #guess-counter {
        display: block;
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }

    #hints-container {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        margin: 10px auto 20px;
    }

    #hints-container button {
        font-size: 13px;
        padding: 10px 12px;
    }
    .search-container {
        margin-bottom: 10px;
    }

    .results-container {
        margin-top: 10px;
    }

    #scroll-hint {
        display: block;
        text-align: center;
        color: #aaa;
        font-size: 12px;
        margin: 8px 0 4px;
    }

    #hint-display {
        margin-bottom: 10px;
    }

    #silhouette-display {
        margin: 10px auto;
    }

    .search-container {
        margin-top: 10px;
    }

    .louie-image {
        width: 75px;
        height: 75px;
    }

    .louie-hint-content {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .louie-speech {
        position: relative;
        margin-top: 8px;
    }

    .louie-speech::before {
        content: "";
        position: absolute;

        top: -12px;
        left: 50%;
        transform: translateX(-50%);

        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-bottom: 12px solid #333;
        border-top: 0;
    }
    
    #victory-message {
        max-width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
        font-size: 18px;
        line-height: 1.4;
        text-align: center;
    }

    #share-button {
        max-width: 100%;
        padding: 12px 20px;
        font-size: 14px;
        margin: 12px auto;
    }
}

.suggestion.highlighted {
    background-color: #444;
}

#help-button {
    position: absolute;
    top: 15px;
    right: 15px;

    width: 36px;
    height: 36px;
    border: 2px solid #aaa;
    border-radius: 50%;

    background-color: transparent;
    color: #ddd;

    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

#help-button:hover {
    background-color: #444;
}

#help-dialog {
    width: min(500px, 90vw);
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box;

    padding: 25px;
    border: 1px solid #555;
    border-radius: 12px;

    background-color: #252525;
    color: white;
    line-height: 1.6;
}

#help-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.75);
}

#help-dialog h2 {
    margin-top: 0;
    color: #8fcb48;
}

#help-dialog h3 {
    margin-bottom: 5px;
}

#help-dialog ul {
    padding-left: 20px;
}

#help-dialog li {
    margin-bottom: 8px;
}

#close-help {
    position: absolute;
    top: 10px;
    right: 15px;

    border: none;
    background: transparent;
    color: #ddd;

    font-size: 28px;
    cursor: pointer;
}

#next-enemy-timer {
    margin-top: 20px;
    text-align: center;
}

#next-enemy-timer p {
    margin-bottom: 5px;
    font-size: 16px;
    color: #ccc;
}

#countdown {
    font-size: 30px;
    font-weight: bold;
    color: #8fcb48;
    font-variant-numeric: tabular-nums;
}

#next-enemy-timer[hidden] {
    display: none;
}