
:root {
    --bg-page:    #0a1628;
    --bg-card:    #0f1e35;
    --bg-inner:   #1a2d4a;
    --border:     #1e3a5f;
    --text:       #e8edf5;
    --text-muted: #7a93b4;
    --accent-blue:#2563eb;
    --accent-red: #cc0033;
    --accent-gold:#f59e0b;
    --bar-blue:   #3b82f6;
    --panel-dark: #0c1830;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--bg-page); color: var(--text); min-height: 100vh; }

/* ── TOP BAR ─────────────────────────────────── */
.top-bar { background: #061020; border-bottom: 1px solid var(--border); padding: 10px 0; }
.top-bar a { color: var(--text-muted); text-decoration: none; font-size: .82rem; }
.top-bar a:hover { color: var(--text); }
.top-bar .brand { font-weight: 800; color: #fff; font-size: 1rem; letter-spacing: .5px; }

.profile-wrapper { max-width: 1060px; margin: 28px auto; padding: 0 16px 60px; }

/* ═══════════════════════════════════════════════════
   ID CARD WRAPPER
═══════════════════════════════════════════════════ */
.idc-wrap {
    display: flex;
    max-width: 900px;
    margin: 0 auto 28px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,.75);
    min-height: 420px;
}

/* ═══════════════════════════════════════════════════
   PANEL IZQUIERDO — FRENTE
═══════════════════════════════════════════════════ */
.idc-front {
    flex: 0 0 355px;
    background: #0c1830;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* textura diagonal */
.idc-front::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        -52deg, transparent, transparent 28px,
        rgba(255,255,255,.018) 28px, rgba(255,255,255,.018) 56px
    );
    pointer-events: none; z-index: 0;
}

/* sombra lateral derecha para profundidad */
.idc-front::after {
    content: '';
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 120px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,.35));
    pointer-events: none; z-index: 1;
}

/* barras rojas borde izquierdo */
.idc-red-bars {
    position: absolute; left: 0; top: 0; bottom: 0;
    display: flex; flex-direction: row; gap: 4px;
    z-index: 5; width: 20px;
}
.idc-red-bars span {
    display: block; width: 5px; height: 100%;
    background: var(--accent-red);
    opacity: 1;
}
.idc-red-bars span:nth-child(2) { opacity: .5; width: 4px; }
.idc-red-bars span:nth-child(3) { opacity: .25; width: 3px; }

/* número de fondo */
.idc-bg-num {
    position: absolute; top: -10px; right: -12px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 200px; line-height: 1;
    color: rgba(255,255,255,.05);
    pointer-events: none; z-index: 0; user-select: none;
}

/* gradiente zona silhouette */
.idc-silhouette-grad {
    position: absolute; right: 0; top: 0; bottom: 0; width: 55%;
    background: linear-gradient(to right, transparent, rgba(20,50,100,.25));
    pointer-events: none; z-index: 1;
}

/* contenido izquierdo */
.idc-front-inner {
    position: relative; z-index: 3;
    display: flex; flex-direction: column;
    height: 100%; padding: 16px 18px 16px 26px;
}

.idc-id-label .idc-id-sm {
    font-size: .52rem; font-weight: 700; letter-spacing: 2.5px;
    color: rgba(255,255,255,.4); text-transform: uppercase; display: block;
}
.idc-id-label .idc-id-lg {
    font-size: 1.6rem; font-weight: 900; letter-spacing: 4px;
    color: #fff; text-transform: uppercase; line-height: 1;
    margin-bottom: 12px;
}

/* foto + badge */
.idc-photo-row {
    display: flex; align-items: flex-start;
    gap: 14px; margin-bottom: 12px;
}
.idc-circle {
    width: 130px; height: 130px; border-radius: 50%;
    overflow: hidden; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,.25);
    background: #0a1628;
}
.idc-circle img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
}
.idc-no-photo {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: rgba(255,255,255,.12);
}
.idc-badge-col {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding-top: 8px;
}
.idc-badge-icon {
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 2px solid rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: rgba(255,255,255,.85);
}

/* nombre */
.idc-name-first {
    font-size: 1.3rem; font-weight: 700;
    color: rgba(255,255,255,.8); text-transform: uppercase;
    letter-spacing: 1px; line-height: 1; margin-bottom: 2px;
}
.idc-name-last {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.8rem; color: var(--accent-red);
    text-transform: uppercase; line-height: 1;
    letter-spacing: 1px; margin-bottom: 8px;
}

/* jersey + posición */
.idc-pos-row {
    display: flex; align-items: flex-start;
    gap: 10px; margin-bottom: 10px;
}
.idc-jersey-num {
    font-size: 1.9rem; font-weight: 900; color: #fff;
    line-height: 1; letter-spacing: -1px; flex-shrink: 0;
}
.idc-pos-stack { display: flex; flex-direction: column; padding-top: 4px; }
.idc-pos-name {
    font-size: .65rem; font-weight: 800; letter-spacing: 2px;
    color: rgba(255,255,255,.55); text-transform: uppercase; line-height: 1.4;
}
.idc-hands {
    font-size: .56rem; font-weight: 600;
    color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .4px;
}

/* divisor */
.idc-divider { height: 1px; background: rgba(255,255,255,.07); margin-bottom: 10px; }

/* info rows */
.idc-info-list { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.idc-info-row { display: flex; align-items: flex-start; gap: 9px; }
.idc-info-ico {
    color: var(--accent-red); font-size: .7rem;
    width: 13px; flex-shrink: 0; margin-top: 2px;
}
.idc-info-txt { display: flex; flex-direction: column; }
.idc-info-lbl {
    font-size: .44rem; font-weight: 700; letter-spacing: 1.5px;
    color: rgba(255,255,255,.3); text-transform: uppercase; line-height: 1; margin-bottom: 1px;
}
.idc-info-val {
    font-size: .68rem; font-weight: 700; color: #fff;
    text-transform: uppercase; letter-spacing: .3px;
}

/* ═══════════════════════════════════════════════════
   PANEL DERECHO — REVERSO
═══════════════════════════════════════════════════ */
.idc-back {
    flex: 1;
    background: #fff;
    display: flex; flex-direction: column;
    min-width: 0;
}

/* cabecera */
.idc-back-top {
    display: flex; align-items: flex-start;
    justify-content: space-between;
    padding: 14px 20px 12px;
    background: #fff;
    border-bottom: 1px solid #eaecef;
    flex-shrink: 0;
    position: relative;
}
/* textura béisbol watermark */
.idc-back-top::after {
    content: '';
    position: absolute; right: 60px; top: 50%; transform: translateY(-50%);
    width: 90px; height: 90px; border-radius: 50%;
    background: radial-gradient(circle,
        rgba(200,210,225,.18) 0%, rgba(200,210,225,.07) 60%, transparent 100%);
    border: 8px solid rgba(180,195,215,.12);
}

/* BE BASEBALL logo */
.idc-be-logo { display: flex; flex-direction: column; }
.idc-be-stars {
    font-size: .52rem; color: var(--accent-red);
    letter-spacing: 5px; line-height: 1; margin-bottom: 1px;
}
.idc-be-line1 {
    font-size: .8rem; font-weight: 900; letter-spacing: 3px;
    color: #0c1830; text-transform: uppercase; line-height: 1;
}
.idc-be-line2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem; letter-spacing: 3px; color: #0c1830; line-height: 1;
}

/* NCS logo */
.idc-ncs-logo { display: flex; flex-direction: column; align-items: flex-end; position: relative; z-index: 1; }
.idc-ncs-big {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.4rem; letter-spacing: 4px; color: #0c1830; line-height: 1;
}
.idc-ncs-sub {
    font-size: .44rem; font-weight: 700; letter-spacing: 3px;
    color: rgba(12,24,48,.4); text-transform: uppercase;
}

/* cuerpo: dos columnas */
.idc-back-body {
    display: flex; flex: 1; min-height: 0;
    background: #f4f6f9;
}

/* columna valores */
.idc-vals {
    flex: 0 0 170px;
    display: flex; flex-direction: column;
    justify-content: center; gap: 8px;
    padding: 14px 12px 10px 18px;
    border-right: 1px solid #e0e4ea;
}
.idc-val-item {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px; border-radius: 8px;
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(0,0,0,.06);
}
.idc-val-icon {
    width: 28px; height: 28px; border-radius: 50%;
    background: #0c1830;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .65rem; flex-shrink: 0;
}
.idc-val-texts { display: flex; flex-direction: column; }
.idc-val-lbl {
    font-size: .44rem; font-weight: 800; letter-spacing: 1.5px;
    color: rgba(12,24,48,.4); text-transform: uppercase; line-height: 1;
}
.idc-val-desc {
    font-size: .6rem; font-weight: 700; color: #0c1830;
    text-transform: uppercase; letter-spacing: .4px; line-height: 1.3;
}
.idc-play-ball {
    font-family: 'Dancing Script', cursive;
    font-size: 1.1rem; color: rgba(12,24,48,.28);
    text-align: center; padding-top: 4px;
}

/* columna QR */
.idc-qr-col {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center;
    padding: 0;
}
.idc-qr-header {
    width: 100%; padding: 8px 16px;
    background: #0c1830;
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}
.idc-qr-header span {
    font-size: .62rem; font-weight: 800; letter-spacing: 2.5px;
    color: #fff; text-transform: uppercase;
}
.idc-qr-body {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px;
    padding: 14px 16px;
}
.idc-qr-frame {
    padding: 8px; background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,.12);
}
.idc-qr-img { width: 130px; height: 130px; display: block; border-radius: 4px; }
.idc-qr-placeholder {
    width: 130px; height: 130px;
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem; color: rgba(0,0,0,.18);
}
.idc-view-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 7px; padding: 8px 18px;
    background: #0c1830; color: #fff;
    font-size: .58rem; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; text-decoration: none;
    border-radius: 6px; transition: background .2s; white-space: nowrap;
}
.idc-view-btn:hover { background: #1e3a5f; color: #fff; }

/* fila stats */
.idc-stats-row {
    display: flex;
    border-top: 1px solid #e4e8ef;
    background: #fff;
    flex-shrink: 0;
}
.idc-stat-cell {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; padding: 10px 6px 8px;
    border-right: 1px solid #eaecef; gap: 2px;
}
.idc-stat-cell:last-child { border-right: none; }
.idc-stat-ico { font-size: .85rem; color: var(--accent-red); margin-bottom: 3px; }
.idc-stat-big {
    font-size: 1.7rem; font-weight: 900; color: #0c1830; line-height: 1;
}
.idc-stat-unit {
    font-size: .44rem; font-weight: 700;
    color: rgba(12,24,48,.4); text-transform: uppercase; letter-spacing: 1px;
}
.idc-stat-lbl {
    font-size: .44rem; font-weight: 700;
    color: var(--accent-red); text-transform: uppercase;
    letter-spacing: .5px; text-align: center;
}

/* barra fortalezas + ranking */
.idc-bottom-bar {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #e8ecf2;
    border-top: 1px solid #d8dce5;
    flex-shrink: 0; gap: 10px;
}
.idc-forte-group { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.idc-forte-title {
    font-size: .44rem; font-weight: 800; letter-spacing: 1.5px;
    color: rgba(12,24,48,.45); text-transform: uppercase; flex-shrink: 0;
}
.idc-forte-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.idc-forte-chip { display: flex; align-items: center; gap: 4px; }
.idc-forte-chip-ico {
    width: 22px; height: 22px; border-radius: 50%; background: #0c1830;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .55rem; flex-shrink: 0;
}
.idc-forte-chip-lbl {
    font-size: .44rem; font-weight: 700;
    color: rgba(12,24,48,.5); text-transform: uppercase; letter-spacing: .4px;
}
.idc-rank-box {
    background: var(--accent-red); border-radius: 7px;
    padding: 5px 12px; text-align: center; flex-shrink: 0;
}
.idc-rank-ttl {
    font-size: .42rem; font-weight: 700; letter-spacing: 1.5px;
    color: rgba(255,255,255,.7); text-transform: uppercase; line-height: 1;
}
.idc-rank-num {
    font-size: 1.15rem; font-weight: 900; color: #fff; line-height: 1.1;
}
.idc-rank-cat {
    font-size: .4rem; font-weight: 700; letter-spacing: 1px;
    color: rgba(255,255,255,.65); text-transform: uppercase;
}

/* ── SECCIONES DE STATS DEBAJO ────────────────── */
.section-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; height: 100%; }
.section-title { font-size: .68rem; font-weight: 800; letter-spacing: 2px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

.ovr-wrap { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.ovr-circle { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.ovr-circle svg { transform: rotate(-90deg); }
.ovr-circle .ovr-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ovr-circle .ovr-num { font-size: 1.8rem; font-weight: 900; color: var(--text); line-height: 1; }
.ovr-circle .ovr-label { font-size: .55rem; font-weight: 700; letter-spacing: 2px; color: var(--text-muted); }
.attr-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.attr-row:last-child { margin-bottom: 0; }
.attr-name { font-size: .65rem; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; width: 80px; flex-shrink: 0; }
.attr-bar-bg { flex: 1; height: 6px; background: var(--bg-inner); border-radius: 3px; overflow: hidden; }
.attr-bar-fill { height: 100%; background: var(--bar-blue); border-radius: 3px; }
.attr-val { font-size: .75rem; font-weight: 700; color: var(--text); width: 24px; text-align: right; }
.key-attr-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: .8rem; color: var(--text); line-height: 1.4; }
.key-attr-item:last-child { margin-bottom: 0; }
.key-attr-icon { color: var(--bar-blue); font-size: .85rem; margin-top: 1px; flex-shrink: 0; }

.stats-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.stats-table thead th { background: var(--bg-inner); color: var(--text-muted); font-size: .6rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 8px 10px; text-align: center; border: 1px solid var(--border); }
.stats-table tbody td { padding: 10px; text-align: center; border: 1px solid var(--border); font-weight: 600; color: var(--text); }
.stats-table tbody tr:hover td { background: var(--bg-inner); }
.stats-table .td-avg { color: var(--bar-blue); font-weight: 800; }

.achievement-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .8rem; }
.achievement-item:last-child { border-bottom: none; padding-bottom: 0; }
.achievement-item i { color: var(--accent-gold); font-size: .9rem; margin-top: 2px; flex-shrink: 0; }

.field-svg { width: 100%; max-width: 240px; margin: 0 auto; display: block; }
.pos-label { font-size: 10px; font-weight: 800; fill: var(--text-muted); text-anchor: middle; dominant-baseline: middle; }
.pos-circle { fill: var(--bg-inner); stroke: var(--border); stroke-width: 1.5; }
.pos-circle-active { fill: var(--accent-red); stroke: var(--accent-red); }
.pos-label-active { fill: #fff; }
.pos-primary-label { margin-top: 10px; text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase; }
.pos-primary-badge { display: inline-block; background: var(--accent-red); color: #fff; font-weight: 800; font-size: .75rem; padding: 4px 14px; border-radius: 4px; letter-spacing: 1px; text-transform: uppercase; margin-top: 6px; }

.event-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .8rem; }
.event-item:last-child { border-bottom: none; padding-bottom: 0; }
.event-item .ev-icon { color: var(--bar-blue); font-size: .9rem; flex-shrink: 0; }
.event-item .ev-name { font-weight: 600; color: var(--text); }
.event-item .ev-date { font-size: .68rem; color: var(--text-muted); }
.chart-container { position: relative; height: 130px; }
.empty-state { text-align: center; padding: 28px 16px; color: var(--text-muted); font-size: .82rem; }
.empty-state i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .4; }

/* ══════════════════════════════════════════════════
   MOBILE ≤ 768px
══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .profile-wrapper { margin: 0; padding: 0 0 80px; }

    .idc-wrap {
        flex-direction: column;
        max-width: 360px; margin: 16px auto 16px;
        border-radius: 14px; min-height: 0;
    }
    .idc-front { flex: none; width: 100%; }
    .idc-back-body { flex-direction: column; }
    .idc-vals {
        flex: none; border-right: none;
        border-bottom: 1px solid #e0e4ea;
    }
    .idc-qr-col { padding-bottom: 14px; }
    .idc-forte-chip-lbl { display: none; }

    .profile-wrapper .row { padding: 0 12px; }
    .profile-wrapper .row.g-3 { --bs-gutter-x: 0; gap: 12px 0; }
    .section-card { border-radius: 12px; height: auto; }

    .stats-grid {
        display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    }
    .stats-grid .sg-item { background: var(--bg-inner); border-radius: 8px; padding: 8px 4px; text-align: center; }
    .stats-grid .sg-label { display: block; font-size: .55rem; font-weight: 700; letter-spacing: .8px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 3px; }
    .stats-grid .sg-value { display: block; font-size: .92rem; font-weight: 800; color: var(--text); }
    .stats-grid .sg-value.is-avg { color: var(--bar-blue); }
    .stats-table-wrap { display: none; }

    .mobile-bottom-nav {
        display: flex !important; position: fixed;
        bottom: 0; left: 0; right: 0;
        background: #061020; border-top: 1px solid var(--border);
        z-index: 1000; padding: 6px 0 max(env(safe-area-inset-bottom), 6px);
    }
    .mobile-bottom-nav a {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; gap: 3px; color: var(--text-muted);
        text-decoration: none; font-size: .58rem; font-weight: 600; padding: 4px 0;
    }
    .mobile-bottom-nav a i { font-size: 1.15rem; }
    .mobile-bottom-nav a.active { color: var(--accent-red); }
    .top-bar .breadcrumb-chain { display: none; }
    .top-bar .mobile-back { display: flex !important; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
}

@media (min-width: 769px) {
    .mobile-bottom-nav { display: none; }
    .stats-grid { display: none; }
    .top-bar .mobile-back { display: none; }
}
