:root {
    /* Colors */
    --bg-light: #f5f5f7;
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --accent-purple: #AECA24;
    --accent-blue: #AECA24;
    --accent-green: #34c759;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(20px);

    /* Spacing */
    --section-padding: 60px 20px;
    --border-radius: 20px;

    /* Fonts */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html,
body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

section {
    padding: var(--section-padding);
    position: relative;
}

h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 72px;
    line-height: 1.1;
}

h2 {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 20px;
}

h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.btn {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--text-main);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

/* Header & Navigation */
header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    z-index: 1000;
    padding: 6px 30px;
    border-radius: 20px;
}

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


/* Header nav button size */
header nav .btn {
    font-size: 11px;
    padding: 10px 18px;
}
.logo {
    display: none;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -1px;
}

/* Hero Section */
.hero {
    height: 100vh;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    background: #000;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-background iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.77vh;
    transform: translate(-50%, -50%);
    object-fit: cover;
    pointer-events: none;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
}

.hero-text {
    text-align: center;
    color: white;
    max-width: 800px;
}

.badge {
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Widgets */
.hero-widgets {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 60px;
}

.widget {
    position: relative;
    z-index: 10;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
}

/* Staggered float animations */
.hero-widgets .widget:nth-child(1) {
    animation: float 4s ease-in-out infinite;
}

.hero-widgets .widget:nth-child(2) {
    animation: float 5s ease-in-out -1s infinite;
}

.hero-widgets .widget:nth-child(3) {
    animation: float 4.5s ease-in-out -0.5s infinite;
}

/* CTA Orange Widget - Opaque Oval Redesign */
.cta-orange {
    background: linear-gradient(135deg, #ff9500, #ff5e3a) !important;
    opacity: 1 !important;
    color: #ffffff !important;
    text-decoration: none;
    border: none !important;
    border-radius: 50px !important;
    padding: 12px 25px !important;
    font-weight: 700 !important;
    animation: float 4.2s ease-in-out -0.3s infinite !important;
    box-shadow: 0 8px 25px rgba(255, 149, 0, 0.4) !important;
}

.cta-orange:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 149, 0, 0.5) !important;
}

/* Trust Strip */
.trust-strip {
    height: 120px;
    margin-top: 0;
    position: relative;
    z-index: 5;
    border-radius: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.ticker {
    display: flex;
    white-space: nowrap;
    animation: ticker 20s linear infinite;
    align-items: center;
}

.ticker img {
    height: 80px;
    margin: 0 60px;
    filter: grayscale(1) opacity(0.8);
    transition: all 0.3s ease;
}

.ticker img:hover {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Ambassador */
.ambassador-grid {
    display: block;
}

.ambassador-content {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 20px 80px;
    align-items: center;
}

.ambassador-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    grid-column: 1;
}

.ambassador-text {
    grid-column: 1;
}

.ambassador-media {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.ambassador-content .role {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.ambassador-content blockquote {
    font-size: 20px;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 20px;
    border-left: 3px solid var(--accent-purple);
    padding-left: 20px;
    font-style: italic;
}

.ambassador-content .signature {
    font-family: 'Brush Script MT', cursive;
    font-size: 36px;
    color: var(--text-main);
    opacity: 0.8;
}

.ambassador-media img {
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: contain;
    border-radius: 40px;
}

/* Gravity Field Section */
.gravity-field {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    background: var(--bg-light);
    text-align: center;
}

.gravity-field .section-title {
    color: #1d1d1f;
    margin-bottom: 5px;
}

.gravity-field .section-subtitle {
    color: #86868b;
    margin-bottom: 30px;
}

/* Rewards Carousel Section (Dribbble Inspired) */
.rewards-section {
    padding: 80px 0;
    background: var(--bg-light);
    overflow: hidden;
}

.rewards-carousel {
    display: flex;
    gap: 20px;
    padding: 60px 20px 100px;
    overflow-x: auto;
    /* Enabled for manual scroll/fling */
    position: relative;
    white-space: nowrap;
}

.rewards-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.reward-card {
    flex: 0 0 280px;
    height: 400px;
    /* scroll-snap-align removed */
    transition: transform 0.1s linear, filter 0.3s ease;
    /* Faster transition for smooth scroll scaling */
    position: relative;
    cursor: pointer;
}

.card-glass {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 30px 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

/* Architecture cut-out corners feel from ref */
.card-glass::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 60px;
    height: 60px;
    background: #ffffff;
    transform: rotate(45deg);
    z-index: 5;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, var(--glow-color, rgba(175, 82, 222, 0.15)) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.reward-card:hover .card-glow,
.reward-card.focused .card-glow {
    opacity: 1;
}

.card-info-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.4);
    z-index: 10;
    transition: all 0.3s ease;
}

.card-info-btn:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.card-image-container {
    width: 100%;
    height: 180px;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.reward-card:hover .card-image-container img,
.reward-card.focused .card-image-container img {
    transform: scale(1.1);
}

.card-content {
    text-align: center;
    width: 100%;
    opacity: 0.5;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.reward-card.focused .card-content,
.reward-card:hover .card-content {
    opacity: 1;
    transform: translateY(0);
}

.card-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.card-content h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #1d1d1f;
}

.card-desc {
    font-size: 14px;
    color: #86868b;
    font-weight: 500;
    line-height: 1.4;
}

/* Category Specific Glow Colors */
[data-category="volunteer"] {
    --glow-color: rgba(255, 69, 0, 0.2);
}

[data-category="sport"] {
    --glow-color: rgba(0, 191, 255, 0.2);
}

[data-category="studies"] {
    --glow-color: rgba(52, 199, 89, 0.2);
}

[data-category="media"] {
    --glow-color: rgba(175, 82, 222, 0.2);
}

[data-category="citizen"] {
    --glow-color: rgba(0, 122, 255, 0.2);
}

[data-category="events"] {
    --glow-color: rgba(255, 149, 0, 0.2);
}

[data-category="social"] {
    --glow-color: rgba(90, 200, 250, 0.2);
}

[data-category="partners"] {
    --glow-color: rgba(255, 45, 85, 0.2);
}

[data-category="extra"] {
    --glow-color: rgba(76, 217, 100, 0.2);
}

[data-category="history"] {
    --glow-color: rgba(199, 199, 204, 0.2);
}

[data-category="community"] {
    --glow-color: rgba(255, 159, 10, 0.2);
}

[data-category="ideas"] {
    --glow-color: rgba(255, 204, 0, 0.2);
}

/* Focus State scaling */
.reward-card {
    opacity: 0.4;
    transform: scale(0.85);
}

.reward-card.focused,
.reward-card:hover {
    opacity: 1;
    transform: scale(1.05);
    z-index: 10;
}

.reward-card.focused .card-glass {
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Mobile */
@media (max-width: 768px) {
    .reward-card {
        flex: 0 0 130px;
        height: 240px;
    }

    .card-image-container {
        height: 100px;
        margin-top: 5px;
    }

    .card-glass {
        padding: 12px 8px;
    }

    .card-icon {
        font-size: 30px;
    }

    .card-content h3 {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .card-desc {
        font-size: 8px;
    }

    .card-badge {
        font-size: 7px;
        padding: 2px 5px;
        margin-bottom: 4px;
    }

    .card-info-btn {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: 8px;
        right: 8px;
    }

    .rewards-carousel {
        padding: 20px 5px 40px;
        gap: 8px;
        scroll-snap-type: none !important;
    }
}

/* Bento Grid updates (cleanup) */
.rewards {
    padding-top: 20px !important;
    background: var(--bg-light);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: 20px;
}

.bento-item {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
    cursor: pointer;
    background-color: var(--glass-bg);
}

.bento-item:hover {
    transform: scale(1.02);
}

/* Reference-based spans (4x3 grid) */
.bento-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
}

/* Orbixa Large */
.bento-item:nth-child(2) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Watch */
.bento-item:nth-child(3) {
    grid-column: span 1;
    grid-row: span 2;
}

/* VR Tall */
.bento-item:nth-child(4) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Typography Aa */
.bento-item:nth-child(5) {
    grid-column: span 2;
    grid-row: span 1;
}

/* Tablet Center */
.bento-item:nth-child(6) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Color Palette */
.bento-item:nth-child(7) {
    grid-column: span 1;
    grid-row: span 1;
}

/* App Icon */
.bento-item:nth-child(8) {
    grid-column: span 2;
    grid-row: span 1;
}

/* Grid/Card Right */

.bento-text-block {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    padding: 28px 32px;
}

.bento-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.huge-text {
    font-size: 80px;
    font-weight: 900;
    line-height: 0.95;
    margin: 0 0 auto 0;
    letter-spacing: -2px;
    background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0.75));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.explanation {
    font-size: 15px;
    line-height: 1.45;
    font-weight: 600;
    opacity: 0.92;
    margin: 0;
    max-width: 220px;
    letter-spacing: -0.2px;
}

.bento-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
}

.bento-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.price {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* Pulse of Loft */
.pulse-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

.pulse-left {
    max-width: 320px;
}
.pulse-left h2 {
    font-size: 34px;
    white-space: nowrap;
    margin-bottom: 12px;
}

.calendar {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 8px;
}
.calendar-header {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    flex: 1;
}
.cal-nav-btn {
    background: #a8e063;
    border: none;
    border-radius: 50%;
    color: #1a3a00;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 1;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(100,200,0,0.25);
}
.cal-nav-btn:hover, .cal-nav-btn:active { background: #7ecb20; transform: scale(1.1); }

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 15px;
    opacity: 0.8;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-grid span {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.calendar-grid span:hover {
    background: rgba(0, 113, 227, 0.1);
}

.calendar-grid span.current {
    background: var(--accent-blue);
    color: white;
}

.calendar-grid span.has-event {
    border-color: var(--accent-purple);
    font-weight: 700;
    position: relative;
    box-shadow: 0 0 15px rgba(175, 82, 222, 0.2);
}

.calendar-grid span.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--accent-purple);
    border-radius: 50%;
}

.feed-container {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1000px;
    padding: 0;
    overflow: hidden;
}

.pulse-right {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    padding: 0;
}

.feed-nav {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s;
    border: 1px solid rgba(255,255,255,0.15);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-arrow:hover,
.nav-arrow:active {
    background: rgba(0, 0, 0, 0.7);
}

.event-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 30px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: grab;
    border: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.0) 0%, rgba(0, 0, 0, 0.55) 100%);
    z-index: 1;
}

.event-info {
    position: relative;
    z-index: 2;
    color: white;
}

.event-info h3 {
    font-size: 28px;
    margin-top: 10px;
    font-weight: 800;
}

.event-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.event-badge.earn {
    background: rgba(52, 199, 89, 0.6);
}

.event-badge.spend {
    background: rgba(175, 82, 222, 0.6);
}

/* Registration Pop-up / Auth Modal */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: max(60px, calc(40px + env(safe-area-inset-top, 0px)));
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

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

.auth-modal {
    max-width: 500px;
    width: 90%;
    padding: 40px;
    border-radius: 32px;
    position: relative;
    background: rgba(255, 255, 255, 0.9) !important;
    /* Light glassmorphism */
    color: #1a1a1a;
    /* Dark text for light background */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overscroll-behavior: contain;
}

.popup-overlay.active .auth-modal {
    transform: translateY(0);
}

.close-popup {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #1a1a1a;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
}

.auth-header p {
    font-size: 15px;
    color: rgba(0, 0, 0, 0.6);
}

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

.input-group label {
    display: block;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    color: #1a1a1a;
    font-size: 18px;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
}

.legal-checks {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 11px;
    color: #333;
    line-height: 1.4;
}

.check-item input {
    display: none;
}

.checkmark {
    min-width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
    margin-top: 2px;
}

.check-item:hover .checkmark {
    border-color: var(--accent-blue);
}

.check-item input:checked+.checkmark {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.check-item input:checked+.checkmark::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.check-item a {
    color: var(--accent-blue);
    text-decoration: none;
}

.check-item a:hover {
    text-decoration: underline;
}

.w-100 {
    width: 100%;
}

#authContinue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.05);
    /* Darker for light background */
    color: rgba(0, 0, 0, 0.3);
}

.auth-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.auth-divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    /* Darker for light background */
    z-index: 0;
}

.auth-divider span {
    position: relative;
    background: #fff;
    /* Match background for overlap */
    padding: 0 15px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 1;
}

.auth-social,
.auth-secondary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-secondary {
    margin-top: 12px;
}

.social-btn {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
    color: #1a1a1a;
    /* Dark text */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.social-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    /* More visible hover */
    transform: translateY(-2px);
}

.tg-btn {
    background: rgba(0, 136, 204, 0.1);
    border-color: rgba(0, 136, 204, 0.3);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tg-btn:hover {
    background: rgba(0, 136, 204, 0.3);
}

.tg-btn .btn-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Обёртка виджета Telegram — нативный рендер, только выравнивание */
.tg-widget-wrap {
    display: flex;
    justify-content: stretch;
    width: 100%;
}
.tg-widget-wrap > span {
    display: block !important;
    width: 100% !important;
}
.tg-widget-wrap iframe {
    width: 100% !important;
    border-radius: 8px;
}

#max-login-btn {
    width: 100%;
    height: 48px;
    box-sizing: border-box;
}

.max-btn {
    background: rgba(0, 198, 255, 0.1);
    border-color: rgba(0, 198, 255, 0.3);
}

.max-btn:hover {
    background: rgba(0, 198, 255, 0.3);
}

.vk {
    background: rgba(0, 119, 255, 0.05);
}

.yandex {
    background: rgba(255, 0, 0, 0.05);
}

.legal-footer {
    text-align: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.4);
    margin-top: 30px;
}

.legal-footer a {
    color: rgba(0, 0, 0, 0.6);
    text-decoration: underline;
}

/* Dashboard */
.dashboard-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 40px;
    margin-bottom: 30px;
}

.main-balance {
    font-size: 64px;
    font-weight: 700;
    color: var(--accent-purple);
}

.progress-container {
    background: rgba(0, 0, 0, 0.05);
    height: 8px;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar {
    background: #ea580c;
    height: 100%;
    transition: width 1s;
}

.booster-banner {
    background: linear-gradient(135deg, #ff9500, #ff5e3a) !important;
    padding: 60px;
    color: white;
    text-align: center;
    margin-bottom: 30px;
}

.countdown {
    font-family: monospace;
    font-size: 32px;
    margin: 20px 0;
    font-weight: 700;
}

.action-center {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.action-card:hover {
    transform: translateY(-5px);
}

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

.dashboard-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.leaderboard,
.achievements {
    padding: 30px;
}

.leaderboard ul {
    list-style: none;
    margin-top: 20px;
}

.leaderboard li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.leaderboard li.me {
    color: var(--accent-blue);
    font-weight: 700;
}

.badges-grid {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.achievement-badge {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
}

.achievement-badge.locked {
    opacity: 0.3;
    filter: grayscale(1);
}

/* Header override for transparency */
header.glass {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-burger {
    display: none;
}

/* Footer */
.footer {
    background: #ffffff;
    color: #1d1d1f;
    padding: 80px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer h3,
.footer h4 {
    color: #1d1d1f;
    font-weight: 700;
}

.footer p,
.footer a {
    color: #86868b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #1d1d1f;
}

.social-btn {
    display: block;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    text-decoration: none;
    font-weight: 600;
    color: white !important;
}

.social-btn.vk {
    background: #AECA24;
}

.social-btn.tg {
    background: #AECA24;
    /* Matching VK color exactly */
}

/* Animations */
@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Mobile Optimization & TWA */
@media screen and (max-width: 768px) {
    header {
        padding: 4px 15px;
        top: 10px;
        width: calc(100% - 20px);
    }

    header.glass {
        border: none !important;
        background: rgba(255, 255, 255, 0.4) !important;
        backdrop-filter: blur(5px) !important;
    }

    h1 {
        font-size: 32px !important;
        line-height: 1.2;
    }

    section {
        padding: 40px 15px !important;
    }

    .hero {
        min-height: 100vh;
        height: auto;
        padding-top: 0;
    }

    .hero-overlay {
        align-items: flex-start;
        padding-top: 120px;
    }

    .rewards-section {
        padding: 30px 0 !important;
    }

    .hero-widgets {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        margin-top: 30px !important;
    }

    .widget {
        display: block !important;
        white-space: normal !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 280px !important;
        padding: 12px 20px !important;
        margin: 0 auto !important;
        font-size: 14px !important;
    }

    .cta-orange {
        width: 100% !important;
        max-width: 280px !important;
    }

    /* Ambassador Reordering */
    .ambassador-grid {
        grid-template-columns: 1fr !important;
        display: block !important;
    }

    .ambassador-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .ambassador-content h2 {
        order: 1 !important;
        text-align: center !important;
        margin-bottom: 6px !important;
    }

    .ambassador-media {
        order: 2 !important;
        margin: 0 auto 8px auto !important;
        width: 100% !important;
        max-width: 320px !important;
    }

    .ambassador-media img {
        height: 350px !important;
        border-radius: 30px !important;
    }

    .ambassador-text {
        order: 3 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }

    .ambassador-content .role {
        white-space: nowrap !important;
        overflow: visible !important;
        text-shadow: none !important;
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 8px !important;
        font-size: 10px !important;
        color: var(--accent-blue) !important;
        letter-spacing: 0.3px !important;
        text-transform: uppercase !important;
    }

    .ambassador-content blockquote {
        text-align: center !important;
        padding-left: 0 !important;
        border-left: none !important;
        font-size: 15px !important;
        margin-bottom: 10px !important;
        line-height: 1.5 !important;
    }

    .ambassador-content .signature {
        text-align: center !important;
        font-size: 24px !important;
    }

    .rewards .section-header h2 {
        font-size: 28px !important;
    }

    /* Centering Headers and Bento Uniformity */
    .section-header h2,
    .section-title {
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }

    .bento-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-auto-rows: min-content !important;
        gap: 20px !important;
    }

    .bento-item,
    .bento-item:nth-child(n) {
        width: 100% !important;
        max-width: none !important;
        height: 280px !important;
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        margin: 0 !important;
    }

    .pulse-grid,
    .footer-grid {
        grid-template-columns: 1fr !important;
    }

    .bento-text-block {
        padding: 24px 26px !important;
    }

    .huge-text {
        font-size: 68px !important;
    }

    .explanation {
        font-size: 14px !important;
        max-width: 100% !important;
    }
}

/* Modals */
.shop-modal {
    max-width: 900px !important;
    width: 90vw !important;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.shop-balance {
    font-size: 18px;
    font-weight: 700;
    margin-top: 10px;
    color: var(--accent-purple);
}

.shop-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
    padding: 0 32px 28px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.shop-item {
    position: relative;
    background: #fff;
    border: 1px solid rgba(175,82,222,0.15);
    border-radius: 18px;
    overflow: visible;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
    text-align: left;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.shop-item:hover {
    box-shadow: 0 4px 20px rgba(175,82,222,0.14);
}

/* 16:9 image */
.shop-item-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0eaf7;
    border-radius: 18px 18px 0 0;
}
.shop-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shop-item-body {
    padding: 12px 14px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.shop-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.shop-item h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.35;
}

.shop-item-badge {
    flex-shrink: 0;
    background: rgba(52,199,89,0.13);
    color: #28a745;
    font-weight: 800;
    font-size: 13px;
    padding: 4px 9px;
    border-radius: 9px;
    white-space: nowrap;
}

.shop-item .shop-item-desc {
    font-size: 12px;
    color: rgba(0,0,0,0.55);
    margin: 0;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shop-item .shop-item-desc.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.shop-item-desc-wrap {
    position: relative;
    flex: 1;
}
.shop-item-desc-fade {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 36px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
}
.shop-item .shop-item-desc.expanded + .shop-item-desc-fade {
    opacity: 0;
}

.shop-item-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid rgba(52,199,89,0.35);
    background: rgba(52,199,89,0.08);
    cursor: pointer;
    margin: 8px auto 4px;
    transition: background 0.2s, transform 0.2s;
    color: #34c759;
    font-size: 11px;
    line-height: 1;
}
.shop-item-expand-btn:hover {
    background: rgba(52,199,89,0.18);
}
.shop-item-expand-btn.expanded {
    transform: rotate(180deg);
}

.shop-item .buy-btn {
    display: block;
    width: calc(100% - 28px);
    margin: 4px 14px 14px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 12px;
    text-align: center;
    background: #34c759 !important;
    color: #fff !important;
    border: none !important;
    pointer-events: none;
    cursor: default;
    user-select: none;
    opacity: 0.92;
}

@media (max-width: 600px) {
    .shop-grid {
        grid-template-columns: 1fr;
        padding: 0 16px 20px;
    }
}

.history-list {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.history-item .reason {
    font-weight: 600;
    font-size: 15px;
}

.history-item .date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.history-item .amount {
    font-weight: 700;
    font-size: 16px;
}

.amount.plus {
    color: var(--accent-green);
}

.amount.minus {
    color: #ff3b30;
}

.history-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

/* --- NEW DASHBOARD MODAL STYLES --- */
.dashboard-modal {
    padding: 0;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.dashboard-modal .auth-header {
    padding: 24px 24px 0;
    text-align: left;
}

.dashboard-modal .auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.dashboard-user-card,
.booster-banner,
.dashboard-actions-list {
    margin: 0 24px;
}

.dashboard-progress {
    margin: 0 24px 24px;
}

.action-list-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

#btn-logout {
    margin: 24px 24px;
    width: calc(100% - 48px) !important;
}

@media (max-width: 500px) {
    .dashboard-modal {
        border-radius: 20px;
        margin-top: 0;
        height: max-content;
        max-height: 92vh;
    }

    .dashboard-user-card,
    .booster-banner,
    .dashboard-actions-list,
    #btn-logout,
    .dashboard-progress {
        margin-left: 16px;
        margin-right: 16px;
    }

    #btn-logout {
        width: calc(100% - 32px) !important;
        margin-bottom: 24px;
    }

    .action-list-btn {
        padding: 12px !important;
    }

    .dashboard-modal .auth-header {
        padding: 20px 16px 0;
    }
}
/* --- SURVEY & LEGAL STYLES (Consents v4.0) --- */
.survey-block {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-label-small {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
    font-weight: 600;
}

.form-input-modern {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px !important;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    color: #1a1a1a;
    transition: all 0.2s;
}

.form-input-modern:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: #fff;
}

.legal-content-body {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.legal-content-body h1, .legal-content-body h2 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #000;
    font-size: 18px;
    font-weight: 700;
}

.legal-content-body p, .legal-content-body ul {
    margin-bottom: 10px;
}

.check-item-survey {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.check-item-survey a {
    color: var(--accent-blue);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .survey-block {
        padding: 15px;
    }
}

/* Auth Social Buttons Consistency */
.auth-social {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 15px !important;
}

.auth-social .social-btn,
.auth-social #max-login-btn {
    width: 100% !important;
    height: 48px !important;
    flex: none !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.auth-social .tg-widget-wrap {
    width: 100% !important;
    height: 48px !important;
    flex: none !important;
}

.social-btn:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

/* --- EARN MODAL STYLES --- */
.earn-modal-inner {
    width: 90vw !important;
    max-width: 900px !important;
    max-height: 88vh;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

.earn-modal-inner .auth-header {
    padding: 28px 32px 16px;
    flex-shrink: 0;
}

.earn-modal-inner .close-popup {
    position: absolute;
    right: 24px;
    top: 20px;
    background: rgba(0,0,0,0.06);
    border: none;
    font-size: 22px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    color: #1a1a1a;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}
.earn-modal-inner .close-popup:hover {
    background: rgba(0,0,0,0.12);
}

.earn-list-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.earn-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 4px 32px 28px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    overscroll-behavior: contain;
    align-items: stretch;
    min-width: 0;
}

.earn-list-fade {
    display: none;
}

/* Earn card */
.earn-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0,122,255,0.13);
    border-radius: 18px;
    overflow: visible;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.earn-card:hover {
    box-shadow: 0 4px 20px rgba(0,122,255,0.13);
}

/* 16:9 image */
.earn-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8edf5;
    flex-shrink: 0;
    border-radius: 18px 18px 0 0;
}
/* Clip card visually without blocking overflow for expand */
.earn-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    pointer-events: none;
}
.earn-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.earn-card-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.earn-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}
.earn-card-title {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.35;
}
.earn-card-badge {
    flex-shrink: 0;
    background: rgba(0,122,255,0.11);
    color: #007aff;
    font-weight: 800;
    font-size: 13px;
    padding: 4px 9px;
    border-radius: 9px;
    white-space: nowrap;
}

/* Description with fade-out clamp */
.earn-card-desc-wrap {
    position: relative;
    flex: 1;
}
.earn-card-desc {
    font-size: 12px;
    color: rgba(0,0,0,0.58);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: none;
}
.earn-card-desc.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}
.earn-card-fade {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 36px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
    transition: opacity 0.2s;
}
.earn-card-desc.expanded + .earn-card-fade {
    opacity: 0;
    pointer-events: none;
}

/* Expand / collapse buttons */
.earn-card-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid rgba(52,199,89,0.35);
    background: rgba(52,199,89,0.08);
    cursor: pointer;
    margin: 8px auto 0;
    transition: background 0.2s, transform 0.2s;
    color: #34c759;
    font-size: 11px;
    line-height: 1;
}
.earn-card-expand-btn:hover {
    background: rgba(52,199,89,0.18);
}
.earn-card-expand-btn.expanded {
    transform: rotate(180deg);
}

/* Expanded card gets elevated shadow */
.earn-card.is-expanded {
    box-shadow: 0 6px 28px rgba(0,0,0,0.14);
}

/* Mobile */
@media (max-width: 600px) {
    .earn-modal-inner {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px;
        margin-top: 0;
    }

    .earn-modal-inner .auth-header {
        padding: 22px 20px 12px;
    }

    .earn-list {
        grid-template-columns: 1fr;
        padding: 4px 16px 20px;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .earn-list-fade {
        display: none !important;
    }
}

.shop-modal .auth-header {
    padding: 28px 32px 16px;
}

/* WebApp safe area: компенсация системного хедера в Telegram и MAX */
.is-webapp header {
    top: calc(10px + env(safe-area-inset-top, 0px));
}

@supports not (top: env(safe-area-inset-top)) {
    .is-webapp header {
        top: 50px;
    }
}

/* Logo image */
.logo-img {
    height: 16px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .logo-img {
        height: 12px;
    }
}

/* === WEBAPP CALENDAR (Telegram / MAX only) === */
.is-webapp .pulse-left h2 {
    font-size: clamp(28px, 8vw, 42px);
    white-space: nowrap;
    line-height: 1.1;
}

.is-webapp .calendar {
    padding: 12px 10px;
    text-align: center;
    margin: 0 auto;
    max-width: 320px;
}

.is-webapp .calendar-header {
    font-size: 15px;
    margin-bottom: 12px;
}

.is-webapp .calendar-days {
    font-size: 11px;
    margin-bottom: 6px;
}

.is-webapp .calendar-grid {
    gap: 2px;
}

.is-webapp .calendar-grid span {
    aspect-ratio: unset;
    height: 30px;
    font-size: 12px;
    border-radius: 6px;
}

/* === EVENTS: mobile 16:9 fix === */
@media (max-width: 768px) {
    .pulse-right {
        aspect-ratio: 16 / 9;
        border-radius: 20px;
        width: 100%;
    }
    .feed-nav {
        right: 8px;
        gap: 6px;
    }
    .nav-arrow {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    .calendar-header-wrap {
        margin-bottom: 16px;
    }
    .cal-nav-btn {
        font-size: 30px;
        padding: 0 6px;
    }
}

/* === WEBAPP: Прокачай свой уровень + стрелки календаря (Telegram / MAX only) === */
.is-webapp .rewards-section .section-title {
    font-size: clamp(22px, 7vw, 36px);
    white-space: nowrap;
    line-height: 1.1;
}

.is-webapp .cal-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #a8e63d;
    color: #1a1a1a;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 1;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    transition: transform 0.15s;
}

.is-webapp .cal-nav-btn:hover,
.is-webapp .cal-nav-btn:active {
    transform: scale(0.92);
    opacity: 1;
}

.is-webapp .calendar-header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.is-webapp .calendar-header {
    font-size: 14px;
}

/* === Event Detail Modal === */
.event-detail-modal-inner {
    background: #fff !important;
    color: #1a1a1a;
}
.event-modal-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #eee center/cover no-repeat;
    flex-shrink: 0;
}
.event-modal-body {
    padding: 24px 28px 28px;
}
.event-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.event-modal-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
}
.event-modal-meta-row strong {
    color: #1a1a1a;
    min-width: 80px;
}
.event-badge-modal {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}
.event-badge-modal.earn { background: rgba(52,199,89,0.15); color: #1a6b2f; }
.event-badge-modal.spend { background: rgba(255,59,48,0.12); color: #b01010; }
.event-badge-modal.neutral { background: rgba(0,113,227,0.12); color: #004e9a; }
@media (max-width: 600px) {
    .event-detail-modal-inner { border-radius: 20px !important; }
    .event-modal-body { padding: 18px 18px 24px; }
    .event-modal-body h2 { font-size: 20px !important; }
}

/* === FIX: Mobile webapp — уменьшить отступ секции events, центрировать календарь, touch fix === */
.is-webapp #events {
    padding-top: 20px;
    padding-bottom: 20px;
}

.is-webapp .pulse-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 100%;
}

.is-webapp .calendar {
    touch-action: manipulation;
}

.is-webapp .calendar-grid span {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.is-webapp .cal-nav-btn {
    touch-action: manipulation;
}
