/* Аккаунты и профиль игрока КИТ (account.js). Палитра — из club.css (:root). */

/* шапка */
.header-auth{display:inline-flex;align-items:center;gap:9px;font-size:11px;color:var(--text);white-space:nowrap;padding:9px 18px;border:1px solid #a49b83;border-radius:13px;background:#080c0888;transition:background .15s,color .15s}
.header-auth:hover{background:#1c251ccc;color:#fff3d7}
.header-auth.is-logged{border-color:transparent;background:transparent;padding:4px 6px}
.header-auth.is-logged:hover{color:var(--cream)}
.header-auth .avatar{width:30px;height:30px}
.header-inner>.profile{display:none}
.nav-account{display:none}
.profile.is-logged{border-color:var(--gold)}

/* аватар */
.avatar{--hue:160;display:inline-grid;place-items:center;width:40px;height:40px;border-radius:50%;flex-shrink:0;color:var(--cream);border:1px solid #c2aa7c88;background:radial-gradient(circle at 30% 28%,hsl(var(--hue) 34% 36%),hsl(var(--hue) 40% 10%) 75%);box-shadow:inset 0 1px 6px #ffffff14,0 6px 18px #00000055}
.avatar .icon{width:52%;height:52%;stroke-width:1.4}
.avatar-xl{width:128px;height:128px;border-width:2px}

/* вход */
.auth-layout{display:grid;grid-template-columns:minmax(0,520px) minmax(0,1fr);gap:28px;padding:10px 0 70px;align-items:start}
.auth-panel{padding:26px 28px}
.auth-panel h2{display:flex;align-items:center;gap:13px;font-size:24px}
.auth-panel .panel-intro{margin:10px 0 18px}
.auth-panel form{margin-top:18px}
.auth-aside .ranking-story{min-height:320px}

/* профиль: карточка */
.profile-page{padding-bottom:70px}
.profile-hero{padding-top:34px}
.profile-card{display:flex;align-items:center;gap:32px;padding:30px 34px;background:linear-gradient(120deg,#0b1c12,#07130e 60%,#0a1a11);position:relative;overflow:hidden}
.profile-card:before{content:'';position:absolute;inset:-40% auto auto -10%;width:420px;height:420px;border-radius:50%;background:radial-gradient(circle,#c2aa7c1c,transparent 65%);pointer-events:none}
.profile-id{min-width:0;flex:1}
.profile-id h1{font:400 52px/1 var(--serif);color:var(--cream);letter-spacing:1px;margin:8px 0 4px;overflow-wrap:anywhere}
.profile-name{font-size:15px;color:var(--text)}
.profile-bio{font-size:13px;line-height:1.55;color:var(--muted);margin-top:8px;max-width:560px;white-space:pre-line}
.profile-bio:empty{display:none}
.badges{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.badge{display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border:1px solid var(--gold-line);border-radius:999px;font-size:10px;letter-spacing:1.6px;text-transform:uppercase;color:var(--cream);background:#0a160f}
.badge .icon{width:14px;height:14px;color:var(--gold)}
.badge.muted{color:var(--muted);border-style:dashed}
.profile-actions{display:flex;flex-direction:column;align-items:stretch;gap:10px;min-width:220px}
.profile-actions .btn{justify-content:center}
.profile-actions .text-link{background:none;border:0;justify-self:center;align-self:center;display:inline-flex;align-items:center;cursor:pointer;color:var(--muted)}
.profile-actions .text-link:hover{color:var(--cream)}

/* профиль: сетка */
.profile-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(300px,1fr);gap:22px;margin-top:22px;align-items:start}
.profile-main,.profile-side{display:grid;grid-template-columns:minmax(0,1fr);gap:22px;min-width:0}
.profile-grid .panel{padding:24px 26px}
.profile-section-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.profile-section-heading h2{display:flex;align-items:center;gap:10px;font:400 24px/1.1 var(--serif);color:var(--cream)}
.profile-section-heading h2 .icon{width:24px;height:24px;color:var(--gold)}
.profile-section-heading .rank-caption{padding:0;text-align:right}
.profile-section-heading a{font-size:11px;color:var(--gold);border-bottom:1px solid var(--gold-line)}

/* плитки статистики */
.profile-stats{padding:18px 22px}
.stat-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.stat{display:grid;gap:4px;padding:14px 16px;border:1px solid #1e2e23;border-radius:10px;background:#07120c;min-width:0}
.stat>*{min-width:0;overflow-wrap:anywhere}
.stat b{font:400 34px/1 var(--serif);color:var(--cream);letter-spacing:.5px}
.stat small{font-size:11px;color:var(--muted)}

/* график PTS */
.pts-chart{position:relative}
.pts-chart svg{width:100%;height:auto;display:block;overflow:visible}
.pts-chart .grid{stroke:#1e2e23;stroke-width:1}
.pts-chart .axis-line{stroke:#2b3c2e;stroke-width:1}
.pts-chart .axis{fill:#8e988a;font-size:10px;font-family:var(--sans)}
.pts-chart .value{fill:var(--cream);font-size:11px;font-family:var(--sans)}
.pts-chart .bar .hit{fill:transparent}
.pts-chart .bar .fill{fill:#0f7a5c;transition:fill .15s}
.pts-chart .bar:hover .fill,.pts-chart .bar:focus-visible .fill{fill:#18a57c}
.pts-chart .bar:focus-visible{outline:none}
.chart-tip{position:absolute;transform:translate(-50%,-100%);padding:8px 11px;border:1px solid var(--gold-line);border-radius:8px;background:#0a160fee;color:var(--text);font-size:11px;white-space:nowrap;pointer-events:none;z-index:2}

/* история турниров */
.history-scroll{overflow-x:auto}
.history-table{width:100%;border-collapse:collapse;font-size:13px}
.history-table th,.history-table td{padding:10px 8px;text-align:left;border-bottom:1px solid #1e2e23;white-space:nowrap}
.history-table thead th{font-size:9px;letter-spacing:2.5px;text-transform:uppercase;color:#8e988a;font-weight:400}
.history-table tbody th{font-weight:400;color:var(--text);white-space:normal;min-width:140px}
.history-table td b{font:400 17px/1 var(--serif);color:var(--cream)}
.history-table td small{color:var(--muted);font-size:10px}
.history-table .place{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;border:1px solid #2b3c2e;font-size:12px}
.history-table .rank-1 .place{border-color:var(--gold);color:var(--gold)}
.history-table .rank-2 .place{border-color:#b7bbb3;color:#dfe2dc}
.history-table .rank-3 .place{border-color:#a8744f;color:#d39b6f}

/* мои записи */
.reg-list{list-style:none;display:grid;gap:10px}
.reg-item{display:flex;align-items:center;gap:14px;padding:12px 14px;border:1px solid #1e2e23;border-radius:10px;background:#07120c}
.reg-item .date{flex-shrink:0}
.reg-item>div{min-width:0;flex:1;display:grid;gap:3px}
.reg-item strong{font-weight:400;font-size:14px;color:var(--text)}
.reg-item small{font-size:11px;color:var(--muted)}
.reg-cancel{background:none;border:1px solid #2b3c2e;border-radius:50%;width:30px;height:30px;display:grid;place-items:center;color:var(--muted);cursor:pointer;flex-shrink:0}
.reg-cancel .icon{width:14px;height:14px}
.reg-cancel:hover{border-color:#c47a6a;color:#e4a394}
.profile-events .panel-intro{margin:0 0 14px}
.profile-story{min-height:220px}

/* редактирование */
.profile-edit form{display:grid;gap:16px}
.profile-edit form+form{margin-top:26px;padding-top:22px;border-top:1px solid #1e2e23}
.profile-edit h3{font:400 18px/1.2 var(--serif);color:var(--cream)}
.avatar-picker{display:flex;flex-wrap:wrap;gap:8px}
.avatar-option{cursor:pointer}
.form-panel .avatar-option input[type=radio]{position:absolute;opacity:0;width:0;height:0;min-height:0;padding:0;border:0;pointer-events:none}
.avatar-option .avatar{width:44px;height:44px;opacity:.55;transition:opacity .15s,transform .15s}
.avatar-option input:checked+.avatar{opacity:1;transform:scale(1.08);border-color:var(--gold);box-shadow:0 0 0 2px #c2aa7c55}
.avatar-option input:focus-visible+.avatar{outline:2px solid #f2ca7e;outline-offset:3px}

/* форма регистрации */
.account-fields{display:grid;gap:17px}
.account-fields[hidden]{display:none}

/* рейтинг: ссылки на игроков и своя строка */
.ranking-panel .player a{color:inherit;border-bottom:1px solid transparent}
.ranking-panel .player a:hover{border-bottom-color:var(--gold)}
.ranking-panel tr.is-me td,.ranking-panel tr.is-me th{background:#0f2418!important;box-shadow:inset 0 0 0 1px #c2aa7c44}

@media(max-width:1190px){
 .profile-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:900px){
 .profile-card{flex-wrap:wrap;gap:22px;padding:24px}
 .profile-actions{flex-direction:row;flex-wrap:wrap;min-width:0;width:100%}
 .profile-actions .btn{flex:1}
 .profile-id h1{font-size:40px}
 .auth-layout{grid-template-columns:minmax(0,1fr)}
 .auth-aside{display:none}
}
@media(max-width:700px){
 .header-auth:not(.is-logged){display:none}
 .nav-account{display:block}
 .header-auth span{display:none}
 .profile-hero{padding-top:20px}
 .profile-card{padding:20px 18px}
 .avatar-xl{width:88px;height:88px}
 .profile-grid .panel{padding:18px}
 .stat-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
 .profile-edit h2{font-size:22px;align-items:center}
 .history-table th:nth-child(4),.history-table td:nth-child(4){display:none}
 .history-table th,.history-table td{padding:10px 6px}
 .stat b{font-size:28px}
 .profile-section-heading .rank-caption{text-align:left}
}
