/* ===== CSS VARIABLES ===== */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-secondary: #6b7280;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent: #ec4899;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 10px 30px rgba(0, 0, 0, 0.04);
    --transition: 0.2s ease-in-out;
    --font-main: 'Inter', sans-serif;
    --radius: 16px;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] {
    --bg-color: #0a0a0f;
    --text-color: #f0f0f5;
    --text-secondary: #9ca3af;
    --card-bg: #141420;
    --border-color: #2a2a3a;
    --primary: #a78bfa;
    --primary-hover: #c4b5fd;
    --accent: #f472b6;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(20, 20, 32, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== BODY ===== */
body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Animated background for dark mode */
[data-theme="dark"] body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    animation: bg-drift 20s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes bg-drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-3%, -3%) rotate(2deg);
    }
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    color: var(--text-color);
    text-align: center;
    line-height: 1.2;
}

.rainbow-gradient {
    background: linear-gradient(135deg, #ff0000, #ff8800, #ffff00, #00cc00, #0066ff, #8b00ff);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-shift 4s ease-in-out infinite;
}

@keyframes rainbow-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.emoji-header {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1rem;
    animation: float-emoji 3s ease-in-out infinite;
}

@keyframes float-emoji {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    text-align: center;
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1.5rem;
    opacity: 0.6;
}

/* ===== BUTTONS ===== */
.primary-btn,
.action-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    width: 100%;
    letter-spacing: -0.01em;
    font-family: var(--font-main);
}

.primary-btn {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.primary-btn:hover::before {
    left: 100%;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.primary-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-sparkle {
    display: inline-block;
    animation: sparkle-rotate 2s linear infinite;
}

@keyframes sparkle-rotate {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

.secondary-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    margin-top: 0.75rem;
}

.secondary-btn:hover {
    color: var(--text-color);
    border-color: var(--text-secondary);
    background: var(--card-bg);
    transform: translateY(-1px);
}

.telegram-btn {
    background: linear-gradient(135deg, #0088cc, #00aaee);
    color: white;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.telegram-btn:hover {
    background: linear-gradient(135deg, #006699, #0088cc);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
}

.theme-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-btn:hover {
    color: var(--text-color);
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.hidden {
    display: none !important;
}

/* ===== HEADER BAR ===== */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
}

.question-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #ec4899, #f97316);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    animation: progress-shimmer 3s ease-in-out infinite;
}

@keyframes progress-shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ===== QUESTION ===== */
.question-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-color);
    line-height: 1.35;
}

/* ===== ANSWERS GRID ===== */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.answer-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    padding: 18px 22px;
    border-radius: var(--radius);
    text-align: left;
    font-size: 0.95rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 500;
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
}

.answer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #8b5cf6, #ec4899);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.answer-btn:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1);
}

.answer-btn:hover::before {
    opacity: 1;
}

.answer-btn:active {
    transform: translateX(4px) scale(0.98);
}

/* ===== RESULTS ===== */
.result-circle-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.circular-chart {
    display: block;
    max-width: 150px;
    max-height: 150px;
}

.circle-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.percentage {
    fill: var(--text-color);
    font-family: var(--font-main);
    font-weight: 800;
    font-size: 0.55em;
    text-anchor: middle;
}

.result-header {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
}

.result-emoji {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 12px;
    animation: float-emoji 3s ease-in-out infinite;
}

.result-title {
    font-size: 1.8rem;
    margin-bottom: 12px;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.02em;
}

.result-desc {
    margin-bottom: 32px;
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ===== STAGGER ANIMATION ===== */
.result-content>* {
    opacity: 0;
    transform: translateY(20px);
}

.result-content.show>* {
    animation: slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.result-content.show>*:nth-child(1) {
    animation-delay: 0.05s;
}

.result-content.show>*:nth-child(2) {
    animation-delay: 0.15s;
}

.result-content.show>*:nth-child(3) {
    animation-delay: 0.25s;
}

.result-content.show>*:nth-child(4) {
    animation-delay: 0.35s;
}

.result-content.show>*:nth-child(5) {
    animation-delay: 0.45s;
}

.result-content.show>*:nth-child(6) {
    animation-delay: 0.55s;
}

.result-content.show>*:nth-child(7) {
    animation-delay: 0.65s;
}

@keyframes slide-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SCREENS ===== */
.screen {
    opacity: 1;
    transition: opacity 0.4s ease;
}

.screen.hidden {
    display: none;
    opacity: 0;
}

/* ===== FADE IN ===== */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fade-in 0.35s ease forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    h1 {
        font-size: 1.7rem;
    }

    .container {
        max-width: 100%;
    }

    .emoji-header {
        font-size: 3rem;
    }

    .question-title {
        font-size: 1.25rem;
    }

    .answer-btn {
        padding: 15px 18px;
        font-size: 0.9rem;
    }

    .result-title {
        font-size: 1.5rem;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-color);
}