:root {
    --primary-bg: #0f0f0f;
    --secondary-bg: #1a1a1a;
    --card-bg: #252525;
    --accent-primary: #ffffff;
    --accent-secondary: #888888;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --border-color: #404040;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    min-height: 100vh;
}

.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

header, main, footer {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-header {
    background: var(--primary-bg);
    border-bottom: 2px solid var(--accent-primary);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.main-header.hide {
    transform: translateY(-100%);
}

.header-content {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    align-items: center;
    gap: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-self: start;
}

.logo {
    max-height: 80px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.main-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    grid-column: 2;
}

.nav-btn {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    padding: 0.8rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.5s ease;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.nav-btn.active {
    background: var(--accent-primary);
    color: var(--primary-bg);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.main-content {
    padding: 4rem 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.title-accent {
    width: 150px;
    height: 4px;
    background: var(--accent-primary);
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: expandLine 0.8s ease-out forwards;
    transform-origin: center;
}

@keyframes expandLine {
    0% {
        width: 0;
    }
    100% {
        width: 150px;
    }
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.game-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease;
    animation: cardAppear 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes cardAppear {
    to {
        opacity: 1;
    }
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }

.game-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.game-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .game-image {
    transform: scale(1.1);
}

.game-info {
    padding: 1.5rem;
}

.game-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.game-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    min-height: 80px;
}

.game-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: var(--accent-primary);
    color: var(--primary-bg);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.game-link:hover {
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.team-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    min-height: 60vh;
    max-width: 1400px;
    margin: 0 auto;
}

.team-founders-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.team-developers-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.team-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    position: relative;
    transition: all 0.4s ease;
    animation: cardAppear 0.6s ease-out forwards;
    opacity: 0;
}

.team-card:nth-child(1) { animation-delay: 0.1s; }
.team-card:nth-child(2) { animation-delay: 0.2s; }
.team-card:nth-child(3) { animation-delay: 0.3s; }

.team-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.team-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: block;
    border: 4px solid var(--accent-primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
    object-fit: cover;
}

.team-card:hover .team-avatar {
    transform: scale(1.1);
}

.team-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--accent-primary);
}

.team-bio {
    color: var(--text-secondary);
    margin: 0.5rem 0 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.team-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: var(--accent-primary);
    color: var(--primary-bg);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    text-align: center;
}

.team-link:hover {
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.social-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    min-height: 50vh;
    padding-bottom: 4rem;
}

.social-buttons-row {
    display: flex;
    justify-content: center;
    gap: 6rem;
}

.social-button {
    text-decoration: none;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.social-button:hover {
    transform: translateY(-10px);
}

.social-icon-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    padding: 30px;
}

.social-icon-circle svg {
    width: 100%;
    height: 100%;
    fill: var(--text-primary);
    transition: fill 0.3s ease;
}

.social-button.youtube:hover .social-icon-circle {
    background: #FF0000;
    border-color: #FF0000;
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.6);
}

.social-button.youtube:hover .social-icon-circle svg {
    fill: #ffffff;
}

.social-button.discord:hover .social-icon-circle {
    background: #5865F2;
    border-color: #5865F2;
    box-shadow: 0 10px 40px rgba(88, 101, 242, 0.6);
}

.social-button.discord:hover .social-icon-circle svg {
    fill: #ffffff;
}

.social-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    max-width: 220px;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-card {
    background: transparent;
    padding: 3rem;
    border: none;
    position: relative;
    animation: cardAppear 0.6s ease-out forwards;
    opacity: 0;
}

.about-card:nth-child(1) { animation-delay: 0.1s; }
.about-card:nth-child(2) { animation-delay: 0.2s; }

.about-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    letter-spacing: 0.15em;
    text-align: left;
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.9;
    text-align: left;
    font-size: 1rem;
    position: relative;
}

.typewriter {
    display: inline-block;
    opacity: 1;
    position: relative;
}

.about-card.typing .typewriter::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--accent-primary);
    margin-left: 2px;
    animation: blink 0.75s step-end infinite;
    vertical-align: text-bottom;
}

.about-card.typing-done .typewriter {
    opacity: 1;
}

@keyframes blink {
    50% {
        background: transparent;
    }
}

.stats-section {
    margin-top: 4rem;
    text-align: center;
}

.stats-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    letter-spacing: 0.15em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.stat-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.stat-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    height: 3rem;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.stat-digit-wrapper {
    display: inline-block;
    height: 3rem;
    overflow: hidden;
    position: relative;
}

.stat-digit-strip {
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.stat-digit-strip span {
    display: block;
    height: 3rem;
    line-height: 3rem;
}

.stat-char {
    display: inline-block;
    height: 3rem;
    line-height: 3rem;
}

.stat-card .stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.applications-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Prevent momentum scrolling on mobile for the container */
@media (max-width: 768px) {
    .applications-container {
        overflow: hidden;
        overscroll-behavior: contain;
    }
}

.application-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.app-btn {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.15em;
    padding: 1rem 2rem;
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.app-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.app-btn.active {
    background: var(--accent-primary);
    color: var(--primary-bg);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.form-container {
    position: relative;
    width: 100%;
    min-height: 1200px;
    overflow: visible;
}

/* Wrapper to handle touch events on mobile */
.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
}

.application-form {
    display: none;
    width: 100%;
    height: 1200px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    touch-action: pan-y;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
}

.application-form.active {
    display: block;
}

.main-footer {
    background: var(--secondary-bg);
    border-top: 2px solid var(--accent-primary);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.footer-text {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.6rem, 2.5vw, 0.9rem);
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    margin: 0;
    white-space: nowrap;
}

.footer-email {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: clamp(0.6rem, 2.5vw, 0.9rem);
    transition: color 0.3s ease;
    white-space: nowrap;
}

.footer-email:hover {
    color: var(--accent-primary);
}

@media (max-width: 768px) {
    .header-content {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 1.5rem;
    }
    
    .logo-container {
        justify-content: center;
    }
    
    .logo {
        max-height: 60px;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .nav-btn {
        font-size: 0.75rem;
        padding: 0.6rem 1rem;
        flex: 1;
        min-width: 80px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stats-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .games-grid,
    .team-grid,
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .game-card,
    .team-card,
    .social-card,
    .about-card {
        margin-bottom: 0;
    }
    
    .social-links {
        gap: 1rem;
    }
    
    .social-card {
        padding: 1.5rem;
    }
}

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.about-section-container {
    position: relative;
}

.about-full-section {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-full-section.active {
    opacity: 1;
    transform: translateY(0);
}

.about-full-section:first-child {
    opacity: 1;
    transform: translateY(0);
}

.about-big-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
    color: var(--accent-primary);
}

.about-big-text {
    font-size: 1.3rem;
    line-height: 2;
    color: var(--text-secondary);
    max-width: 900px;
}

.about-full-section .stats-grid {
    margin-top: 2rem;
    max-width: 1000px;
}

@media (max-width: 768px) {
    .about-big-title {
        font-size: 2.5rem;
    }
    
    .about-big-text {
        font-size: 1.1rem;
    }
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    will-change: transform;
    transform: translateZ(0);
}

.particle {
    will-change: transform;
    transform: translateZ(0);
}

.game-card,
.team-card,
.social-card,
.stat-card,
.about-full-section {
    will-change: transform, opacity;
    transform: translateZ(0);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 480px) {
    .about-big-title {
        font-size: 2rem;
        letter-spacing: 0.1em;
    }
    
    .about-big-text {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .social-card {
        padding: 2rem 1.5rem;
    }
    
    .social-icon {
        width: 60px;
        height: 60px;
    }
    
    .social-card h3 {
        font-size: 1.5rem;
    }
    
    .social-card p {
        font-size: 0.95rem;
    }
    
    .coming-soon-text {
        font-size: 2.5rem;
        letter-spacing: 0.15em;
    }
}

@media (max-width: 768px) {
    .social-buttons-row {
        gap: 3rem;
    }
    
    .social-button {
        gap: 1.5rem;
    }
    
    .social-icon-circle {
        width: 100px;
        height: 100px;
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .social-buttons-row {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }
    
    .social-button {
        gap: 1rem;
    }
    
    .social-icon-circle {
        width: 90px;
        height: 90px;
        padding: 22px;
    }
    
    .social-desc {
        font-size: 1rem;
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .logo-container {
        display: none;
    }
    
    .header-content {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .main-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.4rem;
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }
    
    .nav-btn {
        font-size: 0.75rem;
        padding: 0.7rem 0.6rem;
        letter-spacing: 0.05em;
        white-space: nowrap;
        flex: 1;
        min-width: 0;
    }
    
    .main-header {
        padding: 1rem 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 1rem;
        max-width: 900px;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        font-size: 0.65rem;
        padding: 0.6rem 0.4rem;
        letter-spacing: 0.03em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .application-selector {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .app-btn {
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }
    
    .applications-container {
        padding: 1rem 0.5rem;
    }
    
    .form-container {
        min-height: 1400px;
        isolation: isolate;
        overscroll-behavior: contain;
    }
    
    .application-form {
        height: 1400px;
        /* Ensure iframe can scroll independently on mobile */
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain;
    }
}

@media (max-width: 480px) {
    .app-btn {
        font-size: 0.8rem;
        padding: 0.7rem 1rem;
        letter-spacing: 0.1em;
    }
    
    .form-container {
        min-height: 1200px;
    }
    
    .application-form {
        height: 1200px;
    }
}

html {
    background-color: #0f0f0f;
    min-height: 100vh;
}

.social-buttons-row {
    display: flex;
    gap: 6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.video-section {
    margin-top: 2rem;
    text-align: center;
}

.video-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.youtube-widget {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background: var(--card-bg);
    margin: 0 auto;
}

.youtube-widget iframe {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .video-title {
        font-size: 1.2rem;
    }
    
    .youtube-widget {
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .team-developers-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .team-founders-row,
    .team-developers-row {
        grid-template-columns: 1fr;
    }
}

.team-role-badge {
    padding: 0.4rem 0.8rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.role-founder {
    background: var(--accent-primary);
    color: var(--primary-bg);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.role-developer {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.team-card {
    position: relative;
}