@charset "UTF-8";
/* ==========================================================================
   YSN CLAN - UI LAYER
   Loaded after style.css. Two jobs:
     1. scale the whole interface up on big screens (the design was drawn for
        a small viewport and felt cramped),
     2. supply the components the pages reference but that were never styled
        (contact cards, forum views, gallery sections, auth forms, ...).
   ========================================================================== */

/* ==================== 1. GLOBAL SCALE & RHYTHM ==================== */

:root {
    /* One knob for the whole interface: every rem based size (typography,
       padding, radius) is derived from it. Raise the last value to ~17px for
       a roomier look, lower the first one for a denser one. */
    --ysn-root-size: clamp(14.5px, 0.12vw + 12.4px, 16px);
}

html {
    font-size: var(--ysn-root-size);
}

body {
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: min(1600px, 94vw);
    margin-inline: auto;
    padding-inline: clamp(1rem, 1.6vw, 2rem);
}

.main-layout {
    padding-block: clamp(1.25rem, 2.2vw, 2.25rem);
}

/* A little more air between the big page blocks. */
.main-layout > .container > * + * {
    margin-top: clamp(1.1rem, 1.8vw, 1.85rem);
}

.card-body,
.card-header {
    padding: clamp(0.9rem, 1.2vw, 1.35rem);
}

h1 { font-size: clamp(1.6rem, 1.9vw, 2.15rem); }
h2 { font-size: clamp(1.25rem, 1.45vw, 1.6rem); }
h3 { font-size: clamp(1.05rem, 1.15vw, 1.25rem); }

.page-title {
    font-size: clamp(1.5rem, 1.8vw, 2rem);
}

/* The hero block was eating most of the first screen. */
.page-hero {
    padding: clamp(1.5rem, 2.6vw, 2.5rem) clamp(1rem, 2vw, 2rem);
}

.page-hero h2,
.hero-title {
    font-size: clamp(1.5rem, 2vw, 2.1rem);
}

.hero-description,
.page-hero p {
    font-size: 0.95rem;
    max-width: 62ch;
    margin-inline: auto;
}

.btn-large {
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
}

.widget-header {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.widget-body {
    padding: 0.85rem 1rem;
}

.nav-link {
    font-size: 0.92rem;
}

.page-subtitle {
    max-width: 70ch;
}

.header-title {
    font-size: clamp(1.35rem, 1.6vw, 1.9rem);
    margin-bottom: 0.15rem;
}

/* ==================== 2. SHARED PAGE FURNITURE ==================== */

.page-header-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-lg);
}

.page-header-content {
    flex: 1 1 320px;
    min-width: 0;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Stat tiles: icon on the left, value + label stacked next to it. */
.stat-box-content,
.forum-stat-content,
.gallery-stat-content,
.profile-stat-content,
.cw-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.forum-stats-grid,
.gallery-stats-grid,
.member-stats-grid,
.profile-stats-grid,
.cw-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(0.75rem, 1.2vw, 1.25rem);
}

.forum-stat-box,
.gallery-stat-box,
.profile-stat-card,
.cw-stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: clamp(1rem, 1.4vw, 1.5rem);
    background: var(--dark-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.forum-stat-box:hover,
.gallery-stat-box:hover,
.profile-stat-card:hover,
.cw-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(143, 91, 255, 0.35);
}

.forum-stat-icon,
.gallery-stat-icon,
.profile-stat-icon,
.cw-stat-icon,
.stat-box-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    background: rgba(143, 91, 255, 0.12);
    color: var(--primary);
}

.forum-stat-value,
.gallery-stat-value,
.profile-stat-value,
.cw-stat-value,
.stat-box-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.forum-stat-label,
.gallery-stat-label,
.profile-stat-label,
.cw-stat-label,
.stat-box-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cw-stat-trend {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cw-stat-total .cw-stat-icon { background: rgba(143, 91, 255, 0.14); color: var(--primary); }
.cw-stat-wins .cw-stat-icon { background: rgba(0, 255, 136, 0.12); color: var(--success); }
.cw-stat-losses .cw-stat-icon { background: rgba(255, 71, 87, 0.12); color: var(--danger); }
.cw-stat-winrate .cw-stat-icon { background: rgba(19, 195, 255, 0.12); color: var(--secondary); }

.cw-list-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ==================== 3. FORMS ==================== */

/* An empty status box used to render as a stray coloured bar. */
.form-message:empty {
    display: none !important;
}

.form-input,
.form-textarea,
.filter-input,
.filter-select {
    width: 100%;
    padding: var(--space-md);
    background: var(--dark-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--dark-4);
}

.form-textarea {
    resize: vertical;
    min-height: 9rem;
    line-height: 1.6;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Native checkboxes rendered as the default white square - restyled to match
   the rest of the interface. (.modern-checkbox keeps its own hidden input.) */
.checkbox-label input[type="checkbox"],
.form-checkbox input[type="checkbox"],
.form-group input[type="checkbox"],
.filter-group input[type="checkbox"],
.admin-table input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    display: inline-grid;
    place-content: center;
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    border: 2px solid var(--divider);
    border-radius: 5px;
    background: var(--dark-4);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-checkbox input[type="checkbox"] {
    margin-top: 0.15rem;
}

/* admin-modern.css turns every checkbox into a toggle switch with a white
   knob (::before). These are real checkboxes, so the knob has to go. */
.checkbox-label input[type="checkbox"]::before,
.form-checkbox input[type="checkbox"]::before,
.form-group input[type="checkbox"]::before,
.filter-group input[type="checkbox"]::before,
.admin-table input[type="checkbox"]::before {
    content: none;
    display: none;
}

.checkbox-label input[type="checkbox"]::after,
.form-checkbox input[type="checkbox"]::after,
.form-group input[type="checkbox"]::after,
.filter-group input[type="checkbox"]::after,
.admin-table input[type="checkbox"]::after {
    content: '';
    width: 0.32rem;
    height: 0.62rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform var(--transition-fast);
    margin-top: -0.12rem;
}

.checkbox-label input[type="checkbox"]:hover,
.form-checkbox input[type="checkbox"]:hover,
.form-group input[type="checkbox"]:hover,
.filter-group input[type="checkbox"]:hover,
.admin-table input[type="checkbox"]:hover {
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked,
.form-checkbox input[type="checkbox"]:checked,
.form-group input[type="checkbox"]:checked,
.filter-group input[type="checkbox"]:checked,
.admin-table input[type="checkbox"]:checked {
    background: var(--gradient-primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked::after,
.form-checkbox input[type="checkbox"]:checked::after,
.form-group input[type="checkbox"]:checked::after,
.filter-group input[type="checkbox"]:checked::after,
.admin-table input[type="checkbox"]:checked::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-label input[type="checkbox"]:focus-visible,
.form-checkbox input[type="checkbox"]:focus-visible,
.form-group input[type="checkbox"]:focus-visible,
.filter-group input[type="checkbox"]:focus-visible,
.admin-table input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.checkbox-label {
    user-select: none;
    font-size: 0.9rem;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
}

.password-toggle:hover { color: var(--primary); }

.btn-block {
    width: 100%;
}

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

.link-primary:hover { color: var(--primary-light); }

/* ==================== 4. AUTH PAGES (login / register) ==================== */

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: clamp(1.5rem, 4vw, 3rem) 1rem;
}

.auth-container {
    max-width: 30rem;
}

.auth-card {
    padding: clamp(1.75rem, 2.6vw, 2.75rem);
}

.auth-brand {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-brand img,
.auth-logo {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.auth-brand h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.auth-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-title {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

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

.auth-form .form-group input,
.auth-form .form-group select {
    width: 100%;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    font-size: 0.9rem;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.auth-divider::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    position: relative;
    padding: 0 var(--space-md);
    background: var(--dark-2);
}

.auth-alternative {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.eye-open,
.eye-closed {
    pointer-events: none;
}

/* ==================== 4b. MODALS ==================== */

/* Some pages shipped the dialogs with an inline display:none which beat the
   .active class - keep them hidden through visibility instead. */
.modal {
    display: flex !important;
    pointer-events: none;
    padding: 1.5rem;
}

.modal.active {
    pointer-events: auto;
}

.modal-dialog {
    max-width: min(42rem, 92vw);
}

.modal-large .modal-dialog,
.modal-dialog.modal-large { max-width: min(52rem, 94vw); }

.modal-xl .modal-dialog,
.modal-dialog.modal-xl { max-width: min(64rem, 96vw); }

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--dark-3);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.modal-close:hover { color: var(--danger); }

/* ==================== 5. CONTACT PAGE ==================== */

.contact-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: clamp(1rem, 1.6vw, 1.5rem);
}

.contact-method-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: clamp(1.25rem, 1.8vw, 1.75rem);
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.contact-method-card:hover {
    transform: translateY(-3px);
    border-color: rgba(143, 91, 255, 0.4);
    box-shadow: var(--shadow-md);
}

.contact-method-icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-md);
    background: rgba(143, 91, 255, 0.12);
    color: var(--primary);
    margin-bottom: var(--space-xs);
}

.contact-method-icon svg {
    width: 1.75rem;
    height: 1.75rem;
}

.contact-method-card h3 {
    margin-bottom: 0;
    font-size: 1.15rem;
}

.contact-method-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex: 1;
}

.contact-method-card .btn {
    margin-top: var(--space-sm);
    width: 100%;
}

.contact-method-card .btn-large {
    font-size: 1rem;
    padding: var(--space-sm) var(--space-lg);
}

.contact-form-section .card {
    max-width: 60rem;
}

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

.contact-info-note {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== 6. FORUM ==================== */

.forum-view {
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2vw, 2rem);
}

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

/* The category header wraps its own .card, the thread header does not. */
.forum-category-header > .card {
    width: 100%;
}

.forum-category-header .card-header {
    gap: var(--space-lg);
}

.forum-thread-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: clamp(1rem, 1.5vw, 1.5rem);
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.forum-threads {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.forum-threads .forum-thread {
    margin-bottom: 0;
}

/* Pinned threads stay visually on top of the list. */
.forum-thread.pinned {
    border-color: rgba(255, 187, 0, 0.35);
    background: linear-gradient(90deg, rgba(255, 187, 0, 0.06), transparent 40%);
}

.thread-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.thread-badge.pinned { background: rgba(255, 187, 0, 0.15); color: var(--warning); }
.thread-badge.locked { background: rgba(255, 71, 87, 0.15); color: var(--danger); }
.thread-badge.official { background: rgba(143, 91, 255, 0.18); color: var(--primary-light); }

.thread-main { flex: 1; min-width: 0; }
.thread-title { display: flex; align-items: center; gap: var(--space-sm); font-weight: 600; }
.thread-meta { color: var(--text-muted); font-size: 0.85rem; }

.thread-stats {
    display: flex;
    gap: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    flex: 0 0 auto;
}

.forum-posts {
    display: flex;
    flex-direction: column;
}

.thread-header-main {
    min-width: 0;
}

.forum-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    align-self: center;
}

.forum-reply-section {
    padding: clamp(1rem, 1.5vw, 1.5rem);
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.forum-rules-card .rules-list {
    display: grid;
    gap: var(--space-sm);
    padding-left: 1.1rem;
    color: var(--text-secondary);
}

.rules-note {
    margin-top: var(--space-md);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.application-intro {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.application-requirements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.admin-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: var(--space-md);
}

.forum-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.forum-pager .btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.forum-empty {
    padding: clamp(2rem, 4vw, 3.5rem);
    text-align: center;
    color: var(--text-muted);
    background: var(--dark-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* Empty states are toggled with style.display = 'flex' from JS, which turned
   the icon, heading and text into one row. Lay them out as a column. */
.empty-state,
.loading-placeholder {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: clamp(1.75rem, 3vw, 3rem) var(--space-lg);
    text-align: center;
}

.empty-state svg {
    width: 2.75rem;
    height: 2.75rem;
    opacity: 0.35;
    margin-bottom: var(--space-sm);
}

.empty-state h3 {
    margin: 0;
    font-size: 1.15rem;
}

.empty-state p {
    margin: 0;
    max-width: 46ch;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.loading-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== 6b. MEMBERS ==================== */

.members-category-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: clamp(1.5rem, 2.5vw, 2.25rem) 0 var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.members-category-header svg {
    color: var(--primary);
    flex: 0 0 auto;
}

.members-category-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.category-count {
    margin-left: auto;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    background: rgba(143, 91, 255, 0.14);
    border: 1px solid rgba(143, 91, 255, 0.3);
    color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 600;
}

.members-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: clamp(1rem, 1.5vw, 1.5rem);
    align-items: stretch;
}

/* Cards in a row keep the same height, the meta block sits at the bottom. */
.members-category-grid .member-card {
    height: 100%;
}

.member-card .member-meta {
    margin-top: auto;
}

.members-grid {
    display: block;
}

.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: clamp(1.25rem, 1.8vw, 1.75rem);
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.member-card:hover {
    transform: translateY(-4px);
    border-color: rgba(143, 91, 255, 0.45);
    box-shadow: var(--shadow-md);
}

.member-card-top {
    position: relative;
    display: inline-block;
    line-height: 0;
    margin-bottom: var(--space-sm);
}

.member-avatar {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(143, 91, 255, 0.5);
}

.presence-dot {
    position: absolute;
    right: 0.15rem;
    bottom: 0.15rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 3px solid var(--dark-2);
}

/* green = online, yellow = seen in the last few minutes, red = offline */
.presence-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success), 0 0 12px rgba(0, 255, 136, 0.5);
    animation: presencePulse 2s ease-in-out infinite;
}

.presence-dot.recent {
    background: var(--warning);
    box-shadow: 0 0 6px var(--warning), 0 0 12px rgba(255, 187, 0, 0.4);
}

.presence-dot.offline {
    background: #ff5b5b;
    box-shadow: 0 0 6px rgba(255, 91, 91, 0.5);
}

@keyframes presencePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.presence-text.online { color: var(--success); }
.presence-text.recent { color: var(--warning); }
.presence-text.offline { color: var(--text-muted); }

.member-name {
    margin: 0;
    font-size: 1.15rem;
}

.role-pill {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(143, 91, 255, 0.16);
    color: var(--primary-light);
    border: 1px solid rgba(143, 91, 255, 0.35);
}

.role-pill.role-admin { background: rgba(255, 71, 87, 0.14); color: #ff8b95; border-color: rgba(255, 71, 87, 0.35); }
.role-pill.role-founder,
.role-pill.role-leader { background: rgba(143, 91, 255, 0.18); color: #c3a6ff; }
.role-pill.role-consiglieri { background: rgba(85, 214, 168, 0.14); color: #91f3cf; border-color: rgba(212, 175, 55, 0.42); }
.role-pill.role-moderator { background: rgba(19, 195, 255, 0.14); color: #7fdcff; border-color: rgba(19, 195, 255, 0.35); }
.role-pill.role-member { background: rgba(0, 255, 136, 0.12); color: #7dffbe; border-color: rgba(0, 255, 136, 0.3); }
.role-pill.role-trial { background: rgba(255, 187, 0, 0.14); color: #ffd166; border-color: rgba(255, 187, 0, 0.35); }

.member-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-light);
    width: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Only rendered when the roster entry actually has a game mode set. */
.mode-pill {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/*
 * Country flags on member cards.
 *
 * Sized in em so the flag tracks the label's font-size wherever the card is
 * used, and given a hairline ring so a white-edged flag (Poland, Latvia)
 * still reads as a flag against the dark card instead of bleeding into it.
 * Every flag ships with viewBox "0 0 3 2", so this one rule fits them all.
 */
.flag-icon {
    width: 1.05em;
    height: 0.7em;
    flex: 0 0 auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
    vertical-align: -0.08em;
}

.member-country {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* ---- role badges (multiple roles per member) ---- */

.role-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.35rem 0 0.2rem;
}

/*
 * GLASS CAPSULE role badges.
 *
 * A frosted tint of the role's own gradient at low opacity, a hairline border
 * in the same hue and a single glowing gem dot. Quiet enough that several
 * badges can sit beside a username without shouting, which the old glowing
 * plates could not do.
 *
 * Each role only sets four tokens: the two gradient stops, the label colour
 * and the dot's glow. Everything structural lives here.
 */
.role-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 0.95rem 0.5rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--rb-a) 34%, transparent);
    border-radius: 999px;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--rb-a) 26%, transparent),
            color-mix(in srgb, var(--rb-b) 26%, transparent)),
        rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
    color: var(--rb-text);
    font-family: 'Arial Black', var(--font-heading), sans-serif;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

/* The gem dot. em-sized so it scales with whatever size the badge is drawn
   at - the chat sidebar and the newest-member widget both shrink the label. */
.role-badge::before {
    content: '';
    flex: none;
    width: 0.62em;
    height: 0.62em;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rb-a), var(--rb-b));
    box-shadow: 0 0 0.75em var(--rb-glow);
}

/* The old style framed the caption with a glyph on each side. The capsule
   carries one dot on the left only. */
.role-badge::after {
    content: none;
}

/* The running highlight belonged to the old plate. Kept as a no-op so any
   markup or script that still emits <span class="rb-shine"> is harmless. */
.rb-shine {
    display: none;
}

.role-badge-admin {
    --rb-a: #9e6bff;
    --rb-b: #4d055f;
    --rb-text: #cdaaff;
    --rb-glow: rgba(158, 107, 255, 0.5);
}

.role-badge-leader,
.role-badge-founder {
    --rb-a: #9e6bff;
    --rb-b: #4d055f;
    --rb-text: #cdaaff;
    --rb-glow: rgba(158, 107, 255, 0.5);
}

/* "Assistant CL" */
.role-badge-moderator {
    --rb-a: #9e6bff;
    --rb-b: #b882ce;
    --rb-text: #e6d2ff;
    --rb-glow: rgba(184, 130, 206, 0.55);
}

.role-badge-consiglieri {
    --rb-a: #9e6bff;
    --rb-b: #7d3ed1;
    --rb-text: #d5bcff;
    --rb-glow: rgba(158, 107, 255, 0.5);
}

.role-badge-member {
    --rb-a: #7850c2;
    --rb-b: #742d8d;
    --rb-text: #c9b0f7;
    --rb-glow: rgba(120, 80, 194, 0.55);
}

.role-badge-trial {
    --rb-a: #9e6bff;
    --rb-b: #704b92;
    --rb-text: #d9c6f2;
    --rb-glow: rgba(158, 107, 255, 0.45);
}

/* Guest is the one badge that is deliberately not in the purple family. */
.role-badge-guest {
    --rb-a: #5900ff;
    --rb-b: #00ff26;
    --rb-text: #a9f2c2;
    --rb-glow: rgba(0, 255, 38, 0.45);
}

.text-online { color: var(--success); }

/* ==================== 6c. PROFILE ==================== */

.profile-header-card {
    overflow: hidden;
}

.profile-info-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: clamp(1rem, 2vw, 2rem);
    padding: clamp(1rem, 2vw, 2rem);
}

.profile-details {
    flex: 1 1 18rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-username {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.profile-role-badge {
    align-self: flex-start;
    padding: 0.2rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.profile-meta {
    gap: var(--space-lg) var(--space-xl);
    margin-top: var(--space-xs);
}

/* Cards inside a tab need breathing room - they used to sit glued together. */
.tab-content.active {
    display: grid;
    gap: clamp(1rem, 1.6vw, 1.5rem);
    padding: clamp(1rem, 1.8vw, 1.75rem);
}

.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.4rem;
    background: var(--dark-3);
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover { color: var(--text); background: rgba(143, 91, 255, 0.08); }
.tab-btn.active { color: var(--text); background: rgba(143, 91, 255, 0.18); }

.profile-info-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 0;
}

.profile-info-item {
    align-items: center;
    gap: var(--space-md);
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border-light);
}

.profile-info-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-info-value {
    font-weight: 500;
    word-break: break-word;
    text-align: right;
}

.login-required-card {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: clamp(2rem, 4vw, 3rem);
    text-align: center;
}

.login-required-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
}

/* ==================== 7. GALLERY ==================== */

.gallery-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.upload-banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: clamp(1rem, 1.5vw, 1.5rem);
    background: linear-gradient(135deg, rgba(143, 91, 255, 0.12), rgba(19, 195, 255, 0.08));
    border: 1px solid rgba(143, 91, 255, 0.25);
    border-radius: var(--radius-lg);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: var(--space-md);
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* ==================== 7b. ADMIN PANEL ==================== */

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Roster cards in the admin panel */
.admin-member-card {
    gap: 0.5rem;
}

/* Profile / Edit / Remove stay on one row. */
.admin-member-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    width: 100%;
    margin-top: var(--space-sm);
}

.admin-member-actions .btn {
    width: 100%;
    padding: 0.4rem 0.35rem;
    font-size: 0.78rem;
}

.admin-member-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    width: 100%;
    margin: var(--space-sm) 0;
    padding: 0.6rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.admin-member-stats div {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.admin-member-stats strong {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1;
}

.admin-member-stats span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.admin-table td,
.admin-table th {
    vertical-align: middle;
}

.admin-table-wrapper {
    overflow-x: auto;
}

/* The admin content column hugged the edges - give it real side padding. */
.admin-section {
    padding-inline: clamp(1rem, 2vw, 2.25rem);
}

.admin-section-body,
.admin-card-body {
    padding-inline: clamp(0.25rem, 1vw, 1rem);
}

#memberRosterList .members-category-grid,
#memberRosterList .members-grid {
    padding-inline: clamp(0.25rem, 1vw, 0.75rem);
}

.role-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.45rem;
}

.role-picker .form-checkbox {
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--dark-3);
    color: var(--text);
    transition: all var(--transition-fast);
}

.role-picker .form-checkbox:hover {
    border-color: var(--primary);
}

.role-picker .form-checkbox input[type="checkbox"] {
    margin-top: 0;
}

.role-picker .form-checkbox:has(input:checked) {
    border-color: var(--primary);
    background: rgba(143, 91, 255, 0.12);
}

.form-range {
    width: 100%;
    height: 0.5rem;
    border-radius: var(--radius-full);
    background: var(--dark-4);
    accent-color: var(--primary);
    cursor: pointer;
}

/* Admin controlled activity meter (only shown when a value is set) */
.activity-meter {
    width: 100%;
    display: grid;
    gap: 0.3rem;
    margin: var(--space-sm) 0 0;
}

.activity-meter-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.activity-meter-head strong { font-size: 0.85rem; }

.activity-meter-bar {
    height: 0.45rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.activity-meter-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width var(--transition-normal);
}

.activity-high .activity-meter-head strong { color: var(--success); }
.activity-high .activity-meter-bar span { background: var(--success); box-shadow: 0 0 8px rgba(0, 255, 136, 0.5); }
.activity-mid .activity-meter-head strong { color: var(--warning); }
.activity-mid .activity-meter-bar span { background: var(--warning); box-shadow: 0 0 8px rgba(255, 187, 0, 0.45); }
.activity-low .activity-meter-head strong { color: #ff5b5b; }
.activity-low .activity-meter-bar span { background: #ff5b5b; box-shadow: 0 0 8px rgba(255, 91, 91, 0.45); }

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(143, 91, 255, 0.16);
    color: var(--primary-light);
}

.badge-success { background: rgba(0, 255, 136, 0.14); color: #7dffbe; }
.badge-danger { background: rgba(255, 71, 87, 0.14); color: #ff8b95; }
.badge-warning { background: rgba(255, 187, 0, 0.14); color: #ffd166; }
.badge-info { background: rgba(19, 195, 255, 0.14); color: #7fdcff; }
.badge-secondary { background: rgba(255, 255, 255, 0.07); color: var(--text-secondary); }

/* ==================== 7c. SIDEBAR WIDGETS ==================== */

.server-card {
    display: grid;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, rgba(143, 91, 255, 0.10), rgba(19, 195, 255, 0.05));
    border: 1px solid var(--border);
}

.server-card + .server-card { margin-top: 0.75rem; }

.server-card.is-offline {
    background: rgba(255, 71, 87, 0.06);
    border-color: rgba(255, 71, 87, 0.25);
}

.server-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.server-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.server-pill.online { background: rgba(0, 255, 136, 0.14); color: #7dffbe; }
.server-pill.offline { background: rgba(255, 71, 87, 0.14); color: #ff8b95; }

.server-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

.server-pill.online .server-dot {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6);
    animation: serverPulse 2s infinite;
}

@keyframes serverPulse {
    70% { box-shadow: 0 0 0 6px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.server-ping {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.server-name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
    word-break: break-word;
}

.server-players {
    display: grid;
    gap: 0.35rem;
}

.server-players-row,
.server-meta-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.server-players-row strong,
.server-meta-row span:last-child {
    color: var(--text);
    font-weight: 600;
}

.server-meta-row span:last-child {
    text-align: right;
    word-break: break-word;
}

.server-players-bar {
    height: 0.4rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.server-players-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--gradient-purple-blue);
    transition: width var(--transition-normal);
}

.server-roster {
    display: grid;
    gap: 0.4rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
}

.server-roster-title {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.server-roster-scroll {
    max-height: 13rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

.server-player-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.server-player-table th,
.server-player-table td {
    padding: 0.38rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    text-align: right;
    white-space: nowrap;
}

.server-player-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--dark-3);
    color: var(--text-muted);
    font-size: 0.61rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.server-player-table th:first-child,
.server-player-table td:first-child {
    padding-left: 0;
    text-align: left;
}

.server-player-table th:nth-child(2),
.server-player-table td:nth-child(2) { width: 3.4rem; }

.server-player-table th:nth-child(3),
.server-player-table td:nth-child(3) { width: 4.2rem; }

.server-player-table tbody tr:last-child td { border-bottom: 0; }

.server-player-name {
    overflow: hidden;
    color: var(--text);
    font-family: var(--font-primary);
    font-weight: 600;
    text-overflow: ellipsis;
}

.server-player-ping-unavailable { color: var(--text-muted); }

.server-player-empty {
    padding: 0.45rem 0;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.server-error {
    font-size: 0.8rem;
    color: #ff8b95;
}

.server-ip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.server-ip:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.server-ip span {
    flex: 1;
    min-width: 0;
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.server-card.is-loading .server-name { color: var(--text-muted); font-weight: 500; }

/* ==================== 8. MAINTENANCE PAGE ==================== */

.maintenance-container {
    max-width: 42rem;
    margin: clamp(3rem, 8vw, 6rem) auto;
    padding: clamp(2rem, 4vw, 3rem);
    text-align: center;
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.maintenance-icon {
    display: grid;
    place-items: center;
    width: 5rem;
    height: 5rem;
    margin: 0 auto var(--space-lg);
    border-radius: var(--radius-full);
    background: rgba(255, 187, 0, 0.12);
    color: var(--warning);
}

.maintenance-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.countdown-container {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.countdown-box {
    min-width: 5rem;
    padding: var(--space-md);
    background: var(--dark-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.countdown-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.admin-login-link {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== 9. FOOTER ==================== */

.footer-logo {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: var(--radius-md);
}

.footer-tagline {
    margin-top: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 24rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: var(--space-xl);
    grid-column: span 2;
}

.footer-column h4 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    margin-bottom: var(--space-md);
}

.footer-column ul {
    list-style: none;
    display: grid;
    gap: var(--space-sm);
}

.footer-column a {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.footer-column a:hover { color: var(--primary-light); }

/* "Follow Us" icons had no styling and rendered as bare boxes. */
.social-links {
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Higher specificity than the 40x40 icon-only rule in style.css. */
.social-links .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: auto;
    height: auto;
    min-height: 2.75rem;
    padding: 0.65rem 1.15rem;
    border-radius: var(--radius-md);
    background: var(--dark-3);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.social-links .social-link svg {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
}

.social-links .social-link:hover {
    transform: translateY(-2px);
    color: #fff;
    background: #5865f2;
    border-color: #5865f2;
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.35);
}

/* ==================== 10. SMALL SCREENS ==================== */

@media (max-width: 900px) {
    .forum-post {
        grid-template-columns: 1fr;
    }

    .post-sidebar {
        flex-direction: row;
        gap: var(--space-md);
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: var(--space-md);
    }

    .thread-stats {
        gap: var(--space-md);
    }
}

@media (max-width: 600px) {
    .page-header-section {
        align-items: flex-start;
    }

    .countdown-container {
        flex-wrap: wrap;
    }

    .thread-stats {
        display: none;
    }
}

/* ==================== 11. PHONES ==================== */

@media (max-width: 780px) {
    :root {
        --ysn-root-size: 15px;
    }

    /* Nothing may push the page sideways. */
    body {
        overflow-x: hidden;
    }

    .container {
        max-width: 100%;
        padding-inline: 0.9rem;
    }

    /* --- top bar / header --- */
    .top-bar .container {
        flex-wrap: wrap;
        gap: 0.35rem 0.9rem;
        justify-content: center;
        font-size: 0.78rem;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-md);
    }

    .header-brand {
        justify-content: center;
    }

    .header-stats {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
        width: 100%;
    }

    .header-stats .stat-card {
        min-width: 0;
        padding: 0.5rem 0.25rem;
    }

    .header-stats .stat-value { font-size: 1.05rem; }
    .header-stats .stat-label { font-size: 0.6rem; letter-spacing: 0.02em; }

    /* --- navigation: one scrollable row instead of a wrapped block --- */
    .nav-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .nav-links {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 0.15rem;
    }

    .nav-links::-webkit-scrollbar { display: none; }

    .nav-link {
        flex: 0 0 auto;
        padding: 0.7rem 0.75rem;
        font-size: 0.85rem;
    }

    /* the icon-only nav from style.css is unreadable - keep the labels */
    .nav-link span { display: inline; }

    .nav-user {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        padding-bottom: 0.4rem;
    }

    /* --- page layout --- */
    .layout-grid {
        display: flex;
        flex-direction: column;
        gap: var(--space-lg);
    }

    /* widgets are secondary on a phone - show them under the content */
    .layout-grid .sidebar { order: 2; }
    .layout-grid .main-content { order: 1; }

    .page-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    /* --- grids --- */
    .members-category-grid,
    .gallery-grid,
    .contact-methods-grid,
    .forum-stats-grid,
    .gallery-stats-grid,
    .member-stats-grid,
    .profile-stats-grid,
    .cw-stats-grid,
    .filter-grid,
    .form-grid,
    .admin-actions-grid,
    .application-requirements {
        grid-template-columns: 1fr;
    }

    .members-category-grid {
        grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
        gap: 0.75rem;
    }

    .member-avatar { width: 4.25rem; height: 4.25rem; }
    .member-name { font-size: 1rem; }
    .role-badge { padding: 0.4rem 0.7rem; font-size: 0.55rem; letter-spacing: 0.1em; }

    /* --- forum --- */
    .forum-category,
    .forum-thread {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .forum-cat-stats,
    .thread-stats {
        width: 100%;
        justify-content: flex-start;
        gap: var(--space-lg);
    }

    .forum-category-header .card-header,
    .forum-thread-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .forum-category-header .page-header-actions,
    .forum-thread-header .page-header-actions {
        width: 100%;
    }

    /* --- tables and dialogs --- */
    .admin-table-wrapper,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 44rem;
    }

    .modal {
        padding: 0.75rem;
    }

    .modal-dialog,
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
    }

    .modal-body {
        max-height: 72vh;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* --- admin panel --- */
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        padding: 0.4rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .admin-nav {
        display: flex;
        overflow-x: auto;
        gap: 0.25rem;
        scrollbar-width: none;
    }

    .admin-nav::-webkit-scrollbar { display: none; }

    .admin-nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .admin-header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .admin-section {
        padding-inline: 0.75rem;
    }

    .admin-member-actions {
        grid-template-columns: 1fr 1fr;
    }

    /* --- footer --- */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        text-align: center;
    }

    .footer-links {
        grid-column: auto;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
        text-align: left;
    }

    .footer-tagline { margin-inline: auto; }
    .social-links { justify-content: center; }

    /* --- misc --- */
    .auth-page { padding: 1rem 0.75rem; }
    .hero-actions .btn { width: 100%; }
}

@media (max-width: 420px) {
    .header-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .members-category-grid {
        grid-template-columns: 1fr;
    }

    .admin-member-actions {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   GALLERY MEDIA VIEWER
   Namespaced ysn-viewer-* so none of the two legacy .lightbox-* rule sets in
   style.css can reach it.
   ========================================================================== */

.ysn-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 1.5rem);
}
.ysn-viewer[hidden] { display: none; }

.ysn-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 8, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ysn-viewer-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    max-height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    background: linear-gradient(180deg, #0e0e16 0%, #08080d 100%);
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.75);
    animation: ysnViewerIn 0.18s ease-out;
}
@keyframes ysnViewerIn {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ysn-viewer-shell { animation: none; }
}

/* ---- top bar ---- */
.ysn-viewer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    padding: 0.85rem 1rem 0.85rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.ysn-viewer-heading { min-width: 0; }
.ysn-viewer-title {
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ysn-viewer-sub {
    margin: 0.15rem 0 0;
    color: rgba(255, 255, 255, 0.42);
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.ysn-viewer-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}
.ysn-viewer-counter {
    margin-right: 0.3rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-mono, monospace);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}

.ysn-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ysn-viewer-btn:hover {
    border-color: rgba(143, 91, 255, 0.55);
    background: rgba(143, 91, 255, 0.18);
    color: #fff;
}
.ysn-viewer-btn:focus-visible {
    outline: 2px solid var(--primary, #8f5bff);
    outline-offset: 2px;
}
.ysn-viewer-btn[hidden] { display: none; }
.ysn-viewer-btn-danger:hover {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}
.ysn-viewer-close { width: 2.3rem; height: 2.3rem; }

/* ---- stage ---- */
.ysn-viewer-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.9rem clamp(0.9rem, 4vw, 3.4rem);
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(143, 91, 255, 0.07), transparent 70%),
        #06060a;
}
.ysn-viewer-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    /* The stage owns the height, so a tall portrait clip cannot push the
       meta strip off screen. */
    max-height: min(72vh, 720px);
}
.ysn-viewer-media {
    display: block;
    max-width: 100%;
    max-height: min(72vh, 720px);
    width: auto;
    height: auto;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
.ysn-viewer-media[hidden] { display: none; }
video.ysn-viewer-media {
    /*
     * A <video> with no loaded metadata has an intrinsic size of 300x150, so
     * before the first frame arrives - or forever, if the fetch fails - it
     * collapses into a thin strip with the controls jammed against the
     * bottom. That is exactly what the broken player looked like. A declared
     * aspect ratio gives it a real box from the first paint, and contain
     * letterboxes a portrait clip instead of stretching it.
     */
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(72vh, 720px);
    object-fit: contain;
}

.ysn-viewer-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(10, 10, 16, 0.75);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ysn-viewer-nav:hover {
    border-color: rgba(143, 91, 255, 0.6);
    background: rgba(143, 91, 255, 0.22);
    color: #fff;
}
.ysn-viewer-nav:focus-visible {
    outline: 2px solid var(--primary, #8f5bff);
    outline-offset: 2px;
}
.ysn-viewer-nav[hidden] { visibility: hidden; display: inline-flex; }
.ysn-viewer-prev { margin-right: clamp(0.5rem, 2vw, 1.4rem); }
.ysn-viewer-next { margin-left: clamp(0.5rem, 2vw, 1.4rem); }

.ysn-viewer-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.ysn-viewer-spinner[hidden] { display: none; }
.ysn-viewer-spinner span {
    width: 2.4rem;
    height: 2.4rem;
    border: 2px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--primary, #8f5bff);
    border-radius: 50%;
    animation: ysnViewerSpin 0.8s linear infinite;
}
@keyframes ysnViewerSpin { to { transform: rotate(360deg); } }

.ysn-viewer-failed {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 34rem;
    padding: 1.5rem 1.75rem;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    color: #fecaca;
    font-size: 0.85rem;
    text-align: center;
}
.ysn-viewer-failed[hidden] { display: none; }
.ysn-viewer-failed span {
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    line-height: 1.6;
    word-break: break-all;
}

/* ---- meta strip ---- */
.ysn-viewer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.1rem;
    flex: 0 0 auto;
    padding: 0.85rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.015);
}
.ysn-viewer-fact {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}
.ysn-viewer-fact b {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 600;
}
.ysn-viewer-chip {
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(143, 91, 255, 0.4);
    border-radius: 999px;
    background: rgba(143, 91, 255, 0.16);
    color: #cbb6ff;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.ysn-viewer-note {
    flex: 1 0 100%;
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.82rem;
    line-height: 1.55;
}

@media (max-width: 640px) {
    .ysn-viewer { padding: 0; }
    .ysn-viewer-shell { width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; }
    .ysn-viewer-stage { padding: 0.6rem; }
    .ysn-viewer-nav { position: absolute; z-index: 2; }
    .ysn-viewer-prev { left: 0.5rem; margin: 0; }
    .ysn-viewer-next { right: 0.5rem; margin: 0; }
    .ysn-viewer-sub, .ysn-viewer-counter { display: none; }
}

/* ---- video cards in the grid ---- */
.gallery-card-image { position: relative; }
.gallery-card-video {
    /* object-fit matters: without it a 16:9 clip letterboxes inside the
       square tile and the card looks half empty. */
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #05050a;
}
.gallery-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.1rem;
    height: 3.1rem;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(10, 10, 16, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    pointer-events: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.gallery-card:hover .gallery-card-play,
.gallery-card:focus-visible .gallery-card-play {
    border-color: rgba(143, 91, 255, 0.75);
    background: rgba(143, 91, 255, 0.55);
    transform: translate(-50%, -50%) scale(1.07);
}
.gallery-card-duration {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.15rem 0.4rem;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.74);
    color: #fff;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
.gallery-card-duration:empty { display: none; }
.gallery-card-broken {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: #0b0b12;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
}
