/* ==========================================================================
   Reds Schedule Calendar — Styles
   Works with both dark (default) and light themes via rlc-theme-light class
   ========================================================================== */

/* ------------------------------------------------------------------ */
/*  Theme variables                                                    */
/* ------------------------------------------------------------------ */
:root {
    --rlc-sched-bg:         #0b0b10;
    --rlc-sched-surface:    #131319;
    --rlc-sched-surface-2:  #1b1b24;
    --rlc-sched-surface-3:  #232330;
    --rlc-sched-border:     #2a2a38;
    --rlc-sched-text:       #f0f0f3;
    --rlc-sched-text-muted: #8a8aa0;
    --rlc-sched-accent:     #c6011f;
    --rlc-sched-accent-2:   #e0022a;
    --rlc-sched-accent-glow: rgba(198, 1, 31, 0.35);
    --rlc-sched-home-bg:    rgba(198, 1, 31, 0.08);
    --rlc-sched-home-border:#c6011f;
    --rlc-sched-away-bg:    rgba(138, 138, 160, 0.06);
    --rlc-sched-away-border:#555566;
    --rlc-sched-today-ring: #ffd700;
    --rlc-sched-past-opacity: 0.5;
    --rlc-sched-rival-glow: rgba(198, 1, 31, 0.18);
    --rlc-sched-radius:     12px;
    --rlc-sched-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rlc-sched-shadow:     0 8px 32px rgba(0,0,0,0.5);
    --rlc-sched-card-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Light theme overrides */
.rlc-theme-light {
    --rlc-sched-bg:         #f5f5f7;
    --rlc-sched-surface:    #ffffff;
    --rlc-sched-surface-2:  #f0f0f2;
    --rlc-sched-surface-3:  #e8e8ec;
    --rlc-sched-border:     #d4d4dc;
    --rlc-sched-text:       #1a1a2e;
    --rlc-sched-text-muted: #666680;
    --rlc-sched-home-bg:    rgba(198, 1, 31, 0.06);
    --rlc-sched-away-bg:    rgba(100, 100, 130, 0.06);
    --rlc-sched-away-border:#aaaabc;
    --rlc-sched-rival-glow: rgba(198, 1, 31, 0.1);
    --rlc-sched-shadow:     0 4px 16px rgba(0,0,0,0.08);
    --rlc-sched-card-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ------------------------------------------------------------------ */
/*  Wrapper                                                            */
/* ------------------------------------------------------------------ */
.rlc-schedule-wrapper {
    font-family: var(--rlc-sched-font);
    color: var(--rlc-sched-text);
    background: var(--rlc-sched-bg);
    border-radius: 16px;
    /* overflow left visible so sticky positioning works on the chat panel.
       Rounded corners are handled by the header/content children instead. */
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: var(--rlc-sched-shadow);
    border: 1px solid var(--rlc-sched-border);
}

/* ------------------------------------------------------------------ */
/*  Header                                                             */
/* ------------------------------------------------------------------ */
.rlc-sched-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--rlc-sched-surface);
    border-bottom: 1px solid var(--rlc-sched-border);
    position: relative;
    flex-wrap: wrap;
    gap: 12px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.rlc-sched-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c6011f 0%, #ff2d4a 40%, #ffd700 100%);
    opacity: 0.8;
}

.rlc-sched-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rlc-sched-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(198,1,31,0.3));
}

.rlc-sched-title-group {
    display: flex;
    flex-direction: column;
}

.rlc-sched-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #c6011f, #ff2d4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rlc-sched-subtitle {
    font-size: 13px;
    color: var(--rlc-sched-text-muted);
    margin: 2px 0 0 0;
}

.rlc-sched-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Legend */
.rlc-sched-legend {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--rlc-sched-text-muted);
}

.rlc-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rlc-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.rlc-legend-home .rlc-legend-dot {
    background: var(--rlc-sched-accent);
}

.rlc-legend-away .rlc-legend-dot {
    background: var(--rlc-sched-away-border);
}

/* Theme toggle button */
.rlc-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--rlc-sched-border);
    border-radius: 10px;
    background: var(--rlc-sched-surface-2);
    color: var(--rlc-sched-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.rlc-theme-toggle:hover {
    border-color: var(--rlc-sched-accent);
    color: var(--rlc-sched-accent);
    background: var(--rlc-sched-surface-3);
}

/* Show/hide sun/moon icons based on theme */
.rlc-theme-icon-light { display: none; }
.rlc-theme-icon-dark  { display: block; }

.rlc-theme-light .rlc-theme-icon-light { display: block; }
.rlc-theme-light .rlc-theme-icon-dark  { display: none; }

/* ------------------------------------------------------------------ */
/*  Focus toggle button                                                */
/* ------------------------------------------------------------------ */
.rlc-focus-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--rlc-sched-border);
    border-radius: 8px;
    background: var(--rlc-sched-surface-3);
    color: var(--rlc-sched-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.rlc-focus-toggle:hover {
    border-color: var(--rlc-sched-accent);
    color: var(--rlc-sched-accent);
    background: var(--rlc-sched-surface-3);
}

/* Icon states: off = split pane, on = full pane */
.rlc-focus-icon-on  { display: none; }
.rlc-focus-icon-off { display: block; }

.rlc-focus-toggle[aria-pressed="true"] {
    background: var(--rlc-sched-accent);
    border-color: var(--rlc-sched-accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--rlc-sched-accent-glow);
}

.rlc-focus-toggle[aria-pressed="true"] .rlc-focus-icon-on  { display: block; }
.rlc-focus-toggle[aria-pressed="true"] .rlc-focus-icon-off { display: none; }

/* ------------------------------------------------------------------ */
/*  Focus mode — collapse schedule to today's game only, expand chat   */
/* ------------------------------------------------------------------ */
.rlc-schedule-wrapper.rlc-focus-mode .rlc-sched-calendar {
    flex: 0 0 260px;
    width: 260px;
    min-width: 0;
    padding: 16px;
}

.rlc-schedule-wrapper.rlc-focus-mode .rlc-game-grid {
    grid-template-columns: 1fr;
}

.rlc-schedule-wrapper.rlc-focus-mode .rlc-sched-chat-panel {
    flex: 1 1 0%;
    max-width: 100%;
    width: auto;
}

/* Highlight today's card when in focus mode. */
.rlc-schedule-wrapper.rlc-focus-mode .rlc-game-card.rlc-game-today {
    border-color: var(--rlc-sched-accent);
    box-shadow: 0 0 12px var(--rlc-sched-accent-glow);
}

/* ------------------------------------------------------------------ */
/*  Month tabs                                                         */
/* ------------------------------------------------------------------ */
.rlc-month-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    background: var(--rlc-sched-surface);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rlc-month-tabs::-webkit-scrollbar { display: none; }

.rlc-month-tab {
    flex-shrink: 0;
    padding: 8px 20px;
    border: 1px solid var(--rlc-sched-border);
    border-radius: 8px;
    background: transparent;
    color: var(--rlc-sched-text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--rlc-sched-font);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.rlc-month-tab:hover {
    background: var(--rlc-sched-surface-2);
    border-color: var(--rlc-sched-accent);
    color: var(--rlc-sched-text);
}

.rlc-month-tab-active {
    background: var(--rlc-sched-accent);
    border-color: var(--rlc-sched-accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--rlc-sched-accent-glow);
}

.rlc-month-tab-active:hover {
    background: var(--rlc-sched-accent-2);
    color: #fff;
}

/* ------------------------------------------------------------------ */
/*  Content layout (side by side on desktop)                           */
/* ------------------------------------------------------------------ */
.rlc-sched-content {
    display: flex;
    min-height: 600px;
    /* No max-height — calendar flows naturally, chat panel is sticky. */
}

.rlc-sched-calendar {
    flex: 1;
    padding: 20px 24px;
    /* No overflow/max-height — games display naturally and the page scrolls. */
}

/* Mobile-only toggle to collapse/expand the schedule */
.rlc-sched-mobile-toggle {
    display: none; /* Hidden on desktop, shown in @media ≤900px */
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: var(--rlc-sched-surface);
    border: none;
    border-bottom: 1px solid var(--rlc-sched-border);
    color: var(--rlc-sched-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.rlc-sched-mobile-toggle-icon {
    transition: transform .2s ease;
}

.rlc-sched-chat-panel {
    width: 420px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--rlc-sched-border);
    background: var(--rlc-sched-surface);
    /* Sticky sidebar: chat stays pinned while calendar scrolls with the page. */
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    max-height: 100vh;
}

/* ------------------------------------------------------------------ */
/*  Past games collapsible section                                     */
/* ------------------------------------------------------------------ */
.rlc-past-games-section {
    margin-bottom: 12px;
}

.rlc-past-games-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--rlc-sched-border);
    border-radius: 8px;
    background: var(--rlc-sched-surface-2);
    color: var(--rlc-sched-text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--rlc-sched-font);
    cursor: pointer;
    transition: all 0.2s;
}

.rlc-past-games-toggle:hover {
    border-color: var(--rlc-sched-accent);
    color: var(--rlc-sched-text);
    background: var(--rlc-sched-surface-3);
}

.rlc-past-toggle-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.rlc-past-toggle-icon.rlc-past-toggle-open {
    transform: rotate(45deg);
}

.rlc-past-games-grid {
    margin-bottom: 16px;
}

/* Later (upcoming) games — collapsed by default, same pattern as past */
.rlc-later-games-section {
    margin-top: 12px;
}

.rlc-later-games-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--rlc-sched-border);
    border-radius: 8px;
    background: var(--rlc-sched-surface-2);
    color: var(--rlc-sched-text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--rlc-sched-font);
    cursor: pointer;
    transition: all 0.2s;
}

.rlc-later-games-toggle:hover {
    border-color: var(--rlc-sched-accent);
    color: var(--rlc-sched-text);
    background: var(--rlc-sched-surface-3);
}

.rlc-later-toggle-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.rlc-later-toggle-icon.rlc-later-toggle-open {
    transform: rotate(45deg);
}

.rlc-later-games-grid {
    margin-bottom: 16px;
}

/* ------------------------------------------------------------------ */
/*  Game grid                                                          */
/* ------------------------------------------------------------------ */
.rlc-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

/* ------------------------------------------------------------------ */
/*  Game card                                                          */
/* ------------------------------------------------------------------ */
.rlc-game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--rlc-sched-radius);
    border: 1px solid var(--rlc-sched-border);
    background: var(--rlc-sched-surface-2);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: var(--rlc-sched-font);
    color: var(--rlc-sched-text);
    box-shadow: var(--rlc-sched-card-shadow);
}

.rlc-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border-color: var(--rlc-sched-accent);
}

.rlc-game-card:active {
    transform: scale(0.98);
}

.rlc-game-card.rlc-game-selected {
    border-color: var(--rlc-sched-accent);
    box-shadow: 0 0 0 2px var(--rlc-sched-accent-glow), 0 4px 16px rgba(0,0,0,0.3);
}

/* Home game accent */
.rlc-game-home {
    border-left: 3px solid var(--rlc-sched-home-border);
    background: var(--rlc-sched-home-bg);
}

.rlc-game-away {
    border-left: 3px solid var(--rlc-sched-away-border);
    background: var(--rlc-sched-away-bg);
}

/* Past games dimmed */
.rlc-game-past {
    opacity: var(--rlc-sched-past-opacity);
}

.rlc-game-past:hover {
    opacity: 0.8;
}

/* Today highlight */
.rlc-game-today {
    opacity: 1;
    border-color: var(--rlc-sched-today-ring);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3), var(--rlc-sched-card-shadow);
    animation: rlc-today-pulse 3s ease-in-out infinite;
}

@keyframes rlc-today-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2), var(--rlc-sched-card-shadow); }
    50%      { box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.35), 0 0 20px rgba(255, 215, 0, 0.15); }
}

.rlc-game-today .rlc-game-daynum {
    color: var(--rlc-sched-today-ring);
}

/* Rival game subtle glow */
.rlc-game-rival {
    background: var(--rlc-sched-rival-glow);
}

/* Card internals */
.rlc-game-date {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.rlc-game-dow {
    font-size: 11px;
    font-weight: 600;
    color: var(--rlc-sched-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rlc-game-daynum {
    font-size: 14px;
    font-weight: 700;
}

.rlc-game-matchup {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rlc-game-ha {
    font-size: 11px;
    font-weight: 700;
    color: var(--rlc-sched-text-muted);
    text-transform: uppercase;
}

.rlc-game-opponent {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.rlc-game-home .rlc-game-opponent {
    color: var(--rlc-sched-accent);
}

.rlc-game-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rlc-game-time {
    font-size: 12px;
    color: var(--rlc-sched-text-muted);
    font-weight: 600;
}

.rlc-game-note {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rlc-sched-today-ring);
    background: rgba(255, 215, 0, 0.1);
    padding: 2px 7px;
    border-radius: 4px;
}

.rlc-game-live-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    background: var(--rlc-sched-accent);
    padding: 3px 8px;
    border-radius: 4px;
    animation: rlc-live-glow 2s ease-in-out infinite;
}

@keyframes rlc-live-glow {
    0%, 100% { box-shadow: 0 0 4px var(--rlc-sched-accent-glow); }
    50%      { box-shadow: 0 0 12px var(--rlc-sched-accent-glow); }
}

/* ------------------------------------------------------------------ */
/*  Chat panel header (back + title)                                   */
/* ------------------------------------------------------------------ */
.rlc-sched-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rlc-sched-border);
    background: var(--rlc-sched-surface-2);
}

.rlc-sched-back-btn {
    display: none; /* only shown on mobile */
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--rlc-sched-border);
    border-radius: 8px;
    color: var(--rlc-sched-text-muted);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--rlc-sched-font);
    cursor: pointer;
    transition: all 0.15s;
}

.rlc-sched-back-btn:hover {
    border-color: var(--rlc-sched-accent);
    color: var(--rlc-sched-accent);
}

.rlc-sched-chat-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rlc-sched-text);
    flex: 1;
}

/* Chat header action buttons group */
.rlc-sched-chat-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Chat toggle (minimize/expand) — always visible */
.rlc-sched-chat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--rlc-sched-border);
    border-radius: 8px;
    background: var(--rlc-sched-surface-3);
    color: var(--rlc-sched-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.rlc-sched-chat-toggle:hover {
    border-color: var(--rlc-sched-accent);
    color: var(--rlc-sched-accent);
}

/* Icon visibility — show minimize chevron by default, expand when collapsed */
.rlc-sched-chat-toggle .rlc-toggle-icon-expand  { display: none; }
.rlc-sched-chat-toggle .rlc-toggle-icon-minimize { display: block; }

.rlc-sched-chat-collapsed .rlc-sched-chat-toggle .rlc-toggle-icon-expand  { display: block; }
.rlc-sched-chat-collapsed .rlc-sched-chat-toggle .rlc-toggle-icon-minimize { display: none; }

/* Collapsed state — hide the chat embed and input, keep header visible */
.rlc-sched-chat-collapsed .rlc-sched-chat-embed {
    display: none !important;
}

.rlc-sched-chat-embed {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flex child to shrink below content size */
}

/* Chat app inside schedule panel — override max-width and theme conflicts */
.rlc-sched-chat-embed .rlc-chat-app {
    max-width: 100% !important;
    border-radius: 0;
    border: none;
    box-shadow: none;
    height: 100%;
    min-height: 0; /* Critical: allows flex children to scroll instead of overflow */
    margin: 0 !important;
}

/* Prevent WP themes from blowing up the logo inside the embedded chat */
.rlc-sched-chat-embed .rlc-brand-logo {
    height: 26px !important;
    max-height: 26px !important;
    width: auto !important;
    max-width: 120px !important;
}

/* Force header to stay compact */
.rlc-sched-chat-embed .rlc-header {
    min-height: 48px;
    max-height: 56px;
    overflow: hidden;
    z-index: 2;
}

/* Ensure header buttons are always clickable above panels/messages */
.rlc-sched-chat-embed .rlc-header-right {
    z-index: 3;
    position: relative;
}

/* Make sure the messages area fills remaining space and doesn't overflow */
.rlc-sched-chat-embed .rlc-messages {
    height: auto !important;
    flex: 1;
    min-height: 0;
}

/* Reset any WP theme img overrides inside our chat */
.rlc-sched-chat-embed img {
    max-width: none;
    height: auto;
}

.rlc-sched-chat-embed .rlc-brand-logo {
    height: 26px !important;
}

/* Panels inside schedule embed — make sure they don't exceed the embed */
.rlc-sched-chat-embed .rlc-panel {
    max-width: 100%;
}

/* Override WP theme input color resets — ensure typed text is visible */
.rlc-sched-chat-embed .rlc-msg-input {
    color: #ffffff !important;
    background: var(--rlc-surface-2, #1a1a22) !important;
}

.rlc-sched-chat-embed .rlc-msg-input::placeholder {
    color: #a0a0b8 !important;
}

/* ------------------------------------------------------------------ */
/*  Scrollbar                                                          */
/* ------------------------------------------------------------------ */
.rlc-sched-calendar::-webkit-scrollbar { width: 6px; }
.rlc-sched-calendar::-webkit-scrollbar-track { background: transparent; }
.rlc-sched-calendar::-webkit-scrollbar-thumb { background: var(--rlc-sched-border); border-radius: 3px; }
.rlc-sched-calendar::-webkit-scrollbar-thumb:hover { background: var(--rlc-sched-text-muted); }

/* ------------------------------------------------------------------ */
/*  Empty / loading state                                              */
/* ------------------------------------------------------------------ */
.rlc-sched-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--rlc-sched-text-muted);
    font-size: 14px;
}

.rlc-sched-chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--rlc-sched-text-muted);
    text-align: center;
    padding: 40px 20px;
    gap: 12px;
}

.rlc-sched-chat-placeholder svg {
    opacity: 0.3;
}

.rlc-sched-chat-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
    .rlc-sched-content {
        flex-direction: column;
        max-height: none;
    }

    .rlc-sched-calendar {
        max-height: none;
    }

    /* ---- Mobile schedule collapse toggle ---- */
    .rlc-sched-mobile-toggle {
        display: flex;
    }

    /* When schedule is collapsed on mobile, hide month tabs and calendar content */
    .rlc-schedule-wrapper.rlc-sched-cal-collapsed .rlc-month-tabs {
        display: none;
    }

    .rlc-schedule-wrapper.rlc-sched-cal-collapsed .rlc-sched-calendar {
        padding: 0;
    }

    .rlc-schedule-wrapper.rlc-sched-cal-collapsed .rlc-month-section {
        display: none !important;
    }

    /* Flip the chevron when collapsed */
    .rlc-schedule-wrapper.rlc-sched-cal-collapsed .rlc-sched-mobile-toggle-icon {
        transform: rotate(180deg);
    }

    /* When schedule collapsed, let the chat panel fill more space */
    .rlc-schedule-wrapper.rlc-sched-cal-collapsed .rlc-sched-chat-panel {
        height: calc(100vh - 180px);
        max-height: none;
        min-height: 300px;
        position: relative;
    }

    .rlc-sched-chat-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--rlc-sched-border);
        /* Sticky at viewport bottom so users can't scroll past the chat. */
        position: sticky;
        bottom: 0;
        top: auto;
        align-self: auto;
        height: 55vh;
        min-height: 350px;
        max-height: 500px;
        z-index: 50;
    }

    /* Collapsed chat: just the header bar, no min-height */
    .rlc-sched-chat-collapsed .rlc-sched-chat-panel {
        min-height: auto;
        height: auto;
    }

    .rlc-sched-back-btn {
        display: flex;
    }

    /* When user switches to a specific game chat on mobile, go full-screen */
    .rlc-schedule-wrapper.rlc-game-chat-active .rlc-sched-calendar,
    .rlc-schedule-wrapper.rlc-game-chat-active .rlc-month-tabs {
        display: none;
    }

    .rlc-schedule-wrapper.rlc-game-chat-active .rlc-sched-chat-panel {
        height: calc(100vh - 120px);
        max-height: none;
        position: relative;
    }
}

@media (max-width: 600px) {
    .rlc-sched-header {
        padding: 16px;
    }

    .rlc-sched-title {
        font-size: 18px;
    }

    .rlc-sched-logo {
        height: 36px;
    }

    .rlc-month-tabs {
        padding: 10px 16px;
    }

    .rlc-month-tab {
        padding: 6px 14px;
        font-size: 12px;
    }

    .rlc-sched-calendar {
        padding: 14px 16px;
    }

    .rlc-game-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rlc-game-card {
        flex-direction: row;
        align-items: center;
        padding: 12px 14px;
        gap: 12px;
    }

    .rlc-game-date {
        flex-direction: column;
        align-items: center;
        min-width: 50px;
        gap: 0;
    }

    .rlc-game-matchup {
        flex: 1;
    }

    .rlc-game-opponent {
        font-size: 16px;
    }

    .rlc-game-meta {
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }

    .rlc-sched-legend {
        display: none;
    }
}
