@import url("reset.css");

/* core */

body {
    background-color: #151515;
    color: #FFF;
    font-size: 20px;
    font-family: "Google Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings: "GRAD" 0;
    line-height: 1.4;
    overflow-x: hidden;
}

b {
    font-weight: bold;
}

a {}

a:hover {
    opacity: 0.9;
}

.page-width {
    max-width: 800px;
    margin: 0 auto;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 0;
}

nav {
    font-size: 30px;
}

nav ul {
    display: flex;
    gap: 10px;
}

nav li {
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

nav li span {
    display: block;
    transition: all 0.3s ease;
    user-select: none;
}

nav li:hover {
    background-color: #333;
}

nav li:hover span {
    transform: rotate(10deg);
}

nav li:active span {
    transform: rotate(10deg) scale(1.2);
    filter: brightness(1.2);
}

#menu-button-tip {
    display: none;
    opacity: 0.25;
}

#menu-button-tip:hover {
    opacity: 1;
}

section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.content-box {}

.logo {
    font-size: 36px;
    font-weight: bold;
    position: relative;
    color: #FFF;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo:hover {
    opacity: 1;
}

.logo .level {
    position: absolute;
    top: -5px;
    right: 0;
    font-size: 11px;
    color: #777;
}

.logo:hover .icon {
    animation: brain-pulse 0.5s ease-in-out infinite;
}

@keyframes brain-pulse {

    from,
    to {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

#info {
    text-align: center;
}

#menu-timer {
    display: none;
    font-family: monospace;
}

#menu-button-restart {
    display: none;
}

.guessing {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    /* max-height: 2000px; */
}

.guessing>* {
    flex: 1;
}

.guessing .msg.last-words {
    border: 1px solid #DDD;
}

.guessing .msg {
    display: grid;
    /* Начальное состояние анимации (схлопнут) */
    grid-template-rows: 0fr;
    opacity: 0;
    margin-bottom: 0;
    /* Запускаем анимацию при появлении */
    animation: openMsg 0.2s ease-out forwards;
}

.guessing .msg .msg-content {
    /* overflow: hidden; */
    /* Скрываем то, что не влезает при анимации. Потенциально наличие overflow правильнее, но я тестила оба варианта и не заметила разницы.. мб вернуться к этому в будущем. */
    border: 1px solid transparent;
    border-radius: 10px;
    position: relative;
    background-color: lab(16.1051% -1.18239 -11.7533);
}

.guessing .word-and-distance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 15px 10px;
}

.guessing .iwawwa {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    height: 52px;
}

.guessing .iwawwa img {
    max-height: 42px;
}

.guessing .word {
    z-index: 1;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.guessing .distance {
    z-index: 1;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.guessing .bg {
    border-radius: 10px;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.guessing .name {
    position: absolute;
    top: 0;
    left: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.guessing .last-words .name {
    display: none;
}

footer.main {
    display: flex;
    align-items: center;
    justify-content: center;
}

footer.main .github-link img {
    width: 80px;
}

footer.tech-things {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.ui-cols {
    display: flex;
    align-items: flex-start;
}

.ui-cols>* {
    flex: 1;
}

.button,
button,
input[type="button"],
input[type="submit"] {
    width: 100%;
    cursor: pointer;
    user-select: none;
    padding: 15px 20px;
    border-radius: 5px;
    border: none;
    background-color: #055c05;
    color: #FFF;
    font-size: 18px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    /* background-color: #444; */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled {
    background-color: #555;
}

@keyframes fadeInOpacity {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes openMsg {
    0% {
        grid-template-rows: 0fr;
        opacity: 0;
        transform: translateY(-20px);
        margin-bottom: 0;
    }

    100% {
        grid-template-rows: 1fr;
        /* 1fr = 100% реальной высоты контента */
        opacity: 1;
        transform: translateY(0);
        margin-bottom: 10px;
        /* Финальный отступ между сообщениями */
    }
}

/* error overlay */

.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 2rem;
    padding: 20px;
    z-index: 9999;
    animation: fadeInOpacity 0.5s ease-in-out;
}

.error-overlay .error-content {
    max-width: 600px;
}

.error-overlay .error-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

/* app theme - obs-overlay */
.theme-obs-overlay nav,
.theme-obs-overlay #info,
.theme-obs-overlay footer.main,
.theme-obs-overlay footer.tech-things {
    display: none;
}

.theme-obs-overlay header.main {
    padding-top: 7px;
    padding-bottom: 15px;
}

.theme-obs-overlay section {
    margin-bottom: 30px;
}

.theme-obs-overlay #winner .title {
    display: none;
}

/* hide 4 and 5 elements */
.theme-obs-overlay #leaderboard .list *:nth-child(n+4) {
    display: none;
}

/* remove border from 3 elements */
.theme-obs-overlay #leaderboard .list *:nth-child(3) {
    border-bottom: none;
    padding-bottom: 0;
}

.theme-obs-overlay #statistic,
.theme-obs-overlay #leaderboard {
    padding-top: 15px;
    padding-bottom: 15px;
}

.theme-obs-overlay #statistic .title,
.theme-obs-overlay #leaderboard .title {
    margin-bottom: 10px;
}

/* временный фикс для обс и Квантума */
@media all and (max-width: 800px) {

    header.main {
        padding-top: 7px;
        padding-bottom: 15px;
    }

    section {
        margin-bottom: 30px;
    }

    #winner .title {
        display: none;
    }

    /* hide 4 and 5 elements */
    #leaderboard .list *:nth-child(n+4) {
        display: none;
    }

    /* remove border from 3 elements */
    #leaderboard .list *:nth-child(3) {
        border-bottom: none;
        padding-bottom: 0;
    }

    #statistic,
    #leaderboard {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    #statistic .title,
    #leaderboard .title {
        margin-bottom: 10px;
    }
}

/* Специальные стили для режима obs-overlay */
.obs-overlay nav,
.obs-overlay #info,
.obs-overlay footer.main,
.obs-overlay footer.tech-things {
    display: none;
}

.obs-overlay header.main {
    padding-top: 7px;
    padding-bottom: 15px;
}

.obs-overlay section {
    margin-bottom: 30px;
}

.obs-overlay #winner .title {
    display: none;
}

/* hide 4 and 5 elements */
.obs-overlay #leaderboard .list *:nth-child(n+4) {
    display: none;
}

/* remove border from 3 elements */
.obs-overlay #leaderboard .list *:nth-child(3) {
    border-bottom: none;
    padding-bottom: 0;
}

.obs-overlay #statistic,
.obs-overlay #leaderboard {
    padding-top: 15px;
    padding-bottom: 15px;
}

.obs-overlay #statistic .title,
.obs-overlay #leaderboard .title {
    margin-bottom: 10px;
}