/* ==================== Dashboard Layout ==================== */

/* Override screen padding for dashboard */
#lobby-screen.screen {
    padding: 0;
    background: #0b1120;
}

/* ==================== Top Navbar ==================== */
.dash-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    background: #111827;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.dash-nav-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.dash-nav-subtitle {
    font-size: 0.7rem;
    color: #6b7280;
    font-style: italic;
    margin-top: -2px;
}

.dash-nav-search {
    flex: 0 1 400px;
    position: relative;
}

.dash-nav-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    color: #e5e7eb;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.dash-nav-search input:focus {
    outline: none;
    border-color: #f59e0b;
}

.dash-nav-search input::placeholder {
    color: #6b7280;
}

.dash-nav-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.9rem;
}

.dash-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-nav-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
    color: #9ca3af;
}

.dash-nav-icon-btn:hover {
    background: #374151;
}

.dash-nav-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: #1f2937;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: background 0.2s;
}

.dash-nav-user:hover {
    background: #374151;
}

.dash-nav-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.dash-nav-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #111827;
}

.dash-nav-user-info {
    text-align: right;
}

.dash-nav-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-nav-user-level {
    font-size: 0.7rem;
    color: #22c55e;
}

/* ==================== Dashboard Body ==================== */
.dash-body {
    display: flex;
    gap: 24px;
    padding: 28px 32px;
    max-width: 1440px;
    margin: 0 auto;
    min-height: calc(100vh - 65px);
}

/* ==================== Left Sidebar ==================== */
.dash-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Stats Card */
.dash-stats-card {
    background: #111827;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 24px;
}

.dash-stats-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 20px;
}

.dash-stats-title-icon {
    color: #f59e0b;
}

.dash-stats-grid {
    display: flex;
    gap: 12px;
}

.dash-stat-item {
    flex: 1;
    text-align: center;
    padding: 16px 8px;
    background: #1f2937;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.04);
}

.dash-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1rem;
}

.dash-stat-icon.trend { background: rgba(34,197,94,0.15); color: #22c55e; }
.dash-stat-icon.target { background: rgba(59,130,246,0.15); color: #3b82f6; }
.dash-stat-icon.bolt { background: rgba(245,158,11,0.15); color: #f59e0b; }

.dash-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.dash-stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 2px;
}

.dash-stat-change {
    font-size: 0.7rem;
    font-weight: 600;
    color: #22c55e;
    margin-top: 4px;
}

/* Friends Card */
.dash-friends-card {
    background: #111827;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 24px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dash-friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dash-friends-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
}

.dash-friends-count {
    font-size: 0.8rem;
    color: #22c55e;
    font-weight: 500;
}

.dash-friends-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}

.dash-friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.15s;
    cursor: pointer;
}

.dash-friend-item:hover {
    background: #1f2937;
}

.dash-friend-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dash-friend-info {
    flex: 1;
    min-width: 0;
}

.dash-friend-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-friend-status {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dash-friend-status .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.dash-friend-status .status-dot.online { background: #22c55e; }
.dash-friend-status .status-dot.playing { background: #f59e0b; }
.dash-friend-status .status-dot.offline { background: #6b7280; }

.dash-friend-status .status-text.online { color: #22c55e; }
.dash-friend-status .status-text.playing { color: #f59e0b; }
.dash-friend-status .status-text.offline { color: #6b7280; }

/* ==================== Main Content ==================== */
.dash-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.dash-main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.dash-main-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.dash-main-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 4px;
}

.dash-btn-create {
    padding: 12px 24px;
    background: transparent;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    color: #f59e0b;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-btn-create:hover {
    background: rgba(245,158,11,0.1);
    transform: translateY(-1px);
}

/* Rejoin Banner */
.dash-rejoin-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: 12px;
}

.dash-rejoin-banner span {
    font-weight: 500;
    color: #4ade80;
}

.dash-rejoin-actions {
    display: flex;
    gap: 8px;
}

/* Featured Banner */
.dash-featured-banner {
    background: linear-gradient(135deg, #3b1f6e 0%, #1e1145 30%, #4a1942 60%, #c2410c 100%);
    border-radius: 16px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 130px;
}

.dash-featured-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.dash-featured-badges {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.dash-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-badge.special {
    background: rgba(239,68,68,0.2);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.3);
}

.dash-badge.live {
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-badge.live::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.dash-featured-icon {
    font-size: 3.5rem;
    margin-right: 24px;
    flex-shrink: 0;
}

.dash-featured-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.dash-featured-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.dash-featured-desc {
    font-size: 0.85rem;
    color: #d1d5db;
    margin-bottom: 8px;
}

.dash-featured-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: #9ca3af;
}

.dash-featured-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dash-featured-cta {
    position: relative;
    z-index: 1;
    margin-left: auto;
    padding: 14px 28px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border: none;
    border-radius: 28px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.dash-featured-cta:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(245,158,11,0.3);
}

/* ==================== Room Cards Grid ==================== */
.dash-rooms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.dash-room-card {
    background: #111827;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s, transform 0.15s;
}

.dash-room-card:hover {
    border-color: rgba(245,158,11,0.3);
    transform: translateY(-2px);
}

.dash-room-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.dash-room-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-room-live-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(34,197,94,0.15);
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-room-live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 1.5s infinite;
}

.dash-room-waiting-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-room-type {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

.dash-room-lock {
    color: #f59e0b;
    font-size: 1.1rem;
}

.dash-room-stats {
    display: flex;
    gap: 12px;
}

.dash-room-stat {
    flex: 1;
    padding: 10px 12px;
    background: #1f2937;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
}

.dash-room-stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.dash-room-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.dash-room-stat-value .current {
    color: #fff;
}

.dash-room-stat-value .max {
    color: #6b7280;
}

.dash-room-stat-value.highlight {
    color: #f59e0b;
}

.dash-room-join-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.dash-room-join-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}

.dash-room-join-btn .arrow {
    font-size: 1.1rem;
    transition: transform 0.15s;
}

.dash-room-join-btn:hover .arrow {
    transform: translateX(3px);
}

.dash-rooms-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
    font-size: 1rem;
    background: #111827;
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.1);
}

.dash-rooms-empty p {
    margin-bottom: 16px;
}

/* ==================== Back Button (bottom) ==================== */
.dash-back-btn {
    padding: 10px 20px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    align-self: flex-start;
    margin-top: 8px;
}

.dash-back-btn:hover {
    background: #374151;
    color: #e5e7eb;
}

/* ==================== Scrollbar ==================== */
.dash-friends-list::-webkit-scrollbar {
    width: 4px;
}

.dash-friends-list::-webkit-scrollbar-track {
    background: transparent;
}

.dash-friends-list::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 2px;
}

/* ==================== Responsive ==================== */
@media (max-width: 1100px) {
    .dash-rooms-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .dash-body {
        flex-direction: column;
        padding: 16px;
    }
    
    .dash-sidebar {
        width: 100%;
        flex-direction: row;
        gap: 16px;
    }
    
    .dash-stats-card,
    .dash-friends-card {
        flex: 1;
    }
    
    .dash-friends-card {
        max-height: 250px;
    }
    
    .dash-navbar {
        padding: 10px 16px;
    }
    
    .dash-nav-search {
        display: none;
    }

    .auth-modal-content {
        margin: 16px;
        max-width: none;
        width: calc(100% - 32px);
    }
}

@media (max-width: 640px) {
    .dash-sidebar {
        flex-direction: column;
    }
    
    .dash-stats-grid {
        gap: 8px;
    }
    
    .dash-main-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .dash-btn-create {
        width: 100%;
        justify-content: center;
    }
    
    .dash-nav-user-info {
        display: none;
    }
}

/* ==================== Room Code Badge ==================== */
.dash-room-code {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* ==================== Auth Modal ==================== */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-modal-overlay.hidden {
    display: none;
}

.auth-modal-content {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
    animation: authModalIn 0.3s ease;
}

@keyframes authModalIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-modal-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.auth-modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.auth-modal-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
    margin: 4px 0 0;
}

/* Auth tabs inside modal */
.auth-modal-content .auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #1f2937;
    padding: 4px;
    border-radius: 12px;
}

.auth-modal-content .auth-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.auth-modal-content .auth-tab:hover {
    color: #e5e7eb;
}

.auth-modal-content .auth-tab.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

/* Auth forms inside modal */
.auth-modal-content .auth-form {
    display: none;
    animation: fadeIn 0.25s ease;
}

.auth-modal-content .auth-form.active {
    display: block;
}

.auth-modal-content .input-group {
    margin-bottom: 16px;
}

.auth-modal-content .input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 6px;
}

.auth-modal-content .input-group input {
    width: 100%;
    padding: 12px 16px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #e5e7eb;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-modal-content .input-group input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.auth-modal-content .input-group input::placeholder {
    color: #6b7280;
}

.auth-modal-content .btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.auth-modal-content .btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.auth-modal-content .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}

.auth-modal-content .btn-secondary {
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e5e7eb;
}

.auth-modal-content .btn-secondary:hover {
    background: #374151;
}

/* Error/success in modal */
.auth-modal-content .auth-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.auth-modal-content .auth-success {
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.3);
    color: #4ade80;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

/* Spinner inside modal */
.auth-modal-content .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
}

/* ==================== Guest Prompt Cards (Sidebar) ==================== */
.dash-guest-prompt {
    text-align: center;
    padding: 32px 24px;
}

.dash-guest-prompt-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.dash-guest-prompt-text {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 16px;
    line-height: 1.4;
}

.dash-guest-prompt .btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.dash-guest-prompt .btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.dash-guest-prompt .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}

/* ==================== Shared Page Layout (Rules & Profile) ==================== */
.dash-page.screen {
    padding: 0;
    background: #0b1120;
}

.dash-page-body {
    padding: 32px;
    max-width: 1100px;
    margin: 0 auto;
    min-height: calc(100vh - 65px);
}

.dash-page-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dash-page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

/* Shared Card Style */
.dash-card {
    background: #111827;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 24px;
}

.dash-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 12px;
}

.dash-card h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 16px;
}

.dash-card p {
    color: #9ca3af;
    line-height: 1.7;
    margin-bottom: 8px;
}

.dash-card p:last-child {
    margin-bottom: 0;
}

.dash-card strong {
    color: #e5e7eb;
}

.dash-card ul {
    color: #9ca3af;
    line-height: 1.7;
    padding-left: 20px;
    margin-bottom: 8px;
}

.dash-card li {
    margin-bottom: 4px;
}

.dash-highlight {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
    color: #e5e7eb;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* ==================== Rules Page ==================== */
.dash-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .dash-rules-grid {
        grid-template-columns: 1fr;
    }
    .dash-page-body {
        padding: 16px;
    }
}

/* ==================== Profile Page ==================== */
.dash-profile-info-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dash-profile-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dash-profile-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.dash-profile-details {
    flex: 1;
}

.dash-profile-details .profile-display-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.dash-profile-details h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0;
}

.dash-btn-edit {
    padding: 5px 12px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #9ca3af;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.dash-btn-edit:hover {
    background: #374151;
    color: #e5e7eb;
}

.dash-name-editor {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.dash-name-editor input {
    flex: 1;
    padding: 8px 12px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.9rem;
}

.dash-name-editor input:focus {
    outline: none;
    border-color: #f59e0b;
}

.dash-btn-save {
    padding: 8px 16px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.dash-btn-cancel {
    padding: 8px 16px;
    background: #374151;
    border: none;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: pointer;
}

.dash-profile-username {
    color: #6b7280;
    font-size: 0.9rem;
}

.dash-profile-member-since {
    font-size: 0.8rem;
    color: #4b5563;
    margin-top: 2px;
    display: block;
}

.dash-profile-logout-row {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.dash-btn-logout {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 10px;
    color: #f87171;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Profile Stats Grid */
.dash-profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.dash-profile-stat-card {
    background: #111827;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 20px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color 0.2s;
}

.dash-profile-stat-card:hover {
    border-color: rgba(245,158,11,0.3);
}

.dash-profile-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.dash-profile-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Profile Bottom Grid */
.dash-profile-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dash-profile-history,
.dash-profile-leaderboard {
    max-height: 350px;
    overflow-y: auto;
}

.dash-lb-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.dash-lb-tabs .lb-tab {
    padding: 6px 14px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.dash-lb-tabs .lb-tab.active {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.3);
    color: #f59e0b;
}

.dash-lb-tabs .lb-tab:hover:not(.active) {
    background: #374151;
    color: #e5e7eb;
}

@media (max-width: 900px) {
    .dash-profile-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .dash-profile-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dash-profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-profile-top {
        flex-direction: column;
        text-align: center;
    }
    .dash-profile-details .profile-display-name-row {
        justify-content: center;
    }
}

/* ==================== Friends System ==================== */

/* Friends Search */
.dash-friends-search {
    position: relative;
    margin-bottom: 12px;
}

.dash-friends-search input {
    width: 100%;
    padding: 8px 12px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #e5e7eb;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.dash-friends-search input:focus {
    outline: none;
    border-color: #f59e0b;
}

.dash-friends-search input::placeholder {
    color: #6b7280;
}

.dash-friends-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    margin-top: 4px;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.dash-friend-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.dash-friend-search-item:hover {
    background: #374151;
}

.dash-friend-add-icon {
    margin-left: auto;
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 600;
    white-space: nowrap;
}

.dash-friend-search-empty {
    padding: 12px;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Friend Requests */
.dash-friends-requests {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dash-friends-requests-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #e5e7eb;
    margin-bottom: 8px;
    font-weight: 500;
}

.dash-friends-req-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.dash-friend-request {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(245,158,11,0.05);
    margin-bottom: 4px;
}

.dash-friend-req-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.dash-friend-req-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.dash-friend-req-btn:hover {
    transform: scale(1.1);
}

.dash-friend-req-btn.accept {
    background: rgba(34,197,94,0.2);
    color: #4ade80;
}

.dash-friend-req-btn.reject {
    background: rgba(239,68,68,0.2);
    color: #f87171;
}

/* Friend Remove Button */
.dash-friend-remove {
    opacity: 0;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px;
    transition: opacity 0.15s, color 0.15s;
    margin-left: auto;
}

.dash-friend-item:hover .dash-friend-remove {
    opacity: 1;
}

.dash-friend-remove:hover {
    color: #f87171;
}

/* Friends Empty State */
.dash-friends-empty {
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
    padding: 20px 12px;
}

/* Expand Button */
.dash-friends-expand {
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: #6b7280;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
    margin-top: 8px;
}

.dash-friends-expand:hover {
    background: #1f2937;
    color: #e5e7eb;
}
