* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

:root {
    --red: #e63946;
    --background: #0d0d0d;
    --card: #171717;
    --text: #ffffff;
    --muted: #aaaaaa;
}

/* BODY */

body {
    min-height: 100vh;
    padding: 20px;

    color: var(--text);
    background: #1a0000 url("assets/OIP.webp") center / cover fixed no-repeat;

    font-family: Arial, Helvetica, sans-serif;
    overflow-x: hidden;
}

   a {
    color: inherit;
    text-decoration: none;
}

.page {
    width: 100%;
    max-width: 1350px;
    min-height: 90vh;
    margin: auto;
    padding: 25px;

    background: var(--background);
    border-radius: 25px;

    position: relative;
    z-index: 1;
}


/* NAVIGATION */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 20px 30px;

    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);

    position: sticky;
    top: 0;
    z-index: 100;

    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.logo {
    color: var(--red);
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 2px;
}

.header nav {
    display: flex;
    gap: 30px;
}

.header nav a {
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
}

.header nav a:hover {
    color: var(--red);
}

      /* HERO SECTION */

.hero {
    max-width: 850px;
    margin: auto;
    padding: 120px 20px 90px;
    text-align: center;
}

.small-heading {
    color: var(--red);
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(42px, 7vw, 75px);
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--red);
}

.hero-text {
    max-width: 600px;
    margin: auto;

    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;

    margin-top: 30px;
}

      
/* BUTTONS */

.button {
    display: inline-block;
    padding: 13px 25px;

    border: 2px solid var(--red);
    border-radius: 7px;

    font-size: 15px;
    font-weight: bold;

    transition: 0.3s;
}

.button.primary {
    background: var(--red);
    color: white;
}

.button.primary:hover {
    background: transparent;
    transform: translateY(-3px);
}

.button.secondary {
    background: transparent;
    color: white;
}

.button.secondary:hover {
    background: var(--red);
    transform: translateY(-3px);
}


/* COMMUNITY STATISTICS */

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;

    max-width: 850px;
    margin: 0 auto 100px;
}

.stat {
    padding: 25px 15px;
    text-align: center;

    background: var(--card);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat h2 {
    color: var(--red);
    font-size: 32px;
    margin-bottom: 8px;
}

.stat p {
    color: var(--muted);
    font-size: 14px;
}


/* SECTION HEADINGS */

.games-section,
.contributors-section,
.about-section,
.contribute-section {
    max-width: 1100px;
    margin: auto;
    padding: 60px 20px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    margin-bottom: 30px;
}

.section-heading h2,
.about-section h2,
.contribute-section h2 {
    font-size: 32px;
    margin-bottom: 12px;
}

.section-heading p:not(.small-heading) {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.text-link {
    color: var(--red);
    font-weight: bold;
    white-space: nowrap;
}

.text-link:hover {
    text-decoration: underline;
}


/* GAME CARDS */

.games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.game {
    min-height: 180px;
    padding: 20px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    position: relative;

    transition: 0.3s;
}

.game:hover {
    border-color: var(--red);
    transform: translateY(-5px);
}

.game h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.game p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.game .play-link {
    display: inline-block;
    color: var(--red);
    font-weight: bold;
    margin-top: 20px;
}

.empty-message {
    grid-column: 1 / -1;
    padding: 35px 20px;

    color: var(--muted);
    text-align: center;

    background: var(--card);
    border-radius: 12px;
}

/* GAME DETAILS */

.game-info {
    width: 100%;
}

.game-author a {
    color: var(--red);
}

.game-author a:hover {
    text-decoration: underline;
}

.game-description {
    margin-top: 12px;
}

/* DEVICES, CONTROLS AND TAGS */

.game-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.game-meta-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.game-meta-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: bold;
    margin-right: 3px;
}

.game-chip {
    display: inline-block;
    padding: 5px 9px;

    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;

    font-size: 11px;
}

/* GAME ACTIONS */

.game-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;

    margin-top: 20px;
}

.game-actions .play-link {
    margin-top: 0;
}

.game .like-link {
    color: var(--muted);
    font-size: 13px;
    font-weight: bold;
}

.game .like-link:hover {
    color: var(--red);
    text-decoration: underline;
}

.like-count {
    color: var(--muted);
    font-size: 12px;
}

/* FIRST CONTRIBUTOR BADGE */

.game.first-contributor-game {
    padding-top: 48px;
}

.game-badge {
    position: absolute;
    top: 12px;
    right: 14px;

    padding: 5px 9px;

    color: var(--red);
    background: rgba(230, 57, 70, 0.12);

    border: 1px solid rgba(230, 57, 70, 0.35);
    border-radius: 20px;

    font-size: 11px;
    font-weight: bold;
}
      
/* CONTRIBUTORS */

.contributors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.contributor {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 22px;

    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;

    transition: 0.3s;
}

.contributor:hover {
    border-color: var(--red);
    transform: translateY(-4px);
}

.contributor h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

.contributor p {
    color: var(--muted);
    font-size: 14px;
}

.contributor a {
    color: var(--red);
}

.contributor img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--red);
    flex-shrink: 0;
}

/* ABOUT SECTION */

.about-section {
    text-align: center;
    max-width: 800px;
}

.about-section h2 {
    margin-bottom: 20px;
}

.about-section p,
.contribute-section p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
}


/* CONTRIBUTION SECTION */

.contribute-section {
    max-width: 850px;
    margin: 40px auto 60px;
    padding: 55px 25px;

    text-align: center;

    background: var(--card);
    border: 1px solid rgba(230, 57, 70, 0.25);
    border-radius: 15px;
}

.contribute-section .button {
    margin-top: 15px;
}

/* FOOTER */

.footer {
    padding: 35px 15px 15px;
    text-align: center;

    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.footer a {
    color: var(--red);
}

.footer a:hover {
    text-decoration: underline;
}

.footer .copyright {
    margin-top: 25px;
    font-size: 12px;
}

.copyright a{
  color: var(--muted);
}

/* RED PARTICLES */

.snow {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.snowflake {
    position: absolute;
    top: -10px;

    background: radial-gradient(
        circle,
        rgba(255, 0, 0, 0.8),
        rgba(120, 0, 0, 0.3)
    );

    border-radius: 50%;
    opacity: 0.7;

    animation: fall linear infinite;
}

@keyframes fall {
    from { transform: translate(0, 0); }
    to   { transform: translate(-100px, 110vh); opacity: 0.2; }
}

.game .like-link:focus-visible,
.game .play-link:focus-visible,
.game .game-author a:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 4px;
}

/* TABLETS */

@media (max-width: 768px) {

    body {
        padding: 12px;
    }

    .page {
        padding: 15px;
        border-radius: 18px;
    }

    .header {
        padding: 18px 12px;
    }

    .logo {
        font-size: 21px;
    }

    .header nav {
        gap: 15px;
    }

    .header nav a {
        font-size: 13px;
    }

    .hero {
        padding: 90px 15px 70px;
    }

  .stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;

    max-width: 560px;
    margin: 0 auto 100px;
}

    .stat h2 {
        font-size: 26px;
    }

    .games-section,
    .contributors-section,
    .about-section,
    .contribute-section {
        padding: 45px 12px;
    }

}


/* MOBILE */

@media (max-width: 500px) {

    body {
        padding: 8px;
    }

    .page {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 18px;
        padding: 18px 10px;
    }

    .header nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 18px;
    }

    .header nav a {
        font-size: 12px;
    }

    .hero {
        padding: 75px 10px 55px;
    }

    .hero-text {
        font-size: 15px;
    }

    .stats {
        gap: 8px;
    }

    .stat {
        padding: 20px 8px;
    }

    .stat h2 {
        font-size: 23px;
    }

    .stat p {
        font-size: 12px;
    }

    .section-heading h2,
    .about-section h2,
    .contribute-section h2 {
        font-size: 26px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .text-link {
        font-size: 12px;
    }

    .games,
    .contributors {
        grid-template-columns: 1fr;
    }

}


/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .snow {
        display: none;
    }

}
