:root {
    --accent-color: #38bdf8;
    --bg-dark: #0a0f1d;
    --card-bg: #111827;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-muted: #64748b;
    --live-red: #ef4444;
}

* { box-sizing: border-box; }

body { 
    background-color: var(--bg-dark); 
    color: #f1f5f9; 
    font-family: 'Inter', sans-serif; 
    margin: 0; 
    padding: 15px; 
    line-height: 1.4;
    overflow-x: hidden;
}

.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px; 
}


.main-container { display: flex; flex-direction: column-reverse; gap: 20px; }

@media (min-width: 1025px) {
    .main-container { display: grid; grid-template-columns: 350px 1fr; align-items: flex-start; }
}


.header-area { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 15px;
    background: var(--card-bg); 
    padding: 12px 20px; 
    border-radius: 12px; 
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.header-logo-section { display: flex; align-items: center; gap: 12px; }
.header-logo { height: 28px; width: auto; }
.header-title { font-weight: 900; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; }

.header-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }


.btn-ical {
    text-decoration: none; 
    font-size: 0.7rem; 
    padding: 8px 14px; 
    border-radius: 8px;
    font-weight: 800; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: 0.2s;
    color: white; 
    text-transform: uppercase; 
    white-space: nowrap; 
    min-width: fit-content;
    cursor: pointer;
    border: none;
    background: #2563eb !important; 
}

.btn-ical:hover { 
    filter: brightness(1.2); 
    transform: translateY(-1px); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
}


/* --- BASIS (Für alle Geräte gleich) --- */
.ical-dropdown-container {
    position: relative;
    display: inline-block;
}

.ical-menu-content {
    background: #1e293b;
    border: 1px solid #334155;
    z-index: 1000;
    overflow: hidden;
    display: none; /* Desktop Standard: Aus */
}

/* Links & Styling */
.ical-menu-content a {
    color: white;
    padding: 14px 18px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-bottom: 1px solid #334155;
}
.ical-menu-content a strong { display: block; font-size: 0.85rem; color: #60a5fa; margin-bottom: 2px; }
#link-webcal strong { color: #10b981; }
.ical-menu-content a span { display: block; font-size: 0.7rem; opacity: 0.6; }

/* --- DESKTOP ANSICHT --- */
@media (min-width: 601px) {
    .ical-menu-content {
        position: absolute;
        right: 0;
        top: 100%;
        margin-top: 8px;
        border-radius: 8px;
        min-width: 280px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    }
    .ical-menu-show {
        display: block !important;
        animation: fadeInDropdown 0.2s ease-out;
    }
}

/* --- MOBILE ANSICHT (Hochkant & Quer) --- */
@media (max-width: 600px) {
    .ical-menu-content {
        display: block !important; /* Immer im DOM, aber verschoben */
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0;
        border: none;
        border-top: 1px solid #334155;
        
        /* Das Menü wird nach unten aus dem Bild geschoben */
        transform: translateY(105%); 
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden;
    }

    /* Wenn offen: Hochsliden */
    .ical-menu-show {
        transform: translateY(0) !important;
        visibility: visible !important;
    }

    /* Hintergrund-Abdunkelung */
    .ical-menu-show::before {
        content: "";
        position: fixed;
        top: -100vh;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        z-index: -1;
        backdrop-filter: blur(2px);
    }
    
    /* Fix für Querformat (Landscape): Scrollen erlauben */
    @media (orientation: landscape) {
        .ical-menu-content {
            top: 0 !important; /* Füllt ganzen Bildschirm bei Querformat */
            border-radius: 0;
            overflow-y: auto;
        }
    }
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}



.filter-header { 
    display: none; 
    background: var(--card-bg); 
    color: white; 
    padding: 15px 20px; 
    border-radius: 12px; 
    margin-bottom: 20px; 
    border: 1px solid var(--accent-color);
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}


.reset-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}
.reset-btn:hover { background: var(--live-red); border-color: var(--live-red); }

#filter-name { color: var(--accent-color); font-weight: 900; }

@media (min-width: 600px) {
    .filter-header { flex-direction: row; justify-content: space-between; }
}

.week-dropdown { 
    width:100%; padding:14px; background:var(--card-bg); color:white; 
    border:1px solid var(--border-color); border-radius:10px; font-weight:800; 
    margin-bottom:20px; cursor: pointer; 
}

.pane-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.pane-btn { 
    background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); 
    color: var(--text-muted); padding: 10px; border-radius: 8px; font-size: 0.75rem; 
    font-weight: 800; cursor: pointer; transition: 0.2s; 
}
.pane-btn.active { background: var(--accent-color); color: #000; border-color: var(--accent-color); }


.game-card {
    background: var(--card-bg); border-radius: 14px; padding: 24px; margin-bottom: 16px;
    display: grid; grid-template-columns: 1fr 280px 1fr; align-items: center;
    border: 1px solid var(--border-color); transition: transform 0.2s; cursor: pointer; overflow: hidden;
    position: relative;
}
.game-card:hover { border-color: rgba(56, 189, 248, 0.3); }

.team-column { display: flex; flex-direction: row; align-items: center; gap: 15px; min-width: 0; flex: 1; }
.team-column.away { justify-content: flex-end; text-align: right; }
.team-column.home { justify-content: flex-start; text-align: left; }

.home-team-info { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.team-name-label { font-size: 1.1rem; font-weight: 800; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.home-indicator {
    display: inline-block; font-size: 9px; font-weight: 800; color: #38bdf8;
    background: rgba(56, 189, 248, 0.15); padding: 2px 6px; border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3); line-height: 1; text-transform: uppercase; letter-spacing: 0.5px;
}

.logo-wrapper { 
    width: 56px; height: 56px; background: #fff; border-radius: 50%; 
    padding: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; 
}
.team-logo { max-width: 100%; max-height: 100%; object-fit: contain; }


.score-center-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.status-label { font-size: 0.65rem; font-weight: 900; letter-spacing: 1px; margin-bottom: 4px; color: var(--text-muted); }
.live-pulse { color: var(--live-red); animation: blink 1.5s infinite; }

.main-score { display: flex; align-items: center; gap: 15px; margin-bottom: 8px; position: relative; justify-content: center; }
.score-num { font-size: 2.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.score-divider { font-size: 1.8rem; color: var(--text-muted); opacity: 0.5; }

.quarters-grid { display: flex; gap: 4px; }
.q-unit { 
    display: flex; flex-direction: column; background: rgba(0,0,0,0.3); 
    padding: 4px 6px; border-radius: 6px; min-width: 40px; border: 1px solid var(--border-color); 
}
.q-label { font-size: 0.5rem; color: var(--text-muted); font-weight: 700; }
.q-val { font-size: 0.7rem; font-weight: 800; }
.q-unit.q-active { 
    border: 1px solid var(--accent-color) !important; background: rgba(56, 189, 248, 0.15) !important; 
    position: relative; box-shadow: 0 0 8px rgba(56, 189, 248, 0.4); 
}
.q-unit.q-active::after { content: ''; position: absolute; top: 2px; right: 2px; width: 4px; height: 4px; background: #38bdf8; border-radius: 50%; }

.kickoff-time { 
    font-size: 1.6rem; 
    font-weight: 900; 
    color: var(--accent-color); 
    display: inline-block;
}

.kickoff-time::after { 
    content: ' LOCAL'; 
    font-size: 0.5rem; 
    opacity: 0.5; 
    margin-left: 4px; 
    vertical-align: middle; 
}

.kickoff-date { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    font-weight: bold; 
}

.is-tba .kickoff-time {
    font-size: 1.2rem;    
    color: var(--text-muted); 
    letter-spacing: 1px;
    font-weight: 800;
}

.is-tba .kickoff-time::after {
    display: none !important;
}

.is-tba .kickoff-date {
    opacity: 0.8;
}
.venue-info { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; margin-top: 8px; font-weight: 600; letter-spacing: 0.5px; }


#standings-section { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid var(--border-color); }
.standings-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.standings-table th { color: var(--text-muted); font-size: 0.7rem; padding-bottom: 12px; text-transform: uppercase; }
.standings-table td { padding: 12px 5px; border-bottom: 1px solid rgba(255,255,255,0.03); text-align: center; }
.is-live-row { background: rgba(56, 189, 248, 0.08); } 

.standings-team-cell { display: flex; align-items: center; gap: 12px; }
.mini-roster-link { font-size: 0.65rem; color: var(--accent-color); text-decoration: none; text-transform: uppercase; font-weight: 800; opacity: 0.7; margin-top: -2px; }
.mini-roster-link:hover { opacity: 1; text-decoration: underline; }
.team-link-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-weight: 600; transition: color 0.2s; }
.team-link-text:hover { color: var(--accent-color); text-decoration: underline; }
.logo-shield-small { width: 24px; height: 24px; background: #fff; border-radius: 50%; padding: 3px; flex-shrink: 0; }

.matchup-details-pane { 
    grid-column: 1 / -1; display: none; margin-top: 20px; padding: 15px; 
    background: rgba(0,0,0,0.4); border-radius: 10px; border: 1px solid var(--border-color); 
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}


.game-media-info { margin-top: 12px; width: 100%; border-top: 1px solid var(--border-color); padding-top: 10px; }
.broadcast-container { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.media-link, .media-tag {
    font-size: 0.65rem; font-weight: 800; text-transform: uppercase; padding: 3px 8px; 
    border-radius: 4px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: 0.2s;
}
.media-link.live { color: var(--accent-color); background: rgba(56, 189, 248, 0.1); }
.media-link.highlights { color: #facc15; background: rgba(250, 204, 21, 0.1); }
.media-tag.tv { color: #ffffff; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); }
.media-tba { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; }


.gamecenter-footer { margin-top: 50px; padding: 30px 20px; background: rgba(15, 23, 42, 0.9); border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.8rem; position: relative; z-index: 10; clear: both; }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-about { max-width: 400px; }
.footer-logo { font-weight: 800; display: block; margin-bottom: 5px; color: #f1f5f9; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-color); }


@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
@keyframes score-pop { 0% { transform: scale(1); } 50% { transform: scale(1.1); color: var(--accent-color); } 100% { transform: scale(1); } }

.score-updated { animation: score-pop 0.5s ease-in-out; }

.score-alert-message {
    position: absolute; top: -22px; left: 50%; transform: translateX(-50%) scale(0.8);
    background: #ef4444; color: white; padding: 2px 12px; border-radius: 20px;
    font-size: 0.6rem; font-weight: 900; white-space: nowrap; opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 100; box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.score-alert-active { opacity: 1 !important; transform: translateX(-50%) scale(1) !important; top: -45px !important; }


@media (max-width: 1024px) {
    .game-card { grid-template-columns: 1fr auto 1fr; padding: 15px 10px; gap: 8px; }
    .team-column { flex-direction: column !important; justify-content: center; text-align: center !important; }
    .team-column.away, .team-column.home { text-align: center; justify-content: center; }
    .logo-wrapper { display: none !important; }
    .team-name-label { font-size: 0.8rem; white-space: normal; line-height: 1.1; }
    .home-team-info { align-items: center; width: 100%; }
    .score-center-col { min-width: 140px; }
    .score-num { font-size: 1.8rem; }
    .score-divider { font-size: 1.4rem; }
    .quarters-grid { margin-top: 10px; justify-content: center; }
}


@media (max-width: 600px) {
    .footer-container { flex-direction: column; text-align: center; }
}

@media (max-width: 450px) {
    .game-card { grid-template-columns: 1fr 130px 1fr; gap: 5px; }
    .team-name-label { font-size: 0.7rem; font-weight: 700; }
    .score-center-col { min-width: 130px; }
    .score-num { font-size: 1.6rem; }
}


#landscape-force-overlay {
    position: fixed !important; top: 0; left: 0; width: 100vw; height: 0; 
    overflow: hidden; display: none !important; z-index: 999999;
    background: rgba(10, 15, 29, 0.98); color: white;
    flex-direction: column; justify-content: center; align-items: center;
}

@media screen and (max-width: 900px) and (orientation: portrait) {
    #landscape-force-overlay { display: flex !important; height: 100vh !important; }
}

.overlay-content {
    padding: 30px; background: rgba(255, 255, 255, 0.05); border-radius: 15px;
    backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1); text-align: center;
}
.rotate-icon { font-size: 3rem; display: block; margin-bottom: 15px; }
#landscape-force-overlay button {
    margin-top: 20px; background: var(--accent-color); border: none;
    padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; z-index: 10000;
}
.modal-content {
    background: #1e293b; padding: 25px; border-radius: 12px; max-width: 550px; width: 90%;
    border: 1px solid #334155; position: relative; max-height: 80vh; overflow-y: auto;
}
.close-modal { position: absolute; right: 15px; top: 10px; font-size: 28px; cursor: pointer; color: #94a3b8; }
.btn-drives { 
    background: rgba(56, 189, 248, 0.1); border: 1px solid var(--accent-color); 
    color: var(--accent-color); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 0.75rem; font-weight: 600;
}
.drive-row { display: flex; align-items: center; border-bottom: 1px solid #334155; padding: 10px 0; }
.drive-score-box { width: 50px; font-weight: 800; color: var(--accent-color); text-align: center; font-size: 0.9rem; }
.drive-info-mid { flex: 1; text-align: center; font-size: 0.8rem; color: #cbd5e1; padding: 0 10px; }
.drive-team-label { font-size: 0.6rem; text-transform: uppercase; color: var(--text-muted); display: block; }

/* Week Pills Styling */
.schedule-controls {
    margin-bottom: 25px;
}

.week-pills-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0 15px 0;
    /* Versteckt Scrollbar in den meisten Browsern für sauberen Look */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

.week-pills-container::-webkit-scrollbar {
    display: none;
}

.week-pill {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.week-pill:hover {
    border-color: var(--accent-color);
    color: #fff;
}

.week-pill.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #0a0f1d; /* Dunkler Text auf hellem Accent für Lesbarkeit */
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.week-label-small {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    padding-left: 2px;
}

.week-pill {
    min-width: 40px;
    text-align: center;
    padding: 8px 12px;
}

.team-action-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.action-pill {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s;
}

.action-pill:hover {
    opacity: 0.8;
}

.action-pill.tickets {
    background: #f59e0b;
    color: #000;
}

.action-pill.web {
    background: #334155;
    color: #fff;
}

.action-pill.cal {
    background: var(--accent-color);
    color: #0a0f1d;
}

.home-indicator {
    margin-top: 0 !important; 
    background: #1e293b;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

@media (max-width: 600px) {
    .action-pill {
        font-size: 0.55rem; 
        padding: 1px 4px;
    }
    .team-action-bar {
        gap: 2px;
    }
}

.game-calendar-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: all 0.2s;
}

.game-calendar-link:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #fff !important;
}

.game-card-ical-top {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 6px;
    color: var(--accent-color);
    font-size: 0.65rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s ease;
}

.game-card-ical-top:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .game-card-ical-top .ical-text {
        display: none;
    }
    .game-card-ical-top {
        padding: 5px;
        top: 8px;
        right: 8px;
    }
}