/* Ensure the video covers the entire viewport */
#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
}

/* Ensure content appears over the video */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    /* leave space for fixed navbar; JS updates --nav-offset on load/resize */
    padding: calc(var(--nav-offset, 80px) + env(safe-area-inset-top));
    text-align: center;
    color: white;
    position: relative;
}

:root {
    /* offset to account for the fixed navbar; used to equalize top/bottom spacing */
    --nav-offset: 80px;
    /* default icon size for the link squares; adjust here to resize all icons uniformly */
    --link-icon-size: 56px;
    /* default font size for link labels (squares) */
    --link-font-size: 16px;
    /* inner padding for link squares (controls spacing between icon/text and card edges) */
    --link-padding: 16px;
    /* padding inside the label area and computed label row height */
    --link-label-padding: 6px;
    --link-label-height: calc(var(--link-font-size) + (var(--link-label-padding) * 2));
    /* primary logo font size so section headers can scale relative to it */
    --logo-font-size: 60px;
}

/* Overlay to improve readability */
.content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh; /* Ensures content is centered */
    background: rgba(0, 0, 0, 0.5); /* Optional dark overlay */
    width: 100%;
}

header {
    padding: 20px;
}

.logo {
    color: white;
    margin: 0 20px 0 0;
    font-size: var(--logo-font-size);
    font-weight: bold;
    margin-left: 15px;
    text-shadow: 
        0 0 5px #FFFFFF,   /* White glow */
        0 0 10px #FFFFFF;  /* White glow */
}

.page-title {
    color: white;
    margin: 0 20px 0 0;
    font-size: 75px;    
    font-weight: bold;
    margin-left: 15px;
    text-shadow: 
        0 0 5px #FFFFFF,   /* White glow */
        0 0 10px #FFFFFF;  /* White glow */
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Full width */
    background: linear-gradient(45deg, rgba(0, 23, 5, 0.9), rgba(13, 13, 13, 0.9));
    padding: 10px;
    display: flex;
    justify-content: flex-start; /* Pushes logo left, links right */
    align-items: center;
    box-sizing: border-box; /* Prevents unwanted spacing */
    z-index: 9999; /* Keep navbar above page content */
}

.hamburger {
    font-size: 30px;
    cursor: pointer;
    display: none; /* Hidden by default, shown on mobile */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    justify-content: flex-end; /* Aligns to the right */
    margin-left: auto; /* Push the links to the right */
    padding-right: 20px; /* Add some space on the right */
}

.nav-links a {
    color: white;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Courier New', monospace; /* Terminal font for nav link text */
    text-decoration: none;
    padding: 10px;
}

.nav-links a.active {
    font-weight: bold;
    color: #00ff00; /* Highlight color */
    border-bottom: 2px solid #00ff00; /* Optional underline */
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hamburger {
        display: block; /* Show hamburger menu */
        margin-left: auto; /* Pushes it to the right */
        padding-right: 20px;
    }

    .nav-links {
        display: none; /* Hide links by default */
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        background: rgba(0, 0, 0, 0.9);
        padding-right: 20px; /* Add some space on the right */
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    .nav-links.show {
        display: flex; /* Show menu when toggled */
    }

    .nav-links li {
        padding: 10px;
    }
}

.gif-container {
    display: flex;
    align-items: center;
}

.gif-container img {
    max-width: 75px;
    max-height: 75px;
}



#typing-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Full height of the viewport */
    text-align: center;
    font-family: 'Courier New', monospace; /* Monospace font for the typing effect */
  }
  
  #typing-text {
    font-size: 24px;
    color: #fff; /* Or any color you prefer */
    white-space: nornmal; 
    word-wrap: break-word; /* Allow long words to break and wrap */
    max-width: 80%; /* Optional: Controls the width of the text container */
  }


/* Links page: responsive square cards grid */
.links-container {
    display: grid;
    /* fewer, larger cards per row for even distribution */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 36px; /* even gap between cards */
    justify-items: center;
    align-items: center;
    /* reserve space for the fixed navbar and center the grid inside the remaining viewport height */
    padding: 0 48px; /* horizontal padding only; vertical space is managed via height below */
    width: 100%;
    max-width: 1200px; /* cap width to control columns */
    margin: 0 auto; /* center container */
    box-sizing: border-box;
    /* make the container adapt to viewport while reserving navbar space */
    min-height: calc(100vh - var(--nav-offset, 80px));
    grid-auto-rows: auto; /* don't stretch rows */
    align-content: center; /* center rows vertically within container */
}

/* duplicate removed -- grid is defined above */

/* duplicate removed -- grid is defined above */

.link-button {
    /* two-row grid: icon area (fills remaining space) + fixed label row at bottom */
    display: grid;
    grid-template-rows: calc(100% - var(--link-label-height)) var(--link-label-height);
    justify-items: center;
    align-items: center;
    width: 100%;
    max-width: 160px; /* prevent cards from stretching too wide */
    aspect-ratio: 1 / 1;
    padding: var(--link-padding);
    margin: 0;
    background: rgba(0,0,0,0.65);
    border: 2px solid #00ff00;
    box-shadow: 0 0 12px #00ff00;
    color: #ffffff;
    text-align: center;
    font-size: var(--link-font-size, 18px);
    font-weight: bold; /* Make text bold */
    font-family: 'Courier New', monospace; /* terminal-style font to match About/Esports */
    text-decoration: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Make the page title span the full grid width and sit above the cards */
/* page title removed by design (only link squares visible) */

.link-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,255,0,0.12), 0 0 18px #00ff00;
}

.logo-icon {
    /* constrain the icon so equal padding remains on all sides inside the flexible icon cell */
    max-width: min(var(--link-icon-size, 48px), calc(100% - (var(--link-padding) * 2)));
    max-height: min(var(--link-icon-size, 48px), calc(100% - (var(--link-padding) * 2)));
    width: auto;
    height: auto;
    margin: 0;
    object-fit: contain;
    align-self: center; /* center icon vertically in the icon area */
    justify-self: center;
}

/* Ensuring that text is centered */
.link-button span {
    display: block;
    text-align: center;
    line-height: 1.2;
    margin: 0;
    font-family: 'Courier New', monospace; /* ensure labels use terminal font */
    padding: var(--link-label-padding) 0;
    height: 100%;
    box-sizing: border-box;
}

@media (min-width: 1400px) {
    /* on very wide screens allow slightly larger min width */
    .links-container { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 1600px; }
}

@media (max-width: 420px) {
    .links-container { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; padding: 12px; }
    /* scale icons down proportionally on small screens */
    .logo-icon { width: calc(var(--link-icon-size, 48px) * 0.75); height: calc(var(--link-icon-size, 48px) * 0.75); }
    /* reduce label size on small screens to keep layout balanced */
    .link-button { font-size: calc(var(--link-font-size, 18px) * 0.78); }
}

/* Windows XP-style About Page */
.about-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    font-family: "Tahoma", sans-serif;
    background: linear-gradient(45deg, #008080, #004080);
    color: white;
    min-height: 100vh;
}

.about-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px black;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    max-width: 800px;
    margin-top: 80px; /* Adjust this if needed to prevent overlap */
}

.card {
    background: #d4d0c8;
    border: 2px solid #808080;
    padding: 15px;
    width: 250px;
    cursor: pointer;
    box-shadow: 3px 3px 0px black;
    text-align: center;
}

.card:hover {
    background: #e4e0d8;
}

/* Popup Windows */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #d4d0c8;
    border: 2px solid #808080;
    box-shadow: 5px 5px 0px black;
    width: 300px;
    padding: 15px;
    z-index: 10;
    visibility: hidden; /* Ensures it's properly hidden */
}

.popup-header {
    background: #000080;
    color: white;
    padding: 5px;
    font-weight: bold;
    text-align: left;
    display: flex;
    justify-content: space-between;
}

.close-btn {
    background: red;
    color: white;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
}

.close-btn:hover {
    background: darkred;
}

/* General styling */
#esports-page {
    /* Use the same monospace font as the About page typing text */
    font-family: 'Courier New', monospace;
    color: #ffffff; /* body text in bubbles should be white */
    padding: 40px;
    max-width: 900px;
    margin: auto;
    background: rgba(0, 0, 0, 0.6);
}

/* Headings for eSports page */
#esports-page h2 {
    font-family: 'Courier New', monospace;
    color: #00ff00;
    margin-bottom: 18px;
    /* ~60% of the logo size for strong section titles */
    font-size: calc(var(--logo-font-size) * 0.6);
    font-weight: bold;
    text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00;
}

#esports-page h3 {
    font-family: 'Courier New', monospace;
    color: #00ff00;
    margin-bottom: 12px;
    /* smaller than h2 but larger/thicker than body text */
    font-size: calc(var(--logo-font-size) * 0.38);
    font-weight: 700;
    text-shadow: 0 0 6px #00ff00, 0 0 14px #00ff00;
}

/* PC Specs Section */
#specs {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.specs-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.spec {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    background: rgba(0,0,0,0.7);
    border: 2px solid #00ff00;
    box-shadow: 0 0 12px #00ff00;
    color: #ffffff;
}

.spec:hover {
    transform: scale(1.03);
}


/* Peripherals Grid */
.peripherals-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}


.peripheral {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    background: rgba(0,0,0,0.65);
    border: 2px solid #00ff00;
    box-shadow: 0 0 12px #00ff00;
    padding: 10px;
    border-radius: 8px;
    color: #ffffff;
    flex: 0 0 160px;
    min-height: 160px;
    box-sizing: border-box;
}

.peripheral img {
    width: 120px;
    height: auto;
    border-radius: 10px;
    display: block;
    margin-bottom: 8px;
}

.peripheral:hover {
    transform: scale(1.1);
}

/* Esports Journey */
#journey {
    text-align: center;
    margin-bottom: 20px;
    font-style: italic;
}

/* Heroes Grid */
.heroes-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-card {
    text-align: center;
    transition: transform 0.3s ease-in-out;
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.7);
    border: 2px solid #00ff00;
    box-shadow: 0 0 12px #00ff00;
    padding: 8px;
    border-radius: 8px;
    color: #ffffff;
}

/* Make headers green while body text remains white */
#esports-page h2,
#esports-page h3 {
    color: #00ff00;
}

.hero-card img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 8px;
}

/* Portrait cards on small screens */
@media (max-width: 480px) {
    .hero-card {
        flex: 0 0 120px;
    }
    .hero-card img {
        height: 180px;
    }
}

.hero-card:hover {
    transform: scale(1.1);
}

/* Strong overrides for eSports headers to ensure mobile applies the terminal font, sizes and glow */
#esports-page h2 {
    font-family: 'Courier New', monospace !important;
    color: #00ff00 !important;
    font-size: calc(var(--logo-font-size) * 0.68) !important;
    font-weight: 900 !important;
    text-shadow: 0 0 12px #00ff00, 0 0 28px #00ff00 !important;
}

#esports-page h3 {
    font-family: 'Courier New', monospace !important;
    color: #00ff00 !important;
    font-size: calc(var(--logo-font-size) * 0.42) !important;
    font-weight: 800 !important;
    text-shadow: 0 0 8px #00ff00, 0 0 18px #00ff00 !important;
}

/* Tweak sizes for small screens so header text doesn't overflow */
@media (max-width: 480px) {
    #esports-page h2 { font-size: calc(var(--logo-font-size) * 0.42) !important; }
    #esports-page h3 { font-size: calc(var(--logo-font-size) * 0.28) !important; }
}
