/* INVISTA Poker — professional dark "card-room" theme
   Deliberately distinct from the Tía Carmela child-center look:
   deep neutrals, felt-green and gold accents, data-dense tables. */

:root {
    --bg:        #0e1116;
    --bg-2:      #151a22;
    --surface:   #1b212b;
    --surface-2: #222a36;
    --border:    #2c3645;
    --text:      #e7ecf3;
    --text-dim:  #9aa6b6;
    --muted:     #6b7889;

    --felt:      #1f6f4a;   /* table felt green */
    --felt-2:    #2a9d6a;
    --gold:      #d9a441;
    --gold-2:    #f0c25e;
    --accent:    #3d7dff;

    --pos:       #38c172;   /* gains  */
    --neg:       #ef5350;   /* losses */

    --radius:    12px;
    --shadow:    0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

body {
    background: radial-gradient(1200px 600px at 80% -10%, #16202b 0%, var(--bg) 55%) fixed;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-feature-settings: 'tnum' 1;
    min-height: 100vh;
}

h1,h2,h3,h4,h5 { font-family: 'Sora', 'Inter', sans-serif; font-weight: 700; letter-spacing: -0.01em; }

a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--gold); }

.text-dim   { color: var(--text-dim) !important; }
.text-muted2{ color: var(--muted) !important; }
.mono       { font-variant-numeric: tabular-nums; }

/* ---------- Top navigation ---------- */
.app-nav {
    background: linear-gradient(180deg, #121821, #0e131a);
    border-bottom: 1px solid var(--border);
    padding: .55rem 1.1rem;
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(6px);
}
.app-nav .brand {
    font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.12rem;
    color: var(--text); display: flex; align-items: center; gap: .5rem;
}
.app-nav .brand .chip {
    width: 26px; height: 26px; border-radius: 50%;
    background: conic-gradient(from 45deg, var(--gold), #8a5a12 40%, var(--gold-2));
    box-shadow: inset 0 0 0 3px #0e131a, 0 0 0 1px var(--gold);
}
.app-nav .nav-link {
    color: var(--text-dim); padding: .4rem .8rem; border-radius: 8px;
    font-size: .92rem; font-weight: 500;
}
.app-nav .nav-link:hover { color: var(--text); background: var(--surface); }
.app-nav .nav-link.active { color: #fff; background: var(--surface-2); }

.club-switch .dropdown-menu,
.user-menu .dropdown-menu {
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.club-switch .dropdown-item, .user-menu .dropdown-item { color: var(--text-dim); }
.club-switch .dropdown-item:hover, .user-menu .dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.club-switch .btn, .user-menu .btn {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
}

/* ---------- Layout ---------- */
.app-main { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.1rem 4rem; }
.page-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1.2rem; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .sub { color: var(--text-dim); font-size: .9rem; }

/* ---------- Cards ---------- */
.card-x {
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-x .card-x-head {
    padding: .85rem 1.1rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-x .card-x-head h2 { font-size: 1rem; margin: 0; }
.card-x .card-x-body { padding: 1.1rem; }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: .9rem; }
.stat {
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem;
}
.stat .label { color: var(--text-dim); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-family: 'Sora', sans-serif; font-size: 1.6rem; font-weight: 700; margin-top: .25rem; }
.stat .value .sym { color: var(--muted); font-size: .9rem; font-weight: 500; }

/* ---------- Tables ---------- */
.table-x { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-x thead th {
    color: var(--text-dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    font-weight: 600; text-align: right; padding: .6rem .75rem; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--bg-2);
}
.table-x thead th:first-child, .table-x tbody td:first-child { text-align: left; }
.table-x tbody td { padding: .62rem .75rem; text-align: right; border-bottom: 1px solid rgba(44,54,69,.55); font-variant-numeric: tabular-nums; }
.table-x tbody tr:hover { background: rgba(255,255,255,.025); }
.table-x tbody tr:last-child td { border-bottom: none; }
.table-x tfoot td { padding: .62rem .75rem; text-align: right; border-top: 2px solid var(--border); font-weight: 700; }
.table-x tfoot td:first-child { text-align: left; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* rank pills */
.rank { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
    border-radius: 7px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--text-dim); }
.rank.r1 { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d00; }
.rank.r2 { background: linear-gradient(180deg, #cdd5e0, #9aa6b6); color: #1a2029; }
.rank.r3 { background: linear-gradient(180deg, #c8884e, #9c5f2c); color: #1a0f04; }

.player-cell { display: flex; align-items: center; gap: .6rem; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
    background: linear-gradient(135deg, var(--felt-2), var(--felt));
    color: #eafff3; font-size: .8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.badge-soft { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
    border-radius: 6px; padding: .15rem .5rem; font-size: .72rem; font-weight: 600; }
.badge-ok { color: var(--pos); border-color: rgba(56,193,114,.4); }
.badge-warn { color: var(--gold-2); border-color: rgba(217,164,65,.4); }

/* ---------- Buttons ---------- */
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d00; border: none; font-weight: 700; }
.btn-gold:hover { filter: brightness(1.05); color: #2a1d00; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo { text-align: center; margin-bottom: 1.4rem; }
.login-card .logo .chip { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto .6rem;
    background: conic-gradient(from 45deg, var(--gold), #8a5a12 40%, var(--gold-2));
    box-shadow: inset 0 0 0 6px #0e131a, 0 0 0 1px var(--gold); }
.login-card .logo h1 { font-size: 1.35rem; }
.login-card .logo p { color: var(--text-dim); font-size: .85rem; margin: 0; }

.form-control, .form-select {
    background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: 9px;
}
.form-control:focus, .form-select:focus {
    background: var(--bg-2); color: var(--text); border-color: var(--gold);
    box-shadow: 0 0 0 .2rem rgba(217,164,65,.18);
}
.form-label { color: var(--text-dim); font-size: .82rem; font-weight: 600; }

.alert-x { border-radius: 9px; border: 1px solid var(--border); padding: .7rem .9rem; font-size: .9rem; }
.alert-x.err { background: rgba(239,83,80,.1); border-color: rgba(239,83,80,.4); color: #ffb4b2; }
.alert-x.ok  { background: rgba(56,193,114,.1); border-color: rgba(56,193,114,.4); color: #aef0c8; }

/* misc */
.divider { height: 1px; background: var(--border); margin: 1.2rem 0; }
.empty { text-align: center; color: var(--text-dim); padding: 2.5rem 1rem; }
