* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark-first цветовая схема */
    --bg-primary: #0a0e27;
    --bg-secondary: #141b3d;
    --bg-tertiary: #1e2749;
    --bg-card: rgba(30, 39, 73, 0.8);
    --bg-card-hover: rgba(30, 39, 73, 0.95);
    
    /* Акцентные цвета */
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-success: #43e97b;
    --accent-warning: #f5576c;
    --accent-info: #4facfe;
    
    /* Градиенты */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --dark-gradient: linear-gradient(135deg, #0a0e27 0%, #141b3d 100%);
    
    /* Glass morphism для dark theme */
    --glass-bg: rgba(30, 39, 73, 0.6);
    --glass-bg-light: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-light: rgba(255, 255, 255, 0.2);
    
    /* Текст */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-tertiary: rgba(255, 255, 255, 0.6);
    --text-inverse: #0a0e27;
    
    /* Тени */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.5);
    --shadow-glow-strong: 0 0 30px rgba(102, 126, 234, 0.7);
    
    /* Overlay для обложек */
    --overlay-dark: linear-gradient(180deg, rgba(10, 14, 39, 0) 0%, rgba(10, 14, 39, 0.7) 100%);
    --overlay-light: linear-gradient(180deg, rgba(10, 14, 39, 0) 0%, rgba(10, 14, 39, 0.4) 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dark-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    position: relative;
    width: 100%;
    max-width: 100vw;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Поддержка light-темы Telegram */
body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --text-primary: #0a0e27;
    --text-secondary: rgba(10, 14, 39, 0.8);
    --text-tertiary: rgba(10, 14, 39, 0.6);
    --text-inverse: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-bg-light: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-border-light: rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

/* Анимированный фон для dark theme */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    animation: backgroundShift 15s ease infinite;
    z-index: 0;
    pointer-events: none;
}

body.light-theme::before {
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
}

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

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 100px;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

.screen.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

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

.screen.active {
    display: block;
}

/* Загрузочный экран */
#loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-gradient);
    color: var(--text-primary);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-content {
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

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

.logo {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8)); }
}

.loading-bar {
    width: 250px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
    100% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
}

.loading-text {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 8px;
    min-height: 24px;
}

.loading-percent {
    font-size: 14px;
    opacity: 0.7;
    font-weight: 600;
    letter-spacing: 2px;
}

/* Главный экран */
.header {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 40px;
    padding-top: 20px;
    animation: slideDown 0.6s ease;
}

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

.header h1 {
    font-size: 42px;
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 18px;
    opacity: 0.95;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    line-height: 1.6;
    letter-spacing: 0.2px;
}

.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.9) 0%, rgba(20, 27, 61, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: cardSlideIn 0.6s ease backwards;
    will-change: transform;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }

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

.feature-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;
    pointer-events: none;
    z-index: 0;
}

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

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(102, 126, 234, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.feature-card:active {
    transform: translateY(0);
}

.feature-card:active {
    transform: translateY(-4px) scale(1);
}

.feature-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    line-height: 1;
    transition: transform 0.2s ease;
    will-change: transform;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.feature-card:hover .feature-icon {
    transform: translateY(-3px);
}

.feature-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 400;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideUp 0.8s ease;
    width: 100%;
    box-sizing: border-box;
}

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

.btn {
    padding: 18px 24px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    will-change: transform;
}

.btn::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:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    min-height: 52px;
    font-weight: 700;
    font-size: 17px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: rgba(30, 39, 73, 0.8);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-height: 52px;
    font-size: 17px;
}

.btn-secondary:hover {
    background: rgba(30, 39, 73, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-hint, .btn-skip {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 15px;
    padding: 14px 24px;
    border: 1px solid var(--glass-border-light);
    box-shadow: var(--shadow-sm);
    min-height: 44px;
}

.btn-hint:hover, .btn-skip:hover {
    background: var(--glass-bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Список квестов */
.back-btn {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 24px;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-sm);
    will-change: transform;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateX(-2px);
}

.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.filters select {
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #2d3748;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters select:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.filters select:focus {
    outline: none;
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Категории квестов и рейтингов */
.quest-categories,
.leaderboards-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.leaderboard-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    will-change: transform;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
    pointer-events: none;
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 16px rgba(102, 126, 234, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-card:active {
    transform: translateY(0);
}

.category-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    line-height: 1;
    pointer-events: none;
}

.category-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #fff;
    position: relative;
    z-index: 1;
    font-weight: 700;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.category-card p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    z-index: 1;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-weight: 400;
    pointer-events: none;
}

/* Рейтинги */
.leaderboards-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.leaderboard-content {
    margin-top: 24px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.leaderboard-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.leaderboard-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
    min-height: auto;
}

.leaderboard-item:hover {
    background: var(--glass-bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.leaderboard-item:active {
    transform: translateY(0);
}

.leaderboard-item.quest-item {
    cursor: pointer;
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.leaderboard-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-secondary);
}

.leaderboard-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.quests-list {
    display: grid;
    gap: 20px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.quest-card {
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.95) 0%, rgba(20, 27, 61, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: questCardSlide 0.5s ease backwards;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

/* Обертка для обложки */
.quest-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    /* Градиент будет установлен через inline style из JS */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 180px;
}

/* Обложка квеста (16:9) */
.quest-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    z-index: 0;
}

/* Если изображение не загрузилось, скрываем его */
.quest-cover[style*="display: none"] {
    display: none !important;
}

/* Overlay для читаемости текста */
.quest-cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: var(--overlay-dark);
    pointer-events: none;
    z-index: 1;
}

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

.quest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    z-index: 1;
}

.quest-card:hover::before {
    transform: scaleY(1);
}

.quest-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 20px rgba(102, 126, 234, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.quest-card:active {
    transform: translateY(-3px) translateX(2px) scale(0.98);
}

.quest-card-content {
    padding: 18px 20px 20px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.95) 0%, rgba(20, 27, 61, 0.95) 100%);
}

/* Заголовок квеста поверх обложки */
.quest-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    position: absolute;
    bottom: 16px;
    left: 20px;
    right: 20px;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    line-height: 1.3;
    margin: 0;
}

.quest-card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.quest-card-meta span {
    padding: 6px 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    border: 1px solid var(--glass-border);
}

.quest-card:hover .quest-card-meta span {
    background: var(--primary-gradient);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

.quest-card-info {
    margin-bottom: 8px;
}

.quest-card-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.quest-card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 8px;
}

/* Экран квеста */
.quest-header {
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* Обложка квеста на экране прохождения */
.quest-play-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    position: relative;
    margin-bottom: 24px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.quest-play-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: var(--overlay-light);
    pointer-events: none;
}

.quest-info h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

.quest-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    opacity: 0.95;
    flex-wrap: wrap;
}

.quest-meta span {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.quest-progress {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    position: relative;
    overflow: hidden;
}

.progress-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: progressShine 2s infinite;
}

.progress-text {
    text-align: center;
    font-size: 15px;
    color: #4a5568;
    font-weight: 600;
}

.quest-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    margin-bottom: 24px;
}

.stage-description {
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 400;
}

.stage-puzzle {
    font-size: 20px;
    font-weight: 700;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 16px;
    margin-bottom: 24px;
    color: var(--text-primary);
    border-left: 5px solid;
    border-image: var(--primary-gradient) 1;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stage-puzzle::before {
    content: '💡';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    opacity: 0.3;
}

.answer-section {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

#answer-input {
    flex: 1;
    min-width: 200px;
    padding: 16px 20px;
    border: 2px solid var(--glass-border);
    border-radius: 14px;
    font-size: 16px;
    outline: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    width: 100%;
}

#answer-input::placeholder {
    color: var(--text-tertiary);
}

#answer-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), var(--shadow-md);
    transform: translateY(-2px);
    background: var(--bg-tertiary);
}

.quest-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.quest-actions .btn {
    flex: 1;
    min-width: 140px;
    box-sizing: border-box;
}

.inventory-info {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    font-size: 15px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
    font-weight: 600;
}

.inventory-info span {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 18px;
}

/* Профиль */
.profile-content {
    padding: 20px;
}

.profile-info {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.9) 0%, rgba(20, 27, 61, 0.9) 100%);
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-info-item:last-child {
    border-bottom: none;
}

.profile-info-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.profile-info-value {
    font-size: 14px;
    color: #fff;
    font-weight: 600;
    text-align: right;
}

.profile-section {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.9) 0%, rgba(20, 27, 61, 0.9) 100%);
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    text-align: left;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.achievements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.achievement-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.achievements-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    margin-top: 16px;
}

.achievement-item {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #fff;
    text-align: left;
}

.achievement-item strong {
    color: var(--accent-primary);
}

.profile-avatar {
    text-align: center;
    margin-bottom: 32px;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-gradient);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: white;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: avatarPulse 3s ease-in-out infinite;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-lg), var(--shadow-glow); }
    50% { transform: scale(1.05); box-shadow: var(--shadow-lg), 0 0 30px rgba(102, 126, 234, 0.6); }
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 2px solid var(--glass-border);
}

.stat-card:hover {
    background: var(--primary-gradient);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.3);
}

.stat-card:hover .stat-value,
.stat-card:hover .stat-label {
    color: var(--text-primary);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

/* Бонусы и награды */
.bonuses-content {
    padding: 20px;
}

.balance-display {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.9) 0%, rgba(20, 27, 61, 0.9) 100%);
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.balance-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.balance-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent-primary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bonuses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.bonus-card {
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.9) 0%, rgba(20, 27, 61, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.bonus-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(102, 126, 234, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.bonus-card:active {
    transform: translateY(0);
}

.bonus-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

.bonus-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    pointer-events: none;
}

.bonus-card p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin-bottom: 8px;
    pointer-events: none;
}

.bonus-status {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
    pointer-events: none;
}

.bonus-detail {
    padding: 20px;
}

.bonus-detail-header {
    margin-bottom: 24px;
}

.bonus-detail-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-top: 8px;
}

.bonus-detail-content {
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.9) 0%, rgba(20, 27, 61, 0.9) 100%);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bonus-info {
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.bonus-info p {
    margin-bottom: 12px;
}

.referral-link-container {
    margin-bottom: 24px;
}

.referral-link-container label {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.referral-link-box {
    display: flex;
    gap: 8px;
}

.referral-link-box input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
}

.referral-link-box .btn {
    min-width: auto;
    padding: 12px 20px;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.stat-item .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.stat-item .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

.channels-list-title,
.promocodes-list-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
}

.channel-item {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 12px;
}

.channel-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-name {
    font-weight: 600;
    color: #fff;
}

.channel-bonus {
    font-weight: 700;
    color: var(--accent-primary);
}

.no-channels,
.no-promocodes {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 24px;
}

.promocode-item {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.promocode-code {
    font-weight: 700;
    color: #fff;
    font-family: monospace;
    font-size: 16px;
}

.promocode-bonus {
    font-weight: 700;
    color: var(--accent-primary);
}

.promocode-input-group {
    margin-top: 24px;
    display: flex;
    gap: 8px;
}

.promocode-input-group input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
}

.promocode-input-group .btn {
    min-width: auto;
    padding: 14px 24px;
}

/* Магазин */
.shop-content {
    padding: 20px;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-item {
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.9) 0%, rgba(20, 27, 61, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    will-change: transform;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(102, 126, 234, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.shop-item:active {
    transform: translateY(0);
}

.shop-item-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
    pointer-events: none;
}

.shop-item-info {
    flex: 1;
    pointer-events: none;
}

.shop-item-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.shop-item-info p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.shop-item-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    pointer-events: none;
}

/* Инвентарь */
.inventory-content {
    padding: 20px;
}

.inventory-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inventory-item {
    background: linear-gradient(135deg, rgba(30, 39, 73, 0.9) 0%, rgba(20, 27, 61, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.inventory-item-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.inventory-item-info {
    flex: 1;
}

.inventory-item-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.inventory-item-info p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.inventory-item-count {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    min-width: 50px;
    text-align: center;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.loading {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 500;
    animation: pulse 2s ease-in-out infinite;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 12px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 16px;
    width: 60%;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
}

/* Адаптивность */
@media (min-width: 768px) {
    .features {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .filters {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .btn {
        min-width: 200px;
        width: auto;
    }
    
    .quest-info-actions {
        flex-direction: row;
    }
    
    .quest-info-actions .btn {
        width: auto;
        flex: 1;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .screen {
        padding: 16px;
    }
    
    .category-card {
        padding: 16px 12px;
        min-height: 120px;
    }
    
    .category-icon {
        font-size: 2.5rem;
    }
    
    .category-card h3 {
        font-size: 0.9rem;
    }
    
    .category-card p {
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .quest-card {
        padding: 16px;
    }
    
    .quest-card h3 {
        font-size: 20px;
    }
    
    .answer-section {
        flex-direction: column;
    }
    
    #answer-input {
        width: 100%;
    }
    
    .quest-actions {
        flex-direction: column;
    }
    
    .quest-actions .btn {
        width: 100%;
    }
}

/* Улучшенные эффекты для карточек */
.feature-card, .quest-card {
    position: relative;
}

.feature-card::after,
.quest-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.feature-card:hover::after,
.quest-card:hover::after {
    opacity: 1;
}

/* Плавные переходы для всех интерактивных элементов */
button, .btn, .quest-card, .feature-card {
    -webkit-tap-highlight-color: transparent;
}

/* Улучшенная типографика */
h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Эффект свечения для важных элементов */
.btn-primary, .progress-fill {
    position: relative;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--primary-gradient);
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.3s ease;
}

.btn-primary:hover::after {
    opacity: 0.5;
}

/* Улучшенные скроллбары для веб-приложения */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Эффект параллакса для фона */
.screen.active {
    animation: fadeInUp 0.5s ease;
}

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

/* Экран информации о квесте */
#quest-info-screen {
    padding: 0;
    overflow-y: auto;
}

.quest-info-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.quest-info-content {
    padding-bottom: 2rem;
}

.quest-cover-image {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    position: relative;
}

.quest-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.quest-info-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 25px 25px 0 0;
    padding: 1.5rem;
    margin-top: -20px;
    position: relative;
    z-index: 10;
    border: 1px solid var(--glass-border);
    border-bottom: none;
}

.quest-info-card h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.quest-info-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quest-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quest-info-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    min-width: 100px;
}

.quest-info-row span:not(.quest-info-label) {
    color: rgba(255, 255, 255, 0.8);
}

.quest-info-stats {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.quest-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 1.1rem;
}

.stat-icon {
    font-size: 1.3rem;
}

.quest-info-status {
    margin: 1rem 0;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-new {
    background: var(--accent-gradient);
    color: #fff;
}

.status-started {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.status-completed {
    background: var(--success-gradient);
    color: #fff;
}

.quest-info-keywords {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.quest-info-keywords strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #fff;
}

.quest-info-keywords div {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.quest-info-description {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.quest-info-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.quest-info-actions .btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Skeleton loaders */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 12px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 16px;
    width: 60%;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    margin-bottom: 16px;
}

/* Улучшенные skeleton для карточек квестов */
.quest-card.skeleton {
    pointer-events: none;
    cursor: default;
}

.quest-card.skeleton .quest-card-content {
    padding: 20px;
}

/* Safe Area поддержка для iOS */
@supports (padding: max(0px)) {
    .screen {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(100px, env(safe-area-inset-bottom));
    }
    
    .quest-header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
    
    .header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
}

/* --- Стили для кошельков и выводов --- */

/* Профиль - кнопки действий */
.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

/* Кошельки */
.wallets-content {
    padding: 20px 0;
}

.wallets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.wallet-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.wallet-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wallet-item.wallet-default {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.wallet-info {
    flex: 1;
}

.wallet-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-badge {
    background: var(--primary-gradient);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 8px;
}

.wallet-address {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    word-break: break-all;
}

.wallet-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.wallet-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    border-color: var(--glass-border-light);
    color: var(--text-primary);
}

.btn-icon.btn-danger:hover {
    background: var(--accent-warning);
    border-color: var(--accent-warning);
    color: white;
}

/* Добавление кошелька */
.add-wallet-content {
    padding: 20px 0;
}

.wallet-options {
    margin-bottom: 24px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-tertiary);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.divider span {
    padding: 0 16px;
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: inherit;
}

.btn-link:hover {
    color: var(--accent-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* Вывод QUC */
.withdraw-content {
    padding: 20px 0;
}

.withdraw-balance {
    background: var(--primary-gradient);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow);
}

.balance-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.balance-amount {
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.withdraw-limits {
    display: flex;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.limit-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.limit-item span:first-child {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.limit-item span:last-child {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.withdraw-history-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.withdraw-history-section h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.withdraw-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.withdraw-history-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 16px;
}

.withdraw-history-info {
    margin-bottom: 8px;
}

.withdraw-history-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.withdraw-history-address {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.withdraw-history-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.withdraw-history-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 8px;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-sent {
    background: rgba(67, 233, 123, 0.2);
    color: var(--accent-success);
}

.status-rejected {
    background: rgba(245, 87, 108, 0.2);
    color: var(--accent-warning);
}

.withdraw-history-tx {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.withdraw-history-reason {
    font-size: 0.85rem;
    color: var(--accent-warning);
    margin-top: 4px;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state p {
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

/* Alert стили */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alert-info {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.alert-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Стили для кнопки подключения кошелька на главном экране --- */

.wallet-connect-header {
    padding: 16px 20px;
    display: flex;
    justify-content: center;
}

.btn-wallet {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-wallet:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.wallet-icon {
    font-size: 1.2rem;
}

/* --- Стили для модального окна подключения кошелька --- */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.wallet-modal {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
}

.modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: 24px;
}

.wallet-connect-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn-telegram-wallet {
    width: 100%;
    padding: 16px 20px;
    background: #0088cc;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.btn-telegram-wallet:hover {
    background: #0077b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4);
}

.btn-telegram-wallet span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-icon-small {
    font-size: 1.2rem;
}

.telegram-icon {
    font-size: 1.1rem;
}

.other-wallets-label {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    text-align: center;
    margin: 8px 0;
}

.external-wallets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.wallet-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wallet-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-border-light);
    transform: translateY(-2px);
}

.wallet-option span {
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: center;
}

.wallet-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bg-tertiary);
}

.tonkeeper-logo {
    background: linear-gradient(135deg, #0088cc 0%, #00a8e8 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.mytonwallet-logo {
    background: var(--bg-tertiary);
}

.tonhub-logo {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.all-wallets-logo {
    background: var(--bg-tertiary);
    font-size: 1.8rem;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
}

.ton-connect-branding {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.ton-logo {
    font-size: 1.2rem;
}

.btn-help {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-tertiary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.btn-help:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--glass-border-light);
}
