body {
    font-family: 'Jersey 20', Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    line-height: 1.6;
    font-size: 22px; /* Base font size */
    position: relative;
    z-index: 1;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top, rgba(255, 51, 102, 0.2), transparent 70%);
    animation: pulse-glow 10s infinite alternate;
    z-index: -1;
}

@keyframes pulse-glow {
    from {
        opacity: 0.5;
    }
    to {
        opacity: 1;
    }
}

h1, h2, h3 {
    font-family: 'Jersey 20', Arial, sans-serif;
}

header {
    position: relative; /* Needed for absolute positioning context */
    z-index: 20;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end; /* Push right content to the edge */
    align-items: center;
    padding: 1rem 2rem;
    background-color: transparent;
}

.logo a {
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex; /* Ensure its children are also in a row */
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-left {
    justify-content: flex-start;
}

.nav-right {
    justify-content: flex-end;
}

.nav-links a {
    color: #ffffff;
    text-decoration: underline;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #ffa500;
}

.hamburger-menu {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #ffffff;
    transition: all 0.3s ease-in-out;
}

main {
    padding: 2rem;
}

section {
    padding: 3rem 0;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-wrapper {
    display: flex;
    align-items: center; /* Revert to center for a predictable base */
    justify-content: center;
    min-height: calc(var(--vh, 1vh) * 90); /* Fallback to 90vh */
    box-sizing: border-box; /* Ensure padding is included in the element's total height */
}

#hero {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end; /* Align all items to the bottom */
    gap: 1rem;
    width: 100%;
    padding: 2rem 0; /* Keep some padding */
    max-width: 100%;
}

.fighter-container {
    text-align: center;
    position: relative;
    width: 30vw;
    height: calc(var(--vh, 1vh) * 45); /* Fallback to 45vh */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align content to the bottom */
    min-width: 150px;
    align-self: end;
}

.fighter-container.fighter-left {
    justify-self: end;
}
.fighter-container.fighter-right {
    justify-self: start;
}

.fighter-left, .fighter-right {
    max-height: 100%; /* Fill the container's height */
    max-width: 100%; /* Fill the container's width */
    object-fit: contain;
    image-rendering: pixelated;
}

.fighter-right {
    transform: scaleX(-1);
}

.hero-content {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-logo-container {
    display: grid;
    place-items: center;
    margin-bottom: 1.5rem;
}

.game-logo-title,
.game-logo-fire {
    grid-area: 1 / 1; /* Place both images in the same grid cell */
}

.game-logo-title {
    width: 90%;
    max-width: 400px;
    object-fit: contain;
    z-index: 2; /* Title is on top */
    transform: translateY(65px); /* Move the title down */
}

.game-logo-fire {
    width: 175px;
    height: 175px;
    z-index: 1; /* Fire is behind the title */
}

#hero .subtitle {
    font-size: 2rem;
    font-family: 'Jersey 20', Arial, sans-serif;
    margin-bottom: 1.5rem;
}

.play-button-main {
    font-family: 'Jersey 20', Arial, sans-serif;
    text-decoration: none;
    color: #121212;
    background-color: #ffa500;
    padding: 1rem 2rem;
    border-radius: 5px;
    font-size: 1.5rem;
    margin-top: 1rem;
    display: inline-block;
    transition: background-color 0.3s;
}

.play-button-main:hover {
    background-color: #cc8400;
}

h2 {
    font-size: 2.5rem;
    color: #ffa500;
    margin-bottom: 2rem;
}

.features-grid, .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: left;
    margin-top: 2rem; /* Add some space below the title */
}

.feature-item, .team-member {
    background: #1f1f1f;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #ff4500;
}

#roadmap ul {
    list-style: none;
    padding: 0;
    display: inline-block;
    text-align: left;
}

#roadmap li {
    background: #1f1f1f;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    background-color: #1f1f1f;
    border-top: 1px solid #333;
}

@media (max-width: 768px) {
    .hero-wrapper {
        transform: translateY(-100px);
    }

    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #hero {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        justify-items: center;
    }

    #hero h1 {
        font-size: 2.5rem;
    }

    .hero-content {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
        max-width: 90%;
        padding-bottom: 5rem;
    }

    .fighter-container {
        width: auto;
        height: auto;
        align-self: end;
    }

    .fighter-container-left {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        justify-self: end;
        /* margin-right: -2rem; */
    }

    .fighter-container-right {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        justify-self: start;
        /* margin-left: -2rem; */
    }

    .fighter-left, .fighter-right {
        max-height: 200px;
    }

    #hero .subtitle {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    /* Revert to a simpler layout for centering */
    .title-container {
        position: relative; /* Needed for absolute positioning of the child */
        display: inline-block; /* Allows centering via text-align on the parent */
    }

    .title-container h2 {
        margin-bottom: 0;
    }

    /* Position the animation on top of the title, centered */
    .scroll-animation {
        position: absolute;
        top: 50%;
        left: -120px; /* Position against the left edge of the container */
        transform: translate(-80%, -50%) scale(0.3); /* Move it 80% of its own width to the left */
        opacity: 0;
        width: 120px; /* Adjust size */
        height: 120px;
        transition: transform 0.4s ease-out, opacity 0.4s ease-out;
        z-index: 3; /* Ensure it's on top of the title */
        pointer-events: none; /* Don't block the text */
        margin-right: 0;
    }

    .scroll-animation.animate {
        transform: translate(-80%, -50%) scale(1);
        opacity: 1;
    }

    .scroll-animation.fade-out {
        opacity: 0;
        transform: translate(-80%, -50%) scale(0.3);
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #1f1f1f;
        text-align: center;
        padding: 1rem 0;
        border-top: 2px solid #ff4500;
    }

    .nav-links.active {
        display: flex;
    }

    .logo {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .hamburger-menu {
        display: block;
        margin-right: 1rem; /* Add some spacing from the edge */
        z-index: 1001; /* Ensure hamburger is on top of nav links */
        position: relative;
    }

    /* Animation for hamburger to "X" */
    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    header {
        justify-content: flex-end; /* Push hamburger to the right */
    }

    .nav-center, .nav-right {
        display: none; /* Hide both navs on mobile by default */
    }

    /* Combined mobile navigation container */
    #mobile-nav-container {
        display: none; /* Hidden by default on all screen sizes */
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background-color: #1f1f1f;
        flex-direction: column;
        text-align: center;
        padding-top: 6rem; /* Space for header */
        padding-bottom: 2rem;
        border-bottom: 2px solid #ff4500;
        z-index: 1000;
    }

    #mobile-nav-container.active {
        display: flex;
    }

    #mobile-nav-container a {
        color: #ffffff;
        text-decoration: underline;
        font-size: 1.5rem;
        padding: 0.5rem 0;
    }

    /* On mobile, make the fire next to the play button always visible */
    .pixel-button-container .fire-hover {
        opacity: 1;
    }
}

/* Pixel Button Styles from the game */
.pixel-button-container {
  position: relative;
  cursor: pointer;
  width: 280px; /* Default width */
  height: 60px; /* Default height */
  text-decoration: none;
  /* Add flex to center the actual button content since fire images are absolute */
  display: flex;
  justify-content: center;
  align-items: center;
}

.fire-hover {
    position: absolute;
    height: 50px; /* Make them smaller */
    opacity: 0; /* Hide them by default */
    transition: opacity 0.2s ease-in-out;
    pointer-events: none; /* Prevent them from interfering with clicks */
}

.fire-left {
    right: 105%; /* Position to the left of the button */
}

.fire-right {
    left: 105%; /* Position to the right of the button */
    transform: scaleX(-1); /* Flip it to face outwards */
}

.pixel-button-container:hover .fire-hover {
    opacity: 1; /* Show on hover */
}

.pixel-button-container:hover .pixel-button-outer {
    background-color: #CC2952; /* Accent Muted from theme */
}

.pixel-button-container:hover .pixel-button-inner {
    background-color: #FF4D7F; /* Accent Hover from theme */
}

.pixel-button-outer {
  width: 100%;
  height: 100%;
  background: #B00245; /* Accent Soft from theme */
  image-rendering: pixelated;
  padding: 4px;
  transition: background-color 0.3s;
  clip-path: polygon(0% 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0%, calc(100% - 6px) 0%, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0% calc(100% - 6px));
}

.pixel-button-inner {
  height: 100%;
  width: 100%;
  background: #FF3366; /* Accent Default from theme */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF; /* Text Default from theme */
  font-family: 'Jersey 20', Arial, sans-serif;
  font-size: 1.5rem;
  padding: 0px;
  transition: background-color 0.3s;
  clip-path: polygon(0% 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0%, calc(100% - 6px) 0%, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0% calc(100% - 6px));
}

/* Rain Effect Styles */
#rain-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10; /* Make sure rain is on top of other elements but below any potential modals */
  overflow: hidden;
}

.raindrop {
    position: absolute;
    bottom: 100%;
    animation: fall linear infinite;
    transform: translateY(calc(var(--vh, 1vh) * 110)); /* Fallback to 110vh */
}

/* Raindrop Animation */
@keyframes fall {
    0% {
      transform: translateY(0);
      opacity: 1;
    }
    100% {
      transform: translateY(110vh); /* Fall through the entire viewport height */
      opacity: 0.3;
    }
}

/* Scroll-triggered animation styles */
.title-container {
    position: relative;
    display: inline-block; /* To wrap the h2 content */
}

.scroll-animation {
    position: absolute;
    top: 50%;
    right: 100%; /* Position it to the left of the title container */
    width: 200px;
    transform: translateY(-50%) scale(0.3);
    margin-right: 20px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    z-index: -1;
}

.scroll-animation.animate {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.scroll-animation.fade-out {
    opacity: 0;
    transform: translateY(-50%) scale(0.3);
    transition: all 0.4s ease-out;
}

/* This is now handled in the main media query block above. */
/* @media (max-width: 768px) {
    .scroll-animation {
        width: 120px;
        margin-right: 10px;
    }
}  */

#contact .contact-links {
    margin-top: 2rem;
}

#contact .contact-links p {
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

#contact .contact-links a {
    color: #ffa500;
    text-decoration: underline;
    transition: color 0.3s;
}

#contact .contact-links a:hover {
    color: #ffffff;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-item {
    background-color: #1a1a1a;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-left: 5px solid #ff4500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.feature-item h3 {
    min-height: 3.2em; /* Accommodate two lines of text */
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Leaderboard Section */
#leaderboard-section {
    padding: 4rem 2rem;
    text-align: center;
}

#leaderboard-section h2 {
    font-size: 2.5em; /* Match game style */
    margin-bottom: 2rem;
}

#leaderboard-container {
    max-width: 450px; /* Closer to game width */
    margin: 0 auto;
    background-color: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.leaderboard-summary-card {
    background-color: #262626;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

.summary-info h3 {
    margin: 0;
    color: #c5c5c4;
    font-size: 1.2em;
    font-weight: normal;
}

.summary-trophy img {
    width: 60px;
    height: auto;
}

#leaderboard-table-container {
    position: relative;
    min-height: 300px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1rem;
}

.leaderboard-loader {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #ff4500;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -20px;
    margin-left: -20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#leaderboard-table th, 
#leaderboard-table td {
    padding: 0.5rem;
    text-align: left;
    border: none;
    color: #c5c5c4;
}

#leaderboard-table thead tr {
    border-bottom: 1px solid #333;
}

#leaderboard-table th {
    font-size: 0.9em;
    text-transform: uppercase;
}

#leaderboard-table td {
    font-size: 0.9em;
    font-family: inherit;
}

#leaderboard-table th:first-child, 
#leaderboard-table td:first-child {
    width: 20%;
    text-align: center;
}

#leaderboard-table th:last-child, 
#leaderboard-table td:last-child {
    width: 30%;
    text-align: right;
}

#leaderboard-table td.rank {
    font-weight: bold;
    font-size: 1.1em;
}

#leaderboard-table tr:nth-child(1) td.rank { color: #FFD700; }
#leaderboard-table tr:nth-child(2) td.rank { color: #C0C0C0; }
#leaderboard-table tr:nth-child(3) td.rank { color: #CD7F32; }


#leaderboard-table td.user {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6em;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#leaderboard-table td.points {
    font-weight: bold;
}