/* PairChamp – light chess-friendly theme (blue / white / black) */
:root{
    --pc-blue: #0b67d0;
    --pc-blue-2:#0a58b6;
    --pc-ink: #0b1220;
    --pc-muted:#5b667a;
    --pc-border: rgba(11,103,208,0.12);
    --pc-bg1:#f6faff;
    --pc-bg2:#ffffff;
    --pc-card:#ffffff;
    --pc-shadow: 0 10px 30px rgba(11,103,208,0.10);
    --pc-radius: 14px;

    --pc-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
    margin:0;
    font-family: var(--pc-font);
    color: var(--pc-ink);
    background: radial-gradient(1200px 500px at 20% 0%, rgba(11,103,208,0.10), transparent 60%),
    linear-gradient(180deg, var(--pc-bg1) 0%, var(--pc-bg2) 65%);
    -webkit-font-smoothing: antialiased;
}

a{ color: var(--pc-blue); text-decoration:none; }
a:hover{ text-decoration:underline; }

.pc-shell{
    min-height:100%;
    display:flex;
    flex-direction:column;
}

.pc-header{
    position: sticky;
    top:0;
    z-index:50;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(11,103,208,0.10);
}

.pc-header-inner{
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.pc-brand{
    display:flex;
    align-items:center;
    gap:10px;
    min-width: 0;
}
.pc-logo{
    width:40px;height:40px;border-radius:12px;
    background: linear-gradient(135deg, var(--pc-blue), var(--pc-blue-2));
    box-shadow: 0 8px 18px rgba(11,103,208,0.18);
    position: relative;
}
.pc-logo::after{
    content:none;
}
.pc-title{
    display:flex;
    flex-direction:column;
    min-width: 0;
}
.pc-title strong{
    font-size: 16px;
    line-height:1.1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.pc-title span{
    font-size: 12.5px;
    color: var(--pc-muted);
    margin-top:2px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.pc-nav{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.pc-nav a{
    font-weight:600;
    color: var(--pc-ink);
    opacity:0.9;
}
.pc-nav a:hover{ opacity:1; text-decoration:none; }

.pc-main{
    flex:1;
    width:100%;
}

.pc-container{
    max-width: 1100px;
    margin: 22px auto 26px;
    padding: 0 16px;
}

.pc-hero{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:14px;
    margin: 8px 0 16px;
}
.pc-hero h1{
    margin:0;
    font-size: 22px;
    letter-spacing: -0.2px;
}
.pc-hero p{
    margin:6px 0 0;
    color: var(--pc-muted);
    font-size: 14px;
}

.pc-card{
    background: var(--pc-card);
    border: 1px solid var(--pc-border);
    box-shadow: var(--pc-shadow);
    border-radius: var(--pc-radius);
    overflow:hidden;
}

.pc-card-pad{ padding: 16px; }

.pc-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.pc-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(11,103,208,0.08);
    color: var(--pc-blue);
    font-weight:700;
    font-size: 12px;
}

.pc-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(11,103,208,0.18);
    background: white;
    color: var(--pc-blue);
    font-weight: 800;
    cursor:pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    box-shadow: 0 4px 12px rgba(11,103,208,0.08);
}
.pc-btn:hover{ transform: translateY(-1px); }
.pc-btn:active{ transform: translateY(0px); }

.pc-btn-primary{
    background: linear-gradient(90deg, var(--pc-blue), var(--pc-blue-2));
    color: white;
    border-color: transparent;
}

.pc-btn-ghost{
    background: transparent;
    box-shadow:none;
    border: 1px solid rgba(11,103,208,0.14);
    color: var(--pc-ink);
    font-weight:700;
}

.pc-form{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:flex-end;
}
.pc-field{
    display:flex;
    flex-direction:column;
    gap:6px;
}
.pc-label{
    font-size: 12px;
    font-weight: 800;
    color: var(--pc-muted);
}
.pc-input, .pc-select{
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,0.12);
    background: white;
    font-size: 14px;
    outline:none;
}
.pc-input:focus, .pc-select:focus{
    border-color: rgba(11,103,208,0.35);
    box-shadow: 0 0 0 4px rgba(11,103,208,0.10);
}

.pc-list{
    display:flex;
    flex-direction:column;
}
.pc-item{
    padding: 14px 16px;
    border-top: 1px solid rgba(11,103,208,0.10);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}
.pc-item:first-child{ border-top:none; }
.pc-item h3{
    margin:0;
    font-size: 16px;
    letter-spacing: -0.1px;
}
.pc-item .pc-meta{
    margin-top:6px;
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    color: var(--pc-muted);
    font-size: 13px;
}
.pc-meta span{
    display:inline-flex;
    align-items:center;
    gap:6px;
}
.pc-divider-title{
    margin: 18px 0 10px;
    font-size: 13px;
    color: var(--pc-muted);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pc-table{
    width:100%;
    border-collapse: collapse;
}
.pc-table thead th{
    text-align:left;
    padding: 10px 12px;
    background: rgba(11,103,208,0.07);
    color: var(--pc-blue);
    font-size: 12.5px;
    font-weight: 900;
    border-bottom: 1px solid rgba(11,103,208,0.16);
}
.pc-table tbody td{
    padding: 12px;
    border-bottom: 1px solid rgba(15,23,42,0.08);
    font-size: 14px;
}
.pc-table tbody tr:nth-child(even){
    background: rgba(11,103,208,0.02);
}

.pc-empty{
    padding: 20px 16px;
    text-align:center;
    color: var(--pc-muted);
}

.pc-footer{
    border-top: 1px solid rgba(11,103,208,0.10);
    padding: 18px 16px;
    color: var(--pc-muted);
    background: rgba(255,255,255,0.6);
}
.pc-footer-inner{
    max-width: 1100px;
    margin:0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
    font-size: 13px;
}

/* Mobile & iPad friendliness */
@media (max-width: 860px){
    .pc-item{ align-items:flex-start; flex-direction:column; }
    .pc-row{ flex-direction:column; align-items:stretch; }
    .pc-nav{ justify-content:flex-start; }
}

@media (max-width: 720px){
    .pc-container{ margin: 14px auto 20px; }
    .pc-hero h1{ font-size: 20px; }
    .pc-form{ align-items:stretch; }
    .pc-field{ width:100%; }
    .pc-btn{ width:100%; }

    /* Responsive table => card rows */
    .pc-table thead{ display:none; }
    .pc-table, .pc-table tbody, .pc-table tr, .pc-table td{
        display:block;
        width:100%;
    }
    .pc-table tr{
        margin-bottom:10px;
        border: 1px solid var(--pc-border);
        border-radius: 12px;
        overflow:hidden;
        background:white;
        box-shadow: 0 8px 22px rgba(11,103,208,0.08);
    }
    .pc-table td{
        border-bottom: 1px solid rgba(15,23,42,0.06);
        padding: 10px 12px;
    }
    .pc-table td:last-child{ border-bottom:none; }
    .pc-m-label{
        display:block;
        font-size: 12px;
        font-weight: 900;
        color: var(--pc-muted);
        margin-bottom:6px;
    }
}
/* Entries: stats strip + sortable header links */
.pc-stats { margin-bottom: 14px; }
.pc-stats-grid{
    display:grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap:12px;
}
.pc-stat{
    border: 1px solid rgba(11,103,208,0.10);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.70);
}
.pc-stat-label{
    font-size: 12px;
    font-weight: 900;
    color: var(--pc-muted);
    letter-spacing: .02em;
}
.pc-stat-value{
    margin-top:6px;
    font-size: 20px;
    font-weight: 900;
    color: var(--pc-ink);
}
.pc-stat-muted{ font-size: 13px; font-weight: 800; color: var(--pc-muted); }

.pc-thlink{
    color: var(--pc-blue);
    font-weight: 900;
    text-decoration:none;
    display:inline-flex;
    align-items:center;
    gap:8px;
}
.pc-thlink:hover{ text-decoration: underline; }
.pc-sort{ font-size: 12px; color: var(--pc-blue); }

/* iPad/mobile */
@media (max-width: 860px){
    .pc-stats-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
    .pc-stats-grid{ grid-template-columns: 1fr; }
}

/* Hide mobile labels on desktop/table view */
.pc-m-label{ display:none; }

/* Show them only when table becomes cards (mobile) */
@media (max-width: 720px){
    .pc-m-label{ display:block; }
}

/* Logo sizing - prevents full page logo */
.pc-logo-img{
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

/* Slightly bigger on tablets/desktop */
.pc-logo{
    width:40px;
    height:40px;
    border-radius:12px;
    background: transparent;     /* ✅ remove blue */
    box-shadow: none;            /* ✅ optional: remove glow */
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.pc-logo-img{
    width:40px;
    height:40px;
    object-fit:contain;
    display:block;
}

/* slightly bigger on tablet/desktop */
@media (min-width: 720px){
    .pc-logo{
        width:44px;
        height:44px;
    }
    .pc-logo-img{
        width:44px;
        height:44px;
    }
}

/* add missing tab list styles for results inner tabs */
.pc-tabs { margin-top: 12px; }
.pc-tabs-nav { display:flex; gap:8px; border-bottom:1px solid #e6e9ee; padding-bottom:8px; margin-bottom:16px; }
.pc-tabs-nav ul { list-style:none; padding:0; margin:0; display:flex; gap:8px; }
.pc-tabs-nav li { display:inline-block; }
.pc-tab-btn { background:transparent; border:0; padding:8px 12px; cursor:pointer; font-weight:600; color:var(--pc-text, #0b1a2b); }
.pc-tab-btn.active { background:var(--pc-primary-bg, #0b74ff); color:#fff; border-radius:6px; }
.pc-tab-panel { display:none; }
.pc-tab-panel.active { display:block; }
.pc-tab-panel-inner { display:none; }
.pc-tab-panel-inner.active { display:block; }
.list-wrap { overflow:auto; }
.results-table td, .results-table th { white-space:nowrap; padding:6px 8px; }
.results-mark { font-weight:700; margin-right:6px; }
.results-op { color:#666; font-size:0.95em; }


/* ===== Results (Entries page) – improved UI ===== */

.pc-h2 { margin: 0; font-size: 18px; letter-spacing: -0.2px; }
.pc-subtle { margin-top: 6px; color: var(--pc-muted); font-size: 13px; font-weight: 700; }

.pc-results-head{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
    margin-bottom: 14px;
}

.pc-results-tabsbar{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    padding: 10px;
    border: 1px solid rgba(11,103,208,0.10);
    border-radius: 14px;
    background: rgba(255,255,255,0.70);
}

.pc-results-tab{
    border: 1px solid rgba(11,103,208,0.16);
    background: white;
    color: var(--pc-ink);
    font-weight: 900;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor:pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    box-shadow: 0 4px 12px rgba(11,103,208,0.06);
}
.pc-results-tab:hover{ transform: translateY(-1px); }
.pc-results-tab.is-active{
    background: linear-gradient(90deg, var(--pc-blue), var(--pc-blue-2));
    color:#fff;
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(11,103,208,0.18);
}

.pc-results-panel{ display:none; margin-top: 14px; }
.pc-results-panel.is-active{ display:block; }

.pc-results-state{
    display:flex;
    align-items:center;
    gap:10px;
    padding: 14px;
    border: 1px dashed rgba(11,103,208,0.25);
    border-radius: 14px;
    background: rgba(11,103,208,0.03);
    color: var(--pc-muted);
    font-weight: 800;
}

/* small spinner */
.pc-spinner{
    width:18px; height:18px;
    border-radius: 50%;
    border: 2px solid rgba(11,103,208,0.20);
    border-top-color: rgba(11,103,208,0.90);
    animation: pcspin 0.9s linear infinite;
}
@keyframes pcspin { to { transform: rotate(360deg); } }

.pc-results-tablewrap{
    border: 1px solid rgba(11,103,208,0.10);
    border-radius: 14px;
    overflow: hidden;
}

.pc-results-table thead th{
    background: rgba(11,103,208,0.08);
}

/* nicer row spacing + highlight */
.pc-results-table tbody tr:hover{
    background: rgba(11,103,208,0.04);
}

.pc-rank{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width: 40px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(11,103,208,0.08);
    color: var(--pc-blue);
    font-weight: 900;
}

.pc-player-name{
    font-weight: 900;
    color: var(--pc-ink);
}

.pc-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.10);
    background: rgba(255,255,255,0.85);
    font-weight: 900;
    font-size: 13px;
}
.pc-pill-points{
    border-color: rgba(11,103,208,0.18);
    background: rgba(11,103,208,0.06);
    color: var(--pc-blue);
}

.pc-group{
    display:inline-flex;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(15,23,42,0.04);
    border: 1px solid rgba(15,23,42,0.06);
    font-weight: 800;
    color: var(--pc-muted);
}

/* Mobile cards */
.pc-results-cards{
    display:none; /* enabled by JS but shown by media rules */
    gap:10px;
    margin-top: 12px;
}

.pc-result-card{
    border: 1px solid rgba(11,103,208,0.10);
    border-radius: 14px;
    background: white;
    box-shadow: 0 10px 26px rgba(11,103,208,0.08);
    padding: 12px;
}

.pc-result-card-top{
    display:flex;
    align-items:center;
    gap:10px;
}
.pc-result-card-name{
    font-weight: 900;
    flex:1;
    min-width: 0;
    overflow:hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pc-result-card-meta{
    display:grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:10px;
    margin-top: 10px;
}
.pc-result-card-meta > div{
    border: 1px solid rgba(15,23,42,0.06);
    background: rgba(15,23,42,0.02);
    border-radius: 12px;
    padding: 10px;
}
.pc-meta-k{
    display:block;
    font-size: 11px;
    font-weight: 900;
    color: var(--pc-muted);
    letter-spacing: .02em;
}
.pc-meta-v{
    display:block;
    margin-top: 4px;
    font-weight: 900;
    color: var(--pc-ink);
}
.pc-result-card-group{
    grid-column: 1 / -1;
}

.pc-alert{
    padding: 12px 14px;
    border: 1px solid rgba(239,68,68,0.18);
    background: rgba(239,68,68,0.05);
    color: #991b1b;
    font-weight: 900;
    border-radius: 14px;
}

/* Responsive behavior:
   - Desktop: show table
   - Mobile: hide table, show cards */
@media (max-width: 820px){
    .pc-results-tablewrap{ display:none !important; }
    .pc-results-cards{ display:grid !important; }
    .pc-result-card-meta{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
    .pc-result-card-meta{ grid-template-columns: 1fr; }
}


.pc-logo{
    width:40px;
    height:40px;
    border-radius:12px;
    background: transparent;     /* ✅ remove blue */
    box-shadow: none;            /* ✅ optional: remove glow */
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.pc-logo-img{
    width:40px;
    height:40px;
    object-fit:contain;
    display:block;
}

/* slightly bigger on tablet/desktop */
@media (min-width: 720px){
    .pc-logo{
        width:44px;
        height:44px;
    }
    .pc-logo-img{
        width:44px;
        height:44px;
    }
}