/* Step 140 - Mobile-only layout
   Diese Datei enthält nur Regeln für kleine Bildschirme.
   Desktop-Layout bleibt in style.css und coffee-duel.css unverändert. */

@media (max-width: 760px) {
    .clean-main-header {
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 14px;
        padding: 0 10px 10px;
        border-radius: 0 0 18px 18px;
        background-image: none !important;
        background-color: #020914;
        background-size: auto !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .mobile-header-banner-img {
        display: block !important;
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        height: 82px;
        object-fit: cover;
        object-position: center center;
        z-index: 1;
        pointer-events: none;
        user-select: none;
        border-radius: 0 0 14px 14px;
        flex: 0 0 auto;
    }

    .header-right-controls {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        z-index: 30;
        display: flex;
        justify-content: center;
        width: calc(100% - 20px);
        margin: 6px auto 0;
        flex: 0 0 auto;
    }

    .header-profile-button {
        width: auto;
        min-width: 116px;
        height: 38px;
        padding: 0 8px;
        gap: 8px;
        border-radius: 14px;
        overflow: hidden;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(180deg, rgba(8,35,70,.92), rgba(4,16,34,.98));
        border-color: rgba(104,199,255,.82);
        box-shadow: 0 0 14px rgba(65,174,255,.28), inset 0 0 11px rgba(102,205,255,.08);
    }

    .header-profile-avatar {
        display: inline-flex !important;
        width: 24px;
        height: 24px;
        min-width: 24px;
        border-radius: 8px;
        order: 1;
    }

    .user-info {
        display: none;
    }

    .header-profile-chevron {
        display: inline-flex !important;
        width: 24px;
        height: 24px;
        min-width: 24px;
        margin-left: 0;
        border-radius: 8px;
        color: transparent;
        font-size: 0;
        transform: none !important;
        order: 2;
        background: radial-gradient(circle at 35% 25%, rgba(122, 214, 255, .24), rgba(4, 18, 38, .96));
    }

    .header-profile-chevron::before {
        content: "";
        width: 12px;
        height: 2px;
        border: 0;
        background: #e7fbff;
        transform: none !important;
        box-shadow: 0 -4px 0 #e7fbff, 0 4px 0 #e7fbff;
        filter: drop-shadow(0 0 5px rgba(110, 218, 255, .85));
    }

    .header-profile-logout-icon {
        width: 24px;
        height: 24px;
        min-width: 24px;
        margin-left: 0;
        font-size: .78rem;
        order: 3;
    }

    .profile-menu-popover {
        width: calc(100vw - 20px);
        right: 10px !important;
        left: auto !important;
        max-width: 360px;
    }

    html,
    body {
        overflow-x: hidden;
    }

    body {
        min-width: 0;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 10px 28px;
    }

    .dashboard-desktop-shell {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        min-height: auto;
        padding: 10px;
        border-radius: 22px;
    }

    .live-cockpit,
    .bundesliga-cockpit {
        display: none;
    }

    .app-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        min-width: 0;
    }

    .dashboard-open-tips-card {
        grid-column: 1 / -1;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 10px;
        min-height: 0;
        padding: 14px;
        border-radius: 18px;
    }

    .dashboard-open-tips-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 1.15rem;
    }

    .dashboard-open-tips-head strong {
        font-size: .98rem;
    }

    .dashboard-open-tips-head span {
        font-size: .78rem;
        line-height: 1.35;
    }

    .dashboard-open-tips-action {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 40px;
    }

    .dashboard-open-tip-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 9px 10px;
    }

    .dashboard-open-tip-team-home,
    .dashboard-open-tip-team-away {
        justify-content: flex-start;
        text-align: left;
    }

    .dashboard-open-tip-time {
        text-align: left;
        white-space: normal;
    }

    .app-tile {
        min-height: 88px;
        padding: 12px 8px;
        border-radius: 13px;
    }

    .app-tile h2 {
        margin: 0 0 6px;
        font-size: .92rem;
        line-height: 1.08;
        letter-spacing: -.02em;
    }

    .app-tile p {
        font-size: .64rem;
        line-height: 1.24;
    }

    .app-tile > span {
        right: 8px;
        font-size: 1rem;
    }

    .dashboard-coffee-duel-panel {
        grid-column: 1 / -1;
        grid-row: auto;
        width: 100%;
    }

    .coffee-duel-shell {
        gap: 10px;
    }

    .coffee-duel-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        min-height: 0;
        padding: 16px;
        border-radius: 18px;
    }

    .coffee-duel-hero h3,
    .coffee-history-head strong {
        font-size: 1.1rem;
    }

    .coffee-duel-hero p,
    .coffee-history-head small {
        font-size: .78rem;
        line-height: 1.35;
    }

    .coffee-duel-primary-action {
        width: 100%;
        min-height: 42px;
    }

    .coffee-duel-active-counter {
        min-height: 34px;
        font-size: .82rem;
    }

    .coffee-duel-active-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .coffee-duel-active-grid.is-empty {
        grid-template-columns: 1fr;
    }

    .coffee-duel-card,
    .coffee-duel-empty-card {
        border-radius: 16px;
        padding: 12px;
    }

    .coffee-duel-card {
        min-height: 220px;
    }

    .coffee-duel-empty-card {
        min-height: 76px;
        font-size: .82rem;
    }

    .coffee-history-shell {
        border-radius: 18px;
    }

    .coffee-history-head {
        padding: 14px;
        gap: 10px;
    }

    .coffee-history-body {
        padding: 0 14px 14px;
    }
}

@media (max-width: 430px) {
    .clean-main-header {
        height: 92px;
        min-height: 92px;
        background-size: auto 88px;
        background-position: left center;
    }

    .header-profile-button {
        width: 112px;
        height: 42px;
        padding: 0 7px;
        gap: 6px;
    }

    .header-profile-avatar,
    .header-profile-logout-icon,
    .header-profile-chevron {
        width: 29px;
        height: 29px;
        min-width: 29px;
    }

    .container {
        padding-left: 6px;
        padding-right: 6px;
    }

    .dashboard-desktop-shell {
        padding: 8px;
    }

    .app-grid {
        gap: 7px;
    }

    .app-tile {
        min-height: 82px;
        padding: 10px 7px;
    }

    .app-tile h2 {
        font-size: .84rem;
    }

    .app-tile p {
        font-size: .6rem;
    }

    .coffee-duel-active-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }
}

/* Step 149 - Mobile: Headerbild frei zentriert, Profil darunter */
@media (max-width: 760px) {
    .clean-main-header {
        height: auto;
        min-height: 0;
        margin: 0 0 12px;
        padding: 0 10px 10px;
        border-radius: 0 0 18px 18px;
        background: none !important;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .clean-main-header::before {
        content: "";
        display: block;
        width: 100%;
        height: 78px;
        border-radius: 0 0 16px 16px;
        background-image: url("images/header/bundesliga-header-title-mobile.png?v=2026-06-27-step149") !important;
        background-size: contain;
        background-position: center center;
        background-repeat: no-repeat;
        background-color: #020914;
        border-bottom: 1px solid rgba(82, 179, 255, 0.78);
        box-shadow: 0 0 0 1px rgba(111, 204, 255, 0.14) inset, 0 0 18px rgba(45, 158, 255, 0.16);
    }

    .clean-main-header::after {
        display: none;
    }

    .header-right-controls {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        z-index: 30;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .header-profile-button {
        width: 100%;
        max-width: 380px;
        height: 44px;
        padding: 0 12px;
        gap: 10px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(180deg, rgba(8,35,70,.92), rgba(4,16,34,.98));
        border-color: rgba(104,199,255,.82);
        box-shadow: 0 0 14px rgba(65,174,255,.24), inset 0 0 11px rgba(102,205,255,.08);
    }

    .header-profile-avatar {
        display: inline-flex !important;
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 10px;
        order: 1;
    }

    .header-profile-chevron {
        display: inline-flex !important;
        width: 32px;
        height: 32px;
        min-width: 32px;
        margin-left: 0;
        border-radius: 10px;
        order: 2;
    }

    .header-profile-chevron::before {
        width: 14px;
        height: 2px;
        box-shadow: 0 -5px 0 #e7fbff, 0 5px 0 #e7fbff;
    }

    .header-profile-logout-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        margin-left: 0;
        font-size: .9rem;
        order: 3;
    }
}


/* Step 153 - Mobile Header: Doppelbild entfernen, nur echtes IMG verwenden */
@media (max-width: 760px) {
    .clean-main-header {
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 12px !important;
        padding: 0 10px 10px !important;
        background: none !important;
        background-image: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    .clean-main-header::before,
    .clean-main-header::after {
        content: none !important;
        display: none !important;
        background: none !important;
        background-image: none !important;
    }

    .mobile-header-banner-img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 82px !important;
        object-fit: cover !important;
        object-position: center center !important;
        border-radius: 0 0 16px 16px !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
        background: #020914 !important;
    }

    .header-right-controls {
        position: relative !important;
        inset: auto !important;
        right: auto !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 auto !important;
        z-index: 30 !important;
    }

    .header-profile-button {
        width: 100% !important;
        max-width: 380px !important;
        height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 0 12px !important;
        border-radius: 16px !important;
    }

    .header-profile-avatar,
    .header-profile-chevron,
    .header-profile-logout-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }
}

@media (max-width: 430px) {
    .clean-main-header {
        height: auto !important;
        min-height: 0 !important;
        background: none !important;
        background-image: none !important;
    }

    .mobile-header-banner-img {
        height: 78px !important;
    }
}

/* Step 154 - Mobile Header final: ein echtes Bild, Profil darunter, kein Überlappen */
.mobile-header-banner-img,
.mobile-header-title-image {
    display: none;
}

@media (max-width: 760px) {
    .clean-main-header {
        box-sizing: border-box !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 12px !important;
        padding: 0 10px 12px !important;
        border-radius: 0 0 18px 18px !important;
        background: #020914 !important;
        background-image: none !important;
        background-size: auto !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
    }

    .clean-main-header::before,
    .clean-main-header::after {
        content: none !important;
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        background: none !important;
        background-image: none !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .mobile-header-banner-img,
    .mobile-header-title-image {
        display: block !important;
        position: relative !important;
        inset: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        width: calc(100% + 20px) !important;
        max-width: none !important;
        height: clamp(74px, 20vw, 88px) !important;
        margin: 0 -10px !important;
        object-fit: cover !important;
        object-position: center center !important;
        border-radius: 0 0 16px 16px !important;
        background: #020914 !important;
        flex: 0 0 auto !important;
        z-index: 1 !important;
        pointer-events: none !important;
        user-select: none !important;
    }

    .header-right-controls {
        position: relative !important;
        inset: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 420px !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 auto !important;
        flex: 0 0 auto !important;
        z-index: 30 !important;
    }

    .header-profile-button {
        position: relative !important;
        inset: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 380px !important;
        height: 44px !important;
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 0 12px !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    .header-profile-avatar,
    .header-profile-chevron,
    .header-profile-logout-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        flex: 0 0 32px !important;
    }

    .container {
        padding-top: 0 !important;
    }

    .dashboard-desktop-shell {
        margin-top: 0 !important;
    }

    .dashboard-open-tips-card {
        position: relative !important;
        z-index: 1 !important;
    }
}

@media (max-width: 360px) {
    .mobile-header-banner-img,
    .mobile-header-title-image {
        height: 72px !important;
    }
}


/* Step 155 - Mobile: Cockpits im Header aufklappbar + Dashboard-Kacheln höher */
.mobile-header-cockpit-shell {
    display: none;
}

@media (max-width: 760px) {
    .header-right-controls {
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .mobile-header-cockpit-shell {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 380px !important;
        gap: 7px !important;
        margin: 0 auto !important;
    }

    .mobile-header-cockpit-toggle {
        position: relative !important;
        width: 100% !important;
        min-height: 38px !important;
        border-radius: 15px !important;
        border: 1px solid rgba(104,199,255,.58) !important;
        background: linear-gradient(180deg, rgba(8,35,70,.94), rgba(4,16,34,.98)) !important;
        color: #ffffff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 0 12px !important;
        box-shadow: 0 0 13px rgba(65,174,255,.16), inset 0 0 11px rgba(102,205,255,.07) !important;
        cursor: pointer !important;
    }

    .mobile-header-cockpit-toggle strong {
        font-size: .82rem !important;
        line-height: 1 !important;
        text-transform: uppercase !important;
        letter-spacing: .03em !important;
    }

    .mobile-header-cockpit-toggle span {
        position: relative !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        color: rgba(214, 239, 255, .78) !important;
        font-size: .68rem !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }

    .mobile-header-cockpit-toggle span::after {
        content: "" !important;
        width: 7px !important;
        height: 7px !important;
        border-right: 2px solid rgba(231,251,255,.92) !important;
        border-bottom: 2px solid rgba(231,251,255,.92) !important;
        transform: rotate(45deg) translateY(-1px) !important;
        transition: transform .18s ease !important;
    }

    .mobile-header-cockpit-toggle.is-open span::after {
        transform: rotate(225deg) translateY(-1px) !important;
    }

    .mobile-header-cockpit-panel {
        display: none !important;
        width: 100% !important;
        border-radius: 16px !important;
        border: 1px solid rgba(104,199,255,.26) !important;
        background: linear-gradient(180deg, rgba(5,18,35,.98), rgba(2,8,17,.99)) !important;
        box-shadow: inset 0 0 16px rgba(90,190,255,.06), 0 0 14px rgba(54,158,255,.12) !important;
        overflow: hidden !important;
    }

    .mobile-header-cockpit-panel.is-open {
        display: block !important;
    }

    .mobile-header-cockpit-content {
        max-height: 238px !important;
        overflow-y: auto !important;
        padding: 10px !important;
        scrollbar-width: thin !important;
    }

    .mobile-header-cockpit-content .cockpit-card {
        margin-bottom: 8px !important;
        padding: 10px 11px !important;
        border-radius: 13px !important;
    }

    .mobile-header-cockpit-content .cockpit-card:last-child {
        margin-bottom: 0 !important;
    }

    .mobile-header-cockpit-content .cockpit-card strong {
        font-size: .82rem !important;
        line-height: 1.15 !important;
    }

    .mobile-header-cockpit-content .cockpit-card span {
        font-size: .72rem !important;
        line-height: 1.3 !important;
    }

    .app-grid {
        gap: 9px !important;
    }

    .app-tile {
        min-height: clamp(126px, 34vw, 150px) !important;
        aspect-ratio: .84 / 1 !important;
        padding: 14px 8px 12px !important;
        border-radius: 16px !important;
    }

    .app-tile h2 {
        margin: 0 0 8px !important;
        font-size: .88rem !important;
        line-height: 1.08 !important;
    }

    .app-tile p {
        font-size: .62rem !important;
        line-height: 1.28 !important;
    }
}

@media (max-width: 430px) {
    .mobile-header-cockpit-shell {
        max-width: 100% !important;
    }

    .app-grid {
        gap: 8px !important;
    }

    .app-tile {
        min-height: clamp(122px, 36vw, 148px) !important;
        padding: 13px 7px 11px !important;
        border-radius: 15px !important;
    }
}

@media (max-width: 360px) {
    .app-tile {
        min-height: 116px !important;
        padding: 11px 6px 10px !important;
    }

    .app-tile h2 {
        font-size: .78rem !important;
    }

    .app-tile p {
        font-size: .56rem !important;
    }
}
