/* ELO qoidalar — player.html uslubi: pf palitra, hero band, th-dark, html.lite */
*{margin:0;padding:0;box-sizing:border-box}

:root{
    --bg:#F3F4FA;
    --surface:#FFFFFF;
    --surface-2:#F2F3F9;
    --text:#151A2D;
    --text-2:#3D4463;
    --hint:#6B7290;
    --line:#E6E8F2;
    --pf-hero-top:#4F46E5;
    --pf-hero:linear-gradient(160deg,#4F46E5 0%,#7C3AED 52%,#C026D3 100%);
    --pf-hero-shadow:0 12px 30px rgba(109,40,217,.28);
    --sh-sm:0 2px 12px rgba(30,35,80,.06);
    --pf-accent-bg:rgba(109,40,217,.11);
    --pf-accent-bd:rgba(109,40,217,.3);
    --pf-accent-fg:#6D28D9;
    --ok:#059669;
    --red:#DC2626;
    --gold:#B45309;
    --gem:#7C3AED;
    color-scheme:light dark;
}

html.th-dark{
    --bg:#0B1020;
    --surface:#141A33;
    --surface-2:#1B2240;
    --text:#EEF0FA;
    --text-2:#C7CCE6;
    --hint:#8F97B8;
    --line:#252D4D;
    --pf-hero-top:#1E1B4B;
    --pf-hero:linear-gradient(160deg,#1E1B4B 0%,#3B0764 55%,#581C87 100%);
    --pf-hero-shadow:0 12px 30px rgba(0,0,0,.45);
    --sh-sm:0 2px 12px rgba(0,0,0,.35);
    --pf-accent-bg:rgba(167,139,250,.16);
    --pf-accent-bd:rgba(167,139,250,.35);
    --pf-accent-fg:#A78BFA;
    --ok:#6EE7B7;
    --red:#F87171;
    --gold:#FCD34D;
    --gem:#C4B5FD;
}

@media (prefers-color-scheme:dark){
    html:not(.th-light){
        --bg:#0B1020;
        --surface:#141A33;
        --surface-2:#1B2240;
        --text:#EEF0FA;
        --text-2:#C7CCE6;
        --hint:#8F97B8;
        --line:#252D4D;
        --pf-hero-top:#1E1B4B;
        --pf-hero:linear-gradient(160deg,#1E1B4B 0%,#3B0764 55%,#581C87 100%);
        --pf-hero-shadow:0 12px 30px rgba(0,0,0,.45);
        --sh-sm:0 2px 12px rgba(0,0,0,.35);
        --pf-accent-bg:rgba(167,139,250,.16);
        --pf-accent-bd:rgba(167,139,250,.35);
        --pf-accent-fg:#A78BFA;
        --ok:#6EE7B7;
        --red:#F87171;
        --gold:#FCD34D;
        --gem:#C4B5FD;
    }
}

body{
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    background:var(--bg);
    color:var(--text);
    min-height:100vh;
    font-size:14px;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}

/* Hero band */
.page-header{
    position:relative;
    overflow:hidden;
    display:flex;
    align-items:center;
    gap:10px;
    color:#fff;
    background:linear-gradient(var(--pf-hero-top) 0 16px,transparent 56px),var(--pf-hero);
    border-radius:0 0 28px 28px;
    box-shadow:var(--pf-hero-shadow);
    padding:calc(10px + env(safe-area-inset-top,0px)) 14px 18px;
}

.page-header::before{
    content:'';
    position:absolute;
    top:-90px;
    right:-60px;
    width:220px;
    height:220px;
    border-radius:50%;
    pointer-events:none;
    background:radial-gradient(circle,rgba(255,255,255,.22),transparent 68%);
}

.page-header>*{
    position:relative;
    z-index:1;
}

.nav-btn{
    width:36px;
    height:36px;
    border-radius:12px;
    background:rgba(255,255,255,.16);
    border:1px solid rgba(255,255,255,.26);
    color:#fff;
    font-size:15px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    cursor:pointer;
    text-decoration:none;
    font-family:inherit;
    -webkit-backdrop-filter:blur(8px);
    backdrop-filter:blur(8px);
    transition:transform .15s ease;
}

.nav-btn:active{
    transform:scale(.92);
}

.page-header h1{
    flex:1;
    min-width:0;
    font-size:16px;
    font-weight:800;
    letter-spacing:-.2px;
    color:#fff;
    text-shadow:0 2px 8px rgba(0,0,0,.18);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    display:flex;
    align-items:center;
    gap:8px;
}

.page-header h1 i{
    font-size:14px;
    opacity:.9;
}

/* Kontent */
.content{
    max-width:520px;
    margin:0 auto;
    padding:16px 12px calc(32px + env(safe-area-inset-bottom,0px));
}

.card{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:16px;
    padding:18px;
    margin-bottom:12px;
    box-shadow:var(--sh-sm);
}

.card h2{
    font-size:14px;
    font-weight:800;
    color:var(--text);
    letter-spacing:-.2px;
    margin-bottom:12px;
    display:flex;
    align-items:center;
    gap:10px;
}

.card h2 i{
    width:32px;
    height:32px;
    border-radius:10px;
    background:var(--pf-accent-bg);
    border:1px solid var(--pf-accent-bd);
    color:var(--pf-accent-fg);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    flex-shrink:0;
}

.rule-list{
    list-style:none;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.rule-list li{
    display:flex;
    align-items:flex-start;
    gap:10px;
    font-size:13.5px;
    line-height:1.5;
    color:var(--text-2);
    padding:9px 12px;
    background:var(--surface-2);
    border:1px solid var(--line);
    border-radius:12px;
}

.rule-list li i{
    margin-top:3px;
    color:var(--pf-accent-fg);
    flex-shrink:0;
    width:14px;
    text-align:center;
}

.rule-list li i.ic-up{color:var(--ok)}
.rule-list li i.ic-down{color:var(--red)}
.rule-list li i.ic-eq{color:var(--hint)}
.rule-list li i.ic-gem{color:var(--gem)}

/* ELO jadvali va formulalar (boshqa shablonlar ishlatishi mumkin) */
.elo-table{
    width:100%;
    border-collapse:collapse;
    font-size:13px;
}

.elo-table th{
    background:var(--pf-accent-bg);
    color:var(--pf-accent-fg);
    padding:10px 12px;
    text-align:left;
    font-weight:800;
}

.elo-table th:first-child{border-radius:10px 0 0 0}
.elo-table th:last-child{border-radius:0 10px 0 0}

.elo-table td{
    padding:10px 12px;
    border-bottom:1px solid var(--line);
    color:var(--text-2);
}

.elo-table tr:last-child td{border-bottom:none}

.badge{
    display:inline-block;
    padding:3px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.badge-win{background:rgba(16,185,129,.12);color:var(--ok)}
.badge-loss{background:rgba(239,68,68,.12);color:var(--red)}
.badge-draw{background:rgba(245,158,11,.12);color:var(--gold)}

.formula-box{
    background:var(--surface-2);
    border:1px solid var(--line);
    border-left:4px solid var(--pf-accent-fg);
    border-radius:0 12px 12px 0;
    padding:14px 16px;
    font-size:13.5px;
    color:var(--text-2);
    margin-top:4px;
}

.formula-box code{
    display:block;
    font-family:'Courier New',monospace;
    font-size:15px;
    color:var(--pf-accent-fg);
    margin-top:6px;
    font-weight:700;
}

.rule-section{
    background:var(--surface-2);
    border:1px solid var(--line);
    border-radius:12px;
    padding:14px 16px;
}

.rule-section-title{
    font-size:13px;
    font-weight:800;
    color:var(--text-2);
    margin-bottom:10px;
    display:flex;
    align-items:center;
    gap:6px;
}

/* Eski qurilma rejimi (html.lite) */
html.lite *,
html.lite *::before,
html.lite *::after{
    animation:none !important;
    transition:none !important;
    box-shadow:none !important;
    text-shadow:none !important;
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
}

html.lite .page-header{
    background:var(--pf-hero-top) !important;
}

html.lite .page-header::before{
    display:none !important;
}
