* {
    box-sizing: border-box;
}

p {
    padding: 5px;
    margin: 0;
}

a {
    color: #86c232;
}

body {
    background-color: #222629;
    color: whitesmoke;
    font-size: 17px;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
}

body.daily {
    background-color: #1e202f;
}

body.daily a {
    color: #e38616;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.togglec {
    color: white !important;
    border-style: solid;
    border-width: 1px;
    border-radius: 10px;
    padding: 8px;
    margin: 10px;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.togglec:hover {
    background-color: #5bc232;
}

body.daily .togglec:hover {
    background-color: #e38616;
}

.type-block {
    font-size: 14px;
    color: #ffffff;
    padding: 6px;
    margin: 3px;
    font-weight: normal;
    display: inline-block;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.5s;
}

.hintbtn {
    border-style: solid;
    border-color: gray;
    background-color: gray;
    color: white;
    font-size: 14px;
    border-radius: 15px;
    cursor: pointer;
}

.hintbtn:hover {
    background-color: Gainsboro;
    border-color: Gainsboro;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.blurb {
    margin: 0;
    padding: 2px;
}

.credit {
    font-size: 13px;
}

#attempts {
    color: crimson;
}

/* ── Guess grid ──────────────────────────────────────────────────────────── */

.guesses {
    margin-top: 15px;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    display: none;
}

.row {
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    flex: 1;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s, transform 0.4s;
}

.row.in {
    opacity: 1;
    transform: translateY(0);
}

/* The hinttitles row is always visible once shown */
#hinttitles {
    opacity: 0;
}

#hinttitles.in {
    opacity: 1;
    transform: none;
}

.column {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    flex: 1;
    min-width: 70px;
    max-width: 70px;
    margin-top: auto;
    margin-bottom: auto;
}

.hint {
    font-weight: bold;
    font-size: 14px;
}

.emoji {
    object-fit: scale-down;
    width: 40px;
    height: 40px;
    margin: 3px auto;
}

.item_thumb {
    object-fit: scale-down;
    width: 70px;
}

#secret_thumb {
    margin-left: auto;
    margin-right: auto;
    max-width: 300px;
    display: none;
}

/* ── Tooltip ─────────────────────────────────────────────────────────────── */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: black;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 15px;
    position: absolute;
    z-index: 1;
    top: 80%;
    left: 50%;
    margin-left: -10px;
    opacity: 0;
    transition: opacity 0.5s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ── Autocomplete ────────────────────────────────────────────────────────── */

.autocomplete {
    position: relative;
    display: inline-block;
    width: 300px;
}

.autocomplete-items {
    position: absolute;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: white;
    border-bottom: 1px solid aliceblue;
    color: black;
    text-align: left;
}

.autocomplete-items div:hover {
    background-color: #e6e6e6;
}

.autocomplete-active {
    background-color: #a6ffaa !important;
}

.dropinfo {
    color: black;
    font-size: 13px;
}

/* ── Form inputs ─────────────────────────────────────────────────────────── */

input[type="text"] {
    width: 100%;
    background-color: aliceblue;
    color: black;
}

#guess_weapon {
    padding: 10px;
    width: 300px;
    margin: 0;
}

.guess_input {
    border-radius: 0;
    border: 1px solid transparent;
    font-size: 19px;
    margin: 10px;
}

/* ── Popup (How To Play) ─────────────────────────────────────────────────── */

.popup {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.popup-content {
    background-color: #222629;
    margin: 40px auto;
    padding: 20px;
    border: 1px solid #888;
    width: 70%;
    max-width: 600px;
    position: relative;
}

.popup-content img:not(.emoji) {
    padding: 15px;
    height: 100%;
    width: 100%;
    object-fit: contain;
    max-width: 450px;
    margin: 0 auto;
    display: block;
}

.popup-content .emoji {
    width: 32px;
    height: 32px;
}

/* ── Clipboard notification ──────────────────────────────────────────────── */

#notification {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100px;
    padding: 6px;
    background-color: #4caf50;
    color: white;
    border-radius: 10px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s, transform 0.5s;
    pointer-events: none;
    z-index: 100;
}

#notification.show {
    opacity: 1;
    transform: translateY(0);
}

#notification.hidden {
    opacity: 0;
    transform: translateY(-20px);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media screen and (max-width: 450px) {
    body {
        font-size: 16px;
    }

    .column {
        min-width: 55px;
        max-width: 55px;
    }

    .type-block {
        font-size: 13px;
        padding: 5px;
        margin: 2px;
    }

    .hint {
        font-size: 11px;
    }

    .guess_input {
        box-sizing: border-box;
    }

    .item_thumb {
        object-fit: scale-down;
        width: 55px;
    }

    .emoji {
        width: 32px;
        height: 32px;
    }
}
