/* ============================================
   TIMER PAGE STYLES
   ============================================ */

/* Fonts */
@font-face {
    font-family: 'DrukTextWideCyr';
    src: url("/static/fonts/druktextwidecyr-bold.69e019ec88b0.otf") format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Affect';
    src: url("/static/fonts/affect_bold.0425ff2e8f40.otf") format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --accent-color: #666666;
    --accent-secondary: #888888;
    --text-primary: #e0e0e0;
    --text-secondary: #999999;
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.06);
    
    --font-primary: 'Affect', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'DrukTextWideCyr', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--primary-bg);
    color: var(--text-primary);
    user-select: none;
    -webkit-user-select: none;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%) translateZ(0);
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    will-change: opacity;
}

.bg-video.active {
    opacity: 1;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3px);
    z-index: 1;
}

/* Timer Container */
.timer-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    padding: 1.25rem;
}

/* Timer Display */
.timer-display {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    animation: fadeIn 1s ease forwards;
    width: 100%;
    max-width: 1200px;
}

.timer-unit-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 1.2ch;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.timer-digit {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 5.5rem);
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #e0e0e0 0%, #888888 50%, #666666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
    background-size: 200% 200%;
}

.timer-label {
    font-family: var(--font-primary);
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
    opacity: 0.7;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.timer-separator {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 6vw, 4rem);
    font-weight: 900;
    color: var(--accent-color);
    line-height: 1;
    margin-top: 0.2rem;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Reward Container */
.reward-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    animation: reward-appear 0.8s ease forwards;
}

@keyframes reward-appear {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* Reward Button */
.reward-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 3rem;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: linear-gradient(135deg, #555555, #333333);
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(100, 100, 100, 0.1);
}

.reward-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(100, 100, 100, 0.2);
    background: linear-gradient(135deg, #666666, #444444);
}

.reward-button:active {
    transform: translateY(-2px) scale(1);
}

/* Reward Image */
.reward-image-wrapper {
    position: relative;
    display: block;
    width: clamp(200px, 50vw, 400px);
    height: clamp(200px, 50vw, 400px);
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(100, 100, 100, 0.1);
}

.reward-image-wrapper:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(100, 100, 100, 0.2);
}

.reward-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Pulse animation for expired state */
.timer-expired .timer-digit {
    animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .timer-display {
        gap: 0.2rem;
        flex-wrap: wrap; /* Разрешаем перенос если совсем не влезает */
    }
    
    .timer-digit {
        font-size: clamp(1.5rem, 8vw, 3.5rem);
    }
    
    .timer-separator {
        font-size: clamp(1rem, 6vw, 2.5rem);
        margin-top: 0.1rem;
    }

    .timer-label {
        font-size: clamp(0.5rem, 1.2vw, 0.7rem);
        letter-spacing: 0.05em;
    }
    
    .reward-button {
        padding: 1rem 2rem;
        font-size: clamp(1rem, 4vw, 1.5rem);
    }
    
    .reward-image-wrapper {
        width: clamp(180px, 70vw, 300px);
        height: clamp(180px, 70vw, 300px);
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .timer-container {
        padding: 0.5rem;
    }

    .timer-display {
        gap: 0.15rem;
    }
    
    .timer-digit {
        font-size: clamp(1rem, 11vw, 2rem);
    }
    
    .timer-separator {
        font-size: clamp(0.8rem, 8vw, 1.5rem);
    }

    .timer-label {
        font-size: 0.5rem;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .timer-digit {
        font-size: clamp(1.5rem, 10vh, 3rem);
    }
    
    .timer-separator {
        font-size: clamp(1.2rem, 8vh, 2.5rem);
    }
    
    .reward-image-wrapper {
        width: clamp(150px, 40vh, 250px);
        height: clamp(150px, 40vh, 250px);
    }
}

/* Timer Stats */
.timer-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    animation: fadeIn 1.5s ease forwards;
    transition: opacity 0.3s ease;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-family: var(--font-primary);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
    .timer-stats {
        position: absolute;
        bottom: 22vh;
        margin-top: 0;
        
        /* Centering without transform (to avoid conflict with animation) */
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
        width: max-content;

        padding: 0.5rem 1rem;
        gap: 0.8rem;
        border-radius: 16px;
    }
    
    .stat-value {
        font-size: 0.9rem;
    }
    
    .stat-label {
        font-size: 0.55rem;
    }
}
