/* ============================= */
/*           IMPORTS             */
/* ============================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&display=swap');

/* ============================= */
/*         VARIABLES             */
/* ============================= */
:root {
    --bg-color: #0b0b0b;
    --accent-color: #f5c518;
    --text-color: #fff;
    --btn-bg: #1a1a1a;
    --btn-hover: #333;
    --disabled: #555;
}

/* ============================= */
/*            GLOBALS            */
/* ============================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.05);
}

#share-text {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

body {
    background:
        url('./background-image.jpeg') center center / cover no-repeat fixed;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    position: relative;
    overflow-x: hidden;
    max-height: 100%;
    overflow-y: auto;
}

/* ============================= */
/*          TYPOGRAPHY           */
/* ============================= */
h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2rem;
}

h1,
h2 {
    color: var(--accent-color);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

h3,
h4 {
    font-weight: 100;
    color: #ddd;
}

h5 {
    font-weight: 400;
    color: #ddd;
    margin-bottom: 2rem;
}

.info p {
    margin-bottom: 0;
}

/* ============================= */
/*          LAYOUT / CONTAINERS  */
/* ============================= */
.container {
    animation: fadeIn 1s ease-in-out;
}

.info {
    border-color: #000000;
    padding: 20px 0 50px 0;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.suggestions {
    position: absolute;
    top: 100%;
    background: #333;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    border-radius: 6px;
    margin-top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    cursor: pointer;
}

.suggestion-item:hover {
    background: #272727;
}

.suggestion-item img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
}

#score-container {
    margin-top: 50px;
}

#logo {
    padding-top: 50px;
    padding-bottom: 25px;
}

.game {
    min-height: 300px;
}

.socials {
    margin-top: 50px;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    z-index: 100;
}

.socials a {
    color: var(--accent-color);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.socials a:hover {
    color: var(--text-color);
    transform: scale(1.2);
}

#yesterdayChar-container {
    margin-top: 50px;
}

/* ============================= */
/*           BUTTONS             */
/* ============================= */
.button-game {
    background-color: var(--btn-bg);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
}

.button-game a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.button-title {
    color: #fff;
    font-weight: 600;
    font-size: 1.2rem;
}

.button-description {
    color: #ccc;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.button-game:hover:not(.disabled) {
    transform: scale(1.03);
}

.button-game.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    background-color: var(--btn-bg);
    border: 2px solid var(--accent-color);
    color: var(--text-color);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
}

.btn:hover:not(:disabled) {
    transform: scale(1.03);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================= */
/*           INPUTS              */
/* ============================= */
#input-container {
    padding-bottom: 45px;
}

#guess-input {
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 20px;
    border: 2px solid var(--accent-color);
    width: 100%;
    max-width: 400px;
    background-color: rgba(26, 26, 26, 0.9);
    color: var(--text-color);
    box-shadow: 0px 4px 8px rgba(245, 197, 24, 0.2);
    transition: all 0.3s ease;
    outline: none;
}

#guess-input::placeholder {
    font-size: 0.74rem;
}

#guess-input:hover,
#guess-input:focus {
    border-color: var(--accent-color);
    background-color: rgba(51, 51, 51, 0.9);
    box-shadow: 0px 4px 12px rgba(245, 197, 24, 0.3);
}

#guess-input:disabled {
    background-color: var(--disabled);
    cursor: not-allowed;
    box-shadow: none;
    color: #999;
}

/* ============================= */
/*            HINTS              */
/* ============================= */
.midCorrect-hint {
    background-color: #dd830d;
    transition: background-color 0.3s ease;
}

.midCorrect-hint:hover {
    background-color: #c4710c;
}

.correct-hint {
    background-color: #08a828;
    transition: background-color 0.3s ease;
}

.correct-hint:hover {
    background-color: #069020;
}

.incorrect-hint {
    background-color: #d3100b;
    transition: background-color 0.3s ease;
}

.incorrect-hint:hover {
    background-color: #b00e09;
}

/* ============================= */
/*            TABLES             */
/* ============================= */
#tableClassic {
    border-collapse: collapse;
}

#tableClassic th {
    align-content: end;
    padding-top: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #7e7e7e;
    border-left: 1px solid #7e7e7e;
    border-right: 1px solid #7e7e7e;
}

#tableClassic td {
    height: 100px;
}

#tableClassic th,
#tableClassic td {
    font-size: 0.85rem;
    width: 100px;
    text-align: center;
    vertical-align: middle;
    border-top: none;
    overflow: hidden;
    white-space: nowrap;
    object-fit: cover;
}

.tryChar td {
    box-shadow:
        inset 0 0 8px rgba(0, 0, 0, 0.35),
        inset 0 0 2px rgba(0, 0, 0, 0.3);
    border: 1px solid #000;
    font-weight: normal;
}

td,
th,
td img {
    max-width: 100px;
    max-height: 100px;
}

#tableClassic td img {
    width: 100px;
    height: 100px;
    object-fit: fill;
}

td.scroll-cell {
    overflow-y: auto;
    overflow-x: hidden;
}

td.scroll-cell div {
    max-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ============================= */
/*          ANIMATIONS           */
/* ============================= */
@keyframes fadeInLeft {
    0% {
        transform: rotateY(90deg);
        opacity: 0;
    }

    100% {
        transform: rotateY(0);
        opacity: 1;
    }
}

.fade-in {
    transform: rotateY(90deg);
    opacity: 0;
    animation: fadeInLeft 0.8s ease forwards;
}

td:nth-child(1).fade-in {
    animation-delay: 0.6s;
}

td:nth-child(2).fade-in {
    animation-delay: 1.2s;
}

td:nth-child(3).fade-in {
    animation-delay: 1.8s;
}

td:nth-child(4).fade-in {
    animation-delay: 2.4s;
}

td:nth-child(5).fade-in {
    animation-delay: 3.0s;
}

td:nth-child(6).fade-in {
    animation-delay: 3.6s;
}

td:nth-child(7).fade-in {
    animation-delay: 4.2s;
}

td:nth-child(8).fade-in {
    animation-delay: 4.8s;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}

.confetti {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: #ff0;
    opacity: 0.7;
    pointer-events: none;
    animation: confetti-fall 3s linear forwards;
    position: fixed;
    z-index: 999;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================= */
/*          COMPONENTS           */
/* ============================= */
#countdown {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
    display: none;
}

.name {
    position: relative;
    overflow: hidden;
    height: 100px;
    display: flex;
    align-content: center;
}

.name img {
    transition: opacity 0.4s ease;
}

.nameTitle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    width: 90%;
    max-height: 80%;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
}

.name:hover img {
    opacity: 0.25;
}

.name:hover .nameTitle {
    opacity: 1;
}

.credits {
    font-size: 0.7rem;
    margin-top: 20px;
}

a.nostyle,
a.nostyle:hover,
a.nostyle:visited,
a.nostyle:focus,
a.nostyle:active {
    text-decoration: none;
    color: inherit;
    outline: 0;
    cursor: pointer;
}

#share-container {
    display: none;
    text-align: center;
    margin-top: 1rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

#share-text {
    background: linear-gradient(180deg, rgba(179, 144, 21, 1) 0%, rgba(128, 103, 15, 1) 64%);
    border: 4px solid var(--accent-color);
    border-radius: 10px;
    color: var(--bg-color);
    padding: 1.5rem 2rem;
    width: min-content;
    font-weight: 600;
    font-size: 1.1rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: pre-wrap;
}

/* ============================= */
/*         SCROLLBARS            */
/* ============================= */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-color), #b99200);
    border-radius: 10px;
    border: 2px solid #0b0b0b;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffd84d, var(--accent-color));
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* ============================= */
/*        MEDIA QUERIES          */
/* ============================= */

/* --- Tablets y pantallas medianas --- */
@media (max-width: 1024px) {

    .container {
        padding: 0 1rem;
    }

    .search-bar {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .suggestions {
        width: 90%;
    }

    #guess-input {
        max-width: 100%;
    }

    .game {
        overflow-x: auto;
    }

    #tableClassic {
        width: max-content;
        min-width: 700px;
    }

    #tableClassic th,
    #tableClassic td {
        font-size: 0.8rem;
    }
}

/* --- Móviles (pantallas pequeñas) --- */
@media (max-width: 768px) {

    .container {
        width: 100%;
    }

    #share-text {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        width: 90%;
        text-align: center;
    }
}


/* QUOTE */
#tableQuote {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
}

.tryCharQuote,
.tryCharEmoji {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    width: 100% !important;
    height: 100% !important;
    padding-block: 16px;
    box-sizing: border-box;
    position: static;
}

.tryCharQuote img,
.tryCharEmoji img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.tryCharQuote.incorrect-hint,
.tryCharEmoji.incorrect-hint {
    border: #ff4848 2px solid;
}

.quoteDiv,
.emojiDiv {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #333;
    padding: 50px;
    padding-bottom: 75px;
    margin-bottom: 20px;
    border-radius: 12px;
}

.quoteDiv p,
.emojiDiv p {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    margin-top: 15px;
}

.quoteDiv #hint-text,
.emojiDiv #hint {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    margin-top: 15px;
    margin-bottom: 15px;
}

#hint-btn {
    white-space: nowrap;
}

#quote {
    margin-top: 20px;
}

.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background-color: var(--btn-bg);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(245, 197, 24, 0.1);
}

.nav-link {
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover {
    background-color: var(--btn-hover);
    color: var(--accent-color);
    transform: scale(1.05);
}

.nav-link.disabled {
    color: var(--disabled);
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
    border: 1px dashed var(--disabled);
}

.nav-link.nav-selected {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 10px rgba(245, 197, 24, 0.6);
    cursor: default;
    transform: none;
}

.nav-link.nav-selected:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    transform: none;
}

@media (max-width: 600px) {
    .main-nav {
        flex-direction: column;
        gap: 1rem;
    }
}

.tooltip-container {
    position: relative;
    cursor: help;
    overflow: visible !important;
}

.tooltip-container .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    width: max-content;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    transition: opacity 0.2s ease;
    z-index: 9999;
    border: 1px solid #333;
}

.tooltip-container .tooltip::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent #1a1a1a transparent;
}

.tooltip-container:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

hr.divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, rgba(245, 197, 24, 0.5), rgba(245, 197, 24, 0.1), rgba(245, 197, 24, 0.5));
    margin: 2rem 0;
    border-radius: 4px;
}

.info h1,
.info h2,
.info button {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}