/* Zenorix Onam Offer Challenge - Clean Minimal Design */

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333333;
    line-height: 1.6;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Game Header */
.game-header {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 4px;
}

.header-content p {
    font-size: 0.95rem;
    color: #666666;
    font-weight: 400;
    margin-bottom: 12px;
}

.countdown-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #856404;
}

.countdown-icon {
    font-size: 1rem;
}

.countdown-text {
    font-size: 0.85rem;
    font-weight: 500;
}

#gameCountdown {
    font-weight: 600;
    color: #d63384;
}

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

.rules-btn {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.rules-btn:hover {
    background: #e9ecef;
    color: #333333;
}

.instagram-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.instagram-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #ffffff;
}

.game-stats {
    display: flex;
    gap: 24px;
}

.stat-item {
    text-align: center;
    min-width: 70px;
}

.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

#timer, #movesLeft, #offersUnlocked {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111111;
}

/* Game Grid */
.game-grid-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 8px;
    max-width: 600px;
    max-height: 600px;
    width: 100%;
    aspect-ratio: 1;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.memory-card {
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    transform-style: preserve-3d;
    border: 1px solid #e5e5e5;
}

.memory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.card-back {
    background: #f8f9fa;
    color: #666666;
    border: 1px solid #e5e5e5;
    font-size: 1rem;
}

.card-front {
    background: #ffffff;
    border: 1px solid #ddd;
    transform: rotateY(180deg);
    color: #333;
    font-size: 1.2rem;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    animation: matchedPulse 0.4s ease-out;
    opacity: 0.6;
    pointer-events: none;
}

.memory-card.matched .card-front {
    background: #f0f9ff;
    border-color: #0ea5e9;
    color: #0ea5e9;
}

/* Service Icons */
.service-icon {
    font-size: 1.5rem;
}

/* Available Offers Section */
.offers-section {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-top: 20px;
}

.offers-header {
    text-align: center;
    margin-bottom: 24px;
}

.offers-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 8px;
}

.offers-header p {
    font-size: 0.9rem;
    color: #666666;
    margin: 0;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.offer-card {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.offer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.offer-card.unlocked {
    background: #e7f3ff;
    border-color: #0ea5e9;
}

.offer-card.unlocked::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #0ea5e9;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.offer-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.offer-details {
    flex: 1;
}

.offer-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 4px;
}

.offer-discount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 4px;
}

.offer-code {
    font-size: 0.8rem;
    color: #666666;
    font-family: 'Courier New', monospace;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: inline-block;
}

.offer-status {
    font-size: 0.75rem;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Game Rules Popup */
.rules-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.rules-popup.hidden {
    opacity: 0;
    pointer-events: none;
}

.rules-content {
    text-align: left;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.rule-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.rule-item p {
    margin: 0;
    color: #333333;
    font-size: 0.9rem;
    line-height: 1.5;
}

.moves-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
    color: #856404;
    font-size: 0.9rem;
}

/* Offer Popup */
.offer-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.offer-popup.hidden {
    opacity: 0;
    pointer-events: none;
}

.popup-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 480px;
    width: 90%;
    animation: popupSlide 0.3s ease-out;
}

.popup-header {
    padding: 24px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111111;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #666666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: #f3f4f6;
}

.popup-body {
    padding: 24px;
    text-align: center;
}

.popup-body h3 {
    color: #111111;
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 600;
}

.popup-body p {
    color: #666666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.contact-instruction {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    border: 1px solid #e5e5e5;
}

.contact-instruction p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.contact-instruction p:last-child {
    margin-bottom: 0;
}

.offer-validity {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.validity-icon {
    font-size: 0.9rem;
    margin-right: 4px;
}

.validity-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: #0066cc;
    display: flex;
    align-items: center;
}

.expires-date {
    font-size: 0.8rem;
    color: #666666;
    font-weight: 600;
    margin-top: 2px;
}

.offer-code {
    background: #111111;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin-top: 12px;
    display: inline-block;
}

.popup-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    justify-content: center;
}

.continue-btn {
    background: #111111;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.continue-btn:hover {
    background: #333333;
}

/* Game Over Screen */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.game-over.hidden {
    opacity: 0;
    pointer-events: none;
}

.gameover-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 400px;
    width: 90%;
    animation: popupSlide 0.3s ease-out;
}

.gameover-content h2 {
    color: #111111;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.gameover-content p {
    color: #666666;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.final-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
    gap: 16px;
}

.stat {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    flex: 1;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #666666;
    margin-bottom: 4px;
    font-weight: 500;
}

#finalTime, #finalOffers {
    display: block;
    font-size: 1.1rem;
    color: #111111;
    font-weight: 600;
}

.play-again-btn {
    background: #111111;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.play-again-btn:hover {
    background: #333333;
}

/* Animations */
@keyframes matchedPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

/* Instagram Floating Button */
.instagram-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff;
    border-radius: 50px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 999;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    max-width: 200px;
    animation: floating 3s ease-in-out infinite;
}

.instagram-floating-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    color: #ffffff;
}

.instagram-floating-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.instagram-floating-btn .username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 16px;
        gap: 20px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .countdown-warning {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
    
    .countdown-text {
        font-size: 0.8rem;
    }
    
    .header-buttons {
        gap: 8px;
    }
    
    .game-stats {
        gap: 16px;
    }
    
    .game-grid {
        max-width: 400px;
        max-height: 400px;
        gap: 4px;
        padding: 12px;
    }
    
    .memory-card {
        border-radius: 4px;
    }
    
    .card-face {
        font-size: 0.9rem;
    }
    
    .service-icon {
        font-size: 1.2rem;
    }
    
    .popup-content {
        width: 95%;
    }
    
    .rules-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .instagram-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .rule-item {
        padding: 10px;
        gap: 10px;
    }
    
    .rule-icon {
        font-size: 1rem;
    }
    
    .rule-item p {
        font-size: 0.85rem;
    }
    
    .instagram-floating-btn {
        bottom: 18px;
        right: 18px;
        padding: 11px 14px;
        font-size: 0.8rem;
    }
    
    .instagram-floating-btn svg {
        width: 19px;
        height: 19px;
    }
    
    .instagram-floating-btn .username {
        display: none;
    }
}

@media (max-width: 480px) {
    .game-grid {
        max-width: 320px;
        max-height: 320px;
        gap: 2px;
        padding: 8px;
    }
    
    .service-icon {
        font-size: 1rem;
    }
    
    .card-face {
        font-size: 0.8rem;
    }
    
    .header-content h1 {
        font-size: 1.25rem;
    }
    
    .header-content p {
        font-size: 0.85rem;
    }
    
    .header-buttons {
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }
    
    .rules-btn,
    .instagram-btn {
        width: 100%;
        text-align: center;
    }
    
    .offer-validity {
        padding: 6px 10px;
    }
    
    .validity-text {
        font-size: 0.8rem;
    }
    
    .expires-date {
        font-size: 0.75rem;
    }
    
    .offers-section {
        padding: 16px;
    }
    
    .offers-header h2 {
        font-size: 1.25rem;
    }
    
    .offers-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .offer-card {
        padding: 12px;
        gap: 10px;
    }
    
    .offer-icon {
        font-size: 1.5rem;
    }
    
    .offer-title {
        font-size: 0.9rem;
    }
    
    .offer-discount {
        font-size: 1rem;
    }
    
    .instagram-floating-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 12px;
        font-size: 0.75rem;
        border-radius: 40px;
    }
    
    .instagram-floating-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .instagram-floating-btn .username {
        display: none;
    }
}