* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-secondary: #999;
    --link-color: #6ab0ff;
    --match-bg-hover: #2a2a2a;
    --border-color: #333;
    --footer-border: #444;
    --logo-gray: #aaa;
}

body.light-mode {
    --bg-color: #fefefe;
    --text-color: #333;
    --text-secondary: #666;
    --link-color: #0066cc;
    --match-bg-hover: #f5f5f5;
    --border-color: #eee;
    --footer-border: #ccc;
    --logo-gray: #555;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    background: var(--bg-color);
    color: var(--text-color);
    max-width: 600px;
    margin: 0 auto;
    padding: 8px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    margin: 0;
}

.logo .red {
    color: #f62c4e;
}

.logo .gray {
    color: #5f8f8f;
}

.tagline {
    font-size: 11px;
    color: #888;
    margin: 0 0 5px 0;
    text-transform: uppercase;
}

body.light-mode .logo .gray {
    color: #2f4f4f;
}

.header-buttons {
    display: flex;
    gap: 5px;
}

.header-btn {
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 3px;
}

#matches-container {
    min-height: 100vh;
}

#matches-container.large-text .league-header {
    font-size: 14px;
    padding: 6px 10px;
}

#matches-container.large-text .match-row {
    padding: 10px 8px;
}

#matches-container.large-text .match-time {
    font-size: 14px;
    min-width: 50px;
}

#matches-container.large-text .match-teams {
    font-size: 15px;
}

#matches-container.large-text .match-score {
    font-size: 15px;
}

nav {
    margin: 5px 0;
}

nav a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 12px;
}

nav a:hover {
    text-decoration: underline;
}

nav a.active {
    font-weight: bold;
    color: var(--text-color);
}

.refresh-link {
    display: block;
    color: var(--link-color);
    text-decoration: underline;
    margin: 10px 0;
    font-size: 12px;
    display: none;
}

.breadcrumb {
    background: none;
    color: #e0e0e0;
    padding: 5px 0;
    font-weight: bold;
    margin: 10px 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auto-refresh {
    font-size: 11px;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.auto-refresh input {
    cursor: pointer;
}

body.light-mode .breadcrumb {
    color: #333;
}

.league-header {
    background: #2f4f4f;
    color: #fff;
    padding: 4px 10px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.league-header a {
    color: #fff;
    text-decoration: none;
}

.league-header a.standings-link {
    color: #ccc;
    text-decoration: underline;
    flex-shrink: 0;
    margin-left: 8px;
}

.standings-link:hover {
    color: #fff;
}

.match {
    padding: 4px 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.match:hover {
    background: var(--match-bg-hover);
}

.match-time {
    width: 50px;
    color: var(--text-color);
}

.match-time.live {
    color: #f62c4e;
}

.match-teams {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-teams .status-label-strikethrough {
    text-decoration: line-through;
    opacity: 0.7;
}

.match-score {
    width: 40px;
    text-align: center;
    font-weight: bold;
    color: var(--text-color);
}

.match-score.not-started {
    color: var(--text-color);
}

footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--footer-border);
    font-size: 11px;
    color: var(--text-secondary);
}

footer h2 {
    font-size: 13px;
    color: var(--text-color);
    margin: 10px 0 5px 0;
}

footer h3 {
    font-size: 11px;
    color: var(--text-color);
    margin: 10px 0 5px 0;
}

footer p {
    margin: 5px 0;
    line-height: 1.4;
}

footer ul {
    margin: 5px 0;
    padding-left: 20px;
}

footer li {
    margin: 3px 0;
}

footer a {
    color: var(--link-color);
}

footer .footer-copyright {
    margin-top: 15px;
    font-size: 11px;
    color: #999;
}

footer .footer-nav {
    margin-top: 8px;
}

footer .footer-links {
    margin-top: 8px;
    font-size: 11px;
}

footer .footer-links a {
    color: #ccc;
    text-decoration: none;
}

footer .footer-links a:hover {
    text-decoration: underline;
}

.scroll-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.date-dropdown {
    font-size: 12px;
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
}

.scroll-tab {
    padding: 5px 8px;
    font-size: 11px;
    cursor: pointer;
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.scroll-tab.active {
    background: #2f4f4f;
    color: #fff;
    border-color: #2f4f4f;
}

.loading, .error, .no-matches {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-secondary);
    font-size: 13px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.no-matches p {
    margin: 0;
}

.cta-btn {
    background: none;
    color: var(--accent-color);
    border: none;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.error {
    color: #c41e3a;
}

/* Events Panel */
.match-wrapper {
    display: flex;
    flex-direction: column;
}

.match.expandable {
    cursor: pointer;
}

.match.expandable .match-score {
    text-decoration: underline;
}

.match.expandable:hover {
    background: var(--card-bg);
}

.events-panel {
    display: none;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: 0 0 6px 6px;
    margin-top: -2px;
}

.match-wrapper.expanded .events-panel {
    display: block;
}

.event-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
}

.ev-min {
    color: var(--text-secondary);
    min-width: 37px;
}

.ev-icon {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.ev-goal { color: #4CAF50; }
.ev-og { color: #c41e3a; }
.ev-missed { color: #888; text-decoration: line-through; }
.ev-yellow { color: #FFD700; }
.ev-red { color: #c41e3a; }
.ev-sub { color: #888; }
.ev-var { color: #2196F3; font-size: 10px; }
.ev-cancelled { color: #888; text-decoration: line-through; }

.ev-player {
    color: var(--text-primary);
}

#league-back {
    margin: 8px 0;
    font-size: 12px;
}

#league-back a {
    color: #ccc;
    text-decoration: none;
}


.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 15px;
}

.standings-table th {
    background: var(--border-color);
    padding: 6px 4px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.standings-table td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.standings-table .st-rank {
    width: 25px;
    text-align: center;
}

.standings-table .st-team {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
    width: 45%;
}

.standings-table .st-pts {
    font-weight: bold;
}

.standings-table tr.st-qualified td:first-child {
    border-left: 2px solid #4CAF50;
}

.standings-table tr.st-relegated td:first-child {
    border-left: 2px solid #f44336;
}

.info-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 15px;
    line-height: 1.6;
}

.info-page section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.info-page h2 {
    font-size: 16px;
    margin-bottom: 8px;
}

.info-page h3 {
    font-size: 13px;
    margin: 12px 0 4px;
}

.info-page p {
    font-size: 12px;
    margin-bottom: 6px;
}

.info-page ul {
    font-size: 12px;
    padding-left: 20px;
    margin: 6px 0;
}

.info-page a {
    color: #ccc;
}
