* {
    font-family: "Lilita One", sans-serif;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {

    /* Colors */
    --gray5: hsl(0, 0%, 5%);
    --gray10: hsl(0, 0%, 10%);
    --gray15: hsl(0, 0%, 15%);
    --gray30: hsl(0, 0%, 30%);
    --gray50: hsl(0, 0%, 50%);
    --gray70: hsl(0, 0%, 70%);
    --gray90: hsl(0, 0%, 90%);
    --colora: #ffe537;
    --colora2: #537fe7;

    /* landing page */
    --ff: "Lilita One", sans-serif;
    --h1: bold max(4rem)/1em var(--ff); 
    --h2: bold 3rem/1.2em var(--ff);
    --h3: bold 2.25rem/1.2em var(--ff);
    --h4: 1.5rem/1.6em var(--ff);
    --big: 1.25rem/1.6em var(--ff);
    --p: 1rem/1.6em var(--ff);
    --small: 0.75rem/1.6em var(--ff);

    --transition: 0.3s ease-in-out;

    /* Spacing */
    --margin-xxs: .25rem;
    --margin-xs: .5rem;
    --margin-s: .75rem;
    --margin-m: 1rem;
    --margin-l: 1.25rem;
    --margin-xl: 1.75rem;
    --margin-xxl: 2.5rem;
    --explore-duration: 60s;
    --explore-duration-hover: 100s;
    --nav-height: 5rem;
}

/* Blog-specific heading utilities (used to replace inline styles) */
.blog-h1 { color: white; font-family: var(--ff); font-size: 2.5rem; }
.blog-h2 { color: white; font-family: var(--ff); font-size: 1.5rem; }
.blog-p  { color: white; }

html, body {
    /* Prevent accidental horizontal overflow (mobile sideways scroll).
       This is a small, defensive rule to avoid pages becoming wider than
       the viewport due to transforms, long inline elements, or runtime
       JS. We'll keep this narrow and non-destructive. */
    overflow-x: hidden;
}

body {
    background-color: var(--gray5);
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-rows: var(--nav-height) 1fr; /* reserve top row for nav */
    max-width: 100%; /* ensure body never exceeds the viewport width */
}

main {
    /* occupy second row of body grid */
    display: flex;
    flex-direction: column;
    /* Ensure main fills the remaining viewport space so footer can
       be pushed to the bottom on short pages. When snap is enabled
       the explicit `height` rule will take precedence and preserve
       the snap scrolling behavior. */
    min-height: calc(100vh - var(--nav-height));
    padding-top: 0; /* nav is now in document flow */
}

/* Keep the footer pinned to the bottom of the page when content is short.
   On long pages the footer will naturally follow content. */
.footer {
    margin-top: auto;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: float 5s ease-in-out infinite;
    pointer-events: none; /* Ensure the background doesn't interfere with user interactions */
}

header {
    position: relative;
    z-index: 2;
    height: auto;
}

.footer {
    background-color: var(--gray10);
    color: #fff;
    text-align: center;
    padding: calc(var(--margin-s) * 2) 0;
    font-family: var(--ff);
    position: relative;
    width: 100%;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--margin-l);
}

.footer-link {
    font-family: var(--ff);
    color: var(--gray70);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-link:hover {
    color: white;
}

.nav {
    justify-content: center;
    display: flex;
    background-color: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    color: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    padding: var(margin-xxs);
    position: sticky; /* stay visible but participate in layout */
    top: 0;
    height: var(--nav-height);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.logo{
    /* keep logo in the normal flow so flex alignment can center the nav correctly */
    position: relative;
    left: auto;
    margin-left: var(--margin-m);
}

.nav .logo {
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    transition: transform 0.2s ease-in-out;
}

.nav .logo-text {
    font-family: var(--ff);
    color: #fff;
    text-decoration: none;
    margin-left: 1rem;
    font-size: 2rem;
    font-weight: bold;
    
}

.nav img {
    cursor: pointer;
    width: 10%;
}

.nav div:nth-child(2) a {
    font-family: var(--ff);
    font-size: 1.2rem;
    color: var(--gray70);
    text-decoration: none;
    padding: 0 1rem;
    transition: all 0.2s ease-in-out;
}

.nav div:nth-child(2) a:hover {
    color: var(--gray90);
    transform: scale(1.03);
}

.nav div:nth-child(2) img{
    padding: 0 1rem;
}

.submit-nav {
    align-self: center;
    margin: 0 .5rem;
    padding: .5rem 2rem;
    background-color: rgb(255, 0, 106);
    color: #ffffff;
    border: none;
    border-radius: 1.5rem;
    font-size: 1rem;
    text-decoration: none;
}

@media (min-width: 1145px) {
    /* Desktop and wide screens: show full-nav, hide mobile nav */
    .mobile-nav {
        display: none !important;
    }
    .full-nav {
        display: flex !important;
    }
}

@media (max-width: 1145px) {
    /* Small screens: hide full-nav, show mobile nav */
    .full-nav {
        display: none !important;
    }
    .mobile-nav {
        display: flex !important;
    }

    .mobile-nav {
        padding: 0;
    }

    .fa-bars {
        padding: .5rem;
        margin-right: 30px;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        margin-bottom: 1rem;
    }

    .tagline {
        font-size: 1.2rem;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }
    
    .hero {
        min-height: auto;
        padding: 30px 15px 30px 15px;
    }
    
    .hero::before {
        top: 30px;
        bottom: 30px;
    }
    
    .hero .intro-img {
        max-width: 90%;
        border-radius: 20px;
    }
    
    .hero .intro-text h1.hero-title {
        font: bold clamp(2.5rem, 8vw, 8rem)/1.1 var(--ff);
    }

    .hero-logo-mobile {
        display: block;
        width: 150px;
        height: auto;
        margin: 0 auto var(--margin-s);
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .hero .intro-img {
        max-width: 600px;
    }
}

/* overlay */
/* mobile nav */

#overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100vh;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    text-decoration: none;
}

.overlay-text {
    display: block;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.5rem;
    padding: .5rem 2rem;
    transition: all 200ms ease-in-out;
}

/* hero */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: var(--margin-xxl) auto;
    padding: 50px 20px 40px 20px;
    width: 100%;
    max-width: 1800px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    min-height: 90vh;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 40px;
    background-image: url('https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExdWNxMGlnYmk5b2FnZTY3b3lmb2U3anJiNXBxemhjYjk5eDlwdmt0MiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/IaL0KX18O96ngYFHgI/giphy.gif.giphy.com/media/v1.Y2lkPTc5MGI3NjExMzMwbTJ6emdweWRidGhhaTA5aXZsMHl3ZzNhc2h4bXBrbmYxbnZ5eCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/hFhygTRHt4jvGQo52q/giphy.gif');
    background-size: cover;
    background-position: center;
    opacity: 1;
    box-shadow: inset 0 80px 120px -60px #000, inset 0 -80px 120px -60px #000, inset 0 0 1000px rgba(0, 0, 0, 1);
    z-index: -1;
}



.hero .intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 2rem;
    padding: 1rem 0;
}

.hero .intro-img {
    display: block;
    margin-top: var(--margin-l);
    margin-bottom: var(--margin-xxl);
    padding: 20px;
    max-width: 800px;
    width: 100%;
    height: auto;
    border-radius: 25px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    animation: fadeIn 1.5s ease-in-out;
}

.hero .intro-img:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

/* Intro embedded video (homepage) - sleek container */
.hero .grid {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 20px;
    padding: 0; /* remove accidental padding */
}

.hero .grid iframe {
    width: 100%;
    max-width: 820px;
    aspect-ratio: 16/9;
    height: auto;
    border: 0;
    display: block;
    object-fit: cover;
    transition: transform 260ms ease, box-shadow 260ms ease;
    will-change: transform;
}

.hero .grid:hover iframe {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0,0,0,0.55);
}

.hero .grid::after {
    /* subtle gradient at bottom for depth */
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 24%;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.18));
    pointer-events: none;
}

@media (max-width: 720px) {
    .hero .grid iframe {
        max-width: 100%;
        aspect-ratio: 16/9;
        height: auto;
    }
    .hero .grid { border-radius: 14px; }
}

/* Scroll snap between major sections */
html, body, main {
    height: 100%;
}

/* snap-page namespace handled below via `body.snap-page` */

/* Styles applied only when a page opts-in and runtime allows snap behavior */
body.snap-page.snap-enabled {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: var(--nav-height); /* account for sticky nav */
}

body.snap-page.snap-enabled main {
    scroll-snap-type: y mandatory;
    height: 100%; /* fill the remaining grid row */
    overflow-y: auto;
}

.hero {
    scroll-snap-align: start;
    min-height: calc(100vh - var(--nav-height));
}
.flex-cards {
    scroll-snap-align: start;
    min-height: auto; /* allow cards to size to content so they don't overlap nav */
}

/* when using snap-page, ensure flex-cards sit below the fixed nav */
body.snap-page.snap-enabled .flex-cards {
    /* default small offset so content is not pushed too far on mobile; only when
       snap behavior is actually enabled. Using .snap-enabled prevents the
       spacing from applying on mobile where only the snap namespace is present. */
    margin-top: calc(var(--nav-height) + 1rem) !important;
    padding-top: 1rem;
    gap: clamp(.6rem, 1.0vw, 1rem); /* slightly tighter grid gap */
}

@media (min-width: 1024px) {
    /* larger offset only on wide viewports where there's room */
    body.snap-page.snap-enabled .flex-cards {
        margin-top: calc(var(--nav-height) + clamp(2rem, 12vh, 18rem)) !important;
        padding-top: 1.25rem;
    }
}

/* Slightly smaller cards on the homepage so they feel less tall */
body.snap-page .flex-cards .card {
    padding: calc(var(--margin-m) * 0.65);
}

/* Reveal-on-scroll */
.reveal, .card, .intro-img, .flex-cards > div {
    opacity: 0;
    transform: translateY(18px) scale(0.995);
    transition: opacity 650ms var(--transition), transform 650ms var(--transition), box-shadow 500ms ease;
    will-change: transform, opacity;
}

.in-view {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* Smooth parallax for hero background and image */
.hero {
    background-attachment: fixed;
    transition: background-position 0.2s linear;
}

@media (max-width: 768px) {
    .hero {
        background-attachment: scroll; /* avoid fixed backgrounds on mobile */
    }
    .brawldle-text {
        margin-top: 2.5rem; /* reduce large top spacing on small screens */
        font-size: 2.2rem;
    }
}

/* Extra safety net for very small/mobile screens */
@media (max-width: 768px) {
    /* Make sure no full-viewport height constraints prevent vertical scrolling */
    html, body, main {
        height: auto !important;
        min-height: 0 !important;
    }

    /* Disable snap behavior on small screens in case JS toggles the namespace */
    body.snap-page.snap-enabled, body.snap-page {
        scroll-behavior: auto !important;
    }
    body.snap-page main {
        scroll-snap-type: none !important;
        overflow-y: visible !important;
        height: auto !important;
    }

    /* Cap the width of main layout containers to the viewport to avoid any
         remaining element forcing a wider page (e.g. via calc or transforms). */
    header, main, .hero, .intro-container, .intro, .flex-cards, .explore-banner, .explore-track, .grid {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
}

/* Explore track visual polish */
.explore-track {
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.6));
    transform-origin: left center;
}

.explore-item {
    transition: transform 300ms ease, text-shadow 300ms ease;
}

.explore-item:hover { transform: translateY(-6px) scale(1.02); text-shadow: 0 6px 24px rgba(0,0,0,0.6); }

.intro-text {
    flex: 1;
    margin-left: auto;
    margin-right: auto;
    min-width: 0; /* avoid forcing a minimum width that causes overflow on mobile */
    text-align: center;
    animation: slideInLeft 1s ease-in-out;
    max-width: 90%;
    margin-top: 2rem;
}

.intro-text p {
    color: var(--gray90);
    margin-top: 1.5rem;
    font: var(--p);
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
}

.intro-text h1 {
    width: 100%;
    color: #fff;
    font: var(--h1);
    margin-bottom: 1.5rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.intro-button-container{
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.intro-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--ff);
    font-size: 1.2rem;
    color: white;
    background-color: transparent;
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease, color 0.3s ease;
}

@media (max-width: 768px) {

    .Btn {
        margin-bottom: 20px;
    }
}

.intro-button:hover {
    background-color: white;
    color: black;
    transform: scale(1.03);
}

.intro-button2:hover {
    background-color: #1f1f1f;
    transform: scale(1.05);
    color: #fff;
}

/* Make submit-clip-button match hero buttons when placed next to them */
.intro-button-container .submit-clip-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--ff);
    font-size: 1.2rem;
    color: white;
    background-color: transparent;
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease, color 0.3s ease;
    margin: 0;
}
.intro-button-container .submit-clip-button:hover{
    background-color: white;
    color: black;
    transform: scale(1.03);
}

/* When used in the Brawldle hero, match the yellow action buttons */
.brawldle-intro .submit-clip-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1.2rem;
    color: #000000;
    background-color: #fcff4a;
    border: 2px solid #000000;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0.5rem 0 0 0.5rem;
}
.brawldle-intro .submit-clip-button:hover{
    background-color: #cec045;
    transform: scale(1.05);
}

/* From Uiverse.io by vinodjangid07 */ 
.Btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    position: relative;
    /* overflow: hidden; */
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
  }

  .svgContainer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    backdrop-filter: blur(0px);
    letter-spacing: 0.8px;
    border-radius: 10px;
    transition: all 0.3s;
    border: 1px solid rgba(156, 156, 156, 0.466);
  }
  
  .BG {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    background: #7289da;
    z-index: -1;
    border-radius: 10px;
    pointer-events: none;
    transition: all 0.3s;
  }
  
  .Btn:hover .BG {
    transform: rotate(35deg);
    transform-origin: bottom;
  }
  
  .Btn:hover .svgContainer {
    border: 1px solid rgba(206, 206, 206, 0.466);
    background-color: rgba(214, 214, 214, 0.466);
    backdrop-filter: blur(4px);
  }
  

/* flex cards */
.flex-cards img {
    width: 100%;
    height: auto;
    border-radius: 10%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
}

.explore-banner {
    overflow: hidden;
    width: 100%;
    margin: clamp(1rem, 3vw, 2rem) 0;
    position: relative;
}

.explore-track {
    display: inline-flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding-right: 80px;
    padding-left: 5px;
    animation: scroll var(--explore-duration) linear infinite;
    will-change: transform;
}

.explore-item {
    font-family: 'SF Pro Display', sans-serif;
    font-style: italic;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 5rem);
    text-decoration: none;
    background: linear-gradient(90deg, lightgrey, white);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 clamp(1rem, 2vw, 2rem);
    display: inline-block;
}

.explore-item:hover {
    background: linear-gradient(90deg, #FF7F00, #FFE600);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.explore-banner:hover .explore-track {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(5px); }
    100% { transform: translateX(calc(-50% - 40px)); }
}

/* On narrow screens the explore-track translation can cause horizontal overflow
   (because it translates very far left). Disable the large translation on small
   viewports and instead use a modest shift to keep contents within the viewport. */
@media (max-width: 480px) {
    @keyframes scroll {
        0% { transform: translateX(0); }
        100% { transform: translateX(-20%); }
    }
    .explore-track { padding-right: 20px; }
}

/* Strong mobile overflow protections: ensure major containers never exceed viewport width
   and simplify wide animations so content wraps instead of forcing a wider page. */
@media (max-width: 768px) {
    html, body {
        width: 100vw; /* guard against accidental 100% of a larger container */
        overflow-x: hidden; /* double-ensure no sideways scrolling */
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure hero and card containers stay within the viewport */
    .hero, .explore-banner, .intro, .flex-cards, .grid {
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Disable marquee-style horizontal animation on small screens (wrap instead) */
    .explore-track {
        animation: none !important;
        display: block;
        white-space: normal;
        padding-right: 0.5rem;
    }
    .explore-item {
        display: inline-block;
        white-space: normal;
        margin: 0.5rem 0.25rem;
        font-size: clamp(1.6rem, 4.5vw, 2.8rem);
    }

    /* Make intro columns stack cleanly and avoid forcing minimum widths */
    .intro {
        flex-direction: column;
        gap: 1rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .intro-text, .grid { width: 100%; max-width: 100%; }

    /* Guard against runtime transforms pushing visual overflow */
    .intro-img, .hero .intro-img { transform: none !important; }
}

/* Additional mobile safeguards for images and flex containers */
@media (max-width: 768px) {
    img, .minigame-intro-img, .intro-img, .flex-cards img, .grid img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    /* Flex children can sometimes impose a min-width; reset to allow wrapping */
    .intro-container, .brawldle-intro, .trophyguess-intro, .flex-cards > div, .card {
        min-width: 0;
    }

    /* Ensure modal and overlay don't push horizontal scroll */
    #overlay, .modal, .modal-content {
        left: 0; right: 0; width: 100%; box-sizing: border-box; padding-left: 0.5rem; padding-right: 0.5rem;
    }
}

/* Defensive: if any element has inline large font-sizes or widths, cap them on very small screens */
@media (max-width: 420px) {
    [style*="font-size"] {
        font-size: clamp(0.9rem, 4vw, 1.6rem) !important;
    }
    [style*="width:"] {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

.flex-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    
    background-size: cover;
    width: 90%;
    max-width: 1800px;
    margin: 0 auto; /* top spacing handled per-page (e.g. body.snap-page) */
    padding-top: 30px;
    padding-bottom: 30px;
    /* remove heavy inset shadows so individual cards control their own shadows */
    box-shadow: none;
    animation: fadeIn 1.75s ease-in-out;
}

.flex-cards > div {
    display: flex;
}
.card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--gray10);
    box-shadow: 0 8px 20px rgba(0,0,0,0.45);
    transition: transform 320ms cubic-bezier(.2,.9,.3,1), box-shadow 320ms ease, filter 320ms ease;
    will-change: transform, box-shadow;
    cursor: pointer;
}

/* Scope hover to the card itself for a modern lift + soft shadow */
.flex-cards .card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 24px 48px rgba(0,0,0,0.55), 0 6px 18px rgba(0,0,0,0.35);
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.25));
}

/* Subtle image scale on card hover */
.flex-cards .card img {
    width: 100%;
    height: 450px; /* uniform image height for visual consistency */
    object-fit: cover;
    display: block;
    transition: transform 420ms cubic-bezier(.2,.9,.3,1), filter 320ms ease;
}
.flex-cards .card:hover img { transform: scale(1.03); filter: brightness(1.02); }

/* Subtle overlay to improve contrast on dark backgrounds */
.flex-cards .card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 46%;
    background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0));
    pointer-events: none;
    transition: opacity 260ms ease, transform 320ms ease;
    opacity: 0.65;
}
.flex-cards .card:hover::after {
    opacity: 1;
    transform: translateY(-6px);
}

/* Slight card rim to separate cards from very dark page backgrounds */
.flex-cards .card {
    border: 1px solid rgba(255,255,255,0.03);
}

@media (max-width: 768px) {
    .flex-cards .card img {
        height: auto;
        object-fit: cover;
    }
}

.card-title {
    font: var(--h3);
    color: #fff;
    text-align: center;
}

.card-text {
    font: var(--p);
    color: var(--gray70);
    text-align: center;
}

/* brawdle */
.brawldle-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: none;
    justify-content: center;
    padding: 1rem 1rem;
    background: linear-gradient(135deg, var(--gray10), var(--gray5));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-width: 1200px;
    margin: 3rem auto;
    animation: fadeIn 1s ease-in-out;
    text-align: center;
}

.leaderboard-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: none;
    justify-content: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, var(--gray10), var(--gray5));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-width: 1200px;
    margin: 3rem auto;
    animation: fadeIn 1s ease-in-out;
    text-align: center;
}

.brawldle-section h2, .leaderboard-section h2 {
    font: var(--h2);
    margin-bottom: 1rem;
    color: #fff;
}

.brawldle-section p, .leaderboard-section p {
    font-size: var(--p);
    line-height: 1.6;
    margin-bottom: var(--margin-l);
    color: var(--gray70);
}

.brawldle-button, .brawldle-button2 {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1.2rem;
    color: #000000;
    background-color: #fcff4a;
    border: 2px solid #000000;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0.5rem auto;
    text-align: center;
}

.brawldle-button:hover, .brawldle-button2:hover {
    background-color: #cec045;
    transform: scale(1.05);
}

.trophyGuess-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1.2rem;
    color: #ffffff;
    background-color: #007bff;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 1rem auto;
    transition: all 0.3s ease;
}

.trophyGuess-button:hover {
    background-color: #00448d;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .trophyGuess-button, .brawldle-button, .brawldle-button2 {
        display: block;
        width: 88%;
        margin: 0.5rem auto;
        text-align: center;
        border-radius: 15px;
    }
    
    .flex-cards {
        margin-bottom: 4rem;
    }
    
    .rank-buttons {
        gap: 0.5rem;
        padding: 10px;
    }
    
    .rank-buttons img {
        max-width: 60px;
        max-height: 50px;
        margin: 0 0.5rem;
    }
    
    .submit-button {
        width: 88%;
        display: block;
    }
    
    #streak {
        text-align: center;
        width: 100%;
    }
    
    body {
        min-height: 100vh;
        /* Keep the grid layout on small screens so the nav row is reserved
           and sticky nav participates in layout instead of overlapping content. */
        display: grid;
        grid-template-rows: var(--nav-height) 1fr;
    }

    /* Mobile nav / header adjustments */
    .nav {
        padding: 0.25rem 0.5rem;
    }
    .nav .logo {
        position: relative;
        left: auto;
        margin-left: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .nav img {
        width: 44px;
        height: 44px;
    }
    .account { display: none; }

    /* Make intro cards stack and fill width on small screens */
    .brawldle-intro, .trophyguess-intro {
        min-width: auto;
        max-width: 95%;
        width: 95%;
        padding: 18px;
    }

    /* Reduce snap offset on small screens so content isn't pushed too far down */
    body.snap-page .flex-cards {
        margin-top: calc(var(--nav-height) + 1.25rem) !important;
        padding-top: 0.75rem;
    }
}

@media (max-height: 700px) {
    body {
        min-height: 100vh;
    }
    
    .footer {
        position: relative;
        margin-top: 2rem;
    }
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-list li {
    background-color: #444;
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    color: #fff;
    display: flex;
    justify-content: space-between;
}

#timer {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.5em;
    text-align: center;
    width: fit-content;
    margin: 0 auto; /* Center the timer */
}


/* Brawdle Unlimited */

.brawldle {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.brawldle-text {
    font-family: 'Lilita One', sans-serif;
    font-size: 4rem;
    margin-top: 6rem;
    margin-bottom: 1rem;
    color: #ffffff;
    text-align: center;
}

.brawldle-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

.brawldle-video iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
    border: 5px solid #000000;
    margin-top: 1.7rem;
    border-radius: 10px;
}

#streak {
    font-family: var(--ff);
    font-size: 1.5rem;
    color: var(--gray70);
    margin-top: 1rem;
}

.rank-buttons {
    padding: 20px;
    display: flex;
    justify-content: center;
    margin: 1rem auto;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 90%;
}

.rank-buttons img {
    max-width: 75px;
    max-height: 60px;
    margin: 0 1.0rem;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.rank-buttons img.selected {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.7);
    border: 3px solid #007bff;
    border-radius: 10px;
}

.rank-buttons img:hover {
    transform: scale(1.2); /* Scale up the button slightly */
}

.submit-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1.2rem;
    color: #ffffff;
    background-color: #007bff;
    border: 2px solid #003d7e;
    border-radius: 15px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 1rem auto;
    cursor: pointer;
}

.submit-button:hover {
    background-color: #00448d;
    color: #fff;
}

/* Disabled submit button */
.submit-button.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Status message */
.status-message {
    font-family: 'Open Sans', sans-serif;
    color: #fff;
    text-align: center;
    margin-top: 0.5rem;
}

/* Modal styles */
.modal {
    overflow-y: auto;
    display: none; 
    position: fixed; 
    z-index: 1200; /* Sit on top */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 8px;

    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
    animation: fadeIn 0.3s ease-out forwards; /* Animation for showing the modal */
}

@media (max-width: 768px) {
    .modal {
        position: absolute; /* allow modal to flow within main on small screens */
        left: 0;
        top: 0;
        transform: none;
        width: 100%;
        height: auto;
        max-height: none;
        border-radius: 0;
        background-color: rgba(0,0,0,0.95);
    }
    .modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
        max-width: none;
        padding: 16px;
        box-sizing: border-box;
    }
}

.modal-content {
    color:#fff;
    background: linear-gradient(135deg, #181818, #3a3a3a); /* Gradient background */
    margin: 5% auto; /* 15% from the top and centered */
    padding: 20px;
    max-width: 600px; /* Maximum width */
    border-radius: 0%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    text-align: center;
    animation: slideIn 0.3s ease-out forwards; /* Animation for showing the modal content */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.7);
}

#guessDistributionChart {
    max-width: 100%; /* Ensure the chart fits within the modal */
    max-height: 45vh; /* Adjust height as needed */
}

.modal-content h1 {
    font-family: 'Lilita One', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.modal-content h2 {
    font-family: 'Lilita One', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal-content p {
    font-family: 'Lilita One', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content canvas {
    width: 100% !important;
    height: auto !important;
}

.loseModalText {
    font-family: 'Lilita One', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ff0000;
    text-align: center;
}

#loseModal .modal-content {
    background-color: #f8d7da; /* Light red background */
    border: 2px solid #f5c6cb; /* Slightly darker red border */
    border-radius: 10px; /* Rounded corners */
    padding: 20px; /* Padding inside the modal */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}


#loseModal button {
    background-color: #f5c6cb; /* Light red background */
    color: #721c24; /* Dark red text */
    border: none;
    padding: 10px 20px;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#loseModal button:hover {
    background-color: #f1b0b7; /* Slightly darker red on hover */
}


/* Responsive adjustments */
@media screen and (max-width: 1145px) {
    .modal-content {
        width: 90%; /* Adjust width for smaller screens */ /*test*/
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: scale 0.2s ease-in-out;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
    transform: scale(1.1);
}

/* Keyframe animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

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

@keyframes gradientBackground {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

@keyframes glow {
    0% {
        text-shadow: 0 0 5px #ff005e, 0 0 10px #ff005e, 0 0 20px #ff005e, 0 0 40px #ff005e, 0 0 80px #ff005e;
    }
    100% {
        text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff, 0 0 40px #00d4ff, 0 0 80px #00d4ff, 0 0 160px #00d4ff;
    }
}

/* Debug helpers — toggle by adding `debug-layout` class to the body (for inspection only) */
body.debug-layout .nav { outline: 3px solid rgba(255,0,0,0.9) !important; }
body.debug-layout .hero { outline: 3px dashed rgba(0,200,255,0.9) !important; }
body.debug-layout .flex-cards { outline: 3px solid rgba(255,0,200,0.85) !important; }
body.debug-layout main { background: rgba(255,255,255,0.02); }




/*-------------------*/
/*-------------------*/
/*-------------------*/
/*-------------------*/
/*----submit page----*/
/*-------------------*/
/*-------------------*/
/*-------------------*/
/*-------------------*/
.submit-clip {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
    font-family: var(--ff);
    padding: 4rem 1rem;
    background-color: #292929;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
    max-width: 700px;
    border-radius: 10px;
}

.submit-clip-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1.2rem;
    color: #ffffff;
    background-color: #007bff;
    border: 2px solid #003d7e;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.submit-clip-button:hover {
    background-color: #00448d;
    transform: scale(1.05);
    color: #fff;
}

.videos-text {
    font-family: 'Lilita One', sans-serif;
    font-size: 4rem;
    margin-top: 6rem;
    margin-bottom: 1rem;
    margin-left: 3rem;
    color: #ffffff;
}

.sidebar {
    margin-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.sidebar-button {
    font-family: 'Lilita One', sans-serif;
    font-size: 1.5rem;
    display: block;
    width: 80%;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background-color: rgba(30, 30, 30, 0.8);
    color: white;
    transition: all 0.3s ease;
}

.sidebar-button:hover {
    background-color: rgba(60, 60, 60, 0.8);
    color: white;
    transform: scale(1.05);
}

.fa-times {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    z-index: 1001;
}

/* blog */

 .blog-link {
    --text-color: hsl(231, 97%, 72%);
    --accent-color: hsl(231, 97%, 72%);
    --hover-text-color: hsl(222.2 34% 8.9%);
    --hover-bg-color: hsl(231, 97%, 72%);
    font-family: var(--ff);
    display: inline-block;
    font-family: Sora;
    color: var(--foreground);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.link-content {
    position: relative;
    display: inline-flex;
    align-items: center;
    background-image: linear-gradient(to bottom, var(--accent-color), var(--accent-color));
    background-size: 100% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: all 0.15s ease-in-out;
    padding-top: 2.5px;
        }

.blog-link{
    color: white;
}

.blog-link:hover .link-content {
    color: var(--hover-text-color);
    background-size: 100% 100%;
}

.blog {
    margin: 10vh;
}

.blog-item {
    margin-bottom: 2rem;
}

.blog-text {
    max-width: 800px;
    margin: 100px auto 100px auto;
    padding-left: 20px;
    padding-right: 20px;
    color: white;
    box-sizing: border-box;
}

/* From Uiverse.io by gharsh11032000 (simplified to avoid duplicates) */ 
.card {
    min-width: 240px;
    border-radius: 10px;
    padding: var(--margin-m);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--margin-xs);
}

.card .card-main-content {
    flex: 1;
}

.card-header {
    margin-bottom: 24px;
}

.card .card-heading {
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
}

.card .card-footer {
    font-weight: 400;
    margin-right: 4px;
}

@media (max-width: 768px) {
    .blog {
        margin-left: 2vh;
        margin-right: 2vh;
    }
}

.header-items{
    padding-right: 30px;
}

/* Slider container */
.trophy-slider {
    width: 80%;
    margin: 20px auto;
    text-align: center;
}

/* The slider itself */
.slider {
    width: 100%;
    height: 15px;
    border-radius: 10px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.slider:hover {
    opacity: 1;
}

/* The slider thumb */
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--gray30);
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.slider::-webkit-slider-thumb:hover {
    background: white;
}

.slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.slider::-moz-range-thumb:hover {
    background: #45a049;
}

/* Trophies value display */
.trophy-slider p {
    display: block;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 200ms ease-in-out;
}

.map-container {
    position: relative;
    display: inline-block;
    width: auto;
}

.map {
    display: block;
    width: 100%;
    height: auto;
}

.proxy {
    position: absolute;
    background-color: black;
    color: white;
    border: 2px solid white;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 14px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    text-decoration: none;
}

.proxy:hover {
    background-color: white;
    color: black;
    transform: translate(-50%, -50%) scale(1.05);
    text-decoration: none;
}

.proxy-sydney {
    top: 75%;
    left: 83%;
}

.proxy-japan {
    top: 42%;
    left: 81%;
}

.proxy-singapore {
    top: 47%;
    left: 76%;
}

.proxy-miami {
    top: 46%;
    left: 27%;
}

.proxy-hong-kong {
    top: 50%;
    left: 75%;
}

.proxy-germany {
    top: 34%;
    left: 50%;
}

.proxy-brazil {
    top: 63%;
    left: 36%;
}

.proxy-chile {
    top: 70%;
    left: 30%;
}

.proxy-peru {
    top: 64%;
    left: 29%;
}

.proxy-virginia {
    top: 42%;
    left: 28%;
}

.proxy-dallas {
    top: 45%;
    left: 25%;
}

.proxy-los-angeles {
    top: 43%;
    left: 20%;
}

.proxy-italy {
    top: 0%;
    left: 0%;
}

.proxy-finland {
    top: 0%;
    left: 0%;
}

.proxy-oregon {
    top: 0%;
    left: 0%;
}

.proxy-bahrain {
    top: 0%;
    left: 0%;
}

.proxy-india {
    top: 0%;
    left: 0%;
}

.page-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.proxy-card {
    flex: 1;
    background: rgb(0, 0, 0);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    max-width: 500px;
    margin: 20px auto;
    
}

.video-card {
    flex: 1;
    background: rgb(0, 0, 0);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    max-width: 600px;
    margin: 20px auto;
}

.video-container {
    width: 100%;
    height: 500px;
    background: #000000;
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 1094px) {
    .page-container {
        flex-direction: column;
    }
    
    .proxy-card, .video-card {
        min-width: 90%;
    }

    .video-container {
        height: 500px;
    }
}

.proxy-title {
    font-size: 24px;
    font-weight: bold;
    font-family: var(--ff);
    margin-bottom: 20px;
    color: #ffffff;
}

.info-grid {
    font-family: var(--ff);
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.label {
    font-family: var(--ff);
    color: #ffffff;
    font-weight: 500;
}

.value {
    font-family: var(--ff);
    color: #ffffff;
    font-weight: 600;
}

.connection-info {
    font-family: var(--ff);
    background: #525252;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
}

.connection-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.ip-value, .port-value {
    font-family: monospace;
    font-size: 16px;
    color: #ffffff;
    padding-right: 5px;
}

.copy-btn {
    font-family: var(--ff);
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background: #0056b3;
}

.latency {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.latency-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
}

.coming-soon-title {
    font-family: 'Lilita One', sans-serif;
    margin-top: 6rem;
    margin-left: 3rem;
    color: #ffffff;
}

.coming-soon-text {
    font-family: 'Lilita One', sans-serif;
    margin-bottom: 1rem;
    margin: 3rem;
    color: #ffffff;
}

.flash {
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    from {
        background-color: var(--flash-color);
    }
    to {
        background-color: var(--gray10); /* End with the default background color */
    }
}

.footer {
    background-color: var(--gray10);
    color: #fff;
    text-align: center;
    padding: var(--margin-s) 0;
    font-family: var(--ff);
    position: relative;
    width: 100%;
    margin-top: auto; /* let main's flex layout push footer to bottom when possible */
}

.background-image {
    background-image: url('https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExZ21rZHh5aW9zMTY3c2t6cWtmMnQyNjhnYjRxOGEwdnNmOTduNzh3MSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/3ov9k1173PdfJWRsoE/giphy.gif');
    background-size: cover;
    background-position: center;
    height: 100vh;
}

.login-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    width: 300px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-container h2 {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.form-group input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Lilita One', sans-serif;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.account-buttons {
    width: 100%;
    padding: 10px;
    background-color: #ff4a3d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Lilita One', sans-serif;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease;
}

.account-text {
    font-family: 'Lilita One', sans-serif;
}

.points {
    font-family: 'Lilita One', sans-serif;
}

.error-message {
    color: #ff4a3d;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
}

.dashboard .points-container {
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.dashboard h3 {
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.dashboard .points {
    font-size: 2.5em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.leaderboard-button {
    width: 100%;
    padding: 10px;
    background-color: #3158ca;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Lilita One', sans-serif;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.logout-button {
    width: 100%;
    padding: 10px;
    background-color: #ff4a3d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Lilita One', sans-serif;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.leaderboard-header h1 {
    margin: 0;
    font-size: 2rem;
    font-family: 'Lilita One', sans-serif;
    letter-spacing: 1px;
    color: white;
    padding-bottom: 10px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 15px 70px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.leaderboard-table th {
    background-color: #242424;
    font-weight: normal;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.leaderboard-table tr:hover {
    background-color: #242424;
}

.rank {
    width: 80px;
    text-align: center;
    font-family: 'Lilita One', sans-serif;
    color: white;
}

.points {
    color: #ffd700;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 1.2rem;
}

.username {
    color: white;
    font-family: 'Lilita One', sans-serif;
}

.error {
    text-align: center;
    padding: 30px;
    color: #ff4444;
    font-size: 1.2rem;
}

.leaderboard-table tr {
    transition: background-color 0.2s ease;
}

@media (max-width: 600px) {
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    .leaderboard-header h1 {
        font-size: 1.5rem;
    }
}

.update-email-button {
    width: 100%;
    padding: 10px;
    background-color: #ffc863;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Lilita One', sans-serif;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.update-email-button:hover {
    background-color: #e6b800;
}

.email-input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Lilita One', sans-serif;
}

.email-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.nav-links {
    display: flex;
    gap: var(--margin-m);
    position: relative;
    z-index: 1;
}

.account {
    /* position account in-flow and let flex/margin handle alignment */
    position: relative;
    right: auto;
    margin-left: auto; /* push account to the far right within the nav */
}

.nav.full-nav {
    /* center nav container using auto margins instead of absolute/transform centering */
    margin: var(--margin-m) auto;
    padding: var(--margin-l) var(--margin-l);
    border-radius: 25px;
    height: auto;
    width: 90%;
    max-width: 1200px;
    position: sticky; /* participate in layout, don't remove flow */
    border: 2px solid var(--gray15);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Account link styling */
.account a {
    font-family: var(--ff);
    font-size: 1.2rem;
    color: var(--gray70);
    border: 1px solid var(--gray70);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    transition: all 0.2s ease-in-out;
}

.account a:hover {
    background-color: var(--gray70);
    color: #fff;
}

.nav.mobile-nav {
    /* center mobile nav similarly and rely on flex for spacing */
    margin: var(--margin-m) auto;
    padding: var(--margin-l) 10px;
    border-radius: 25px;
    height: 70px;
    width: 95%;
    position: sticky; /* keep in flow so grid reserves space */
    justify-content: space-between;
    z-index: 999;
    border: 2px solid var(--gray15);
    display: flex;
    align-items: center;
}

.nav.mobile-nav img {
    margin-left: 0; /* reset any inline offsets; mobile spacing controlled here */
}

.nav.mobile-nav .fa-bars {
    margin-right: 20px;
}

/* Morti-Site title styling */
.hero-title {
    font-family: var(--ff);
    font-size: clamp(2rem, 8vw, 8rem);
    color: #fff;
    text-shadow: 0 0 5px #ff005e, 0 0 10px #ff005e, 0 0 20px #ff005e, 0 0 40px #ff005e, 0 0 80px #ff005e;
    animation: glow 1.5s infinite alternate;
    margin-bottom: var(--margin-s);
    text-align: center;
}

.tagline {
    font-size: 20px;
    color: white;
}

.hero .intro-text h1.hero-title {
    font: bold clamp(2rem, 8vw, 8rem)/1em var(--ff);
}

/* Stats Page Styles */
.stats-container {
    width: 95%;
    max-width: 1200px;
    margin: 6rem auto 3rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stats-section {
    background-color: var(--gray10);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 7px 10px rgba(0,0,0,0.7);
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.section-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.section-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    transition: color 0.3s ease;
}

.section-header:hover h2 {
    color: var(--colora);
}

.section-header h2::after {
    content: none;
}

.collapse-icon {
    font-size: 1.2rem;
    color: var(--gray70);
    transition: transform 0.3s ease, color 0.3s ease;
    margin-right: 0.5rem;
}

.section-header:hover .collapse-icon {
    color: var(--colora);
}

.section-header.active .collapse-icon {
    transform: rotate(180deg);
}

.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.section-content.active {
    max-height: 5000px;
    opacity: 1;
    padding-top: 1.5rem;
}

.stats-section h2 {
    font: var(--h2);
    color: #fff;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.75rem;
}

.grid-container {
    display: grid;
    gap: 1.5rem;
}

#events-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.event-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    justify-content: center;
}

.brawler-grid {
    grid-template-columns: repeat(auto-fill, minmax(calc(25% - 1.5rem), 1fr));
    justify-content: center;
    gap: 1rem;
    max-width: 100%;
}

.brawler-card {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--gray15);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

.brawler-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.brawler-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 0.75rem;
    object-fit: cover;
    border: 2px solid var(--gray50);
}

.brawler-name {
    font-size: 1.1rem;
    color: #fff;
    text-align: center;
}

.loading-text {
    color: var(--gray70);
    font-size: 1.2rem;
    text-align: center;
    padding: 2rem 0;
}

/* Event Card Specific Styles */
.event-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--gray15);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
    height: 100%;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.event-map-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 8px;
    margin: 0.75rem 0;
    object-fit: cover;
    border: 1px solid var(--gray30);
}

.event-gamemode-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 0.5rem;
    border-radius: 8px;
}

.event-card h4 {
    font: var(--h4);
    color: #fff;
    text-align: center;
    margin: 0.5rem 0;
    width: 100%;
}

.event-time {
    font-size: var(--small);
    color: var(--gray70);
    text-align: center;
    padding: 0.5rem;
    width: 100%;
    background-color: rgba(0,0,0,0.2);
    border-radius: 5px;
    margin-top: auto;
}

.event-type-title {
    font: var(--h3);
    color: #fff;
    text-align: center;
    margin: 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray30);
    width: 100%;
}

.api-credit {
    font-size: var(--small);
    color: var(--gray50);
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray30);
    width: 100%;
}

.api-credit a {
       color: var(--gray70);
    text-decoration: none;
    transition: color 0.2s ease;
}

.api-credit a:hover {
    color: var(--colora);
}

@media (max-width: 1024px) {
    .stats-container {
        width: 95%;
        margin-top: 5rem;
    }
    
    .stats-section {
        padding: 1.25rem;
    }
    
    .event-cards-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .brawler-grid {
        grid-template-columns: repeat(auto-fill, minmax(calc(33.33% - 1rem), 1fr));
    }
}

@media (max-width: 768px) {
    .stats-container {
        margin-top: 4rem;
        gap: 1.5rem;
    }
    
    .stats-section {
        padding: 1rem;
    }
    
    .stats-section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.25rem;
    }
    
    .brawler-grid {
        grid-template-columns: repeat(auto-fill, minmax(calc(50% - 0.75rem), 1fr));
    }
    
    .brawler-image {
        width: 60px;
        height: 60px;
    }
    
    .event-map-image {
        max-width: 100%;
    }
    
    .event-cards-wrapper {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-container {
        width: 92%;
        padding: 0;
        margin-top: 3.5rem;
    }
    
    .brawler-grid {
        grid-template-columns: repeat(auto-fill, minmax(calc(50% - 0.5rem), 1fr));
        gap: 0.75rem;
    }
    
    .brawler-card {
        padding: 0.75rem;
    }
    
    .brawler-image {
        width: 50px;
        height: 50px;
        margin-bottom: 0.5rem;
    }
    
    .brawler-name {
        font-size: 0.9rem;
    }
    
    .event-card {
        padding: 0.75rem;
    }
}

/* Player Data Section */
.player-search {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 1rem;
}

.player-search h3 {
    font-family: var(--ff);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.player-search p {
    font-size: 1rem;
    color: var(--gray70);
    margin-bottom: 1.5rem;
    text-align: center;
}

.player-search-form {
    display: flex;
    width: 100%;
    max-width: 500px;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.player-tag-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray30);
    border-radius: 8px;
    background-color: var(--gray15);
    color: #fff;
    font-family: var(--ff);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.player-tag-input:focus {
    outline: none;
    border-color: var(--colora);
}

.player-tag-input::placeholder {
    color: var(--gray50);
}

.search-player-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--colora2);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--ff);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.search-player-btn:hover {
    background-color: #4267c9;
    transform: translateY(-2px);
}

.search-player-btn:active {
    transform: translateY(0);
}

.player-results {
    width: 100%;
    max-width: 800px;
    padding: 1.5rem;
    background-color: var(--gray15);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-results .info-text {
    color: var(--gray70);
    font-size: 1.1rem;
    text-align: center;
}

.player-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.player-stat-card {
    background-color: var(--gray10);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-stat-card h4 {
    font-family: var(--ff);
    font-size: 1.2rem;
    color: var(--gray90);
    margin-bottom: 0.5rem;
}

.player-stat-card .stat-value {
    font-family: var(--ff);
    font-size: 1.8rem;
    color: var(--colora);
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .player-search-form {
        flex-direction: column;
        max-width: 100%;
    }
    
    .search-player-btn {
        width: 100%;
    }
    
    .player-results {
        padding: 1rem;
    }
}

/* Styles for the detailed How to Play section */
.how-to-play-detailed {
    text-align: left; /* Override center alignment for this section */
    transform: none; /* Reset transform from .brawldle-section to bring it up */
    margin-top: var(--margin-xl); /* Reduce top margin to bring it further up */
}

.how-to-play-detailed h3 {
    font-size: var(--h3); /* Use existing h3 variable */
    color: var(--colora); /* Accent color for subheadings */
    margin-top: var(--margin-xl);
    margin-bottom: var(--margin-m);
}

.how-to-play-detailed ul {
    list-style-type: none; /* Remove default bullets */
    padding-left: 0; /* Remove default padding */
    margin-bottom: var(--margin-l);
}

.how-to-play-detailed ul li {
    font-size: var(--p);
    color: var(--gray90);
    margin-bottom: var(--margin-s);
    padding-left: var(--margin-m); /* Indent list items */
    position: relative;
}

.how-to-play-detailed ul li::before {
    content: "▶"; /* Custom bullet */
    position: absolute;
    left: 0;
    color: var(--colora); /* Accent color for bullets */
    font-size: 0.8em;
    top: 2px; /* Adjust vertical alignment if needed */
}

/* Styling for nested ULs within how-to-play for Elo specifics */
.how-to-play-detailed ul ul {
    margin-top: var(--margin-xs);
    margin-bottom: var(--margin-s);
    padding-left: var(--margin-m); /* Further indent nested list */
}

.how-to-play-detailed ul ul li::before {
    content: "▪"; /* Different bullet for sub-items */
    font-size: 0.9em;
    top: 1px;
}

.how-to-play-detailed > p:last-of-type { /* The "Ready to play?" paragraph */
    font-weight: bold;
    color: white;
    text-align: center; /* Center the final call to action */
    margin-top: var(--margin-xl);
}

.hero-logo-mobile {
    display: none;
}

@media (max-width: 1145px) {
    .hero-logo-mobile {
        display: block;
        width: 150px;
        height: auto;
        margin: 0 auto var(--margin-s);
    }
}

/* Multiplayer matchmaking screen */
.matchmaking-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 160px);
    text-align: center;
    color: #fff;
}

/* full-screen overlay used by multiplayer countdowns */
.full-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

@media (max-width: 768px) {
    .full-overlay {
        position: absolute; /* let it flow inside main on small screens */
        height: auto;
        min-height: calc(100vh - var(--nav-height));
        padding: 2rem 1rem;
    }
}

.matchmaking-screen h2 {
    font-family: 'Lilita One', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* End screen results list */
.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.modal-content ul li {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.2rem;
    margin: 0.5rem 0;
    color: #fff;
}

.game-over-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Space between round rows */
    margin-top: 1rem;
}

.round-summary-row {
    display: flex; /* Arrange round label, your guess, opp guess, correct answer in a row */
    justify-content: space-between; /* Distribute items in the row */
    align-items: center;
    padding: 0.75rem;
    background-color: rgba(0,0,0,0.1); /* Light background for each row */
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}

.round-label {
    font-weight: bold;
    font-size: 1.1rem;
    flex-basis: 15%; /* Give some base width to round label */
    color: #fff;
}

.guess-details {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Space between label like "You:" and the icon */
    flex-basis: 25%; /* Base width for each guess section */
    color: #ddd;
}



.player-label {
    font-weight: normal;
    margin-right: 5px;
}

.rank-icon-summary {
    width: 40px; /* Adjust size as needed */
    max-width: 40px;
    max-height: 40px;
    height: auto;
    border-radius: 5px; /* Optional: slightly rounded corners for icons */
}

.no-guess-text {
    font-style: italic;
    color: #aaa;
}

/* Brawldle + TrophyGuess intro sections */
.intro-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 20px;
    box-sizing: border-box;
    flex-grow: 1;
    width: 100%;
}

.brawldle-intro,
.trophyguess-intro {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 30px;
    flex: 1 1 calc(50% - 10px);
    min-width: 300px;
    max-width: calc(50% - 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.brawldle-intro .intro-text h1,
.trophyguess-intro .intro-text h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.brawldle-intro .intro-text p,
.trophyguess-intro .intro-text p {
    font-size: 1rem;
    margin-bottom: 15px;
}

.brawldle-intro .intro-img,
.trophyguess-intro .intro-img {
    max-width: 80%;
    height: auto;
    border-radius: 10px;
    margin-top: 15px;
}

.brawldle-intro .brawldle-button,
.brawldle-intro .brawldle-button2,
.trophyguess-intro .trophyGuess-button {
    display: block;
    width: 80%;
    margin: 10px auto;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: rgb(0, 0, 0);
    font-weight: bold;
}

.brawldle-intro .brawldle-button {
    background-color: var(--colora);
}

.brawldle-intro .brawldle-button2 {
    background-color: rgb(116, 116, 253);
}

.trophyguess-button {
    border-color: #4CAF50;
}

@media (max-width: 1075px) { 
    .intro-container {
        flex-direction: column;
        align-items: center;
    }

    .brawldle-intro,
    .trophyguess-intro {
        width: 95%;
        max-width: none; 
        flex-basis: auto;
    }
}

.minigame-intro-img {
    max-width: 100%;
    width: 100%;
    max-width: 520px;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    margin-top: 15px;
}

.brawldle-intro .intro-text,
.trophyguess-intro .intro-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Player Data Section */
.player-search, .club-search {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 1rem;
}

.player-search h3, .club-search h3 {
    font-family: var(--ff);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.player-search p, .club-search p {
    font-size: 1rem;
    color: var(--gray70);
    margin-bottom: 1.5rem;
    text-align: center;
}

.player-search-form, .club-search-form {
    display: flex;
    width: 100%;
    max-width: 500px;
    margin-bottom: 1.5rem;
    gap: 0.75rem;
}

.player-tag-input, .club-tag-input { /* Combined for shared styling */
    flex-grow: 1;
    padding: 0.8rem 1rem;
    border: 2px solid var(--gray30);
    border-radius: 8px;
    background-color: var(--gray15);
    color: #fff;
    font-family: var(--ff);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.player-tag-input:focus, .club-tag-input:focus {
    outline: none;
    border-color: var(--colora);
    box-shadow: 0 0 0 3px rgba(255, 229, 55, 0.3);
}

.player-tag-input::placeholder, .club-tag-input::placeholder {
    color: var(--gray50);
}

/* Results Area - Contains Player/Club Cards */
.results-area {
    margin-top: 1rem;
    padding: 0;
    background-color: transparent;
    border-radius: 8px;
    color: var(--gray90);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.results-area .info-text {
    color: var(--gray70);
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 20px;
}

/* Player Card Styles */
.player-card {
    background-color: var(--gray15);
    border: 1px solid var(--gray30);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-in-out;
    flex: 1 1 660px;
    min-width: 600px;
    max-width: 750px;
}

.player-card:hover {
    transform: translateY(-5px);
}

.player-card h3 {
    color: var(--colora); 
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.7rem;
    border-bottom: 2px solid var(--colora2);
    padding-bottom: 10px;
    text-align: center;
}

.player-card p.player-club-info {
    margin-bottom: 20px;
    line-height: 1.6;
    color: var(--gray80);
    font-size: 1rem;
    text-align: center;
}

.player-club-link {
    color: var(--colora2);
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
}

.player-club-link:hover {
    color: var(--colora);
}

.player-card .stats-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.stat { 
    background-color: var(--gray10); 
    padding: 25px 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--gray30);
    width: 275px;
}

.stat .value {
    display: block;
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.stat .label {
    font-size: 1rem;
    color: var(--gray50);
    line-height: 1.2;
}

/* Club Card Styles */
.club-result-card {
    background-color: var(--gray15);
    border: 1px solid var(--gray30);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-in-out;
    flex: 1 1 660px;
    min-width: 600px;
    max-width: 750px;
    display: flex;
    flex-direction: column;
}

.club-result-card:hover {
    transform: translateY(-5px);
}

.club-result-card h3 {
    color: var(--colora2); 
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.7rem;
    border-bottom: 2px solid var(--colora);
    padding-bottom: 10px;
    text-align: center;
}

.club-result-card p.club-description {
    margin-bottom: 20px;
    line-height: 1.6;
    color: var(--gray80);
    font-size: 0.95rem;
    text-align: left;
}

.club-result-card .club-stats-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.club-actions {
    margin-top: 20px;
    text-align: center;
}

.view-members-btn {
    padding: 10px 20px;
    background-color: var(--colora2);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out, opacity 0.2s ease;
}

.view-members-btn:hover {
    background-color: var(--colora);
    color: var(--gray5);
}

.view-members-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.club-members-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--gray30);
    width: 100%;
}

.club-members-header {
    font-size: 1.3rem;
    color: var(--colora);
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--gray50);
}

.club-member-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.club-member-list::-webkit-scrollbar {
    width: 8px;
}

.club-member-list::-webkit-scrollbar-track {
    background: var(--gray10);
    border-radius: 4px;
}

.club-member-list::-webkit-scrollbar-thumb {
    background: var(--gray50);
    border-radius: 4px;
}

.club-member-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray70);
}

.club-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px solid var(--gray20);
    font-size: 0.95rem;
    color: var(--gray90);
}

.club-member-item:last-child {
    border-bottom: none;
}

.club-member-item .member-rank {
    color: var(--colora);
    font-weight: bold;
    min-width: 35px;
    text-align: right;
    margin-right: 10px;
}

.club-member-item .member-name {
    flex-grow: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.club-member-item .member-role {
    color: var(--gray70);
    min-width: 80px;
    text-align: center;
    margin-left: 10px;
}

.club-member-item .member-trophies {
    font-weight: bold;
    color: #fff;
    min-width: 70px;
    text-align: right;
    margin-left: 10px;
}

.club-member-item.no-members {
    justify-content: center;
    font-style: italic;
    color: var(--gray70);
}

.club-stat {
    background-color: var(--gray10); 
    padding: 25px 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--gray30);
    width: 275px;
    box-sizing: border-box;
}

.club-stat .value {
    display: block;
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.club-stat .label {
    font-size: 1rem;
    color: var(--gray50);
    line-height: 1.2;
}


.leaderboard {
    background-color: var(--gray15);
    border: 1px solid var(--gray30);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.leaderboard h3 {
    color: var(--colora);
    text-align: center;
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 20px;
}

.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray30);
    transition: background-color 0.2s ease-in-out;
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-item:hover {
    background-color: var(--gray10);
}

.rank-item .rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--colora2);
    min-width: 40px;
}

.rank-item .name {
    font-size: 1.1rem;
    color: var(--gray90);
    flex-grow: 1;
    padding-left: 15px;
    padding-right: 15px;
}

.rank-item .trophies {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.player-search-form input[type="text"],
.club-search-form input[type="text"] {
    padding: 12px 15px;
    border: 1px solid var(--gray30);
    background-color: var(--gray10);
    color: var(--gray90);
    border-radius: 6px;
    font-size: 1rem;
    flex-grow: 1;
    margin-right: 10px;
}

.search-btn {
    padding: 12px 20px;
    background-color: var(--colora);
    color: var,--gray5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out;
}

.search-btn:hover {
    background-color: #ffd700;
}

.club-search {
    margin-top: 0;
}


@media (max-width: 768px) {
    .player-card h3, .club-result-card h3, .leaderboard h3 {
        font-size: 1.5rem; 
    }

    .player-card .stats-grid, .club-result-card .club-stats-grid {
        gap: 10px; 
    }

    .stat, .club-stat {
        padding: 15px 10px;
        width: 225px;
    }

    .stat .value, .club-stat .value {
        font-size: 1.8rem;
    }

    .stat .label, .club-stat .label {
        font-size: 0.85rem;
    }

    .results-area {
        gap: 15px; 
        justify-content: center;
    }

    .player-card, .club-result-card {
        flex-basis: calc(100% - 20px); 
        min-width: 300px;
        max-width: 100%;
        margin-left: auto; 
        margin-right: auto;
    }
}

/* ========== Mobile override fixes (appended) ========== */
/* These overrides are intentionally placed at the end to ensure they win
   over earlier layout rules for small screens (<=768px). They are defensive
   and conservative, aiming to prevent hero/flex-cards clipping and horizontal
   overflow while preserving the desktop layout. */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        overflow-x: hidden;
        /* Use normal document flow on mobile to avoid grid row height traps
             that can prevent scrolling to content below the hero. */
        display: block !important;
        height: auto !important;
    }

  /* Make main scrollable so content below the hero is reachable */
    main {
        min-height: auto !important;
        height: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

  /* Let hero size to its content and center it */
  .hero {
    min-height: auto !important;
    height: auto !important;
    padding: 1.25rem 0 1rem 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .hero .intro, .intro-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .intro-text {
    min-width: 0 !important; /* prevents flex items from creating horizontal overflow */
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  /* Ensure images don't force overflow and don't get transformed on mobile */
  .intro-img, .minigame-intro-img, img {
    max-width: 100% !important;
    height: auto !important;
    transform: none !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Make flex-cards reachable and not offset when snap isn't enabled */
  .flex-cards {
    margin-top: 0 !important;
    padding-top: 1rem !important;
    box-sizing: border-box !important;
  }

  /* Reset min-width that may be set earlier for various card components */
  .player-card, .club-result-card, .player-card .stats-grid, .player-card, .club-result-card, .results-area, .stat, .club-stat {
    min-width: 0 !important;
  }

  /* Ensure cards and flex children can shrink/wrap instead of forcing min widths */
  .flex-cards > div, .card, .brawldle-intro, .trophyguess-intro {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Prevent any remaining heavy horizontal animations from forcing width */
  .explore-track {
    animation: none !important;
    display: block !important;
    white-space: normal !important;
    padding-right: 0.5rem !important;
  }

  .explore-item { display: inline-block !important; white-space: normal !important; }

  /* Modals/overlays should not push page width */
  #overlay, .modal, .modal-content, .full-overlay {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}
