/* style.css */

/* 全局：强制深色背景，防止被主题覆盖 */
html, body {
    margin: 0;
    padding: 0;
    background: #020617 !important;
    color: #f9fafb !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

/* 容器 */
.football-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 12px;
}

/* 顶部标题区域：压低字号，看起来不像巨大标题 */
.football-header {
    text-align: left;
    margin-bottom: 10px;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 8px;
}

.football-header h1 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 600;
    color: #f9fafb;
}

.football-header p {
    margin: 0;
    color: #9ca3af;
    font-size: 12px;
}

/* 区块标题（Fixtures / Standings） */
.section-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #e5e7eb;
}

/* 控制面板：卡片风格，紧凑 */
.football-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px 10px 8px;
    background: #020617;
    border-radius: 8px;
    border: 1px solid #1f2937;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.4);
}

.control-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
    flex: 1;
}

.control-group label {
    font-size: 11px;
    margin-bottom: 3px;
    color: #d1d5db;
}

.control-group input,
.control-group select {
    border-radius: 4px;
    border: 1px solid #374151;
    padding: 5px 7px;
    font-size: 13px;
    background: #020617;
    color: #e5e7eb;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.control-group input:focus,
.control-group select:focus {
    border-color: #2563eb;
    background: #020617;
}

/* 按钮 */
.btn {
    padding: 7px 14px;
    border-radius: 4px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    align-self: center;
    margin-top: auto;
    white-space: nowrap;
}

.btn.primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn.primary:hover {
    background: #1d4ed8;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* 内容块 */
.football-content {
    background: #020617;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #1f2937;
    margin-bottom: 6px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.5);
}

.loading {
    color: #a5b4fc;
    font-size: 12px;
    margin-bottom: 4px;
}

.error {
    color: #fca5a5;
    font-size: 12px;
    margin-bottom: 4px;
}

.hidden {
    display: none;
}

/* 比赛列表 */
.matches-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.match-card {
    display: grid;
    grid-template-columns: 1.4fr 0.7fr 1.4fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "home score away"
        "info info info";
    gap: 3px 6px;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #1f2937;
    background: #020617;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 6px;
}

.match-team .logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1f2937;
    overflow: hidden;
    flex-shrink: 0;
}

.match-team .logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-team .name {
    font-size: 12px;
    color: #e5e7eb;
}

.match-score {
    grid-area: score;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #fbbf24;
    align-self: center;
}

.match-home {
    grid-area: home;
}

.match-away {
    grid-area: away;
    text-align: right;
}

.match-info {
    grid-area: info;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

.match-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 状态标签 */
.status-tag {
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    background: #1f2937;
    color: #e5e7eb;
}

.status-tag.live {
    background: #059669;
    color: #ecfdf5;
}

.status-tag.finished {
    background: #374151;
    color: #f9fafb;
}

.status-tag.scheduled {
    background: #2563eb;
    color: #eff6ff;
}

/* 带阴影的小号页脚 */
.football-footer {
    text-align: center;
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
}

/* Bảng xếp hạng – gọn đẹp */
.standings-container {
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #1f2937;
    overflow: hidden;
    background: #020617;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    line-height: 1.4;
}

.standings-table thead {
    background: #0b1120;
}

.standings-table th,
.standings-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #111827;
    color: #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

.standings-table th {
    font-weight: 600;
    color: #f9fafb;
}

.standings-table tbody tr:nth-child(odd) td {
    background: #020617;
}
.standings-table tbody tr:nth-child(even) td {
    background: #050816;
}

/* 高亮前 4 名 */
.standings-table tr.highlight td {
    background: #1e293b;
    color: #f9fafb;
}

.standings-table td:first-child,
.standings-table th:first-child {
    text-align: center;
    width: 28px;
}

/* Đội bóng: logo + tên */
.standings-team {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.standings-team-logo {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: #1f2937;
    flex-shrink: 0;
}

.standings-team-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 数字列居中 */
.standings-table td:nth-child(n+3),
.standings-table th:nth-child(n+3) {
    text-align: center;
}

/* 响应式 */
@media (max-width: 640px) {
    .football-wrapper {
        padding: 10px 8px;
    }

    .football-controls {
        flex-direction: column;
    }

    .match-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "home"
            "score"
            "away"
            "info";
        text-align: left;
    }

    .match-away {
        text-align: left;
    }

    .match-score {
        margin: 4px 0;
    }

    .standings-table {
        font-size: 10px;
    }
}
