/* ============================================
   ChessNova Community Components
   Prefix: cn- (ChessNova)
   ============================================ */

/* --- Language Toggle (fixed top-right) --- */
.cn-lang-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(22, 33, 62, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.cn-lang-toggle:hover {
    background: rgba(22, 33, 62, 0.95);
    border-color: rgba(0, 217, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
}

.cn-lang-toggle .cn-lang-flag {
    font-size: 16px;
    line-height: 1;
}

.cn-lang-toggle .cn-lang-label {
    color: #eee;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* --- Auth Bar (fixed top-right, below lang toggle) --- */
.cn-auth-bar {
    position: fixed;
    top: 50px;
    right: 12px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(22, 33, 62, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 20px;
    padding: 5px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.3s ease;
}

.cn-auth-bar:hover {
    border-color: rgba(0, 217, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
}

.cn-auth-bar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.cn-auth-bar-name {
    color: #eee;
    font-size: 12px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cn-auth-bar-btn {
    background: none;
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: #00d9ff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.cn-auth-bar-btn:hover {
    background: rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.6);
}

.cn-auth-bar-btn--logout {
    color: #aaa;
    border-color: rgba(255, 255, 255, 0.15);
}

.cn-auth-bar-btn--logout:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

/* --- Auth Modal --- */
.cn-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cn-auth-overlay.cn-auth-overlay--open {
    opacity: 1;
    pointer-events: auto;
}

.cn-auth-modal {
    background: rgba(26, 26, 46, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    width: 380px;
    max-width: calc(100vw - 32px);
    padding: 0;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.cn-auth-overlay--open .cn-auth-modal {
    transform: translateY(0) scale(1);
}

.cn-auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cn-auth-modal-header h3 {
    margin: 0;
    color: #eee;
    font-size: 16px;
    font-weight: 600;
}

.cn-auth-modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.cn-auth-modal-close:hover {
    color: #fff;
}

.cn-auth-tabs {
    display: flex;
    background: rgba(22, 33, 62, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cn-auth-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: inherit;
}

.cn-auth-tab:hover {
    color: #ccc;
}

.cn-auth-tab.cn-auth-tab--active {
    color: #00d9ff;
    border-bottom-color: #00d9ff;
}

.cn-auth-form {
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 14px;
}

.cn-auth-form.cn-auth-form--active {
    display: flex;
}

.cn-auth-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: #eee;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.cn-auth-input:focus {
    border-color: rgba(0, 217, 255, 0.5);
}

.cn-auth-input::placeholder {
    color: #555;
}

.cn-auth-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 10px;
    padding: 11px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

.cn-auth-btn-primary:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.cn-auth-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cn-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #555;
    font-size: 12px;
}

.cn-auth-divider::before,
.cn-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.cn-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 16px;
    color: #ddd;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

.cn-google-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.cn-google-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.cn-auth-error {
    color: #ef4444;
    font-size: 12px;
    text-align: center;
    min-height: 16px;
}

/* --- Site Stats Section --- */
.cn-stats-section {
    max-width: 1400px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.cn-stats-title {
    text-align: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.cn-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.cn-stats-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s;
}

.cn-stats-card:hover {
    border-color: rgba(0, 217, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.cn-stats-card-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.cn-stats-card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #00d9ff;
    font-variant-numeric: tabular-nums;
}

.cn-stats-card-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 4px;
}

/* --- Bot Message in Chat --- */
.cn-msg--bot {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.25);
    color: #ddd;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.cn-msg--bot .cn-msg-author {
    color: #4CAF50;
}

/* --- Footer --- */
.cn-footer {
    background: rgba(22, 33, 62, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 217, 255, 0.15);
    padding: 18px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #aaa;
    font-size: 13px;
    margin-top: 40px;
}

.cn-footer-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cn-footer-stat .cn-stat-icon {
    font-size: 16px;
}

.cn-footer-stat .cn-stat-value {
    color: #00d9ff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cn-footer-brand {
    color: #667eea;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- Chat FAB (Floating Action Button) --- */
.cn-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.cn-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(102, 126, 234, 0.6);
}

.cn-fab.cn-fab--open {
    transform: rotate(45deg);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.cn-fab.cn-fab--open:hover {
    transform: rotate(45deg) scale(1.1);
}

/* --- Chat Panel --- */
.cn-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: 9998;
    width: 380px;
    max-width: calc(100vw - 48px);
    max-height: 520px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.cn-panel.cn-panel--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* --- Panel Header --- */
.cn-panel-header {
    padding: 14px 16px;
    background: rgba(22, 33, 62, 0.8);
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cn-panel-header h3 {
    margin: 0;
    color: #eee;
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

/* --- Tabs --- */
.cn-tabs {
    display: flex;
    background: rgba(22, 33, 62, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cn-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: inherit;
}

.cn-tab:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.03);
}

.cn-tab.cn-tab--active {
    color: #00d9ff;
    border-bottom-color: #00d9ff;
}

/* --- Tab Content Area --- */
.cn-tab-content {
    flex: 1;
    overflow-y: auto;
    display: none;
}

.cn-tab-content.cn-tab-content--active {
    display: flex;
    flex-direction: column;
}

/* Scrollbar */
.cn-tab-content::-webkit-scrollbar {
    width: 4px;
}

.cn-tab-content::-webkit-scrollbar-track {
    background: transparent;
}

.cn-tab-content::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.2);
    border-radius: 2px;
}

/* --- Chat Messages --- */
.cn-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
    max-height: 320px;
}

.cn-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.cn-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.2);
    border-radius: 2px;
}

.cn-msg {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.cn-msg--other {
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: #ddd;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.cn-msg--self {
    background: rgba(0, 217, 255, 0.15);
    border: 1px solid rgba(0, 217, 255, 0.2);
    color: #eee;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.cn-msg-author {
    font-size: 11px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 2px;
}

.cn-msg-time {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    text-align: right;
}

.cn-chat-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #666;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* --- Chat Input --- */
.cn-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(22, 33, 62, 0.5);
}

.cn-chat-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 14px;
    color: #eee;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.cn-chat-input input:focus {
    border-color: rgba(0, 217, 255, 0.4);
}

.cn-chat-input input::placeholder {
    color: #555;
}

.cn-chat-input button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.cn-chat-input button:hover {
    transform: scale(1.1);
}

.cn-chat-input button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* --- Auth Notice --- */
.cn-auth-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
    gap: 12px;
    flex: 1;
}

.cn-auth-notice .cn-auth-icon {
    font-size: 32px;
}

/* --- Suggestions Form --- */
.cn-suggest-form {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cn-suggest-form label {
    color: #aaa;
    font-size: 12px;
    font-weight: 500;
}

.cn-suggest-form select,
.cn-suggest-form textarea {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: #eee;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.cn-suggest-form select:focus,
.cn-suggest-form textarea:focus {
    border-color: rgba(0, 217, 255, 0.4);
}

.cn-suggest-form textarea {
    resize: vertical;
    min-height: 80px;
}

.cn-suggest-form select option {
    background: #1a1a2e;
    color: #eee;
}

/* --- Star Rating --- */
.cn-stars {
    display: flex;
    gap: 4px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.cn-stars input {
    display: none;
}

.cn-stars label {
    font-size: 22px;
    color: #444;
    cursor: pointer;
    transition: color 0.15s;
}

.cn-stars label:hover,
.cn-stars label:hover ~ label,
.cn-stars input:checked ~ label {
    color: #f59e0b;
}

/* --- Submit Button --- */
.cn-btn-submit {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.cn-btn-submit:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.cn-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Toast Notification --- */
.cn-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(16, 185, 129, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.cn-toast.cn-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cn-toast.cn-toast--error {
    background: rgba(239, 68, 68, 0.9);
}

/* --- FAQ --- */
.cn-faq-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cn-faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cn-faq-item:hover {
    border-color: rgba(0, 217, 255, 0.15);
}

.cn-faq-q {
    padding: 10px 14px;
    color: #ddd;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.cn-faq-q::after {
    content: '\25BC';
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.cn-faq-item.cn-faq-item--open .cn-faq-q::after {
    transform: rotate(180deg);
}

.cn-faq-a {
    padding: 0 14px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.25s ease;
    color: #999;
    font-size: 12px;
    line-height: 1.5;
}

.cn-faq-item.cn-faq-item--open .cn-faq-a {
    padding: 0 14px 12px;
    max-height: 200px;
}

.cn-faq-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* --- Suggestion Success --- */
.cn-suggest-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    gap: 8px;
}

.cn-suggest-success .cn-success-icon {
    font-size: 36px;
}

.cn-suggest-success p {
    color: #10b981;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

/* --- Auth Bar — clickable cursor when logged in --- */
.cn-auth-bar.cn-auth-bar--clickable {
    cursor: pointer;
}

/* --- Challenge Badge on auth bar --- */
.cn-challenge-badge {
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: cn-pulse 1.5s infinite;
}

@keyframes cn-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* --- Online Players Panel --- */
.cn-players-panel {
    position: fixed;
    top: 100px;
    right: 12px;
    z-index: 9997;
    width: 260px;
    max-height: 420px;
    background: rgba(22, 33, 62, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.cn-players-panel.cn-players-panel--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cn-players-panel-header {
    padding: 12px 14px 10px;
    background: rgba(22, 33, 62, 0.8);
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    color: #eee;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cn-players-panel-header span {
    color: #00d9ff;
    font-size: 11px;
    font-weight: 400;
}

/* --- Status Buttons Row --- */
.cn-status-btns {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(22, 33, 62, 0.5);
}

.cn-status-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 5px 4px;
    color: #aaa;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
    white-space: nowrap;
}

.cn-status-btn:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.3);
    color: #eee;
}

.cn-status-btn.cn-status-btn--active {
    background: rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.5);
    color: #00d9ff;
}

/* --- Players List --- */
.cn-players-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    max-height: 300px;
}

.cn-players-list::-webkit-scrollbar {
    width: 4px;
}

.cn-players-list::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.2);
    border-radius: 2px;
}

/* --- Player Row --- */
.cn-player-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.cn-player-row:hover {
    background: rgba(0, 217, 255, 0.07);
}

.cn-player-row-name {
    color: #ddd;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.cn-players-empty {
    padding: 20px 14px;
    color: #666;
    font-size: 12px;
    text-align: center;
}

/* --- Status Dot --- */
.cn-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cn-status-dot--dispo {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.cn-status-dot--occupe {
    background: #eab308;
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
}

.cn-status-dot--offline {
    background: #555;
}

/* --- Context Menu --- */
.cn-context-menu {
    position: fixed;
    z-index: 10005;
    background: rgba(22, 33, 62, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    padding: 6px 0;
    min-width: 190px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: cn-ctx-in 0.15s ease;
}

@keyframes cn-ctx-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.cn-context-menu-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 9px 16px;
    color: #ddd;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
    white-space: nowrap;
}

.cn-context-menu-item:hover {
    background: rgba(0, 217, 255, 0.1);
    color: #fff;
}

/* --- Challenge Popup --- */
.cn-challenge-popup {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 10006;
    background: rgba(22, 33, 62, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    padding: 20px 22px;
    width: 300px;
    max-width: calc(100vw - 32px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cn-challenge-popup.cn-challenge-popup--open {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.cn-challenge-popup-title {
    color: #00d9ff;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
}

.cn-challenge-popup-body {
    color: #ccc;
    font-size: 13px;
    margin: 0 0 16px;
}

.cn-challenge-popup-btns {
    display: flex;
    gap: 8px;
}

.cn-challenge-popup-btns button {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.cn-challenge-accept {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
}

.cn-challenge-accept:hover {
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.cn-challenge-decline {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #aaa;
}

.cn-challenge-decline:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .cn-panel {
        right: 8px;
        bottom: 80px;
        width: calc(100vw - 16px);
        max-height: 70vh;
    }

    .cn-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .cn-footer {
        padding: 14px 16px;
        gap: 16px;
        font-size: 12px;
    }

    .cn-lang-toggle {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
    }

    .cn-auth-bar {
        top: 44px;
        right: 8px;
        left: auto;
        padding: 4px 8px;
    }

    .cn-auth-modal {
        width: calc(100vw - 24px);
    }

    .cn-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
