:root {
    --cbat-blue: #123a78;
    --cbat-blue-dark: #0c2b59;
    --cbat-yellow: #efc243;
    --cbat-lightblue: #69a7ff;

    --bg: #eef1f5;
    --card: #ffffff;
    --text: #162033;
    --muted: #7a8494;
    --line: #dfe4ea;

    --shadow: 0 8px 24px rgba(13, 28, 56, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* HEADER */
.header {
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.header img {
    height: 36px;
}

.header h1 {
    font-size: 16px;
    margin: 0;
    font-weight: 900;
    color: var(--cbat-blue-dark);
}

/* HERO */
.hero {
    background: linear-gradient(180deg, var(--cbat-blue), var(--cbat-blue-dark));
    color: white;
    padding: 20px 16px;
}

.hero h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
}

.hero p {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.8;
}

/* SHARE */
.share-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    background: white;
    border-bottom: 1px solid var(--line);
}

.share-btn {
    border: none;
    background: var(--cbat-yellow);
    color: var(--cbat-blue-dark);
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.share-btn-light {
    background: #e5e7eb;
    color: var(--text);
}

.copy-status {
    display: block;
    padding: 0 16px 12px;
    background: white;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

/* CONTADORES */
.counters {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-block {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
}

.stat-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--cbat-blue-dark);
    text-transform: uppercase;
}

.stat-total {
    font-size: 16px;
    font-weight: 900;
}

.stat-bar {
    display: flex;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: #e8edf3;
    margin-bottom: 6px;
}

.stat-fill {
    height: 100%;
    transition: width 0.4s ease;
}

.stat-blue {
    background: var(--cbat-blue);
}

.stat-yellow {
    background: var(--cbat-yellow);
}

.stat-lightblue {
    background: var(--cbat-lightblue);
}

.stat-legend {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    gap: 10px;
    flex-wrap: wrap;
}

.stat-legend strong {
    color: var(--text);
}

/* FILTROS / SELECTORES */
#week-selector,
.filters {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    background: white;
    border-bottom: 1px solid var(--line);
}

.week-btn,
.filter-btn {
    border: none;
    background: #e5e7eb;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
}

.week-btn.active {
    background: var(--cbat-blue);
    color: white;
    font-weight: 700;
}

.filter-btn.active {
    background: var(--cbat-yellow);
    color: var(--cbat-blue-dark);
    font-weight: 700;
}

/* CONTROLES */
#jornada-controls,
#equipo-controls {
    background: white;
}

/* SELECT EQUIPO */
.equipo-wrap {
    padding: 10px 16px;
    background: white;
    border-bottom: 1px solid var(--line);
}

#equipo-selector {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: 2px solid #cfd6df;
    background: white;
    color: var(--text);
    font-size: 14px;
}

/* APP */
#app {
    padding: 8px 0 20px;
}

/* BLOQUE CATEGORÍA */
.category-block-title {
    padding: 14px 16px 6px;
    font-weight: 900;
    color: var(--cbat-blue-dark);
    font-size: 18px;
}

/* DÍA */
.day {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
}

.day.today {
    color: var(--cbat-blue);
}

/* TARJETA */
.card {
    background: white;
    margin: 8px 16px 12px;
    padding: 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.result-win {
    border-left: 4px solid #16a34a;
}

.result-lose {
    border-left: 4px solid #dc2626;
}

.result-draw {
    border-left: 4px solid #9ca3af;
}

/* CABECERA TARJETA */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.category {
    font-size: 11px;
    font-weight: 800;
    color: #b38711;
    background: #fff4cf;
    padding: 4px 8px;
    border-radius: 999px;
}

.condition {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    flex-shrink: 0;
}

/* PARTIDO */
.match {
    display: grid;
    grid-template-columns: 1fr 70px 90px;
    gap: 10px;
    align-items: center;
}

.teams {
    min-width: 0;
}

.team {
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
}

.cbat {
    font-weight: 800;
    color: var(--cbat-blue-dark);
    margin-bottom: 4px;
}

.rival {
    color: var(--muted);
}

/* CENTRO */
.center {
    width: 70px;
    text-align: center;
}

.score {
    font-size: 16px;
    font-weight: 900;
}

.score.win {
    color: #16a34a;
}

.score.lose {
    color: #dc2626;
}

.score.draw {
    color: #6b7280;
}

.vs {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

/* INFO */
.info {
    text-align: right;
    min-width: 80px;
}

.time {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.court {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.25;
}

.empty-card {
    text-align: center;
}

/* POSTER INSTAGRAM */
.poster-wrap {
    position: absolute;
    left: -9999px;
    top: 0;
}

.poster-instagram {
    width: 1080px;
    min-height: 1350px;
    background: #173a6a;
    color: white;
    padding: 40px;
    font-family: Arial, sans-serif;
}

.poster-inner {
    min-height: 1270px;
    display: flex;
    flex-direction: column;
}

.poster-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.poster-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.poster-title-block {
    display: flex;
    flex-direction: column;
}

.poster-kicker {
    font-size: 18px;
    opacity: 0.85;
}

.poster-title {
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
}

.poster-week {
    font-size: 28px;
    color: var(--cbat-yellow);
    margin-top: 5px;
    font-weight: 700;
}

.poster-divider {
    height: 4px;
    background: var(--cbat-yellow);
    margin: 24px 0;
}

.poster-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.poster-item {
    background: white;
    color: #173a6a;
    border-radius: 18px;
    padding: 16px 18px;
}

.poster-date {
    font-size: 18px;
    font-weight: 900;
    color: #b38711;
    margin-bottom: 6px;
}

.poster-match {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.2;
}

.poster-info {
    font-size: 18px;
    margin-top: 6px;
    color: #4b5563;
}

.poster-footer {
    margin-top: 24px;
    text-align: center;
}

.poster-footer-text {
    font-size: 16px;
    opacity: 0.8;
}

/* SCROLL */
::-webkit-scrollbar {
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 6px;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .hero h2 {
        font-size: 22px;
    }

    .match {
        grid-template-columns: 1fr 60px 78px;
        gap: 8px;
    }

    .category-block-title {
        font-size: 16px;
    }

    .card {
        padding: 12px;
    }

    .score {
        font-size: 15px;
    }

    .time {
        font-size: 13px;
    }

    .court {
        font-size: 10px;
    }
}