/* ============================= */
/* shadcn dark theme             */
/* ============================= */

:root {
    --background: #0a0a0a;
    --foreground: #fafafa;
    --card: #171717;
    --card-foreground: #fafafa;
    --popover: #171717;
    --popover-foreground: #fafafa;
    --primary: #e5e5e5;
    --primary-foreground: #171717;
    --secondary: #262626;
    --secondary-foreground: #fafafa;
    --muted: #262626;
    --muted-foreground: #a3a3a3;
    --accent: #262626;
    --accent-foreground: #fafafa;
    --destructive: #7f1d1d;
    --destructive-foreground: #fafafa;
    --border: rgba(255, 255, 255, 0.1);
    --input: rgba(255, 255, 255, 0.1);
    --ring: #737373;
    --radius-sm: 4px;
    --radius: 0.5rem;
    --radius-lg: 12px;
    --radius-pill: 9999px;
    --surface-dark: #0d1017;
    --destructive-fg: #ef4444;
    --success: #22c55e;
    --warning: #eab308;
}

/* ============================= */
/* Subtle background glow        */
/* ============================= */

.bg-motion {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bg-motion__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 15% 0%, hsla(0, 0%, 20%, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 85% 100%, hsla(0, 0%, 18%, 0.12) 0%, transparent 70%);
}

.bg-motion__grain {
    display: none;
}

/* ============================= */
/* Reset & base                  */
/* ============================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--background);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--foreground);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

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

.container {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.container--narrow {
    max-width: 440px;
}

/* ============================= */
/* Top nav                       */
/* ============================= */

.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.topnav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    color: var(--foreground);
}

.topnav__brand svg {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.topnav__links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topnav__link {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-foreground);
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}

.topnav__link:hover {
    color: var(--foreground);
    background: var(--secondary);
}

/* Edit button in navbar — only on profile page */
.topnav__edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary, #4d9fff);
    background: rgba(77,159,255,0.08);
    border: 1px solid rgba(77,159,255,0.2);
    border-radius: var(--radius);
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.topnav__edit-btn:hover {
    background: rgba(77,159,255,0.15);
    border-color: rgba(77,159,255,0.4);
}

body.layout-editing .topnav__edit-btn {
    display: none;
}

/* Viewer auth in navbar */
.topnav__viewer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted-foreground);
}
.topnav__viewer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.topnav__viewer-name {
    font-weight: 500;
    color: var(--foreground);
}
.topnav__suggest-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #7c8cf8;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid rgba(124,140,248,0.3);
    border-radius: 6px;
    background: rgba(124,140,248,0.08);
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.topnav__suggest-btn:hover {
    background: rgba(124,140,248,0.16);
    border-color: rgba(124,140,248,0.5);
}
.topnav__viewer-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #9147ff;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid rgba(145,71,255,0.35);
    border-radius: 6px;
    background: rgba(145,71,255,0.07);
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.topnav__viewer-login:hover {
    background: rgba(145,71,255,0.14);
    border-color: rgba(145,71,255,0.5);
}

/* Status navigation (route-based tabs) */
.status-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.status-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted-foreground);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.status-nav__link:hover {
    color: var(--foreground);
    background: var(--secondary);
}
.status-nav__link--active {
    color: var(--foreground);
    background: var(--secondary);
    border-color: var(--border);
}
.status-nav__link--alt {
    margin-left: auto;
    color: var(--muted-foreground);
    opacity: 0.7;
}
.status-nav__link--alt:hover {
    opacity: 1;
}

/* ============================= */
/* Typography                    */
/* ============================= */

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--muted-foreground);
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted-foreground);
    background: var(--secondary);
    padding: 2px 8px;
    border-radius: 9999px;
}

hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ============================= */
/* Card                          */
/* ============================= */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    padding: 24px;
}

.card--flush {
    padding: 0;
}

.card__header {
    padding: 20px 24px 0;
    margin-bottom: 16px;
}

.card__body {
    padding: 0 24px 20px;
}

/* ============================= */
/* Buttons                       */
/* ============================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn--primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn--primary:hover {
    opacity: 0.9;
}

.btn--secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.btn--secondary:hover {
    background: #2e2e2e;
}

.btn--outline {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn--outline:hover {
    background: var(--secondary);
}

.btn--ghost {
    background: transparent;
    color: var(--foreground);
}

.btn--ghost:hover {
    background: var(--secondary);
}

.btn--destructive {
    background: var(--destructive);
    color: var(--destructive-foreground);
}

.btn--destructive:hover {
    opacity: 0.9;
}

.btn--sm {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: var(--radius);
}

.btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn--icon svg {
    width: 16px;
    height: 16px;
}

.btn--block {
    width: 100%;
}

/* ============================= */
/* Form inputs                   */
/* ============================= */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(115, 115, 115, 0.15);
}

.form-input::placeholder {
    color: var(--muted-foreground);
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: border-color 0.15s;
}

.form-select:focus {
    border-color: var(--ring);
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius);
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.15s;
}

.form-textarea:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(115, 115, 115, 0.15);
}

.form-hint {
    font-size: 13px;
    color: var(--muted-foreground);
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-row > .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ============================= */
/* Badges                        */
/* ============================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    line-height: 1.4;
}

.badge--primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.badge--secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.badge--outline {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.badge--success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge--destructive {
    background: rgba(127, 29, 29, 0.2);
    color: #ef4444;
}

.badge--warning {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

/* ============================= */
/* Alert / Flash messages        */
/* ============================= */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--border);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert--error {
    background: rgba(127, 29, 29, 0.1);
    border-color: var(--destructive);
    color: #ef4444;
}

.alert--success {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert--info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #60a5fa;
}

/* ============================= */
/* Toast notifications           */
/* ============================= */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--foreground);
    font-size: 14px;
    line-height: 1.4;
    pointer-events: auto;
    animation: toast-in 0.3s ease-out both;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.toast--success {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.08);
}

.toast--error {
    border-color: var(--destructive);
    background: rgba(127, 29, 29, 0.15);
}

.toast--info {
    border-color: var(--ring);
}

.toast--removing {
    animation: toast-out 0.25s ease-in both;
}

.toast__close {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 2px;
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.15s;
}

.toast__close:hover {
    color: var(--foreground);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* ============================= */
/* Avatar                        */
/* ============================= */

.avatar {
    border-radius: 9999px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--muted);
}

.avatar--sm {
    width: 32px;
    height: 32px;
}

.avatar--md {
    width: 48px;
    height: 48px;
}

.avatar--lg {
    width: 80px;
    height: 80px;
}

.avatar--xl {
    width: 120px;
    height: 120px;
}

/* ============================= */
/* Tabs                          */
/* ============================= */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 0;
    margin-bottom: 20px;
}

.tab {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-foreground);
    background: none;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.tab:hover {
    color: var(--foreground);
}

.tab.active {
    color: var(--foreground);
    border-bottom-color: var(--foreground);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ============================= */
/* Streamer grid (home)          */
/* ============================= */

.streamer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.streamer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    transition: background 0.15s, border-color 0.15s;
    text-align: center;
}

.streamer-card:hover {
    background: var(--secondary);
    border-color: #333;
}

.streamer-card__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
}

.streamer-card--live {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.2), inset 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.streamer-card--live:hover {
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.3), inset 0 0 0 1px rgba(34, 197, 94, 0.15);
}

.streamer-card__live-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fff;
    background: #22c55e;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1.4;
}

/* ============================= */
/* Game card                     */
/* ============================= */

.game-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.game-card:hover {
    background: #141414;
    border-color: #333;
    transform: translateX(2px);
}

.game-card__cover {
    width: 100px;
    height: 47px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.game-card__no-cover {
    width: 100px;
    height: 47px;
    border-radius: var(--radius);
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--muted-foreground);
    font-size: 11px;
}

.game-card__info {
    flex: 1;
    min-width: 0;
}

.game-card__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card__comment {
    font-size: var(--comment-font-size, 13px);
    color: var(--muted-foreground);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card__rating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 28px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--secondary);
}

/* Rating colors */
.rating--high {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.rating--mid {
    color: var(--warning);
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.rating--low {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.game-card__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ============================= */
/* Dashboard navigation          */
/* ============================= */

.dashboard-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.dashboard-nav__link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-foreground);
    padding: 10px 16px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    text-decoration: none;
}

.dashboard-nav__link:hover {
    color: var(--foreground);
}

.dashboard-nav__link--active {
    color: var(--foreground);
    border-bottom-color: var(--foreground);
}

/* ============================= */
/* Profile header                */
/* ============================= */

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 0;
    text-align: center;
}

.profile-header__name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    margin-right: 4px;
}

.status-dot--online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.status-dot--offline {
    background: var(--muted-foreground);
}

/* Online avatar glow */
.avatar--online {
    box-shadow: 0 0 0 3px var(--background), 0 0 0 5px rgba(34, 197, 94, 0.35);
}

/* ============================= */
/* Profile background            */
/* ============================= */

.profile-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.profile-bg--image {
    background-size: cover;
    background-position: center top;
}

.profile-bg--video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-bg__overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

/* Profile avatar area */
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
}

/* Telegram icon on profile */
.profile-telegram {
    position: absolute;
    top: 0;
    right: -32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: var(--muted-foreground);
    transition: color 0.15s;
}

.profile-telegram:hover {
    color: var(--foreground);
}

/* Profile name link */
.profile-name-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: border-color 0.15s;
}

.profile-name-link:hover {
    border-color: #9147ff;
}

/* Status display */
.profile-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.profile-status__live {
    color: var(--success);
    font-weight: 500;
}

/* Profile stats badges */
.profile-badges {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

/* Sort/filter bar */
.sort-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.sort-bar__label {
    font-size: 12px;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.sort-bar__spacer {
    margin-left: auto;
}

/* Tabs + view toggle row */
.tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tabs--borderless {
    border-bottom: none;
    flex: 1;
}

.view-toggle {
    display: flex;
    gap: 4px;
    padding-bottom: 4px;
}

/* Game card cover wrapper */
.game-card__cover-wrap {
    position: relative;
}

/* Game card info inline */
.game-card__info-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.game-card__ordered-by {
    font-size: 12px;
    color: #4b5563;
    white-space: nowrap;
}

/* ============================= */
/* Dashboard game management     */
/* ============================= */

.game-manage {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.game-manage .form-select,
.game-manage .form-input {
    width: auto;
    padding: 4px 8px;
    font-size: 13px;
}

.comment-form {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.comment-form textarea {
    flex: 1;
    min-height: 32px;
    height: 32px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 13px;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius);
    resize: none;
    outline: none;
    transition: border-color 0.15s;
}

.comment-form textarea:focus {
    border-color: var(--ring);
}

/* ============================= */
/* Steam search results          */
/* ============================= */

.steam-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    margin-bottom: 8px;
}

.steam-result__cover {
    width: 120px;
    height: 56px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

.steam-result__info {
    flex: 1;
    min-width: 0;
}

.steam-result__title {
    font-size: 14px;
    font-weight: 500;
}

.steam-result__form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.steam-result__form .form-input {
    width: 70px;
    padding: 6px 8px;
    text-align: center;
    font-size: 13px;
}

/* ============================= */
/* Auth pages                    */
/* ============================= */

.auth-page {
    padding-top: 48px;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-link {
    color: var(--foreground);
    text-decoration: underline;
}

/* ============================= */
/* Error pages                   */
/* ============================= */

.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page__code {
    font-size: 72px;
    font-weight: 700;
    color: var(--muted-foreground);
    line-height: 1;
    margin-bottom: 16px;
}

.error-page__title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-page__text {
    font-size: 14px;
    color: var(--muted-foreground);
    margin-bottom: 24px;
}

/* ============================= */
/* Empty state                   */
/* ============================= */

/* ============================= */
/* Show more / toggle            */
/* ============================= */

.hidden-games {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.hidden-games.open {
    max-height: 10000px;
    opacity: 1;
}

.toggle-more {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* ============================= */
/* Search                        */
/* ============================= */

.search-wrap {
    position: relative;
    margin-bottom: 20px;
}

.search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted-foreground);
    pointer-events: none;
}

.search-wrap .form-input {
    padding-left: 36px;
}

/* ============================= */
/* Separator text                */
/* ============================= */

.separator-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted-foreground);
    margin: 16px 0;
}

.separator-text::before,
.separator-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================= */
/* Utility                       */
/* ============================= */

.text-muted {
    color: var(--muted-foreground);
}

.text-sm {
    font-size: 13px;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.mt-6 {
    margin-top: 24px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.gap-2 {
    gap: 8px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

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

.w-full {
    width: 100%;
}

/* ============================= */
/* Dashboard utilities           */
/* ============================= */

.flex-1 { flex: 1; min-width: 0; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.self-start { align-self: flex-start; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.text-xs { font-size: 12px; }
.text-error { color: #e55; }

/* Topnav logo */
.topnav__logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

/* Dashboard inline form row */
.dash-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Dashboard film list item */
.dash-film-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

/* Dashboard film thumbnail */
.dash-film-thumb {
    width: 48px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #0d1017;
}

/* Dashboard film add form */
.dash-film-add {
    display: none;
    background: var(--card-hover, #1a1f2e);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.dash-film-add__poster {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #0d1017;
}

/* Background upload modal */
.bg-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.bg-modal__content {
    max-width: 480px;
    margin: 120px auto;
    background: var(--card, #111520);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

.bg-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bg-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.bg-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    font-size: 24px;
    line-height: 1;
    padding: 0 4px;
}

.bg-modal__desc {
    font-size: 13px;
    color: #9ca3b0;
    margin: 0 0 20px;
}

.bg-dropzone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s;
    margin-bottom: 16px;
}

.bg-dropzone__icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.bg-dropzone__text {
    font-size: 13px;
    color: #9ca3b0;
}

.bg-dropzone__hint {
    font-size: 11px;
    color: var(--muted-foreground);
    margin-top: 6px;
}

.bg-preview {
    display: none;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.bg-preview__img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
}

.bg-upload-status {
    margin-top: 10px;
    font-size: 12px;
    text-align: center;
}

/* Wishlist item */
.wishlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
}

.wishlist-item__cover {
    width: 92px;
    height: 43px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.wishlist-item__no-cover {
    width: 92px;
    height: 43px;
    background: var(--border);
    border-radius: 4px;
    flex-shrink: 0;
}

.wishlist-item__title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.wishlist-item__delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 4px;
    transition: color 0.15s;
}

.wishlist-item__delete:hover {
    color: #ef4444;
}

/* Film search result item (in JS template) */
.film-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.film-result-item:hover {
    background: var(--card-hover, #1a1f2e);
}

.film-result-item__poster {
    width: 36px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.film-result-item__no-poster {
    width: 36px;
    height: 54px;
    background: #0d1017;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Dashboard sort controls */
.sort-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.sort-controls__label {
    font-size: 12px;
    color: var(--muted-foreground);
    white-space: nowrap;
}

/* Dashboard game item sidebar */
.game-item__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
}

/* Save feedback indicator */
.save-feedback {
    font-size: 11px;
    color: var(--success);
    opacity: 0;
    transition: opacity 0.3s;
}

/* Film poster empty text */
.film-poster-empty__text {
    font-size: 11px;
    color: #374151;
    letter-spacing: 0.05em;
}

/* Avatar initial fallback */
.avatar--initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
}

/* Home page header */
.home-header {
    margin-bottom: 24px;
}

/* ============================= */
/* Modal/Dialog                  */
/* ============================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.15s ease-out;
}

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: scale-in 0.2s ease-out;
}

.modal__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal__text {
    font-size: 14px;
    color: var(--muted-foreground);
    margin-bottom: 20px;
}

.modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--foreground);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================= */
/* Stats bar                     */
/* ============================= */

.stats-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
}

.stats-bar__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted-foreground);
}

.stats-bar__value {
    font-weight: 600;
    color: var(--foreground);
}

.stats-bar__item--success .stats-bar__value { color: var(--success); }
.stats-bar__item--destructive .stats-bar__value { color: #ef4444; }
.stats-bar__item--warning .stats-bar__value { color: var(--warning); }

.stats-bar__item svg {
    width: 14px;
    height: 14px;
    color: var(--muted-foreground);
}

/* ============================= */
/* Enhanced empty state           */
/* ============================= */

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted-foreground);
}

.empty-state__icon {
    display: block;
    margin: 0 auto 16px;
    opacity: 0.3;
}

.empty-state__text {
    font-size: 15px;
    margin-bottom: 16px;
}

.empty-state__cta {
    display: inline-flex;
}

/* ============================= */
/* Entrance animations           */
/* ============================= */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.page-title {
    animation: fade-in-up 0.4s ease-out both;
}

.page-subtitle {
    animation: fade-in-up 0.4s ease-out 0.05s both;
}

.card {
    animation: fade-in-up 0.4s ease-out 0.1s both;
}

.streamer-card {
    animation: fade-in-up 0.35s ease-out both;
}

.streamer-card:nth-child(1) { animation-delay: 0.05s; }
.streamer-card:nth-child(2) { animation-delay: 0.1s; }
.streamer-card:nth-child(3) { animation-delay: 0.15s; }
.streamer-card:nth-child(4) { animation-delay: 0.2s; }
.streamer-card:nth-child(5) { animation-delay: 0.25s; }
.streamer-card:nth-child(6) { animation-delay: 0.3s; }
.streamer-card:nth-child(n+7) { animation-delay: 0.35s; }

.game-card {
    animation: fade-in-up 0.3s ease-out both;
}

.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.06s; }
.game-card:nth-child(4) { animation-delay: 0.08s; }
.game-card:nth-child(5) { animation-delay: 0.1s; }
.game-card:nth-child(n+6) { animation-delay: 0.12s; }

.profile-header {
    animation: fade-in-up 0.5s ease-out both;
}

.alert {
    animation: fade-in-up 0.3s ease-out both;
}

.steam-result {
    animation: scale-in 0.25s ease-out both;
}

.steam-result:nth-child(1) { animation-delay: 0.05s; }
.steam-result:nth-child(2) { animation-delay: 0.1s; }
.steam-result:nth-child(3) { animation-delay: 0.15s; }
.steam-result:nth-child(4) { animation-delay: 0.2s; }
.steam-result:nth-child(5) { animation-delay: 0.25s; }

/* ============================= */
/* Pulse & glow animations       */
/* ============================= */

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 12px rgba(34, 197, 94, 0.7); }
}

.status-dot--online {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes glow-ring {
    0%, 100% { box-shadow: 0 0 0 3px var(--background), 0 0 0 5px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 0 0 3px var(--background), 0 0 0 6px rgba(34, 197, 94, 0.5), 0 0 20px rgba(34, 197, 94, 0.15); }
}

.avatar--online {
    animation: glow-ring 3s ease-in-out infinite;
}

/* ============================= */
/* Enhanced hover transitions    */
/* ============================= */

.streamer-card {
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.streamer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn {
    transition: background 0.15s, opacity 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:active {
    transform: scale(0.97);
}

.topnav__link {
    transition: color 0.2s, background 0.2s;
}

.tab {
    transition: color 0.2s, border-color 0.25s;
}

/* ============================= */
/* Responsive                    */
/* ============================= */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bg-motion__gradient,
    .bg-motion__grain {
        animation: none !important;
    }
}

/* Mobile nav */
.topnav__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.topnav__toggle:hover {
    background: var(--secondary);
}

.topnav__link--muted {
    color: var(--muted-foreground);
}

@media (max-width: 768px) {
    .topnav__toggle {
        display: flex;
        align-items: center;
    }

    .topnav__links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        padding: 8px;
        gap: 2px;
        animation: fade-in-up 0.2s ease-out both;
    }

    .topnav__links--open {
        display: flex;
    }

    .topnav__link {
        padding: 10px 16px;
        border-radius: var(--radius);
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 16px 12px 32px;
    }

    .page-title {
        font-size: 22px;
    }

    .streamer-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .game-card {
        flex-wrap: wrap;
    }

    .game-card__cover {
        width: 80px;
        height: 38px;
    }

    .steam-result {
        flex-wrap: wrap;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .topnav {
        padding: 12px 16px;
    }
}

/* ==================== REACTIONS ==================== */

.reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 0 10px 10px;
}
.reaction-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--secondary, #262626);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 12px;
    color: var(--muted-foreground, #a3a3a3);
    user-select: none;
}
.reaction-bubble:hover {
    border-color: var(--ring, #737373);
    background: var(--muted, #262626);
}
.reaction-bubble--active {
    border-color: var(--primary, #4d9fff);
    background: rgba(77, 159, 255, 0.12);
    color: var(--foreground, #fafafa);
    box-shadow: 0 0 6px rgba(77, 159, 255, 0.35);
}
.reaction-bubble__img {
    width: 20px;
    height: 20px;
    object-fit: cover;
}
.reaction-bubble__count {
    font-size: 11px;
    font-weight: 600;
    min-width: 8px;
    text-align: center;
}
.reaction-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px dashed var(--border, rgba(255,255,255,0.1));
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted-foreground, #a3a3a3);
    transition: border-color 0.15s, color 0.15s;
    font-size: 14px;
    padding: 0;
}
.reaction-add-btn:hover {
    border-color: var(--ring, #737373);
    color: var(--foreground, #fafafa);
}

/* Reaction picker popup */
.reaction-picker {
    display: none;
    position: fixed;
    z-index: 9999;
    background: var(--card, #171717);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    padding: 8px;
    width: 280px;
    max-height: 320px;
    overflow: visible;
    flex-direction: column;
}
.reaction-picker--open { display: flex; }
.reaction-picker__search {
    width: 100%;
    padding: 6px 10px;
    background: var(--input, rgba(255,255,255,0.1));
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: var(--radius, 0.375rem);
    color: var(--foreground, #fafafa);
    font-size: 12px;
    margin-bottom: 6px;
    outline: none;
    box-sizing: border-box;
}
.reaction-picker__search:focus { border-color: var(--ring, #737373); }
.reaction-picker__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    overflow-y: auto;
    max-height: 240px;
    padding: 2px;
}
.reaction-picker__item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 3px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}
.reaction-picker__item:hover { background: rgba(255, 255, 255, 0.1); }
.reaction-picker__item--active { background: rgba(115, 115, 115, 0.3); }
.reaction-picker__item img {
    width: 26px;
    height: 26px;
    object-fit: cover;
}
.reaction-picker__close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: var(--muted-foreground, #a3a3a3);
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    line-height: 1;
}
.reaction-picker__close:hover { color: var(--foreground, #fafafa); }

/* Twitch auth bar on profile */
.viewer-auth-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    margin-bottom: 16px;
    background: var(--secondary, #262626);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: var(--radius, 0.375rem);
    font-size: 13px;
    color: var(--muted-foreground, #a3a3a3);
}
.viewer-auth-bar__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.viewer-auth-bar a {
    color: #9146ff;
    text-decoration: none;
    font-weight: 500;
}
.viewer-auth-bar a:hover { text-decoration: underline; }

/* Emote tabs in comment editor */
.emote-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
}
.emote-tab {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted-foreground, #a3a3a3);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.emote-tab:hover { color: var(--foreground, #fafafa); }
.emote-tab--active {
    color: var(--foreground, #fafafa);
    border-bottom-color: var(--foreground, #fafafa);
}
.emote-tab-panel { display: none; }
.emote-tab-panel--active { display: block; }
.emote-tab-panel__loading {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--muted-foreground, #a3a3a3);
}
.emote-tab-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}
.emote-tab-item {
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 2px;
}
.emote-tab-item:hover { background: rgba(255, 255, 255, 0.1); }
.emote-tab-item img {
    width: 22px;
    height: 22px;
    object-fit: cover;
}

/* Emote section labels (channel vs global split) */
.emote-tab-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #a3a3a3);
    padding: 6px 4px 4px;
    opacity: 0.7;
}
.emote-tab-section-label:first-child {
    padding-top: 2px;
}

/* Inline emotes in comments */
.emote-inline {
    display: inline;
    height: 1.4em;
    vertical-align: middle;
    margin: 0 2px;
}

/* ============================= */
/* Focus-visible states          */
/* ============================= */

:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.btn:focus-visible,
.tab:focus-visible,
.topnav__link:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(115, 115, 115, 0.15);
}

.streamer-card:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(115, 115, 115, 0.15);
}

.reaction-bubble:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}

/* ============================= */
/* Profile: sort & view controls */
/* ============================= */

.sort-btn.active,
.view-btn.active {
    color: var(--foreground) !important;
    border-color: var(--border) !important;
    background: var(--muted) !important;
}
.sort-arrow { font-size: 11px; opacity: 0.7; }

/* ============================= */
/* Profile: comments collapsible */
/* ============================= */

.comment-collapsible {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    color: #9ca3b0;
    line-height: 1.5;
    margin-top: 4px;
}
.has-comment { cursor: pointer; }

.card-expanded .comment-collapsible {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

.game-list--grid .game-item {
    position: relative;
}
.game-list--grid .game-card.card-expanded {
    overflow: visible;
    z-index: 10;
    height: var(--card-height);
}
.game-list--grid .game-card.card-expanded .comment-collapsible {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--card, #171717);
    padding: 8px 10px 12px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 20;
}
.game-item { position: relative; }

/* ============================= */
/* Profile: no-cover placeholder */
/* ============================= */

.game-card__no-cover {
    width: 60px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-dark);
    font-size: 10px;
    color: var(--muted-foreground, #6b7280);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ============================= */
/* Profile: grid view            */
/* ============================= */

.game-list--grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: auto;
    gap: 12px;
}
.game-list--grid .game-item {
    min-width: 0;
}
.game-list--grid .game-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    overflow: hidden;
    height: 100%;
    min-width: 0;
}
.game-list--grid .game-card__cover-wrap {
    width: 100%;
    flex-shrink: 0;
}
.game-list--grid .game-card__cover {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 460 / 215;
    object-fit: cover;
    background: var(--surface-dark);
    border-radius: 0;
    display: block;
}
.game-list--grid .game-card__no-cover {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 460 / 215;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-dark);
    border-radius: 0;
    font-size: 12px;
    color: var(--muted-foreground, #6b7280);
    letter-spacing: 0.05em;
}
.game-list--grid .game-card__info {
    position: relative;
    padding: 8px 10px 4px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}
.game-list--grid .game-card__title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.game-list--grid .game-card__ordered-by {
    font-size: calc(var(--comment-font-size, 11px) - 1px);
    color: #9ca3af;
    background: rgba(255,255,255,0.06);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
    line-height: 1.5;
    margin-top: 2px;
}
.game-list--grid .game-card__comment {
    font-size: var(--comment-font-size, 11px);
    color: var(--muted-foreground, #9ca3af);
    margin-top: 4px;
}
.game-list--grid .game-card__rating {
    font-size: 12px;
    padding: 2px 8px;
    align-self: flex-start;
    margin: 6px 0 0 0;
}

/* Meta block (рейтинг + время + видео) */
.game-card__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}
.game-list--grid .game-card__meta {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 2px 10px 2px;
    align-self: flex-start;
    flex-wrap: wrap;
    margin-top: auto;
}
.game-list--grid .reactions {
    padding: 0 10px 6px;
    width: 100%;
    box-sizing: border-box;
}
.game-list--grid .game-card__meta .game-card__rating {
    margin: 0;
    min-width: 38px;
    height: 24px;
    font-size: 12px;
    padding: 0 8px;
}
.game-list--grid .game-card__meta .game-card__playtime {
    margin: 0;
    font-size: 11px;
}
.game-list--grid .game-card__meta .game-card__video-link svg {
    width: 16px;
    height: 16px;
}
.game-card__playtime {
    font-size: 11px;
    color: #c0c4d0;
    white-space: nowrap;
}
.game-card__video-link {
    display: flex;
    align-items: center;
    color: #9ca3b0;
    transition: color 0.15s;
    flex-shrink: 0;
}
.game-card__video-link:hover {
    color: var(--primary, #4d9fff);
}
.game-card__video-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.75);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    flex-shrink: 0;
}
.game-card__video-overlay:hover {
    background: var(--primary, #4d9fff);
    color: #fff;
}
.game-list--grid .game-card__playtime {
    margin: 0;
    font-size: 11px;
}

.game-card__genre {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted-foreground, #9ca3af);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ============================= */
/* Films: grid & cards           */
/* ============================= */

#list-films, #list-queue {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
}
#list-films .game-item, #list-queue .game-item {
    width: 100% !important;
    min-width: 0 !important;
    position: relative;
}
#list-films .game-card, #list-queue .game-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative;
    border-radius: 10px !important;
    width: 100% !important;
    height: 100% !important;
}
.film-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    background: var(--surface-dark);
    flex-shrink: 0;
}
.film-poster-empty {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: var(--surface-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}
.film-info {
    padding: 10px 12px 0;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}
.film-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.film-year {
    font-size: 11px;
    color: var(--muted-foreground, #6b7280);
    margin-top: 2px;
}
.film-meta {
    padding: 6px 12px 4px;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
}
.film-reactions {
    padding: 0 12px 8px;
    width: 100%;
    box-sizing: border-box;
}
/* Film expanded comment overlay */
#list-films .game-item.card-expanded,
#list-queue .game-item.card-expanded {
    z-index: 10;
}
#list-films .card-expanded .game-card,
#list-queue .card-expanded .game-card {
    overflow: hidden !important;
}
#list-films .card-expanded .comment-collapsible,
#list-queue .card-expanded .comment-collapsible {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: auto;
    white-space: normal;
    word-break: break-word;
    position: absolute;
    inset: 0;
    background: rgba(var(--card-rgb, 23,23,23), 0.95);
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 20;
    font-size: 12px;
    line-height: 1.6;
    color: var(--foreground, #e2e8f0);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
/* Film tab buttons */
.film-tab-btn.active {
    background: var(--muted) !important;
    color: var(--foreground) !important;
}
.film-sort-btn.active {
    color: var(--foreground) !important;
    border-color: var(--border) !important;
    background: var(--muted) !important;
}

/* ============================= */
/* FAQ page                      */
/* ============================= */

.faq-hero {
    text-align: center;
    padding: 60px 0 48px;
}
.faq-hero__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary, #4d9fff);
    border: 1px solid var(--primary, #4d9fff);
    border-radius: 20px;
    padding: 4px 14px;
    margin-bottom: 20px;
    opacity: 0.85;
}
.faq-hero__title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--foreground, #e8eaf0);
    margin: 0 0 16px;
}
.faq-hero__subtitle {
    font-size: 16px;
    color: #9ca3b0;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}
.faq-section {
    margin-bottom: 56px;
}
.faq-section__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--foreground, #e8eaf0);
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, #2a2f3e);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.feature-card {
    background: var(--card, #111520);
    border: 1px solid var(--border, #2a2f3e);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.2s;
}
.feature-card:hover {
    border-color: var(--primary, #4d9fff);
}
.feature-card__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsla(215, 100%, 63%, 0.1);
    border-radius: var(--radius);
    margin-bottom: 12px;
    color: var(--primary, #4d9fff);
}
.feature-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground, #e8eaf0);
    margin-bottom: 6px;
}
.feature-card__text {
    font-size: 13px;
    color: #9ca3b0;
    line-height: 1.6;
}
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.faq-item {
    background: var(--card, #111520);
    border: 1px solid var(--border, #2a2f3e);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.faq-item--open {
    border-color: var(--primary, #4d9fff);
}
.faq-item__q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground, #e8eaf0);
    text-align: left;
    font-family: inherit;
}
.faq-item__q:hover {
    color: var(--primary, #4d9fff);
}
.faq-item__arrow {
    flex-shrink: 0;
    transition: transform 0.25s;
    color: var(--muted-foreground, #6b7280);
}
.faq-item__a {
    display: none;
    padding: 0 20px 18px;
    font-size: 13px;
    color: #9ca3b0;
    line-height: 1.7;
}
.faq-item--open .faq-item__a {
    display: block;
}
.faq-item__a code {
    background: var(--input, #1e2330);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    font-size: 12px;
    color: var(--primary, #4d9fff);
    font-family: monospace;
}
.faq-item__a strong {
    color: var(--foreground, #e8eaf0);
}
.faq-cta {
    text-align: center;
    padding: 16px 0 48px;
}

/* ============================= */
/* Mobile breakpoints            */
/* ============================= */

@media (max-width: 480px) {
    .stats-bar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .sort-bar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .game-list--grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #list-films, #list-queue {
        grid-template-columns: 1fr !important;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .game-list--grid { grid-template-columns: repeat(2, 1fr); }
    #list-films, #list-queue { grid-template-columns: repeat(2, 1fr) !important; }
    .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1200px) {
    .game-list--grid { grid-template-columns: repeat(4, 1fr); }
}

/* Touch targets for coarse pointers (mobile) */
@media (pointer: coarse) {
    .rxn-bubble {
        min-height: 32px;
        padding: 4px 8px;
    }
    .game-card__actions .comments-toggle {
        min-height: 32px;
        padding: 4px 8px;
    }
}


/* ============================================================
   LIQUID GLASS — grid cards
   ============================================================ */
.game-list--grid .game-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    overflow: clip;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.12) inset,
        0 -1px 0 0 rgba(0,0,0,0.3) inset,
        0 8px 32px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
}

/* Блик сверху — имитация преломления света */
.game-list--grid .game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(
        160deg,
        rgba(255,255,255,0.10) 0%,
        rgba(255,255,255,0.03) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
}

.game-list--grid .game-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-3px);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.18) inset,
        0 -1px 0 0 rgba(0,0,0,0.3) inset,
        0 16px 48px rgba(0,0,0,0.45);
}

/* Обложка — скруглённые углы только сверху */
.game-list--grid .game-card__cover-wrap {
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    position: relative;
    z-index: 0;
}

.game-list--grid .game-card__cover {
    border-radius: 0;
}

/* Нижняя часть карточки — лёгкое матовое стекло */
.game-list--grid .game-card__info,
.game-list--grid .game-card__meta,
.game-list--grid .reactions,
.game-list--grid .game-card__actions {
    position: relative;
    z-index: 2;
}

/* Flip-front flex layout — fills card, pins meta to bottom */
.game-list--grid .flip-front {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Плавный переход от обложки к контенту */
.game-list--grid .game-card__cover-wrap::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, rgba(10,10,10,0.6));
    pointer-events: none;
}

/* Video badge on card cover */
.game-card__video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #fff;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
    text-decoration: none;
}

.game-card__video-badge:hover {
    background: rgba(77,159,255,0.7);
    border-color: rgba(77,159,255,0.6);
    transform: scale(1.1);
    color: #fff;
}

.game-card__video-badge svg {
    margin-left: 1px;
}


/* ============================================================
   LIQUID GLASS — streamer cards
   ============================================================ */
.streamer-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 20px;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.12) inset,
        0 -1px 0 0 rgba(0,0,0,0.3) inset,
        0 8px 32px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Блик сверху */
.streamer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(
        150deg,
        rgba(255,255,255,0.10) 0%,
        rgba(255,255,255,0.03) 40%,
        transparent 70%
    );
    pointer-events: none;
}

.streamer-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-4px);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.18) inset,
        0 -1px 0 0 rgba(0,0,0,0.3) inset,
        0 16px 40px rgba(0,0,0,0.4);
}

/* Live — зелёное стекло */
.streamer-card--live {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.12) inset,
        0 -1px 0 0 rgba(0,0,0,0.3) inset,
        0 0 20px rgba(34, 197, 94, 0.15),
        0 8px 32px rgba(0,0,0,0.3);
}

.streamer-card--live:hover {
    background: rgba(34, 197, 94, 0.09);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.15) inset,
        0 -1px 0 0 rgba(0,0,0,0.3) inset,
        0 0 32px rgba(34, 197, 94, 0.25),
        0 16px 40px rgba(0,0,0,0.4);
}


/* ============================================================
   LIQUID GLASS — viewer-auth-bar & stats-bar (profile page)
   ============================================================ */
.viewer-auth-bar {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.10) inset,
        0 -1px 0 0 rgba(0,0,0,0.25) inset,
        0 4px 20px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}
.viewer-auth-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, transparent 60%);
    pointer-events: none;
}

.stats-bar {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.10) inset,
        0 -1px 0 0 rgba(0,0,0,0.25) inset,
        0 4px 20px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}
.stats-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, transparent 60%);
    pointer-events: none;
}


/* ============================================================
   LIQUID GLASS — .card blocks (dashboard films, games, etc.)
   ============================================================ */
.card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.10) inset,
        0 -1px 0 0 rgba(0,0,0,0.25) inset,
        0 6px 24px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}
.card > * {
    position: relative;
    z-index: 1;
}

/* ============================================================
   ACTIONS TRAY — recessed glass shelf at card bottom
   ============================================================ */

/* Hide old .reactions in grid mode */
.game-list--grid .reactions { display: none !important; }

/* Actions tray: recessed glass shelf pinned to card bottom */
.game-card__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.10);
    border-top: 1px solid rgba(255,255,255,0.04);
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.18);
}

/* Comment icon-button — matches reaction pill aesthetic */
.game-card__actions .comments-toggle {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0;
    color: rgba(255,255,255,0.40);
    font-family: inherit;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    width: auto;
    margin: 0;
    line-height: 1;
}
.game-card__actions .comments-toggle svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.7;
}
.game-card__actions .comments-toggle:hover {
    color: var(--foreground, #fafafa);
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}
.game-card__actions .comments-toggle:hover svg {
    opacity: 1;
}
.game-card__actions .comments-toggle.active {
    color: var(--foreground, #fafafa);
    background: rgba(77,159,255,0.10);
    border-color: rgba(77,159,255,0.30);
}
.game-card__actions .comments-toggle.active svg {
    opacity: 1;
    stroke: var(--primary, #4d9fff);
}
.game-card__actions .comment-count-badge {
    font-size: 10px;
    font-weight: 600;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
    color: inherit;
    line-height: 1;
}

/* Reaction bar — flows inline, wraps when needed */
.rxn-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: auto;
    min-width: 0;
}

/* Reaction pill — glass capsule */
.rxn-bubble {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    font-size: 0;
    color: var(--muted-foreground, #a3a3a3);
    user-select: none;
    line-height: 1;
}
.rxn-bubble:hover {
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.08);
    transform: scale(1.05);
}
.rxn-bubble:active {
    transform: scale(0.95);
}
.rxn-bubble.reaction-bubble--active {
    border-color: rgba(77,159,255,0.40);
    background: rgba(77,159,255,0.12);
    box-shadow: 0 0 6px rgba(77,159,255,0.20);
}
.rxn-bubble__img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    pointer-events: none;
}
.rxn-bubble__count {
    font-size: 10px;
    font-weight: 600;
    min-width: 6px;
    text-align: center;
    pointer-events: none;
    line-height: 1;
}
.rxn-bubble.reaction-bubble--active .rxn-bubble__count {
    color: var(--foreground, #fafafa);
}

/* Add reaction "+" button — dashed outline, inviting */
.rxn-bubble--add {
    border-style: dashed;
    border-color: rgba(255,255,255,0.10);
    background: none;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.30);
    padding: 2px 7px;
    line-height: 16px;
}
.rxn-bubble--add:hover {
    border-color: rgba(255,255,255,0.30);
    color: rgba(255,255,255,0.80);
    background: rgba(255,255,255,0.05);
}

/* ============================= */
/* Freeform profile layout       */
/* ============================= */

/* Resize handle — hidden by default, shown in edit mode */
.layout-resize-handle {
    display: none;
}

/* Block resize handle — hidden by default */
.layout-block__resize {
    display: none;
}

/* ============================= */
/* Block-based layout canvas     */
/* ============================= */

.layout-canvas {
    position: relative;
}

.layout-canvas--custom {
    position: relative;
}

.layout-canvas--custom .layout-block {
    position: absolute;
    box-sizing: border-box;
}

/* All layout blocks need relative for resize handle and edit button positioning */
.layout-block {
    position: relative;
}

/* Block labels — only visible in edit mode */
.layout-block__label {
    display: none;
}

/* Section titles — visible in custom layout (view mode) */
.layout-block__section-title {
    display: none;
}

.layout-canvas--custom .layout-block__section-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted-foreground, #94a3b8);
    padding: 0 0 8px 2px;
    letter-spacing: 0.01em;
}

.layout-canvas--custom .layout-block__section-title .section-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted-foreground, #64748b);
    opacity: 0.7;
}

/* Hide section titles in edit mode (label is shown instead) */
body.layout-editing .layout-block__section-title {
    display: none;
}

/* ============================= */
/* Layout editor — edit mode     */
/* ============================= */

body.layout-editing {
    overflow-x: hidden;
}

body.layout-editing .layout-canvas {
    overflow: visible;
    background:
        radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 10px 10px;
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 12px;
    min-height: 600px;
    padding: 8px;
}

body.layout-editing .layout-block {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

body.layout-editing .layout-block:hover {
    border-color: rgba(255,255,255,0.25);
}

body.layout-editing .layout-block--selected {
    border-color: var(--primary, #4d9fff);
    box-shadow: 0 0 0 2px rgba(77, 159, 255, 0.2);
    z-index: 20;
}

body.layout-editing .layout-block--scale-selected {
    border-color: var(--primary, #4d9fff);
    box-shadow: 0 0 0 2px rgba(77, 159, 255, 0.3), inset 0 0 0 1px rgba(77, 159, 255, 0.1);
}

body.layout-editing .layout-block:active {
    cursor: grabbing;
}

body.layout-editing .layout-block__label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary, #4d9fff);
    background: rgba(77, 159, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    width: fit-content;
    pointer-events: none;
}

/* Disable card hover transforms and flip during editing */
body.layout-editing .game-card:hover {
    transform: none !important;
    box-shadow: none !important;
}

body.layout-editing .game-card::before {
    display: none !important;
}

body.layout-editing .game-item.has-flip {
    perspective: none !important;
}

body.layout-editing .flip-inner {
    transform: none !important;
    transition: none !important;
}

/* Card resize handle visible in edit mode */
body.layout-editing .layout-resize-handle {
    display: block;
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 30;
    background: linear-gradient(135deg, transparent 50%, var(--primary, #4d9fff) 50%);
    border-radius: 0 0 8px 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}

body.layout-editing .layout-resize-handle:hover {
    opacity: 1;
}

/* Hide actions tray in edit mode so card resize handle is accessible */
body.layout-editing .game-card__actions {
    display: none;
}

/* Block resize handle */
body.layout-editing .layout-block__resize {
    display: block;
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    z-index: 30;
    opacity: 0.5;
    transition: opacity 0.15s;
}

body.layout-editing .layout-block__resize::before,
body.layout-editing .layout-block__resize::after {
    content: '';
    position: absolute;
    background: var(--primary, #4d9fff);
    border-radius: 1px;
}

body.layout-editing .layout-block__resize::before {
    width: 12px;
    height: 2px;
    bottom: 4px;
    right: 4px;
}

body.layout-editing .layout-block__resize::after {
    width: 2px;
    height: 12px;
    bottom: 4px;
    right: 4px;
}

body.layout-editing .layout-block__resize:hover {
    opacity: 1;
}

/* Snap guide lines */
.snap-guide {
    position: absolute;
    pointer-events: none;
    z-index: 100;
}

.snap-guide--h {
    height: 1px;
    left: 0;
    right: 0;
    background: rgba(77, 159, 255, 0.5);
}

.snap-guide--v {
    width: 1px;
    top: 0;
    bottom: 0;
    background: rgba(77, 159, 255, 0.5);
}

/* Layout editor toolbar */
.layout-toolbar {
    display: none;
    flex-direction: column;
    padding: 0;
    background: rgba(23, 23, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    position: sticky;
    top: 8px;
    z-index: 50;
    overflow: hidden;
}

body.layout-editing .layout-toolbar {
    display: flex;
}

.layout-toolbar__top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
}

.layout-toolbar__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}

.layout-toolbar__hint {
    font-size: 11px;
    color: var(--muted-foreground);
    margin-left: 8px;
}

.layout-toolbar__hint--spacer {
    margin-right: auto;
}

.layout-toolbar .btn {
    font-size: 12px;
    padding: 6px 14px;
}

.layout-toolbar .btn.active,
.layout-toolbar .btn--active {
    background: rgba(77,159,255,0.15);
    color: var(--primary, #4d9fff);
}

.layout-toolbar__separator {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.08);
    margin: 0 4px;
    flex-shrink: 0;
}

.layout-width-btn {
    font-size: 11px !important;
    padding: 4px 8px !important;
    min-width: 0;
}

/* Card size controls */
.card-size-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    height: 26px;
    overflow: hidden;
}

.card-size-ctrl__arrow {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0 5px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}

.card-size-ctrl__arrow:hover {
    background: rgba(255,255,255,0.1);
    color: var(--foreground);
}

.card-size-ctrl__input {
    width: 40px;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.06);
    border-right: 1px solid rgba(255,255,255,0.06);
    color: var(--foreground);
    font-size: 11px;
    text-align: center;
    padding: 0 2px;
    height: 100%;
    -moz-appearance: textfield;
    outline: none;
}

.card-size-ctrl__input::-webkit-inner-spin-button,
.card-size-ctrl__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.card-size-ctrl__input:focus {
    background: rgba(255,255,255,0.06);
}

/* Scale panel */
.layout-toolbar__scale {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    font-size: 12px;
}

.scale-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary, #e5e5e5);
    cursor: pointer;
    border: none;
}

.scale-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary, #e5e5e5);
    cursor: pointer;
    border: none;
}

.scale-value {
    font-size: 11px;
    font-weight: 600;
    min-width: 36px;
    text-align: center;
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
}

/* Palette panel inside toolbar */
.layout-toolbar__palette {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.layout-toolbar__palette .palette-presets__grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.layout-toolbar__palette .palette-swatch {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.layout-toolbar__palette .palette-swatch:hover {
    border-color: var(--ring);
}

.layout-toolbar__palette .palette-swatch--active {
    border-color: var(--ring, #4d9fff);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 0 1px var(--ring, #4d9fff);
}

.layout-toolbar__palette .palette-swatch__colors {
    display: flex;
    gap: 2px;
    width: 100%;
}

.layout-toolbar__palette .palette-swatch__colors span {
    flex: 1;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.06);
    min-width: 16px;
}

.layout-toolbar__palette .palette-swatch__name {
    font-size: 9px;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.layout-toolbar__palette .palette-pickers {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.layout-toolbar__palette .palette-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.layout-toolbar__palette .palette-picker__label {
    font-size: 11px;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.layout-toolbar__palette .palette-picker__input {
    width: 28px;
    height: 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.layout-toolbar__palette .palette-picker__input::-webkit-color-swatch-wrapper { padding: 1px; }
.layout-toolbar__palette .palette-picker__input::-webkit-color-swatch { border-radius: 2px; border: none; }

/* Responsive fallback */
@media (max-width: 768px) {
    .layout-canvas--custom .layout-block {
        position: static !important;
        width: auto !important;
        transform: none !important;
    }

    .layout-toolbar__top {
        flex-wrap: wrap;
        gap: 6px;
    }

    .layout-toolbar__scale {
        flex-wrap: wrap;
    }
}

/* ============================================ */
/* Windows XP Luna Theme  (html.theme-xp)       */
/* ============================================ */

html.theme-xp body {
    font-family: Tahoma, 'Microsoft Sans Serif', 'Segoe UI', sans-serif;
    font-size: 13px;
    background: var(--background);
}

/* Disable dark glow effects */
html.theme-xp .bg-motion {
    display: none;
}

/* === TopNav → Luna taskbar === */
html.theme-xp .topnav {
    background: linear-gradient(to bottom,
        #245dba 0%, #3d82d8 40%, #2a6cc8 55%, #1e52a4 100%
    );
    border-bottom: 2px solid #1a3f7c;
    backdrop-filter: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    padding: 10px 24px;
}

html.theme-xp .topnav__brand {
    color: #FFFFFF;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

html.theme-xp .topnav__link,
html.theme-xp .topnav__link--muted {
    color: rgba(255,255,255,0.92);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    border-radius: 3px;
}

html.theme-xp .topnav__link:hover {
    background: rgba(255,255,255,0.18);
    color: #FFFFFF;
}

html.theme-xp .topnav__edit-btn {
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 50%, #D4D0C8 100%);
    border: 1px solid #716F64;
    color: #000000;
    border-radius: 3px;
    text-shadow: none;
    box-shadow: inset 1px 1px 0 #FFFFFF, 1px 1px 2px rgba(0,0,0,0.3);
}

html.theme-xp .topnav__edit-btn:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #CCE0FA 100%);
    border-color: #316AC5;
}

/* === Cards → XP window panels === */
html.theme-xp .card {
    background: var(--card);
    border-radius: 0;
    border: 2px solid;
    border-color: #DFDFDF #716F64 #716F64 #DFDFDF;
    box-shadow:
        inset 1px 1px 0 #FFFFFF,
        inset -1px -1px 0 #ACA899,
        2px 2px 5px rgba(0,0,0,0.18);
}

/* === Game cards → XP list rows === */
html.theme-xp .game-card {
    background: #FFFFFF;
    border-radius: 0;
    border: 1px solid #D4D0C8;
    box-shadow: none;
    transition: background 0.08s, border-color 0.08s;
}

html.theme-xp .game-card:hover {
    background: #EBF3FB;
    border-color: #316AC5;
    transform: none;
    box-shadow: none;
}

html.theme-xp .game-card__cover,
html.theme-xp .game-card__no-cover,
html.theme-xp .game-card__cover-wrap,
html.theme-xp .game-list--grid .game-card__cover-wrap {
    border-radius: 0;
    border: 1px solid #ACA899;
}

html.theme-xp .game-card__title {
    color: #000000;
    font-weight: 600;
}

html.theme-xp .game-card__comment {
    color: #716F64;
}

html.theme-xp .game-card__rating {
    background: #ECE9D8;
    border: 2px solid;
    border-color: #DFDFDF #716F64 #716F64 #DFDFDF;
    border-radius: 0;
    color: #000000;
    font-family: Tahoma, sans-serif;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

html.theme-xp .rating--high {
    color: #006600;
    background: #EEFFEE;
    border-color: #CCFFCC #339933 #339933 #CCFFCC;
}

html.theme-xp .rating--mid {
    color: #7A5900;
    background: #FFFACC;
    border-color: #FFEEAA #997700 #997700 #FFEEAA;
}

html.theme-xp .rating--low {
    color: #990000;
    background: #FFEEEE;
    border-color: #FFCCCC #CC3333 #CC3333 #FFCCCC;
}

/* === Buttons → 3D XP push buttons === */
html.theme-xp .btn {
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 48%, #D4D0C8 100%);
    border: 1px solid #716F64;
    border-radius: 3px;
    color: #000000;
    font-family: Tahoma, 'Microsoft Sans Serif', sans-serif;
    font-size: 11px;
    font-weight: normal;
    text-shadow: none;
    box-shadow:
        inset 1px 1px 0 #FFFFFF,
        inset -1px -1px 0 #ACA899,
        1px 1px 3px rgba(0,0,0,0.2);
    padding: 4px 14px;
    transition: none;
}

html.theme-xp .btn:hover {
    background: linear-gradient(to bottom, #FFFFFF 0%, #EEF3FB 48%, #C8D8EE 100%);
    border-color: #316AC5;
    color: #000000;
    opacity: 1;
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.9),
        inset -1px -1px 0 #7EA6E0,
        1px 1px 3px rgba(0,0,0,0.2);
}

html.theme-xp .btn:active {
    background: linear-gradient(to bottom, #D4D0C8 0%, #ECE9D8 100%);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.25);
    padding-left: 15px;
    padding-top: 5px;
}

html.theme-xp .btn--primary {
    background: linear-gradient(to bottom,
        #5aa4e8 0%, #3378d0 35%, #1e52a0 65%, #183d80 100%
    );
    border: 1px solid #0A246A;
    color: #FFFFFF;
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.35),
        inset -1px -1px 0 rgba(0,0,0,0.15),
        1px 1px 3px rgba(0,0,0,0.3);
}

html.theme-xp .btn--primary:hover {
    background: linear-gradient(to bottom,
        #70b8f8 0%, #4888e0 35%, #2a62b0 65%, #1e4a8c 100%
    );
    opacity: 1;
    border-color: #0A246A;
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.35),
        1px 1px 3px rgba(0,0,0,0.3);
}

html.theme-xp .btn--secondary,
html.theme-xp .btn--outline,
html.theme-xp .btn--ghost {
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 48%, #D4D0C8 100%);
    border: 1px solid #716F64;
    color: #000000;
    box-shadow:
        inset 1px 1px 0 #FFFFFF,
        inset -1px -1px 0 #ACA899,
        1px 1px 3px rgba(0,0,0,0.15);
}

html.theme-xp .btn--secondary:hover,
html.theme-xp .btn--outline:hover,
html.theme-xp .btn--ghost:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #C8D8F0 100%);
    border-color: #316AC5;
    color: #000000;
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.9),
        inset -1px -1px 0 #7EA6E0,
        1px 1px 3px rgba(0,0,0,0.15);
}

html.theme-xp .btn--destructive {
    background: linear-gradient(to bottom, #FF7777 0%, #CC2222 100%);
    border-color: #880000;
    color: #FFFFFF;
    text-shadow: 0 1px 1px rgba(0,0,0,0.4);
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.3),
        1px 1px 3px rgba(0,0,0,0.3);
}

html.theme-xp .btn--sm {
    font-size: 11px;
    padding: 3px 10px;
}

html.theme-xp .btn--icon {
    padding: 0;
    width: 26px;
    height: 26px;
}

/* === Status nav → XP tab-style buttons === */
html.theme-xp .status-nav__link {
    background: linear-gradient(to bottom, #ECE9D8 0%, #D4D0C8 100%);
    border: 1px solid #716F64;
    border-radius: 3px;
    color: #000000;
    box-shadow: inset 1px 1px 0 #FFFFFF, inset -1px -1px 0 #ACA899;
    transition: none;
}

html.theme-xp .status-nav__link:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #C8D8F0 100%);
    border-color: #316AC5;
    color: #000000;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.9), inset -1px -1px 0 #7EA6E0;
}

html.theme-xp .status-nav__link--active {
    background: linear-gradient(to bottom, #5aa4e8 0%, #2a62b0 100%);
    border-color: #0A246A;
    color: #FFFFFF;
    text-shadow: 0 1px 1px rgba(0,0,0,0.4);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.25), inset -1px -1px 0 rgba(0,0,0,0.1);
}

html.theme-xp .status-nav__link--alt {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #716F64;
}

html.theme-xp .status-nav__link--alt:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #C8D8F0 100%);
    border-color: #316AC5;
    color: #000000;
}

/* Section count badge */
html.theme-xp .section-count {
    background: #D4D0C8;
    border: 1px solid #ACA899;
    border-radius: 0;
    color: #000000;
    font-family: Tahoma, sans-serif;
}

html.theme-xp .status-nav__link--active .section-count {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: #FFFFFF;
}

/* === Profile header === */
html.theme-xp .profile-header__name {
    color: #000000;
    font-size: 20px;
    text-shadow: none;
    letter-spacing: 0;
}

/* Avatar → square XP style */
html.theme-xp .avatar {
    border-radius: 0 !important;
    border: 2px solid;
    border-color: #DFDFDF #716F64 #716F64 #DFDFDF;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

html.theme-xp .avatar--online {
    box-shadow: 0 0 0 2px #ECE9D8, 0 0 0 4px #316AC5;
}

/* === Inputs → XP sunken fields === */
html.theme-xp input[type="text"],
html.theme-xp input[type="search"],
html.theme-xp input[type="number"],
html.theme-xp textarea,
html.theme-xp select {
    background: #FFFFFF;
    border: 2px solid;
    border-color: #716F64 #DFDFDF #DFDFDF #716F64;
    border-radius: 0;
    color: #000000;
    font-family: Tahoma, sans-serif;
    font-size: 13px;
    box-shadow: inset 1px 1px 0 #ACA899;
}

html.theme-xp input[type="text"]:focus,
html.theme-xp input[type="search"]:focus,
html.theme-xp input[type="number"]:focus,
html.theme-xp textarea:focus,
html.theme-xp select:focus {
    border-color: #316AC5 #DFDFDF #DFDFDF #316AC5;
    outline: none;
}

/* === HR → XP double-line separator === */
html.theme-xp hr {
    border: none;
    border-top: 1px solid #ACA899;
    border-bottom: 1px solid #FFFFFF;
    margin: 20px 0;
}

/* === Section titles === */
html.theme-xp .section-title {
    color: #0A246A;
    font-weight: 700;
    font-family: Tahoma, sans-serif;
}

/* === Layout toolbar in XP mode === */
html.theme-xp .layout-toolbar {
    background: linear-gradient(to bottom, #ECE9D8, #D4D0C8);
    border-bottom: 2px solid;
    border-color: #FFFFFF #716F64 #716F64 #FFFFFF;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

html.theme-xp .layout-toolbar {
    font-family: Tahoma, sans-serif;
    color: #000000;
}

html.theme-xp .layout-toolbar__title {
    color: #0A246A;
    font-weight: 700;
}

/* === Toast → XP dialog style === */
html.theme-xp .toast {
    background: #FFFFFF;
    border: 2px solid;
    border-color: #DFDFDF #716F64 #716F64 #DFDFDF;
    border-radius: 0;
    color: #000000;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.35);
    font-family: Tahoma, sans-serif;
}

/* === Palette swatches in editor === */
html.theme-xp .palette-swatch {
    border-radius: 0;
    border: 2px solid;
    border-color: #DFDFDF #716F64 #716F64 #DFDFDF;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

html.theme-xp .palette-swatch:hover {
    border-color: #316AC5;
}

html.theme-xp .palette-swatch--active {
    border-color: #0A246A;
    box-shadow: 0 0 0 2px #316AC5, inset 1px 1px 0 #FFFFFF;
}

/* === Scrollbar → XP chrome style (Blink only) === */
html.theme-xp ::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

html.theme-xp ::-webkit-scrollbar-track {
    background: #D4D0C8;
}

html.theme-xp ::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, #C0BDB4, #ECE9D8, #C0BDB4);
    border: 1px solid;
    border-color: #DFDFDF #716F64 #716F64 #DFDFDF;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

html.theme-xp ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to right, #C0D4EE, #EEF3FB, #C0D4EE);
    border-color: #316AC5;
}

html.theme-xp ::-webkit-scrollbar-button {
    background: linear-gradient(to bottom, #ECE9D8, #D4D0C8);
    border: 1px solid #716F64;
    box-shadow: inset 1px 1px 0 #FFFFFF, inset -1px -1px 0 #ACA899;
    display: block;
    height: 16px;
    width: 16px;
}

/* === XP window chrome on profile blocks === */
html.theme-xp .layout-block[data-block-id] {
    position: relative;
    background: #FFFFFF;
    border: 2px solid;
    border-color: #DFDFDF #716F64 #716F64 #DFDFDF;
    box-shadow:
        inset 1px 1px 0 #FFFFFF,
        inset -1px -1px 0 #ACA899,
        2px 2px 5px rgba(0,0,0,0.2);
    border-radius: 4px 4px 0 0;
    padding-top: 26px;
}

html.theme-xp .layout-block[data-block-id]::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 26px;
    background: linear-gradient(to bottom,
        #6da4e0 0%, #3d82d8 20%, #2462be 55%, #1a3f90 100%
    );
    border-radius: 2px 2px 0 0;
    pointer-events: none;
}

html.theme-xp .layout-block[data-block-id]::after {
    content: '';
    position: absolute;
    top: 5px; left: 10px;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    pointer-events: none;
    z-index: 1;
}

html.theme-xp .layout-block[data-block-id="header"]::after  { content: 'Профиль'; }
html.theme-xp .layout-block[data-block-id="stats"]::after   { content: 'Статистика'; }
html.theme-xp .layout-block[data-block-id="nav"]::after     { content: 'Навигация'; }
html.theme-xp .layout-block[data-block-id="games"]::after   { content: 'Игры'; }
html.theme-xp .layout-block[data-block-id="search"]::after  { content: 'Поиск'; }

/* === Muted text === */
html.theme-xp .text-muted,
html.theme-xp [style*="color:var(--muted"] {
    color: #716F64;
}

/* === Suggest button in nav === */
html.theme-xp .topnav__suggest-btn {
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 50%, #D4D0C8 100%);
    border: 1px solid #716F64;
    color: #0A246A;
    border-radius: 3px;
    box-shadow: inset 1px 1px 0 #FFFFFF, inset -1px -1px 0 #ACA899;
}

html.theme-xp .topnav__suggest-btn:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #C8D8F0 100%);
    border-color: #316AC5;
    color: #0A246A;
}

/* Viewer name in nav */
html.theme-xp .topnav__viewer-name {
    color: #FFFFFF;
}

html.theme-xp .topnav__viewer {
    color: rgba(255,255,255,0.85);
}

/* === Search input reset === */
html.theme-xp input[type="search"]::-webkit-search-cancel-button {
    filter: invert(0.5);
}

/* === XP: compact block content (убираем лишние отступы внутри блоков) === */
html.theme-xp .profile-header {
    padding: 10px 0 8px;
    gap: 8px;
}

html.theme-xp .profile-header__name {
    font-size: 16px;
    letter-spacing: 0;
}

html.theme-xp .stats-bar {
    padding: 8px 12px;
    margin-bottom: 0;
    border-radius: 0;
    border: none;
    background: transparent;
    gap: 12px;
}

html.theme-xp .status-nav {
    margin-bottom: 4px;
}

html.theme-xp .search-wrap {
    margin-bottom: 6px;
}

html.theme-xp .sort-bar {
    gap: 4px;
}

/* Маленькие промежутки между блоками */
html.theme-xp .layout-block[data-block-id] {
    margin-bottom: 6px;
}

/* === XP edit mode: светлые стили вместо тёмных === */
html.theme-xp body.layout-editing .layout-canvas {
    background-color: #ECE9D8;
    background-image: radial-gradient(circle, #ACA899 1px, transparent 1px);
    background-size: 10px 10px;
    border: 1px dashed #ACA899;
    border-radius: 0;
}

html.theme-xp body.layout-editing .layout-block {
    border: 2px dashed #ACA899;
    border-radius: 0;
    cursor: grab;
}

html.theme-xp body.layout-editing .layout-block:hover {
    border-color: #316AC5;
}

html.theme-xp body.layout-editing .layout-block--selected {
    border-color: #0A246A;
    border-style: solid;
    box-shadow: 0 0 0 2px rgba(49,106,197,0.25);
}

html.theme-xp body.layout-editing .layout-block__label {
    color: #0A246A;
    background: rgba(49,106,197,0.1);
    border-radius: 0;
    border: 1px solid rgba(49,106,197,0.2);
}

/* В edit-режиме скрываем XP-тайтлбар (label уже показывает название) */
html.theme-xp body.layout-editing .layout-block[data-block-id]::before,
html.theme-xp body.layout-editing .layout-block[data-block-id]::after {
    display: none;
}

html.theme-xp body.layout-editing .layout-block[data-block-id] {
    padding-top: 8px;
    background: rgba(255,255,255,0.7);
    border-color: #ACA899;
    box-shadow: none;
}

/* === XP: стили реакций зрителей === */
html.theme-xp .rxn-bubble {
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 100%);
    border: 1px solid;
    border-color: #DFDFDF #ACA899 #ACA899 #DFDFDF;
    border-radius: 3px;
    box-shadow: inset 1px 1px 0 #FFFFFF;
    color: #000000;
    transition: none;
    transform: none !important;
}

html.theme-xp .rxn-bubble:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #C8D8F0 100%);
    border-color: #316AC5;
    transform: none !important;
}

html.theme-xp .rxn-bubble:active {
    background: linear-gradient(to bottom, #D4D0C8 0%, #ECE9D8 100%);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.15);
    transform: none !important;
}

html.theme-xp .rxn-bubble.reaction-bubble--active {
    background: linear-gradient(to bottom, #C8D8F0 0%, #EEF3FB 100%);
    border-color: #0A246A;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.5);
}

html.theme-xp .rxn-bubble__count {
    color: #000000;
    font-family: Tahoma, sans-serif;
    font-size: 10px;
}

html.theme-xp .rxn-bubble.reaction-bubble--active .rxn-bubble__count {
    color: #0A246A;
    font-weight: 700;
}

html.theme-xp .rxn-bubble--add {
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 100%);
    border-style: solid;
    border-color: #DFDFDF #ACA899 #ACA899 #DFDFDF;
    color: #716F64;
    font-size: 12px;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

html.theme-xp .rxn-bubble--add:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #C8D8F0 100%);
    border-color: #316AC5;
    color: #0A246A;
}

/* === XP: кнопка комментариев === */
html.theme-xp .game-card__actions .comments-toggle {
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 50%, #D4D0C8 100%);
    border: 1px solid;
    border-color: #DFDFDF #ACA899 #ACA899 #DFDFDF;
    border-radius: 3px;
    color: #000000;
    box-shadow: inset 1px 1px 0 #FFFFFF;
    transition: none;
}

html.theme-xp .game-card__actions .comments-toggle svg {
    opacity: 1;
    stroke: #716F64;
}

html.theme-xp .game-card__actions .comments-toggle:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #C8D8F0 100%);
    border-color: #316AC5;
    color: #000000;
}

html.theme-xp .game-card__actions .comments-toggle:hover svg {
    opacity: 1;
    stroke: #0A246A;
}

html.theme-xp .game-card__actions .comments-toggle.active {
    background: linear-gradient(to bottom, #C8D8F0 0%, #EEF3FB 100%);
    border-color: #0A246A;
    border-style: solid;
}

html.theme-xp .game-card__actions .comments-toggle.active svg {
    opacity: 1;
    stroke: #0A246A;
}

html.theme-xp .game-card__actions .comment-count-badge {
    color: #000000;
    font-family: Tahoma, sans-serif;
}

/* === XP: попап комментариев === */
html.theme-xp #commentsPopup {
    background: #ECE9D8 !important;
    border: 2px solid !important;
    border-color: #DFDFDF #716F64 #716F64 #DFDFDF !important;
    border-radius: 4px 4px 0 0 !important;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.4) !important;
}

/* Заголовок попапа — синяя XP-полоса */
html.theme-xp #commentsPopup > div:first-child {
    background: linear-gradient(to bottom, #6da4e0 0%, #3d82d8 20%, #2462be 55%, #1a3f90 100%) !important;
    border-bottom: 1px solid #0A246A !important;
    padding: 6px 10px !important;
}

html.theme-xp #commentsPopupTitle {
    color: #FFFFFF !important;
    font-family: Tahoma, sans-serif !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
}

html.theme-xp #commentsPopup > div:first-child button {
    color: rgba(255,255,255,0.8) !important;
    font-size: 16px !important;
}

html.theme-xp #commentsPopup > div:first-child button:hover {
    color: #FFFFFF !important;
}

/* Тело попапа */
html.theme-xp #commentsPopupBody {
    background: #FFFFFF !important;
    border-top: 1px solid #D4D0C8;
}

/* Элемент комментария */
html.theme-xp .comment-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #D4D0C8;
    font-family: Tahoma, sans-serif;
}

html.theme-xp .comment-item:last-child {
    border-bottom: none;
}

html.theme-xp .comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 0 !important;
    border: 1px solid #ACA899;
    flex-shrink: 0;
    object-fit: cover;
}

html.theme-xp .comment-avatar--placeholder {
    background: #D4D0C8 !important;
    color: #000000 !important;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.theme-xp .comment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

html.theme-xp .comment-name {
    font-size: 11px;
    font-weight: 700;
    color: #0A246A;
    font-family: Tahoma, sans-serif;
}

html.theme-xp .comment-text {
    font-size: 12px;
    color: #000000;
    font-family: Tahoma, sans-serif;
    word-break: break-word;
}

html.theme-xp .comment-delete {
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 100%);
    border: 1px solid;
    border-color: #DFDFDF #ACA899 #ACA899 #DFDFDF;
    border-radius: 2px;
    color: #716F64;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

html.theme-xp .comment-delete:hover {
    background: #FFE6E6;
    border-color: #CC3333;
    color: #CC0000;
}

html.theme-xp .comment-empty,
html.theme-xp .comment-loading,
html.theme-xp .comment-error {
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    color: #716F64;
    text-align: center;
    padding: 12px 0;
}

/* Инпут комментария */
html.theme-xp .comment-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 0;
    border-top: 1px solid #D4D0C8;
    margin-top: 4px;
}

html.theme-xp .comment-input {
    flex: 1;
    background: #FFFFFF;
    border: 2px solid;
    border-color: #716F64 #DFDFDF #DFDFDF #716F64;
    border-radius: 0;
    color: #000000;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    padding: 3px 6px;
    box-shadow: inset 1px 1px 0 #ACA899;
    outline: none;
}

html.theme-xp .comment-input:focus {
    border-color: #316AC5 #DFDFDF #DFDFDF #316AC5;
}

html.theme-xp .comment-send {
    background: linear-gradient(to bottom, #5aa4e8 0%, #2a62b0 100%);
    border: 1px solid #0A246A;
    border-radius: 2px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    padding: 2px 8px;
    cursor: pointer;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.3);
}

html.theme-xp .comment-send:hover {
    background: linear-gradient(to bottom, #70b8f8 0%, #3d78c8 100%);
}

html.theme-xp .comment-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    color: #0A246A;
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECE9D8 100%);
    border: 1px solid #716F64;
    border-radius: 2px;
    padding: 4px 10px;
    cursor: pointer;
    margin-top: 8px;
    text-decoration: none;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

html.theme-xp .comment-login-btn:hover {
    background: linear-gradient(to bottom, #EEF3FB 0%, #C8D8F0 100%);
    border-color: #316AC5;
}
