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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary: #06b6d4;
    --accent: #10b981;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --ton-primary: #0088cc;
    --ton-secondary: #0066aa;
    --glass: rgba(255, 255, 255, 0.8);
    --glass-dark: rgba(255, 255, 255, 0.9);
}

body.dark-mode {
    --text: #f1f5f9;
    --text-light: #cbd5e1;
    --text-lighter: #94a3b8;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --glass: rgba(30, 41, 59, 0.8);
    --glass-dark: rgba(30, 41, 59, 0.9);
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.bubble {
    position: absolute;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite linear;
}

.bubble-1 { width: 120px; height: 120px; top: 10%; left: 10%; animation-delay: 0s; }
.bubble-2 { width: 80px; height: 80px; top: 60%; left: 80%; animation-delay: -5s; }
.bubble-3 { width: 150px; height: 150px; top: 80%; left: 20%; animation-delay: -10s; }
.bubble-4 { width: 100px; height: 100px; top: 30%; left: 60%; animation-delay: -15s; }

.gradient-orbs {
    position: absolute;
    width: 100%;
    height: 100%;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -200px;
    right: -200px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -250px;
    left: -250px;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-20px) rotate(90deg) scale(1.1); }
    50% { transform: translateY(0) rotate(180deg) scale(1); }
    75% { transform: translateY(20px) rotate(270deg) scale(0.9); }
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: all 0.3s ease;
    line-height: 1.6;
}

.app-container {
    max-width: 400px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
}

/* ===== TELEGRAM STYLE HEADER ===== */
.telegram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--glass);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.avatar-placeholder {
    font-size: 20px;
    color: white;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.header-title {
    display: flex;
    flex-direction: column;
}

.app-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    letter-spacing: -0.5px;
}

.app-status {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
}

.wallet-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass);
    padding: 10px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wallet-mini:hover {
    background: var(--glass-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.wallet-mini.connected {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.wallet-icon-mini {
    font-size: 16px;
}

.wallet-status-mini {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.wallet-mini.connected .wallet-status-mini {
    color: var(--success);
}

/* ===== MAIN CONTENT & PAGES ===== */
.main-content {
    padding: 0 0 80px 0;
}

.page {
    display: none;
    min-height: calc(100vh - 140px);
}

.page.active {
    display: block;
}

.page-content {
    padding: 20px;
}

/* ===== TODAY PAGE ===== */
.hydration-hero {
    margin-bottom: 24px;
}

.hero-content {
    margin-bottom: 30px;
}

.greeting h1 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.greeting p {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
}

.streak-display-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass);
    padding: 16px 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
}

.streak-fire {
    font-size: 24px;
    animation: pulse 2s infinite;
}

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

.streak-count {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.streak-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}

.points-earned {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    padding: 14px 18px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 14px;
    border: 1.5px solid rgba(34, 197, 94, 0.2);
}

/* Progress Section */
.progress-section {
    background: var(--glass);
    padding: 30px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.progress-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.progress-circle {
    position: relative;
    width: 200px;
    height: 200px;
}

.circle-bg {
    width: 100%;
    height: 100%;
    border: 10px solid var(--bg-secondary);
    border-radius: 50%;
    position: absolute;
}

.circle-fill {
    width: 100%;
    height: 100%;
    border: 10px solid transparent;
    border-top: 10px solid var(--primary);
    border-right: 10px solid var(--primary);
    border-radius: 50%;
    position: absolute;
    transform: rotate(-45deg);
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-main {
    font-size: 42px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -2px;
}

.progress-sub {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 600;
}

.progress-points {
    font-size: 13px;
    color: var(--accent);
    font-weight: 800;
}

/* Drink Controls */
.drink-controls {
    background: var(--glass);
    padding: 28px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.time-status-card {
    background: var(--bg-secondary);
    padding: 22px;
    border-radius: 20px;
    margin-bottom: 22px;
}

.next-drink-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.next-drink-label {
    color: var(--text-light);
    font-size: 15px;
    font-weight: 600;
}

.next-drink-time {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    font-feature-settings: "tnum";
}

.window-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.window-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.drink-btn-main {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 22px;
    border-radius: 22px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin: 22px 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.drink-btn-main:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.drink-btn-main:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.btn-points {
    background: rgba(255,255,255,0.2);
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

/* Quick Actions - Fixed Horizontal Layout */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.quick-action-btn {
    background: var(--glass);
    border: 1.5px solid var(--border);
    padding: 18px 10px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.quick-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.quick-icon {
    font-size: 22px;
    margin-bottom: 10px;
}

.quick-amount {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.quick-points {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 0 24px 0;
}

.stat-card {
    background: var(--glass);
    padding: 22px 16px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--border);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.stat-icon {
    font-size: 22px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.stat-main {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

/* ===== QUICK ACTIONS ROW ===== */
.quick-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 0 0 24px 0;
}

.action-card {
    background: var(--glass);
    padding: 22px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.action-icon {
    font-size: 26px;
    margin-bottom: 10px;
}

.action-text {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text);
}

.action-badge {
    font-size: 12px;
    font-weight: 800;
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    padding: 6px 10px;
    border-radius: 10px;
    display: inline-block;
}

/* ===== AI COACH BANNER ===== */
.ai-coach-banner {
    background: linear-gradient(135deg, var(--ton-primary), var(--ton-secondary));
    color: white;
    margin: 0 0 24px 0;
    padding: 22px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.ai-coach-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.banner-content {
    flex: 1;
}

.banner-title {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 6px;
}

.banner-desc {
    font-size: 13px;
    opacity: 0.9;
}

.banner-arrow {
    font-size: 22px;
    font-weight: bold;
}

/* ===== TIMELINE ===== */
.timeline-section {
    background: var(--glass);
    margin: 0 0 24px 0;
    padding: 28px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.section-header h3 {
    font-weight: 700;
    font-size: 20px;
}

.section-action {
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.section-action:hover {
    color: var(--primary-dark);
    transform: translateX(2px);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: var(--bg-secondary);
    border-radius: 18px;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    background: var(--glass-dark);
    transform: translateX(4px);
}

.timeline-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.marker-icon {
    color: white;
    font-size: 16px;
}

.timeline-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-time {
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
}

.timeline-amount {
    font-weight: 700;
    font-size: 15px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 52px;
    margin-bottom: 18px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-subtext {
    font-size: 13px;
    opacity: 0.7;
}

/* ===== QUOTE SECTION ===== */
.quote-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    margin: 0;
    padding: 28px;
    border-radius: 28px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-lg);
}

.quote-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.quote-text {
    font-size: 15px;
    line-height: 1.6;
    font-style: italic;
}

/* ===== PAGE HEADERS ===== */
.page-header {
    text-align: center;
    padding: 30px 20px 25px;
}

.page-header h2 {
    font-weight: 800;
    font-size: 32px;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.page-header p {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
}

/* ===== ACHIEVEMENTS ===== */
.points-summary {
    background: var(--glass);
    margin: 0 0 24px 0;
    padding: 28px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
}

.total-points {
    text-align: center;
    margin-bottom: 24px;
}

.points-label {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 600;
}

.points-value {
    font-size: 52px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
}

.points-progress {
    background: var(--bg-secondary);
    padding: 22px;
    border-radius: 18px;
}

.progress-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 600;
}

.progress-bar-token {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill-token {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 5px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    font-weight: 600;
}

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

.achievement-card {
    background: var(--glass);
    padding: 28px 18px;
    border-radius: 22px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--border);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-lg);
}

.achievement-icon {
    font-size: 36px;
    margin-bottom: 14px;
}

.achievement-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}

.achievement-desc {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.4;
}

.achievement-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 13px;
}

/* ===== QUESTS PAGE ===== */
.quests-container {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.quest-card {
    background: var(--glass);
    padding: 24px;
    border-radius: 22px;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

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

.quest-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.quest-icon {
    font-size: 26px;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quest-info {
    flex: 1;
}

.quest-title {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    margin-bottom: 6px;
}

.quest-reward {
    font-size: 15px;
    font-weight: 800;
    color: var(--success);
}

.quest-desc {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 18px;
    line-height: 1.5;
}

.quest-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quest-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.quest-progress {
    margin-top: 12px;
}

.quest-status {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 700;
    text-align: center;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

/* ===== INVITE FRIENDS PAGE ===== */
.invite-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    margin: 0 0 24px 0;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
}

.invite-icon {
    font-size: 56px;
    margin-bottom: 18px;
}

.invite-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.invite-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.referral-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 0 24px 0;
}

.stat-item {
    background: var(--glass);
    padding: 24px;
    border-radius: 22px;
    text-align: center;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 36px;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 700;
}

.invite-actions {
    padding: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.invite-card {
    background: var(--glass);
    padding: 24px;
    border-radius: 22px;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

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

.invite-method {
    display: flex;
    align-items: center;
    gap: 14px;
}

.method-icon {
    font-size: 26px;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.method-info {
    display: flex;
    flex-direction: column;
}

.method-title {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    margin-bottom: 6px;
}

.method-desc {
    font-size: 13px;
    color: var(--text-light);
}

.invite-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.invite-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.referral-terms {
    background: var(--glass);
    margin: 0;
    padding: 28px;
    border-radius: 22px;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.referral-terms h3 {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 18px;
    color: var(--text);
}

.terms-list {
    list-style: none;
    padding: 0;
}

.terms-list li {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
    padding-left: 0;
    line-height: 1.5;
}

/* ===== SUPPORT PAGE ===== */
.support-options {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.support-card {
    background: var(--glass);
    padding: 32px 28px;
    border-radius: 26px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.support-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.support-icon {
    font-size: 52px;
    margin-bottom: 18px;
}

.support-title {
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 12px;
}

.support-desc {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.5;
}

.support-btn {
    background: linear-gradient(135deg, var(--ton-primary), var(--ton-secondary));
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* FIXED: Wallet Connect Wrapper for Centering */
.wallet-connect-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

.ton-connect-centered {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* AI Features Section */
.ai-features {
    background: var(--glass);
    margin: 24px 0;
    padding: 28px;
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
}

.ai-features h3 {
    text-align: center;
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 28px;
    color: var(--text);
}

.features-grid {
    display: grid;
    gap: 18px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 18px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateX(4px);
    background: var(--glass-dark);
}

.feature-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-content {
    flex: 1;
}

.feature-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--text);
}

.feature-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}

/* AI Tech Badge */
.ai-tech {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.tech-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--glass);
    padding: 18px 22px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.tech-icon {
    font-size: 28px;
}

.tech-info {
    display: flex;
    flex-direction: column;
}

.tech-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

.tech-desc {
    font-size: 12px;
    color: var(--text-light);
}

.why-support {
    background: var(--glass);
    margin: 24px 0 0 0;
    padding: 28px;
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
}

.why-support h3 {
    text-align: center;
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 28px;
}

.reasons-grid {
    display: grid;
    gap: 22px;
}

.reason {
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 18px;
    transition: all 0.3s ease;
}

.reason:hover {
    transform: translateY(-2px);
    background: var(--glass-dark);
}

.reason-icon {
    font-size: 36px;
    margin-bottom: 14px;
}

.reason-title {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 10px;
}

.reason-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

/* ===== SETTINGS ===== */
.settings-section {
    background: var(--glass);
    margin: 0 0 24px 0;
    padding: 28px;
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
}

.settings-section h3 {
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 22px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1.5px solid var(--border);
}

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

.setting-info {
    flex: 1;
}

.setting-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 6px;
}

.setting-desc {
    font-size: 13px;
    color: var(--text-light);
}

.setting-control {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    padding: 12px 16px;
    border-radius: 14px;
    color: var(--text);
    font-size: 14px;
    min-width: 140px;
    transition: all 0.3s ease;
}

.setting-control:focus {
    border-color: var(--primary);
    outline: none;
}

.danger-btn {
    background: var(--error);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.danger-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* About */
.about-content {
    text-align: center;
}

.about-icon {
    font-size: 52px;
    margin-bottom: 22px;
}

.about-content h4 {
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 16px;
}

.about-content p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 28px;
}

.app-info {
    background: var(--bg-secondary);
    padding: 22px;
    border-radius: 18px;
    text-align: left;
}

.info-item {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-light);
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass);
    border-top: 1.5px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 12px 8px;
    z-index: 1000;
    max-width: 400px;
    margin: 0 auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-item {
    background: none;
    border: none;
    padding: 8px 6px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 50px;
    flex: 1;
    max-width: 60px;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.nav-icon {
    font-size: 20px;
    transition: all 0.3s ease;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    transition: all 0.3s ease;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass);
    border-radius: 28px;
    padding: 0;
    max-width: 400px;
    width: 100%;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1.5px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
}

.modal-body {
    padding: 28px;
    text-align: center;
}

/* Drink Confirmation */
.drink-confirmation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.drink-confirmation.active {
    display: flex;
}

.confirmation-card {
    background: var(--glass);
    padding: 40px 32px;
    border-radius: 32px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: popIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(20px);
}

.confirmation-icon {
    font-size: 64px;
    margin-bottom: 22px;
}

.confirmation-title {
    font-weight: 900;
    font-size: 26px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.confirmation-message {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 22px;
    line-height: 1.5;
}

.confirmation-progress {
    margin-bottom: 28px;
}

.progress-text {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.confirmation-ok {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirmation-ok:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* TON Connect Overrides - IMPROVED */
.ton-connect-button__button {
    background: linear-gradient(135deg, var(--ton-primary), var(--ton-secondary)) !important;
    border-radius: 16px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: var(--shadow-md) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ton-connect-button__button:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* Responsive */
@media (max-width: 380px) {
    .telegram-header {
        padding: 14px 16px;
    }
    
    .user-avatar {
        width: 38px;
        height: 38px;
    }
    
    .avatar-placeholder {
        font-size: 18px;
    }
    
    .app-name {
        font-size: 16px;
    }
    
    .app-status {
        font-size: 12px;
    }
    
    .wallet-mini {
        padding: 8px 12px;
    }
    
    .wallet-status-mini {
        font-size: 12px;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .progress-circle {
        width: 180px;
        height: 180px;
    }
    
    .progress-main {
        font-size: 38px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .quick-actions-row {
        gap: 12px;
    }
    
    .action-card {
        padding: 18px;
    }
    
    .action-icon {
        font-size: 22px;
    }
    
    .action-text {
        font-size: 13px;
    }
    
    .nav-item {
        padding: 6px 4px;
        min-width: 45px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-label {
        font-size: 9px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .quick-action-btn {
        padding: 16px 8px;
        min-height: 80px;
    }
    
    .quick-amount {
        font-size: 13px;
    }
    
    .quick-points {
        font-size: 11px;
    }
    
    .features-grid {
        gap: 14px;
    }
    
    .feature-item {
        padding: 16px;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .tech-badge {
        padding: 14px 18px;
    }
    
    .wallet-connect-wrapper {
        padding: 8px 0;
    }
}