

:root {
    /* Bookclub-specific design tokens (supplements main.css vars) */
    --color-bg-hero:     #2c1810;
    --color-surface:     #eeebe4;
    --color-border-light:#ece9e2;

    --color-text-primary:  #1a1410;
    --color-text-secondary:#5a524a;
    --color-text-muted:    #8a8078;
    --color-text-on-dark:  #f5f2ec;

    --color-accent:        #c0392b;
    --color-accent-hover:  #a93226;
    --color-accent-light:  #f9ebe9;
    --color-secondary:     #2c3e50;
    --color-secondary-hover: #1a252f;
    --color-gold:          #c9a84c;
    --color-success:       #27ae60;
    --color-error:         #e74c3c;

    --font-display: var(--font-serif);
    --font-body:    var(--font-sans);

    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-full: 9999px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:  0 8px 24px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl:  0 16px 48px rgba(0,0,0,0.18), 0 8px 16px rgba(0,0,0,0.08);

    --content-max: 1200px;

    --transition: 0.2s ease;
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    --color-surface:       #2a2520;
    --color-border-light:  #2a2520;
    --color-text-primary:  #f0ede6;
    --color-text-secondary:#a09880;
    --color-text-muted:    #706860;
    --color-accent-light:  #2a1510;
}


.clubs-page-inner .btn,
.clubs-hero .btn,
.create-club-panel .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    line-height: 1;
}
.clubs-page-inner .btn:active,
.clubs-hero .btn:active,
.create-club-panel .btn:active { transform: translateY(1px); }
.clubs-page-inner .btn:disabled,
.clubs-hero .btn:disabled,
.create-club-panel .btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.btn-primary:hover:not(:disabled) {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    box-shadow: 0 4px 12px rgba(192,57,43,0.3);
}

.btn-secondary {
    background: var(--color-secondary);
    color: #fff;
    border-color: var(--color-secondary);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--color-secondary-hover);
    border-color: var(--color-secondary-hover);
}

.btn-outline {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--border, var(--color-border-light));
}
.btn-outline:hover:not(:disabled) {
    background: var(--color-surface);
    border-color: var(--color-text-secondary);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}
.btn-ghost:hover:not(:disabled) {
    color: var(--color-text-primary);
    background: var(--color-surface);
}

.btn-join {
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.btn-join:hover:not(:disabled) {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(192,57,43,0.25);
}

.btn-joined {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}
.btn-joined:hover:not(:disabled) {
    background: #219150;
    border-color: #219150;
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-large { padding: 0.75rem 1.75rem; font-size: 1rem; }


.clubs-hero {
    position: relative;
    background: var(--color-bg-hero);
    color: var(--color-text-on-dark);
    padding: var(--space-3xl) var(--space-xl);
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(135deg, #2c1810 0%, #1a1008 40%, #0d1520 100%);
    background-size: 60px 60px, 100%;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}
.clubs-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}
.hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.85;
    max-width: 500px;
    margin-bottom: var(--space-xl);
    color: #d4c9bb;
}
.hero-actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }

.clubs-page-inner {
    padding: var(--space-2xl) var(--space-xl);
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}


.clubs-section { margin-bottom: var(--space-3xl); }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.section-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.section-icon {
    font-size: 1.2rem;
    line-height: 1;
    color: var(--color-text-secondary);
    width: 1.4em;
    text-align: center;
}
.section-title-group h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}
.see-all-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity var(--transition);
}
.see-all-link:hover { opacity: 0.75; }

.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.club-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
    display: flex;
    flex-direction: column;
}
body.dark-mode .club-card {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
.club-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.club-card-thumbnail {
    width: 100%;
    height: 130px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0;
    transition: filter var(--transition);
    text-decoration: none;
}
.club-card-thumbnail:hover .club-thumb-overlay { opacity: 1; }
.club-card-thumbnail:hover { filter: brightness(0.9); }

.club-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity var(--transition);
    text-transform: uppercase;
}

.club-card-body {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.club-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.club-card-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}
.club-name-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: var(--color-text-primary);
    text-align: left;
    padding: 0;
    line-height: inherit;
    transition: color var(--transition);
    text-decoration: none;
}
.club-name-btn:hover { color: var(--color-accent); }

.club-genre-badge {
    display: inline-block;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.club-card-desc {
    font-size: 0.83rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.club-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.club-meta-row { display: flex; gap: var(--space-sm); align-items: center; }
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.rating-chip { color: var(--color-gold); }
.club-card-actions { display: flex; align-items: center; gap: var(--space-xs); }

/* ── Club card reading preview ── */
.club-card-reading {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    padding: 4px 8px;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.reading-label {
    font-size: 0.85rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
    width: 1.2em;
    text-align: center;
}
.reading-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

.filter-bar {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}
.filter-select {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--border, var(--color-border-light));
    border-radius: var(--radius-full);
    background: var(--bg-card, #fff);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8078' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2rem;
}
body.dark-mode .filter-select {
    background-color: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}
.filter-select:focus { border-color: var(--color-accent); }


.clubs-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.club-list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    background: var(--bg-card, #fff);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-slow), transform var(--transition-slow), opacity 0.3s ease;
}
body.dark-mode .club-list-item {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
.club-list-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(3px);
}

.club-list-thumbnail {
    width: 72px; height: 72px;
    min-width: 72px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition);
    flex-shrink: 0;
}
.club-list-thumbnail:hover { transform: scale(1.05); }
.club-list-thumbnail:hover .club-thumb-view-overlay { opacity: 1; }

.club-thumb-view-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.club-list-info { flex: 1; min-width: 0; }
.club-list-top {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
    flex-wrap: wrap;
}
.club-list-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }

.club-name-link {
    color: var(--color-text-primary);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    transition: color var(--transition);
}
.club-name-link:hover { color: var(--color-accent); }

.club-list-desc {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.club-list-meta {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}
.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.activity-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.activity-very-active  { background: #eafaf1; color: #1a6b3a; }
.activity-active        { background: #eaf4fb; color: #1a5276; }
.activity-moderately-active { background: #fef9e7; color: #7d6608; }

body.dark-mode .activity-very-active { background: #0a2a10; color: #5dbe7d; }
body.dark-mode .activity-active { background: #0a1a2a; color: #5da5d5; }
body.dark-mode .activity-moderately-active { background: #2a2010; color: #d4a84c; }

.club-list-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--color-gold);
    font-size: 0.85rem;
    font-weight: 700;
}

.club-list-btn-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    align-items: flex-end;
}


.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 300;
    backdrop-filter: blur(2px);
}
.modal-backdrop.active { display: block; }

dialog.modal {
    position: fixed;
    inset: 0;
    margin: auto;
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    background: var(--bg-card, #fff);
    color: var(--color-text-primary);
    z-index: 400;
    padding: 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
body.dark-mode dialog.modal {
    background: #1e1a15;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

dialog.modal:not([open]) { display: none; }

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: var(--radius-full);
    width: 36px; height: 36px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-on-dark);
    z-index: 10;
    transition: background var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.25); }

.club-detail-modal { width: min(560px, 95vw); }
.modal-club-hero {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
}

.modal-body { padding: var(--space-xl); }

.modal-club-meta {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}
.modal-genre-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.modal-activity { font-size: 0.8rem; font-weight: 600; }

.modal-club-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.modal-club-desc {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-bottom: var(--space-xl);
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: center;
}
.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-primary);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-primary);
}

.current-book-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
}
.book-spine {
    width: 14px;
    height: 56px;
    border-radius: 2px;
    flex-shrink: 0;
}
.book-info { display: flex; flex-direction: column; }

.modal-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}


.create-club-panel {
    background: var(--bg-card, #fff);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: 0;
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                padding 0.3s ease,
                margin 0.3s ease;
}
body.dark-mode .create-club-panel {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
.create-club-panel.is-open {
    max-height: 1200px;
    opacity: 1;
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.create-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}
.create-panel-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-primary);
}
.create-panel-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
    line-height: 1.5;
}
.create-panel-close {
    background: var(--color-surface);
    border: none;
    border-radius: var(--radius-full);
    width: 36px; height: 36px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-secondary);
    transition: background var(--transition);
    flex-shrink: 0;
}
.create-panel-close:hover {
    background: var(--color-border-light);
}


.create-club-form { display: flex; flex-direction: column; gap: var(--space-lg); }

.form-group { display: flex; flex-direction: column; gap: var(--space-xs); }

.form-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text-primary);
}
.required { color: var(--color-accent); margin-left: 2px; }
.optional { color: var(--color-text-muted); font-weight: 400; font-size: 0.8rem; }

.form-input {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.6rem var(--space-md);
    border: 1.5px solid var(--border, var(--color-border-light));
    border-radius: var(--radius-md);
    background: var(--bg, #f5f2ec);
    color: var(--color-text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}
body.dark-mode .form-input {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}
.form-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
    outline: none;
}
.form-input::placeholder { color: var(--color-text-muted); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
select.form-input { appearance: none; cursor: pointer; }

.form-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
.form-hint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.char-count {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}
@media (max-width: 500px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }


.create-preview {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}
.create-preview-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}
.create-preview-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.preview-thumb {
    width: 56px; height: 56px; min-width: 56px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #2a2a2a, #4a4a4a);
    transition: background 0.4s ease;
    color: rgba(255,255,255,0.92);
}
.preview-info { flex: 1; min-width: 0; }
.preview-info strong {
    display: block;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--color-text-primary);
}
.preview-info p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}

.form-message {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: var(--space-md);
}
.form-message[hidden] { display: none; }
.form-message.success {
    background: #eafaf1;
    border: 1px solid #a9dfbf;
    color: #1d6a3a;
}
.form-message.error {
    background: #fdf0ef;
    border: 1px solid #f5b7b1;
    color: #943126;
}
body.dark-mode .form-message.success { background: #0a2a10; border-color: #1a4a25; color: #5dbe7d; }
body.dark-mode .form-message.error { background: #2a0a0a; border-color: #4a1515; color: #e07060; }

.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-secondary);
    color: #fff;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 600;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-error); }


.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}
.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-card, #fff);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
body.dark-mode .stat-card {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    color: var(--color-text-secondary);
    width: 1.5em;
    text-align: center;
}
.stat-card-info { display: flex; flex-direction: column; }
.stat-card-number {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text-primary);
}
.stat-card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .stats-dashboard { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
    .stats-dashboard { grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
    .stat-card { padding: var(--space-sm) var(--space-md); }
    .stat-card-number { font-size: 1.1rem; }
}


.fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), transform var(--transition);
}
.fav-btn:hover { color: var(--color-accent); transform: scale(1.15); }
.fav-btn.is-fav { color: var(--color-accent); }

.club-list-actions-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}


.filter-search-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, var(--color-border-light));
    border-radius: var(--radius-full);
    padding: var(--space-xs) var(--space-md);
    transition: border-color var(--transition), box-shadow var(--transition);
}
body.dark-mode .filter-search-wrap {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}
.filter-search-wrap:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
.filter-search-wrap svg { color: var(--color-text-muted); flex-shrink: 0; }
.filter-search {
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-primary);
    width: 130px;
    min-width: 0;
}
.filter-search::placeholder { color: var(--color-text-muted); }

.filter-results-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-accent-light);
    border-radius: var(--radius-md);
}
.filter-results-info[hidden] { display: none; }

.btn-xs { padding: 2px 8px; font-size: 0.75rem; }


.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--color-text-secondary);
}
.empty-state[hidden] { display: none; }
.empty-state-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: var(--space-md);
    color: var(--color-text-muted);
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}
.empty-state p { margin-bottom: var(--space-lg); }


.club-new-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-success), #2ecc71);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
}
body.dark-mode .club-new-badge {
    background: linear-gradient(135deg, #1a6b3a, #219150);
}
body.dark-mode .founder-badge { background: #2a2010; color: #d4a84c; }
body.dark-mode .mod-badge { background: #0a2030; color: #5da5d5; }

.delete-club-btn {
    color: var(--color-text-muted) !important;
    font-size: 0.75rem !important;
    padding: 2px 6px !important;
}
.delete-club-btn:hover:not(:disabled) {
    color: var(--color-error) !important;
    background: rgba(231,76,60,0.08) !important;
}

.hero-search {
    position: relative;
    max-width: 560px;
    margin-bottom: var(--space-xl);
    z-index: 10;
}
.hero-search-inner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-lg);
    backdrop-filter: blur(8px);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.hero-search-inner:focus-within {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.08);
}
.hero-search-inner svg { color: rgba(255,255,255,0.6); flex-shrink: 0; }
.hero-search-inner input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #fff;
    min-width: 0;
}
.hero-search-inner input::placeholder { color: rgba(255,255,255,0.55); }
.search-shortcut {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    line-height: 1;
    flex-shrink: 0;
}
.search-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: var(--radius-full);
    transition: color var(--transition), background var(--transition);
}
.search-clear:hover { color: #fff; background: rgba(255,255,255,0.15); }

.search-results {
    position: absolute;
    top: calc(100% + var(--space-sm));
    left: 0;
    right: 0;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, var(--color-border-light));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 380px;
    overflow-y: auto;
    z-index: 100;
}
body.dark-mode .search-results {
    background: #1e1a15;
    border-color: rgba(255,255,255,0.12);
}
.search-results[hidden] { display: none; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    text-decoration: none;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus {
    background: var(--color-surface);
    outline: none;
}
.search-result-thumb {
    width: 40px; height: 40px; min-width: 40px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: rgba(255,255,255,0.92);
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}
.search-result-info mark {
    background: rgba(192,57,43,0.15);
    color: var(--color-accent);
    border-radius: 2px;
    padding: 0 2px;
}
body.dark-mode .search-result-info mark {
    background: rgba(192,57,43,0.25);
}
.search-result-meta {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}
.search-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-text-secondary);
}
.search-empty p { margin-bottom: var(--space-md); }


.my-clubs-strip {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.my-club-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-card, #fff);
    border: 1.5px solid var(--border, var(--color-border-light));
    border-radius: var(--radius-full);
    padding: 6px 14px 6px 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
body.dark-mode .my-club-chip {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}
.my-club-chip:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(192,57,43,0.15);
    transform: translateY(-1px);
}
.my-club-icon {
    width: 26px; height: 26px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.my-club-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-club-dot { font-size: 0.5rem; }
.activity-dot-very-active  { color: var(--color-success); }
.activity-dot-active        { color: #2980b9; }
.activity-dot-moderately-active { color: #f39c12; }


.scroll-top-btn {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 44px; height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: background var(--transition), transform var(--transition), opacity var(--transition);
}
.scroll-top-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
}
.scroll-top-btn[hidden] { display: none; }


/* ── Font Awesome genre icons ── */
.club-thumb-icon {
    font-size: 2.8rem;
    color: rgba(255,255,255,0.92);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
    z-index: 1;
    transition: transform var(--transition);
}
.club-card:hover .club-thumb-icon,
.club-list-thumbnail:hover .club-thumb-icon { transform: scale(1.1); }

.club-chip-icon {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
}

.club-hero-fa-icon {
    font-size: 4rem;
    color: rgba(255,255,255,0.95);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.clubs-section {
    animation: sectionFadeIn 0.4s ease both;
}
@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.clubs-section:nth-child(2) { animation-delay: 0.05s; }
.clubs-section:nth-child(3) { animation-delay: 0.1s; }
.clubs-section:nth-child(4) { animation-delay: 0.15s; }
.clubs-section:nth-child(5) { animation-delay: 0.2s; }
.clubs-section:nth-child(6) { animation-delay: 0.25s; }

@media (max-width: 900px) {
    .clubs-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 640px) {
    .clubs-page-inner { padding: var(--space-xl) var(--space-md); }
    .clubs-hero { padding: var(--space-2xl) var(--space-md); }
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .clubs-grid { grid-template-columns: 1fr 1fr; gap: var(--space-md); }
    .club-list-item { flex-direction: column; gap: var(--space-md); }
    .club-list-actions { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }
    .modal-stats { grid-template-columns: repeat(3, 1fr); }
    .clubs-section { margin-bottom: var(--space-2xl); }
    .section-title-group h2 { font-size: 1.2rem; }
    .hero-search { max-width: 100%; }
    .hero-search-inner { padding: var(--space-xs) var(--space-md); }
    .search-shortcut { display: none; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-search-wrap { width: 100%; }
    .filter-search { width: 100%; }
    .club-list-actions-top { justify-content: space-between; }
}

@media (max-width: 480px) {
    .clubs-grid { grid-template-columns: 1fr; }
    .modal-actions { flex-direction: column; }
    .modal-actions .btn { width: 100%; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; justify-content: center; }
}

@media print {
    .hero-search, .filter-bar, .scroll-top-btn,
    .fav-btn, .delete-club-btn, .btn-join, .btn-joined,
    .create-club-panel { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
