@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@600&display=swap");

/* styles.css */
html {
    font-size: clamp(13px, 1vw, 20px);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Surfaces */
    --background-color: #072c61;
    --additional-background-color: rgba(7, 34, 74, 0.9);
    --header-background-color: #062551;
    --footer-background-color: #062551;
    --opposite-background-color: #f5f7fb;
    --contrast-background-color: #f0b51a;
    --temporary-contrast-background: #0a2f63;

    /* Interactive elements */
    --button-background-color: #0b3c7a;
    --button-hover-color: #F2AF05;
    --button-border-color: rgba(121, 165, 226, 0.7);
    --border-color: rgba(126, 163, 215, 0.25);

    /* Brand gradient */
    --theme-start-color: #f4c542;
    --theme-middle-color: #1c58a6;
    --theme-end-color: #f0a300;
    --theme-color: linear-gradient(
            135deg,
            var(--theme-start-color) 0%,
            var(--theme-middle-color) 60%,
            var(--theme-end-color) 100%
    );
    --diamond-theme-color: linear-gradient(
            135deg,
            #0f4a93,
            #072c61
    );

    /* Details */
    --dot-color: #f4c542;
    --scrollbar-color: #f0a300 var(--button-background-color);

    /* Text colours */
    --normal-text-color: #dfe9f7;
    --bright-normal-text-color: rgba(223, 233, 247, 0.6);
    --opposite-text-color: #0b1a33;
    --background-text-color: rgba(223, 233, 247, 0.6);
    --green-text-color: #3cd598;
    --yellow-text-color: #f4c542;
    --blue-text-color: #9ec3ff;

    /* State colours */
    --closed-answer-color: linear-gradient(
            180deg,
            #0d3b78,
            #083063
    );
    --error-color: #ff5c5c;
    --miss-color: rgba(255, 92, 92, 0.35);
    --success-color: #3cd598;
    --revealed-answer-color: rgba(42, 86, 38, 0.9);;
    --missed-answer-color: rgba(141, 126, 126, 0.9);
    --duel-player-1: #ff5a5a;
    --duel-player-2: #4d8dff;

    /* Inputs */
    --caret-color: #f4c542;
    --input-text-color: #0b1a33;
    --background-input-color: rgba(9, 33, 72, 0.7);
    --background-border-color: rgba(120, 155, 210, 0.25);
    --hint-color: #27d07d;
    --merge-hint-color: rgba(49,130,206,0.12);
    scrollbar-color: #f0a300 var(--button-background-color);
    color: var(--normal-text-color);
}
.color-theme-a * {
    --background-color: #1F1F23;
    --opposite-background-color: #f1f3f6;
    --additional-background-color: #252527;
    --button-background-color: #38383D;
    --theme-start-color: #5865F2;
    --theme-end-color: #85338C;
    --theme-middle-color: #7A40A6;
    --theme-color: linear-gradient(var(--theme-start-color), var(--theme-end-color));
    --diamond-theme-color: linear-gradient(135deg, var(--theme-start-color), var(--theme-end-color));
    --dot-color: #7b5cc9;
    --button-hover-color: #6b00b6;
    --normal-text-color: #BFBFBF;
    --bright-normal-text-color: #E6E6E6;
    --green-text-color: #1ABC9C;
    --yellow-text-color: #F0B232;
    --blue-text-color: #5865F2;
    --opposite-text-color: #1F1F23;
    --temporary-contrast-background: #252527;
    --border-color: #ccc;
    --closed-answer-color: linear-gradient(270deg, var(--theme-start-color), var(--theme-end-color));
    --error-color: #95003a;
    --success-color: #1ABC9C;
    --revealed-answer-color: #4b6400;
    --missed-answer-color: rgba(141, 126, 126, 0.9);
    --duel-player-1: #ff5a5a;
    --duel-player-2: #4d8dff;
    --caret-color: black;
    --input-text-color: black;
    --hint-color: #28a745;
    --merge-hint-color: rgba(49,130,206,0.12);
    scrollbar-color: #85338C var(--button-background-color);
}
* {
    font-family: 'Rubik', sans-serif;
}
#body-wrapper {
    background:
            radial-gradient(900px 420px at 15% -10%, rgba(28, 88, 166, 0.35), transparent 65%),
            radial-gradient(800px 520px at 90% 120%, rgba(5, 24, 58, 0.7), transparent 70%),
            linear-gradient(180deg, rgba(6, 35, 81, 0.95), rgba(7, 44, 97, 0.95));
    font-family: 'Rubik', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    caret-color: transparent;
    align-items: stretch;
}
h1, h2, h3 {
    color: var(--normal-text-color)
}
input {
    caret-color: var(--caret-color);
    color: var(--input-text-color);
    border-radius: 20px;
    height: 30px;
}
label {
    color: var(--normal-text-color);
}
a {
    cursor: pointer;
}
::placeholder {
    text-align: center;
}
hr {
    width: 100%;
}
.normal-title {
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--bright-normal-text-color);
    text-transform: uppercase;
}
.normal-button-style {
    height: 48px;
    padding: 0 20px;
    border: 1px solid var(--button-border-color);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(15, 62, 122, 0.95), rgba(9, 45, 95, 0.95));
    color: var(--bright-normal-text-color);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(2, 16, 39, 0.35);
}
a.normal-button-style {
    text-decoration: none;
}
#fake-margin-header {
    height: 56px;
    max-height: 6%;
    flex-shrink: 0;
}
.header-line {
    position: relative;
    width: 100%;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 32px;
    z-index: 200;
    flex-shrink: 0;
}
.clean-header-line {
    position: relative;
    align-items: center;
    justify-content: center;
    z-index: 200;
    display: none;
}
.clean-header .header-line {
    display: none;
}
.clean-header .clean-header-line {
    display: flex;
}
.logo {
    position: relative;
    height: 56px;
    width: 120px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #1f61b7 0%, #0b2f62 70%);
    border: 3px solid var(--theme-start-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-start-color);
    font-family: 'Marko One', serif;
    font-size: 22px;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.logo::before {
    content: "100 к 1";
}
.clean-header-line .logo {
    width: 140px;
    height: 64px;
    font-size: 24px;
}
.settings-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-button-container {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-right: 0;
    margin-left: auto;
}
.settings-button-container .normal-button-style {
    width: auto;
    height: auto;
    padding: 6px 10px;
    border: none;
    background: transparent;
    box-shadow: none;
}
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--normal-text-color);
    cursor: pointer;
}
.mobile-menu-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--normal-text-color);
    border-radius: 2px;
}
.mobile-menu-icon::before,
.mobile-menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background-color: var(--normal-text-color);
    border-radius: 2px;
}
.mobile-menu-icon::before {
    top: -7px;
}
.mobile-menu-icon::after {
    top: 7px;
}
.mobile-menu-overlay {
    display: none;
}
.mobile-menu-close {
    display: none;
}
.dropdown-settings-button {
    position: relative;
    display: inline-block;
}
.normal-button-style.profile {
    min-width: 160px;
    width: fit-content;
    padding-right: 52px;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.04em;
}
.circle-before::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--theme-color);
    transform: translateY(-50%);
}
.dropdown-menu {
    display: none;
    position: absolute;
    background-color: rgba(6, 28, 64, 0.98);
    border-radius: 12px;
    width: 220px;
    box-shadow: 0 18px 36px rgba(2, 10, 26, 0.35);
    z-index: 1;
    list-style: none;
    padding: 8px;
    transition: opacity 0.3s ease;
    opacity: 0;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(6px);
    top: calc(100% + 8px);
    right: 0;
}
.dropdown-menu li a {
    color: var(--bright-normal-text-color);
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.normal-button-style[aria-expanded="true"] + .dropdown-menu {
    display: flex;
    flex-direction: column;
    opacity: 1;
}
.dropdown-settings-button:has(.normal-button-style[aria-expanded="true"]) {
    background-color: rgba(6, 28, 64, 0.6);
    border-radius: 10px;
}
.dropdown-menu .normal-button-style {
    padding: 0 10px;
    font-size: 12px;
    display: flex;
    height: 36px;
    width: 100%;
    margin: 2px 0;
    align-self: center;
    text-transform: none;
    letter-spacing: 0.02em;
    background: rgba(10, 52, 104, 0.7);
    border: 1px solid transparent;
    box-shadow: none;
}
#user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}
#user-dropdown .normal-button-style.profile {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    padding: 6px 12px;
}
.user-logo {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background-color: #0a2b58;
}
.authorized #user-image-container .edit-icon {
    cursor: pointer;
}
.authorized #user-image-container .user-logo:hover + .edit-icon,
.authorized #user-image-container .edit-icon:hover {
    opacity: 1;
}
#user-image-container {
    position: relative;
    z-index: 50;
    margin-left: 8px;
    display: flex;
    align-items: center;
}
#user-image-container .edit-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    opacity: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--theme-start-color);
    color: #0b1a33;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}
#super-main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    padding: 24px 24px 32px;
}
.main-content {
    position: relative;
    display: flex;
    flex-direction: column;
}
.button-group .normal-button-style {
    width: 260px;
    height: 52px;
    margin: auto;
    font-size: 18px;
    font-family: "Rubik", sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0;
}
.button-group {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    margin: 24px auto 8px;
    width: fit-content;
 }
.footer-line {
    width: 100%;
    height: 72px;
    background-color: var(--footer-background-color);
    border-radius: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0 32px;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
}
.footer-button {
    display: flex;
    color: var(--normal-text-color);
    cursor: pointer;
    width: auto;
    height: auto;
    padding: 0;
    text-decoration: none;
    background: transparent;
    border: 0;
    font: inherit;
    position: relative;
    margin: 0;
    align-items: center;
}
.support {
    color: var(--theme-start-color);
    text-transform: uppercase;
}
.footer-button::before,
.footer-button::after {
    display: none;
}
.circle {
    width: 10px;
    height: 10px;
    background: #7b3ff0;
    border-radius: 50%;
    margin-bottom: 5px;
}
#reset-password-button {
    align-self: flex-start;
    margin: 4px 0 12px;
    text-align: left;
    text-decoration: none;
    font-size: 12px;
    transform: translateY(-25px);
}
#reset-password-button:hover {
    color: var(--bright-normal-text-color);
    text-decoration: underline;
}
#shadow-overlay {
    display: none;
    position: absolute;
    height: 100%;
    width: 100%;
    background-color: #0000008a;
}

@media (hover: hover) {
    .normal-button-style:hover:not(:disabled) {
        background: var(--button-hover-color);
        box-shadow: 0 10px 24px rgba(3, 16, 38, 0.4);
    }
    .header-line .normal-button-style:hover:not(:disabled) {
        background-color: rgba(255, 255, 255, 0.08);
    }
    .footer-button:hover {
        color: var(--theme-start-color);
    }
    .support:hover {
        text-decoration: underline;
        color: var(--normal-text-color);
    }
}

@media (hover: none) {
    .normal-button-style:active:not(:disabled) {
        background-color: var(--button-hover-color);
    }
    .footer-button:active {
        color: var(--theme-start-color);
    }
}

@media (max-height: 800px) {
    #reset-password-button {
        transform: none;
    }
}

@media (max-width: 480px) {
    .logo {
        height: 46px;
        width: 96px;
        font-size: 18px;
    }
    .header-line {
        height: 64px;
        padding: 12px 16px;
        gap: 12px;
    }
    .mobile-menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }
    .mobile-menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 190;
    }
    #body-wrapper.mobile-menu-open .mobile-menu-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    #body-wrapper.mobile-menu-open {
        overflow: hidden;
    }
    .settings-button-container {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(320px, 86vw);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 72px 20px 24px;
        gap: 14px;
        background-color: var(--header-background-color);
        border-left: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: -12px 0 24px rgba(2, 16, 39, 0.35);
        transform: translateX(110%);
        transition: transform 0.25s ease;
        z-index: 220;
    }
    #body-wrapper.mobile-menu-open .settings-button-container {
        transform: translateX(0);
    }
    .mobile-menu-close {
        display: inline-flex;
        position: absolute;
        top: 18px;
        right: 18px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.08);
        color: var(--normal-text-color);
        align-items: center;
        justify-content: center;
    }
    .settings-button-container .normal-button-style {
        width: 100%;
        height: 46px;
        padding: 0 16px;
        border: 1px solid rgba(121, 165, 226, 0.5);
        background: rgba(10, 46, 96, 0.9);
        box-shadow: none;
    }
    #user-dropdown {
        width: 100%;
        order: -1;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "avatar button"
            "menu menu";
        align-items: center;
        gap: 10px;
    }
    #user-dropdown .normal-button-style.profile {
        grid-area: button;
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        padding-right: 12px;
    }
    #user-image-container {
        grid-area: avatar;
    }
    #user-dropdown .dropdown-menu {
        grid-area: menu;
    }
    #user-image-container {
        margin-left: 0;
    }
    .dropdown-settings-button {
        width: 100%;
    }
    .dropdown-menu {
        position: static;
        width: 100%;
        right: auto;
        top: auto;
        box-shadow: none;
        border: none;
        background-color: transparent;
        padding: 4px 0;
    }
    .dropdown-menu .normal-button-style {
        height: 40px;
        background: rgba(10, 52, 104, 0.65);
        border: 1px solid transparent;
    }
    .normal-button-style {
        font-size: 14px;
        padding: 8px 14px;
    }
    .main-content {
        padding: 20px;
        width: min(92vw, 960px);
    }
    .button-group {
        width: min(320px, 90vw);
        margin-top: 40px;
    }
    .button-group .normal-button-style {
        width: 100%;
        height: 50px;
    }
    .footer-line {
        padding: 6px 16px;
        height: auto;
        flex-wrap: wrap;
        gap: 12px;
    }
    .footer-button {
        font-size: 10px;
        letter-spacing: 0.08em;
    }
    .container {
        top: 0;
    }
}
