/* ============================================================
   Клубы (v462): pages/clubs.html
   ============================================================ */
.cl-app { --gold: #ffc93c; --ok: #2fd27a; --bad: #ff5a6e; padding: 8px 0 40px; min-width: 0; }
.cl-app *, .cl-app *::before, .cl-dialog * { box-sizing: border-box; }

.cl-hero, .cl-head { position: relative; padding: 26px; margin-bottom: 16px; border-radius: 28px; overflow: hidden; isolation: isolate;
    border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
    background: radial-gradient(90% 140% at 0% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 55%),
                radial-gradient(80% 130% at 100% 100%, color-mix(in srgb, #f7931e 24%, transparent), transparent 60%),
                linear-gradient(160deg, color-mix(in srgb, var(--surface) 92%, #0b1030), color-mix(in srgb, var(--bg) 85%, #04060f)); }
.cl-hero::after, .cl-head::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5; background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, .025) 22px 23px); }
.cl-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.cl-hero h2, .cl-head h2 { font-family: 'Russo One', 'Montserrat', sans-serif; font-weight: 400; font-size: clamp(24px, 3.4vw, 36px); line-height: 1.12; margin: 10px 0 8px; overflow-wrap: anywhere; }
.cl-hero h2 em { font-style: normal; background: linear-gradient(90deg, var(--gold), #ff8a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cl-hero p { margin: 0 0 16px; max-width: 640px; color: var(--text-muted); font-size: 14.5px; line-height: 1.55; }
.cl-mine { display: flex; flex-wrap: wrap; gap: 10px; }

/* кнопки */
.cl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; font: inherit; font-weight: 800; font-size: 14px;
    color: var(--text); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); cursor: pointer; text-decoration: none; transition: transform .2s, background .2s, box-shadow .2s; }
.cl-btn:hover { background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.cl-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.cl-btn.is-main { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 26px -14px var(--accent); }
.cl-btn.is-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.cl-btn.is-danger.is-solid { color: #fff; background: var(--bad); border: 0; }
.cl-btn.is-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.cl-btn.is-ghost { background: none; border-color: transparent; color: var(--text-muted); }

/* мой клуб в шапке */
.cl-mycard { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 18px; color: var(--text); text-decoration: none; min-width: 0; max-width: 100%;
    background: rgba(0, 0, 0, .25); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); transition: transform .2s; }
.cl-mycard:hover { transform: translateY(-2px); }
.cl-mycard > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cl-mycard small { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); }
.cl-mycard b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-mystat { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-weight: 800; white-space: nowrap; }
.cl-mystat i { color: var(--gold); }
.cl-mystat em { font-style: normal; color: var(--text-muted); font-size: 13px; }

/* аватарка клуба: щит-квадрат */
.cl-ava { flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 30%; color: #1a1300;
    background: linear-gradient(135deg, #ffe07a, #ff9d3a); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.cl-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl-ava b { font-family: 'Russo One', sans-serif; font-weight: 400; }
.cl-ava.is-sm { width: 46px; height: 46px; font-size: 20px; }
.cl-ava.is-md { width: 84px; height: 84px; font-size: 34px; }
.cl-ava.is-lg { width: 120px; height: 120px; font-size: 52px; border-radius: 32px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 60%, transparent), 0 20px 40px -18px #ff9d3a; }

/* поиск */
.cl-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.cl-search { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-soft); }
.cl-search i { color: var(--text-dim); }
.cl-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.cl-search:focus-within { border-color: var(--accent); }

/* рейтинг */
.cl-rank { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.cl-row { min-width: 0; }
.cl-row { animation: cl-in .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(min(var(--i, 0), 12) * 35ms); }
@keyframes cl-in { from { opacity: 0; transform: translateY(10px); } }
.cl-row a { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; border-radius: 18px; color: var(--text); text-decoration: none; min-width: 0;
    background: var(--surface); border: 1px solid var(--border-soft); transition: border-color .2s, transform .2s; }
.cl-row a:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.cl-row.is-mine a { border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface)); }
.cl-row.is-skel { height: 68px; border-radius: 18px; background: var(--surface); opacity: .5; animation: cl-pulse 1.2s ease-in-out infinite; }
@keyframes cl-pulse { 50% { opacity: .25; } }
.cl-place { flex: none; width: 34px; text-align: center; font-family: 'Russo One', sans-serif; font-size: 17px; color: var(--text-muted); }
.cl-place.p1 { color: #ffd34d; } .cl-place.p2 { color: #d9e2f0; } .cl-place.p3 { color: #e39a5b; }
.cl-place.p1, .cl-place.p2, .cl-place.p3 { font-size: 21px; text-shadow: 0 0 14px currentColor; }
.cl-name { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cl-name b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-name small { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-name small i { margin-right: 4px; color: var(--accent); }
.cl-trophies { flex: none; display: inline-flex; align-items: center; gap: 6px; font-family: 'Russo One', sans-serif; font-size: 16px; }
.cl-trophies i { color: var(--gold); }
.cl-empty { list-style: none; }

/* страница клуба */
.cl-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 700; font-size: 14px; color: var(--text-muted); text-decoration: none; }
.cl-back:hover { color: var(--text); }
.cl-skel-head { height: 260px; border-radius: 28px; background: var(--surface); animation: cl-pulse 1.2s ease-in-out infinite; }
.cl-head { display: flex; gap: 24px; align-items: flex-start; }
.cl-head-main { flex: 1; min-width: 0; }
.cl-head h2 { margin-top: 6px; }
.cl-desc { margin: 0 0 14px; color: var(--text-muted); line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.cl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.cl-stat { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 18px; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .07); min-width: 0; }
.cl-stat > i { color: var(--accent); font-size: 15px; }
.cl-stat.is-gold > i { color: var(--gold); }
.cl-stat b { font-family: 'Russo One', sans-serif; font-weight: 400; font-size: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-stat.is-gold b { color: var(--gold); }
.cl-stat small { font-size: 12px; color: var(--text-muted); }
.cl-bar { height: 5px; margin-top: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.cl-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.cl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cl-note { font-size: 13.5px; color: var(--text-muted); }
.cl-note a { color: var(--accent); }
.cl-hint { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.45; color: var(--text-muted); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cl-hint i { color: var(--accent); margin-right: 6px; }

.cl-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 14px; align-items: start; }
.cl-cols > .cl-panel:only-child { grid-column: 1 / -1; }
.cl-panel { padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border-soft); min-width: 0; margin-bottom: 14px; }
.cl-panel h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; font-family: 'Montserrat', sans-serif; }
.cl-panel h3 i { color: var(--accent); }
.cl-panel h3 em { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }

.cl-members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.cl-mem { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 4px; border-radius: 14px; min-width: 0; animation: cl-in .4s both; animation-delay: calc(min(var(--i, 0), 15) * 25ms); }
.cl-mem:hover { background: rgba(255, 255, 255, .04); }
.cl-mem.is-me { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cl-mem-n { flex: none; width: 24px; text-align: center; font-size: 13px; font-weight: 800; color: var(--text-dim); }
.cl-mem-who { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.cl-mem-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cl-mem-who b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-mem-who small { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-mem-who small.r-owner { color: var(--gold); }
.cl-mem-who small.r-officer { color: color-mix(in srgb, var(--accent) 80%, #fff); }
.cl-mem-who small i { margin-right: 4px; }
.cl-pava { flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); }
.cl-pava img, .cl-pava video { width: 100%; height: 100%; object-fit: cover; }
.cl-mem-tr { flex: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.cl-mem-tr i { color: var(--gold); }
.cl-mem-tr.is-off { color: var(--text-dim); }
.cl-mem-tr.is-off i { color: var(--text-dim); }

.cl-menu { position: relative; flex: none; }
.cl-menu summary { list-style: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; color: var(--text-muted); }
.cl-menu summary::-webkit-details-marker { display: none; }
.cl-menu summary:hover, .cl-menu[open] summary { background: rgba(255, 255, 255, .08); color: var(--text); }
.cl-menu > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 240px; padding: 6px; border-radius: 14px; background: var(--surface-2, #1b1f33); border: 1px solid var(--border-soft); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .7); }
.cl-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.cl-menu button:hover { background: rgba(255, 255, 255, .07); }
.cl-menu button i { width: 16px; color: var(--text-muted); }
.cl-menu button.is-danger, .cl-menu button.is-danger i { color: var(--bad); }

.cl-reqs ul, .cl-log ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cl-reqs li { display: flex; align-items: center; gap: 10px; padding: 6px 0; min-width: 0; }
.cl-reqs li > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cl-reqs b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-reqs small { font-size: 12px; color: var(--text-muted); }
.cl-reqs small i { color: var(--gold); margin-right: 4px; }
.cl-log li { font-size: 13px; line-height: 1.45; color: var(--text-muted); padding: 6px 0; border-bottom: 1px solid var(--border-soft); overflow-wrap: anywhere; }
.cl-log li:last-child { border-bottom: 0; }
.cl-log b { color: var(--text); font-weight: 700; }
.cl-log time { display: block; font-size: 11.5px; color: var(--text-dim); }

/* форма */
.cl-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 26px; color: var(--text);
    background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 94%, #0b1030), var(--bg)); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); }
.cl-dialog::backdrop { background: rgba(4, 6, 15, .65); backdrop-filter: blur(4px); }
.cl-dialog[open] { animation: cl-pop .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes cl-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.cl-form { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.cl-form h3 { margin: 0; font-family: 'Russo One', sans-serif; font-weight: 400; font-size: 22px; }
.cl-form p { margin: 0; line-height: 1.5; }
.cl-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-muted); min-width: 0; }
.cl-form input, .cl-form textarea, .cl-form select { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 500; }
.cl-form input:focus, .cl-form textarea:focus, .cl-form select:focus { outline: 0; border-color: var(--accent); }
.cl-form input:disabled { opacity: .6; }
.cl-form textarea { resize: vertical; min-height: 80px; }
.cl-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cl-form-ava { display: flex; align-items: center; gap: 16px; }
.cl-form-ava > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cl-form-ava small { flex-basis: 100%; font-size: 12px; color: var(--text-dim); }
.cl-form-note { margin-top: -6px; font-size: 12px; color: var(--text-dim); }
.cl-form-err { padding: 10px 12px; border-radius: 12px; font-size: 13.5px; color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.cl-form-act { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.cl-link-danger { align-self: center; margin-top: 4px; border: 0; background: none; color: var(--bad); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cl-link-danger i { margin-right: 6px; }

@media (max-width: 860px) {
    .cl-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .cl-hero, .cl-head { padding: 20px; border-radius: 24px; }
    .cl-head { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
    .cl-ava.is-lg { width: 96px; height: 96px; font-size: 42px; border-radius: 28px; }
    .cl-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cl-stats .cl-stat:first-child { grid-column: 1 / -1; }
    .cl-actions { justify-content: center; }
    .cl-actions .cl-btn { flex: 1 1 140px; }
    .cl-row a { gap: 10px; padding: 10px 12px 10px 8px; }
    .cl-place { width: 26px; }
    .cl-trophies { font-size: 14px; }
    .cl-mycard { width: 100%; }
    .cl-mystat { margin-left: 0; font-size: 13px; }
    .cl-mystat em { display: none; }
    .cl-mine .cl-btn { width: 100%; }
    .cl-form-row { grid-template-columns: minmax(0, 1fr); }
    .cl-form-act .cl-btn { flex: 1; }
    .cl-reqs .cl-btn.is-main span { display: none; }
    .cl-panel { padding: 14px 10px; border-radius: 20px; }
    .cl-panel h3 { padding-left: 4px; }
    .cl-mem { gap: 8px; padding: 8px 4px; }
    .cl-mem-n { display: none; }
    .cl-pava { width: 34px; height: 34px; }
    .cl-mem-tr { font-size: 13px; gap: 4px; }
    .cl-menu summary { width: 28px; }
    .cl-stat b { font-size: 17px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .cl-row, .cl-mem, .cl-dialog[open] { animation: none; } }
