/* Mobile v82 - FINAL PROFESSIONAL */
/* Complete redesign with all fixes */

@media (max-width: 768px) {
    /* ===== CONTAINER ===== */
    .mu-list {
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* ===== CARD ===== */
    .mu-card {
        background: #ffffff;
        border-radius: 14px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        padding: 14px;
        border: 1px solid #e2e8f0;
    }
    
    /* Top 3 - výrazné ohraničení */
    .mu-card.top1 { 
        border: 2px solid #fbbf24;
        background: linear-gradient(135deg, rgba(251,191,36,0.08) 0%, #ffffff 50%);
        box-shadow: 0 4px 12px rgba(251,191,36,0.15);
    }
    .mu-card.top2 { 
        border: 2px solid #a1a1aa;
        background: linear-gradient(135deg, rgba(161,161,170,0.08) 0%, #ffffff 50%);
        box-shadow: 0 4px 12px rgba(161,161,170,0.15);
    }
    .mu-card.top3 { 
        border: 2px solid #d97706;
        background: linear-gradient(135deg, rgba(217,119,6,0.08) 0%, #ffffff 50%);
        box-shadow: 0 4px 12px rgba(217,119,6,0.15);
    }
    
    /* Record states */
    .mu-card.broken {
        border: 2px solid #f59e0b;
        background: linear-gradient(135deg, rgba(251,191,36,0.12) 0%, #ffffff 50%);
        box-shadow: 0 4px 16px rgba(245,158,11,0.2);
    }
    .mu-card.tied {
        border: 2px solid #3b82f6;
        background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, #ffffff 50%);
        box-shadow: 0 4px 16px rgba(59,130,246,0.15);
    }
    
    /* ===== ROW 1: Header ===== */
    .mu-row1 {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    /* Top row: Rank + Team + Fav */
    .mu-row1-top {
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Rank */
    .mu-rank {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: 700;
        background: #f1f5f9;
        color: #64748b;
        flex-shrink: 0;
    }
    .mu-rank.gold {
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
        color: #78350f;
        box-shadow: 0 2px 8px rgba(251,191,36,0.4);
    }
    .mu-rank.silver {
        background: linear-gradient(135deg, #e4e4e7, #a1a1aa);
        color: #3f3f46;
    }
    .mu-rank.bronze {
        background: linear-gradient(135deg, #fbbf24, #d97706);
        color: #78350f;
    }
    
    /* Team link */
    .mu-team {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
        text-decoration: none;
    }
    
    .mu-team-logo {
        width: 40px;
        height: 40px;
        object-fit: contain;
        flex-shrink: 0;
    }
    
    .mu-team-info {
        flex: 1;
        min-width: 0;
    }
    
    .mu-team-name {
        font-size: 1rem;
        font-weight: 700;
        color: #111827;
        line-height: 1.25;
    }
    
    /* Favorite only in top row */
    .mu-fav {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        border: 1.5px solid #e5e7eb;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
    }
    
    .mu-fav svg {
        width: 18px;
        height: 18px;
        color: #d1d5db;
    }
    
    .mu-fav.active {
        background: linear-gradient(135deg, #fef3c7, #fde68a);
        border-color: #fbbf24;
    }
    
    .mu-fav.active svg {
        color: #f59e0b;
    }
    
    /* Meta row: Type badge + League + Data from */
    .mu-row1-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: 38px;
        flex-wrap: wrap;
    }
    
    .mu-type {
        padding: 5px 10px;
        border-radius: 6px;
        font-size: 0.625rem;
        font-weight: 700;
        color: white;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        white-space: nowrap;
    }
    
    .mu-league-link {
        display: flex;
        align-items: center;
        gap: 5px;
        text-decoration: none;
    }
    
    .mu-league-logo {
        width: 16px;
        height: 16px;
        object-fit: contain;
        flex-shrink: 0;
    }
    
    .mu-league-name {
        font-size: 0.75rem;
        color: #6b7280;
        font-weight: 500;
    }
    
    .mu-league-link:active .mu-league-name {
        color: #3b82f6;
    }
    
    .mu-data-from {
        font-size: 0.6875rem;
        color: #9ca3af;
        margin-left: auto;
    }
    
    /* Status badge (for my.php) */
    .mu-status {
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 0.625rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.2px;
    }
    
    .mu-status.active {
        background: #dcfce7;
        color: #166534;
    }
    
    .mu-status.inactive {
        background: #fee2e2;
        color: #991b1b;
    }
    
    /* Hide old elements */
    .mu-actions,
    .mu-league-row {
        display: none !important;
    }
    
    /* ===== ROW 2: Stats ===== */
    .mu-row2 {
        display: flex;
        align-items: stretch;
        background: #f8fafc;
        border-radius: 10px;
        overflow: hidden;
    }
    
    .mu-stat {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 10px 6px;
        cursor: pointer;
        transition: background 0.15s;
        border-right: 1px solid #e5e7eb;
    }
    
    .mu-stat:last-child {
        border-right: none;
    }
    
    .mu-stat:active {
        background: rgba(0,0,0,0.04);
    }
    
    .mu-stat-label {
        font-size: 0.5625rem;
        font-weight: 600;
        text-transform: uppercase;
        color: #9ca3af;
        letter-spacing: 0.5px;
        margin-bottom: 6px;
    }
    
    .mu-num-wrap {
        position: relative;
        display: inline-flex;
    }
    
    .mu-num {
        min-width: 42px;
        height: 42px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.375rem;
        font-weight: 800;
        color: white;
    }
    
    .mu-num.max {
        background: #9ca3af !important;
    }
    
    /* Trophy/tie icon - more visible */
    .mu-num-icon {
        position: absolute;
        top: -6px;
        right: -6px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.6875rem;
        border: 2px solid white;
        box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    }
    
    .mu-num-icon.broken {
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
    }
    
    .mu-num-icon.tied {
        background: linear-gradient(135deg, #60a5fa, #3b82f6);
    }
    
    .mu-stat-meta {
        font-size: 0.6875rem;
        color: #6b7280;
        margin-top: 4px;
        white-space: nowrap;
    }
    
    /* ===== Next Match Section ===== */
    .mu-next {
        flex: 1.1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px 8px;
        cursor: default;
    }
    
    .mu-next-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        width: 100%;
    }
    
    .mu-next-top {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .mu-next-venue {
        font-size: 0.625rem;
        font-weight: 700;
        padding: 3px 6px;
        border-radius: 4px;
        text-transform: uppercase;
    }
    
    .mu-next-venue.home {
        background: #dbeafe;
        color: #1e40af;
    }
    
    .mu-next-venue.away {
        background: #fee2e2;
        color: #991b1b;
    }
    
    .mu-next-logo {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }
    
    .mu-next-opp {
        font-size: 0.8125rem;
        font-weight: 600;
        color: #374151;
        text-align: center;
        line-height: 1.2;
    }
    
    .mu-next-time {
        font-size: 0.6875rem;
        color: #6b7280;
    }
    
    .mu-next-none {
        font-size: 0.6875rem;
        color: #9ca3af;
        padding: 10px 0;
    }
    
    /* ===== LOAD MORE BUTTON ===== */
    .load-more-btn {
        display: block !important;
        width: calc(100% - 20px) !important;
        margin: 16px 10px !important;
        padding: 14px !important;
        font-size: 0.9375rem !important;
        border-radius: 12px !important;
    }
    
    /* ===== EMPTY STATE ===== */
    .mu-empty {
        text-align: center;
        padding: 60px 24px;
    }
    
    .mu-empty-icon {
        font-size: 3rem;
        margin-bottom: 12px;
        opacity: 0.4;
    }
    
    .mu-empty-text {
        font-size: 1rem;
        font-weight: 600;
        color: #9ca3af;
    }
    
    /* ===== MODAL ===== */
    .mu-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        padding: 24px 16px;
        animation: muFadeIn 0.2s;
    }
    
    @keyframes muFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .mu-modal {
        background: white;
        border-radius: 16px;
        width: 100%;
        max-width: 380px;
        max-height: calc(100vh - 48px);
        display: flex;
        flex-direction: column;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
        animation: muSlideUp 0.25s ease-out;
    }
    
    @keyframes muSlideUp {
        from {
            opacity: 0;
            transform: scale(0.95) translateY(10px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
    
    .mu-modal-header {
        padding: 16px;
        border-bottom: 1px solid #f3f4f6;
        position: relative;
        flex-shrink: 0;
    }
    
    .mu-modal-title {
        font-size: 1.0625rem;
        font-weight: 700;
        color: #111827;
        padding-right: 36px;
        line-height: 1.3;
    }
    
    .mu-modal-subtitle {
        font-size: 0.8125rem;
        color: #6b7280;
        font-weight: 600;
        margin-top: 4px;
    }
    
    .mu-modal-date {
        font-size: 0.75rem;
        color: #9ca3af;
        margin-top: 2px;
    }
    
    .mu-modal-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: #f3f4f6;
        color: #6b7280;
        font-size: 1.5rem;
        font-weight: 300;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mu-modal-close:active {
        background: #e5e7eb;
    }
    
    .mu-modal-body {
        padding: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1;
        min-height: 0;
    }
    
    .mu-modal-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.8125rem;
    }
    
    .mu-modal-table thead {
        background: #f9fafb;
        position: sticky;
        top: 0;
        z-index: 1;
    }
    
    .mu-modal-table th {
        padding: 10px 8px;
        font-size: 0.625rem;
        font-weight: 700;
        text-transform: uppercase;
        color: #6b7280;
        text-align: left;
        border-bottom: 2px solid #e5e7eb;
    }
    
    .mu-modal-table td {
        padding: 10px 8px;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .mu-modal-table tbody tr:last-child td {
        border-bottom: none;
    }
    
    .mu-modal-date-col {
        color: #6b7280;
        font-weight: 600;
        white-space: nowrap;
        font-size: 0.75rem;
    }
    
    .mu-modal-team {
        color: #374151;
        font-size: 0.8125rem;
    }
    
    .mu-modal-team.bold {
        font-weight: 700;
        color: #111827;
    }
    
    .mu-modal-score {
        text-align: center;
        font-weight: 700;
        color: #111827;
        font-size: 0.9375rem;
        white-space: nowrap;
    }
    
    .mu-modal-empty {
        padding: 40px 20px;
        text-align: center;
        color: #9ca3af;
        font-weight: 600;
    }
    
    /* ===== MOBILE FILTERS ===== */
    .hero-section {
        padding: 16px 12px !important;
        gap: 12px !important;
    }
    
    .hero-title {
        font-size: 1.375rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.8125rem !important;
    }
    
    .hero-stats {
        gap: 8px !important;
        flex-wrap: wrap !important;
    }
    
    .stat-card {
        padding: 10px 14px !important;
        min-width: 80px !important;
        border-radius: 10px !important;
    }
    
    .stat-value {
        font-size: 1.25rem !important;
    }
    
    .stat-label {
        font-size: 0.625rem !important;
    }
    
    /* Category tabs */
    .category-tabs {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 4px 6px !important;
        scrollbar-width: none !important;
    }
    
    .category-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .cat-tab {
        padding: 10px 14px !important;
        font-size: 0.8125rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        border-radius: 10px !important;
    }
    
    /* Filter panel */
    .filter-panel {
        padding: 14px !important;
        margin: 0 10px 14px !important;
        border-radius: 14px !important;
    }
    
    .filters-top {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .filters-right {
        width: 100% !important;
    }
    
    /* Record buttons */
    .record-btns {
        display: flex !important;
        gap: 8px !important;
    }
    
    .rec-btn {
        padding: 10px 14px !important;
        font-size: 0.8125rem !important;
        border-radius: 10px !important;
        flex: 1 !important;
        justify-content: center !important;
    }
    
    .rec-count {
        min-width: 22px !important;
        height: 22px !important;
        font-size: 0.75rem !important;
    }
    
    /* Selects */
    .filters-selects {
        gap: 12px !important;
    }
    
    .filters-row-main {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .f-select {
        width: 100% !important;
        padding: 14px 16px !important;
        font-size: 0.9375rem !important;
        border-radius: 12px !important;
    }
    
    .filters-row-advanced {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .filter-label-small {
        width: 100% !important;
        margin-bottom: -4px !important;
    }
    
    .f-select--compact {
        flex: 1 !important;
        min-width: 120px !important;
        padding: 12px 14px !important;
    }
    
    /* Type row */
    .type-row {
        gap: 8px !important;
        padding: 12px 14px !important;
        margin-top: 14px !important;
        border-radius: 12px !important;
    }
    
    .type-btn {
        padding: 8px 12px !important;
        font-size: 0.8125rem !important;
        border-radius: 8px !important;
    }
    
    /* Info banners */
    .info-banner {
        padding: 14px 16px !important;
        margin: 0 10px 14px !important;
        border-radius: 12px !important;
    }
    
    .info-icon {
        font-size: 1.125rem !important;
    }
    
    .info-text {
        font-size: 0.875rem !important;
    }
    
    /* Table wrapper - hide on mobile */
    .table-wrapper {
        display: none !important;
    }
    
    /* ===== VISIBILITY ===== */
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
}
