@layer components {

/* ============================================
   Skeleton Loading Components
   ============================================ */

/* --- Skeleton Card (Challenge Grid) --- */
.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.skeleton-image {
    height: 200px;
    background: var(--surface-1);
}

.skeleton-content {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-line {
    border-radius: 6px;
    background: var(--surface-1);
}

.skeleton-title {
    height: 20px;
    width: 75%;
}

.skeleton-meta {
    height: 14px;
    width: 50%;
}

.skeleton-tags {
    display: flex;
    gap: 6px;
}

.skeleton-tag {
    height: 22px;
    width: 60px;
    border-radius: 12px;
    background: var(--surface-1);
}

/* --- Skeleton Leaderboard Rows --- */
.skeleton-lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
}

.skeleton-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--surface-1);
    flex-shrink: 0;
}

.skeleton-name {
    height: 14px;
    flex: 1;
    border-radius: 6px;
    background: var(--surface-1);
}

.skeleton-stat {
    height: 14px;
    width: 60px;
    border-radius: 6px;
    background: var(--surface-1);
    flex-shrink: 0;
}

/* --- Skeleton Stats (Account page) --- */
.skeleton-stat-box {
    flex: 1;
    min-width: 80px;
    background: var(--surface-2);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.skeleton-stat-value {
    height: 28px;
    width: 48px;
    border-radius: 6px;
    background: var(--surface-1);
}

.skeleton-stat-label {
    height: 10px;
    width: 64px;
    border-radius: 4px;
    background: var(--surface-1);
}

/* --- Skeleton Achievement Badge --- */
.skeleton-achievement {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-2);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--surface-3);
}

.skeleton-ach-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--surface-1);
    flex-shrink: 0;
}

.skeleton-ach-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-ach-name {
    height: 14px;
    width: 120px;
    border-radius: 4px;
    background: var(--surface-1);
}

.skeleton-ach-desc {
    height: 10px;
    width: 180px;
    border-radius: 4px;
    background: var(--surface-1);
}

/* --- Skeleton Card Variants --- */
.skeleton-card-compact {
    height: 120px;
}

.skeleton-card-compact .skeleton-content {
    padding: var(--space-5);
}

.skeleton-card-compact .skeleton-tags {
    margin-top: var(--space-2);
}

.skeleton-tag-wide {
    width: 80px;
}

.skeleton-tag-narrow {
    width: 60px;
}
.skeleton-score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--surface-2);
    border-radius: var(--border-radius-sm);
}

.skeleton-score-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-score-name {
    height: 14px;
    width: 140px;
    border-radius: 4px;
    background: var(--surface-1);
}

.skeleton-score-diff {
    height: 10px;
    width: 80px;
    border-radius: 4px;
    background: var(--surface-1);
}

.skeleton-score-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.skeleton-score-time {
    height: 14px;
    width: 70px;
    border-radius: 4px;
    background: var(--surface-1);
}

.skeleton-score-date {
    height: 10px;
    width: 50px;
    border-radius: 4px;
    background: var(--surface-1);
}


/* ============================================
   Empty State Illustrations
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 16px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--accent-bg), rgba(59, 130, 246, 0.02));
    border: 1px solid var(--accent-bg-medium);
    color: var(--accent);
    margin-bottom: 4px;
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--accent);
    opacity: 0.8;
}

.empty-state-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.empty-state-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: 360px;
    line-height: 1.6;
}

.empty-state-action {
    margin-top: 8px;
}


/* ============================================
   Light Theme Component Refinements
   ============================================ */

/* Leaderboard columns get borders in light mode */
[data-theme="light"] .lb-column {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
}

/* Status bar gets subtle shadow */
[data-theme="light"] .status-bar {
    box-shadow: var(--shadow-xs);
}

/* Empty state icon gets a more visible background */
[data-theme="light"] .empty-state-icon {
    background: linear-gradient(135deg, var(--accent-bg-subtle), rgba(59, 130, 246, 0.02));
    border-color: var(--accent-border);
}

/* Skeleton shimmer uses lighter surface tones */
[data-theme="light"] .loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--surface-1) 25%,
        var(--surface-2) 50%,
        var(--surface-1) 75%
    );
    background-size: 200% 100%;
}

/* Modal dialog gets extra definition */
[data-theme="light"] .modal-dialog {
    border-color: var(--border-color);
}

/* Win modal content gets softer glow */
[data-theme="light"] .win-content {
    box-shadow: var(--shadow-lg);
}

/* Gauge widget container gets depth */
[data-theme="light"] .gauge-container {
    box-shadow: var(--shadow-xs);
}

/* Card image area in light theme — softer overlay */
[data-theme="light"] .card-overlay {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.03) 100%);
}


/* ============================================
   Skeleton Inline Utilities (Phase 27.3)
   Replace inline style="" on skeleton placeholders
   ============================================ */

/* Breadcrumb / small inline skeleton: 120×14 */
.skeleton-inline-sm {
    display: inline-block;
    width: 120px;
    height: 14px;
    vertical-align: middle;
}

/* Large inline skeleton: 280×28 (titles) */
.skeleton-inline-lg {
    display: inline-block;
    width: 280px;
    height: 28px;
    vertical-align: middle;
}

/* Medium inline skeleton: 260×28 (tournament names) */
.skeleton-inline-md {
    display: inline-block;
    width: 260px;
    height: 28px;
}

/* Profile name skeleton: 160×28 */
.skeleton-inline-name {
    display: inline-block;
    width: 160px;
    height: 28px;
}

/* Profile date skeleton: 120×14 */
.skeleton-inline-date {
    display: inline-block;
    width: 120px;
    height: 14px;
}

/* Profile stat skeleton (narrow): 24×18 */
.skeleton-inline-stat {
    display: inline-block;
    width: 24px;
    height: 18px;
}

/* Profile stat skeleton (wide): 50×18 */
.skeleton-inline-stat-wide {
    display: inline-block;
    width: 50px;
    height: 18px;
}

/* Partial-width skeleton meta line */
.skeleton-partial {
    width: 60%;
}

/* Full-width button utility */
.btn-full-width {
    width: 100%;
}

/* Grid full span utility */
.grid-full-span {
    grid-column: 1 / -1;
}

/* SVG completion ring transition */
.ring-transition {
    transition: stroke-dashoffset 1s ease-out;
}

/* Round config save button spacing */
.round-config-save-btn {
    margin-top: var(--space-3);
}

/* Compact empty state variant (for sidebar widgets, small sections) */
.empty-state-compact {
    padding: 20px 12px;
}

.empty-state-compact .empty-state-title {
    font-size: 0.95rem;
}

.empty-state-compact .empty-state-text {
    font-size: 0.8rem;
}

/* Smaller empty state icon variant */
.empty-state-icon-sm {
    width: 56px;
    height: 56px;
}

.empty-state-icon-sm svg {
    width: 28px;
    height: 28px;
}

} /* end @layer components */
