/**
 * Кастомные стили для Tailwind CSS
 * Сбалансированный дизайн: минимализм + красивые анимации
 * Улучшенная читаемость и полная адаптивность
 */

/* ==========================================================================
   КАСТОМНЫЕ ШРИФТЫ
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Merriweather:wght@400;700&display=swap');

/* ==========================================================================
   БАЗОВЫЕ НАСТРОЙКИ
   ========================================================================== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: #1f2937;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Паттерн на фоне */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Увеличенный размер шрифта для мобильных */
@media (max-width: 640px) {
    html {
        font-size: 15px;
    }
    
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
    }
    
    p, li, span, a, button {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
}

/* ==========================================================================
   ТИПОГРАФИКА
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin-bottom: 0.75em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1em;
    color: #374151;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #1d4ed8;
    text-decoration: none;
}

/* ==========================================================================
   АНИМАЦИИ - СБАЛАНСИРОВАННЫЕ
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(37, 99, 235, 0.5), 0 0 40px rgba(37, 99, 235, 0.2);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Классы анимаций */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Задержка анимаций */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ==========================================================================
   КАРТОЧКИ - С БАЛАНСОМ СТИЛЯ
   ========================================================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .glass-card {
        padding: 1rem;
        border-radius: 12px;
    }
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Градиентные карточки */
.gradient-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,250,252,0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gradient-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.gradient-card:hover::before {
    left: 100%;
}

.gradient-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   КНОПКИ - С ЭФФЕКТАМИ
   ========================================================================== */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Градиентные кнопки */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-gradient::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.5s;
}

.btn-gradient:hover::after {
    left: 100%;
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Адаптивные кнопки для мобильных */
@media (max-width: 640px) {
    button, .btn, a.btn {
        min-height: 48px;
        padding: 0.875rem 1.25rem;
    }
}

/* ==========================================================================
   ФОРМЫ - С АНИМАЦИЕЙ
   ========================================================================== */
input, textarea, select {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.3s ease;
    width: 100%;
    background: white;
    color: #1f2937;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

input:hover, textarea:hover, select:hover {
    border-color: #d1d5db;
}

input::placeholder, textarea::placeholder {
    color: #9ca3af;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
    transition: color 0.3s ease;
}

/* ==========================================================================
   НАВИГАЦИЯ - С ЭФФЕКТАМИ
   ========================================================================== */
.navbar {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(55, 65, 81, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.875rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9375rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Мобильная навигация */
@media (max-width: 768px) {
    .nav-menu {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.625rem;
        font-size: 0.875rem;
    }
    
    .nav-balance {
        display: none;
    }
}

/* ==========================================================================
   УВЕДОМЛЕНИЯ - С АНИМАЦИЕЙ
   ========================================================================== */
.messages-container {
    max-width: 1280px;
    margin: 0.75rem auto;
    padding: 0 1rem;
}

.message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    border-left: 4px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.4s ease-out;
    backdrop-filter: blur(10px);
}

.message-success {
    background: rgba(240, 253, 244, 0.95);
    color: #166534;
    border-color: #16a34a;
}

.message-error {
    background: rgba(254, 242, 242, 0.95);
    color: #991b1b;
    border-color: #dc2626;
}

.message-warning {
    background: rgba(255, 251, 235, 0.95);
    color: #92400e;
    border-color: #d97706;
}

.message-info {
    background: rgba(239, 246, 255, 0.95);
    color: #1e40af;
    border-color: #2563eb;
}

/* ==========================================================================
   ПРОГРЕСС БАРЫ - С АНИМАЦИЕЙ
   ========================================================================== */
.progress-bar {
    height: 10px;
    background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* ==========================================================================
   МОДАЛЬНЫЕ ОКНА - С ЭФФЕКТАМИ
   ========================================================================== */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content-custom {
    max-width: 28rem;
    width: 100%;
    margin: 1rem;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 640px) {
    .modal-content-custom {
        margin: 0.5rem;
        padding: 1.25rem !important;
    }
}

/* ==========================================================================
   GRID LAYOUTS - АДАПТИВНЫЕ
   ========================================================================== */
.grid-responsive {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Адаптивные сетки */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-responsive {
        gap: 1rem;
    }
}

/* ==========================================================================
   КАРТОЧКИ СТАТИСТИКИ - С ГРАДИЕНТАМИ
   ========================================================================== */
.stat-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-card-icon {
    transform: scale(1.1) rotate(5deg);
}

@media (max-width: 640px) {
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   GAME CARDS - С ЭФФЕКТАМИ
   ========================================================================== */
.game-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(249,250,251,0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(37, 99, 235, 0.3);
}

@media (max-width: 640px) {
    .game-card {
        padding: 1rem;
    }
}

/* ==========================================================================
   QUIZ STYLES - С АНИМАЦИЕЙ
   ========================================================================== */
.quiz-option {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quiz-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s;
}

.quiz-option:hover::before {
    left: 100%;
}

.quiz-option:hover {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateX(4px);
}

.quiz-option.selected {
    border-color: #2563eb;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.quiz-option.correct {
    border-color: #16a34a;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    animation: pulse 0.5s ease;
}

.quiz-option.wrong {
    border-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    animation: pulse 0.5s ease;
}

@media (max-width: 640px) {
    .quiz-option {
        padding: 0.875rem 1rem;
    }
}

/* ==========================================================================
   INVESTMENT CARDS - С ГРАДИЕНТАМИ
   ========================================================================== */
.invest-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(249,250,251,0.9) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.invest-card:hover {
    border-color: #2563eb;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.2);
    transform: translateY(-4px);
}

.invest-card.deposit {
    border-left: 4px solid #16a34a;
}

.invest-card.deposit:hover {
    border-left-color: #16a34a;
    border-right-color: #2563eb;
}

.invest-card.stocks {
    border-left: 4px solid #dc2626;
}

.invest-card.stocks:hover {
    border-left-color: #dc2626;
    border-right-color: #2563eb;
}

/* ==========================================================================
   EXPENSE CARDS - С АНИМАЦИЕЙ
   ========================================================================== */
.expense-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(249,250,251,0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.expense-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.expense-card:hover::before {
    transform: scaleX(1);
}

.expense-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
    transform: translateY(-4px);
}

@media (max-width: 640px) {
    .expense-card {
        padding: 0.875rem;
    }
}

/* ==========================================================================
   LEVEL BADGES - С ГРАДИЕНТАМИ
   ========================================================================== */
.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    transition: transform 0.3s ease;
}

.level-badge:hover {
    transform: scale(1.1) rotate(5deg);
}

.level-badge-1 { 
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.level-badge-2 { 
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.level-badge-3 { 
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.level-badge-4 { 
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ==========================================================================
   FOOTER - СТИЛЬНЫЙ
   ========================================================================== */
.footer {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(55, 65, 81, 0.95) 100%);
    backdrop-filter: blur(20px);
    color: #9ca3af;
    padding: 2rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .footer {
        padding: 1.5rem 1rem;
        text-align: center;
    }
}

/* ==========================================================================
   SCROLLBAR - КРАСИВЫЙ
   ========================================================================== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid #f3f4f6;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ==========================================================================
   ДОСТУПНОСТЬ
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Фокус для клавиатуры */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==========================================================================
   ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ
   ========================================================================== */

/* Свечение для важных элементов */
.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

/* Градиентный текст */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-blue {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-green {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Тени с цветом */
.shadow-colored {
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.2);
}

.shadow-colored-green {
    box-shadow: 0 10px 40px rgba(22, 163, 74, 0.2);
}

.shadow-colored-purple {
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
}

/* Эффект при наведении на карточки */
.lift-on-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lift-on-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* =========================================================================
   ДОСТИЖЕНИЯ (ачивки)
   ========================================================================= */

.achievement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: help;
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.achievement-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 8px;
}

.achievement-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 6px;
}

.achievement-xp {
    font-size: 11px;
    font-weight: 700;
    color: #d97706;
    background: #fef3c7;
    padding: 2px 8px;
    border-radius: 999px;
}

.achievement-unlocked {
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    border-color: #fcd34d;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.12);
}

.achievement-locked {
    background: #f9fafb;
    border-color: #e5e7eb;
    opacity: 0.55;
    filter: grayscale(0.7);
}

.achievement-locked .achievement-xp {
    background: #e5e7eb;
    color: #6b7280;
}

/* =========================================================================
   ТОСТ ДОСТИЖЕНИЯ
   ========================================================================= */

#achievement-toast-container {
    position: fixed;
    top: 90px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
    pointer-events: none;
}

.achievement-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.25);
    color: #78350f;
    font-weight: 600;
    transform: translateX(120%);
    transition: transform 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease;
    opacity: 0;
}

.achievement-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.achievement-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.achievement-toast-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.achievement-toast-body {
    flex: 1;
    min-width: 0;
}

.achievement-toast-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #b45309;
    margin-bottom: 2px;
    font-weight: 700;
}

.achievement-toast-title {
    font-size: 15px;
    font-weight: 800;
    color: #78350f;
    line-height: 1.25;
}

.achievement-toast-xp {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    background: rgba(255, 255, 255, 0.5);
    padding: 2px 8px;
    border-radius: 999px;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* =========================================================================
   ТИПОГРАФИКА
   ========================================================================= */

/* Заголовки на крупных текстовых блоках — Manrope (более «дружелюбный»
   и узнаваемый, чем Inter). Применяется через класс .font-display
   (Tailwind extended) или к h1/h2 в Hero-секциях. */
.font-display {
    font-family: 'Manrope', 'Inter', system-ui, sans-serif;
    letter-spacing: -0.02em;
}

/* Lucide-иконки по умолчанию 1em — выровняем по тексту */
i[data-lucide] {
    display: inline-block;
    vertical-align: -2px;
    width: 1.05em;
    height: 1.05em;
}

/* =========================================================================
   SCROLL-REVEAL
   ========================================================================= */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.18, 0.89, 0.32, 1.0),
                transform 0.7s cubic-bezier(0.18, 0.89, 0.32, 1.0);
    will-change: opacity, transform;
}

.reveal.reveal-fade {
    transform: none;
}

.reveal.reveal-left {
    transform: translateX(24px);
}

.reveal.reveal-right {
    transform: translateX(-24px);
}

.reveal.revealed {
    opacity: 1;
    transform: translate(0, 0);
}

/* На print — всегда видимо */
@media print {
    .reveal { opacity: 1 !important; transform: none !important; }
}

/* =========================================================================
   ЛИДЕРБОРД (РЕЙТИНГ)
   ========================================================================= */

.podium-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 18px 20px;
    border-radius: 20px;
    background: #fff;
    border: 2px solid transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.podium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.podium-1 {
    background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%);
    border-color: #f59e0b;
    transform: translateY(-12px);
    padding: 32px 18px 24px;
}

.podium-1:hover { transform: translateY(-16px); }

.podium-2 {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-color: #94a3b8;
}

.podium-3 {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border-color: #c2410c;
}

.podium-mine {
    box-shadow: 0 0 0 3px #3b82f6, 0 10px 30px rgba(59, 130, 246, 0.2);
}

.podium-medal {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.podium-1 .podium-medal { font-size: 72px; }

.podium-name {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 6px;
    word-break: break-word;
}

.podium-1 .podium-name { font-size: 22px; }

.podium-xp {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    color: #b45309;
    margin-bottom: 12px;
}

.podium-1 .podium-xp { font-size: 16px; }

.podium-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 12px;
    color: #4b5563;
    font-weight: 600;
}

/* Таблица */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
}

.leaderboard-table th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    text-align: left;
}

.leaderboard-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: middle;
}

.leaderboard-table tbody tr:hover {
    background: #f8fafc;
}

.leaderboard-row-mine {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
}

.leaderboard-row-mine:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.05)) !important;
}

.leaderboard-row-separator td {
    border-top: 2px dashed #cbd5e1;
}

.avatar-bubble {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

.level-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.level-pill-1 { background: #16a34a; }
.level-pill-2 { background: #2563eb; }
.level-pill-3 { background: #d97706; }
.level-pill-4 { background: #9333ea; }

/* Мини-блок «Ваше место» на dashboard */
.rank-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
}

.rank-card-icon {
    font-size: 36px;
    line-height: 1;
}

.rank-card-rank {
    font-size: 28px;
    font-weight: 800;
    color: #4f46e5;
    line-height: 1;
}
