/* =========================================
   XTRA INDUSTRIAL — Common Theme
   Color: Charcoal Gray + Signal Red
   Font: Barlow + Roboto Condensed
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=Roboto+Condensed:wght@400;700&family=Barlow+Condensed:wght@600;700;800;900&display=swap');

/* ---- Design Tokens ---- */
:root {
    --clr-bg:        #111111;
    --clr-bg2:       #1a1a1a;
    --clr-bg3:       #222222;
    --clr-card:      #1e1e1e;
    --clr-section:   #161616;

    --clr-primary:   #e63030;     /* signal red */
    --clr-primary-d: #c0271e;     /* deep red */
    --clr-primary-l: #ff4444;     /* light red */
    --clr-accent:    #ff6b35;     /* red-orange accent */

    --clr-text:      #e8e8e8;
    --clr-text2:     #b0b0b0;
    --clr-muted:     #777777;
    --clr-border:    rgba(255, 255, 255, 0.07);
    --clr-border-r:  rgba(230, 48, 48, 0.3);
    --clr-white:     #ffffff;

    --header-h:      72px;
    --header-bg:     #0d0d0d;
    --radius:        0px;
    --radius-sm:     2px;
    --radius-lg:     4px;

    --ease:          cubic-bezier(0.22, 1, 0.36, 1);
    --transition:    all 0.3s var(--ease);

    /* Shadows */
    --shadow-red:    0 4px 20px rgba(230, 48, 48, 0.3);
    --shadow-dark:   0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-card:   0 2px 12px rgba(0, 0, 0, 0.4);

    /* Legacy aliases */
    --primary-color: var(--clr-primary);
    --border-color:  var(--clr-border);
    --text-muted:    var(--clr-muted);
    --text-main:     var(--clr-text);
    --bg-card:       var(--clr-card);
    --clr-secondary: var(--clr-primary);
    --clr-border2:   var(--clr-border-r);

    /* Glow aliases */
    --glow-primary:  var(--shadow-red);
    --glow-crimson:  var(--shadow-red);
    --glow-accent:   var(--shadow-red);
    --clr-accent2:   #888;
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Barlow', sans-serif;
    color: var(--clr-text);
    background-color: var(--clr-bg);
    line-height: 1.65;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Barlow Condensed', sans-serif;
    line-height: 1.1;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--clr-bg); }
::-webkit-scrollbar-thumb { background: var(--clr-primary); border-radius: 2px; }

/* ---- Layout ---- */
.container {
    width: 92%;
    max-width: 1280px;
    margin: 0 auto;
}

/* ambient bg — subtle texture */
.ambient-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(255,255,255,0.012) 0px,
            rgba(255,255,255,0.012) 1px,
            transparent 1px,
            transparent 60px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.012) 0px,
            rgba(255,255,255,0.012) 1px,
            transparent 1px,
            transparent 60px
        );
}
/* Orbs from show/news pages */
.ambient-background .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.06;
    pointer-events: none;
}
.orb-1 { width: 500px; height: 500px; background: var(--clr-primary); top: -10%; left: -10%; }
.orb-2 { width: 400px; height: 400px; background: #444; top: 40%; right: -8%; }
.orb-3 { width: 300px; height: 300px; background: var(--clr-primary); bottom: 0; left: 30%; }

/* ---- Header ---- */
header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--header-h);
    display: flex;
    align-items: center;
    z-index: 2005;
    transition: var(--transition);
    background: var(--header-bg);
    border-bottom: 2px solid var(--clr-primary);
}
header.scrolled {
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.8);
}

/* Also apply for resources pages */
header.glass-nav,
.glass-nav {
    background: var(--header-bg);
    border-bottom: 2px solid var(--clr-primary);
}

.header-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    gap: 2rem;
}

/* Logo */
.logo img {
    height: 36px;
    filter: brightness(1.1);
    transition: var(--transition);
}
.logo img:hover { filter: brightness(1.3); }

/* Nav */
.nav-list ul {
    display: flex;
    gap: 0;
    align-items: center;
}
.nav-list a {
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--clr-text2);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    position: relative;
    transition: var(--transition);
    font-family: 'Barlow', sans-serif;
}
.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 2px;
    background: var(--clr-primary);
    transition: left 0.3s, right 0.3s;
}
.nav-list a:hover {
    color: var(--clr-white);
}
.nav-list a:hover::after { left: 0; right: 0; }

/* Header CTA */
.header-auth .btn-signup {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--clr-primary);
    color: #fff;
    padding: 0.6rem 1.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    border-radius: 0;
    transition: var(--transition);
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.header-auth .btn-signup:hover {
    background: var(--clr-primary-l);
    box-shadow: var(--shadow-red);
    transform: translateY(-1px);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0;
    cursor: pointer;
    width: 42px; height: 42px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    z-index: 2001;
    transition: var(--transition);
}
.mobile-menu-toggle:hover { border-color: var(--clr-primary); }
.mobile-menu-toggle span {
    display: block;
    width: 20px; height: 2px;
    background: var(--clr-white);
    border-radius: 0;
    transition: var(--transition);
}
.mobile-menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 2004;
    opacity: 0; visibility: hidden;
    transition: var(--transition);
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }
body.no-scroll { overflow: hidden; }

/* ---- Global Typography ---- */
.section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-family: 'Barlow Condensed', sans-serif;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--clr-white);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 800;
}
.section-title span { color: var(--clr-primary); }

.section-prefix {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--clr-primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Barlow', sans-serif;
}
.section-prefix::before {
    content: '//';
    color: var(--clr-primary);
    font-weight: 900;
}

.gradient-text {
    color: var(--clr-primary);
    -webkit-text-fill-color: var(--clr-primary);
}

/* ---- Buttons ---- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--clr-primary);
    color: #fff;
    padding: 0.85rem 2.2rem;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-primary:hover {
    background: var(--clr-primary-l);
    box-shadow: var(--shadow-red);
    transform: translateY(-2px);
    color: #fff;
}
.btn-primary:hover::after { opacity: 1; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--clr-white);
    padding: 0.85rem 2.2rem;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 0;
    transition: var(--transition);
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}
.btn-secondary:hover {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
    background: rgba(230,48,48,0.08);
}

/* ---- Footer ---- */
footer {
    background: #0a0a0a;
    padding: 5rem 5% 2rem;
    margin-top: 0;
    border-top: 3px solid var(--clr-primary);
    position: relative;
    overflow: hidden;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}
.footer-brand .footer-desc {
    color: var(--clr-muted);
    font-size: 0.88rem;
    margin-top: 1.2rem;
    max-width: 280px;
    line-height: 1.85;
    font-family: 'Barlow', sans-serif;
}
.footer-nav h4, .footer-contact h4 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--clr-primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}
.footer-nav h4::after, .footer-contact h4::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 30px; height: 2px;
    background: var(--clr-primary);
}
.footer-nav ul, .footer-contact ul {
    display: flex; flex-direction: column; gap: 0.6rem;
}
.footer-nav a { color: var(--clr-muted); font-size: 0.85rem; font-family: 'Barlow', sans-serif; }
.footer-nav a:hover { color: var(--clr-primary); padding-left: 8px; }
.footer-contact li {
    display: flex; align-items: center; gap: 10px;
    color: var(--clr-muted); font-size: 0.85rem;
    font-family: 'Barlow', sans-serif;
}
.footer-contact li i { color: var(--clr-primary); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 2rem;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.78rem;
    color: var(--clr-muted);
    font-family: 'Barlow', sans-serif;
}
.footer-links a { color: var(--clr-primary); font-size: 0.78rem; }
.footer-links a:hover { color: #fff; }

/* ---- Mobile Bottom Bar ---- */
.mobile-bottom-bar { display: none; }

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .nav-list {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0; right: -100%;
        width: 280px; height: 100vh; height: 100dvh;
        background: #0d0d0d;
        padding: 7rem 2rem 2rem;
        z-index: 2000;
        border-left: 2px solid var(--clr-primary);
        box-shadow: -20px 0 60px rgba(0,0,0,0.9);
        transition: right 0.45s var(--ease);
        overflow-y: auto;
    }
    .nav-list.active { right: 0; }
    .nav-list ul { flex-direction: column; gap: 0.2rem; }
    .nav-list a { font-size: 0.9rem; padding: 0.8rem 1rem; display: block; }

    .mobile-menu-toggle { display: flex; }
    .header-auth .btn-signup { display: none; }
    .header-container { padding: 0 1.5rem; }

    .footer-top { grid-template-columns: 1fr; gap: 2.5rem; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
    .section-title { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .mobile-bottom-bar {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        position: fixed;
        bottom: 0; left: 0; width: 100%;
        background: rgba(10, 10, 10, 0.98);
        border-top: 2px solid var(--clr-primary);
        padding: 10px 12px;
        z-index: 1005;
        gap: 8px;
        align-items: stretch;
    }
    .mobile-bottom-bar > a {
        width: 100%;
        text-align: center;
        padding: 12px 8px;
        font-family: 'Barlow', sans-serif;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.72rem;
        letter-spacing: 0.5px;
        border-radius: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-bottom-bar .btn-login {
        border: 2px solid rgba(255,255,255,0.2);
        color: var(--clr-white);
    }
    .mobile-bottom-bar .btn-register {
        background: var(--clr-primary);
        color: #fff;
        box-shadow: var(--shadow-red);
    }
    .mobile-bottom-bar .btn-torneios-quick {
        flex-direction: column;
        gap: 2px;
        padding: 8px 10px;
        min-width: 64px;
        border: 2px solid rgba(230, 48, 48, 0.55);
        color: var(--clr-primary);
        background: rgba(230, 48, 48, 0.1);
        font-size: 0.58rem;
        line-height: 1.1;
    }
    .mobile-bottom-bar .btn-torneios-quick i {
        font-size: 1.05rem;
        color: var(--clr-primary-l);
    }
    .mobile-bottom-bar .btn-torneios-quick:hover {
        background: rgba(230, 48, 48, 0.2);
        color: #fff;
    }
    body { padding-bottom: 72px; }
}