/* ==========================================================================
   1. GLOBAL & CORE VARIABLES
   ========================================================================== */


   /* Smooth Theme Transition for Backgrounds, Borders, and Colors */
body,
.top-nav,
.nav-toggle,
.nav-menu,
.nav-link,
.game-card,
.poster-wrapper,
.controls-bar,
.sort-select,
.link-item,
.card,
.feature-card,
.support-card,
.btn-more-games,
h1, h2, h3, p, span, a {
    transition: background-color 0.35s ease, 
                border-color 0.35s ease, 
                color 0.35s ease, 
                box-shadow 0.35s ease;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&family=Montserrat:wght@300;400;600;700;800;900&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    scroll-behavior: smooth;
}

body {
    background-color: #0b0c0e;
    color: #d1d5db;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    padding: 6rem 1.5rem 4rem 1.5rem;
    line-height: 1.6;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* Page-specific background override for INERTIA subpage */
body.inertia-theme {
    background-color: #0a0a0c;
    color: #e0e0e6;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem;
    background-image: 
        radial-gradient(circle at 50% 15%, rgba(211, 47, 47, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
    position: relative;
    overflow-x: hidden;
}

/* Ambient Holographic CRT Scanline Overlay */
body.inertia-theme::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 10;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
}

/* ==========================================================================
   2. SHARED TOP NAVIGATION BAR
   ========================================================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(11, 12, 14, 0.9);
    border-bottom: 1px solid #27272a;
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem;
    position: relative;
}

/* Container width override for main/home/inertia pages */
.container-narrow .nav-container,
body.inertia-theme .nav-container {
    max-width: 800px;
}

.nav-brand {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-toggle {
    background: #121316;
    border: 1px solid #27272a;
    color: #d1d5db;
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-toggle:hover {
    border-color: #52525b;
    background: #18191e;
    color: #ffffff;
}

.nav-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.nav-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1.5rem;
    width: 200px;
    background: #121316;
    border: 1px solid #27272a;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-link {
    padding: 0.6rem 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #a1a1aa;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    background: #18191e;
    color: #ffffff;
}

/* ==========================================================================
   3. SHARED CONTAINERS & FOOTER
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.container.container-narrow {
    max-width: 800px;
    gap: 3.5rem;
}

footer {
    border-top: 1px solid #18181b;
    padding-top: 1.5rem;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #3f3f46;
}

.ai-disclaimer {
    font-size: 0.75rem;
    color: #52525b;
    line-height: 1.4;
}

/* ==========================================================================
   4. HOME PAGE STYLES (index.html)
   ========================================================================== */
.profile {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.avatar {
    width: 96px;
    height: 96px;
    border-radius: 8px;
    border: 1px solid #27272a;
    object-fit: cover;
    background: #18181b;
    flex-shrink: 0;
}

.bio h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.bio .subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #a1a1aa;
    margin-top: 0.2rem;
}

.bio .about {
    font-size: 0.95rem;
    color: #71717a;
    margin-top: 0.75rem;
    max-width: 600px;
}

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #52525b;
    margin-bottom: 1.25rem;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.game-grid .game-card {
    background: #121316;
    border: 1px solid #27272a;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.game-grid .game-card:hover {
    border-color: #52525b;
    transform: translateY(-2px);
}

.card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(9, 9, 11, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    color: #e4e4e7;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.card-desc {
    font-size: 0.8rem;
    color: #71717a;
    line-height: 1.4;
}

.btn-more-games {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    background: #121316;
    border: 1px dashed #27272a;
    border-radius: 6px;
    color: #a1a1aa;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-more-games:hover {
    background: #18191e;
    border-color: #52525b;
    color: #ffffff;
}

.links-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.link-item {
    background: #121316;
    border: 1px solid #27272a;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #e4e4e7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.link-item:hover {
    border-color: #52525b;
    background: #18191e;
}

.link-item span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #52525b;
}

/* ==========================================================================
   5. GAMES LIBRARY PAGE STYLES (games.html)
   ========================================================================== */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #121316;
    border: 1px solid #27272a;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    gap: 1rem;
    flex-wrap: wrap;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #a1a1aa;
}

.sort-select {
    background: #0b0c0e;
    border: 1px solid #27272a;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.sort-select:hover, .sort-select:focus {
    border-color: #52525b;
}

.game-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #52525b;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem 1.25rem;
    position: relative;
}

.library-grid .game-card {
    position: relative;
}

/* Poster and Hover Tooltip */
.poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #121316;
    border: 1px solid #27272a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.poster-wrapper[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(9, 9, 11, 0.95);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 90%;
    text-align: center;
    word-break: break-word;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}

.poster-wrapper[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.library-grid .game-card:hover .poster-wrapper {
    transform: translateY(-4px);
    border-color: #52525b;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
}

.poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.status-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(9, 9, 11, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    color: #e4e4e7;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

/* Card Text Details Below Image */
.card-details {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Allows multi-line title wrapping so text is never truncated */
.game-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
    line-height: 1.3;
    transition: color 0.2s ease;
    display: block
}

/* Tooltip Popup Bubble */
.game-title[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; /* Positions tooltip right above the title text */
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(18, 19, 22, 0.95);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

/* Hover & Focus Activation */
.game-title[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.library-grid .game-card:hover .game-title {
    color: #c7c7c7;
}

/* Year / Release Status Display */
.game-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #71717a;
    font-weight: 500;
}

/* ==========================================================================
   6. INERTIA SUBPAGE STYLES (inertia/index.html)
   ========================================================================== */
.main-wrapper {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
    margin-top: 4rem;
}

.glitch-active {
    animation: glitch-anim 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    position: relative;
    will-change: transform, filter;
}

.glitch-active::before,
.glitch-active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    pointer-events: none;
}

.glitch-active::before {
    left: 3px;
    text-shadow: -2px 0 #ff0055;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-slice 0.2s infinite linear alternate-reverse;
}

.glitch-active::after {
    left: -3px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-slice 0.2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { transform: translate(0) skew(0deg); }
    20% { transform: translate(-4px, 2px) skew(-1deg); filter: hue-rotate(90deg); }
    40% { transform: translate(4px, -2px) skew(1.5deg); }
    60% { transform: translate(-2px, 1px) skew(-0.5deg); filter: invert(0.1); }
    80% { transform: translate(2px, -1px) skew(0.5deg); }
    100% { transform: translate(0) skew(0deg); }
}

@keyframes glitch-slice {
    0% { clip: rect(12px, 9999px, 44px, 0); }
    50% { clip: rect(76px, 9999px, 12px, 0); }
    100% { clip: rect(32px, 9999px, 88px, 0); }
}

.logo-container {
    text-align: center;
    padding: 1rem 0;
    width: 100%;
}

.logo-container img {
    max-width: 80%;
    height: auto;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.9));
}

.card {
    width: 100%;
    background: rgba(18, 18, 22, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.tagline {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
}

.description {
    font-size: 1rem;
    color: #b0b0bb;
    font-weight: 400;
    text-align: center;
    max-width: 780px;
    margin: 0 auto;
    line-height: 1.7;
}

.carousel-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0.5rem 0;
}

.carousel-main {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 35px rgba(97, 97, 97, 0.25), 
                0 0 15px rgba(54, 54, 54, 0.05);
    transition: box-shadow 0.3s ease;
}

.carousel-main:hover {
    box-shadow: 0 0 45px rgba(180, 180, 180, 0.4), 
                0 0 20px rgba(255, 255, 255, 0.1);
}

.carousel-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease-in-out;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 12, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

.btn-prev { left: 10px; }
.btn-next { right: 10px; }

.carousel-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    width: 100%;
}

.thumb {
    aspect-ratio: 16 / 9;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.5;
    transition: all 0.25s ease;
    background: #121214;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb:hover {
    opacity: 0.85;
    border-color: rgba(255, 255, 255, 0.4);
}

.thumb.active {
    opacity: 1;
    border: 2px solid #faf8f8;
    box-shadow: 0 0 15px rgba(161, 161, 161, 0.4);
}

.card .section-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #71717a;
    margin-bottom: -0.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    width: 100%;
}

.feature-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.25s ease;
}

.feature-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature-card p {
    font-size: 0.85rem;
    color: #9a9ab0;
    line-height: 1.5;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #71717a;
}

.meta-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e0e6;
}

.actions {
    display: flex;
    justify-content: center;
    width: 100%;
}

.btn-steam {
    display: block;
    width: 100%;
    max-width: 650px;
    aspect-ratio: 4 / 1;
    background-color: transparent;
    background-image: url('steam.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.btn-steam:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 8px 25px rgba(255, 255, 255, 0.15));
}

/* Inline Steam Layout for Dream Project */
.dream-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1rem;
}

.dream-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.btn-steam-inline {
    display: block;
    width: 170px;
    height: 50px;
    flex-shrink: 0;
    background-color: transparent;
    background-image: url('steam.png');
    background-size: contain;
    background-position: center right;
    background-repeat: no-repeat;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-steam-inline:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.25));
}

.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
}

.support-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: border-color 0.2s ease;
}

.support-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.support-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #71717a;
}

.support-link, .support-text {
    font-size: 0.9rem;
    color: #e0e0e6;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
}

.support-link {
    color: #ff4d4d;
    transition: color 0.2s ease;
}

.support-link:hover {
    color: #ff6666;
    text-decoration: underline;
}

#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0e0e0e;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    will-change: opacity;
}

#intro-overlay video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(0);
}

#intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ==========================================================================
   7. MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    .main-wrapper {
        margin-top: 3.5rem;
    }

    #intro-overlay video {
        width: 90%;
        max-width: 480px;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: contain;
        border-radius: 6px;
    }

    .card {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }

    .tagline {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .carousel-btn {
        padding: 0.5rem 0.75rem;
        font-size: 1.2rem;
    }

    .carousel-thumbs {
        gap: 0.4rem;
    }

    .support-grid, .features-grid, .metadata-grid {
        grid-template-columns: 1fr;
    }

    .btn-steam {
        aspect-ratio: 3.5 / 1;
    }
}

@media (max-width: 600px) {
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    body {
        padding: 5rem 1rem 2rem 1rem;
    }
}

@media (max-width: 550px) {
    .profile {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}



/* ==========================================================================
   8. WHITE MODE SUPPORT
   ========================================================================== */

   /* Light/White Theme Override */
body.light-theme {
    background-color: #ffffff;
    background-image: 
        linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    color: #18181b;
}

body.light-theme .top-nav {
    background: rgba(255, 255, 255, 0.9);
    border-color: #e4e4e7;
}

body.light-theme .nav-toggle,
body.light-theme .nav-menu,
body.light-theme .game-card,
body.light-theme .link-item,
body.light-theme .controls-bar {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #18181b;
}

body.light-theme .nav-brand,
body.light-theme .bio h1,
body.light-theme .card-title,
body.light-theme .game-title {
    color: #09090b;
}

body.light-theme .nav-link {
    color: #52525b;
}

body.light-theme .nav-link:hover,
body.light-theme .nav-link.active {
    background: #e4e4e7;
    color: #09090b;
}


/* ==========================================================================
   9. Theme Toggle Button Styles
   ========================================================================== */

   /* Theme Toggle Button Styles & Animation */
.theme-toggle-btn {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.theme-toggle-btn svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Default (Dark Mode): Show Moon, Hide Sun */
.theme-toggle-btn .icon-moon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.theme-toggle-btn .icon-sun {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-180deg) scale(0.2);
}

/* Light Mode State: Hide Moon, Show Sun with Rotation */
body.light-theme .theme-toggle-btn .icon-moon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg) scale(0.2);
}

body.light-theme .theme-toggle-btn .icon-sun {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}