:root {
    --bg: #f4f7fb;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f6ff;
    --accent: #2563eb;
    --accent-soft: #3b82f6;
    --text: #1e293b;
    --text-dim: #64748b;
    --border: #e2e8f0;
    --win: #16a34a;
    --lose: #dc2626;
}

* { box-sizing: border-box; }

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Pretendard", "Malgun Gothic", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* header */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}
.main-nav {
    display: flex;
    gap: 18px;
}
.main-nav a {
    color: var(--text-dim);
    font-weight: 600;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
}
.main-nav a.active,
.main-nav a:hover {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* sport tabs */
.sport-tabs {
    max-width: 1100px;
    margin: 14px auto 0;
    padding: 0 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab {
    flex: none;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.9rem;
    white-space: nowrap;
}
.tab.active {
    background: var(--accent-soft);
    color: #fff;
    border-color: var(--accent);
}

/* ad banner */
.ad-banner-wrap {
    grid-column: 1 / -1;
    margin: 4px 0;
    text-align: center;
}
.ad-banner-link {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ad-banner-link:hover {
    transform: scale(1.005);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
}
.ad-banner-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    background: var(--bg-card);
}
.ad-banner-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 7px 20px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}
.ad-banner-link:hover .ad-banner-btn {
    background: var(--accent-soft);
}
@media (max-width: 640px) {
    .ad-banner-btn { right: 10px; bottom: 10px; padding: 6px 16px; font-size: 0.78rem; }
}

/* layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}
.page-title {
    font-size: 1.4rem;
    margin: 4px 0 18px;
}
.empty {
    color: var(--text-dim);
    text-align: center;
    padding: 40px 0;
}

/* match cards */
.match-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background 0.15s, box-shadow 0.15s;
}
.match-card:hover {
    background: var(--bg-card-hover);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 10px;
    gap: 8px;
    flex-wrap: wrap;
}
.league {
    font-weight: 700;
    color: var(--accent);
}
.status-badge {
    background: var(--border);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.team-right {
    justify-content: flex-end;
    text-align: right;
}
.team-name {
    font-weight: 600;
    overflow-wrap: break-word;
    word-break: keep-all;
}
.flag {
    font-size: 1.2rem;
}
.vs {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 700;
    flex: none;
}
.score {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    flex: none;
    padding: 0 8px;
}

/* odds */
.odds-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
}
.odds-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
}
.odds-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
}
.odds-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
    margin: 2px 0;
}
.odds-prob {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* team rank badge */
.team-rank {
    font-size: 0.72rem;
    color: var(--text-dim);
    background: #f1f5f9;
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
}

/* standings page */
.league-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.standings-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    white-space: nowrap;
}
.standings-table th,
.standings-table td {
    padding: 10px 14px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.standings-table th {
    color: var(--text-dim);
    font-weight: 700;
    background: #f8fafc;
}
.standings-table .team-col {
    text-align: left;
    font-weight: 600;
}
.standings-table tbody tr:hover {
    background: var(--bg-card-hover);
}
.standings-table tbody tr:last-child td {
    border-bottom: none;
}

/* footer */
.site-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    color: var(--text-dim);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.site-footer p { margin: 4px 0; }

/* responsive tweaks */
@media (max-width: 640px) {
    .match-list {
        grid-template-columns: 1fr;
    }
    .brand { font-size: 1.1rem; }
    .main-nav { gap: 12px; font-size: 0.9rem; }
    .team-name { font-size: 0.92rem; }
}
