/* Base Elements */
html, body {
    font-family: var(--site-font, 'Poppins', 'Segoe UI', sans-serif), sans-serif;
    color: var(--site-color, var(--text-primary));
    font-size: var(--site-font-size, 16px);
    background-color: var(--site-bg, var(--bg-primary));
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

html {
    min-width: 320px;
}

/* Global responsive safety guards */
*, *::before, *::after {
    box-sizing: border-box;
}

img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
    height: auto;
}

table {
    width: 100%;
    max-width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

pre,
code,
.text-break,
.card,
.modal-content {
    overflow-wrap: anywhere;
    word-break: break-word;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

a, .link {
    color: var(--site-link, var(--primary));
}

.btn, button, input[type="submit"] {
    background-color: var(--site-btn-bg, var(--primary));
    color: var(--site-btn-text, #ffffff);
}

.bg-primary, .navbar, .nav-link.active {
    background-color: var(--site-primary, var(--primary)) !important;
}

.bg-secondary {
    background-color: var(--site-secondary, var(--secondary)) !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    font-weight: 600;
}

a {
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

a:hover {
    transform: translateY(-1px);
}

a:active {
    transform: translateY(0);
    color: var(--primary) !important;
}

a:visited {
    color: inherit;
}

a:visited:hover {
    color: var(--primary);
}

/* Typography */
.brand-text {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Navbar */
.navbar {
    padding: 0.8rem 0;
    background-color: var(--bg-navbar) !important;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.navbar {
    background: linear-gradient(135deg, var(--bg-navbar) 0%, var(--bg-secondary) 100%) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light) !important;
}

.navbar-light,
.navbar-dark {
    background-color: var(--bg-navbar) !important;
    border-bottom: 1px solid var(--border-light);
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: rotate(15deg);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 0.5rem !important;
    border-radius: 8px;
    color: var(--text-secondary) !important;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background: var(--primary);
    color: var(--text-primary) !important;
    transform: translateY(-1px);
}

.nav-link.active {
    background: var(--primary);
    color: var(--text-light) !important;
    box-shadow: var(--shadow-sm);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.nav-link:visited {
    color: var(--text-secondary) !important;
}

.nav-link.active:visited {
    color: var(--text-light) !important;
}

.nav-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.nav-link:active {
    transform: scale(0.95);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.7)),
              url("../images/games.59849936e898.jpeg") no-repeat center center;
    background-size: cover;
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* Icons & Wrappers */
.icon-wrapper {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border:1px solid var(--border-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Game Cards */
.game-card {
    transition: all 0.3s ease;
    border-radius: 10px !important;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.game-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

/* Platform Cards */
.platform-card {
    border-radius: var(--border-radius-sm) !important;
    transition: var(--transition);
}

.platform-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Footer */
footer {
    background-color: var(--bg-footer) !important;
    border-top: 1px solid var(--border-light);
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
}

footer.bg-secondary {
    background-color: var(--bg-footer) !important;
}

footer a {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    color: var(--primary) !important;
    padding-left: 5px;
    text-decoration: none;
    transform: translateX(3px);
}

footer a:active {
    color: var(--primary);
    transform: scale(0.95);
}

footer a:visited {
    color: var(--text-muted);
}

footer a:visited:hover {
    color: var(--text-primary);
}

footer h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer .brand-text {
    color: var(--text-primary);
}

footer p {
    color: var(--text-secondary);
    line-height: 1.6;
}

footer .small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-copy-text {
    color: rgba(2, 1, 2, 0.81);
}

.footer-ownership-text {
    font-size: 10px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: var(--primary);
    color: white;
    border: none;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* Utilities */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-light {
    background-color: var(--bg-secondary) !important;
}

.bg-white {
    background-color: var(--bg-primary) !important;
}

/* Buttons */
.btn:active {
    transform: scale(0.98);
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(53, 168, 240, 0.3);
}

/* Theme Toggle */
#themeToggle {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
}

#themeToggle:hover {
    transform: scale(1.05);
    background: var(--bg-secondary);
}

/* Smooth Transitions */
.navbar-brand,
.nav-link,
.btn,
.card,
footer a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme */
.navbar-dark .nav-link {
    color: var(--text-secondary) !important;
}

.navbar-dark .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light) !important;
}

.navbar-dark .nav-link.active {
    background: var(--primary);
    color: var(--text-light) !important;
}

/* Section Backgrounds */
.bg-dark {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.bg-dark-light {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Dark theme footer */
[data-theme="dark"] footer {
    background-color: var(--bg-footer) !important;
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.6);
}

[data-theme="dark"] footer a {
    color: var(--text-secondary) !important;
    /*color: var(--info) !important;*/
}

[data-theme="dark"] footer a:hover {
    color: var(--primary) !important;
}

[data-theme="dark"] footer h6 {
    color: var(--text-primary);
}

[data-theme="dark"] footer .brand-text {
    color: var(--text-primary);
}

[data-theme="dark"] footer p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] footer .small {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, var(--bg-navbar) 0%, var(--bg-tertiary) 100%) !important;
    border-bottom: 1px solid var(--border-medium) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

[data-theme="dark"] .nav-link {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-light) !important;
}

[data-theme="dark"] .nav-link.active {
    background: var(--primary);
    color: #fff !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 4px 10px rgba(0,0,0,0.5);
}

[data-theme="dark"] #themeToggle {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
    color: var(--text-light);
}

[data-theme="dark"] #themeToggle:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .back-to-top {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

[data-theme="dark"] .back-to-top:hover {
    background: var(--primary);
}

/* Focus states accessibility in dark mode */
[data-theme="dark"] .nav-link:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: auto;
        padding: 100px 0;
        text-align: center;
    }
  
    .hero-section h1 {
        font-size: 2.5rem;
    }
  
    .navbar-brand {
        font-size: 1.25rem;
    }
  
    .game-card,
    .platform-card {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: clamp(1.6rem, 7.2vw, 2.1rem);
    }

    .container,
    .container-fluid {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .back-to-top {
        right: 14px;
        bottom: 14px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 400px) {
    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .icon-wrapper {
        width: 56px;
        height: 56px;
    }
}