:root {
    --primary: rgb(35, 35, 35);
    --secondary: rgb(25, 25, 25);
    --primary-accent: rgb(250, 250, 250);
    --secondary-accent: rgb(150, 150, 150);
    --highlight: rgb(80, 184, 253, 0.75);
    --secondary-highlight: rgba(80, 184, 253, 0.4);
    --filter-btn-border: white;
    --scrollbar: rgba(100, 100, 100, 0.5);
    --scrollbar-hover: rgba(150, 150, 150, 0.8);
    --scrollbar-track: var(--primary);
    --card-box-shadow: rgba(0, 0, 0, 0.3);
    --card-box-shadow-hover: rgba(0, 0, 0, 0.5);
    --card-box-shadow-hover-dev: rgba(0, 0, 0, 0.4);
    --card-dev: #ff0000;
    --card-dev-text: white;
    --card-dev-outline: white;
    --card-new: rgba(144, 238, 144, 0.4);
    --card-new-text: #32CD32;
    --card-new-text-shadow: rgba(0, 0, 0, 0.7);
    --card-new-hover: rgba(144, 238, 144, 0);
    --card-new-no-hover: rgba(144, 238, 144, 0.4);
    --card-new-webkit-text-stroke: black;
    --contact-link: white;
    --contact-link-hover: rgb(80, 184, 253);
    --warning-message: rgba(211, 47, 47, 0.8);
    --warning-message-text: white;
    --migration-banner: rgba(255, 99, 71, 0.8);
    --migration-banner-a-hover: rgba(109, 212, 247, 0.8);
    --random-game-text: white;
    --carousel-slide: white;
    --carousel-content: rgba(0, 0, 0, 0.6);
    --carousel-popular: #ffcc00;
    --carousel-dot: rgba(255, 255, 255, 0.5);
    --carousel-dot-active: white;
    --carousel-progress: rgba(255, 255, 255, 0.3);
    --github-repo-info: #1c1e1f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto Mono", monospace;
}

body {
    background-color: var(--primary);
    color: var(--primary-accent);
    overflow-x: hidden;
    margin: 0;
}

a {
    text-decoration: none;
    color: var(--primary-accent);
}


#filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px auto;
    max-width: 90%;
}

.filter-btn {
    background-color: var(--secondary);
    color: var(--primary-accent);
    border: 2px solid var(--primary-accent);
    padding: 8px 15px; 
    cursor: pointer;
    border-radius: 10px; 
    font-size: 1rem; 
    transition: all 0.3s ease;
    min-width: 100px;
    text-align: center;
    white-space: nowrap; 
}

.filter-btn:hover {
    background-color: var(--secondary-highlight);
    color: var(--filter-btn-border);
    border-color: var(--highlight);
}

.filter-btn.active {
    background-color: var(--highlight);
    color: var(--filter-btn-border);
    border-color: var(--highlight);
}

@media (max-width: 600px) {
    #filter-bar {
        justify-content: center;
    }
}

/*
::-webkit-scrollbar {
    display: none;
}
*/

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px; 
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track); 
    border-radius: 10px;
}



#games-title {
    text-align: center;
    margin-top: 2rem;
    font-size: 2.5rem;
    color: var(--primary-accent);
}

#games-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    margin: 0 auto;
    max-width: 1200px;
}

.ad-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 15px;
    background-color: var(--secondary);
    box-shadow: 2px 2px 8px var(--card-box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: center;
    justify-content: space-between; /* add this to push footer down */
    height: 100%; /* ensure consistent height for spacing */
    position: relative; /* helpful for positioning if needed */
}

.ad-card:hover {
    transform: scale(1.05);
    box-shadow: 4px 4px 12px var(--card-box-shadow-hover);
}

.ad-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.ad-card p {
    font-size: 1rem;
    color: var(--secondary-accent);
    margin: 0;
}

#ad-footer {
    font-size: 0.8rem; /* smaller text */
    color: var(--secondary-accent);
    margin-top: auto; /* pushes to bottom in flex column */
    opacity: 0.7;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 15px;
    background-color: var(--secondary);
    box-shadow: 2px 2px 8px var(--card-box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: center;
}


.game-card:hover {
    transform: scale(1.05);
    box-shadow: 4px 4px 12px var(--card-box-shadow-hover);
}

.game-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.game-card h3 {
    font-size: 1.5rem;
    margin: 10px 0;
    color: var(--primary-accent);
}

.game-card p {
    font-size: 1rem;
    color: var(--secondary-accent);
    margin: 0;
}
/*
#home-button {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 15px;
    background-color: var(--secondary);
    box-shadow: 2px 2px 8px var(--card-box-shadow);
    color: var(--primary-accent);
    font-size: 1.2rem;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

#home-button:hover {
    transform: scale(1.05);
    box-shadow: 4px 4px 12px var(--card-box-shadow-hover);
}

#home-button-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: invert(1); 
}
*/

#games-footer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
    position: relative;
    bottom: 0;
    text-align: center; /* added? */
}

#games-footer-container .container {
    background-color: var(--secondary);
    color: var(--primary-accent);
    box-shadow: 2px 2px 8px var(--card-box-shadow);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    max-width: 800px;
}

#games-footer-container p {
    margin: 0;
    font-size: 1rem;
}

#contact-link {
    text-decoration: underline;
    color: var(--contact-link);
    transition: color 0.3s ease;
}

#contact-link:hover {
    color: var(--contact-link-hover);
}

.container {
    line-height: 1.3;
}

.game-card.under-development {
    position: relative;
    pointer-events: none; /* disables clicks */
}

.game-card.under-development:hover {
    transform: none; /* no hover effects */
    box-shadow: 2px 2px 8px var(--card-box-shadow); /* shadow */
}

.game-card.under-development .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--card-box-shadow-hover-dev); /* dark semi-transparent background */
    border-radius: 15px; /* matches the card's border radius */
    z-index: 2;
    pointer-events: none; /* disables interaction */
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-card.under-development .overlay span {
    position: absolute;
    transform: rotate(-45deg); /* diagonal text */
    background-color: var(--card-dev); /* rectangle colour */
    color: var(--card-dev-text);
    font-size: 1.4rem;
    font-weight: 300; /* text boldness */
    font-family: "Impact", "Arial Black", sans-serif; /* warning-style font */
    padding: 20px 40px;
    border: 3px solid var(--card-dev-outline); /* rectangle outline */
    text-transform: uppercase;
    box-shadow: 4px 4px 10px var(--card-box-shadow-hover);
    text-align: center;
    width: 80%; /* rectangle width */
    max-width: 450px; /* cap the rectangle's width */
}

.game-card {
    position: relative;
    overflow: hidden;
}

.warning-message {
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    background-color: var(--warning-message);
    color: var(--warning-message-text);
    font-size: 1rem; 
    font-weight: bold;
    text-transform: uppercase;
    padding: 12px 20px; 
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--card-box-shadow);
    transform: translateY(-100%); 
    opacity: 0; 
    transition: transform 0.3s ease, opacity 0.3s ease; 
    font-family: "Arial", sans-serif; 
}

.game-card:hover .warning-message {
    transform: translateY(50px); 
    opacity: 1; 
}

.game-card.new-game .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--card-new); /* tint */
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* disables interaction */
    z-index: 2;
    opacity: 1;
    transition: opacity 0.5s ease, background-color 0.5s ease;
}

.game-card.new-game .overlay span {
    font-size: 2rem;
    font-weight: 300;
    font-family: "Impact", "Arial Black", sans-serif;
    color: var(--card-new-text); /* text */
    animation: bounceZoom 1s infinite;
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-shadow: 1px 1px 1px var(--card-new-text-shadow);
    -webkit-text-stroke: 0.7px var(--card-new-webkit-text-stroke);
    background-color: var(--card-box-shadow); /* box background */
    padding: 5px 10px;
    border-radius: 8px;

}


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

.game-card.new-game:hover .overlay {
    background-color: var(--card-new-hover);
    opacity: 0;
}

.game-card.new-game:hover .overlay span {
    opacity: 0;
    transform: scale(1);
}

.game-card.new-game:not(:hover) .overlay {
    background-color: var(--card-new-no-hover);
    opacity: 1;
}

.game-card.new-game:not(:hover) .overlay span {
    opacity: 1;
    animation: bounceZoom 1s infinite;
}

@media screen and (max-width: 600px) {
    #games-title {
        font-size: 2rem;
    }

    .game-card img {
        height: 150px;
    }
}

@keyframes flash {
    0%, 100% {
        opacity: 0.75;
    }
    50% {
        opacity: 1.0;
    }
}

#migration-banner {
    display: none;
    position: fixed;
    top: -120px; /* Start off-screen */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 600px;
    z-index: 1000;
    transition: top 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    background-color: var(--migration-banner);
    color: var(--primary-accent);
    padding: 15px 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px;
    box-shadow: 0 8px 20px var(--card-box-shadow);
    line-height: 1.5;
    font-size: 16px;
    word-break: keep-all;
    animation: flash 2s infinite ease-in-out;
}

.icon {
    font-size: 1.8rem;
    margin-right: 10px;
}

.banner-text {
    flex: 1;
}

#migration-banner a {
    color: var(--primary-accent);
    text-decoration: underline;
    margin: 0 5px;
    white-space: nowrap;
    vertical-align: middle;
    transition: color 0.2s;
}

#migration-banner a:hover {
    color: var(--migration-banner-a-hover)
}

#migration-banner.show {
    display: flex;
    top: 20px;
}

.close-button {
    cursor: pointer;
    font-size: 24px;
    padding: 5px;
    background: transparent;
    border: none;
    color: var(--primary-accent);
    transition: transform 0.2s, opacity 0.2s;
    line-height: 1;
}

.close-button:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

#search-bar-container {
    display: flex;
    justify-content: center;
    margin: 10px auto 20px;
    max-width: 90%;
    flex-wrap: wrap;
}

#search-bar {
    width: calc(100% - 120px);
    max-width: 500px;
    padding: 10px 15px;
    border: 2px solid var(--primary-accent);
    border-radius: 10px;
    background-color: var(--secondary);
    color: var(--primary-accent);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px; 
}

#search-bar::placeholder {
    color: var(--secondary-accent);
}

#search-bar:focus {
    border-color: var(--highlight);
}

#random-game-button {
    max-width: 500px;
    padding: 10px 15px;
    border: 2px solid var(--primary-accent);
    border-radius: 10px;
    background-color: var(--secondary);
    color: var(--primary-accent);
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    height: 44px; /* match search-bar height */
    box-sizing: border-box;
}

#random-game-button:hover {
    background-color: var(--secondary-highlight);
    color: var(--random-game-text);
    border-color: var(--highlight);
}

@media (max-width: 720px) {
    #search-bar {
        width: 100%;
        margin-right: 0;
    }
    #random-game-button {
        width: 100%;
    }
}

#carousel-container {
    padding: 20px;
}

#carousel {
    position: relative;
    max-width: 1159px;
    height: 300px;
    overflow: hidden;
    margin: auto;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

#carousel:hover {
    transform: scale(1.05);
}

.carousel-slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--carousel-slide);
    text-align: left;
}

.carousel-content {
    position: absolute;
    z-index: 2;
    background: var(--carousel-content);
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#carousel-popular {
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--carousel-popular);
}

#carousel-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 5px 0;
    opacity: 0.8;
}

#carousel-description {
    font-size: 1rem;
    opacity: 0.9;
}

#carousel-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.5);
    transition: background-image 1s ease-in-out;
}

#carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    background-color: var(--carousel-dot);
    border-radius: 50%;
    transition: all 0.3s ease-in-out, opacity 0.5s ease-in-out;
    opacity: 0.5;
}

.carousel-dot.active {
    width: 14px;
    height: 14px;
    background-color: var(--carousel-dot-active);
    opacity: 1;
}

#carousel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--carousel-progress);
    overflow: hidden;
}

#carousel-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--carousel-slide);
    transition: width linear;
}

#github-repo-info {
    z-index: 800;;
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--github-repo-info); /* #24292e */
    color: #fff;
    padding: 10px 15px;
    margin-left: 5vmin;
    border-radius: 8px;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    box-shadow: 0 2px 5px var(--card-box-shadow);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.97;
  }
  
  #github-repo-info:hover {
    transform: translateY(-5px);
  }
  
  .repo-link {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
  }
  
  .fork-icon {
    width: 20px;
    height: 20px;
    margin-right: 5px;
  }
  
  .repo-name {
    text-decoration: none;
    color: #fff;
    transition: color 0.3s ease;
  }
  
  .repo-name:hover {
    color: #58a6ff;
  }
  
  .commit-message {
    font-size: 0.9em;
    color: #bbb;
    transition: color 0.3s ease;
  }
  
  .commit-message:hover {
    color: #58a6ff;
  }

  .commit-time {
    font-size: 0.85em;
    color: #888;
    margin-top: 3px;
    transition: color 0.3s ease;
}

    .commit-time:hover {
        color: #58a6ff;
    }

    .new-badge {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #ff4757;
        color: white;
        padding: 8px 16px;
        border-radius: 999px;
        font-weight: bold;
        font-size: 14px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        cursor: pointer;
        z-index: 9999;
        transition: background-color 0.3s;
      }
      
      .new-badge:hover {
        background-color: #e84118;
      }

      .new-badge.hidden {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
      }
      

      #stats-section {
        padding: 20px 20px; 
        display: flex;
        justify-content: center;
        color: #e0e0e0;
        box-sizing: border-box; 
      }
      
      #stats-section .container {
        background-color: var(--secondary);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
        padding: 20px 40px;
        border-radius: 12px;
        max-width: 600px;
        width: 100%;
        box-sizing: border-box; 
      }
      
      
      .stats-container {
        display: flex;
        justify-content: center;
        gap: 40px;
        flex-wrap: nowrap; 
        max-width: 100%;
        overflow-x: auto; 
        text-wrap: nowrap;
      }
      
      .stat {
        width: 180px;
        text-align: center;
      }
      
      .stat h3 {
        font-size: 1.1rem;
        margin-bottom: 6px;
        font-weight: normal;
        color: #b0b0b0;
      }
      
      .stat .count {
        font-size: 1.8rem;
        font-weight: 600;
        color: #00ffcc;
      }
      
      .navbar {
        position: sticky;
        top: 20px;
        z-index: 1000;
        margin: 20px auto;
        max-width: 800px;
        background-color: var(--secondary);
        border-radius: 15px;
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.4);
        padding: 15px 30px;
        transition: all 0.3s ease-in-out;
        backdrop-filter: blur(3px);
        display: flex;
        justify-content: center;
      }
      
      .navbar.scrolled {
        top: 0;
        margin-top: 0;
        border-radius: 0 0 15px 15px;
        padding: 10px 20px;
        background-color: rgba(25, 25, 25, 0.95);
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.5);
      }
      
      .nav-links {
        list-style: none;
        display: flex;
        gap: 30px;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
      }
      
      .nav-item a {
        display: flex;
        flex-direction: row; 
        align-items: center;
        gap: 10px;
        background-color: var(--primary);
        padding: 6px 16px;
        border-radius: 8px;
        transition: all 0.3s ease;
        border: 2px solid transparent;
        font-size: 0.95rem;
        line-height: 1;
      }
      
      
      .nav-icon {
        width: 15px;
        height: 15px;
        transition: transform 0.3s ease;
        flex-shrink: 0;
        border-radius: 3px;
      }
      
      
      .nav-item a:hover {
        background-color: var(--secondary-highlight);
        border: 2px solid var(--highlight);
        box-shadow: 0 0 10px var(--highlight);
        transform: translateY(-2px);
      }
      
      .nav-item a:hover .nav-icon {
        transform: scale(1.2);
      }
      
      
    
      @media (max-width: 830px) {
        .navbar {
            max-width: 95%;
        }
        .nav-links {
          gap: 12px;
        }
      
        .nav-item a {
          padding: 5px 12px;
          font-size: 0.85rem;
          gap: 8px;
          border-radius: 6px;
        }
      
        .nav-icon {
          width: 18px;
          height: 18px;
        }
      }

      @media (max-width: 690px) {
        .navbar {
            max-width: 340px;
        }

        .nav-links {
          gap: 12px;
        }
      
        .nav-item a {
          padding: 5px 12px;
          font-size: 0.85rem;
          gap: 0;
          border-radius: 6px;
          justify-content: center;
        }
      
        .nav-icon {
          width: 18px;
          height: 18px;
        }
      
        .nav-item a span {
          display: none;
        }
      }
      
      
      .modal.hidden {
        display: none;
      }
      
      .modal {
        position: fixed;
        inset: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
      }
      
      .modal-backdrop {
        position: absolute;
        inset: 0;
        backdrop-filter: blur(6px);
        background: var(--card-box-shadow);
      }
      
      .modal-content {
        position: relative;
        background: var(--secondary);
        color: var(--primary-accent);
        border-radius: 20px;
        padding: 30px;
        z-index: 1001;
        width: 90%;
        max-width: 500px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
        border: 2px solid var(--highlight);
      }
      
      .modal-content h2 {
        margin-bottom: 15px;
        font-size: 1.8rem;
        color: var(--highlight);
      }
      
      .modal-content button {
        margin-top: 20px;
        padding: 10px 20px;
        background-color: var(--highlight);
        color: white;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        font-size: 1rem;
        transition: background 0.3s ease;
      }
      
      .modal-content button:hover {
        background-color: var(--secondary-highlight);
      }
      
      .settings-select {
        width: 100%;
        padding: 10px;
        border-radius: 10px;
        border: 2px solid var(--highlight);
        background-color: var(--secondary);
        color: var(--primary-accent);
        font-size: 1rem;
        margin-bottom: 20px;
        transition: border 0.3s ease;
      }
      
      .settings-select:focus {
        outline: none;
        border-color: var(--secondary-highlight);
      }
      