/* Challenge sahifasi — Modern Minimalist SaaS (Linear & Apple Books style) */

.ch-page { position: relative; z-index: 1; }

/* ================= HERO BANNER ================= */
.ch-hero {
    padding: 24px 28px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(15, 81, 50, 0.05) 0%, rgba(234, 88, 12, 0.05) 100%), var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-xs);
}

.ch-hero-content {
    flex: 1 1 360px;
    min-width: 0;
}

.ch-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.ch-hero-badge .material-symbols-outlined { font-size: 15px; }

.ch-hero-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 12px;
    line-height: 1.25;
}

.ch-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ch-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
}
.ch-pill .material-symbols-outlined { font-size: 16px; color: var(--text-muted); }

.ch-pill-highlight {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent-dark);
}
.ch-pill-highlight .material-symbols-outlined { color: var(--accent); }

.ch-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ch-admin-link, .ch-preview-btn {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Fallback for legacy ch-head if used in admin */
.ch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.ch-sub { margin: 6px 0 0; font-size: 14px; max-width: 640px; }

/* ================= SECTION HEADERS ================= */
.ch-section { margin: 28px 0; }

.ch-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ch-h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18.5px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.01em;
}
.ch-h2 .material-symbols-outlined { color: var(--accent); font-size: 22px; }

.ch-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.ch-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: chPulse 2s infinite;
}
@keyframes chPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ================= MEDAL ICONS ================= */
.ch-medal-ic { font-variation-settings: 'FILL' 1; line-height: 1; }
.ch-medal-gold { color: #F59E0B; filter: drop-shadow(0 2px 5px rgba(245, 158, 11, .35)); }
.ch-medal-silver { color: #94A3B8; filter: drop-shadow(0 2px 5px rgba(148, 163, 184, .25)); }
.ch-medal-bronze { color: #D97706; filter: drop-shadow(0 2px 5px rgba(217, 119, 6, .3)); }
.ch-medal { display: inline-flex; align-items: center; justify-content: center; }
.ch-medal .ch-medal-ic { font-size: 26px; }

/* ================= PRIZES SHOWCASE ================= */
.ch-prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.ch-prize-card {
    padding: 20px 18px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: hidden;
}
.ch-prize-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.ch-rank-gold {
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--surface) 48%);
    box-shadow: 0 2px 14px rgba(245, 158, 11, 0.08);
}
.ch-rank-silver {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.08) 0%, var(--surface) 48%);
}
.ch-rank-bronze {
    border: 1px solid rgba(217, 119, 6, 0.32);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.07) 0%, var(--surface) 48%);
}

.ch-prize-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
}
.ch-rank-gold .ch-prize-badge { background: rgba(245, 158, 11, 0.16); color: #B45309; }
.ch-rank-silver .ch-prize-badge { background: rgba(148, 163, 184, 0.16); color: #475569; }
.ch-rank-bronze .ch-prize-badge { background: rgba(217, 119, 6, 0.15); color: #B45309; }

[data-theme="dark"] .ch-rank-gold .ch-prize-badge { color: #FBBF24; }
[data-theme="dark"] .ch-rank-silver .ch-prize-badge { color: #CBD5E1; }
[data-theme="dark"] .ch-rank-bronze .ch-prize-badge { color: #F59E0B; }

.ch-prize-cover-wrap {
    width: 96px;
    height: 136px;
    margin: 2px auto 14px;
    perspective: 600px;
}

.ch-prize-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 18px -4px rgba(15, 23, 42, 0.22), 0 2px 6px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(0,0,0,0.06);
    transition: transform .25s ease;
}
.ch-prize-card:hover .ch-prize-cover {
    transform: scale(1.04) rotateY(-4deg);
}

.ch-prize-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1.5px dashed var(--border-strong);
    border-radius: 8px;
}
.ch-prize-placeholder .material-symbols-outlined { font-size: 36px; }

.ch-prize-info { width: 100%; min-width: 0; }
.ch-prize-title {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ch-prize-author {
    display: block;
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================= BAYRAM BANNERI ================= */
.ch-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), var(--accent-soft));
}
.ch-banner .ch-banner-ic { font-size: 26px; color: var(--accent); }
.ch-banner-text { flex: 1 1 auto; }
.ch-banner-text strong { display: block; color: var(--text); font-size: 14.5px; }

/* ================= PODIUM ================= */
.ch-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 14px;
    margin: 18px 0 10px;
}

.ch-podium-card {
    flex: 1 1 0;
    max-width: 220px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: var(--radius) var(--radius) 0 0;
    transition: transform .2s ease;
}
.ch-podium-card:hover { transform: translateY(-4px); text-decoration: none; }

.ch-podium-medal { margin-bottom: 4px; }
.ch-podium-card .ch-medal .ch-medal-ic { font-size: 28px; }
.ch-place-1 .ch-medal .ch-medal-ic { font-size: 36px; }

.ch-avatar-wrap { position: relative; margin: 4px 0 8px; }
.ch-avatar { width: 62px; height: 62px; font-size: 23px; border: 3px solid var(--surface); box-shadow: var(--shadow-md); border-radius: 50%; }

.ch-place-1 .ch-avatar {
    width: 82px;
    height: 82px;
    font-size: 30px;
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28), var(--shadow-lg);
}
.ch-place-2 .ch-avatar { border-color: #94A3B8; }
.ch-place-3 .ch-avatar { border-color: #D97706; }

.ch-rank-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-xs);
}
.ch-place-1 .ch-rank-badge { background: #F59E0B; }
.ch-place-2 .ch-rank-badge { background: #94A3B8; }
.ch-place-3 .ch-rank-badge { background: #D97706; }

.ch-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}
.ch-score { font-size: 13px; color: var(--text-secondary); }
.ch-score strong { color: var(--accent); font-size: 16.5px; font-weight: 800; }
.ch-detail { font-size: 12px; color: var(--text-muted); }

.ch-pillar {
    margin-top: 10px;
    width: 100%;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid var(--border);
    border-bottom: none;
}
.ch-place-1 .ch-pillar {
    height: 76px;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.03) 100%);
    border-color: rgba(245, 158, 11, 0.38);
}
.ch-place-2 .ch-pillar {
    height: 52px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.16) 0%, rgba(148, 163, 184, 0.03) 100%);
    border-color: rgba(148, 163, 184, 0.32);
}
.ch-place-3 .ch-pillar {
    height: 36px;
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.14) 0%, rgba(217, 119, 6, 0.03) 100%);
    border-color: rgba(217, 119, 6, 0.28);
}
.ch-pillar-num {
    font-size: 24px;
    font-weight: 900;
    opacity: 0.35;
    color: var(--text);
    letter-spacing: -1px;
}

/* ================= RANK LIST ================= */
.ch-rank-wrapper {
    padding: 6px 10px;
    border-radius: var(--radius);
    margin-top: 14px;
}

.ch-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ch-rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background .15s ease;
    border-bottom: 1px solid var(--border);
}
.ch-rank-row:last-child { border-bottom: none; }
.ch-rank-row:hover { background: var(--bg-subtle); }
.ch-rank-row.is-me {
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
}

.ch-rank-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13.5px;
    border-radius: 8px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ch-rank-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.ch-rank-avatar {
    width: 34px;
    height: 34px;
    font-size: 13.5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ch-rank-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ch-rank-stats {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
}
.ch-rank-score { font-size: 13px; color: var(--text); }
.ch-rank-score strong { color: var(--accent); font-weight: 700; }
.ch-rank-books { font-size: 12px; }

/* My Rank Docked Card */
.ch-my-rank {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 18px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-soft), var(--surface));
    border: 1.5px solid var(--accent);
    box-shadow: var(--shadow-xs);
}
.ch-my-rank-ic { color: var(--accent); font-size: 24px; }
.ch-my-rank-num {
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    padding: 2px 9px;
    font-weight: 800;
    font-size: 13.5px;
}
.ch-my-rank-info { flex: 1 1 auto; display: flex; flex-direction: column; }
.ch-my-rank-info strong { font-size: 13.5px; color: var(--text); }
.ch-my-rank-info .muted { font-size: 12px; }

/* ================= ANNOUNCED WINNERS (LEGACY COMPAT) ================= */
.ch-winners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ch-winner { padding: 18px; position: relative; overflow: hidden; border-radius: var(--radius); }
.ch-winner.ch-place-1 { border: 1.5px solid #F59E0B; background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), var(--surface) 60%); }
.ch-winner-deco { position: absolute; top: -14px; right: -10px; font-size: 84px; opacity: .05; pointer-events: none; }
.ch-winner-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.ch-winner-top .ch-medal .ch-medal-ic { font-size: 30px; }
.ch-winner-user { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.ch-winner-user .ch-avatar { width: 46px; height: 46px; font-size: 19px; }
.ch-winner-stats { display: flex; gap: 14px; margin: 12px 0 10px; position: relative; z-index: 1; }
.ch-winner-stats > div { display: flex; flex-direction: column; }
.ch-winner-stats strong { font-size: 17px; color: var(--text); }
.ch-winner-stats .muted { font-size: 11.5px; }

.ch-gift {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}
.ch-gift img { width: 40px; height: 56px; object-fit: cover; border-radius: 5px; box-shadow: var(--shadow-xs); }
.ch-gift > div { display: flex; flex-direction: column; min-width: 0; }
.ch-gift-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--accent); font-weight: 700; }
.ch-gift-label .material-symbols-outlined { font-size: 14px; }
.ch-gift-noimg { width: 40px; height: 56px; border-radius: 5px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }

.ch-like-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
    font-weight: 600; font-size: 13px; color: var(--text); transition: all .15s ease; position: relative; z-index: 1;
}
.ch-like-btn:active { transform: scale(.95); }
.ch-like-btn .material-symbols-outlined { font-size: 18px; color: var(--text-muted); transition: color .15s ease; }
.ch-like-btn:hover { border-color: var(--accent); }
.ch-like-btn.is-liked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ch-like-btn.is-liked .material-symbols-outlined { color: var(--accent); font-variation-settings: 'FILL' 1; }
.ch-like-btn.pop { animation: chPop .3s ease; }
@keyframes chPop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ================= STATISTIKA / HEATMAP ================= */
.ch-stats-card {
    padding: 20px;
    border-radius: var(--radius);
}

.ch-stats-header { margin-bottom: 12px; }

.ch-stats-tabs {
    display: inline-flex;
    padding: 3px;
    background: var(--bg-subtle);
    border-radius: 999px;
    border: 1px solid var(--border);
}

.ch-stat-tab {
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s ease;
}
.ch-stat-tab.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
    font-weight: 700;
}

.ch-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ch-stat-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ch-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-secondary);
}
.ch-stat-chip .material-symbols-outlined { font-size: 15px; color: var(--primary); }
.ch-stat-chip strong { color: var(--text); font-weight: 700; }

.ch-year-nav { display: inline-flex; align-items: center; gap: 6px; }
.ch-year-nav button {
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    color: var(--text); transition: all .15s ease;
}
.ch-year-nav button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ch-year-nav button:disabled { opacity: .35; cursor: not-allowed; }
.ch-year-label { font-weight: 700; font-size: 14.5px; min-width: 50px; text-align: center; }

.ch-heatmap { overflow-x: auto; padding: 4px 0 10px; }
.gh-cal { display: inline-flex; flex-direction: column; gap: 5px; }
.gh-months { display: flex; gap: 3px; padding-left: 28px; }
.gh-m { width: 13px; font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.gh-cols { display: flex; gap: 6px; }
.gh-wd { display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; width: 22px; }
.gh-wd span { font-size: 9px; color: var(--text-muted); line-height: 13px; }
.gh-weeks { display: flex; gap: 3px; }
.gh-week { display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; }
.gh-day { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-subtle); border: 1px solid var(--border); }
.gh-day:not(.gh-empty) { cursor: pointer; transition: transform .1s ease; }
.gh-day:not(.gh-empty):hover { transform: scale(1.3); }
.gh-day.gh-empty { background: transparent; border-color: transparent; }
.gh-day.lv-0 { background: var(--bg-subtle); }
.gh-day.lv-1 { background: rgba(16, 185, 129, 0.25); border-color: rgba(16, 185, 129, 0.35); }
.gh-day.lv-2 { background: rgba(16, 185, 129, 0.50); border-color: rgba(16, 185, 129, 0.60); }
.gh-day.lv-3 { background: rgba(16, 185, 129, 0.75); border-color: rgba(16, 185, 129, 0.85); }
.gh-day.lv-4 { background: #10B981; border-color: #059669; }
.gh-day.is-sel { outline: 2px solid var(--accent); outline-offset: 1px; }

.ch-heatmap-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.gh-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.gh-detail .material-symbols-outlined { color: var(--primary); font-size: 18px; }
.gh-detail strong { color: var(--text); }
.gh-detail b { color: var(--text); }

.gh-legend { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); }
.gh-legend .gh-day { cursor: default; }
.gh-loading { padding: 24px 10px; color: var(--text-muted); font-size: 13.5px; text-align: center; }

/* ================= EMPTY STATE ================= */
.ch-empty { text-align: center; padding: 36px 20px; }
.ch-empty-icon {
    width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft);
    color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.ch-empty-icon .material-symbols-outlined { font-size: 28px; }
.ch-empty h3 { margin: 0 0 6px; font-size: 16px; }
.ch-empty p { max-width: 360px; margin: 0 auto 16px; font-size: 13.5px; }

/* ================= CELEBRATION EFFECTS ================= */
.ch-festive { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ch-festive .ch-spark { position: absolute; top: 0; opacity: 0; animation: chFall linear infinite; font-variation-settings: 'FILL' 1; }
.ch-festive .c-gold { color: #F59E0B; }
.ch-festive .c-silver { color: #94A3B8; }
.ch-festive .c-primary { color: var(--primary); }
.ch-festive .c-accent { color: var(--accent); }
@keyframes chFall {
    0% { transform: translateY(-10vh) rotate(0); opacity: 0; }
    10% { opacity: .8; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: .4; }
}

/* ================= WINNERS MODAL ================= */
.ch-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.ch-modal[hidden] { display: none; }
.ch-modal-backdrop { position: absolute; inset: 0; background: rgba(9, 13, 22, 0.55); backdrop-filter: blur(4px); }
.ch-modal-box {
    position: relative; z-index: 1; width: min(640px, 94vw); max-height: 90vh; overflow: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 0 0 22px; text-align: center; box-shadow: var(--shadow-lg);
    animation: chModalIn .3s cubic-bezier(.2,.9,.3,1);
}
@keyframes chModalIn { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.ch-modal-header {
    position: relative; padding: 24px 20px 20px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden;
    background: linear-gradient(135deg, #0F5132, #093521); color: #fff;
}
.ch-modal-crown { font-size: 38px; color: #F59E0B; font-variation-settings: 'FILL' 1; }
.ch-modal-title { margin: 4px 0 2px; font-size: 20px; color: #fff; }
.ch-modal-sub { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, 0.85); }
.ch-modal-x { position: absolute; top: 12px; right: 12px; border: none; background: rgba(255, 255, 255, 0.16); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ch-modal-x:hover { background: rgba(255, 255, 255, 0.28); }

.ch-modal-winners { display: flex; justify-content: center; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 20px 14px 18px; }
.ch-modal-winner { display: flex; flex-direction: column; align-items: center; width: 165px; padding: 12px 8px; border-radius: var(--radius); background: var(--bg-subtle); border: 1px solid var(--border); }
.ch-modal-winner .ch-medal .ch-medal-ic { font-size: 30px; }
.ch-modal-winner .ch-avatar { width: 64px; height: 64px; font-size: 24px; margin: 4px 0; }
.ch-modal-winner.ch-place-1 { order: -1; transform: scale(1.04); background: var(--surface); border: 1.5px solid #F59E0B; box-shadow: var(--shadow-md); }
.ch-modal-winner.ch-place-1 .ch-avatar { width: 76px; height: 76px; border: 3px solid #F59E0B; }
.ch-modal-name { font-weight: 700; font-size: 13.5px; color: var(--text); }
.ch-modal-stats { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }

.ch-modal-gift {
    margin-top: 10px; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: var(--radius-sm); background: var(--bg-subtle); border: 1px solid var(--border); text-align: left; width: 100%;
}
.ch-modal-gift img { width: 38px; height: 52px; object-fit: cover; border-radius: 5px; }
.ch-modal-gift-noimg { width: 38px; height: 52px; border-radius: 5px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.ch-modal-gift-info { display: flex; flex-direction: column; min-width: 0; }
.ch-modal-gift-title { font-weight: 700; font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-modal-gift-author { font-size: 11.5px; color: var(--text-secondary); }
.ch-modal-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: var(--radius-lg); }

/* ================= SUPER ADMIN SINOV REJIMI ================= */
.ch-sa-preview { position: fixed; inset: 0; z-index: 2000; overflow-y: auto; background: var(--bg); }
.ch-sa-preview-inner { max-width: 860px; margin: 0 auto; padding: 20px 16px 50px; }
.ch-sa-preview-head {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.ch-sa-preview-title { display: flex; align-items: center; gap: 8px; font-size: 19px; margin: 0 0 2px; }
.ch-sa-preview-title .material-symbols-outlined { color: var(--accent); }
.ch-sa-sub { margin: 0; font-size: 13.5px; }
.ch-sa-empty { text-align: center; padding: 36px 12px; }
.ch-sa-empty .material-symbols-outlined { font-size: 40px; color: var(--text-muted); }
.ch-sa-winners { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 16px; }
.ch-sa-winner {
    flex: 1 1 190px; max-width: 230px; text-align: center; padding: 14px 10px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
}
.ch-sa-winner .ch-avatar { width: 56px; height: 56px; margin: 4px auto; }
.ch-sa-winner-stats { font-size: 11.5px; margin-top: 3px; }
.ch-sa-winner-gift { margin-top: 8px; }
.ch-sa-gift-forms { display: flex; flex-direction: column; gap: 12px; }
.ch-sa-gift-form { padding: 14px; }
.ch-sa-gift-who { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ch-form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ch-form-row label { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.ch-form-row input { padding: 7px 11px; border-radius: var(--radius-xs); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; }
.ch-sa-summary { margin: 16px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-subtle); border: 1px solid var(--border); }
.ch-sa-summary-title { margin: 0 0 6px; font-size: 14px; }
.ch-sa-summary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ch-sa-summary-list li { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.ch-sa-summary-list .material-symbols-outlined { font-size: 17px; color: var(--accent); }
.ch-sa-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Admin Preview & Standings */
.ch-h3 { display: flex; align-items: center; gap: 8px; font-size: 15.5px; margin: 18px 0 10px; }
.ch-h3 .material-symbols-outlined { color: var(--accent); font-size: 19px; }

/* ================= CHALLENGE ADMIN DASHBOARD ================= */
.ch-admin {
    max-width: 980px;
    margin: 0 auto;
}

.ch-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 22px 26px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(234, 88, 12, 0.05) 100%), var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.ch-admin-header-main {
    flex: 1 1 360px;
    min-width: 0;
}

.ch-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.ch-admin-badge .material-symbols-outlined { font-size: 15px; }

.ch-admin-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 6px;
    line-height: 1.25;
}

.ch-admin-desc {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ch-admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ch-admin-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #15803d;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 22px;
}
.ch-admin-alert .material-symbols-outlined { font-size: 22px; color: #16a34a; }

.ch-admin-card {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-bottom: 24px;
}

.ch-admin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.ch-admin-card-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ch-admin-card-head p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.ch-admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.ch-admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ch-admin-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ch-admin-field .input {
    width: 100%;
}

.ch-admin-field small {
    font-size: 12px;
    color: var(--text-muted);
}

/* 1-, 2-, 3-o'rin sovg'a kitoblar gridi */
.ch-admin-prizes {
    margin: 22px 0 18px;
}

.ch-admin-prizes-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text);
}
.ch-admin-prizes-title .material-symbols-outlined { color: var(--accent); }

.ch-admin-prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.ch-prize-card {
    padding: 16px;
    border-radius: var(--radius);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ch-prize-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}

.ch-prize-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.ch-prize-head .ch-medal-ic { font-size: 22px; }

.ch-prize-cover-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    margin-top: 4px;
}

.ch-prize-cover-img {
    width: 44px;
    height: 62px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.ch-prize-cover-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ch-prize-cover-meta strong {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ch-prize-cover-meta span {
    font-size: 11.5px;
    color: var(--accent);
    font-weight: 600;
}

.ch-admin-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.ch-admin-form-actions-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Davr navigatsiyasi */
.ch-period-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
}

.ch-period-label {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.ch-period-label strong {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.ch-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
}
.ch-status .material-symbols-outlined { font-size: 14px; }
.ch-status.is-announced {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.ch-status.is-completed {
    background: rgba(234, 88, 12, 0.12);
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.3);
}
.ch-status.is-live {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

/* Amallar paneli */
.ch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* Sovg'a kitob formasi (e'lon qilingandan keyin) */
.ch-gift-form {
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
}

.ch-gift-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.ch-gift-form-header strong {
    font-size: 14.5px;
    color: var(--text);
}

.ch-announce-form {
    max-height: 70vh;
    overflow-y: auto;
    padding: 4px 6px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .ch-hero { padding: 18px 16px; }
    .ch-hero-title { font-size: 22px; }
    .ch-podium { gap: 6px; }
    .ch-avatar { width: 50px; height: 50px; font-size: 18px; }
    .ch-place-1 .ch-avatar { width: 64px; height: 64px; font-size: 24px; }
    .ch-pillar-num { font-size: 18px; }
    .ch-rank-row { padding: 8px 10px; gap: 8px; }
    .ch-rank-name { font-size: 13px; }
    .ch-rank-score { font-size: 12px; }
    .ch-prizes-grid { grid-template-columns: 1fr; }
    .ch-heatmap-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ch-admin-header { padding: 18px 16px; }
    .ch-admin-grid-2 { grid-template-columns: 1fr; }
    .ch-admin-prizes-grid { grid-template-columns: 1fr; }
    .ch-period-nav { flex-direction: column; text-align: center; }
}
