:root {
    --font-main: Verdana, Arial, Helvetica, sans-serif;
    --font-accent: Tahoma, Verdana, Arial, sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.15s ease;
}

body {
    margin: 0;
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.4;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

    body.theme-light {
        --bg: #f3f1f8;
        --surface: #ffffff;
        --surface-alt: #f4ebff;
        --surface-muted: #efe7ff;
        --border: #b58cff;
        --border-strong: #8b5cf6;
        --text: #1e1633;
        --text-muted: #5e4f80;
        --link: #5b21b6;
        --link-hover: #7c3aed;
        --topbar: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
        --subbar: linear-gradient(180deg, #c4b5fd 0%, #a78bfa 100%);
        --card-header: linear-gradient(180deg, #b794f4 0%, #8b5cf6 100%);
        --button: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
        --button-hover: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
        --button-secondary: #ede9fe;
        --button-secondary-hover: #ddd6fe;
        --input-bg: #ffffff;
        --notification-unseen: #f8f0ff;
    }

    body.theme-dark {
        --bg: #1e1e1e;
        --surface: #252526;
        --surface-alt: #2d2d30;
        --surface-muted: #333337;
        --border: #3f3f46;
        --border-strong: #7c3aed;
        --text: #d4d4d4;
        --text-muted: #9da5b4;
        --link: #c084fc;
        --link-hover: #d8b4fe;
        --topbar: linear-gradient(180deg, #2d2d30 0%, #252526 100%);
        --subbar: linear-gradient(180deg, #37373d 0%, #2d2d30 100%);
        --card-header: linear-gradient(180deg, #5b3a91 0%, #7c3aed 100%);
        --button: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
        --button-hover: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
        --button-secondary: #37373d;
        --button-secondary-hover: #44444a;
        --input-bg: #1f1f22;
        --notification-unseen: #33284a;
    }

body {
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--link);
    text-decoration: none;
}

    a:hover {
        color: var(--link-hover);
        text-decoration: underline;
    }

.topbar {
    background: var(--topbar);
    border-bottom: 1px solid var(--border-strong);
    color: white;
}

.topbar-inner,
.subbar-inner,
.page-shell {
    max-width: 1200px;
    margin: 0 auto;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.top-link,
.top-link:visited {
    color: white;
    font-weight: bold;
}

    .top-link:hover {
        color: #f3e8ff;
    }

.top-username {
    color: #f3e8ff;
    font-weight: bold;
}

.subbar {
    background: var(--subbar);
    border-bottom: 1px solid var(--border);
}

.subbar-inner {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    flex-wrap: wrap;
}

.sub-link,
.sub-link:visited {
    color: var(--text);
    font-weight: bold;
}

.page-shell {
    padding: 20px 16px 40px 16px;
}

.page-title {
    margin-top: 0;
    color: var(--text);
    font-size: 32px;
}

.myspace-card {
    background: var(--surface);
    border: 2px solid var(--border-strong);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-md);
    overflow: visible;
    margin-bottom: 20px;
}

.card-header {
    background: var(--card-header);
    color: white;
    font-weight: bold;
    padding: 10px 14px;
    font-size: 18px;
}

.card-body {
    padding: 16px;
}

.profile-form {
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    gap: 6px;
}

.inline-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.themed-input,
.themed-select,
.themed-textarea {
    width: 100%;
    max-width: 500px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    box-sizing: border-box;
}

.themed-textarea {
    min-height: 100px;
    resize: vertical;
}

    .themed-input:focus,
    .themed-select:focus,
    .themed-textarea:focus {
        outline: 2px solid var(--border-strong);
        outline-offset: 1px;
    }

.themed-button,
.top-button {
    background: var(--button);
    color: white;
    border: 1px solid var(--border-strong);
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

    .themed-button:hover,
    .top-button:hover {
        background: var(--button-hover);
        transform: translateY(-1px);
    }

.secondary-button {
    background: var(--button-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

    .secondary-button:hover {
        background: var(--button-secondary-hover);
    }

.small-button {
    padding: 6px 10px;
    font-size: 12px;
}

.help-text {
    color: var(--text-muted);
    font-size: 12px;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.notifications-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: 95vw;
    height: 72vh;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.notifications-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--card-header);
    color: white;
}

    .notifications-modal-header h2 {
        margin: 0;
        font-size: 24px;
    }

.close-button {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    cursor: pointer;
    font-weight: bold;
}

.notifications-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
}

.notification-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
}

.notification-unseen {
    background: var(--notification-unseen);
    border-color: var(--border-strong);
}

.notification-title {
    font-weight: bold;
    margin-bottom: 6px;
}

.notification-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.notification-link-wrap {
    margin-bottom: 10px;
}

.notification-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.default-avatar {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .default-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

body.theme-light .default-avatar.male {
    background: linear-gradient(180deg, #ede9fe 0%, #ddd6fe 100%);
}

body.theme-light .default-avatar.female {
    background: linear-gradient(180deg, #f5e8ff 0%, #e9d5ff 100%);
}

body.theme-dark .default-avatar.male {
    background: linear-gradient(180deg, #2d2d30 0%, #37373d 100%);
}

body.theme-dark .default-avatar.female {
    background: linear-gradient(180deg, #372b42 0%, #4b3560 100%);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

table {
    border-collapse: collapse;
    background: var(--surface);
    color: var(--text);
}

    table th,
    table td {
        border: 1px solid var(--border);
        padding: 8px 10px;
    }

    table th {
        background: var(--surface-muted);
    }

@media (max-width: 768px) {
    .topbar-inner,
    .subbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .notifications-modal {
        width: 96vw;
        height: 80vh;
    }

    .page-title {
        font-size: 26px;
    }
}
.logo-text {
    color: white;
    font-weight: bold;
    font-size: 20px;
    letter-spacing: 0.5px;
}

.subbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    flex-wrap: wrap;
}

.subbar-left,
.subbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bell-link {
    font-weight: bold;
}
.profile-page {
    display: grid;
    gap: 18px;
}

.profile-top-header {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
    align-items: start;
}

.profile-display-name {
    margin: 0;
    font-size: 38px;
    line-height: 1.05;
}

.profile-headline {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 18px;
    font-style: italic;
}

.profile-network-box {
    background: var(--surface);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    text-align: center;
    font-size: 24px;
}

.profile-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    align-items: start;
}

.profile-left-column,
.profile-right-column {
    display: grid;
    gap: 18px;
}

.profile-photo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.profile-main-photo,
.profile-main-avatar {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
}

    .profile-main-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.profile-basic-details {
    display: grid;
    gap: 8px;
    color: var(--text);
}

.contact-actions {
    display: grid;
    gap: 12px;
}

.contact-row {
    color: var(--text);
}

.friendship-state-box {
    display: grid;
    gap: 10px;
}

.friends-status-wrap {
    position: relative;
    display: inline-block;
}

.friend-menu-details {
    position: relative;
    display: inline-block;
}

.friend-menu-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

    .friend-menu-summary::-webkit-details-marker {
        display: none;
    }

    .friend-menu-summary::marker {
        content: "";
    }

.gear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    background: var(--button-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

    .gear-button:hover {
        background: var(--button-secondary-hover);
    }

.friend-gear-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    min-width: 160px;
    z-index: 500;
    box-shadow: var(--shadow-soft);
}

.friend-menu-details[open] .friend-gear-menu {
    display: block;
}

.blurb-section {
    margin-bottom: 18px;
}

    .blurb-section:last-child {
        margin-bottom: 0;
    }

    .blurb-section h3 {
        margin: 0 0 8px 0;
        font-size: 24px;
        color: var(--text);
    }

    .blurb-section p {
        margin: 0;
        white-space: pre-wrap;
    }

.top8-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.top8-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: 10px;
    text-align: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

    .top8-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-soft);
    }

.top8-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

    .top8-link:hover {
        text-decoration: none;
    }

.top8-position-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--button);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 7px;
    border-radius: 999px;
}

.top8-avatar,
.top8-avatar-wrap {
    width: 90px;
    height: 90px;
    margin: 0 auto 8px auto;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.top8-name {
    display: block;
    overflow-wrap: anywhere;
}

.comment-form {
    display: grid;
    gap: 10px;
}

.comment-textarea {
    max-width: none;
    width: 100%;
}

.profile-comment-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: 12px;
    margin-bottom: 12px;
}

.profile-comment-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 8px;
}

.profile-comment-date {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.profile-comment-body {
    white-space: pre-wrap;
}

.delete-comment-form {
    margin-top: 10px;
}

@media (max-width: 960px) {
    .profile-top-header {
        grid-template-columns: 1fr;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .top8-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .profile-display-name {
        font-size: 30px;
    }

    .top8-grid {
        grid-template-columns: 1fr;
    }

    .profile-comment-header {
        flex-direction: column;
    }

    .profile-main-photo,
    .profile-main-avatar {
        width: 180px;
        height: 180px;
    }
}
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.friend-card-photo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.friend-card-photo,
.friend-card-photo-wrap-inner {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.friend-card-name {
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.friend-card-actions,
.friend-remove-form {
    margin-top: 10px;
}

.family-form {
    display: grid;
    gap: 10px;
}

.family-checkbox-row {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.family-list {
    margin: 0;
    padding-left: 18px;
}
.messages-page-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    align-items: start;
}

.messages-sidebar,
.messages-main {
    display: grid;
    gap: 18px;
}

.conversation-list {
    display: grid;
    gap: 10px;
}

.conversation-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: inherit;
    text-decoration: none;
}

    .conversation-item:hover {
        text-decoration: none;
        box-shadow: var(--shadow-soft);
    }

.conversation-item-active {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--border-strong) 35%, transparent);
}

.conversation-avatar,
.conversation-avatar-wrap {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.conversation-meta {
    min-width: 0;
}

.conversation-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.conversation-preview {
    color: var(--text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-date {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 4px;
}

.conversation-unread {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--button);
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-thread-scroll,
.profile-message-thread {
    max-height: 420px;
    overflow-y: auto;
    display: grid;
    gap: 10px;
    padding-right: 4px;
    margin-bottom: 12px;
}

.thread-message {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
}

.thread-message-mine {
    margin-left: auto;
    background: color-mix(in srgb, var(--border-strong) 12%, var(--surface));
}

.thread-message-theirs {
    margin-right: auto;
}

.thread-message-body {
    white-space: pre-wrap;
}

.thread-message-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.message-send-form {
    display: grid;
    gap: 10px;
}

@media (max-width: 960px) {
    .messages-page-layout {
        grid-template-columns: 1fr;
    }
}
.groups-page-layout {
    display: grid;
    gap: 18px;
}

.group-list {
    display: grid;
    gap: 12px;
}

.group-list-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: 10px;
    color: inherit;
    text-decoration: none;
}

    .group-list-item:hover {
        text-decoration: none;
        box-shadow: var(--shadow-soft);
    }

.group-list-image,
.group-list-image-placeholder {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: bold;
}

.group-list-meta {
    min-width: 0;
}

.group-list-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.group-list-subtext {
    color: var(--text-muted);
    font-size: 12px;
}

.group-view-page {
    display: grid;
    gap: 18px;
}

.group-hero {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: start;
}

.group-hero-image,
.group-hero-image-wrap img {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
}

.group-hero-meta {
    display: grid;
    gap: 10px;
}

.group-description-block {
    white-space: pre-wrap;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
}

.group-action-row {
    margin-top: 6px;
}

.group-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.group-member-card {
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: 10px;
}

.group-member-avatar,
.group-member-avatar-wrap {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin: 0 auto 8px auto;
}

.group-member-name {
    font-weight: bold;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.group-member-role {
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 700px) {
    .group-hero {
        grid-template-columns: 1fr;
    }

    .group-hero-image,
    .group-hero-image-wrap img {
        width: 140px;
        height: 140px;
    }
}
.groups-manage-layout {
    display: grid;
    gap: 18px;
}

.group-manage-list {
    display: grid;
    gap: 12px;
}

.group-manage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: 12px;
}

.group-manage-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.group-manage-avatar,
.group-manage-avatar-wrap {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.group-manage-username {
    font-weight: bold;
    overflow-wrap: anywhere;
}

.group-manage-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

.group-manage-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.group-role-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.group-role-select {
    width: auto;
    min-width: 130px;
}

.group-manage-owner-badge {
    font-weight: bold;
    color: var(--text-muted);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.group-phase3-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
    align-items: start;
}

.group-feed-column,
.group-chat-column {
    display: grid;
    gap: 18px;
}

.group-post-form,
.group-comment-form,
.group-reply-form,
.group-chat-form {
    display: grid;
    gap: 10px;
}

.group-post-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: 14px;
    margin-bottom: 16px;
}

.group-post-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.group-post-user,
.group-comment-user,
.group-chat-user {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.group-post-avatar,
.group-post-avatar-wrap,
.group-comment-avatar,
.group-comment-avatar-wrap,
.group-chat-avatar,
.group-chat-avatar-wrap {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.group-post-username,
.group-comment-username,
.group-chat-username {
    font-weight: bold;
}

.group-post-date,
.group-comment-date,
.group-chat-date {
    font-size: 12px;
    color: var(--text-muted);
}

.group-post-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.group-post-content,
.group-comment-content,
.group-chat-content {
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.group-post-image,
.group-comment-image,
.group-chat-image {
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.group-post-image-wrap,
.group-comment-image-wrap,
.group-chat-image-wrap {
    margin-bottom: 10px;
}

.group-post-comments {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}

    .group-post-comments h4 {
        margin: 0 0 10px 0;
    }

.group-comment-card,
.group-reply-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 10px;
    margin-bottom: 10px;
}

.group-replies-wrap {
    margin-top: 10px;
    margin-left: 24px;
}

.group-chat-scroll {
    max-height: 700px;
    overflow-y: auto;
    display: grid;
    gap: 12px;
    padding-right: 4px;
    margin-bottom: 12px;
}

.group-chat-message {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: 10px;
}

.group-chat-meta {
    min-width: 0;
}

.group-post-flag {
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.group-locked-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

@media (max-width: 980px) {
    .group-phase3-layout {
        grid-template-columns: 1fr;
    }
}
.group-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: 8px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--button);
    color: white;
    font-size: 12px;
    font-weight: bold;
    vertical-align: middle;
}
.group-manage-current-image-wrap {
    margin-bottom: 10px;
}

.group-manage-current-image {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: block;
}
.group-description-block {
    white-space: pre-wrap;
}
.validation-summary {
    color: #ffb3b3;
    margin-bottom: 12px;
}

.color-input {
    width: 90px;
    height: 42px;
    padding: 4px;
}

.multi-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.profile-custom-banner-wrap {
    margin-bottom: 16px;
}

.profile-custom-banner {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    display: block;
}

.profile-song-autoplay-note {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.8;
}
.link-preview-card {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    overflow: hidden;
}

.link-preview-generic {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

    .link-preview-generic:hover {
        text-decoration: none;
    }

.link-preview-thumb-wrap {
    width: 120px;
    height: 120px;
    overflow: hidden;
    background: var(--surface-muted);
}

.link-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.link-preview-meta {
    padding: 12px;
    min-width: 0;
}

.link-preview-title {
    font-weight: bold;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.link-preview-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.link-preview-site {
    font-size: 12px;
    color: var(--text-muted);
}

.link-preview-image-wrap,
.link-preview-audio-wrap,
.link-preview-video-wrap,
.link-preview-embed-wrap {
    width: 100%;
    background: #000;
}

.link-preview-image {
    display: block;
    max-width: 100%;
    max-height: 420px;
    width: 100%;
    object-fit: contain;
    background: #000;
}

.link-preview-audio-wrap audio,
.link-preview-video-wrap video {
    width: 100%;
    display: block;
}

.link-preview-embed-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}

    .link-preview-embed-wrap iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

@media (max-width: 700px) {
    .link-preview-generic {
        grid-template-columns: 1fr;
    }

    .link-preview-thumb-wrap {
        width: 100%;
        height: 180px;
    }
}

* {
    box-sizing: border-box;
}

.arcade-page {
    max-width: 1380px;
    margin: 0 auto;
    padding: 22px;
}

.arcade-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
    padding: 20px;
    border: 2px solid #79e8ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #24183a 0%, #100b1d 100%);
    box-shadow: 0 0 24px rgba(121, 232, 255, 0.22), inset 0 0 24px rgba(255,255,255,0.05);
}

    .arcade-header h1 {
        margin: 0 0 8px;
        color: #ff8de3;
        text-shadow: 0 0 12px rgba(255, 141, 227, 0.45);
    }

    .arcade-header p {
        margin: 0;
        color: #d6dcff;
    }

.arcade-header-actions {
    display: flex;
    gap: 10px;
}

.arcade-button {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    background: linear-gradient(180deg, #ff8de3 0%, #ff48be 100%);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 0 12px rgba(255, 72, 190, 0.35);
}

    .arcade-button.secondary {
        background: linear-gradient(180deg, #73efff 0%, #3ab4ff 100%);
        box-shadow: 0 0 12px rgba(58, 180, 255, 0.35);
    }

.arcade-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
}

.game-panel,
.leaderboard-panel {
    border: 2px solid #79e8ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #1d1631 0%, #0d0a18 100%);
    box-shadow: 0 0 24px rgba(121, 232, 255, 0.18), inset 0 0 18px rgba(255,255,255,0.04);
    padding: 18px;
}

.score-strip {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.score-chip {
    padding: 10px 14px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(121, 232, 255, 0.3);
}

.canvas-shell {
    position: relative;
    width: 420px;
    max-width: 100%;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 420px;
    border: 3px solid #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.28);
    background: #9ee7ff;
}

.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

    .game-overlay.visible {
        opacity: 1;
    }

.overlay-card {
    max-width: 310px;
    padding: 18px 20px;
    border-radius: 14px;
    text-align: center;
    background: rgba(10, 8, 20, 0.82);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
}

    .overlay-card h2 {
        margin: 0 0 8px;
        color: #ff8de3;
    }

    .overlay-card p {
        margin: 0;
        line-height: 1.5;
    }

.instructions-panel {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: #d5dcff;
}

.leaderboard-header h2 {
    margin: 0 0 6px;
    color: #ff8de3;
    text-shadow: 0 0 12px rgba(255, 141, 227, 0.35);
}

.leaderboard-header p {
    margin: 0 0 14px;
    color: #c9d2ff;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(121, 232, 255, 0.18);
    color: #fff;
}

.leaderboard-rank {
    width: 52px;
    font-weight: bold;
    color: #76e9ff;
}

.leaderboard-main {
    flex: 1;
}

.leaderboard-name {
    font-weight: bold;
}

.leaderboard-date {
    font-size: 0.85rem;
    color: #c3caeb;
}

.leaderboard-score {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffe16d;
}

.leaderboard-empty {
    color: #d4dcff;
    padding: 12px 0;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    gap: 20px;
}

.game-card-thumb {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-title {
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 0 14px rgba(255,255,255,0.28);
}

.game-card-body {
    padding: 18px;
}

    .game-card-body h2 {
        margin: 0 0 8px;
        color: white;
    }

    .game-card-body p {
        margin: 0 0 14px;
        color: white;
    }

@media (max-width: 980px) {
    .arcade-layout {
        grid-template-columns: 1fr;
    }
}
.comingsoon-thumb {
    background: linear-gradient(135deg, #686868 0%, #363636 100%);
}
.login_controls{
    max-width: 300px !important;
}
.games-grid .card-body p {
    color: var(--text);
}
.games-grid a.myspace-card {
    color: var(--text);
    text-decoration: none;
}

    .games-grid a.myspace-card:hover {
        text-decoration: none;
    }

.games-grid .card-body p {
    color: var(--text);
}
.games-play-page {
    display: grid;
    gap: 20px;
}

.games-play-hero-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

    .games-play-hero-body h1 {
        margin: 0 0 8px 0;
        color: var(--text);
        font-size: 36px;
    }

    .games-play-hero-body p {
        margin: 0;
        color: var(--text-muted);
        font-size: 16px;
        font-weight: bold;
    }

.games-play-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.games-play-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px 320px;
    gap: 20px;
    align-items: start;
}

.game-play-card .card-body {
    display: grid;
    gap: 14px;
}

.score-strip {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.score-chip {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-weight: bold;
}

.canvas-shell {
    position: relative;
    width: 420px;
    max-width: 100%;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 420px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    background: #9ee7ff;
}

.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

    .game-overlay.visible {
        opacity: 1;
    }

.overlay-card {
    max-width: 310px;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

    .overlay-card h2 {
        margin: 0 0 8px 0;
        color: var(--text);
    }

    .overlay-card p {
        margin: 0;
        color: var(--text-muted);
        line-height: 1.5;
    }

.instructions-panel {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
}

.leaderboard-subtitle {
    margin: 0 0 14px 0;
    color: var(--text-muted);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
}

.leaderboard-rank {
    width: 52px;
    font-weight: bold;
    color: var(--link);
}

.leaderboard-main {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-weight: bold;
    color: var(--text);
}

.leaderboard-date {
    font-size: 12px;
    color: var(--text-muted);
}

.leaderboard-score {
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
}

.leaderboard-empty {
    color: var(--text-muted);
    padding: 12px 0;
}

@media (max-width: 1180px) {
    .games-play-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

@media (max-width: 860px) {
    .games-play-layout {
        grid-template-columns: 1fr;
    }

    .canvas-shell {
        margin: 0 auto;
    }
}
.game-play-wrapper {
    overflow: visible;
}

.game-play-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.game-left {
    flex: 0 0 440px;
}

.game-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.leaderboard-section h3 {
    margin: 0 0 6px 0;
    color: var(--text);
}

.leaderboard-section {
    background: var(--surface-alt);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.game-play-inner {
    display: grid;
    grid-template-columns: 450px 330px 330px;
    gap: 16px;
    align-items: start;
}

.game-left {
    width: 450px;
}

/* make each leaderboard its own column */
.game-right {
    display: contents;
}

/* force each leaderboard to stay in its column */
.leaderboard-section {
    width: 100%;
}

.leaderboard-section {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

    .leaderboard-section h3 {
        margin: 0 0 6px 0;
    }

@media (max-width: 900px) {
    .game-play-inner {
        grid-template-columns: 1fr;
    }

    .game-left {
        width: 100%;
    }
}
.duckshoot-thumb {
    background: var(--card-header);
}

/* MyFriendsSpace mobile UX 02: additive, scoped responsive safeguards. */
@media (max-width: 767px) {
  html, body { max-width:100%; overflow-x:clip; }
  .page-shell { min-width:0; padding:12px 10px 28px; }
  .topbar-inner, .subbar-inner { min-width:0; gap:8px; padding:9px 10px; }
  .topbar-left, .topbar-right { min-width:0; max-width:100%; gap:8px; }
  .top-username { overflow-wrap:anywhere; }
  .subbar-inner { flex-direction:row; flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
  .subbar-inner .sub-link { white-space:nowrap; flex:0 0 auto; min-height:38px; display:inline-flex; align-items:center; }
  .myspace-card, .card-body, .profile-layout, .messages-page-layout, .groups-page-layout, .games-play-layout, .game-play-inner { min-width:0; max-width:100%; }
  .card-body { padding:12px; }
  .page-title { font-size:clamp(22px,6vw,32px); overflow-wrap:anywhere; }
  img, video { max-width:100%; height:auto; }
  input:not([type=checkbox]):not([type=radio]), textarea, select { max-width:100%; min-width:0; font-size:max(16px,1em); }
  .notifications-modal { max-width:calc(100vw - 20px); max-height:calc(100dvh - 24px); }
  .notifications-modal-body { overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  .game-play-inner { display:grid; grid-template-columns:minmax(0,1fr); }
  .game-left { min-width:0; max-width:100%; width:100%; flex-basis:auto; }
  .game-right { min-width:0; }
  .game-play-wrapper, .canvas-shell { max-width:100%; min-width:0; }
  #gameCanvas { max-width:100%; height:auto; touch-action:manipulation; }
  /* Wide data tables should scroll inside their own area, never force a full-page sideways pan. */
  .card-body table, .page-shell table { max-width:100%; }
}
@media (max-width: 400px) {
  .topbar-inner { align-items:flex-start; }
  .card-header { font-size:16px; }
  .card-body { padding:10px; }
}
