﻿:root {
    --ht-text-main: #f2f5ff;
    --ht-text-muted: #b6c1dc;
    --ht-gold: #ffecb3;
    --ht-blue: #30479b;
    --ht-blue-dark: #141b36;
    --ht-menu-glow: rgba(120, 220, 232, 0.4);
    --ht-menu-default-card-image: url("/images/menu/face_flowers.png");
    --ht-screen-max-width: 540px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    color: var(--ht-text-main);
    font-family: "Century Gothic", "Trebuchet MS", "Segoe UI", sans-serif;
}

.ht-body {
    background: #050a0f;
}

.ht-shell {
    position: relative;
    width: 100%;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    padding: 14px 12px;
    overflow: hidden;
}

.ht-screen {
    position: relative;
    z-index: 2;
    width: min(100%, var(--ht-screen-max-width));
}

.ht-heading {
    margin: 0;
    font-size: clamp(1.7rem, 6vw, 2.4rem);
    line-height: 1.12;
}

.ht-home-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(179, 197, 240, 0.44);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    color: #f7faff;
    background: rgba(17, 24, 42, 0.72);
    backdrop-filter: blur(6px);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ht-home-btn--icon {
    top: 8px;
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    padding: 0;
    border-radius: 14px;
    background: linear-gradient(145deg, #355ad1 0%, #2944a5 100%);
    border-color: rgba(148, 171, 255, 0.55);
    box-shadow: 0 16px 30px rgba(7, 21, 68, 0.46);
    backdrop-filter: none;
}

.ht-home-btn:hover,
.ht-home-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(5, 10, 24, 0.42);
}

.ht-home-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ht-empty {
    margin: auto;
    width: min(100%, 580px);
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(162, 180, 222, 0.32);
    background: rgba(19, 28, 46, 0.7);
}

.ht-empty h2 {
    margin: 0 0 8px;
}

.ht-empty p {
    margin: 0;
    line-height: 1.5;
    color: #d7e1fd;
}

.ht-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 54px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ht-button:hover,
.ht-button:focus-visible {
    transform: translateY(-1px);
}

.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.ht-shell--menu {
    align-items: center;
    padding: 24px 16px;
    background: radial-gradient(ellipse at center, #1a3b4a 0%, #0a1a20 70%, #050a0f 100%);
}

.ht-screen--menu {
    width: min(100%, 700px);
    text-align: center;
    opacity: 0;
    animation: ht-fade-in 0.75s ease-out forwards;
}

.ht-menu-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.ht-menu-particle {
    position: absolute;
    bottom: -40px;
    border-radius: 50%;
    background: rgba(180, 230, 240, 0.66);
    animation-name: ht-menu-float;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
}

.ht-menu-fade {
    position: absolute;
    inset: 0;
    z-index: 10;
    opacity: 0;
    background: #000;
    pointer-events: none;
    transition: opacity 0.55s ease;
}

.ht-menu-fade.is-active {
    opacity: 1;
    pointer-events: auto;
}

.ht-headline {
    margin: 0 auto;
    max-width: 520px;
    padding: 0 10px;
}

.ht-overline {
    margin: 0;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: rgba(168, 229, 238, 0.88);
}

.ht-shell--menu .ht-heading {
    margin-top: 14px;
    font-size: clamp(2rem, 6.4vw, 2.8rem);
    color: #f3fbff;
    text-shadow: 0 0 14px rgba(120, 220, 232, 0.7);
}

.ht-subheading {
    margin: 14px auto 0;
    max-width: 480px;
    color: rgba(212, 232, 237, 0.86);
    line-height: 1.45;
}

.ht-test-grid {
    margin: 26px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    max-width: 230px;
    padding-bottom: 14px;
}

.ht-test-card {
    --menu-fallback-image: var(--ht-menu-default-card-image);
    --card-in-delay: 0s;
    position: relative;
    width: min(88vw, 195px);
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 16px;
    border: 1px solid rgba(140, 214, 226, 0.34);
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    background: rgba(10, 30, 40, 0.72);
    box-shadow:
        0 0 10px rgba(120, 220, 232, 0.28),
        0 0 26px rgba(120, 220, 232, 0.12);
    transform: scale(1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    opacity: 0;
    animation: ht-menu-card-in 0.45s ease forwards, ht-edge-glow 4s ease-in-out infinite;
    animation-delay: var(--card-in-delay), calc(var(--card-in-delay) + 0.55s);
}

.ht-test-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--card-bg-image, var(--menu-fallback-image));
    background-size: cover;
    background-position: center;
    filter: saturate(1.06);
}

.ht-test-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 76%;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.84) 100%);
}

.ht-test-card:nth-child(1) {
    --card-in-delay: 0.18s;
}

.ht-test-card:nth-child(2) {
    --card-in-delay: 0.32s;
}

.ht-test-card:nth-child(3) {
    --card-in-delay: 0.46s;
}

.ht-test-card__title {
    position: relative;
    z-index: 3;
    padding: 0 12px;
    font-size: 0.94rem;
    line-height: 1.25;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.62);
}

.ht-test-card__meta {
    position: relative;
    z-index: 3;
    margin-top: 5px;
    padding: 0 12px 12px;
    font-size: 0.74rem;
    color: rgba(231, 243, 247, 0.84);
}

.ht-test-card:hover,
.ht-test-card:focus-visible {
    transform: scale(1.04);
    border-color: rgba(170, 236, 246, 0.62);
    box-shadow:
        0 0 16px rgba(120, 220, 232, 0.46),
        0 0 34px rgba(120, 220, 232, 0.24);
}

.ht-shell--take {
    --ht-screen-max-width: 520px;
    --slider-fill-color: var(--test-accent, #4bc40d);
    align-items: flex-start;
    background: radial-gradient(circle at center, rgb(76, 73, 119) 0%, rgb(20, 20, 31) 70%, rgb(10, 10, 15) 100%);
}

.ht-shell--take::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(5, 8, 21, 0.6) 0%, rgba(10, 12, 26, 0.78) 65%, rgba(6, 7, 15, 0.92) 100%),
        var(--test-bg-image, none);
    background-size: cover;
    background-position: center;
    opacity: 0.55;
}

.ht-shell--take::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 90% 6%, rgba(70, 92, 210, 0.26), transparent 34%),
        radial-gradient(circle at 8% 90%, rgba(30, 120, 220, 0.24), transparent 30%);
}

.ht-shell--take .ht-screen--take {
    min-height: calc(100dvh - 28px);
    padding: 8px 2px 20px;
    display: flex;
    flex-direction: column;
}

.ht-welcome {
    min-height: calc(100dvh - 48px);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: clamp(88px, 16vh, 156px) 6px 8px;
    animation: ht-fade-up 0.35s ease both;
}

.ht-heading--welcome {
    text-align: center;
    font-size: clamp(2rem, 8.8vw, 3.2rem);
    line-height: 1.1;
    font-weight: 700;
    color: var(--ht-gold);
    text-wrap: balance;
}

.ht-intro-card {
    margin-top: clamp(28px, 7vh, 80px);
    padding: 34px 20px 20px;
    border-radius: 18px;
    border: 1px solid rgba(190, 201, 246, 0.2);
    background: linear-gradient(155deg, rgba(68, 77, 122, 0.35), rgba(41, 51, 87, 0.45));
    backdrop-filter: blur(6px);
}

.ht-intro-description {
    margin: 0;
    text-align: center;
    font-size: clamp(1rem, 4.2vw, 1.24rem);
    line-height: 1.58;
    color: rgba(242, 246, 255, 0.95);
}

.ht-intro-meta {
    margin: 22px 0 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--ht-gold);
    font-size: clamp(0.98rem, 3.7vw, 1.15rem);
    font-weight: 700;
}

.ht-screen-footer {
    position: relative;
    margin-top: auto;
    min-height: 106px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.ht-version-tag {
    position: absolute;
    right: 2px;
    bottom: 9px;
    font-size: 0.82rem;
    color: rgba(171, 181, 210, 0.64);
    letter-spacing: 0.02em;
}

.ht-play-btn {
    width: 68px;
    height: 68px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    background: var(--ht-blue);
    transform: translateY(-4px);
    box-shadow:
        0 4px 0 var(--ht-blue-dark),
        0 16px 30px rgba(13, 19, 42, 0.52);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.16s ease;
}

.ht-play-btn:hover,
.ht-play-btn:focus-visible {
    background: #243162;
}

.ht-play-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 0 var(--ht-blue-dark);
}

.ht-play-btn:focus-visible {
    outline: 2px solid rgba(227, 234, 255, 0.85);
    outline-offset: 2px;
}

.ht-play-btn--next {
    margin: 10px auto 0;
}

.ht-play-icon {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid #fff;
    margin-left: 3px;
}

.ht-quiz {
    min-height: calc(100dvh - 48px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 2px;
    animation: ht-fade-up 0.25s ease both;
}

.ht-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ht-progress__track {
    width: 100%;
    height: 4px;
    border-radius: 0;
    background: rgba(203, 214, 245, 0.16);
    overflow: hidden;
}

.ht-progress__fill {
    width: 0;
    min-width: 6px;
    height: 100%;
    background: linear-gradient(90deg, var(--ht-gold) 0%, var(--ht-gold) 100%);
    box-shadow: 0 0 14px rgba(255, 236, 179, 0.42);
    animation: ht-progress-glow 2.2s ease-in-out infinite;
    transition: width 0.25s ease;
}

.ht-progress__counter {
    margin: 0;
    font-size: clamp(1.95rem, 8.4vw, 2.45rem);
    line-height: 1;
    color: var(--ht-gold);
    font-weight: 500;
}

.ht-question-stack {
    display: flex;
    flex: 1;
    min-height: 0;
}

.ht-question-panel {
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    padding-top: clamp(18px, 8vh, 70px);
}

.ht-question-panel.is-active {
    display: flex;
    animation: ht-slide-in 0.24s ease both;
}

.ht-question-text {
    margin: 0;
    text-align: center;
    text-wrap: balance;
    font-size: clamp(1.75rem, 8.2vw, 3.1rem);
    line-height: 1.28;
    font-weight: 700;
    color: #f0f4ff;
}

.ht-slider-block {
    margin-top: auto;
}

.ht-slider-labels {
    margin: 0 0 5px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font-size: 0.88rem;
    color: rgba(216, 224, 244, 0.92);
}

.ht-slider-input {
    width: 100%;
    height: 32px;
    border-radius: 5px;
    border: 0;
    appearance: none;
    background: #1d1d1d;
    outline: none;
}

.ht-slider-input::-webkit-slider-runnable-track {
    height: 32px;
    border-radius: 5px;
    background: transparent;
}

.ht-slider-input::-webkit-slider-thumb {
    appearance: none;
    width: 8px;
    height: 32px;
    margin-top: 0;
    border-radius: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.56);
}

.ht-slider-input::-moz-range-track {
    height: 32px;
    border-radius: 5px;
    background: transparent;
}

.ht-slider-input::-moz-range-thumb {
    width: 8px;
    height: 32px;
    border-radius: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.56);
}

.ht-slider-number {
    margin: 12px 0 0;
    text-align: center;
    font-size: clamp(2.2rem, 10vw, 3.2rem);
    font-weight: 700;
    color: #f3eee0;
}

.ht-form-error {
    margin: 0;
    text-align: center;
    color: #ffb8c4;
    line-height: 1.45;
}

.ht-shell--result {
    --ht-screen-max-width: 960px;
    align-items: flex-start;
    background: radial-gradient(circle at center, rgb(76, 73, 119) 0%, rgb(20, 20, 31) 70%, rgb(10, 10, 15) 100%);
}

.ht-shell--result::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 86% 16%, rgba(83, 111, 219, 0.22), transparent 34%),
        radial-gradient(circle at 12% 88%, rgba(25, 123, 212, 0.18), transparent 30%);
}

.ht-shell--result .ht-screen--result {
    min-height: calc(100dvh - 28px);
    padding: clamp(70px, 12vh, 90px) 4px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ht-result-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(176, 189, 235, 0.18);
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
}

.ht-result-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    border: 1px solid rgba(185, 200, 242, 0.24);
    background-size: cover;
    background-position: center;
}

.ht-score-pill {
    margin: 2px 0 0;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    color: #f2f6ff;
    font-size: 0.85rem;
    border: 1px solid rgba(178, 193, 235, 0.25);
    background: rgba(54, 69, 122, 0.58);
}

.ht-heading--result {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    color: var(--ht-gold);
}

.ht-result-description {
    margin: 0;
    line-height: 1.52;
    color: #e9edfb;
    white-space: pre-line;
}

.ht-result-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.ht-result-actions__row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ht-legacy-link {
    min-height: 66px;
    border-radius: 12px;
    padding: 10px 12px;
    color: #f2f7ff;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.24);
    transition: transform 0.14s ease, filter 0.14s ease;
}

.ht-legacy-link:hover,
.ht-legacy-link:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.ht-legacy-link:active {
    transform: translateY(1px);
}

.ht-legacy-link--green {
    background: linear-gradient(145deg, #2adf74 0%, #16b85b 100%);
}

.ht-legacy-link--blue {
    background: linear-gradient(145deg, #4361d5 0%, #2d45af 100%);
}

.ht-legacy-link__icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 999px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: rgba(12, 18, 44, 0.28);
}

.ht-legacy-link__icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ht-legacy-link__text {
    font-size: 0.88rem;
    line-height: 1.2;
    font-weight: 700;
}

.ht-legacy-repeat {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #f2f5ff;
    background: linear-gradient(145deg, #4361d5 0%, #2d45af 100%);
    border: 1px solid rgba(138, 164, 255, 0.5);
    box-shadow: 0 4px 0 rgba(12, 20, 56, 0.9);
    transition: transform 0.14s ease, filter 0.14s ease;
}

.ht-legacy-repeat:hover,
.ht-legacy-repeat:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.ht-legacy-repeat:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(12, 20, 56, 0.9);
}

.ht-legacy-repeat__icon {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes ht-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ht-menu-card-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ht-menu-float {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(var(--particle-drift, 0px), -115vh, 0);
    }
}

@keyframes ht-edge-glow {
    0% {
        box-shadow:
            0 0 9px rgba(120, 220, 232, 0.24),
            0 0 22px rgba(120, 220, 232, 0.08);
    }
    50% {
        box-shadow:
            0 0 14px rgba(120, 220, 232, 0.44),
            0 0 30px rgba(120, 220, 232, 0.2);
    }
    100% {
        box-shadow:
            0 0 9px rgba(120, 220, 232, 0.24),
            0 0 22px rgba(120, 220, 232, 0.08);
    }
}

@keyframes ht-progress-glow {
    0% {
        box-shadow: 0 0 10px rgba(255, 236, 179, 0.25);
    }
    50% {
        box-shadow: 0 0 16px rgba(255, 236, 179, 0.5);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 236, 179, 0.25);
    }
}

@keyframes ht-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ht-slide-in {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (min-width: 680px) {
    .ht-shell {
        padding: 18px;
    }

    .ht-home-btn {
        right: max(18px, calc(50vw - (var(--ht-screen-max-width) / 2) + 16px));
    }

    .ht-shell--menu .ht-test-grid {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 640px;
        gap: 24px;
    }

    .ht-shell--menu .ht-test-card {
        width: 188px;
    }

    .ht-home-btn--icon {
        top: 20px;
        right: max(20px, calc(50vw - (var(--ht-screen-max-width) / 2) + 20px));
    }

    .ht-shell--take .ht-screen--take,
    .ht-shell--result .ht-screen--result {
        min-height: calc(100dvh - 36px);
    }
}

@media (max-width: 479px) {
    .ht-shell {
        padding: 12px 10px;
    }

    .ht-shell--menu .ht-heading {
        font-size: 1.9rem;
    }

    .ht-subheading {
        font-size: 0.93rem;
    }

    .ht-slider-labels {
        font-size: 0.8rem;
    }

    .ht-home-btn--icon {
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
    }

}

@media (max-height: 700px) {
    .ht-welcome {
        padding-top: 78px;
    }

    .ht-intro-card {
        margin-top: 20px;
        padding-top: 24px;
    }

    .ht-question-panel {
        padding-top: 10px;
    }
}
