/**
 * Fantasy Draft Board v4.0 - Mobile Styles
 * Phone-specific UI styles for optimal mobile experience
 * 
 * @version 4.0.0
 */

/* ================================================================
   1. MOBILE VIEW CONTAINER
   ================================================================ */

.mobile-view-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: -webkit-fill-available;
    background: #f5f5f5;
    overflow: hidden;
}

.mobile-view-container.hidden {
    display: none !important;
}

/* ================================================================
   2. MOBILE HEADER
   ================================================================ */

.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--header-bg, #1e293b);
    color: white;
    min-height: 48px;
    flex-shrink: 0;
}

.mobile-header-left {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.mobile-league-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.mobile-header-right {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mobile-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-header-btn:hover,
.mobile-header-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-header-btn svg {
    width: 20px;
    height: 20px;
}

/* Refresh button spinning animation */
.mobile-header-btn.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ================================================================
   3. MOBILE TAB BAR
   ================================================================ */

.mobile-tab-bar {
    display: flex;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.mobile-tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-tab.active {
    color: var(--primary-start, #667eea);
    border-bottom-color: var(--primary-start, #667eea);
}

.mobile-tab:hover:not(.active) {
    color: #374151;
    background: #f9fafb;
}

/* Compare count badge */
.compare-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    background: var(--primary-start, #667eea);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9px;
}

.compare-count.hidden {
    display: none;
}

/* ================================================================
   DRAFT TYPE TOGGLE IN TAB BAR
   ================================================================ */

.mobile-tab-with-toggle {
    display: flex;
    align-items: center;
    flex: 1;
}

.mobile-tab-with-toggle .mobile-tab {
    flex: 1;
}

.draft-type-toggle {
    display: flex;
    gap: 2px;
    padding: 0 0.5rem;
    background: #f3f4f6;
    border-radius: 4px;
    margin-right: 0.25rem;
}

.draft-type-toggle.hidden {
    display: none;
}

.draft-type-toggle .toggle-option {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.draft-type-toggle .toggle-option input {
    display: none;
}

.draft-type-toggle .toggle-option span {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    border-radius: 3px;
    transition: all 0.2s;
}

.draft-type-toggle .toggle-option input:checked + span {
    background: var(--primary-start, #667eea);
    color: white;
}

/* ================================================================
   4. MOBILE CONTENT AREA
   ================================================================ */

.mobile-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.mobile-view {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-view.hidden {
    display: none !important;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.empty-state p {
    margin: 0.25rem 0;
}

.empty-hint {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ================================================================
   MOBILE NAVIGATION BAR
   ================================================================ */

.mobile-nav-bar {
    display: flex;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.25rem;
    gap: 0.25rem;
}

.mobile-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.6rem 0.5rem;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-nav-btn.active {
    background: var(--primary-start, #667eea);
    color: white;
}

.mobile-nav-btn svg {
    opacity: 0.7;
}

/* Highlight Compare button when 2+ teams selected */
.mobile-nav-btn.compare-ready {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    animation: pulse-compare 1.5s ease-in-out infinite;
}

.mobile-nav-btn.compare-ready:not(.active) {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

@keyframes pulse-compare {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.compare-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 9px;
    margin-left: 4px;
}

.compare-badge.hidden {
    display: none;
}

/* Mobile League Switcher */
.mobile-league-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    margin-top: 0.5rem;
}

.mobile-league-select:focus {
    outline: none;
    border-color: var(--primary-start, #667eea);
}

#mobileLeagueSwitcherGroup {
    margin-bottom: 0.75rem;
}

#mobileLeagueSwitcherGroup label {
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 0.25rem;
}

/* Make mobile league name look clickable */
#mobileLeagueName {
    cursor: pointer;
    transition: color 0.2s ease;
}

#mobileLeagueName:active {
    color: #4299e1;
}

/* ================================================================
   CONTEXT BAR (Draft type / Week selector)
   ================================================================ */

.mobile-context-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    min-height: 40px;
}

.context-draft,
.context-roster,
.context-trade {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.context-draft.hidden,
.context-roster.hidden,
.context-trade.hidden {
    display: none;
}

.context-btn {
    padding: 0.4rem 1rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.context-btn.active {
    background: var(--primary-start, #667eea);
    border-color: var(--primary-start, #667eea);
    color: white;
}

.context-roster select {
    padding: 0.4rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
}

.coming-soon {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

/* ================================================================
   DROPDOWN MENUS - Proper z-index and positioning
   ================================================================ */

.mobile-nav-bar {
    display: flex;
    position: relative; /* For dropdown positioning */
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.25rem;
    gap: 0.25rem;
    z-index: 100;
}

.mobile-dropdown {
    position: absolute;
    top: 100%;
    left: 0.5rem;
    right: 0.5rem;
    margin-top: 2px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* High z-index */
    overflow: hidden;
}

.mobile-dropdown.hidden {
    display: none !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: white;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.95rem;
    color: #374151;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item:active {
    background: #f3f4f6;
}

.dropdown-item.active {
    background: #ede9fe;
    color: var(--primary-start, #667eea);
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile overlay - very high z-index */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Very high */
    padding: 1rem;
}

.mobile-overlay.hidden {
    display: none !important;
}

.mobile-overlay .overlay-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mobile-overlay .overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: var(--primary-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: white;
}

.mobile-overlay .overlay-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.mobile-overlay .overlay-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-overlay .overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

/* Ensure dropdowns appear above content */
.mobile-header,
.mobile-nav-bar,
.mobile-context-bar {
    position: relative;
    z-index: 50;
}

.mobile-content {
    position: relative;
    z-index: 1;
}

.badge-soon {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    margin-left: auto;
}

/* ================================================================
   PICK LIST - 2 COLUMN LAYOUT
   ================================================================ */

.pick-list-container {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
}

.pick-list-item {
    display: flex;
    align-items: stretch;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.pick-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f9fafb;
    /* FIXED WIDTH - 35% of screen */
    width: 35%;
    min-width: 100px;
    max-width: 140px;
    flex-shrink: 0;
}

.pick-right {
    /* Takes remaining space */
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    min-width: 0; /* Allow text truncation if needed */
}

.pick-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    flex-shrink: 0;
    padding: 0.25rem;
    background: var(--header-bg, #1e293b);
    border-radius: 4px;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
}

.pick-list-item.current-pick {
    border-color: var(--primary-start, #667eea);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.pick-list-item.empty-pick {
    opacity: 0.6;
}

.pick-number .round {
    opacity: 0.8;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
}

.player-info .player-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #111827;
    cursor: pointer;
}

.player-info .player-name:active {
    color: var(--primary-start, #667eea);
}

.player-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
}

.player-meta .position {
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
    color: white;
}

.player-meta .nfl-team {
    color: #6b7280;
}

.player-meta .bye-week {
    color: #9ca3af;
    font-size: 0.65rem;
}

.empty-pick-text {
    color: #9ca3af;
    font-style: italic;
}

/* ================================================================
   LANDSCAPE MODE - Force 2-column roster view
   ================================================================ */

/* Use both orientation AND aspect ratio for better detection */
@media (orientation: landscape),
       (min-aspect-ratio: 4/3) and (max-width: 896px) {
    
    /* Hide portrait view in landscape */
    .mobile-view-container .roster-portrait-view {
        display: none !important;
    }
    
    /* Show landscape view */
    .mobile-view-container .roster-landscape-view {
        display: flex !important;
        flex-direction: row;
        height: 100%;
    }
    
    /* Compact header in landscape */
    .mobile-header {
        padding: 0.3rem 0.75rem;
        min-height: 36px;
    }
    
    .mobile-league-name {
        font-size: 0.8rem;
    }
    
    .mobile-nav-bar {
        padding: 0.2rem;
    }
    
    .mobile-nav-btn {
        padding: 0.4rem;
        font-size: 0.75rem;
    }
    
    .mobile-context-bar {
        padding: 0.3rem;
        min-height: 32px;
    }
}

/* Portrait mode - force portrait view */
@media (orientation: portrait) and (max-width: 480px) {
    .mobile-view-container .roster-portrait-view {
        display: flex !important;
        flex-direction: column;
        height: 100%;
    }
    
    .mobile-view-container .roster-landscape-view {
        display: none !important;
    }
}

/* ================================================================
   MOBILE VIEW CONTAINER - Ensure proper display
   ================================================================ */

@media (max-width: 480px) {
    .mobile-view-container {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
    }
    
    .mobile-view-container.hidden {
        display: none !important;
    }
    
    /* Hide desktop container when mobile is active */
    body:has(.mobile-view-container:not(.hidden)) #draftContainer {
        display: none !important;
    }
}

/* Larger phones in landscape */
@media (max-width: 896px) and (orientation: landscape) {
    .mobile-view-container:not(.hidden) {
        display: flex !important;
    }
}

/* ================================================================
   POSITION BACKGROUND COLORS (Light shading)
   ================================================================ */

.pos-bg-QB { background: rgba(239, 68, 68, 0.08); }   /* Red tint */
.pos-bg-RB { background: rgba(34, 197, 94, 0.08); }   /* Green tint */
.pos-bg-WR { background: rgba(59, 130, 246, 0.08); }  /* Blue tint */
.pos-bg-TE { background: rgba(249, 115, 22, 0.08); }  /* Orange tint */
.pos-bg-K  { background: rgba(168, 85, 247, 0.08); }  /* Purple tint */
.pos-bg-DEF, 
.pos-bg-Def { background: rgba(107, 114, 128, 0.08); } /* Gray tint */
.pos-bg-DL { background: rgba(236, 72, 153, 0.08); }  /* Pink tint */
.pos-bg-LB { background: rgba(20, 184, 166, 0.08); }  /* Teal tint */
.pos-bg-DB { background: rgba(245, 158, 11, 0.08); }  /* Amber tint */

/* ================================================================
   5. PICK LIST VIEW (DRAFT)
   ================================================================ */

.pick-list-container {
   height: 100%;
   overflow-y: auto !important;
   -webkit-overflow-scrolling: touch;
   padding: 0.5rem;
   padding-bottom: 2rem; /* Extra padding at bottom for scroll */
}

/* Ensure the mobile view allows scrolling */
#mobilePickListView {
   height: 100%;
   overflow-y: auto;
   -webkit-overflow-scrolling: touch;
}

/* Fix mobile content area to allow scrolling */
.mobile-content {
   flex: 1;
   overflow: hidden;
   position: relative;
   display: flex;
   flex-direction: column;
}

.mobile-view {
   flex: 1;
   overflow-y: auto;
   -webkit-overflow-scrolling: touch;
}

.pick-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pick-list-item.empty-pick {
    opacity: 0.6;
}

.pick-list-item.current-pick {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    animation: pulse-border 2s infinite;
}

/* Auction amount in pick list */
.pick-list-item .auction-amount {
    display: inline-block;
    background: #fbbf24;
    color: #1f2937;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.5rem;
}

@keyframes pulse-border {
    0%, 100% { border-color: #f59e0b; }
    50% { border-color: #d97706; }
}

/* Pick number */
.pick-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 36px;
    padding: 0.25rem;
    background: var(--table-header-dark, #2d3748);
    border-radius: 6px;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.2;
}

.pick-number .round {
    opacity: 0.8;
}

/* Pick team - stacks name and action icons vertically */
.pick-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.3;
    cursor: pointer;
    /* Allow text wrapping for long team names */
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
    /* Allow height to expand */
    min-height: 1.3em;
    max-height: none;
    overflow: visible;
}

.pick-team .franchise-name-text {
    /* Inherits font styles from parent */
}

.pick-team:active {
    color: var(--primary-start, #667eea);
}

/* Ensure pick-left can expand */
.pick-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f9fafb;
    min-width: 110px;
    max-width: 150px;
    flex-shrink: 0;
}

/* Pick player */
.pick-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pick-player .player-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
}

.pick-player .player-name:active {
    color: var(--primary-start, #667eea);
}

.pick-player .player-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.pick-player .position {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.pick-player .nfl-team {
    font-size: 0.75rem;
    color: #6b7280;
}

.empty-pick-text {
    color: #9ca3af;
    font-style: italic;
}

/* Position colors - more specific selectors to override styles_v4.css */
.player-meta .position.position-QB,
.position-QB { background: var(--pos-qb-dark, rgba(139, 0, 0, 0.85)) !important; }

.player-meta .position.position-RB,
.position-RB { background: var(--pos-rb-dark, rgba(34, 139, 34, 0.85)) !important; }

.player-meta .position.position-WR,
.position-WR { background: var(--pos-wr-dark, rgba(0, 102, 204, 0.85)) !important; }

.player-meta .position.position-TE,
.position-TE { background: var(--pos-te-dark, rgba(255, 140, 0, 0.85)) !important; }

.player-meta .position.position-K,
.position-K { background: var(--pos-k-dark, rgba(128, 0, 128, 0.85)) !important; }

/* DEF/DST - all case variations with dark gray background */
.player-meta .position.position-DEF,
.player-meta .position.position-Def,
.player-meta .position.position-DST,
.position-DEF,
.position-Def,
.position-DST { background: #374151 !important; }

.player-meta .position.position-DL,
.position-DL { background: var(--pos-dl-dark, rgba(240, 101, 149, 0.85)) !important; }

.player-meta .position.position-LB,
.position-LB { background: var(--pos-lb-dark, rgba(255, 146, 43, 0.85)) !important; }

.player-meta .position.position-DB,
.position-DB { background: var(--pos-db-dark, rgba(32, 201, 151, 0.85)) !important; }

/* ================================================================
   TEAM ACTION ICONS (Pick List View)
   ================================================================ */

.team-action-icons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 0px;
}

.team-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.15s, background-color 0.15s, transform 0.1s;
    background: rgba(0, 0, 0, 0.08);
    color: #64748b;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.team-action-icon svg {
    pointer-events: none;
}

.team-action-icon:active,
.team-action-icon.active {
    opacity: 1;
    transform: scale(0.92);
}

.quick-view-icon.active {
    background: rgba(59, 130, 246, 0.25);
    color: #3b82f6;
}

.filter-icon.active {
    background: rgba(168, 85, 247, 0.25);
    color: #a855f7;
}

/* ================================================================
   QUICK-VIEW ROSTER OVERLAY
   ================================================================ */

.quick-roster-overlay {
    position: fixed;
    z-index: 9999;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 12px;
    min-width: 180px;
    max-width: 260px;
    max-height: 350px;
    overflow-y: auto;
    color: #f1f5f9;
    font-size: 12px;
    pointer-events: none;
}

.quick-roster-overlay .overlay-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-roster-overlay .roster-by-round {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.quick-roster-overlay .round-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-roster-overlay .round-num {
    font-weight: 700;
    font-size: 10px;
    background: rgba(99, 102, 241, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 26px;
    text-align: center;
}

.quick-roster-overlay .round-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.quick-roster-overlay .player-pos-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    min-width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.quick-roster-overlay .player-pos-badge.pos-QB { background: #ef4444; }
.quick-roster-overlay .player-pos-badge.pos-RB { background: #22c55e; }
.quick-roster-overlay .player-pos-badge.pos-WR { background: #3b82f6; }
.quick-roster-overlay .player-pos-badge.pos-TE { background: #f97316; }
.quick-roster-overlay .player-pos-badge.pos-K { background: #a855f7; }
.quick-roster-overlay .player-pos-badge.pos-DEF { background: #6b7280; }
.quick-roster-overlay .player-pos-badge.pos-DL,
.quick-roster-overlay .player-pos-badge.pos-LB,
.quick-roster-overlay .player-pos-badge.pos-DB { background: #78716c; }

.quick-roster-overlay .player-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-roster-overlay .empty-round {
    color: #94a3b8;
    font-style: italic;
}

/* ================================================================
   PICK LIST FILTER BAR & STATE
   ================================================================ */

.pick-list-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    font-size: 13px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pick-list-filter-bar .filter-team-name {
    flex: 1;
}

.pick-list-filter-bar .clear-filter-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pick-list-filter-bar .clear-filter-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Hidden picks when filtered */
.pick-list-item.filtered-out {
    display: none !important;
}

/* ================================================================
   6. ROSTER VIEW - PORTRAIT (Dropdown + List)
   ================================================================ */

.roster-portrait-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.team-selector-dropdown {
    padding: 0.75rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.team-selector-dropdown select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.team-selector-dropdown select:focus {
    outline: none;
    border-color: var(--primary-start, #667eea);
}

.roster-list-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
}

.roster-actions {
    padding: 0.75rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.compare-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.compare-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-start, #667eea);
}

/* Clear Compare Button */
.clear-compare-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-compare-btn:hover {
    background: #dc2626;
}

.clear-compare-btn.hidden {
    display: none;
}

/* Roster actions bar layout */
.roster-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* ================================================================
   7. ROSTER VIEW - LANDSCAPE (2-Column)
   ================================================================ */

/* Hide portrait view in landscape, show landscape view */
@media (orientation: landscape) {
    #mobileRosterView .roster-portrait-view {
        display: none !important;
    }
    
    #mobileRosterView .roster-landscape-view {
        display: flex !important;
    }
}

/* Hide landscape view in portrait, show portrait view */
@media (orientation: portrait) {
    #mobileRosterView .roster-portrait-view {
        display: flex !important;
    }
    
    #mobileRosterView .roster-landscape-view {
        display: none !important;
    }
}

.roster-landscape-view {
    display: none;
    height: 100%;
}

.team-list-column {
    width: 40%;
    max-width: 180px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-right: 1px solid #e5e7eb;
}

.team-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.15s;
}

.team-list-item:hover {
    background: #f9fafb;
}

.team-list-item.selected {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-left: 3px solid var(--primary-start, #667eea);
}

.team-compare-checkbox {
    flex-shrink: 0;
}

.team-compare-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-start, #667eea);
}

.team-info {
    flex: 1;
    min-width: 0;
}

.team-info .team-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-info .team-budget {
    font-size: 0.7rem;
    color: #6b7280;
}

.roster-detail-column {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
    background: #f9fafb;
}

.roster-detail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ================================================================
   8. ROSTER CONTENT (Shared)
   ================================================================ */

.roster-header {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: white;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
}

.roster-position-group {
    margin-bottom: 0.75rem;
}

.position-header {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    border-radius: 4px 4px 0 0;
}

.roster-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    cursor: pointer;
}

.roster-player:last-child {
    border-radius: 0 0 4px 4px;
}

.roster-player:hover {
    background: #f9fafb;
}

.roster-player .player-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.roster-player .player-team {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.roster-player .player-salary {
    font-size: 0.75rem;
    color: #059669;
    font-weight: 500;
}

/* Slot status badges (on IR / on TAXI) */
.slot-status-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    white-space: nowrap;
}

.slot-status-badge.ir-slot {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.slot-status-badge.taxi-slot {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* IR Warning Banner (mobile) */
.ir-warning-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 0.8rem;
    color: #991b1b;
}

.ir-warning-icon {
    font-size: 1rem;
}

.ir-warning-text {
    flex: 1;
    line-height: 1.3;
}

/* ================================================================
   ROSTER VIEW - ORIENTATION HANDLING
   ================================================================ */

/* Default: Hide both, let JS control */
.roster-portrait-view,
.roster-landscape-view {
    display: none;
    height: 100%;
}

/* Portrait Mode - Show portrait view */
@media (orientation: portrait) and (max-width: 480px) {
    #mobileRosterView .roster-portrait-view {
        display: flex !important;
        flex-direction: column;
    }
    
    #mobileRosterView .roster-landscape-view {
        display: none !important;
    }
}

/* Landscape Mode - Show landscape 2-column view */
@media (orientation: landscape) and (max-width: 896px) {
    #mobileRosterView .roster-portrait-view {
        display: none !important;
    }
    
    #mobileRosterView .roster-landscape-view {
        display: flex !important;
        flex-direction: row;
    }
}

/* Landscape view layout */
.roster-landscape-view {
    height: 100%;
}

.team-list-column {
    width: 35%;
    min-width: 140px;
    max-width: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-right: 1px solid #e5e7eb;
}

.roster-detail-column {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
    background: #f9fafb;
}

/* ================================================================
   9. COMPARE VIEW
   ================================================================ */
.compare-container {
    padding: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.compare-header-row,
.compare-row {
    display: flex;
    min-width: fit-content;
}
.compare-header-row {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    border-bottom: 2px solid #e5e7eb;
}
.compare-position-col {
    width: 40px;
    min-width: 40px;
    padding: 0.5rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-align: center;
    border-radius: 4px;
    margin: 1px;
}
.compare-header-row .compare-position-col {
    background: var(--table-header-dark, #2d3748);
    color: white;
}
.compare-team-col,
.compare-player-col {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
    padding: 0.5rem;
    text-align: center;
}
.compare-team-col {
    background: var(--table-header-bg, #4a5568);
    color: white;
}
.compare-team-name {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.compare-team-budget {
    font-size: 0.65rem;
    opacity: 0.8;
}
.compare-row {
    border-bottom: 1px solid #f3f4f6;
}
.compare-row:nth-child(even) {
    background: #f9fafb;
}
.compare-player-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    font-size: 0.75rem;
}
.compare-player-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.compare-player-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.65rem;
}
.compare-player-team {
    font-size: 0.65rem;
    color: #6b7280;
}
.compare-player-bye {
    /*color: #dc2626;  red */
    color: #6b7280; /* same as team, grey */ 
    font-weight: 600;
    font-size: 0.6rem;
}

/* Highlight bye week ONLY when it matches current week - neon yellow glow */
.compare-player-bye.bye-current-week {
    background: transparent; !important;
    color: inherit !important;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    border: 2px solid #facc15;
    box-shadow: 0 0 6px 2px rgba(250, 204, 21, 0.8),
                0 0 12px 4px rgba(250, 204, 21, 0.5);
    animation: bye-glow 1.5s ease-in-out infinite alternate;
}

/* ================================================================
   10. OVERLAYS
   ================================================================ */

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.mobile-overlay.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-content {
    width: 100%;
    max-height: 85vh;
    background: white;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.overlay-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.overlay-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
}

.overlay-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.overlay-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

/* ================================================================
   11. NEEDS TABLE
   ================================================================ */

.needs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.needs-table th,
.needs-table td {
    padding: 0.5rem 0.4rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.needs-table th {
    background: #f3f4f6;
    font-weight: 600;
    position: sticky;
    top: 0;
}

/* Position header cells in needs table - white text on colored backgrounds */
.needs-table th.position-QB { background: var(--pos-qb-dark, rgba(139, 0, 0, 0.85)); color: #fff; }
.needs-table th.position-RB { background: var(--pos-rb-dark, rgba(34, 139, 34, 0.85)); color: #fff; }
.needs-table th.position-WR { background: var(--pos-wr-dark, rgba(0, 102, 204, 0.85)); color: #fff; }
.needs-table th.position-TE { background: var(--pos-te-dark, rgba(255, 140, 0, 0.85)); color: #fff; }
.needs-table th.position-K { background: var(--pos-k-dark, rgba(128, 0, 128, 0.85)); color: #fff; }
.needs-table th.position-DEF,
.needs-table th.position-Def,
.needs-table th.position-DST { background: #374151; color: #fff; }
.needs-table th.position-DL { background: var(--pos-dl-dark, rgba(240, 101, 149, 0.85)); color: #fff; }
.needs-table th.position-LB { background: var(--pos-lb-dark, rgba(255, 146, 43, 0.85)); color: #fff; }
.needs-table th.position-DB { background: var(--pos-db-dark, rgba(32, 201, 151, 0.85)); color: #fff; }

.needs-table th:first-child,
.needs-table td:first-child {
    text-align: left;
    padding-left: 0.75rem;
}

.needs-team-name {
    font-weight: 500;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.needs-cell {
    font-weight: 500;
}

.needs-cell.filled {
    color: #059669;
    background: #d1fae5;
}

.needs-cell.need-low {
    color: #d97706;
    background: #fef3c7;
}

.needs-cell.need-high {
    color: #dc2626;
    background: #fee2e2;
}

/* ================================================================
   12. SETTINGS OVERLAY
   ================================================================ */

.mobile-setting-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-setting-item:last-of-type {
    border-bottom: none;
}

.mobile-setting-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.mobile-setting-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--primary-start, #667eea);
}

.setting-description {
    margin: 0.5rem 0 0 2.25rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.mobile-logout-btn {
    width: 100%;
    padding: 0.875rem;
    margin-top: 1rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}

.mobile-logout-btn:hover {
    background: #fecaca;
}

/* ================================================================
   13. LANDSCAPE ADJUSTMENTS
   ================================================================ */

@media (orientation: landscape) {
    .mobile-header {
        padding: 0.4rem 1rem;
        min-height: 40px;
    }
    
    .mobile-league-name {
        font-size: 0.8rem;
    }
    
    .mobile-header-btn {
        width: 36px;
        height: 36px;
    }
    
    .mobile-tab {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .overlay-content {
        max-height: 90vh;
        max-width: 500px;
        border-radius: 16px;
        margin: auto;
    }
}

/* ================================================================
   14. SAFE AREA INSETS (iPhone Notch)
   ================================================================ */

@supports (padding-top: env(safe-area-inset-top)) {
    .mobile-header {
        padding-top: calc(0.5rem + env(safe-area-inset-top));
    }
    
    .mobile-view-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ================================================================
   15. HIDE MOBILE VIEWS ON LARGER SCREENS
   ================================================================ */

@media (min-width: 481px) {
    .mobile-view-container {
        display: none !important;
    }
}

/* ================================================================
   16. PROJECTED SCORES MODAL - MOBILE RESPONSIVE
   ================================================================ */

@media (max-width: 480px) {
    /* Make projected scores modal more responsive */
    .modal-content .matchup-card,
    .modal-content .projection-matchup {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .modal-content .matchup-team {
        font-size: 0.85rem;
        padding: 0.4rem 0.5rem;
    }
    
    .modal-content .matchup-score,
    .modal-content .projection-score {
        font-size: 1rem;
        min-width: 50px;
    }
    
    /* Ensure matchups fit in mobile width */
    .modal-content .matchups-container,
    .modal-content .projections-container {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content .matchup-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        background: #f8fafc;
        border-radius: 8px;
    }
    
    .modal-content .team-name-cell {
        flex: 1;
        font-size: 0.8rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 45%;
    }
    
    .modal-content .score-cell {
        font-size: 0.9rem;
        font-weight: 600;
        min-width: 45px;
        text-align: right;
    }
    
    /* Optimal lineups section */
    .modal-content .optimal-lineup-card {
        padding: 0.75rem;
    }
    
    .modal-content .optimal-lineup-card .team-rank {
        font-size: 0.9rem;
    }
    
    .modal-content .optimal-lineup-card .projected-total {
        font-size: 1.1rem;
    }
}

/* ================================================================
   17. ROSTER PLAYER ROW - 3 COLUMN LAYOUT
   ================================================================ */

.roster-header.clickable {
    cursor: pointer;
    position: relative;
}

.roster-header.clickable:hover,
.roster-header.clickable:active {
    background: linear-gradient(135deg, #5a6fd6 0%, #6b5ba2 100%);
}

.roster-header-hint {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 0.5rem;
}

.roster-player-row {
    display: grid;
    /* Fixed widths for Team(Bye) and Salary columns to ensure alignment */
    grid-template-columns: 1fr 65px 85px;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
}

.roster-player-row.clickable {
    cursor: pointer;
}

.roster-player-row.clickable:active {
    background: #f3f4f6;
}

.player-name-col {
    font-size: 0.9rem;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-team-col {
    font-size: 0.8rem;
    color: #6b7280;
    min-width: 35px;
    text-align: center;
}

/* Bye week inside team column - muted color like rest of app */
/* Override global .bye-week styles for mobile roster rows */
.roster-player-row .player-team-col .bye-week {
    background: transparent !important;
    color: #9ca3af !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    font-weight: normal !important;
    font-size: 0.7rem !important;
    text-shadow: none !important;
    display: inline !important;
}

.player-salary-col {
    font-size: 0.8rem;
    color: #059669;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

/* ================================================================
   SALARY ADJUSTMENTS - MOBILE
   ================================================================ */

.roster-adjustments-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 0.85rem;
}

.roster-adjustments-line.clickable {
    cursor: pointer;
}

.roster-adjustments-line.clickable:active {
    background: #fde68a;
}

.adjustment-label {
    color: #92400e;
    font-weight: 500;
    flex: 1;
}

.adjustment-amount {
    font-weight: 600;
    margin-right: 0.5rem;
}

.adjustment-amount.positive {
    color: #dc2626;
}

.adjustment-amount.negative {
    color: #16a34a;
}

.adjustment-arrow {
    color: #92400e;
    font-size: 1.2rem;
    font-weight: bold;
}

/* ================================================================
   ADJUSTMENTS MODAL
   ================================================================ */

.mobile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mobile-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.mobile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mobile-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.mobile-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.mobile-modal-close:hover {
    opacity: 1;
}

.mobile-modal-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.modal-team-name {
    font-weight: 600;
    color: #374151;
}

.modal-total {
    font-weight: 700;
}

.modal-total.positive {
    color: #dc2626;
}

.modal-total.negative {
    color: #16a34a;
}

.mobile-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
}

/* Adjustments list items */
.adjustments-list .adjustment-item {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.adjustments-list .adjustment-item:last-child {
    border-bottom: none;
}

.adjustment-desc {
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.adjustment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.adjustment-date {
    color: #9ca3af;
}

.adjustment-amt {
    font-weight: 600;
}

.adjustment-amt.positive {
    color: #dc2626;
}

.adjustment-amt.negative {
    color: #16a34a;
}

/* Contract tooltip indicator */
.contract-tip {
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

/* ================================================================
   18. PICK LIST ITEM - BETTER TEXT CONTRAST
   ================================================================ */

.pick-list-item .player-meta .nfl-team,
.pick-list-item .player-meta .bye-week {
    color: rgba(255, 255, 255, 0.9);
}

.pick-list-item.empty-pick .player-meta .nfl-team,
.pick-list-item.empty-pick .player-meta .bye-week {
    color: #9ca3af;
}

/* ================================================================
   MOBILE SEARCH HIGHLIGHT
   ================================================================ */

.pick-list-item.search-highlighted {
    animation: mobileSearchHighlight 2.5s ease-in-out;
    border: 3px solid #ff1493 !important;
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.7) !important;
}

/* Roster player row highlight */
.roster-player-row.search-highlighted,
.roster-player.search-highlighted {
    animation: mobileSearchHighlight 2.5s ease-in-out;
    border: 3px solid #ff1493 !important;
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.7) !important;
    background: #fff0f5 !important;
}

@keyframes mobileSearchHighlight {
    0%, 100% { 
        border-color: #ff1493;
        box-shadow: 0 0 20px rgba(255, 20, 147, 0.7);
        transform: scale(1);
    }
    25%, 75% { 
        border-color: #ff69b4;
        box-shadow: 0 0 30px rgba(255, 20, 147, 0.9);
        transform: scale(1.02);
    }
    50% { 
        border-color: #ff1493;
        box-shadow: 0 0 40px rgba(255, 20, 147, 1);
        transform: scale(1.03);
    }
}

/* ================================================================
   19. SPECIAL PICK TYPES
   ================================================================ */

.pick-list-item .special-pick-text {
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.pick-list-item.commissioner-pick {
    background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
}

.pick-list-item.adp-pick {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

.pick-list-item.skipped-pick {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.pick-list-item.comment-pick {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.pick-list-item.empty-pick .special-pick-text,
.pick-list-item.empty-pick .empty-pick-text {
    color: #9ca3af;
}

/* ================================================================
   20. TEAM ROSTER OVERLAY (DYNAMIC)
   ================================================================ */

#teamRosterOverlay {
    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: 10000;
    padding: 1rem;
}

#teamRosterOverlay.hidden {
    display: none !important;
}

#teamRosterOverlay .overlay-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#teamRosterOverlay .overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

#teamRosterOverlay .overlay-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

#teamRosterOverlay .overlay-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#teamRosterOverlay .overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ================================================================
   21. WEEKLY RESULTS MODAL - MOBILE RESPONSIVE
   ================================================================ */

@media (max-width: 480px) {
    /* Weekly results matchups - stack vertically */
    .modal-content .matchup-container,
    .modal-content .matchup {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        background: #f8fafc;
        border-radius: 8px;
    }
    
    .modal-content .matchup-team,
    .modal-content .team-score-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        background: #fff;
        border-radius: 6px;
    }
    
    .modal-content .matchup-team.winner,
    .modal-content .team-score-row.winner {
        background: #dcfce7;
        border-left: 3px solid #22c55e;
    }
    
    .modal-content .team-name {
        flex: 1;
        font-size: 0.85rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 65%;
    }
    
    .modal-content .team-score {
        font-size: 1rem;
        font-weight: 700;
        min-width: 50px;
        text-align: right;
    }
    
    .modal-content .matchup-vs {
        text-align: center;
        font-size: 0.7rem;
        color: #9ca3af;
        padding: 0.25rem 0;
    }
    
    /* Week selector in modal */
    .modal-content .week-selector {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .modal-content .week-selector button {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* ================================================================
   SLIDING PANEL - MOBILE RESPONSIVE (Weekly Results Details)
   ================================================================ */

@media (max-width: 480px) {
    /* Full width panel on mobile */
    #slidingPanel {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.75rem !important;
        box-sizing: border-box !important;
    }
    
    /* Force the two-team grid to stack vertically */
    #slidingPanel > div[style*="grid-template-columns"],
    #slidingPanel div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    /* Ensure each team div takes full width */
    #slidingPanel div[style*="grid-template-columns"] > div {
        width: 100% !important;
    }
    
    /* Smaller title */
    #slidingPanel h3 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Team header adjustments - keep gradient intact */
    #slidingPanel h4 {
        font-size: 0.9rem !important;
        padding: 0.75rem !important;
    }
    
    /* Larger touch target for close button */
    #closeSlidingPanel {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* Ensure panel scrolls properly */
@media (max-width: 480px) {
    #slidingPanel {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ================================================================
   22. OPTIMAL LINEUPS - MOBILE WIDTH FIX
   ================================================================ */
@media (max-width: 480px) {
    /* Force modal to respect viewport */
    .modal-content {
        max-width: calc(100vw - 2rem) !important;
        overflow-x: auto !important;
    }
    
    /* Projected scores modal body */
    .modal-content .modal-body {
        padding: 0.75rem;
        overflow-x: auto !important;
    }
    
    /* Override inline grid styles that set minmax(400px, 1fr) */
    .modal-content div[style*="grid-template-columns"],
    .modal-content .bestLineupsSection > div,
    #bestLineupsSection > div {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    /* Force column layout on projections containers */
    #projectedScoresContent > div,
    #bestLineupsSection {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    /* Constrain optimal lineup cards */
    .modal-content .franchise-lineup-header,
    .modal-content .optimal-lineup-card,
    .modal-content .lineup-card,
    .modal-content div[style*="border: 2px solid"],
    .modal-content [class*="lineup"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: auto !important;
    }
    
    /* Projected scores specific */
    .modal-content .franchise-lineup-header {
        flex-wrap: wrap;
        padding: 0.5rem !important;
    }
    
    .modal-content .franchise-lineup-header > * {
        flex-shrink: 1;
        min-width: 0;
    }
    
    /* Team ranking cards in projections */
    .modal-content .team-projection-card,
    .modal-content .projection-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .modal-content .team-projection-card .team-name,
    .modal-content .projection-card .team-name {
        flex: 1;
        font-size: 0.9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-right: 0.5rem;
    }
    
    .modal-content .team-projection-card .projection-score,
    .modal-content .projection-card .projection-score {
        font-size: 1.1rem;
        font-weight: 700;
        min-width: 50px;
        text-align: right;
    }
    
    /* Section headers */
    .modal-content h4,
    .modal-content .section-header {
        font-size: 0.95rem;
        margin: 1rem 0 0.5rem 0;
    }
}

/* ================================================================
   23. INJURY REPORT & STANDINGS - MOBILE SCROLL
   ================================================================ */

@media (max-width: 480px) {
    /* Override the hidden overflow from section 22 for these modals */
    #injuryReportModal .modal-content,
    #standingsModal .modal-content {
        overflow-x: auto !important;
    }
    
    /* Allow modal body to scroll horizontally */
    .modal-content .modal-body {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
        padding-left: 0 !important;
        max-width: 100%;
    }
    
    /* Make tables wider than container to force scroll */
    .modal-content table {
        min-width: 500px;
    }
    
    /* Injury Report - sticky first column */
    #injuryReportModal table td:first-child,
    #injuryReportContent table td:first-child {
        position: sticky !important;
        left: 0 !important;
        background-color: #fff !important;
        z-index: 1 !important;
        box-shadow: 5px 0 5px -3px rgba(0, 0, 0, 0.1) !important;
    }
    
    #injuryReportModal table tr:nth-child(even) td:first-child,
    #injuryReportContent table tr:nth-child(even) td:first-child {
        background-color: #f9fafb !important;
    }
    
    #injuryReportModal table th:first-child,
    #injuryReportContent table th:first-child {
        position: sticky !important;
        left: 0 !important;
        background-color: #4a5568 !important;
        color: #fff !important;
        z-index: 2 !important;
        box-shadow: 5px 0 5px -3px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* Standings - sticky first TWO columns */
    #standingsModal table td:nth-child(1) {
        position: sticky !important;
        left: 0 !important;
        background-color: #fff !important;
        z-index: 1 !important;
    }
    
    #standingsModal table td:nth-child(2) {
        position: sticky !important;
        left: 50px !important;
        background-color: #fff !important;
        z-index: 1 !important;
        box-shadow: 5px 0 5px -3px rgba(0, 0, 0, 0.1) !important;
    }
    
    #standingsModal table tr:nth-child(even) td:nth-child(1),
    #standingsModal table tr:nth-child(even) td:nth-child(2) {
        background-color: #f9fafb !important;
    }
    
    #standingsModal table th:nth-child(1) {
        position: sticky !important;
        left: 0 !important;
        background-color: #4a5568 !important;
        color: #fff !important;
        z-index: 2 !important;
    }
    
    #standingsModal table th:nth-child(2) {
        position: sticky !important;
        left: 50px !important;
        background-color: #4a5568 !important;
        color: #fff !important;
        z-index: 2 !important;
        box-shadow: 5px 0 5px -3px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* Remove left padding from modal body to eliminate gap */
    #injuryReportModal .modal-body,
    #injuryReportContent,
    #standingsModal .modal-body {
        padding-left: 0 !important;
    }
    
   /* Scroll hint text - ONLY for modals with wide tables that need horizontal scrolling */
       /* Apply to: Injury Report, Standings, Projected Scores */
       #injuryReportModal .modal-body::after,
       #standingsModal .modal-body::after,
       #projectedScoresModal .modal-body::after {
           content: '← Scroll for more →';
           display: block;
           text-align: center;
           font-size: 0.7rem;
           color: #9ca3af;
           padding: 0.5rem;
       }
       
       /* Explicitly hide scroll hint for modals that DON'T need horizontal scrolling */
       #scheduleModal .modal-body::after,
       #weeklyResultsModal .modal-body::after,
       #allLeaguesScoresModal .modal-body::after,
       #nflScheduleModal .modal-body::after {
           content: none;
           display: none;
       }
}

/* ================================================================
   INJURY REPORT FILTERS - MOBILE RESPONSIVE
   ================================================================ */

@media (max-width: 480px) {
    .injury-report-filters {
        padding: 0.5rem !important;
        gap: 0.5rem !important;
    }
    
    .injury-report-filters .filter-group {
        flex: 1 1 45% !important;
        min-width: 45% !important;
    }
    
    .injury-report-filters .filter-group label {
        font-size: 0.7rem !important;
    }
    
    .injury-report-filters .filter-select,
    .injury-report-filters select {
        font-size: 0.8rem !important;
        padding: 0.35rem !important;
    }
    
    .injury-report-filters .filter-results {
        flex: 1 1 100% !important;
        text-align: center !important;
        font-size: 0.75rem !important;
    }
    
    /* Stack offense-only and reset on their own row on very small screens */
    @media (max-width: 360px) {
        .injury-report-filters .filter-group {
            flex: 1 1 100% !important;
            min-width: 100% !important;
        }
    }
}

/* ================================================================
   24. LANDSCAPE HEADER ROW FIX
   ================================================================ */

@media (orientation: landscape) and (max-width: 896px) {
    .mobile-header {
        padding: 0.25rem 0.75rem;
        min-height: 36px;
        height: auto;
    }
    
    .mobile-context-bar {
        padding: 0.2rem 0.5rem;
        min-height: 28px;
        height: auto;
    }
    
    .mobile-context-bar .context-btn,
    .mobile-context-bar button {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
        min-height: 24px;
    }
    
    .mobile-context-bar select {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
        min-height: 24px;
    }
}

/* ================================================================
   STANDALONE PWA VIEWPORT FIX
   iOS standalone apps don't always respect 100vh on rotation
   ================================================================ */
@media all and (display-mode: standalone) {
    html, body {
        height: 100%;
        overflow: hidden;
    }
    
    .mobile-view-container {
        height: 100%;
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
}

/* iOS Safari standalone mode */
@supports (-webkit-touch-callout: none) {
    .mobile-view-container {
        min-height: -webkit-fill-available;
    }
}

/* ================================================================
   DISABLE DOUBLE-TAP-TO-ZOOM ON INTERACTIVE ELEMENTS
   Required for custom double-tap gesture to work on iOS Safari
   ================================================================ */
.pick-team,
.player-name,
.player-info .player-name,
.team-list-item,
.roster-player {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}