:root {
    --maroon: #5a0001;
    --maroon-light: #800000;
    --gold: #ffcc00;
    --gold-light: #ffec80;
    --dark-bg: #1a1a1a;
    --text-light: #f4f4f4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', sans-serif;
    background-color: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(90, 0, 1, 0.05) 0%, transparent 100%),
        url('https://www.transparenttextures.com/patterns/dark-matter.png');
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

body.loading {
    overflow: hidden;
}

/* Page Transition */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

.transition-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #fc8a63 0%, #bc0f34 100%);
}

.action-lines {
    position: absolute;
    width: 200vmax;
    height: 200vmax;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.2) 10deg,
        transparent 20deg,
        rgba(255, 255, 255, 0.2) 30deg,
        transparent 40deg,
        rgba(255, 255, 255, 0.2) 50deg,
        transparent 60deg,
        rgba(255, 255, 255, 0.2) 70deg,
        transparent 80deg,
        rgba(255, 255, 255, 0.2) 90deg,
        transparent 100deg,
        rgba(255, 255, 255, 0.2) 110deg,
        transparent 120deg,
        rgba(255, 255, 255, 0.2) 130deg,
        transparent 140deg,
        rgba(255, 255, 255, 0.2) 150deg,
        transparent 160deg,
        rgba(255, 255, 255, 0.2) 170deg,
        transparent 180deg,
        rgba(255, 255, 255, 0.2) 190deg,
        transparent 200deg,
        rgba(255, 255, 255, 0.2) 210deg,
        transparent 220deg,
        rgba(255, 255, 255, 0.2) 230deg,
        transparent 240deg,
        rgba(255, 255, 255, 0.2) 250deg,
        transparent 260deg,
        rgba(255, 255, 255, 0.2) 270deg,
        transparent 280deg,
        rgba(255, 255, 255, 0.2) 290deg,
        transparent 300deg,
        rgba(255, 255, 255, 0.2) 310deg,
        transparent 320deg,
        rgba(255, 255, 255, 0.2) 330deg,
        transparent 340deg,
        rgba(255, 255, 255, 0.2) 350deg,
        transparent 360deg
    );
    animation: spin 10s linear infinite;
    z-index: 1;
}

.transition-logo {
    position: relative;
    z-index: 2;
    max-width: 300px;
    width: 80%;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(0,0,0,0.5));
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.page-transition.active .transition-logo {
    transform: scale(1);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
header {
    background: #3a0001;
    border-bottom: 4px solid var(--gold);
    padding: 60px 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('logo_background.png');
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.6);
    transform: scale(1.1); /* Prevent blur edges from showing */
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
}

.main-logo {
    max-width: 450px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.8));
    margin-bottom: 10px;
}

.header-subtitle {
    font-family: 'Fredoka', sans-serif;
    color: var(--gold-light);
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 1px;
}

nav {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-link {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
    padding: 10px 30px;
    font-family: 'Fredoka', sans-serif;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--gold);
    color: var(--maroon);
}

.section-title {
    font-family: 'Fredoka', sans-serif;
    color: var(--gold);
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--gold);
}

.tab-content {
    display: none;
    padding: 60px 0;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Home Section */
.home-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.home-main-card {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #3d3d3d;
    padding: 40px;
    border-radius: 12px;
    border-left: 5px solid var(--gold);
}

.home-main-card p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #ccc;
}

.home-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-button {
    padding: 15px 35px;
    font-family: 'Fredoka', sans-serif;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-size: 1.1rem;
    display: inline-block;
}

.discord-btn {
    background-color: #5865F2;
    color: white;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.discord-btn:hover {
    background-color: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}

.secondary-btn {
    border: 2px solid var(--gold);
    color: var(--gold);
}

.secondary-btn:hover {
    background-color: var(--gold);
    color: var(--maroon);
    transform: translateY(-2px);
}

.info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    padding: 25px;
    border-radius: 8px;
}

.info-box h3 {
    font-family: 'Fredoka', sans-serif;
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.quick-links, .nav-guide {
    list-style: none;
}

.quick-links li, .nav-guide li {
    margin-bottom: 12px;
}

.quick-links a {
    color: var(--gold-light);
    text-decoration: none;
    transition: color 0.2s;
}

.quick-links a:hover {
    text-decoration: underline;
}

.nav-guide li strong {
    color: var(--gold);
    display: block;
}

@media (max-width: 992px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

/* Applications Section */
.section-intro {
    text-align: center;
    max-width: 800px;
    margin: -30px auto 50px;
    font-size: 1.1rem;
    color: #bbb;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.app-card {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #3d3d3d;
    padding: 35px;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    border-bottom: 4px solid var(--maroon);
}

.app-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.app-card h3 {
    font-family: 'Fredoka', sans-serif;
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.app-card p {
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.7;
}

.app-card .cta-button {
    width: 100%;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    background: #2a2a2a;
    border: 2px solid #3d3d3d;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-bottom: 5px solid var(--maroon);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.game-card:hover::before {
    transform: translateX(100%);
}

.game-card:hover {
    transform: scale(1.05);
    border-color: var(--gold);
    border-bottom-color: var(--gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 0 10px rgba(212, 175, 55, 0.1);
    cursor: pointer;
}

.game-card h2 {
    font-family: 'Fredoka', sans-serif;
    color: var(--gold-light);
    font-size: 1.5rem;
}

/* Players Grid */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.player-name {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 12px;
    text-align: center;
    border-radius: 4px;
    font-weight: bold;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.player-name:hover {
    background: var(--gold);
    color: var(--maroon);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-color: var(--gold);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #222;
    margin: 5% auto;
    padding: 40px;
    border: 3px solid var(--gold);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    color: var(--text-light);
    line-height: 1.8;
}

#modal-description p {
    margin-bottom: 15px;
}

#modal-description strong {
    color: var(--gold);
}

#modal-description ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

#modal-description li {
    margin-bottom: 8px;
}

.close-modal {
    color: var(--gold);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1001;
}

.close-modal:hover {
    color: #fff;
    transform: rotate(90deg);
}

#modal-title {
    font-family: 'Fredoka', sans-serif;
    color: var(--gold);
    font-size: 2.5rem;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
}

.game-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.gallery-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 2px solid #444;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.gallery-img:hover {
    border-color: var(--gold);
    transform: scale(1.02);
    cursor: pointer;
}

.modal-link {
    color: var(--gold-light);
    text-decoration: underline;
    font-weight: bold;
}

/* Live Stream */
.stream-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 4px solid var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
}

#twitch-embed {
    width: 100%;
    height: 100%;
}

/* Team Scores */
.team-scores-section {
    margin-top: 80px;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.team-card-score {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: transform 0.3s ease;
}

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

.team-card-score h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.team-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}

.team-card-score:hover .team-icon {
    transform: scale(1.1) rotate(5deg);
}

.score-main {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    font-family: 'Fredoka', sans-serif;
}

.player-list {
    text-align: left;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

.player-list p {
    margin: 5px 0;
}

/* Team Colors */
.team-red { border-color: #ff4d4d; color: #ff4d4d; }
.team-orange { border-color: #ffa500; color: #ffa500; }
.team-yellow { border-color: #ffff00; color: #ffff00; }
.team-lime { border-color: #32cd32; color: #32cd32; }
.team-green { border-color: #008000; color: #008000; }
.team-aqua { border-color: #00ffff; color: #00ffff; }
.team-blue { border-color: #4d4dff; color: #4d4dff; }
.team-cyan { border-color: #00ced1; color: #00ced1; }
.team-purple { border-color: #bf00ff; color: #bf00ff; }
.team-pink { border-color: #ff69b4; color: #ff69b4; }

/* Adjust individual scores text color to keep them readable but distinct */
.team-card-score .player-list p {
    color: rgba(255, 255, 255, 0.8);
}

/* Footer */
footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #666;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border: 4px solid var(--gold);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-lightbox:hover {
    color: var(--gold);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        padding: 40px 0 30px;
    }

    .main-logo {
        max-width: 300px;
    }

    .header-subtitle {
        font-size: 1rem;
        padding: 0 20px;
    }

    nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 10px 5px;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }

    nav::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }

    .nav-link {
        flex: 0 0 auto;
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .tab-content {
        padding: 30px 0;
    }

    /* Home section */
    .home-main-card {
        padding: 25px;
    }

    .home-main-card p {
        font-size: 1rem;
    }

    .home-actions {
        flex-direction: column;
    }

    .cta-button {
        width: 100%;
        text-align: center;
    }

    /* Modal Adjustments */
    .modal-content {
        padding: 20px;
        margin: 10% auto;
        width: 95%;
    }

    #modal-title {
        font-size: 1.8rem;
    }

    .game-gallery {
        grid-template-columns: 1fr;
    }

    /* Live Stream */
    .stream-container {
        border-width: 2px;
    }

    /* Teams Grid */
    .teams-grid {
        grid-template-columns: 1fr;
    }

    .team-icon {
        width: 60px;
        height: 60px;
    }

    .score-main {
        font-size: 2rem;
    }

    .close-lightbox {
        right: 20px;
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .main-logo {
        max-width: 220px;
    }

    .header-subtitle {
        font-size: 0.9rem;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
