/* FITSHK STYLES */
/* ============================================ */

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    /* position: relative removed - can cause iOS issues */
}

/* When content is shown, allow scrolling */
body.content-active {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling - DAS IST DER WICHTIGSTE FIX */
}

/* iOS Fix: When language gate is open, prevent body scroll */
body.language-gate-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Keep header clickable */
header h1 {
    pointer-events: auto !important;
    cursor: pointer;
}

/* Make header always visible and above gates */
header {
    width: 100%;
    padding: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100; /* Normal z-index */
    position: relative;
}

/* Hide main header when language gate is open */
body.language-gate-open #mainHeader {
    display: none;
}

/* Language Gate Header - scrollt mit */
.language-gate-header {
    width: 100%;
    padding: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem; /* Perfekter Abstand */
}

.language-gate-header h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    margin: 0;
    animation: glitch 2s infinite;
    cursor: default; /* Kein Pointer - hat keine Funktion */
}

/* Fixed header on mobile */
@media (max-width: 768px) {
    /* Header when content is active (nicht bei Language Gate) */
    body.content-active header#mainHeader {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        padding: 1.5rem 0;
        z-index: 10001;
        width: 100%;
    }
    
    /* Language Gate Header auf Mobile */
    .language-gate-header h1 {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }
}

/* LOGO */
h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    margin: 0;
    animation: glitch 2s infinite;
    transition: transform 0.3s ease;
}

h1:hover {
    transform: scale(1.05);
}

/* GLITCH EFFECT */
@keyframes glitch {
    0%, 100% { 
        text-shadow: 
            0.05em 0 0 #00fffc, -0.025em -0.025em 0 #fc00ff,
            0.025em 0.025em 0 #fffc00;
    }
    15% {
        text-shadow: 
            0.05em 0 0 #00fffc, -0.025em -0.025em 0 #fc00ff,
            0.025em 0.025em 0 #fffc00;
    }
    16% {
        text-shadow: 
            -0.05em -0.025em 0 #00fffc, 0.025em 0.025em 0 #fc00ff,
            -0.05em -0.05em 0 #fffc00;
    }
    49% {
        text-shadow: 
            -0.05em -0.025em 0 #00fffc, 0.025em 0.025em 0 #fc00ff,
            -0.05em -0.05em 0 #fffc00;
    }
    50% {
        text-shadow: 
            0.025em 0.05em 0 #00fffc, 0.025em 0 0 #fc00ff,
            0 -0.05em 0 #fffc00;
    }
    99% {
        text-shadow: 
            0.025em 0.05em 0 #00fffc, 0.025em 0 0 #fc00ff,
            0 -0.05em 0 #fffc00;
    }
}

/* FLYING WORDS BACKGROUND */
.flying-words {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: all;
    z-index: 1;
}

.word {
    position: absolute;
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-weight: bold;
    opacity: 0.2;
    pointer-events: all;
    cursor: grab;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    will-change: transform;
}

.word:hover:not(.dragging) {
    opacity: 1 !important;
    transform: scale(1.5) rotate(360deg);
    z-index: 100;
}

.word.dragging {
    animation: none !important;
    opacity: 1 !important;
    z-index: 1000 !important;
    transition: none !important;
    transform: scale(1.2) !important;
    cursor: grabbing !important;
}

/* Ultra Rare Words */
.word.rare {
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Foreign Script Words */
.word.foreign {
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    opacity: 0.25;
}

@keyframes fly {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(100vw + 350px));
    }
}

@keyframes rainbow {
    to {
        filter: hue-rotate(360deg);
    }
}

/* FITSHK CONTENT STYLES */
.fitshk-content {
    display: none;
    width: 90%;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    color: white;
    z-index: 50;
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

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

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

.fitshk-content h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-top: 0;
    margin-bottom: 1rem;
    animation: none;
}

.fitshk-content p,
.fitshk-content ul {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.fitshk-content strong {
    color: #00fffc;
    text-shadow: 0 0 10px rgba(0, 255, 252, 0.5);
}

/* SOCIAL LINKS - MINIMAL */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: #fff;
    opacity: 0.7;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    width: 28px;
    height: 28px;
}

.social-links a img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
}

/* X Logo needs to be visible on black background */
.social-links a.twitter img {
    filter: brightness(0) invert(1);
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-3px) scale(1.15);
}

.social-links a.tiktok:hover img { filter: drop-shadow(0 0 10px #00f2ea); }
.social-links a.youtube:hover img { filter: drop-shadow(0 0 10px #ff0000); }
.social-links a.twitter:hover img { filter: brightness(0) invert(1) drop-shadow(0 0 10px #1DA1F2); }
.social-links a.reddit:hover img { filter: drop-shadow(0 0 10px #FF4500); }

/* FOOTER - removed, now only in language gate */

/* Gate overlay */
.gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.5s ease;
}

.gate-overlay.active {
    opacity: 1;
}

/* LANGUAGE GATE */
.language-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    z-index: 10000;
    transition: opacity 0.5s ease;
    pointer-events: none;
    overflow: hidden; /* Container selbst nicht scrollbar */
}

/* Inner scrollable content */
.language-gate-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem; /* Header scrollt mit, weniger padding nötig */
    padding-bottom: 20px;
    pointer-events: auto;
}

.language-gate::before {
    display: none;
}

.language-gate-content .subtitle {
    font-size: clamp(1rem, 3vw, 2rem);
    font-weight: 300;
    letter-spacing: 0.2em;
    opacity: 0.8;
    margin-top: 0;
    margin-bottom: 0;
    color: white;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    max-width: 900px;
    width: 90%;
    margin-top: 20px; /* Reduziert von 30px */
    padding: 0 20px;
}

.lang-btn {
    background: rgba(255,255,255,0.02);
    border: 2px solid rgba(255,255,255,0.1);
    color: white;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-4px) scale(1.05);
}

.lang-btn:hover::before {
    width: 200px;
    height: 200px;
}

.lang-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.lang-btn .flag {
    font-size: 48px;
    filter: grayscale(0.2);
    transition: filter 0.3s;
}

.lang-btn:hover .flag {
    filter: grayscale(0);
}

.lang-btn .name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Language Gate Footer - scrollt mit den Flaggen */
.language-gate-footer {
    width: 100%;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.language-gate-footer a {
    color: #00fffc; /* Cyan/grün wie gewünscht */
    text-decoration: none;
    margin: 0 1rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: all 0.3s ease;
    opacity: 0.8;
}

.language-gate-footer a:hover {
    color: #00fffc; /* Bleibt cyan/grün */
    text-shadow: 0 0 10px rgba(0, 255, 252, 0.5);
    opacity: 1;
    transform: translateY(-2px);
}

/* Social Links im language-gate-footer haben gleiche Styles */
.language-gate-footer .social-links {
    margin-bottom: 1rem;
}

/* CRT SCANLINES EFFECT - Disabled on mobile to avoid issues */
@media (min-width: 769px) {
    .language-gate::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.03) 2px,
            rgba(255,255,255,0.03) 4px
        );
        pointer-events: none;
    }
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    /* iOS Scroll Fix - Simple Version */
    body.content-active {
        position: relative;
        height: auto;
    }
    
    /* iOS Fix for language gate scrolling */
    .language-gate-content {
        padding-top: 2rem; /* Header scrollt mit */
        padding-bottom: 20px;
        height: 100vh;
        overflow-y: scroll !important; /* Force scroll on iOS */
        -webkit-overflow-scrolling: touch !important;
    }
    
    .language-gate-footer {
        padding: 1.5rem 1rem;
        margin-top: 30px;
    }
    
    .language-gate-footer a {
        display: inline-block;
        margin: 0.5rem;
    }
    
    .fitshk-content {
        width: 100%;
        padding: 1.5rem;
        margin: 0;
        padding-top: 10rem;
        padding-bottom: 2rem; /* Kein fixer Footer mehr */
    }

    
    .social-links {
        gap: 1rem;
    }
    
    .social-links a {
        width: 24px;
        height: 24px;
    }
    
    .social-links a img {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    h1 {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }
    
    .language-gate-content .subtitle {
        font-size: clamp(0.9rem, 4vw, 1.5rem);
    }
    
    .language-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
        margin-top: 20px; /* Reduziert von 40px */
        margin-bottom: 20px; /* Reduziert von 40px */
    }
    
    .lang-btn {
        padding: 20px 10px;
    }
    
    .lang-btn .flag {
        font-size: 36px;
    }
    
    .lang-btn .name {
        font-size: 11px;
    }
    
    .word {
        font-size: 1rem;
    }
    
    .word.foreign {
        font-size: 1.2rem;
    }
}