/* ==============================
   Global Styles
   ============================== */
   * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Prevent touch-based scrolling and pinch-zoom on the game canvas */
#gameCanvas {
    touch-action: none;
    background: url('https://www.transparenttextures.com/patterns/asfalt-light.png') repeat, #228B22;
    background-size: 100px 100px; /* Apply the texture to all screen sizes */
    border-radius: 10px;
    border: 2px solid #ffffff; /* White border for both mobile and desktop */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1; /* Base layer */
}

/* Fonts */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
}

h1, h2, h3, .font-press-start {
    font-family: 'Press Start 2P', cursive;
}

/* ==============================
   Card Styling with Depth and 3D Hover Animation
   ============================== */

/* Container for the card to provide 3D perspective */
.card-container {
    perspective: 1000px; /* Gives a 3D effect when rotating the card */
    display: inline-block; /* Ensure the card container fits around the card */
}

/* Update global card size */
.card {
    width: 140px; /* Increased from 120px */
    height: 196px; /* Maintains aspect ratio (1.4) */
    background-color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 255, 255, 0.5),
        0 0 5px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    user-select: none;
    transform-origin: center bottom;
    backdrop-filter: blur(5px);
}

/* Hover effect for cards */
.card:hover {
    transform: translateY(-10px) rotateY(5deg) rotateX(5deg) scale(1.05); /* 3D transformation on hover */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); /* Deeper shadow for hover effect */
}

/* Flip Animation */
.flip-card {
    transform-style: preserve-3d;
    transition: transform 0.6s; /* Smooth flip */
    position: relative;
    width: 100%;
    height: 100%;
}

.flip-card.flipped {
    transform: rotateY(180deg); /* Rotate 180 degrees for the flip effect */
}

.flip-card .front, .flip-card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Hide the back face when flipped */
    border-radius: 4px;
}

.flip-card .back {
    transform: rotateY(180deg); /* Back face starts rotated */
}

/* ==============================
   Specific Design for Foundation Cards
   ============================== */
.foundation .card {
    border: 2px solid #FFD700; /* Gold border to make it stand out */
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3), 0 3px 6px rgba(0, 0, 0, 0.15);
    z-index: 3; /* Above other cards */
    
    /* New styles for background gradients */
    background: linear-gradient(135deg, #f9d423, #ff4e50); /* Example gradient */
    /* You can customize the colors as per your preference */
    
    /* Optional: Add a subtle pattern overlay for added texture */
    /* background-image: url('path-to-your-pattern.png'), linear-gradient(135deg, #f9d423, #ff4e50);
       background-blend-mode: overlay; */
    
    /* Ensure the background covers the entire card */
    background-size: cover;
    background-repeat: no-repeat;
}

/* ==============================
   Unique Backgrounds for Each Foundation Pile
   ============================== */

/* Foundation Pile 1 - Hearts */
.foundation .card:nth-child(1) {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4); /* Soft pink gradient */
}

/* Foundation Pile 2 - Diamonds */
.foundation .card:nth-child(2) {
    background: linear-gradient(135deg, #a18cd1, #fbc2eb); /* Purple-pink gradient */
}

/* Foundation Pile 3 - Clubs */
.foundation .card:nth-child(3) {
    background: linear-gradient(135deg, #89f7fe, #66a6ff); /* Blue gradient */
}

/* Foundation Pile 4 - Spades */
.foundation .card:nth-child(4) {
    background: linear-gradient(135deg, #f093fb, #f5576c); /* Pink-red gradient */
}

/* ============================
   Foundation Highlight on Drop
   ============================ */
@keyframes highlightDrop {
    0% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
        transform: scale(1);
    }
}

.foundation .card-dropped {
    animation: highlightDrop 0.5s ease-out; /* Applies the animation when a card is dropped */
}

/* ==============================
   Canvas and Card Adjustments for Mobile
   ============================== */
@media (max-width: 968px) {
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 375px; /* General mobile */
        max-height: 667px;
        position: relative;
    }

    .stockpile {
        position: absolute;
        left: 15px;
        top: 25px;
    }

    .waste {
        position: absolute;
        left: 165px; /* Adjusted based on new card width */
        top: 25px;
    }

    .foundation {
        position: absolute;
        right: 10px;
        top: 20px;
    }

    .tableau {
        margin-top: 220px; /* Adjusted tableau to accommodate larger cards */
        gap: 20px; /* Increased from 5px */
    }
}

/* iPhone SE adjustments */
@media screen and (max-width: 320px) and (max-height: 568px) {
    #gameCanvas {
        max-width: 320px;
        max-height: 568px;
    }

    .stockpile {
        left: 5px;
        top: 15px;
    }

    .waste {
        left: 100px; /* Adjusted for new card size */
    }

    .foundation {
        right: 5px; /* Adjust right alignment */
        top: 15px;
    }

    .tableau {
        margin-top: 160px; /* Adjusted tableau */
        gap: 10px;
    }
}

/* iPhone 12 Pro adjustments */
@media screen and (min-width: 390px) and (max-width: 430px) {
    #gameCanvas {
        max-width: 390px;
        max-height: 844px; /* iPhone 12 Pro dimensions */
    }

    .stockpile {
        left: 15px;
        top: 25px;
    }

    .waste {
        left: 110px; /* Adjust for larger screen */
    }

    .foundation {
        right: 15px;
        top: 25px;
    }

    .tableau {
        margin-top: 220px;
        gap: 15px;
    }
}

/* Samsung Galaxy S8 adjustments */
@media screen and (min-width: 360px) and (max-width: 412px) {
    #gameCanvas {
        max-width: 360px;
        max-height: 740px; /* Galaxy S8 screen size */
    }

    .stockpile {
        left: 12px;
        top: 18px;
    }

    .waste {
        left: 95px; /* Adjust for screen */
    }

    .foundation {
        right: 12px;
        top: 18px;
    }

    .tableau {
        margin-top: 220px;
        gap: 15px;
    }
}

/* ==============================
   Animation Enhancements
   ============================== */

/* Flip Animation */
@keyframes flip {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

.flip {
    animation: flip 0.6s forwards;
}

/* Pulse Animation for Foundation Cards */
@keyframes pulse {
    0% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
}

.pulse {
    animation: pulse 1.5s infinite;
}

/* ==============================
   Additional Adjustments
   ============================== */

/* Highlight card being dragged */
.dragging {
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
    z-index: 5; /* Above all other elements */
}

/* Highlight valid drop zones */
.valid-drop {
    border: 2px dashed #00ff00;
}

/* ==============================
   Pop-up Message Styles
   ============================== */
.popup {
    background-color: #ffffff; /* White background */
    color: #000000; /* Black text */
    border: 1px solid #ccc; /* Light gray border */
    padding: 20px; /* Space inside the popup */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Shadow for depth */
    position: fixed; /* Fixed position on the screen */
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust to perfectly center */
    z-index: 1000; /* Ensure it's above other elements */
    /* display: none; */ /* Removed to prevent conflict */
    max-width: 90%; /* Responsive width */
    text-align: center; /* Centered text */
}

/* OK Button Styles */
.popup-button {
    margin-top: 20px; /* Space above the button */
    padding: 10px 20px; /* Button padding */
    background-color: #4CAF50; /* Green background */
    color: white; /* White text */
    border: none; /* No border */
    border-radius: 5px; /* Rounded corners */
    cursor: pointer; /* Pointer cursor on hover */
    font-size: 16px; /* Font size */
}

.popup-button:hover {
    background-color: #45a049; /* Darker green on hover */
}

/* Hidden Class to Hide Elements */
.hidden {
    display: none; /* Completely hides the element */
}

/* ==============================
   Desktop-Specific Styles
   ============================== */

@media (min-width: 768px) {
    /* Position the controlButtons container above the game canvas */
    .game-container {
        position: relative; /* Establish a positioning context */
    }

    #controlButtons {
        position: absolute; /* Position absolutely within the game-container */
        top: 10px; /* Adjust this value to move buttons higher or lower */
        right: 50%; /* Center horizontally */
        transform: translateX(50%); /* Center alignment */
    }

    #controlButtons {
        margin-bottom: 0; /* Remove bottom margin */
    }
}


/* Buttons should stay visible below the canvas */
#controlButtons {
    margin-top: 10px;  /* Ensure some space between the canvas and buttons */
    position: relative;
    z-index: 2;  /* Keep them above the canvas */
    display: flex;
    justify-content: center;  /* Center buttons horizontally */
}

/* Adjust button size for desktop */
#controlButtons button {
    font-size: 16px;  /* Increase button font size */
    padding: 10px 20px;  /* Adjust padding for bigger buttons */
}

/* On mobile, make sure buttons are accessible and positioned well */
@media (max-width: 768px) {
    #controlButtons {
        position: static;  /* Allow normal flow in mobile layout */
        margin-top: 20px;  /* Add spacing on mobile as well */
    }

    #controlButtons button {
        font-size: 14px;  /* Smaller buttons on mobile */
        padding: 8px 16px;
    }
}

/* Game Stats Styling */
#gameStats {
    display: flex;
    justify-content: center;
    gap: 20px;
}

#timerDisplay,
#movesDisplay,
#scoreDisplay,
#highScoreDisplay {
    font-family: 'Roboto', sans-serif !important;
    font-size: 16px !important;
    color: white !important;
    font-weight: bold !important;
}

/* Game Title */
.game-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 20px;
    color: #fff;
    text-align: center;
    margin: 5px 0;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.3);
}


/* Adjust Game Canvas */
.canvas-container {
    flex-grow: 1;
    width: 100%;
    max-width: 1000px; /* Max width for desktop canvas */
    height: auto;
    position: relative; /* Allows for control buttons to be positioned relative */
    padding-bottom: 80px; /* Add space below the tableau */
}

#statsOverlay {
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Header and Stats Styling */
.solitaire-header {
    text-align: center;
    margin: 5px 0;
    padding: 0;
    font-size: 24px;
    font-family: 'Press Start 2P', cursive;
    color: #000;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
}

/* Game Stats Container */
#gameStats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 5px 0;
    margin: 0;
    border-radius: 4px;
}

/* Individual Stat Items */
#timerDisplay,
#movesDisplay,
#scoreDisplay,
#highScoreDisplay {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: #000;
    padding: 5px;
    margin: 0;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .solitaire-header {
        font-size: 20px;
    }
    
    #timerDisplay,
    #movesDisplay,
    #scoreDisplay,
    #highScoreDisplay {
        font-size: 10px;
    }
}
/* Override Game Stats Styling */
#gameStats div,
#timerDisplay,
#movesDisplay,
#scoreDisplay,
#highScoreDisplay {
    font-family: 'Roboto', sans-serif !important;
    font-size: 18px !important;
    color: white !important;
    font-weight: bold !important;
    text-shadow: none !important;
}

.achievement-item {
    transform: translateY(0);
    transition: transform 0.2s ease-in-out;
}

.achievement-item:hover {
    transform: translateY(-2px);
}

.achievement-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.5s ease-out;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
    font-size: 24px;
}

.achievement-text {
    display: flex;
    flex-direction: column;
}

.achievement-title {
    font-size: 12px;
    color: #ffd700;
}

.achievement-name {
    font-size: 16px;
    font-weight: bold;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Achievement Card Styles */
/* Achievement card base styles */
.achievement-card {
    transition: all 0.3s ease;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
}

/* Unlocked achievement styles */
.achievement-earned {
    background: linear-gradient(to right, #dcfce7, #bbf7d0);
    border: 2px solid #4ade80;
    transform: scale(1);
    opacity: 1;
}

.achievement-earned:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.2);
}

/* Locked achievement styles */
.achievement-locked {
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    opacity: 0.6;
    filter: grayscale(1);
}

.achievement-locked:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Progress Bar Animation */
@keyframes progressFill {
    from { width: 0; }
    to { width: var(--progress-width); }
}

#progressBar {
    animation: progressFill 1s ease-out forwards;
}

/* Achievement status indicators */
.achievement-earned {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.achievement-locked {
    background-color: rgba(229, 231, 235, 0.5);
    border-color: rgba(229, 231, 235, 0.8);
}

#achievementsOverlay {
    /* Keep existing styles and add/update these */
    overflow: hidden; /* Hide overflow on the overlay */
    background-color: rgba(0, 0, 0, 0.75);
    color: black; /* Set text color to black if background is light */
}

#achievementsList {
    /* Add these new styles */
    max-height: 70vh; /* Take up 70% of the viewport height */
    overflow-y: auto; /* Enable vertical scrolling */
    padding-right: 16px; /* Add padding for scrollbar */
    scroll-behavior: smooth; /* Enable smooth scrolling */
}

/* Add styles for the scrollbar */
#achievementsList::-webkit-scrollbar {
    width: 8px;
}

#achievementsList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#achievementsList::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#achievementsList::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dropdown menu */
.dropdown-menu {
    display: none;
    min-width: 180px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* Smooth animation for arrow */
.dropdown button svg {
    transition: transform 0.2s ease-in-out;
}

.dropdown:hover button svg {
    transform: rotate(180deg);
}

/* Active state for current game type */
.dropdown-menu a.active {
    background-color: #f3f4f6;
}

/* Ensure dropdown is always on top */
.dropdown {
    position: relative;
    z-index: 50;
}

/* Add to style.css */

/* Info Pages Specific Styles */
.info-page {
    min-height: 100vh;
    background: url('https://www.transparenttextures.com/patterns/asfalt-light.png') repeat, #228B22;
    background-size: 100px 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.info-header {
    width: 100%;
    max-width: 800px;
    margin-bottom: 2rem;
}

.info-nav {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.info-nav__link {
    color: white;
    text-decoration: none;
    font-family: 'Press Start 2P', cursive;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.info-title {
    font-family: 'Press Start 2P', cursive;
    color: white;
    text-align: center;
    margin: 2rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.info-content {
    width: 90%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-section__title {
    font-family: 'Press Start 2P', cursive;
    color: #228B22;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.info-section__text {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    margin-bottom: 1.5rem;
}

.info-section__list {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-footer {
    width: 100%;
    text-align: center;
    margin-top: auto;
    padding: 2rem 0;
}

.info-footer__nav {
    margin-bottom: 1rem;
}

.info-footer__link {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
}

.info-footer__copy {
    color: white;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .info-content {
        width: 95%;
        padding: 1rem;
    }
    
    .info-title {
        font-size: 1.2rem;
    }
    
    .info-nav__link {
        display: block;
        margin: 0.5rem 0;
    }
}

/* Add to style.css */

/* Contact Page Specific Styles */
.contact-page .info-section {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

.contact-page .info-section__text {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 3rem;
    text-align: center;
}

/* Reset alignment for other pages */
.info-section {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.info-section__text {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 2rem;
    text-align: left;
}

.achievement-div {
    background-color: #f0f0f0; /* Light background for achievements */
    color: #333; /* Dark text color */
}

.stats-button {
    padding: 0.5rem 1rem;
    background-color: #15803d;
    color: white;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
}

.stats-button:hover {
    background-color: #16a34a;
}

/* Share Button */
.share-button {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #3182ce;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.share-button:hover {
    background-color: #2c5282;
}

/* Retro Gaming Style for All Games Page */

:root {
    --primary-color: #00ccff;
    --secondary-color: #ff00aa;
    --accent-color: #FFD700;
    --dark-bg: #121212;
    --glow-neon-cyan: 0 0 10px rgba(0, 204, 255, 0.7), 0 0 20px rgba(0, 204, 255, 0.4);
    --glow-neon-pink: 0 0 10px rgba(255, 0, 170, 0.7), 0 0 20px rgba(255, 0, 170, 0.4);
    --glow-neon-yellow: 0 0 10px rgba(255, 215, 0, 0.7), 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Base styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--dark-bg);
    color: white;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.font-game, h1, h2, h3, .retro-title, .category-btn, .play-now-btn {
    font-family: 'Press Start 2P', cursive;
}

/* Retro style background */
.retro-bg {
    background: linear-gradient(135deg, #000 0%, #0f172a 50%, #000 100%);
}

/* Grid overlay */
.grid-overlay {
    background-image: 
        linear-gradient(rgba(0, 204, 255, 0.1) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(0, 204, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    perspective: 1000px;
    transform: rotateX(60deg) translateZ(-100px) scale(2.5);
    transform-origin: center bottom;
    animation: gridPulse 20s infinite linear;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.2; }
}

/* Navigation */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.shadow-neon {
    box-shadow: 0 4px 20px rgba(0, 204, 255, 0.3);
    background: rgba(0, 0, 0, 0.8);
}

/* Mobile menu */
.retro-link {
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0;
    transition: all 0.3s;
    position: relative;
    padding-left: 1.2rem;
}

.retro-link::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    animation: blink 1s infinite;
}

.retro-link:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Retro Title */
.retro-title {
    color: var(--primary-color);
    text-shadow: var(--glow-neon-cyan);
    letter-spacing: 0.1em;
}

/* Adding styles for the hero banner image */

/* Ensure the hero section has proper height for the banner */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7));
    border-bottom: 2px solid var(--primary-color);
    position: relative;
    min-height: 40vh;
    overflow: hidden;
}

/* Style for the banner image container */
.hero-section .banner-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Style for the banner overlay to ensure text readability */
.hero-section .banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.5));
    z-index: 1;
}

/* Enhance the retro title glow against the banner */
.retro-title {
    color: var(--primary-color);
    text-shadow: var(--glow-neon-cyan), 0 0 15px rgba(0, 204, 255, 0.8);
    letter-spacing: 0.1em;
    position: relative;
    display: inline-block;
}

.glitch {
    position: relative;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--secondary-color);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-color);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(71% 0 10% 0); }
    20% { clip-path: inset(29% 0 36% 0); }
    40% { clip-path: inset(94% 0 3% 0); }
    60% { clip-path: inset(58% 0 33% 0); }
    80% { clip-path: inset(23% 0 69% 0); }
    100% { clip-path: inset(91% 0 8% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(15% 0 66% 0); }
    20% { clip-path: inset(79% 0 16% 0); }
    40% { clip-path: inset(26% 0 62% 0); }
    60% { clip-path: inset(72% 0 4% 0); }
    80% { clip-path: inset(67% 0 27% 0); }
    100% { clip-path: inset(33% 0 46% 0); }
}

/* Pixel divider */
.pixel-divider {
    height: 4px;
    width: 200px;
    background: repeating-linear-gradient(90deg, var(--primary-color), var(--primary-color) 8px, transparent 8px, transparent 12px);
    animation: colorPulse 3s infinite alternate;
}

@keyframes colorPulse {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(90deg); }
}

/* Hero section */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7));
    border-bottom: 2px solid var(--primary-color);
}

/* Filter section */
.arcade-cabinet {
    background: #232323;
    border: 3px solid var(--accent-color);
    box-shadow: 
        0 0 0 1px #000, 
        0 0 0 4px var(--accent-color),
        var(--glow-neon-yellow);
}

.cabinet-screen {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #444;
}

.category-btn {
    background: linear-gradient(to bottom, #444, #222);
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.category-btn:hover {
    background: linear-gradient(to bottom, #555, #333);
    transform: translateY(-2px);
    box-shadow: var(--glow-neon-cyan);
}

.category-btn.active {
    background: linear-gradient(to bottom, var(--primary-color), #0099cc);
    color: black;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--glow-neon-cyan);
}

/* Game Cards */
.games-grid {
    margin-top: 2rem;
}

.game-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.game-card:hover {
    transform: translateY(-10px);
}

.card-inner {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.game-card:hover .card-inner {
    box-shadow: var(--glow-neon-cyan);
}

.card-header {
    background: linear-gradient(to right, #000, #0a1929, #000);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--primary-color);
}

.card-title {
    color: var(--primary-color);
    font-size: 0.8rem;
    margin: 0;
    text-shadow: 0 0 5px rgba(0, 204, 255, 0.5);
}

.card-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    transition: transform 0.5s;
}

.game-card:hover .card-image img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.game-card:hover .card-overlay {
    transform: translateY(0);
}

.overlay-text {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.play-now-btn {
    display: inline-block;
    background: linear-gradient(45deg, var(--secondary-color), #ff3dc8);
    color: white;
    font-size: 0.7rem;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.game-card:hover .play-now-btn {
    animation: pulseBtn 1.5s infinite;
}

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

/* Difficulty badges */
.difficulty-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: black;
    font-weight: bold;
}

.easy {
    background-color: #4CAF50;
}

.medium {
    background-color: #FF9800;
}

.hard {
    background-color: #F44336;
}

/* New tag */
.new-tag {
    position: absolute;
    top: 10px;
    right: -30px;
    background: linear-gradient(45deg, #ff5e00, #ffb700);
    color: white;
    padding: 0.3rem 2rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    transform: rotate(45deg);
    animation: pulse-new 1.5s infinite;
}

@keyframes pulse-new {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* Floating elements */
.pixel-art {
    position: fixed;
    font-size: 2rem;
    z-index: 1;
    animation: float 3s infinite ease-in-out alternate;
    opacity: 0.4;
    pointer-events: none;
}

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

/* Make sure new-tag is styled properly for new games like Pac-Man */
.new-tag {
    display: inline-block;
    background: linear-gradient(45deg, var(--secondary-color), #ff3dc8);
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 0.5rem;
    animation: pulse-tag 1.5s infinite;
}

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

/* Ensure consistent card sizing across all game types */
.game-card {
    display: flex;
    flex-direction: column;
    background-color: var(--dark-bg-alt, #0f0f22);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.game-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Ensure Pac-Man image displays properly */
.game-thumbnail img[alt="Pac-Man"] {
    object-fit: cover;
    object-position: center;
}

/* NEW! corner badge for game cards */
.new-tag {
    position: absolute;
    top: 10px;
    right: -28px;
    z-index: 10;
    background: linear-gradient(45deg, #ffb700, #ff5e00 80%);
    color: #222;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 6px 32px 6px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25), 0 0 0 3px #fff8;
    transform: rotate(20deg);
    letter-spacing: 1px;
    text-shadow: 0 1px 2px #fff, 0 0 6px #ffb70099;
    pointer-events: none;
    /* Animation for attention */
    animation: pulse-new 1.5s infinite;
}

@keyframes pulse-new {
    0%, 100% { opacity: 0.95; transform: rotate(20deg) scale(1); }
    50% { opacity: 1; transform: rotate(20deg) scale(1.08); }
}

/* Game Card Standardization */
.game-card {
    height: 100%;
}

.game-card .card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card .card-image {
    height: 160px; /* Standardized height for all game images */
    overflow: hidden;
    position: relative;
}

.game-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.game-card .card-header {
    height: 60px; /* Standardized header height */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.game-card .card-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}
