/* Dashboard Specific Styles */

/* Design tokens live in css/base/variables.css */

/* Dashboard Content */
/* welcome banner removed */

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 8px 24px -4px rgba(var(--brand-rgb), 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .dashboard-card {
    background: rgba(var(--card-bg-rgb), 0.92);
    border: 1px solid rgba(var(--brand-rgb), 0.18);
    box-shadow:
        0 0 0 1px rgba(var(--brand-rgb), 0.08),
        0 16px 40px rgba(0, 0, 0, 0.4);
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -8px rgba(var(--brand-rgb), 0.18), 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .dashboard-card:hover {
    box-shadow:
        0 0 0 1px rgba(var(--brand-rgb), 0.22),
        0 24px 56px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(var(--brand-rgb), 0.08);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.07), transparent);
    flex-shrink: 0;
}

[data-theme="dark"] .card-header {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.12), transparent);
    border-bottom-color: rgba(var(--brand-rgb), 0.15);
}

.card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.add-btn {
    font-size: 1.5rem;
    font-weight: bold;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    border-radius: 50%;
    padding: 0;
    transition: all 0.2s ease;
}

.add-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.dashboard-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-card .card-header h3 {
    margin-bottom: 0;
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Anonymous Warning */
.anonymous-warning {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.05), transparent);
    border: 2px solid var(--warning-color);
    position: relative;
    overflow: hidden;
}

.anonymous-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--warning-color), #ffa726);
}

[data-theme="dark"] .anonymous-warning {
    background: linear-gradient(135deg, rgba(251, 211, 141, 0.1), transparent);
    border: 2px solid var(--warning-color);
}

.anonymous-warning .card-header {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.1), transparent);
    border-bottom-color: rgba(237, 137, 54, 0.2);
}

.anonymous-warning h3 {
    color: var(--warning-color);
    font-weight: 700;
}

[data-theme="dark"] .anonymous-warning h3 {
    color: var(--warning-color);
}

.anonymous-info {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.875rem;
    flex: 1;
}

.anonymous-info p {
    margin-bottom: 0.75rem;
}

.anonymous-info p:last-child {
    margin-bottom: 0;
}

/* Stats */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
}

[data-theme="dark"] .stat-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #666;
}

[data-theme="dark"] .stat-label {
    color: #aaa;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Activity List */
.activity-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:hover {
    background-color: rgba(var(--brand-rgb),0.05);
    padding-left: 0.5rem;
    border-radius: 5px;
}

[data-theme="dark"] .activity-item:hover {
    background-color: rgba(var(--brand-rgb),0.1);
}

[data-theme="dark"] .activity-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-content {
    flex: 1;
}

.activity-type {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.activity-details {
    font-size: 0.9rem;
    color: #666;
}

.activity-details .activity-completed {
    color: var(--success-color, #10b981);
    font-weight: 600;
    margin-left: 0.25rem;
}

[data-theme="dark"] .activity-details {
    color: #aaa;
}

.activity-date {
    font-weight: 500;
}

.activity-location {
    font-style: italic;
}

.activity-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Session row actions: matched squares that read as one control group rather
   than three loose glyphs. Colour is carried by the icon, and only the button
   under the cursor picks up a background. */
.activity-actions .icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.activity-actions .icon-btn i {
    display: block;
    font-size: 1.05rem;
}

.activity-actions .icon-btn:hover {
    background: var(--gray-light);
    color: var(--text-primary);
}

/* Play is the primary action on the row, so it keeps its colour at rest */
.activity-actions .play-btn {
    color: var(--primary-color);
}

.activity-actions .play-btn:hover {
    background: rgba(var(--brand-rgb), 0.14);
    color: var(--primary-color);
}

.activity-actions .delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error-color);
}

.activity-actions .privacy-btn:hover {
    background: rgba(var(--brand-rgb), 0.14);
    color: var(--primary-color);
}

.activity-list {
    list-style: none;
    padding: 0;
}

.no-data {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
}

[data-theme="dark"] .no-data {
    color: #777;
}

/* Activity Detail Modal */
.activity-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12000; /* above floating controls */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.activity-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.activity-detail-modal {
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--gray-light);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    box-sizing: border-box;
    /* These dialogs only ever scroll vertically. overflow-x must be stated
       explicitly: per spec, `visible` on one axis computes to `auto` when the
       other axis is `auto`, which is what was producing a stray horizontal
       scrollbar whenever any child was even a pixel too wide. */
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-2xl);
    transform: scale(0.96) translateY(-50px);
    opacity: 0;
    transition: all var(--transition-spring);
}

.activity-modal-overlay.active .activity-detail-modal {
    transform: translateY(0);
    opacity: 1;
}

/* Lock body scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

.activity-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

[data-theme="dark"] .activity-detail-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-detail-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* New Session Modal */
/* The picker opens with the same short rise the steps inside it use
   (stepFadeIn), instead of the spring pop the other dialogs get. Without this
   the first thing you see on opening is a bounce, and every step change after
   it is calm, which reads as two different animations. */
.activity-modal-overlay .new-session-modal {
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.activity-modal-overlay.active .new-session-modal {
    transform: translateY(0);
}

.new-session-modal {
    max-width: 500px;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Scrollbar styling for new session modal */
.new-session-modal::-webkit-scrollbar {
    width: 10px;
}

.new-session-modal::-webkit-scrollbar-track {
    background: transparent;
}

.new-session-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color, #6a11cb), var(--secondary-color, #fc466b));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.new-session-modal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary-color, #fc466b), var(--primary-color, #6a11cb));
    background-clip: padding-box;
}

[data-theme="dark"] .new-session-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7a21db, #fc466b);
    border-color: rgba(0, 0, 0, 0.2);
    background-clip: padding-box;
}

/* Gamemode Step */
.session-step {
    animation: stepFadeIn 0.25s ease;
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Title badge (Premium) */
.title-badge {
    display: inline-block;
    vertical-align: middle;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.4rem;
    position: relative;
    top: -1px;
}

.title-badge.experimental {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* Picker step gets a wider modal so the modes fit in two columns instead of
   one long scroll (there are five of them now). */
.new-session-modal.picker-wide { max-width: 780px; }

.gamemode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: stretch;
}

.gamemode-card {
    position: relative;
    display: flex;
    flex-direction: row;
    /* Top-aligned so text baselines match across equal-height grid cards */
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    border: none;
    border-radius: 16px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    overflow: hidden;
    width: 100%;
    text-align: left;
}

[data-theme="dark"] .gamemode-card {
    background: rgba(var(--brand-rgb), 0.10);
}

.gamemode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    transition: left 0.6s ease;
}

.gamemode-card:hover::before {
    left: 100%;
}

.gamemode-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(var(--brand-rgb), 0.18);
}

[data-theme="dark"] .gamemode-card:hover {
    box-shadow: 0 8px 30px rgba(var(--brand-rgb), 0.22);
}

.gamemode-card.gamemode-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gamemode-card.gamemode-disabled:hover {
    transform: none;
    box-shadow: none;
    background: var(--bg-secondary);
}

[data-theme="dark"] .gamemode-card.gamemode-disabled:hover {
    background: rgba(var(--brand-rgb), 0.10);
}

/* Per-mode accent colour, so five modes read as five things rather than one
   wall of purple. Drives the hover border, glow and focus ring. */
.gamemode-card { --gm-accent: var(--primary-color); }
.gamemode-card[data-gamemode="holding"]           { --gm-accent: #60a5fa; }
.gamemode-card[data-gamemode="potty-training"]    { --gm-accent: #a78bfa; }
.gamemode-card[data-gamemode="coop-holding"]      { --gm-accent: #ec4899; }
.gamemode-card[data-gamemode="rapid-desperation"] { --gm-accent: #fb7185; }
.gamemode-card[data-gamemode="negotiation"]       { --gm-accent: #fbbf24; }

/* Without the ring, the per-mode accent shows up as a glow and a tinted
   surface, so five modes still read as five things. */
.gamemode-card:hover {
    background: color-mix(in srgb, var(--gm-accent) 12%, var(--bg-secondary));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .gamemode-card:hover {
    background: color-mix(in srgb, var(--gm-accent) 18%, rgba(var(--card-bg-rgb), 0.95));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Keyboard users get the same affordance as the mouse hover */
.gamemode-card:focus-visible {
    outline: 2px solid var(--gm-accent);
    outline-offset: 3px;
}

/* Gamemode card inner layout. The icon is the coloured .ph-glass tile inside,
   so this wrapper stays neutral instead of boxing a box. */
.gamemode-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

.gamemode-card:hover .gamemode-icon {
    transform: scale(1.06);
}

.gamemode-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.gamemode-arrow {
    flex-shrink: 0;
    align-self: center;
    color: var(--text-color);
    opacity: 0.3;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.gamemode-card:hover .gamemode-arrow {
    opacity: 1;
    color: var(--gm-accent);
    transform: translateX(3px);
}

.gamemode-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 0.1rem;
}

/* Badge inside title (e.g. "Experimental") */
.title-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.title-badge.experimental {
    background: none;
    border: none;
    border-radius: 0;
    color: #ef4444;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.title-badge.experimental::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 0.9em;
    background: rgba(239, 68, 68, 0.45);
    border-radius: 1px;
}

.gamemode-desc {
    font-size: 0.82rem;
    color: var(--text-color);
    opacity: 0.55;
    line-height: 1.45;
}

.gamemode-requirements {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.5;
    margin-top: 0.2rem;
}

/* Label "optional" badge */
.label-optional {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.45;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 0.25rem;
}

/* Inline badge (Coming Soon) */
.gamemode-badge {
    display: inline-block;
    vertical-align: middle;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Back button in modal header */
.gamemode-back-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
    line-height: 1;
    margin-right: 0.5rem;
}

.gamemode-back-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .gamemode-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.new-session-form {
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-group input {
    border-color: #444;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--brand-rgb),0.1);
}

/* Responsive Design - Scrollable header buttons */
@media (max-width: 900px) {
    .dashboard-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        position: relative;
    }
    
    .header-actions {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 0.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        /* No visible scrollbar, it added height below the buttons and pushed
           the row out of line with the bell/avatar. Still swipeable; the
           right-edge fade hints that more buttons are hiding. */
        scrollbar-width: none;
        padding: 0.25rem 0;
        padding-right: 0.5rem;
        mask-image: linear-gradient(to right, black 0%, black calc(100% - 3rem), transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 0%, black calc(100% - 3rem), transparent 100%);
    }

    .header-actions::-webkit-scrollbar {
        display: none;
    }
    
    .user-menu {
        flex: 0 0 auto !important;
        position: relative;
        z-index: 2;
        margin-left: 1.5rem;
        padding-left: 1.5rem;
        background: linear-gradient(to right, transparent 0%, var(--bg-color) 35%);
    }
    
    /* Smaller buttons */
    .nav-btn.small {
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .nav-btn.small {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .user-menu {
        margin-left: 1rem;
        padding-left: 1.25rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-card {
        border-radius: 12px;
    }
    
    .card-header {
        padding: 1rem 1rem 0.75rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .welcome-banner {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .welcome-banner h2 {
        font-size: 1.5rem;
    }
    
    .welcome-banner p {
        font-size: 1rem;
    }
    
    .activity-detail-modal {
        width: 95%;
        padding: 1.5rem;
    }
    
    .new-session-modal {
        width: 95%;
        max-width: none;
        max-height: 85vh;
    }
    
    .add-friend-modal {
        width: 95%;
        max-width: none;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .container {
        padding-top: 100px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-bottom: 60px;
    }
    
    .dashboard-header {
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }
    
    .user-menu {
        gap: 0.4rem;
        padding-left: 0.75rem;
    }
    
    .user-info {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .user-info #username {
        font-size: 0.8rem;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .anonymous-badge {
        display: none; /* Hide badge on small screens */
    }
    
    .nav-btn.small {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .avatar {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    
    .card-header h3 {
        font-size: 1.1rem;
    }
    
    .friend-item {
        padding: 0.5rem;
        border-radius: 12px;
    }
    
    .friend-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .friend-username {
        font-size: 0.9rem;
    }
    
    .notification-item {
        padding: 0.6rem 0.75rem;
        flex-wrap: wrap;
    }
    
    .notification-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }
    
    .activity-detail-modal {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .container {
        padding-top: 90px;
    }
    
    .nav-btn.small {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .user-info #username {
        max-width: 55px;
        font-size: 0.8rem;
    }
    
    .avatar {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .user-menu {
        padding-left: 0.75rem;
    }
    
    .dashboard-card {
        border-radius: 10px;
    }
    
    .card-header {
        padding: 0.75rem 0.75rem 0.5rem;
    }
    
    .card-content {
        padding: 0.75rem;
    }
}

/* Dashboard Notifications Card */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--water-light);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    transition: var(--transition);
}

.notification-item:hover {
    background: var(--water-medium);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.notification-title {
    font-weight: 600;
    color: var(--text-color);
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 600;
}

.notification-btn.primary {
    background: var(--primary-color);
    color: #fff;
}

.notification-btn.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.notification-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* ===================================
   Bell Notification Button
   =================================== */

.bell-wrapper {
    position: relative;
}

.bell-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bell-btn:hover {
    background: var(--water-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.bell-btn.has-notifications {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .bell-btn {
    border-color: rgba(var(--brand-rgb), 0.3);
}

[data-theme="dark"] .bell-btn:hover,
[data-theme="dark"] .bell-btn.has-notifications {
    background: rgba(var(--brand-rgb), 0.12);
    border-color: rgba(var(--brand-rgb), 0.6);
}

.bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #f87cb3, #fc466b);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-color);
    pointer-events: none;
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes badgePop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Notification Dropdown */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.notif-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .notif-dropdown {
    background: rgba(var(--card-bg-rgb), 0.97);
    border-color: rgba(var(--brand-rgb), 0.25);
    box-shadow:
        0 0 0 1px rgba(var(--brand-rgb), 0.12),
        0 20px 50px rgba(0, 0, 0, 0.5);
}

.notif-dropdown-header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color);
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.07), transparent);
}

[data-theme="dark"] .notif-dropdown-header {
    border-bottom-color: rgba(var(--brand-rgb), 0.15);
}

.notif-dropdown-body {
    max-height: 360px;
    overflow-y: auto;
    padding: 0.5rem;
}

.notif-dropdown-body::-webkit-scrollbar {
    width: 6px;
}

.notif-dropdown-body::-webkit-scrollbar-track {
    background: transparent;
}

.notif-dropdown-body::-webkit-scrollbar-thumb {
    background: rgba(var(--brand-rgb), 0.3);
    border-radius: 999px;
}

.notif-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Notification items inside dropdown */
.notif-list .notification-item {
    border-radius: 10px;
    padding: 0.75rem;
    border-left: none;
}

/* Mobile: dropdown goes full-width below header */
@media (max-width: 480px) {
    .notif-dropdown {
        width: calc(100vw - 2rem);
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-8px) scale(0.97);
    }

    .notif-dropdown.open {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* ===================================
   Friends List, Redesigned
   =================================== */

.friends-list {
    display: flex;
    flex-direction: column;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    transition: background 0.18s ease;
    position: relative;
}

[data-theme="dark"] .friend-item {
    border-bottom-color: rgba(var(--brand-rgb), 0.1);
}

.friend-item:last-child {
    border-bottom: none;
}

/* Hover is just a soft fill. The old version slid a gradient bar in at the left
   edge, which read as a stray outline against the avatar next to it. */
.friend-item:hover {
    background: var(--water-light);
    border-radius: 10px;
}

.friend-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

/* Avatar wrapper holds the avatar + status dot */
.friend-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease;
}

/* Online glow ring */
.friend-item:has(.friend-status-dot.online) .friend-avatar {
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--success-color);
}

/* Status dot, positioned on avatar bottom-right */
.friend-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    background: var(--text-secondary);
}

.friend-status-dot.online {
    background: var(--success-color);
    animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
    50%       { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

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

.friend-username {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-status {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.friend-status.online {
    color: var(--success-color);
    font-weight: 500;
}

.friend-last-seen {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

/* Action buttons, always visible (hover only emphasizes them) */
.friend-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    opacity: 0.75;
    transition: opacity 0.18s ease;
}

.friend-item:hover .friend-actions {
    opacity: 1;
}

/* Unread-DM count on a friend row */
.friend-dm-badge {
    background: var(--gradient-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    margin-left: 6px;
    flex-shrink: 0;
}

.friend-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    color: var(--text-secondary);
    padding: 0;
}

/* Colour-only hover: the pill background and scale read as a stray outline
   next to the avatar, so this one stays flat. */
.friend-btn.view-profile:hover {
    background: none;
    color: var(--primary-color);
    transform: none;
}

.friend-btn.message:hover {
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--primary-color);
    transform: scale(1.1);
}

.friend-btn.remove:hover {
    background: rgba(229, 62, 62, 0.1);
    color: var(--error-color);
    transform: scale(1.1);
}

.friend-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.friend-btn:disabled:hover {
    transform: none;
    background: none;
    color: var(--text-secondary);
}

/* Add Friend Modal */
.add-friend-modal {
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Scrollbar styling for add friend modal */
.add-friend-modal::-webkit-scrollbar {
    width: 10px;
}

.add-friend-modal::-webkit-scrollbar-track {
    background: transparent;
}

.add-friend-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color, #6a11cb), var(--secondary-color, #fc466b));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.add-friend-modal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary-color, #fc466b), var(--primary-color, #6a11cb));
    background-clip: padding-box;
}

[data-theme="dark"] .add-friend-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7a21db, #fc466b);
    border-color: rgba(0, 0, 0, 0.2);
    background-clip: padding-box;
}

.add-friend-form .form-group {
    margin-bottom: 1rem;
}

.add-friend-form label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.add-friend-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-input);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

.add-friend-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb),0.1);
}

/* User Search Results */
.search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    margin-top: 0.5rem;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--water-light);
}

.search-result-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-username {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.search-result-join-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.no-search-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* Selected User */
.selected-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--water-light);
    border-radius: 999px;
    border: 2px solid var(--primary-color);
    margin-top: 0.5rem;
    overflow: hidden;
}

.selected-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.selected-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.selected-details {
    flex: 1;
}

.selected-username {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.selected-join-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 1.2rem;
    color: var(--error-color);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear:hover {
    background: rgba(255, 0, 0, 0.1);
    transform: scale(1.1);
}

/* Friend Requests Section */
.friend-requests-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .friend-requests-section {
    border-bottom-color: rgba(var(--brand-rgb), 0.12);
}

.friends-section {
    margin-top: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.section-header h4 {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.requests-count.friends-count {
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--primary-color);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    border: 1px solid rgba(var(--brand-rgb), 0.2);
}

.friend-requests-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.friend-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--water-light);
    border-radius: 999px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}

.friend-request-item:hover {
    background: var(--water-medium);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.friend-request-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.friend-request-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.friend-request-username {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.friend-request-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.friend-request-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.friend-request-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.8rem;
    font-weight: 500;
}

.friend-request-btn.accept {
    background: var(--success-color);
    color: white;
}

.friend-request-btn.accept:hover {
    background: #38a169;
    transform: scale(1.05);
}

.friend-request-btn.decline {
    background: var(--error-color);
    color: white;
}

.friend-request-btn.decline:hover {
    background: #c53030;
    transform: scale(1.05);
}

.friend-request-btn.cancel {
    background: var(--text-secondary);
    color: white;
}

.friend-request-btn.cancel:hover {
    background: #666;
    transform: scale(1.05);
}

.friend-request-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.friend-request-btn:disabled:hover {
    transform: none;
}

.no-requests-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
    background: var(--water-light);
    border-radius: 999px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

/* Difficulty Buttons */
.difficulty-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.difficulty-btn {
    flex: 1;
    background: var(--card-bg);
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .difficulty-btn {
    background: rgba(var(--card-bg-rgb), 0.8);
    border: 2px solid rgba(var(--brand-rgb), 0.2);
}

.difficulty-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.difficulty-btn:hover::before {
    left: 100%;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

[data-theme="dark"] .difficulty-btn:hover {
}

.difficulty-btn.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.06), rgba(var(--brand-rgb), 0.12));
    transform: translateY(-2px);
}

[data-theme="dark"] .difficulty-btn.active {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.15), rgba(var(--brand-rgb), 0.25));
}

.difficulty-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.difficulty-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.difficulty-btn.active .difficulty-name {
    color: var(--primary-color);
}

.difficulty-desc {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.2;
}

[data-theme="dark"] .difficulty-desc {
    color: #aaa;
}

.difficulty-btn.active .difficulty-desc {
    color: var(--primary-color);
    opacity: 0.8;
}

/* Difficulty Preview */
.difficulty-preview {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    transition: all 0.3s ease;
}

[data-theme="dark"] .difficulty-preview {
    background: rgba(var(--card-bg-rgb), 0.8);
    border: 2px solid rgba(var(--brand-rgb), 0.2);
}

.difficulty-preview h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.preview-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.preview-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] .preview-stat {
    border-bottom-color: rgba(255,255,255,0.05);
}

.preview-stat:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.85rem;
    opacity: 0.7;
}

.stat-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.preview-description {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0.75rem;
    background: rgba(var(--brand-rgb),0.05);
    border-radius: 8px;
    border: 1px solid rgba(var(--brand-rgb),0.1);
}

[data-theme="dark"] .preview-description {
    background: rgba(var(--brand-rgb),0.1);
    border: 1px solid rgba(var(--brand-rgb),0.2);
}

/* ===================================
   Privacy / Feed Visibility Options
   =================================== */
.privacy-option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.privacy-option,
label.privacy-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--card-bg);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

[data-theme="dark"] .privacy-option {
    background: rgba(var(--card-bg-rgb), 0.6);
    border-color: rgba(var(--brand-rgb), 0.12);
}

.privacy-option:hover {
    border-color: rgba(var(--brand-rgb), 0.35);
    background: rgba(var(--brand-rgb), 0.04);
}

[data-theme="dark"] .privacy-option:hover {
    background: rgba(var(--brand-rgb), 0.08);
    border-color: rgba(var(--brand-rgb), 0.3);
}

/* Hide default radio input */
.privacy-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Selected state via JS-toggled class or :has */
.privacy-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(var(--brand-rgb), 0.06);
}

[data-theme="dark"] .privacy-option:has(input[type="radio"]:checked) {
    background: rgba(var(--brand-rgb), 0.14);
    border-color: rgba(var(--brand-rgb), 0.55);
}

.privacy-option-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--primary-color);
    transition: background 0.2s ease;
}

.privacy-option:has(input[type="radio"]:checked) .privacy-option-icon {
    background: rgba(var(--brand-rgb), 0.2);
}

.privacy-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
}

.privacy-option-text strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.privacy-option-text small {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.5;
}

/* Responsive difficulty buttons */
@media (max-width: 480px) {
    .difficulty-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .difficulty-btn {
        flex-direction: row;
        align-items: center;
        padding: 0.65rem 0.9rem;
        text-align: left;
        gap: 0.6rem;
    }

    .difficulty-dot {
        margin-bottom: 0;
    }

    .difficulty-name {
        margin-bottom: 0.1rem;
    }

    .difficulty-preview {
        padding: 1rem;
    }

    .preview-stats {
        gap: 0.35rem;
    }

    .preview-stat {
        padding: 0.35rem 0;
    }

    .gamemode-card {
        padding: 0.85rem 1rem;
    }

    .gamemode-icon {
        width: 38px;
        height: 38px;
    }
}

/* ===================================
   Gamemode Tags
   =================================== */
.gamemode-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 6px;
}
.holding-tag {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}
.potty-training-tag {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}
[data-theme="dark"] .holding-tag {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}
[data-theme="dark"] .potty-training-tag {
    background: rgba(168, 85, 247, 0.25);
    color: #c084fc;
}

/* ===================================
   Mobile Navbar Fixes
   =================================== */

/* Ensure floating navbar elements always stay visible on mobile */
@media (max-width: 768px) {
    .floating-brand.floating-controls {
        position: fixed !important;
        z-index: 9999 !important;
        transform: none !important;
        -webkit-transform: none !important;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    .floating-brand {
        top: 14px !important;
        left: 14px !important;
    }
    
    .floating-controls {
        top: 14px !important;
        right: 14px !important;
        left: auto !important;
    }
} 
/* Visibility selector in the session detail modal */
.detail-privacy-select {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--gray-light);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

.detail-privacy-select:hover.detail-privacy-select:focus {
    border-color: rgba(var(--brand-rgb), 0.45);
}

/* ===================== Co-op multiplayer setup ===================== */
.coop-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.coop-toggle-list label.coop-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 0;
    border: 1.5px solid var(--gray-light);
    border-radius: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.coop-toggle:hover {
    border-color: rgba(var(--brand-rgb), 0.45);
}
/* Active (checked) card highlight */
.coop-toggle:has(input:checked) {
    border-color: var(--primary);
    background: rgba(var(--brand-rgb), 0.08);
}
/* Hide the native checkbox; the switch on the right is the control */
.coop-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.coop-toggle-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg, #fff);
    color: var(--text-light);
    font-size: 1.15rem;
    transition: color 0.18s ease, background 0.18s ease;
}
.coop-toggle:has(input:checked) .coop-toggle-icon {
    background: rgba(var(--brand-rgb), 0.16);
    color: var(--primary);
}
.coop-toggle-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
/* Toggle switch */
.coop-switch {
    flex-shrink: 0;
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: var(--gray-light);
    transition: background 0.2s ease;
}
.coop-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}
.coop-toggle:has(input:checked) .coop-switch {
    background: var(--primary);
}
.coop-toggle:has(input:checked) .coop-switch::after {
    transform: translateX(18px);
}
.coop-toggle input:focus-visible ~ .coop-switch {
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.35);
}
.coop-toggle-text strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.coop-toggle-text small {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.coop-select {
    width: 100%;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--gray-light);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}
.coop-select:hover.coop-select:focus {
    border-color: rgba(var(--brand-rgb), 0.45);
}
.coop-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ===== Potty-training starting-level step ===== */
.step-intro {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.pt-start-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pt-start-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-bg);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.pt-start-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--brand-rgb), 0.45);
}

.pt-start-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color), 0 6px 20px rgba(var(--brand-rgb), 0.18);
}

.pt-start-emoji {
    font-size: 1.7rem;
    line-height: 1;
    flex-shrink: 0;
}

.pt-start-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pt-start-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.98rem;
}

.pt-start-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.pt-quiz-toggle {
    margin: 1rem 0 0;
    width: 100%;
}

.pt-quiz {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pt-quiz-label {
    margin: 0 0 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.pt-quiz-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pt-quiz-opt {
    padding: 0.45rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pt-quiz-opt:hover {
    border-color: rgba(var(--brand-rgb), 0.5);
}

.pt-quiz-opt.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.pt-quiz-result {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--text-color);
    font-size: 0.92rem;
    text-align: center;
}

.pt-quiz-result-label {
    color: var(--text-secondary);
}

/* ===== Negotiation (AI Keeper) gamemode ===== */
/* Persona picker mirrors the difficulty-button look, but with its own class so
   the global difficulty-btn handler doesn't clear the difficulty selection. */
.nego-persona-btn,
.rapid-bladder-btn {
    flex: 1;
    background: var(--card-bg);
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .nego-persona-btn,
[data-theme="dark"] .rapid-bladder-btn {
    background: rgba(var(--card-bg-rgb), 0.8);
    border: 2px solid rgba(var(--brand-rgb), 0.2);
}
.nego-persona-btn:hover,
.rapid-bladder-btn:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.nego-persona-btn.active,
.rapid-bladder-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18);
}

/* Hydration safety note in the Rapid Desperation setup form */
.rapid-safety-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(245, 166, 35, 0.10);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.rapid-safety-note i { color: var(--warm); font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.nego-needs-row { display: flex; gap: 18px; margin-top: 6px; }
.nego-need-check {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600; color: var(--text-secondary); cursor: pointer;
}
.nego-need-check input { accent-color: var(--primary); width: 16px; height: 16px; }
.gamemode-tag.nego-tag { background: rgba(251, 191, 36, 0.15); color: #d97706; }
[data-theme="dark"] .gamemode-tag.nego-tag { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.gamemode-tag.rapid-tag { background: rgba(var(--brand-rgb), 0.15); color: #6555e0; }
[data-theme="dark"] .gamemode-tag.rapid-tag { background: rgba(var(--brand-rgb), 0.20); color: #9686f9; }
.nego-card-status { color: var(--accent); font-weight: 600; }

/* Premium badge: gold, so it reads as "paid" rather than "experimental" */
.title-badge.premium-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

/* ===================================
   Premium-locked features (visible but disabled for non-premium users)
   =================================== */

.gamemode-card.premium-locked {
    opacity: 0.5;
    filter: grayscale(0.6);
    cursor: not-allowed;
}

.gamemode-card.premium-locked:hover {
    transform: none;
    background: var(--bg-secondary);
    box-shadow: none;
}

[data-theme="dark"] .gamemode-card.premium-locked:hover {
    background: rgba(var(--brand-rgb), 0.10);
}

.gamemode-card.premium-locked .gamemode-arrow {
    visibility: hidden;
}

.premium-lock-note {
    color: #f59e0b !important;
    font-weight: 600;
}

.premium-lock-note i {
    vertical-align: -2px;
}

.nav-btn.premium-locked {
    opacity: 0.5;
    filter: grayscale(0.6);
    cursor: not-allowed;
    pointer-events: none;
}

/* ===================================
   Diaper stash box
   =================================== */
.stash-total {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--water-light);
    padding: 2px 9px;
    border-radius: 999px;
    margin-left: 0.4rem;
}

.stash-list { display: flex; flex-direction: column; gap: 0.5rem; }

.stash-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    background: var(--bg-secondary);
    transition: var(--transition);
}
.stash-item:hover { box-shadow: var(--shadow-sm); }
.stash-item.is-empty { opacity: 0.55; }

.stash-item-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stash-item-name { font-weight: 600; font-size: 0.92rem; }
.stash-item-meta { font-size: 0.75rem; color: var(--text-secondary); }
.stash-item-notes {
    font-size: 0.72rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stash-item-qty {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.stash-step {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}
.stash-step:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); }
.stash-step:disabled { opacity: 0.5; cursor: default; }

.stash-count {
    min-width: 2ch;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stash-edit {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}
.stash-edit:hover { color: var(--primary-color); background: var(--water-light); }

.stash-form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
/* min-width:0 + full-width inputs stop the three fields overflowing the modal
   (inputs carry a default intrinsic width that flex otherwise refuses to shrink) */
.stash-form-row .form-group { flex: 1 1 120px; min-width: 0; }
.stash-form-row .form-group input { width: 100%; box-sizing: border-box; }

/* ===================================
   Private gallery box
   =================================== */
.gallery-private-tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: var(--gray);
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.gallery-filters { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.gallery-filter {
    font-family: var(--font-primary);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.gallery-filter:hover { border-color: var(--primary-color); color: var(--primary-color); }
.gallery-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 0.5rem;
}

.gallery-tile {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-secondary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-tile-kind {
    position: absolute;
    left: 4px;
    bottom: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}
.gallery-tile-kind.kind-pee  { background: rgba(96, 165, 250, 0.85); }
.gallery-tile-kind.kind-poop { background: rgba(251, 191, 36, 0.85); }
.gallery-tile-kind.kind-both { background: rgba(167, 139, 250, 0.85); }

.gallery-private-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 1rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: var(--water-light);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.gallery-private-note i { color: var(--primary-color); flex-shrink: 0; margin-top: 1px; }

.gallery-view-modal { max-width: 640px; }
.gallery-view-body { text-align: center; }
.gallery-view-body img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}
.gallery-view-caption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===================================
   Gallery add-image form
   Segmented type picker + drop zone. Note: .radio-group/.radio-label live in
   admin.css, which the dashboard doesn't load, so these are self-contained.
   =================================== */
.segmented {
    display: flex;
    gap: 0.4rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    max-width: 100%;
    box-sizing: border-box;
}

/* min-width:0 lets the options shrink; without it flex items keep their
   nowrap content width and push a horizontal scrollbar onto the modal. */
.segmented-option { position: relative; flex: 1 1 0; min-width: 0; margin: 0; cursor: pointer; }
/* Visually hidden but still focusable. A bare `position:absolute` here had no
   containing block and picked up a 100% width, so the three radios sat far to
   the right and gave the modal ~390px of phantom horizontal scroll. */
.segmented-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.segmented-option > span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.6rem;
    border-radius: 999px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}
.segmented-option > span i { font-size: 1rem; flex-shrink: 0; }
/* Long labels (e.g. German) ellipsis instead of widening the modal */
.segmented-option > span > span { overflow: hidden; text-overflow: ellipsis; }
.segmented-option:hover > span { color: var(--primary-color); }
.segmented-option input:checked + span {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.segmented-option input:focus-visible + span {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Drop zone replaces the raw file input */
.gallery-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 1rem;
    max-width: 100%;
    box-sizing: border-box;
    border: 2px dashed var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
}
.gallery-drop:hover,
.gallery-drop.is-dragging {
    border-color: var(--primary-color);
    background: var(--water-light);
}

.gallery-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
    pointer-events: none;
}
.gallery-drop-inner > i { font-size: 1.9rem; color: var(--primary-color); margin-bottom: 0.1rem; }
.gallery-drop-title { font-weight: 700; font-size: 0.92rem; color: var(--text-color); }
.gallery-drop-hint { font-size: 0.75rem; color: var(--text-light); }

/* Once a file is picked the preview fills the zone */
.gallery-drop-preview {
    max-width: 100%;
    max-height: 220px;
    border-radius: 10px;
    object-fit: contain;
}
.gallery-drop.has-file { border-style: solid; padding: 0.5rem; }

/* Header tag sits on the same optical line as the card title */
.card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}
.stash-total,
.gallery-private-tag {
    display: inline-flex;
    align-items: center;
    line-height: 1.6;
    vertical-align: middle;
}
/* With no items the JS clears the text, but the pill's own background and
   padding still painted a small stub next to the title. */
.stash-total:empty { display: none; }

/* Keep the stash/gallery modals from ever growing a horizontal scrollbar:
   inputs here otherwise use their intrinsic width (~177px default) and any
   flex row of them can exceed the modal's content box. */
#stash-modal-overlay form,
#gallery-modal-overlay form { max-width: 100%; }

#stash-modal-overlay input[type="text"],
#stash-modal-overlay input[type="number"],
#gallery-modal-overlay input[type="text"],
#gallery-modal-overlay input[type="number"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#stash-modal-overlay .form-group,
#gallery-modal-overlay .form-group { min-width: 0; }
