/* ============================================
   Pink Horizon - Mobile / Responsive Overrides
   Loaded AFTER style.css + gamemodes.css to cleanly override.
   2026-06-03
   ============================================ */

/* Generelle Tap-Optimierung + horizontale-Scroll-Prevention */
html, body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    overflow-x: hidden;
    overscroll-behavior-x: none;
}
a, button, input, select, textarea {
    -webkit-tap-highlight-color: rgba(255, 105, 180, 0.18);
}
img, video, svg {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Tablet (≤ 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .container { padding: 0 18px; }
    .nav-container { padding: 0 18px; }
    .nav-links { gap: 20px; }
    .nav-links a { font-size: 0.85rem; }
    .section { padding: 80px 0; }
    .section-title { font-size: 2.2rem; }
    .gamemodes-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .leaderboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   Phone (≤ 768px)
   ============================================ */
@media (max-width: 768px) {
    .container { padding: 0 16px; }

    /* ── Navigation: sauberes Mobile-Drawer ──────────── */
    .nav-container { padding: 0 16px; min-height: 56px; }
    .nav-logo { font-size: 1.25rem; }

    .nav-links, .nav-actions { display: none; }
    .nav-toggle { display: flex; }

    /* Im Mobile-Open Mode wird der nav-container zum Drawer:
       Logo + Burger bleiben in Row 1, nav-links + nav-actions
       brechen in eigene Rows (order steuert Reihenfolge). */
    .navbar.mobile-open {
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 12px 30px rgba(0,0,0,0.4);
    }
    .navbar.mobile-open .nav-container {
        flex-wrap: wrap;
        align-items: center;
    }
    .navbar.mobile-open .nav-logo { order: 1; }
    .navbar.mobile-open .nav-toggle { order: 2; }
    .navbar.mobile-open .nav-links {
        order: 3;
        display: flex !important;
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin-top: 12px;
        padding: 8px 0 0;
        border-top: 1px solid rgba(255,255,255,0.06);
        border-bottom: none;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        background: transparent !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }
    .navbar.mobile-open .nav-links li { width: 100%; }
    .navbar.mobile-open .nav-links a {
        display: block;
        padding: 14px 8px;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .navbar.mobile-open .nav-links a:hover {
        background: rgba(255, 105, 180, 0.06);
        color: var(--pink);
    }
    .navbar.mobile-open .nav-links a::after { display: none; }

    .navbar.mobile-open .nav-actions {
        order: 4;
        display: flex !important;
        width: 100%;
        padding: 14px 0 16px;
        gap: 12px;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
    .navbar.mobile-open .nav-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 12px 18px;
        font-size: 0.95rem;
        min-height: 48px;
    }

    /* Burger-Animation */
    .nav-toggle {
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
    }
    .navbar.mobile-open .nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .navbar.mobile-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }
    .navbar.mobile-open .nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* ── Hero ──────────────────────────────────────── */
    .hero {
        min-height: auto;
        padding: 100px 18px 50px;
    }
    .hero::before, .hero::after {
        animation: none;
    }
    .title-line {
        font-size: 0.95rem;
        letter-spacing: 2px;
    }
    .title-main.graffiti {
        font-size: clamp(2.4rem, 11vw, 4rem);
        letter-spacing: 3px;
        padding-bottom: 20px;
    }
    .graffiti-letter {
        text-shadow: 1px 1px 0 #a0004e, 0 0 15px rgba(255, 105, 180, 0.3);
    }
    .graffiti-white {
        text-shadow: 1px 1px 0 rgba(100, 100, 100, 0.5), 0 0 12px rgba(255, 255, 255, 0.15);
    }
    .drip-container {
        height: 30px;
    }
    .drip { height: calc(var(--h) * 0.6); }
    /* Nur jeden 2. Drip auf Mobile zeigen → weniger visuelles Geblubber */
    .drip:nth-child(odd) { display: none; }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.55;
        padding: 0 4px;
        margin: 18px auto 22px;
        max-width: 100%;
    }

    /* IP-Box */
    .ip-box {
        gap: 10px;
        padding: 12px 18px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        max-width: 360px;
    }
    .ip-label { font-size: 0.78rem; width: 100%; text-align: center; }
    .ip-address {
        font-size: 1.05rem;
        word-break: break-all;
        text-align: center;
    }
    .ip-copy {
        font-size: 0.7rem;
        padding: 6px 14px;
    }

    .hero-badges {
        gap: 14px 22px;
        margin-top: 26px;
    }
    .badge-icon { font-size: 1.2rem; }
    .badge-text { font-size: 0.65rem; }

    .server-status-bar {
        gap: 10px 16px;
        margin-top: 12px;
    }
    .srv-status { font-size: 0.72rem; }
    .srv-status small { font-size: 0.65rem; }

    .hero-scroll { display: none; }

    /* ── Sections ──────────────────────────────────── */
    .section { padding: 70px 0; }
    .section-title {
        font-size: 1.9rem;
        line-height: 1.15;
        padding: 0 8px;
    }
    .section-subtitle {
        font-size: 0.95rem;
        padding: 0 8px;
    }

    /* ── Buttons ───────────────────────────────────── */
    .btn {
        padding: 11px 18px;
        font-size: 0.9rem;
        min-height: 44px;
    }
    .btn-lg {
        padding: 14px 22px;
        font-size: 1rem;
    }

    /* ── Game-Mode Cards ───────────────────────────── */
    .gamemodes-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    .gamemode-card {
        padding: 22px 20px;
    }
    .gamemode-icon {
        width: 60px;
        height: 60px;
    }
    .gamemode-card h3 { font-size: 1.2rem; }

    /* ── Stats / Leaderboard ───────────────────────── */
    .leaderboard-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    .stat-highlight {
        padding: 1rem 1.5rem;
    }
    .stat-number { font-size: 1.8rem; }
    .stat-label { font-size: 0.8rem; }
    .lb-name { font-size: 0.88rem; }
    .lb-value { font-size: 0.78rem; }

    /* ── Team ──────────────────────────────────────── */
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
    .team-skin { width: 64px; }
    .team-name { font-size: 0.9rem; }

    /* ── Ranks ─────────────────────────────────────── */
    .ranks-grid {
        grid-template-columns: 1fr !important;
        gap: 18px;
    }
    .rank-card {
        padding: 22px 18px;
    }

    /* ── Tabs (Cmd / Rank / Vote-Server) ───────────── */
    .commands-tabs, .ranks-tabs, .vs-tabs {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }
    .cmd-tab, .rank-tab, .vs-tab {
        padding: 10px 14px;
        font-size: 0.82rem;
        min-height: 40px;
        white-space: nowrap;
    }

    /* ── Cmd-Grid + Cmd-Card ───────────────────────── */
    .cmd-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .cmd-card {
        padding: 16px;
    }
    .cmd-card code {
        font-size: 0.85rem;
        word-break: break-word;
    }

    /* ── Vote-Section ──────────────────────────────── */
    .vote-container {
        max-width: 100%;
        padding: 22px 18px;
    }

    /* ── Links-Grid (Footer-Bereich) ───────────────── */
    .links-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .link-card {
        padding: 18px;
    }

    /* ── Footer ────────────────────────────────────── */
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 22px;
        text-align: left;
    }
    .footer-links {
        flex-wrap: wrap;
        gap: 12px 20px;
    }
    .footer-links a {
        font-size: 0.88rem;
        padding: 4px 0;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        font-size: 0.78rem;
    }

    /* ── Touch-Effekte aus ─────────────────────────── */
    .cursor-dot, .cursor-trail { display: none !important; }
    .particles { opacity: 0.4; }

    /* Hover-Tilt aus (Touch hat keinen hover) */
    .gamemode-card:hover,
    .rank-card:hover,
    .link-card:hover,
    .team-card:hover,
    .leaderboard-card:hover {
        transform: translateY(-3px) !important;
    }

    /* ── Befehle-Seite ─────────────────────────────── */
    .cmd-toolbar {
        flex-direction: column;
        gap: 10px;
        margin: 1.4rem 0 1rem;
    }
    .cmd-search {
        flex: 1 1 100%;
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    .cmd-cat-btn {
        padding: 9px 14px;
        font-size: 0.82rem;
        min-height: 40px;
    }
    .cmd-stats {
        gap: 0.8rem;
        font-size: 0.82rem;
    }
    .cmd-category {
        margin: 1.8rem 0;
    }
    .cmd-category h3 {
        font-size: 1.15rem;
    }
    .cmd-cat-desc {
        font-size: 0.85rem;
        margin-left: 0.6rem;
    }

    /* Tabellen: horizontaler Scroll-Wrapper */
    .cmd-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        font-size: 0.85rem;
    }
    .cmd-table thead, .cmd-table tbody, .cmd-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    .cmd-table th, .cmd-table td {
        padding: 0.55rem 0.7rem;
        font-size: 0.82rem;
        word-break: break-word;
        white-space: normal;
    }
    .cmd-table code {
        font-size: 0.78em;
        padding: 0.1rem 0.35rem;
        word-break: break-word;
        white-space: normal;
    }

    /* ── Legal-Pages ───────────────────────────────── */
    .legal-page {
        padding: 100px 16px 60px;
    }
    .legal-page .legal-section {
        padding: 1.1rem 1.2rem;
    }
    .legal-page h2 { font-size: 1.05rem; }
    .legal-page h3 { font-size: 0.95rem; }
    .legal-page p, .legal-page li {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    /* ── Gamemode-Detail-Page Hero ─────────────────── */
    .gm-hero {
        padding: 100px 18px 40px !important;
        min-height: auto !important;
    }
    .gm-hero h1, .gm-hero-title {
        font-size: clamp(1.8rem, 7vw, 2.6rem) !important;
        line-height: 1.15 !important;
    }
    .gm-hero-subtitle, .gm-subtitle {
        font-size: 0.95rem !important;
    }
    .gm-section { padding: 50px 0 !important; }
    .gm-section-title {
        font-size: 1.6rem !important;
        line-height: 1.2;
    }
    .gm-back {
        top: 72px !important;
        left: 12px !important;
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    .gm-hero-icon {
        width: 64px !important;
        height: 64px !important;
        font-size: 1.4rem !important;
    }
    .feature-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .feature-card {
        padding: 18px !important;
    }
    .cmd-ref-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .tutorial-step-lg {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 16px !important;
    }
    .tutorial-steps-lg::before {
        display: none !important;
    }
    .gm-cta {
        padding: 36px 20px !important;
    }
    .gm-cta h2 { font-size: 1.6rem; }
    .gm-cta p { font-size: 0.95rem; }
}

/* ============================================
   Small Phone (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .nav-container { padding: 0 14px; }
    .nav-logo { font-size: 1.1rem; }

    .hero {
        padding: 92px 14px 40px;
    }
    .title-line {
        font-size: 0.82rem;
        letter-spacing: 1.5px;
    }
    .title-main.graffiti {
        font-size: clamp(2rem, 10vw, 3rem);
        letter-spacing: 2px;
        padding-bottom: 14px;
    }
    .graffiti-space {
        width: 0.3em;
    }
    .hero-subtitle {
        font-size: 0.92rem;
        margin: 14px auto 18px;
    }
    .ip-box {
        padding: 10px 14px;
        max-width: 100%;
    }
    .ip-address {
        font-size: 0.95rem;
    }
    .hero-badges {
        gap: 12px 18px;
        margin-top: 20px;
    }
    .badge-icon { font-size: 1.05rem; }
    .badge-text { font-size: 0.6rem; letter-spacing: 0.5px; }

    .section { padding: 56px 0; }
    .section-title {
        font-size: 1.55rem;
    }
    .section-subtitle {
        font-size: 0.88rem;
    }

    .gamemode-card {
        padding: 18px 16px;
    }
    .gamemode-card h3 { font-size: 1.1rem; }
    .gamemode-icon {
        width: 52px;
        height: 52px;
    }

    .stat-highlight { padding: 0.9rem 1.2rem; }
    .stat-number { font-size: 1.6rem; }

    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.8rem;
    }
    .team-skin { width: 54px; }
    .team-name { font-size: 0.82rem; }
    .team-rank { font-size: 0.7rem; }

    .cmd-card { padding: 14px; }
    .cmd-card code {
        font-size: 0.8rem;
    }

    .cmd-tab, .rank-tab, .vs-tab {
        padding: 9px 12px;
        font-size: 0.78rem;
    }

    .footer-links {
        gap: 10px 16px;
    }
    .footer-links a { font-size: 0.84rem; }
    .footer-bottom { font-size: 0.72rem; }

    /* Befehle-Seite kleiner */
    .cmd-table th, .cmd-table td {
        padding: 0.45rem 0.55rem;
        font-size: 0.76rem;
    }

    /* Legal kleiner */
    .legal-page {
        padding: 92px 12px 50px;
    }
    .legal-page .legal-section {
        padding: 1rem 1rem;
    }
}

/* ============================================
   Sehr kleine Geräte (≤ 360px) — iPhone SE 1, kleine Androids
   ============================================ */
@media (max-width: 360px) {
    .title-main.graffiti {
        font-size: 1.85rem;
        letter-spacing: 1.5px;
    }
    .hero-subtitle { font-size: 0.85rem; }
    .ip-address { font-size: 0.85rem; }
    .section-title { font-size: 1.35rem; }
    .btn { padding: 10px 14px; font-size: 0.82rem; }
}

/* ============================================
   Landscape-Mode auf Phones (kürzeres Hero)
   ============================================ */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: auto;
        padding: 80px 18px 30px;
    }
    .title-main.graffiti {
        font-size: 2.4rem;
        padding-bottom: 10px;
    }
    .drip-container { display: none; }
    .hero-subtitle { font-size: 0.9rem; margin: 10px auto 14px; }
    .hero-badges { gap: 12px 22px; margin-top: 14px; }
}

/* ============================================
   Touch-only-Devices: Hover-Only-Effekte abschalten
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .gamemode-card:hover::before,
    .gamemode-card:hover::after {
        opacity: 0 !important;
    }
    .ip-box:hover {
        transform: none;
        box-shadow: none;
    }
    .cursor-dot, .cursor-trail { display: none !important; }
}
