:root {
    color-scheme: light;
    --bg: #e8eaef;
    --surface: #ffffff;
    --surface-soft: #f3f4f7;
    --text: #1a1d24;
    --muted: #6b7280;
    --accent: #3b82f6;
    --accent-dim: #2563eb;
    --accent-light: #60a5fa;
    --danger: #ef4444;
    --border: rgba(0, 0, 0, 0.08);
    --chat-time: #64748b;
    --sidebar-active: #e8f0fe;
    --lobby-highlight: #eff6ff;
}

html.dark .btn.primary,
html.dark .btn-create,
html.dark .btn-send {
    color: #fff;
}

html.dark {
    color-scheme: dark;
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-soft: #1a1a1a;
    --text: #f0f0f0;
    --muted: #9ca3af;
    --accent: #3b82f6;
    --accent-dim: #2563eb;
    --accent-light: #60a5fa;
    --danger: #f87171;
    --border: rgba(255, 255, 255, 0.08);
    --chat-time: #888888;
    --sidebar-active: rgba(59, 130, 246, 0.18);
    --lobby-highlight: rgba(59, 130, 246, 0.1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.game-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.game-brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.game-link, .game-user {
    color: var(--muted);
    margin-left: 12px;
    text-decoration: none;
}

.game-main {
    padding: 20px;
    /* max-width: 1400px; */
    margin: 0 auto;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.btn.primary {
    background: var(--accent);
    border-color: transparent;
    color: #0f1419;
    font-weight: 600;
}

.btn.tiny {
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 0.85rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-block { width: 100%; }

body.nex-modal-open {
    overflow: hidden;
}

.nex-errors {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
    margin-bottom: 16px;
    font-size: 0.88rem;
}

input.nex-input,
.nex-input[type="number"] {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    padding: 10px 12px;
    outline: none;
}

.nex-textarea,
textarea.nex-textarea {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font: inherit;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    outline: none;
}

.nex-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 16px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nex-modal.open {
    visibility: visible;
    opacity: 1;
}

.nex-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 26, 0.55);
}

.nex-modal-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: min(88vh, 900px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(10, 15, 29, 0.28);
}

.nex-modal-dm {
    width: min(960px, 100%);
    max-height: min(86vh, 720px);
}

.nex-modal-dm .nex-modal-head {
    display: none;
}

.nex-modal-close--dm {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    display: grid;
    place-items: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.nex-modal-close--dm:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.nex-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.nex-modal-title {
    margin: 0;
    font-size: 1.1rem;
}

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

.nex-dm-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    height: min(560px, 78vh);
    min-height: 420px;
    max-height: min(78vh, 680px);
}

.nex-dm-list-wrap {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--surface-soft);
}

.nex-dm-list-head {
    padding: 16px 16px 12px;
    flex-shrink: 0;
}

.nex-dm-list-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nex-dm-start {
    display: flex;
    gap: 8px;
    padding: 0 12px 10px;
    flex-wrap: wrap;
}

.nex-dm-start .nex-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.nex-dm-conv-list {
    list-style: none;
    margin: 0;
    padding: 4px 8px 10px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nex-dm-conv-btn {
    width: 100%;
    text-align: left;
    padding: 10px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease;
}

.nex-dm-conv-btn:hover {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.nex-dm-conv-btn.is-active {
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.nex-dm-conv-avatar,
.nex-dm-thread-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
}

.nex-dm-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nex-dm-avatar-letter {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-soft);
}

.nex-dm-conv-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.nex-dm-conv-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nex-dm-conv-preview {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nex-dm-conv-unread {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    background: var(--danger);
    color: #fff;
}

.nex-dm-empty-li {
    padding: 12px 10px;
    font-size: 0.85rem;
}

.nex-dm-thread-wrap {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    background: var(--surface);
    position: relative;
}

.nex-dm-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
}

.nex-dm-empty-icon {
    font-size: 2.2rem;
    color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.nex-dm-panel-loaded {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.nex-dm-placeholder {
    margin: 0;
    font-size: 0.9rem;
    max-width: 260px;
}

.nex-dm-thread-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.nex-dm-thread-back {
    display: none;
    flex-shrink: 0;
}

.nex-dm-thread-peer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.nex-dm-thread-name-link {
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s ease;
}

.nex-dm-thread-name-link:hover {
    color: var(--accent);
}

.nex-dm-thread-name-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}

.nex-dm-thread-peer-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nex-dm-thread-name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nex-dm-thread-status {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nex-dm-thread-status.is-typing {
    color: var(--accent);
    font-style: italic;
}

.nex-dm-thread-menu {
    flex-shrink: 0;
    opacity: 0.45;
}

.nex-dm-panel-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: none;
    border-radius: 0;
    padding: 16px 14px;
    margin: 0;
    background: var(--surface-soft);
    box-sizing: border-box;
}

.nex-dm-compose {
    flex-shrink: 0;
    margin-top: auto;
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.nex-dm-compose-bar {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 6px 8px 6px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nex-dm-compose-bar:focus-within {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
    background: var(--surface);
}

.nex-dm-compose-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    resize: none;
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text);
    max-height: 120px;
    padding: 8px 0;
    overflow-y: auto;
}

.nex-dm-compose-input:focus {
    outline: none;
}

.nex-dm-compose-input::placeholder {
    color: var(--muted);
}

.nex-dm-compose-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    padding-bottom: 2px;
}

.nex-dm-compose-tool {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 1rem;
    opacity: 0.55;
}

.nex-dm-compose-send {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    transition: filter 0.12s ease, opacity 0.12s ease;
}

html.dark .nex-dm-compose-send {
    color: #0f1419;
}

.nex-dm-compose-send:hover:not(:disabled) {
    filter: brightness(1.06);
}

.nex-dm-compose-send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.nex-dm-loading {
    margin: auto;
    padding: 24px;
    text-align: center;
}

.nex-message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message--appear {
    animation: chat-message-in 0.22s ease-out both;
}

@keyframes chat-message-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-message--appear {
        animation: none;
    }
}

.nex-message {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: min(78%, 420px);
}

.nex-message--pending {
    opacity: 0.78;
}

.nex-message-own {
    align-self: flex-end;
}

.nex-message-theirs {
    align-self: flex-start;
}

.nex-message-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    max-width: 100%;
}

.nex-message-own .nex-message-stack {
    align-items: flex-end;
}

.nex-message-theirs .nex-message-stack {
    align-items: flex-start;
}

.nex-message-bubble {
    width: fit-content;
    border-radius: 18px;
    padding: 8px 12px 6px;
    min-width: 0;
    max-width: 100%;
}

.nex-message-own .nex-message-bubble {
    background: var(--accent);
    color: #fff;
    border: none;
    border-bottom-right-radius: 6px;
}

.nex-message-theirs .nex-message-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
}

.nex-message-body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.92rem;
    line-height: 1.45;
}

.nex-message-own .nex-message-body,
.nex-message-own .unlias-user-mention {
    color: #fff;
}

.nex-message-own .unlias-user-mention {
    text-decoration: underline;
    font-weight: 600;
}

.nex-message-author {
    display: none;
}

.unlias-user-mention {
    color: var(--accent, #3b82f6);
    font-weight: 600;
    text-decoration: none;
}

.unlias-user-mention:hover {
    text-decoration: underline;
}

.lobby-chat-text .unlias-user-mention {
    color: var(--accent, #3b82f6);
}

.lobby-chat-line--own .lobby-chat-text .unlias-user-mention {
    color: rgba(255, 255, 255, 0.95);
}

.log-line .unlias-user-mention {
    color: #d6d6d6;
}

.nex-message-time-in {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    line-height: 1;
    text-align: right;
    opacity: 0.75;
    white-space: nowrap;
}

.nex-message-own .nex-message-time-in {
    color: rgba(255, 255, 255, 0.85);
}

.nex-message-read {
    font-size: 0.68rem;
    padding-right: 2px;
}

.nex-chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-market-filters {
    margin-bottom: 18px;
}

.game-market-filters-hint {
    margin: -8px 0 14px;
    font-size: 0.88rem;
}

.game-market-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px 14px;
    margin-bottom: 14px;
}

.game-market-filter label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.game-market-filter input[type="search"],
.game-market-filter select {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
}

.game-market-filters-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.game-market-field-target {
    color: var(--text);
    font-weight: 500;
}

.game-market-item-meta {
    display: block;
    font-size: 0.88rem;
    line-height: 1.35;
}

.game-catalog-page .game-admin-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.game-catalog-page .game-admin-pagination-info {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.game-catalog-page .game-admin-pagination-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-catalog-page .game-admin-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.game-catalog-page a.game-admin-pagination-link:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    color: var(--accent);
}

.game-catalog-page .game-admin-pagination-item.is-active .game-admin-pagination-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.game-catalog-page .game-admin-pagination-item.is-disabled .game-admin-pagination-link {
    opacity: 0.45;
    color: var(--muted);
}

.game-market-help {
    margin-bottom: 18px;
}

.game-market-fee-example,
.game-market-price {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.92rem;
}

.game-catalog-page .game-market-fee-example span {
    flex: 1 1 140px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.game-market-fee-example span,
.game-market-price span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 10px;
    background: var(--surface-soft);
}

.game-market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.game-market-my-lots {
    scroll-margin-top: 88px;
}

.game-market-my-lots .game-market-grid--my-lots {
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 16px;
}

.game-market-my-lots .game-market-card--own {
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.game-market-my-lots .game-market-card--own:hover {
    transform: none;
}

.game-market-my-lots .game-market-card__media {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 35%, var(--surface-soft));
}

.game-market-my-lots .game-market-card__img {
    display: block;
    width: 100%;
    height: 104px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--surface);
    padding: 10px;
    box-sizing: border-box;
}

.game-market-my-lots .game-market-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 12px;
    flex: 1;
    min-width: 0;
}

.game-market-my-lots .game-market-card__body .game-inventory-headline {
    margin-bottom: 2px;
}

.game-market-my-lots .game-market-card__body .game-inventory-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    min-width: 0;
}

.game-market-my-lots .game-market-item-meta {
    display: block;
    font-size: 0.84rem;
    line-height: 1.4;
    word-break: break-word;
}

.game-market-my-lot-pricing {
    margin: 8px 0 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-soft);
}

.game-market-my-lot-pricing__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 10px 12px;
}

.game-market-my-lot-pricing__row + .game-market-my-lot-pricing__row {
    border-top: 1px solid color-mix(in srgb, var(--text) 10%, var(--border));
}

.game-market-my-lot-pricing__row dt {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
}

.game-market-my-lot-pricing__row dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    text-align: right;
}

.game-market-my-lots .game-market-card__footer {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 20%, var(--surface-soft));
}

.game-market-my-lots .game-market-card__footer form {
    margin: 0;
}

.game-market-my-lots .game-market-card__cancel {
    width: 100%;
    justify-content: center;
    border-color: color-mix(in srgb, var(--danger, #c23838) 35%, var(--border));
    color: var(--danger, #c23838);
    background: var(--surface);
}

.game-market-my-lots .game-market-card__cancel:hover {
    border-color: color-mix(in srgb, var(--danger, #c23838) 55%, var(--border));
    background: color-mix(in srgb, var(--danger, #c23838) 8%, var(--surface));
}

.game-market-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: 14px;
    padding: 16px;
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.game-market-card--catalog {
    text-decoration: none;
    color: inherit;
}

a.game-market-card--catalog:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.game-market-catalog-hint,
.game-market-item-lots-hint {
    margin: 0 0 12px;
}

.game-market-catalog-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 8px;
}

.game-market-catalog-price__label {
    font-size: 0.82rem;
}

.game-market-catalog-count {
    margin: 4px 0 0;
    font-size: 0.82rem;
}

.game-market-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 0.88rem;
}

.game-market-breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.game-market-breadcrumb a:hover {
    text-decoration: underline;
}

.game-market-item-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 18px;
    margin-bottom: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.game-market-item-hero__media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
    overflow: hidden;
}

.game-market-item-hero__img {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.game-market-item-hero__body .game-inventory-name {
    font-size: 1.35rem;
}

.game-market-item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 14px 0 0;
}

.game-market-item-stats div {
    min-width: 90px;
}

.game-market-item-stats dt {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.game-market-item-stats dd {
    margin: 2px 0 0;
    font-size: 1.05rem;
    font-weight: 700;
}

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

.game-market-lot {
    display: grid;
    grid-template-columns: minmax(110px, 140px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.game-market-lot__price strong {
    font-size: 1rem;
}

.game-market-lot__seller {
    font-size: 0.92rem;
}

.game-market-lot__action form {
    margin: 0;
}

.game-market-my-lots .game-inventory-name a {
    color: inherit;
    text-decoration: none;
}

.game-market-my-lots .game-inventory-name a:hover {
    color: var(--accent);
}

@media (max-width: 720px) {
    .game-market-item-hero {
        grid-template-columns: 1fr;
    }

    .game-market-lot {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .game-market-lot__action {
        justify-self: start;
    }
}

.game-market-seller {
    margin: 0;
    font-size: 0.88rem;
}

.game-market-list-form,
.game-market-mini {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.game-market-price-field {
    display: grid;
    gap: 6px;
}

.game-market-fee-note {
    margin: 0;
    font-size: 0.84rem;
}

.game-market-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.lobby-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.room-list {
    display: grid;
    gap: 12px;
}

.room-card, .empty-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.room-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ——— App shell + sidebar (как FILE) ——— */
.game-shell-backdrop {
    display: none;
}

body.game-body--shell {
    --game-sidebar-w: 260px;
    --game-sidebar-w-mini: 72px;
    --game-sidebar-head-h: 64px;
    --game-shell-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --game-shell-dur: 0.36s;
    margin: 0;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
}

.game-app-shell {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-columns: var(--game-sidebar-w) minmax(0, 1fr);
    transition: grid-template-columns var(--game-shell-dur) var(--game-shell-ease);
}

html[data-game-sidebar-collapsed="1"] .game-app-shell:not(.sidebar-transition-ready) {
    grid-template-columns: var(--game-sidebar-w-mini) minmax(0, 1fr);
}

html[data-game-sidebar-collapsed="0"] .game-app-shell:not(.sidebar-transition-ready) {
    grid-template-columns: var(--game-sidebar-w) minmax(0, 1fr);
}

html[data-game-sidebar-collapsed="0"] .game-app-shell.sidebar-collapsed:not(.sidebar-transition-ready) .game-sidebar-brand-text,
html[data-game-sidebar-collapsed="0"] .game-app-shell.sidebar-collapsed:not(.sidebar-transition-ready) .game-sidebar-link-label {
    opacity: 1;
    max-width: 180px;
    pointer-events: auto;
}

html[data-game-sidebar-collapsed="1"] .game-app-shell:not(.sidebar-collapsed):not(.sidebar-transition-ready) .game-sidebar-brand-text,
html[data-game-sidebar-collapsed="1"] .game-app-shell:not(.sidebar-collapsed):not(.sidebar-transition-ready) .game-sidebar-link-label {
    opacity: 0;
    max-width: 0;
    margin: 0;
    pointer-events: none;
}

.game-app-shell:not(.sidebar-transition-ready) {
    transition: none;
}

.game-app-shell:not(.sidebar-transition-ready) .game-sidebar-brand-text,
.game-app-shell:not(.sidebar-transition-ready) .game-sidebar-link-label,
.game-app-shell:not(.sidebar-transition-ready) .game-sidebar-toggle-btn i,
.game-app-shell:not(.sidebar-transition-ready) .game-topbar-title,
.game-app-shell:not(.sidebar-transition-ready) .game-topbar-actions {
    transition: none;
}

.game-app-shell.sidebar-collapsed {
    grid-template-columns: var(--game-sidebar-w-mini) minmax(0, 1fr);
}

.game-sidebar {
    position: relative;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    z-index: 40;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: visible;
    transition: box-shadow var(--game-shell-dur) var(--game-shell-ease);
}

.game-app-shell.sidebar-collapsed .game-sidebar {
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06);
}

.game-sidebar-head {
    min-height: var(--game-sidebar-head-h);
    height: var(--game-sidebar-head-h);
    padding: 0 14px 0 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    transition: padding var(--game-shell-dur) var(--game-shell-ease);
}

.game-app-shell.sidebar-collapsed .game-sidebar-head {
    justify-content: center;
    padding: 0 8px;
}

.game-app-shell.sidebar-collapsed .game-sidebar-brand {
    justify-content: center;
    width: 100%;
}

.game-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
    color: var(--text);
    text-decoration: none;
    min-width: 0;
}

.game-sidebar-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--text);
    color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.game-sidebar-brand-mark i {
    display: block;
    font-size: 0.95rem;
    line-height: 1;
    transform: translateX(0.5px);
}

.game-body--lobby .game-sidebar-brand-mark {
    background: var(--accent);
    color: #fff;
}

.game-sidebar-brand-text,
.game-sidebar-link-label {
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    max-width: 180px;
    transition: opacity 0.22s ease, max-width var(--game-shell-dur) var(--game-shell-ease), margin var(--game-shell-dur) var(--game-shell-ease);
}

.game-app-shell.sidebar-collapsed .game-sidebar-brand-text,
.game-app-shell.sidebar-collapsed .game-sidebar-link-label {
    opacity: 0;
    max-width: 0;
    margin: 0;
    pointer-events: none;
}

.game-sidebar-toggle-btn,
.game-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    padding: 0;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.game-sidebar-toggle-btn {
    position: absolute;
    top: var(--game-sidebar-head-h);
    right: 0;
    z-index: 45;
    transform: translate(50%, -50%);
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.game-app-shell.sidebar-collapsed .game-sidebar-toggle-btn {
    transform: translate(50%, -50%);
}

html.dark .game-sidebar-toggle-btn {
    background: var(--surface);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.game-sidebar-toggle-btn i {
    transition: transform var(--game-shell-dur) var(--game-shell-ease);
}

.game-app-shell.sidebar-collapsed .game-sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.game-sidebar-toggle-btn:hover,
.game-icon-btn:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.game-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.game-sidebar-foot {
    padding: 10px 10px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.game-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.92rem;
    text-decoration: none;
    border: 1px solid transparent;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease, padding var(--game-shell-dur) var(--game-shell-ease), gap var(--game-shell-dur) var(--game-shell-ease), justify-content var(--game-shell-dur) var(--game-shell-ease);
}

.game-app-shell.sidebar-collapsed .game-sidebar-link {
    justify-content: center;
    gap: 0;
    padding: 12px 8px;
}

.game-sidebar-link i {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    font-size: 1.05rem;
    transition: transform 0.25s var(--game-shell-ease);
}

.game-app-shell.sidebar-collapsed .game-sidebar-link:hover i {
    transform: scale(1.08);
}

.game-sidebar-link:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.game-sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--accent);
}

.game-sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
    transition: top var(--game-shell-dur) var(--game-shell-ease), bottom var(--game-shell-dur) var(--game-shell-ease), left var(--game-shell-dur) var(--game-shell-ease), right var(--game-shell-dur) var(--game-shell-ease), width var(--game-shell-dur) var(--game-shell-ease), height var(--game-shell-dur) var(--game-shell-ease);
}

.game-sidebar-unread-badge {
    flex-shrink: 0;
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    box-sizing: border-box;
    pointer-events: none;
}

.game-sidebar-unread-badge[hidden],
.nex-dm-conv-unread[hidden] {
    display: none !important;
}

.game-sidebar-link[data-dm-sidebar-link] .game-sidebar-link-label {
    flex: 1;
    min-width: 0;
}

.game-app-shell.sidebar-collapsed .game-sidebar-unread-badge {
    position: absolute;
    margin-left: 0;
    right: 8px;
    top: 8px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 10px;
    border: 2px solid var(--sidebar-bg, var(--surface));
}

.game-sidebar-link.has-dm-unread:not(.active) {
    color: var(--text);
}

.game-app-shell.sidebar-collapsed .game-sidebar-link.active::before {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 6px;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.game-app-shell.sidebar-collapsed .game-sidebar-nav,
.game-app-shell.sidebar-collapsed .game-sidebar-foot {
    padding-left: 8px;
    padding-right: 8px;
}

.game-main-area {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    transition: filter var(--game-shell-dur) var(--game-shell-ease);
    position: relative;
}

.game-active-session-banner {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 45;
    width: min(288px, calc(100vw - 36px));
    pointer-events: none;
}

.game-active-session-banner__card {
    position: relative;
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        'icon body'
        'btn btn';
    gap: 10px 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--accent-roll) 32%, var(--border));
    background: color-mix(in srgb, var(--surface-card) 92%, var(--accent-roll) 8%);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
}

.game-active-session-banner__pulse {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-roll);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-roll) 55%, transparent);
    animation: game-active-session-pulse 1.8s ease-out infinite;
}

@keyframes game-active-session-pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-roll) 45%, transparent);
    }
    70% {
        box-shadow: 0 0 0 8px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

.game-active-session-banner__icon {
    grid-area: icon;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent-roll) 16%, var(--surface-deep));
    color: var(--accent-roll);
    font-size: 16px;
}

.game-active-session-banner__body {
    grid-area: body;
    min-width: 0;
}

.game-active-session-banner__kicker {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-roll);
}

.game-active-session-banner__title {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.game-active-session-banner__meta {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.3;
}

.game-active-session-banner__btn {
    grid-area: btn;
    width: 100%;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 720px) {
    .game-active-session-banner {
        right: 12px;
        bottom: 12px;
        width: min(288px, calc(100vw - 24px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-active-session-banner__pulse {
        animation: none;
    }
}

body.game-body--shell .game-main-area .game-topbar {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--game-topbar-height, 56px);
    padding: 12px 20px;
    box-sizing: border-box;
    transition: padding var(--game-shell-dur) var(--game-shell-ease), box-shadow var(--game-shell-dur) var(--game-shell-ease), background var(--game-shell-dur) ease;
}

.game-app-shell.sidebar-collapsed .game-main-area .game-topbar {
    padding-left: 14px;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
}

.game-body--lobby .game-app-shell.sidebar-collapsed .game-main-area .game-topbar {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

@media (prefers-reduced-motion: reduce) {
    body.game-body--shell {
        --game-shell-dur: 0.01ms;
    }

    .game-sidebar-toggle-btn i,
    .game-sidebar-link i {
        transition: none;
    }
}

.game-topbar-menu {
    display: none;
}

.game-topbar-title,
.game-topbar-actions {
    transition: transform var(--game-shell-dur) var(--game-shell-ease), opacity 0.28s ease;
}

.game-topbar-title {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.game-app-shell.sidebar-collapsed .game-topbar-title {
    transform: translateX(6px);
}

.game-app-shell.sidebar-collapsed .game-topbar-actions {
    transform: translateX(-4px);
}

.game-topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    --game-topbar-control-h: 36px;
}

.game-topbar-actions > .game-icon-btn {
    width: var(--game-topbar-control-h);
    height: var(--game-topbar-control-h);
    min-width: var(--game-topbar-control-h);
    min-height: var(--game-topbar-control-h);
    padding: 0;
}

.game-topbar-chat-btn {
    display: none;
}

.game-topbar-user-hub {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.game-topbar-user-hub .unlias-notif-hub {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.game-topbar-user-hub .unlias-notif-btn {
    width: var(--game-topbar-control-h);
    height: var(--game-topbar-control-h);
    min-width: var(--game-topbar-control-h);
    min-height: var(--game-topbar-control-h);
    padding: 0;
}

.game-topbar-profile-anchor {
    position: relative;
    flex-shrink: 0;
}

.game-topbar-balance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--game-topbar-control-h);
    min-height: var(--game-topbar-control-h);
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
    max-width: min(140px, 34vw);
    box-sizing: border-box;
}

.game-topbar-balance__value {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-topbar-balance:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    color: var(--accent-light);
}

.game-topbar-avatar-btn {
    display: inline-grid;
    place-items: center;
    width: var(--game-topbar-control-h);
    height: var(--game-topbar-control-h);
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.game-topbar-avatar-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.game-topbar-avatar {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    box-sizing: border-box;
}

.game-topbar-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    max-width: min(160px, 28vw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-topbar-user-name:hover {
    color: var(--accent-light);
}

.game-topbar-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    max-width: min(320px, calc(100vw - 24px));
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    z-index: 120;
}

.game-topbar-user-menu-head {
    padding: 6px 10px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.game-topbar-user-menu[hidden] {
    display: none;
}

.game-topbar-user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}

.game-topbar-user-menu-item:hover,
.game-topbar-user-menu-item:focus-visible {
    background: var(--surface-soft);
    color: var(--text);
}

.game-topbar-user-menu-item i {
    width: 16px;
    text-align: center;
    color: var(--muted);
    flex-shrink: 0;
}

.game-topbar-user-menu-item__label {
    flex: 1;
    min-width: 0;
}

.game-topbar-user-menu-divider {
    height: 1px;
    margin: 6px 8px;
    background: var(--border);
}

.game-topbar-alert-sounds {
    padding: 2px 6px 8px;
}

.game-topbar-alert-volume {
    padding: 0 8px 8px;
}

.game-topbar-alert-volume__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}

.game-topbar-alert-volume__value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text);
}

.game-alert-volume-slider {
    --volume-pct: 68;
    position: relative;
    height: 24px;
}

.game-alert-volume-slider__track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 5px;
    border-radius: 999px;
    background: var(--surface-soft, #e5e7eb);
    overflow: hidden;
}

.game-alert-volume-slider__fill {
    display: block;
    height: 100%;
    width: calc(var(--volume-pct) * 1%);
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa 0%, #818cf8 45%, #a78bfa 100%);
    transition: width 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-alert-volume-slider__input {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.game-alert-volume-slider__thumb {
    position: absolute;
    top: 50%;
    left: calc(var(--volume-pct) * 1%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #818cf8;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: left 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-alert-volume-slider--muted .game-alert-volume-slider__fill {
    background: var(--muted);
}

.game-topbar-alert-toggles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-topbar-alert-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text);
}

.game-topbar-alert-toggle:hover {
    background: var(--surface-soft, rgba(0, 0, 0, 0.04));
}

.game-topbar-alert-toggle__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.game-topbar-alert-toggle__box {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    position: relative;
}

.game-topbar-alert-toggle__input:checked + .game-topbar-alert-toggle__box {
    background: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
}

.game-topbar-alert-toggle__input:checked + .game-topbar-alert-toggle__box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.game-topbar-alert-toggle__label {
    flex: 1;
    min-width: 0;
}

.game-topbar-alert-preview {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.game-topbar-alert-preview:hover,
.game-topbar-alert-preview:focus-visible {
    background: var(--surface-soft, rgba(0, 0, 0, 0.06));
    color: var(--accent, #6366f1);
}

.game-topbar-menu-badge {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    box-sizing: border-box;
}

.game-trade-inbox-section__badge {
    margin-left: 8px;
    vertical-align: middle;
}

.game-trade-inbox-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.game-trade-inbox-row + .game-trade-inbox-row {
    border-top: 1px solid var(--border);
}

.game-trade-inbox-row__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.game-trade-inbox-row__link:hover {
    background: var(--surface-soft);
}

.game-trade-inbox-row__avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    background: var(--surface-soft) center/cover no-repeat;
    border: 1px solid var(--border);
}

.game-trade-inbox-row__avatar--letter {
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    background: var(--accent);
}

.game-trade-inbox-row__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-trade-inbox-row__name {
    font-size: 0.95rem;
}

.game-trade-inbox-row__meta,
.game-trade-inbox-row__items {
    font-size: 0.82rem;
    line-height: 1.35;
}

.game-trade-inbox-row__chevron {
    color: var(--muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

body.game-body--shell .game-main-area .game-main {
    flex: 1;
    min-height: 0;
    overflow: auto;
    position: relative;
}

.game-main-frame {
    display: block;
    min-height: 0;
}

.game-shell-nav-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 40;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.game-shell-nav-loader.is-active {
    opacity: 1;
}

.game-shell-nav-loader__bar {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(0.2);
    background: linear-gradient(90deg, #60a5fa 0%, #818cf8 45%, #a78bfa 100%);
    animation: game-shell-nav-progress 0.85s cubic-bezier(0.33, 1, 0.45, 1) infinite;
}

@keyframes game-shell-nav-progress {
    0% {
        transform: scaleX(0.06);
        opacity: 0.65;
    }
    50% {
        transform: scaleX(0.82);
        opacity: 1;
    }
    100% {
        transform: scaleX(0.06);
        opacity: 0.65;
    }
}

.lobby-page--shell,
.game-spectate-page {
    position: relative;
}

.lobby-panel-loadable {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.lobby-side-card--friends.lobby-panel-loadable {
    flex: 1 1 auto;
    min-height: 120px;
}

.lobby-chat-feed-wrap.lobby-panel-loadable {
    flex: 1 1 auto;
    min-height: 0;
}

.lobby-rooms-list-shell.lobby-panel-loadable {
    flex: 1 1 auto;
    min-height: 160px;
}

.lobby-panel-loader {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--surface-soft, var(--bg)) 84%, transparent);
    backdrop-filter: blur(1px);
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.lobby-panel-loader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lobby-panel-loader__spinner {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--accent, #6366f1);
    animation: game-shell-page-spin 0.7s linear infinite;
}

.game-shell-page-loader {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: min(16vh, 120px);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.game-shell-page-loader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.game-shell-page-loader__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.game-shell-page-loader__spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--accent, #6366f1);
    animation: game-shell-page-spin 0.7s linear infinite;
}

.game-shell-page-loader__text {
    font-size: 0.82rem;
    color: var(--muted);
}

@keyframes game-shell-page-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-shell-nav-loader__bar,
    .game-shell-page-loader__spinner {
        animation: none;
    }
}

body.game-body--account.game-body--shell .game-main-area .game-main {
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

body.game-body--catalog.game-body--shell .game-main-area .game-main {
    padding: 20px;
    /* max-width: 1200px; */
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    body.game-body--account.game-body--shell .game-main-area .game-main,
    body.game-body--catalog.game-body--shell .game-main-area .game-main {
        padding: 15px;
    }
}

@media (max-width: 900px) {
    .nex-modal-dm {
        max-height: min(92vh, 800px);
    }

    .nex-dm-layout {
        grid-template-columns: 1fr;
        max-height: none;
        min-height: min(70vh, 560px);
    }

    .nex-dm-list-wrap {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 38vh;
    }

    .nex-modal-dm.nex-dm-has-thread .nex-dm-list-wrap {
        display: none;
    }

    .nex-dm-thread-back {
        display: inline-grid;
    }

    .nex-dm-thread-head .nex-dm-thread-peer {
        flex: 1;
        min-width: 0;
    }

    .nex-modal-close--dm {
        top: 10px;
        right: 10px;
    }

    .nex-dm-panel-scroll {
        min-height: 240px;
    }

    body.game-body--account.game-body--shell .game-main-area .game-main,
    body.game-body--catalog.game-body--shell .game-main-area .game-main {
        padding: 15px;
    }

    .game-shell-backdrop.game-shell-backdrop--open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 34;
        background: rgba(15, 23, 42, 0.38);
    }

    .game-app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .game-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(280px, 88vw);
        transform: translateX(-102%);
        transition: transform 0.28s ease;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
        min-height: 100dvh;
    }

    .game-app-shell.sidebar-open .game-sidebar {
        transform: translateX(0);
    }

    .game-app-shell.sidebar-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }

    .game-app-shell.sidebar-collapsed .game-sidebar-brand-text,
    .game-app-shell.sidebar-collapsed .game-sidebar-link-label {
        opacity: 1;
        max-width: 180px;
        pointer-events: auto;
    }

    .game-topbar-menu {
        display: inline-grid;
    }

    .game-sidebar-toggle-btn {
        display: none;
    }

    body.game-body--shell .game-main-area .game-topbar {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ——— Lobby hub (3 columns) ——— */
.lobby-create-dialog {
    background: var(--surface);
}

html.dark body.game-body--lobby {
    color-scheme: dark;
}

html.dark .lobby-col {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

html.dark .lobby-side-card {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
}

.game-body--lobby .unlias-notif-panel {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.game-body--lobby .game-main-area .game-topbar {
    background: var(--surface);
    box-shadow: 0 1px 0 var(--border);
}

.game-body--lobby.game-body--shell .game-main-area .game-main {
    padding: 0;
    max-width: none;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lobby-page {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    height: 100%;
    min-height: 0;
}

.lobby-inline-notice {
    flex-shrink: 0;
    margin: 0;
    padding: 8px 12px;
}

.lobby-col--rooms {
    padding: 0;
}

.lobby-active-game-mount {
    flex-shrink: 0;
    padding: 14px 14px 0;
}

.lobby-active-game-mount:empty {
    display: none;
}

.lobby-active-game {
    margin: 0 0 14px;
}

.lobby-active-game__card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        'icon body'
        'btn btn';
    gap: 10px 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--accent-roll) 30%, var(--border));
    background: color-mix(in srgb, var(--surface) 88%, var(--accent-roll) 12%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.lobby-active-game__pulse {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-roll);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-roll) 55%, transparent);
    animation: game-active-session-pulse 1.8s ease-out infinite;
}

.lobby-active-game__icon {
    grid-area: icon;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--accent-roll) 18%, var(--surface));
    color: var(--accent-roll);
    font-size: 1.1rem;
}

.lobby-active-game__body {
    grid-area: body;
    min-width: 0;
}

.lobby-active-game__kicker {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-roll);
}

.lobby-active-game__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
}

.lobby-active-game__meta {
    margin: 4px 0 0;
    font-size: 11px;
}

.lobby-active-game__btn {
    grid-area: btn;
    width: 100%;
    justify-content: center;
}

body.game-body--lobby .game-active-session-banner {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .lobby-active-game__pulse {
        animation: none;
    }
}

.lobby-my-rooms-mount {
    flex-shrink: 0;
}

.lobby-my-rooms {
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.lobby-rooms-waiting {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.lobby-create-competitive {
    padding: 12px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 14px;
    background: color-mix(in srgb, rgba(245, 158, 11, 0.12) 100%, var(--surface));
}

.lobby-competitive-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.lobby-competitive-kicker {
    display: block;
    margin-bottom: 2px;
    color: #b45309;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lobby-competitive-head h2 {
    margin: 0;
    font-size: 1rem;
}

.lobby-competitive-head p {
    margin: 2px 0 0;
    font-size: 11px;
}

.lobby-competitive-rating {
    flex-shrink: 0;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
    font-size: 11px;
    font-weight: 800;
}

.lobby-competitive-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.lobby-competitive-sizes label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface);
}

.lobby-competitive-status {
    min-height: 22px;
    font-size: 12px;
}

.lobby-competitive-status p {
    margin: 0;
}

.lobby-competitive-warning {
    color: #b91c1c;
    font-weight: 700;
}

.lobby-competitive-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.lobby-competitive-found {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.lobby-competitive-players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.lobby-competitive-player {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 3px 8px;
    align-items: center;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.lobby-competitive-avatar {
    grid-row: span 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    background-size: cover;
    background-position: center;
    color: #fff;
    font-weight: 800;
}

.lobby-competitive-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 800;
}

.lobby-competitive-player-status {
    font-size: 11px;
    color: var(--muted);
}

.lobby-competitive-player-status--accepted {
    color: #15803d;
    font-weight: 800;
}

.lobby-my-rooms-head {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--lobby-highlight);
}

.lobby-my-rooms-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.lobby-my-rooms-head p { margin: 2px 0 0; font-size: 11px; }

.lobby-my-rooms-body .lobby-room {
    border-bottom: none;
}

.lobby-room--mine {
    background: var(--lobby-highlight);
}

.lobby-hub {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.35fr) minmax(300px, 1.15fr);
    gap: 10px;
    flex: 1;
    height: 100%;
    min-height: 0;
    align-items: stretch;
    padding: 10px;
    box-sizing: border-box;
}

.lobby-col--chat {
    min-height: 0;
}

.lobby-col {
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.lobby-rooms-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.lobby-rooms-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.lobby-rooms-count { margin: 2px 0 0; font-size: 11px; }

.btn-create {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
}

.btn-create .fa-solid {
    font-size: 11px;
}

.btn-create:hover { filter: brightness(1.05); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
}

.lobby-rooms-list {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

.lobby-room {
    padding: 14px 16px 16px;
    border-bottom: 1px solid var(--border);
}

.lobby-room:last-child { border-bottom: none; }

.lobby-room-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.lobby-room-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    font-size: 15px;
    background: transparent;
    border-radius: 0;
}

.lobby-room-icon--classic {
    color: #16a34a;
}

.lobby-room-icon--competitive {
    color: #b45309;
}

.lobby-room-icon--team-2v2 {
    color: #059669;
}

.lobby-room-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.lobby-room-name--classic {
    color: #16a34a;
}

.lobby-room-name--competitive {
    color: #b45309;
}

.lobby-room-name--team-2v2 {
    color: #059669;
}

.lobby-room-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1;
    min-width: 0;
}

.lobby-room-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.lobby-room-tag .fa-solid {
    font-size: 11px;
    opacity: 0.85;
}

.lobby-room-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lobby-room-activity-stack {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.lobby-room-activity-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
    z-index: 3;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.lobby-room-activity-badge--plus {
    background: #22c55e;
    color: #fff;
}

.lobby-room-activity-badge--minus {
    background: #ef4444;
    color: #fff;
}

.lobby-room-activity-faces {
    display: inline-flex;
    align-items: center;
    margin-left: -4px;
}

.lobby-room-activity-face {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface-soft) center/cover no-repeat;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text);
    margin-left: -9px;
    border: 2px solid var(--surface);
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
}

.lobby-room-activity-stack--invite .lobby-room-activity-face {
    border-color: color-mix(in srgb, #22c55e 45%, var(--surface));
}

.lobby-room-activity-stack--kick .lobby-room-activity-face {
    border-color: color-mix(in srgb, #ef4444 45%, var(--surface));
}

.lobby-room-activity-faces .lobby-room-activity-face:first-child {
    margin-left: 0;
}

.lobby-room-activity-face--more {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.lobby-room-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.lobby-room-head-actions .btn-sm {
    padding: 5px 10px;
    font-size: 11px;
    gap: 4px;
}

.lobby-room-watch-form {
    margin-left: auto;
    flex-shrink: 0;
}

.lobby-room-watch-btn {
    background: #475569;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.lobby-room-watch-btn:hover {
    filter: brightness(1.08);
}

.lobby-room-close-form,
.lobby-room-leave-form {
    margin: 0;
    flex-shrink: 0;
}

.lobby-room-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.lobby-room-close:hover {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

.lobby-room-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.lobby-room-slots {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px 18px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.lobby-room-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 20px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    position: relative;
}

.lobby-room-settings__col {
    min-width: 0;
}

.lobby-room-settings__col + .lobby-room-settings__col {
    border-left: 1px solid var(--border);
    padding-left: 20px;
}

.lobby-room-settings__title {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.lobby-room-settings .lobby-create-toggle {
    padding: 8px 0;
}

.lobby-room-settings__stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 2px;
}

.lobby-room-settings__stepper-label {
    font-weight: 600;
    font-size: 14px;
}

.lobby-room-stepper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.lobby-room-stepper__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.lobby-room-stepper__btn:hover:not(:disabled) {
    filter: brightness(1.06);
}

.lobby-room-stepper__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lobby-room-stepper__value {
    min-width: 1.2em;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.lobby-room-settings__field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 2px;
}

.lobby-room-settings__field-label {
    font-weight: 600;
    font-size: 14px;
}

.lobby-room-settings__field-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.lobby-room-settings__corner {
    border: none;
    margin: 0;
    padding: 8px 0 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lobby-room-settings__corner-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.lobby-room-settings__corner-option input {
    margin-top: 2px;
    accent-color: var(--accent);
}

.lobby-room-settings__status {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    font-size: 11px;
    text-align: center;
}

.lobby-room-settings__status.is-error {
    color: #b91c1c;
}

.lobby-room-settings.is-busy {
    opacity: 0.85;
    pointer-events: none;
}

@media (max-width: 640px) {
    .lobby-room-settings {
        grid-template-columns: 1fr;
        gap: 12px 0;
    }

    .lobby-room-settings__col + .lobby-room-settings__col {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 12px;
    }
}

/* 2 на 2: две команды друг против друга */
.lobby-room-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px 14px;
    align-items: stretch;
}

.lobby-room-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.lobby-room-team-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.lobby-room-team-slots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 14px;
    width: 100%;
}

.lobby-room-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-width: 36px;
    padding: 0 2px;
}

.lobby-room-vs span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.lobby-room-teams .lobby-slot {
    width: 72px;
}

.lobby-room-teams .lobby-slot-label {
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
    max-width: 72px;
}

.lobby-slot {
    width: 76px;
    flex-shrink: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lobby-slot-btn {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    font: inherit;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lobby-slot-btn:hover .lobby-slot-plus {
    color: var(--text);
}

.lobby-slot-btn:hover .lobby-slot-label {
    color: var(--text);
}

.lobby-slot-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.lobby-slot-plus .fa-solid {
    font-size: 1.1rem;
}

.lobby-slot--filled .lobby-slot-avatar,
a.lobby-slot-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 50%;
    background: var(--surface-soft) center/cover no-repeat;
    font-weight: 700;
    font-size: 16px;
    color: var(--muted);
    position: relative;
    text-decoration: none;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.lobby-slot-online {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--surface);
    box-sizing: border-box;
}

.lobby-slot-name {
    display: block;
    max-width: 100%;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.2;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lobby-slot-name:hover {
    color: var(--accent);
    text-decoration-color: currentColor;
}

.lobby-slot-label {
    display: block;
    max-width: 100%;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.2;
    text-transform: lowercase;
}

.lobby-slot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 14%, var(--surface-soft));
    color: var(--accent);
    font-size: 9px;
}

.lobby-slot-badge .fa-solid {
    font-size: 8px;
}

.lobby-slot--locked { opacity: 0.65; pointer-events: none; }

.lobby-slot--filled { position: relative; }

.lobby-slot-kick-form {
    position: absolute;
    top: -4px;
    right: 4px;
    z-index: 2;
    margin: 0;
}

.lobby-slot-kick {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.lobby-room-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.lobby-room-actions .btn-block {
    padding: 8px 12px;
    font-size: 12px;
}

.lobby-room-start-form {
    margin: 0;
}

.lobby-room-wait {
    margin: 0;
    font-size: 11px;
    text-align: center;
    line-height: 1.3;
}

.waiting-kick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.btn-kick {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.lobby-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 12px;
}

.lobby-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.lobby-chat-head > div {
    display: flex;
    align-items: baseline;
    gap: 8px 12px;
    flex-wrap: nowrap;
    min-width: 0;
}

.lobby-chat-head-main {
    flex: 1 1 auto;
    min-width: 0;
}

.lobby-chat-head-side {
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.lobby-ws-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--muted);
}

.lobby-ws-status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.lobby-ws-status--connecting {
    color: #d4a017;
}

.lobby-ws-status--online {
    color: #3ecf8e;
}

.lobby-ws-status--offline {
    color: #e06c75;
}

.lobby-chat-head h2 {
    margin: 0;
    font-size: 1.1rem;
    white-space: nowrap;
}

.lobby-chat-head p {
    margin: 0;
    font-size: 0.88rem;
    white-space: nowrap;
}

.lobby-chat-online-line {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28em;
    min-width: 8.5ch;
}

.lobby-chat-online-count {
    display: inline-block;
    min-width: 2.5ch;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.lobby-chat-close {
    display: none;
    flex-shrink: 0;
}

.lobby-chat-feed {
    flex: 1;
    overflow-y: auto;
    overflow-anchor: none;
    padding: 14px 12px 16px;
    font-size: 13px;
    line-height: 1.45;
    background: var(--surface-soft);
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lobby-chat-line--moderatable,
.log-line--moderatable {
    position: relative;
}

.chat-mod-delete {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.log-line--moderatable .chat-mod-delete {
    position: absolute;
    right: 0;
    top: 0;
    display: none;
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0.85;
}

.chat-mod-delete:hover,
.chat-mod-delete:focus-visible {
    color: #f87171;
    background: color-mix(in srgb, #ef4444 18%, transparent);
    opacity: 1;
}

.lobby-chat-line--moderatable:hover .lobby-chat-bubble-foot .chat-mod-delete,
.lobby-chat-line--moderatable:focus-within .lobby-chat-bubble-foot .chat-mod-delete,
.log-line--moderatable:hover .chat-mod-delete,
.log-line--moderatable:focus-within .chat-mod-delete {
    display: inline-flex;
}

.lobby-chat-line {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: fit-content;
    max-width: min(85%, 420px);
    word-break: break-word;
    text-align: left;
    color: var(--text);
}

.lobby-chat-line--own {
    align-self: flex-end;
    margin-left: auto;
}

.lobby-chat-line--pending {
    opacity: 0.82;
    transition: opacity 0.12s ease;
}

.lobby-chat-line--pending .lobby-chat-bubble {
    pointer-events: none;
}

.lobby-chat-line:not(.lobby-chat-line--own) {
    align-self: flex-start;
}

.lobby-chat-avatar {
    flex-shrink: 0;
    text-decoration: none;
}

.lobby-chat-avatar__img {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

.lobby-chat-bubble-wrap {
    position: relative;
    width: fit-content;
    max-width: 100%;
}

.lobby-chat-bubble {
    width: fit-content;
    max-width: 100%;
    border-radius: 18px;
    padding: 8px 12px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
}

.lobby-chat-bubble--media {
    padding: 4px;
}

.lobby-chat-bubble--media-only {
    padding-bottom: 6px;
}

.lobby-chat-bubble--media .lobby-chat-text {
    padding: 0 4px;
}

.lobby-chat-bubble--media .lobby-chat-bubble-foot {
    margin-top: 2px;
    padding: 0 4px;
}

.lobby-chat-bubble--media .lobby-chat-bubble-head {
    padding: 0 4px;
}

.lobby-chat-line--own .lobby-chat-bubble {
    background: var(--accent);
    color: #fff;
    border: none;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 6px;
}

.lobby-chat-bubble-head {
    margin-bottom: 2px;
}

.lobby-chat-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
}

.lobby-chat-author:hover {
    text-decoration: underline;
}

.lobby-chat-text {
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.lobby-chat-line--own .lobby-chat-text {
    color: #fff;
}

.lobby-chat-bubble-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}

.lobby-chat-time {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.85;
}

.lobby-chat-line--own .lobby-chat-time {
    color: rgba(255, 255, 255, 0.85);
}

.lobby-chat-reply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.lobby-chat-line--own .lobby-chat-reply {
    color: rgba(255, 255, 255, 0.75);
}

.lobby-chat-line:hover .lobby-chat-reply,
.lobby-chat-line:focus-within .lobby-chat-reply,
.lobby-chat-reply:focus-visible {
    opacity: 1;
}

.lobby-chat-reply:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

.lobby-chat-line--own .lobby-chat-reply:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.lobby-chat-line--own .chat-mod-delete {
    color: rgba(255, 255, 255, 0.7);
}

.lobby-chat-line--own .chat-mod-delete:hover,
.lobby-chat-line--own .chat-mod-delete:focus-visible {
    color: #fecaca;
    background: rgba(255, 255, 255, 0.14);
}

.lobby-chat-vip-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(145deg, #fde68a, #f59e0b);
    color: #78350f;
    font-size: 9px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.lobby-chat-user--0 { color: #3b82f6; }
.lobby-chat-user--1 { color: #6366f1; }
.lobby-chat-user--2 { color: #0ea5e9; }
.lobby-chat-user--3 { color: #8b5cf6; }
.lobby-chat-user--4 { color: #14b8a6; }
.lobby-chat-user--5 { color: #64748b; }

.lobby-chat-line .chat-attachment {
    display: block;
    margin-top: 0;
}

.lobby-chat-bubble--media:not(.lobby-chat-bubble--media-only) .chat-attachment {
    margin-top: 4px;
}

.chat-attachment {
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    line-height: 0;
}

.chat-attachment-img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(240px, calc(100vw - 96px));
    max-height: 200px;
    border-radius: 12px;
    object-fit: contain;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    pointer-events: none;
}

.lobby-chat-line--own .chat-attachment-img {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
}

.nex-message-body img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(260px, calc(100vw - 96px));
    max-height: 200px;
    margin-top: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    object-fit: contain;
}

.unlias-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.unlias-image-lightbox.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.unlias-image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 26, 0.82);
    cursor: zoom-out;
}

.unlias-image-lightbox-dialog {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: min(96vw, 1200px);
    max-height: 92vh;
}

.unlias-image-lightbox-img {
    display: block;
    max-width: min(96vw, 1200px);
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.unlias-image-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

body.unlias-image-lightbox-open {
    overflow: hidden;
}

.btn-chat-attach,
.play-chat-attach {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.btn-chat-attach:hover,
.play-chat-attach:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.btn-chat-attach.has-file,
.play-chat-attach.has-file {
    color: #fff;
    background: var(--accent);
}

.lobby-chat-form {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.lobby-chat-form.is-dragover,
.lobby-col--chat.is-dragover,
.board-center-frame__chat.is-dragover,
.play-center-chat.is-dragover {
    outline: 2px dashed var(--accent);
    outline-offset: 3px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.lobby-chat-composer {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    padding: 4px 5px 4px 4px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.lobby-chat-composer:focus-within {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.lobby-chat-input-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 6px;
}

.lobby-chat-input {
    width: 100%;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: var(--text);
}

.lobby-chat-input:focus,
.lobby-chat-input:focus-visible {
    outline: none;
    box-shadow: none;
}

.lobby-chat-input::placeholder {
    color: var(--muted);
}

.lobby-chat-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.lobby-chat-tool {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.lobby-chat-tool:focus,
.lobby-chat-tool:focus-visible {
    outline: none;
    box-shadow: none;
}

.lobby-chat-tool:hover:not(:disabled) {
    color: var(--text);
    background: color-mix(in srgb, var(--text) 8%, transparent);
}

.lobby-chat-tool:disabled,
.lobby-chat-tool.is-disabled {
    opacity: 0.42;
    cursor: default;
    pointer-events: none;
}

.lobby-chat-attach.has-file {
    color: #fff;
    background: var(--accent);
}

.lobby-chat-send {
    color: var(--muted);
}

.lobby-chat-send:hover:not(:disabled) {
    color: var(--text);
}

.lobby-col--social {
    padding: 0;
    gap: 8px;
    overflow-y: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.lobby-social-quick {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.lobby-side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}

.lobby-side-card--compact .lobby-side-hint {
    font-size: 11px;
    line-height: 1.4;
}

.lobby-side-card--friends {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.lobby-side-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.lobby-side-card-head--friends {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 10px;
}

.lobby-side-card-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.lobby-side-link,
.lobby-side-tag {
    font-size: 12px;
    text-decoration: none;
    color: var(--muted);
    flex-shrink: 0;
}

.lobby-side-tag {
    font-weight: 600;
}

.lobby-side-link--accent {
    color: #7c3aed;
    font-weight: 600;
}

.lobby-side-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
}

.lobby-friends-badge {
    font-size: 11px;
    color: #16a34a;
    font-weight: 600;
}

.lobby-friends-search {
    display: block;
    margin-bottom: 8px;
}

.lobby-friends-search input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    margin: 0;
    background: var(--surface-soft);
}

.lobby-friends-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.lobby-friend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

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

.lobby-friend-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.lobby-friend-main:hover .lobby-friend-name {
    color: var(--accent);
}

.lobby-friend-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-soft) center/cover no-repeat;
    font-weight: 700;
    font-size: 14px;
    color: var(--muted);
    position: relative;
}

.lobby-friend-dot {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

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

.lobby-friend-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lobby-friend-status { font-size: 11px; color: var(--accent); }

.lobby-friend-invite {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--accent);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
}

.lobby-friend-invite:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-soft, rgba(99, 102, 241, 0.12));
}

.lobby-friend-invite.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

.lobby-friend-more {
    color: var(--muted);
    text-decoration: none;
    padding: 4px 8px;
}

.lobby-create-dialog {
    border: none;
    border-radius: 14px;
    padding: 0;
    width: min(720px, 96vw);
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.lobby-create-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
}

.lobby-create-form {
    margin: 0;
    width: 100%;
}

.lobby-create-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 380px;
}

.lobby-create-modes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 10px;
    background: var(--surface-soft);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.lobby-create-mode {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    font: inherit;
}

.lobby-create-mode--active {
    background: var(--accent);
    color: #fff;
}

.lobby-create-mode--active .lobby-create-mode-desc {
    color: rgba(255, 255, 255, 0.85);
}

.lobby-create-mode--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.lobby-create-mode-title {
    font-weight: 700;
    font-size: 13px;
}

.lobby-create-mode-desc {
    font-size: 11px;
    color: var(--muted);
}

.lobby-create-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 20px 20px;
    background: var(--surface);
}

.lobby-create-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lobby-create-panel-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.lobby-create-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lobby-create-close:hover {
    background: color-mix(in srgb, var(--muted) 12%, var(--surface-soft));
    color: var(--text);
}

.lobby-create-section h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lobby-create-players {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lobby-create-player-opt {
    min-width: 44px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.lobby-create-player-opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lobby-create-player-opt:has(input:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.lobby-create-player-opt--soon {
    opacity: 0.35;
    cursor: not-allowed;
    font-size: 12px;
}

.lobby-create-player-opt--wide {
    min-width: auto;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
}

.lobby-create-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.lobby-create-toggle:last-child {
    border-bottom: none;
}

.lobby-create-toggle--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lobby-create-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lobby-create-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lobby-create-toggle-label {
    font-weight: 600;
    font-size: 14px;
}

.lobby-create-toggle-hint {
    font-size: 12px;
    color: var(--muted);
}

.lobby-create-switch {
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 35%, var(--surface-soft));
    position: relative;
    transition: background 0.2s;
}

.lobby-create-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.lobby-create-toggle input:checked + .lobby-create-switch {
    background: var(--accent);
}

.lobby-create-toggle input:checked + .lobby-create-switch::after {
    transform: translateX(20px);
}

.lobby-create-submit {
    margin-top: auto;
    width: 100%;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.lobby-create-submit:hover {
    filter: brightness(1.05);
}

@media (max-width: 560px) {
    .lobby-create-layout {
        grid-template-columns: 1fr;
    }

    .lobby-create-modes {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .lobby-create-mode {
        min-width: 140px;
    }
}

.lobby-inline-notice {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    color: color-mix(in srgb, var(--danger) 82%, var(--text));
    border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border));
}

.lobby-inline-notice--error { }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 1100px) {
    .lobby-hub {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(120px, auto) 1fr minmax(160px, auto);
        padding: 10px;
        gap: 8px;
    }

    .lobby-col--social { order: 1; }
    .lobby-col--chat {
        order: 2;
        min-height: 360px;
    }
    .lobby-col--rooms { order: 3; }
}

/* Лобби: телефоны — прокрутка страницы, мин. высота чата; десктоп (>640px) без изменений */
@media (max-width: 640px) {
    body.game-body--lobby.game-body--shell {
        height: auto;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.game-body--lobby.game-body--shell .game-app-shell {
        min-height: 100dvh;
        height: auto;
    }

    body.game-body--lobby.game-body--shell .game-main-area {
        min-height: auto;
        overflow: visible;
    }

    body.game-body--lobby.game-body--shell .game-main-area .game-main {
        overflow: visible;
        flex: none;
        height: auto;
        min-height: auto;
    }

    .lobby-page {
        flex: none;
        height: auto;
        min-height: auto;
    }

    .lobby-hub {
        grid-template-rows: auto;
        grid-auto-rows: auto;
        flex: none;
        height: auto;
        min-height: auto;
        padding: 10px;
        gap: 8px;
    }

    .lobby-inline-notice {
        margin-left: 10px;
        margin-right: 10px;
    }

    .lobby-col--social {
        order: 1;
        padding: 0;
        gap: 8px;
        overflow: visible;
        flex-shrink: 0;
    }

    .lobby-social-quick {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .lobby-side-card--compact {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .lobby-side-card--compact .lobby-side-card-head {
        margin-bottom: 4px;
    }

    .lobby-side-card--compact .lobby-side-card-head h3 {
        font-size: 12px;
    }

    .lobby-side-card--compact .lobby-side-hint {
        font-size: 10px;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .lobby-side-card--friends {
        padding: 12px 12px 14px;
        border-radius: 10px;
        flex: none;
        min-height: 0;
    }

    .lobby-side-card-head--friends {
        margin-bottom: 8px;
        column-gap: 8px;
    }

    .lobby-side-card-head--friends h3 {
        font-size: 13px;
    }

    .lobby-side-link--accent,
    .lobby-friends-badge {
        font-size: 11px;
    }

    .lobby-friends-search {
        margin-bottom: 10px;
    }

    .lobby-friends-search input {
        padding: 8px 10px;
        font-size: 16px;
        border-radius: 8px;
    }

    .lobby-friends-list {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
        margin: 0 -2px;
        padding: 2px 2px 6px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .lobby-friends-list > .muted {
        font-size: 12px;
        line-height: 1.4;
        padding: 8px 4px 10px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .lobby-friend {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        width: auto;
        min-width: 76px;
        max-width: 92px;
        padding: 4px 4px 2px;
        border-bottom: none;
        scroll-snap-align: start;
    }

    .lobby-friend-main {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 100%;
        flex: none;
    }

    .lobby-friend-avatar {
        width: 48px;
        height: 48px;
        font-size: 14px;
    }

    .lobby-friend-dot {
        width: 10px;
        height: 10px;
        right: 1px;
        bottom: 1px;
        border-color: var(--surface);
    }

    .lobby-friend-meta {
        width: 100%;
        text-align: center;
    }

    .lobby-friend-name {
        font-size: 11px;
        font-weight: 600;
        line-height: 1.25;
        max-width: 84px;
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        word-break: break-word;
        text-overflow: unset;
    }

    .lobby-friend-status {
        display: none;
    }

    .lobby-friend-more {
        display: none;
    }

    .lobby-friend-invite {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 0.8rem;
        flex-shrink: 0;
        margin: 0;
    }

    .lobby-friend-invite[hidden] {
        display: none;
    }

    .lobby-friend:has(.lobby-friend-invite:not([hidden])) {
        padding-bottom: 4px;
    }

    .lobby-col {
        overflow: visible;
        min-height: auto;
    }

    .game-body--lobby .game-topbar-chat-btn {
        display: inline-grid;
    }

    .lobby-hub .lobby-col--chat {
        display: none;
    }

    body.lobby-chat-modal-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 44;
        pointer-events: none;
    }

    body.lobby-chat-modal-open .lobby-hub .lobby-col--chat {
        display: flex;
        position: fixed;
        top: var(--game-topbar-height, 56px);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        min-height: 0;
        max-height: none;
        order: unset;
    }

    body.lobby-chat-modal-open .lobby-chat-feed {
        flex: 1;
        min-height: 0;
        max-height: none;
    }

    body.lobby-chat-modal-open .lobby-chat-close {
        display: inline-grid;
    }

    body.lobby-chat-modal-open {
        overflow: hidden;
    }

    .game-topbar-user-name {
        display: none;
    }

    .lobby-col--rooms {
        order: 3;
        flex-shrink: 0;
    }

    .lobby-rooms-waiting {
        flex: none;
        min-height: auto;
    }

    .lobby-rooms-list {
        flex: none;
        overflow-y: visible;
        max-height: none;
    }

    .lobby-chat-head {
        padding: 8px 12px;
        flex-shrink: 0;
    }

    .lobby-chat-head h2 {
        font-size: 0.95rem;
    }

    .lobby-chat-head p {
        font-size: 0.8rem;
    }

    .lobby-chat-feed {
        flex: 1 1 auto;
        min-height: 315px;
        max-height: min(525px, 66.5vh);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .lobby-chat-form {
        padding: 8px;
        flex-shrink: 0;
    }

    .lobby-chat-input {
        font-size: 16px;
    }

    .lobby-rooms-head {
        padding: 8px 10px;
    }

    .lobby-room {
        padding: 12px 10px 14px;
    }

    .lobby-room-slots {
        gap: 8px 12px;
    }

    .lobby-room-teams {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .lobby-room-vs {
        order: -1;
        padding: 4px 0;
    }

    .lobby-room-team-slots {
        gap: 10px;
    }

    .lobby-slot {
        width: 68px;
    }

    .lobby-slot--filled .lobby-slot-avatar,
    a.lobby-slot-avatar {
        width: 46px;
        height: 46px;
    }

    .lobby-slot-plus {
        width: 46px;
        height: 46px;
        font-size: 1.65rem;
    }

    body.game-body--play .game-main {
        padding: 15px;
    }

    .game-page-head,
    .game-profile-hero,
    .game-card,
    .game-friends-layout,
    .game-catalog-page {
        max-width: 100%;
    }
}

.table-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    min-height: calc(100vh - 100px);
}

.table-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.player-card {
    background: var(--surface-soft);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-card.is-active {
    outline: 2px solid var(--accent);
}

.tag {
    display: inline-block;
    font-size: 12px;
    color: var(--accent);
}

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: uppercase;
    background: var(--surface-soft);
}

.status-pill--waiting { color: #fbbf24; }
.status-pill--playing { color: var(--accent); }

.table-board-area {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 16px;
}

.monopoly-board {
    display: grid;
    --board-strip: 1fr;
    --board-side: 2.28fr;
    grid-template-columns: var(--board-side) repeat(9, var(--board-strip)) var(--board-side);
    grid-template-rows: var(--board-side) repeat(9, var(--board-strip)) var(--board-side);
    gap: 2px;
    background: var(--surface);
    /* border: 1px solid var(--border); */
    border-radius: 16px;
    padding: 4px;
    min-height: 520px;
    aspect-ratio: 1;
    max-height: min(72vh, 720px);
}

.board-center {
    grid-column: 2 / 11;
    grid-row: 2 / 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    /* border-radius: 12px; */
    text-align: center;
    gap: 4px;
}

.board-center-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

.board-cell {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px;
    font-size: 9px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    position: relative;
}

.board-cell--go { background: #1e3a2f; }
.board-cell--jail,
.board-cell--jackpot { background: #3d2f1e; }
.board-cell--goto_jail { background: #2a3140; }
.board-cell--chance { background: #3d2f4a; }
.board-cell--tax { background: #4a2c2c; }

.board-cell--group-brown { border-bottom: 3px solid #8b6914; }
.board-cell--group-light_blue { border-bottom: 3px solid #6ecff6; }
.board-cell--group-pink { border-bottom: 3px solid #f472b6; }
.board-cell--group-orange { border-bottom: 3px solid #fb923c; }
.board-cell--group-red { border-bottom: 3px solid #ef4444; }
.board-cell--group-yellow { border-bottom: 3px solid #facc15; }
.board-cell--group-green { border-bottom: 3px solid #22c55e; }
.board-cell--group-blue { border-bottom: 3px solid #3b82f6; }

.board-cell-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-cell-price {
    color: var(--muted);
    font-size: 8px;
}

.game-body--play .board-cell,
.game-body--play .board-cell[class*='board-cell--group-'] {
    border: none;
    border-bottom: none;
}

.game-body--play .board-cell.is-owned-p0,
.game-body--play .board-cell.is-owned-p1,
.game-body--play .board-cell.is-owned-p2,
.game-body--play .board-cell.is-owned-p3 {
    box-shadow: none;
}

.board-token--0 { background: #2dd4bf; }
.board-token--1 { background: #f472b6; }
.board-token--2 { background: #a78bfa; }
.board-token--3 { background: #fb923c; }


.lobby-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.game-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.game-modal[hidden],
.game-modal[hidden].is-opening,
.game-modal[hidden].is-closing {
    display: none !important;
}

.game-modal.is-opening:not([hidden]),
.game-modal.is-closing:not([hidden]) {
    display: flex;
}

body.game-modal-open {
    overflow: hidden;
}

.game-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.game-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

@keyframes game-overlay-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes game-overlay-backdrop-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes game-overlay-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes game-overlay-panel-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
}

@keyframes game-popover-drop-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes game-popover-drop-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
}

@keyframes game-dialog-panel-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes game-dialog-panel-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
}

.game-modal.is-opening .game-modal-backdrop {
    animation: game-overlay-backdrop-in 0.22s ease-out both;
}

.game-modal.is-closing .game-modal-backdrop {
    animation: game-overlay-backdrop-out 0.2s ease-in both;
}

.game-modal.is-opening .game-modal-dialog {
    animation: game-overlay-panel-in 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.game-modal.is-closing .game-modal-dialog {
    animation: game-overlay-panel-out 0.2s ease-in both;
}

.game-inventory-item-modal.is-opening .game-modal-backdrop {
    animation: game-overlay-backdrop-in 0.34s ease-out both;
}

.game-inventory-item-modal.is-closing .game-modal-backdrop {
    animation: game-overlay-backdrop-out 0.26s ease-in both;
}

.game-inventory-item-modal.is-opening .game-inventory-item-modal__spotlight {
    animation: game-inventory-spotlight-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.02s both;
}

.game-inventory-item-modal.is-closing .game-inventory-item-modal__spotlight {
    animation: game-inventory-spotlight-out 0.24s ease-in both;
}

.game-inventory-item-modal.is-opening .game-inventory-item-modal__slot {
    animation: game-inventory-panel-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.game-inventory-item-modal.is-closing .game-inventory-item-modal__slot {
    animation: game-inventory-panel-out 0.24s ease-in both;
}

.game-inventory-item-modal.is-opening .game-inventory-item-modal__slot .game-item-sheet {
    animation: none;
}

.game-inventory-item-modal.is-closing .game-inventory-item-modal__slot .game-item-sheet {
    animation: none;
}

.game-inventory-item-modal.is-opening .game-item-sheet__header {
    animation: game-item-sheet-block-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.game-inventory-item-modal.is-opening .game-item-sheet__info {
    animation: game-item-sheet-block-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.game-inventory-item-modal.is-opening .game-field-equip-menu {
    animation: game-item-sheet-block-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.game-inventory-item-modal.is-opening .game-item-sheet__menu:not(.game-field-equip-menu),
.game-inventory-item-modal.is-opening .game-item-sheet__info--tail {
    animation: game-item-sheet-block-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.game-inventory-item-modal.is-closing .game-item-sheet__header,
.game-inventory-item-modal.is-closing .game-item-sheet__info,
.game-inventory-item-modal.is-closing .game-field-equip-menu,
.game-inventory-item-modal.is-closing .game-item-sheet__menu,
.game-inventory-item-modal.is-closing .game-item-sheet__info--tail {
    animation: game-item-sheet-block-out 0.22s ease-in both;
}

.lobby-create-dialog.is-opening {
    animation: game-dialog-panel-in 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lobby-create-dialog.is-closing {
    animation: game-dialog-panel-out 0.2s ease-in both;
}

.lobby-create-dialog.is-opening::backdrop {
    animation: game-overlay-backdrop-in 0.22s ease-out both;
}

.lobby-create-dialog.is-closing::backdrop {
    animation: game-overlay-backdrop-out 0.18s ease-in both;
}

.game-topbar-user-menu.is-opening,
.unlias-notif-panel.is-opening {
    animation: game-popover-drop-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-origin: top right;
}

.game-topbar-user-menu.is-closing,
.unlias-notif-panel.is-closing {
    animation: game-popover-drop-out 0.14s ease-in both;
    transform-origin: top right;
}

@media (prefers-reduced-motion: reduce) {
    .game-modal.is-opening .game-modal-backdrop,
    .game-modal.is-closing .game-modal-backdrop,
    .game-modal.is-opening .game-modal-dialog,
    .game-modal.is-closing .game-modal-dialog,
    .game-inventory-item-modal.is-opening .game-modal-backdrop,
    .game-inventory-item-modal.is-closing .game-modal-backdrop,
    .game-inventory-item-modal.is-opening .game-inventory-item-modal__slot,
    .game-inventory-item-modal.is-closing .game-inventory-item-modal__slot,
    .game-inventory-item-modal.is-opening .game-inventory-item-modal__spotlight,
    .game-inventory-item-modal.is-closing .game-inventory-item-modal__spotlight,
    .game-inventory-item-modal.is-opening .game-inventory-item-modal__slot .game-item-popover,
    .game-inventory-item-modal.is-closing .game-inventory-item-modal__slot .game-item-popover,
    .game-inventory-item-modal.is-opening .game-item-sheet__header,
    .game-inventory-item-modal.is-closing .game-item-sheet__header,
    .game-inventory-item-modal.is-opening .game-item-sheet__info,
    .game-inventory-item-modal.is-closing .game-item-sheet__info,
    .game-inventory-item-modal.is-opening .game-item-sheet__menu,
    .game-inventory-item-modal.is-closing .game-item-sheet__menu,
    .game-inventory-item-modal.is-opening .game-item-sheet__info--tail,
    .game-inventory-item-modal.is-closing .game-item-sheet__info--tail,
    .lobby-create-dialog.is-opening,
    .lobby-create-dialog.is-closing,
    .lobby-create-dialog.is-opening::backdrop,
    .lobby-create-dialog.is-closing::backdrop,
    .game-topbar-user-menu.is-opening,
    .game-topbar-user-menu.is-closing,
    .unlias-notif-panel.is-opening,
    .unlias-notif-panel.is-closing {
        animation: none !important;
    }
}

@keyframes game-item-sheet-block-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes game-item-sheet-block-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
}

@keyframes game-inventory-spotlight-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes game-inventory-spotlight-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.94);
    }
}

@keyframes game-inventory-panel-in {
    from {
        opacity: 0;
        transform: translate3d(14px, 8px, 0) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes game-inventory-panel-out {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        opacity: 0;
        transform: translate3d(10px, 6px, 0) scale(0.97);
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.game-modal-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
}

.game-modal-body {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

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

.game-modal-actions--row {
    flex-direction: row;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.game-modal-actions--row .btn {
    width: auto;
    min-width: 108px;
}

/* ——— Market sell modal ——— */
.game-market-sell-modal .game-modal-backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
}

.game-market-sell-dialog {
    width: min(440px, 100%);
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.22),
        0 0 0 1px color-mix(in srgb, var(--surface) 80%, transparent);
}

.game-market-sell-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 16px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%,
        var(--surface) 100%
    );
    border-bottom: 1px solid var(--border);
}

.game-market-sell-kicker {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.game-market-sell-title {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.game-market-sell-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.game-market-sell-close:hover {
    background: var(--surface);
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.game-market-sell-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 20px 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    background: var(--surface-soft);
}

.game-market-sell-preview__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--accent);
    font-size: 1.2rem;
}

.game-market-sell-preview__name {
    display: block;
    font-size: 1rem;
    margin-bottom: 6px;
    line-height: 1.3;
}

.game-market-sell-preview__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
}

.game-market-sell-form {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.game-market-sell-price {
    display: grid;
    gap: 8px;
}

.game-market-sell-price__label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
}

.game-market-sell-price__wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-market-sell-price__wrap:focus-within {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.game-market-sell-price__currency {
    display: grid;
    place-items: center;
    padding: 0 14px;
    font-weight: 700;
    color: var(--muted);
    background: color-mix(in srgb, var(--border) 40%, var(--surface-soft));
    border-right: 1px solid var(--border);
}

.game-market-sell-price__input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 12px 14px;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
}

.game-market-sell-price__input::-webkit-outer-spin-button,
.game-market-sell-price__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.game-market-sell-breakdown {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 6%, var(--surface-soft));
    border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
}

.game-market-sell-breakdown__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--muted);
}

.game-market-sell-breakdown__row--total {
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px dashed color-mix(in srgb, var(--border) 80%, transparent);
    color: var(--text);
    font-size: 0.95rem;
}

.game-market-sell-breakdown__row--total strong {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 800;
}

.game-market-sell-hint {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.82rem;
    line-height: 1.45;
}

.game-market-sell-hint i {
    margin-top: 2px;
    color: var(--accent);
    opacity: 0.85;
}

.game-market-sell-actions {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.game-market-sell-submit {
    gap: 8px;
    font-weight: 700;
    padding: 12px 16px;
}

.game-btn-sell {
    gap: 8px;
    font-weight: 600;
}

.game-btn-sell i {
    font-size: 0.9em;
    opacity: 0.9;
}

/* ——— Case open modal & reel ——— */
.game-case-modal {
    z-index: 210;
}

.game-case-modal .game-modal-backdrop {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
}

.game-case-dialog {
    width: min(400px, calc(100% - 24px));
    max-height: min(88vh, 560px);
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

.game-case-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, color-mix(in srgb, #8b5cf6 10%, var(--surface)) 0%, var(--surface) 100%);
    flex-shrink: 0;
}

.game-case-kicker {
    margin: 0 0 2px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b5cf6;
}

.game-case-title {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.game-case-close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
}

.game-case-step {
    padding: 12px 14px 14px;
    overflow-y: auto;
    min-height: 0;
}

.game-case-preview-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.game-case-preview-card {
    width: 88px;
    flex-shrink: 0;
    margin: 0;
}

.game-case-preview-desc {
    margin: 0;
    flex: 1;
    min-width: 0;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.4;
    padding-top: 2px;
}

.game-case-result-kicker {
    margin: 0 0 10px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.game-case-loot-title {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.game-case-loot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 5px;
    max-height: 148px;
    overflow: auto;
    margin-bottom: 10px;
    padding-right: 2px;
}

.game-case-loot-grid .game-item-tile__media {
    padding: 10px 5px 4px;
}

.game-case-loot-grid .game-item-tile__media > i {
    font-size: 1.35rem;
}

.game-case-loot-grid .game-item-tile__footer {
    padding: 3px 4px;
}

.game-case-loot-grid .game-item-tile__name {
    font-size: 0.58rem;
}

.game-case-loot-item {
    min-width: 0;
}

.game-case-loot-item--reel {
    flex: 0 0 88px;
    width: 88px;
    min-width: 88px;
    transform: scale(0.94);
    opacity: 0.88;
    transition: transform 0.35s ease, opacity 0.35s ease, box-shadow 0.35s ease;
}

.game-case-loot-item--reel.is-reel-winner {
    transform: scale(1);
    opacity: 1;
    border-color: #eab308;
    box-shadow:
        0 0 0 2px color-mix(in srgb, #eab308 70%, transparent),
        0 8px 20px rgba(15, 23, 42, 0.14);
    z-index: 1;
}

.game-case-preview-card .game-item-tile__media {
    padding: 12px 6px 6px;
}

.game-case-preview-card .game-item-tile__media > i {
    font-size: 1.6rem;
}

.game-case-preview-card .game-item-tile__footer {
    padding: 3px 4px;
}

.game-case-preview-card .game-item-tile__name {
    font-size: 0.58rem;
}

.game-case-result-card {
    max-width: 120px;
    margin: 0 auto 10px;
}

.game-case-result-card .game-item-tile__stage {
    min-height: 0;
}

.game-case-key-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.game-case-key-panel--ready {
    border-color: rgba(45, 212, 191, 0.35);
    background: rgba(45, 212, 191, 0.08);
}

.game-case-key-panel--missing {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.1);
}

.game-case-key-panel__icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    flex-shrink: 0;
    font-size: 0.85rem;
}

.game-case-key-panel--ready .game-case-key-panel__icon {
    color: #2dd4bf;
}

.game-case-key-panel--missing .game-case-key-panel__icon {
    color: #f87171;
}

.game-case-key-panel__body {
    flex: 1;
    min-width: 0;
}

.game-case-key-panel__title {
    display: block;
    font-size: 0.82rem;
    margin-bottom: 1px;
}

.game-case-key-panel__hint {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.3;
}

.game-case-key-panel__count {
    flex-shrink: 0;
    min-width: 2rem;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    line-height: 1;
}

.game-case-open-btn {
    gap: 6px;
    font-weight: 700;
    padding: 10px 14px;
    font-size: 0.92rem;
}

.game-case-open-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    filter: grayscale(0.35);
    box-shadow: none;
}

.game-case-reel-viewport {
    position: relative;
    overflow: hidden;
    height: 128px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg, var(--surface-soft) 0%, var(--surface) 50%, var(--surface-soft) 100%);
    margin-bottom: 10px;
}

.game-case-reel-viewport::before,
.game-case-reel-viewport::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 56px;
    z-index: 2;
    pointer-events: none;
}

.game-case-reel-viewport::before {
    left: 0;
    background: linear-gradient(90deg, var(--surface) 0%, transparent 100%);
}

.game-case-reel-viewport::after {
    right: 0;
    background: linear-gradient(270deg, var(--surface) 0%, transparent 100%);
}

.game-case-reel-pointer {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
    z-index: 3;
    pointer-events: none;
}

.game-case-reel-pointer::before,
.game-case-reel-pointer::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.game-case-reel-pointer::before {
    top: -2px;
    border-bottom: 10px solid var(--accent);
}

.game-case-reel-pointer::after {
    bottom: -2px;
    border-top: 10px solid var(--accent);
}

.game-case-reel-track {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 8px 0;
    will-change: transform;
}

.game-case-spin-label {
    margin: 0;
    text-align: center;
    font-size: 0.82rem;
}

.game-case-result-card.game-item-tile {
    animation: case-result-in 0.45s ease-out;
    margin-bottom: 10px;
}

@keyframes case-result-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-case-error {
    margin: 0 14px 14px;
    font-size: 0.82rem;
}

.game-btn-open-case {
    gap: 8px;
    font-weight: 600;
}

.dice-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.dice-overlay[hidden] {
    display: none;
}

.dice-pair {
    display: flex;
    gap: 16px;
}

.dice {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    background: #fff;
    color: #111;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: dice-roll 0.55s ease-out;
}

@keyframes dice-roll {
    0% { transform: rotate(0deg) scale(0.6); opacity: 0; }
    40% { transform: rotate(180deg) scale(1.1); opacity: 1; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.board-token {
    transition: transform 0.35s ease-out;
}

.board-tokens {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    min-height: 10px;
}

.board-token {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    font-size: 0;
}

.board-token--0 { background: #2dd4bf; }
.board-token--1 { background: #f472b6; }

.action-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dice-label {
    font-size: 14px;
    min-height: 1.2em;
}

.timer-line {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.timer-line--urgent {
    color: var(--danger);
    font-weight: 600;
}

.bid-input {
    width: 100%;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 12px;
    margin-bottom: 4px;
}

.manage-panel {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.manage-title {
    margin: 0 0 8px;
    font-size: 14px;
}

.prop-row {
    background: var(--surface-soft);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
    font-size: 12px;
}

.prop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.board-cell.is-mortgaged {
    opacity: 0.55;
}

.house-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #facc15;
    color: #000;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
}

.trade-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.trade-form.hidden {
    display: none;
}

.jackpot-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.btn-jackpot-pick {
    flex: 1;
    min-width: 36px;
    font-weight: 700;
}

.playing-panel .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.event-feed {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    max-height: 140px;
    overflow-y: auto;
    font-size: 12px;
    margin-bottom: 10px;
}

.event-feed:empty {
    display: none;
}

.event-feed-line {
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

.event-feed-line:last-child {
    border-bottom: none;
}

.event-feed-line strong {
    color: var(--text);
}

.chance-flash {
    animation: chance-pop 0.4s ease-out;
}

@keyframes chance-pop {
    0% { transform: scale(0.92); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.table-log {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-stream {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.log-line--system { color: var(--muted); }
.log-author { color: var(--accent); margin-right: 6px; }

.log-form {
    display: flex;
    gap: 8px;
}

.log-form input {
    flex: 1;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 12px;
}

.spectator-note {
    color: var(--muted);
    font-size: 13px;
}

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

/* ——— Account: profile, friends, inventory ——— */
.game-page-head h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.game-page-head .muted {
    margin: 0 0 20px;
}

.game-flash {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.game-toast-stack {
    position: fixed;
    top: var(--game-toast-top, calc(var(--game-topbar-height, 56px) + 12px));
    right: 16px;
    z-index: 34;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.game-toast {
    pointer-events: auto;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    animation: gameToastIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-toast--error {
    border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}

.game-toast.is-leaving {
    animation: gameToastOut 0.18s ease forwards;
}

html.dark .game-toast {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}

@keyframes gameToastIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gameToastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
}

@media (max-width: 900px) {
    .game-toast-stack {
        right: 12px;
        max-width: min(320px, calc(100vw - 24px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-toast {
        animation: none;
    }

    .game-toast.is-leaving {
        animation: none;
        opacity: 0;
    }
}

.game-flash--ok {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.game-flash--error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

.game-card-title {
    margin: 0 0 12px;
    font-size: 1rem;
}

.game-search input,
.game-search-input,
.game-input {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
    margin-bottom: 16px;
}

.game-search--toolbar {
    position: relative;
    max-width: none;
    margin-bottom: 12px;
}

.game-search--toolbar .game-search-input,
.game-search--toolbar input {
    width: 100%;
    max-width: none;
    margin-bottom: 0;
    padding-left: 38px;
}

.game-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    font-size: 14px;
    line-height: 1;
}

.game-inventory-toolbar {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.game-inventory-toolbar__top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.game-inventory-toolbar__top .game-search--toolbar {
    flex: 1;
    min-width: min(100%, 220px);
    margin-bottom: 0;
}

.game-toolbar-wallet {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.game-toolbar-wallet__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.game-toolbar-wallet__value {
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text);
}

/* ——— Catalog pages: inventory & market ——— */
.game-catalog-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.game-catalog-hero {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent) 14%, var(--surface)) 0%,
        var(--surface) 48%,
        color-mix(in srgb, var(--surface-soft) 90%, var(--surface)) 100%
    );
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
}

.game-catalog-hero--market {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, #f59e0b 16%, var(--surface)) 0%,
        var(--surface) 52%,
        color-mix(in srgb, var(--accent) 8%, var(--surface)) 100%
    );
}

.game-catalog-hero__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 18%, var(--surface-soft));
    color: var(--accent);
    font-size: 1.35rem;
}

.game-catalog-hero--market .game-catalog-hero__icon {
    background: color-mix(in srgb, #f59e0b 22%, var(--surface-soft));
    color: #d97706;
}

.game-catalog-hero__text h1 {
    margin: 0 0 8px;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.game-catalog-hero__text .muted {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    max-width: 56ch;
}

.game-catalog-hero a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.game-catalog-hero a:hover {
    text-decoration: underline;
}

.game-catalog-toolbar {
    margin-bottom: 0;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.game-catalog-stats,
.game-friends-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

.game-catalog-stats .game-stat-card {
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-catalog-stats .game-stat-card:hover {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.game-catalog-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-catalog-page .game-card {
    margin-bottom: 0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    overflow: visible;
}

.game-catalog-section .game-inventory-grid {
    margin-top: 4px;
    overflow: visible;
}

.game-catalog-page .game-market-card,
.game-catalog-page .game-shop-card {
    background: var(--surface-soft);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.game-catalog-page .game-market-card:hover,
.game-catalog-page .game-shop-card:hover {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.game-catalog-page .game-market-help {
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.game-catalog-page .game-market-my-lots {
    border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.game-catalog-empty {
    margin: 0;
    padding: 8px 0;
    text-align: center;
}

.game-catalog-page .game-equipped-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.game-catalog-page .game-equipped-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.game-catalog-page .game-inventory-empty {
    margin: 0;
    padding: 20px 8px;
    text-align: center;
}

@media (max-width: 700px) {
    .game-catalog-hero {
        flex-direction: column;
        padding: 18px 16px;
    }

    .game-catalog-stats,
    .game-friends-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-catalog-page .game-inventory-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .game-catalog-page .game-inventory-filter {
        min-width: 0;
    }

    .game-inventory-toolbar__top {
        flex-direction: column;
        align-items: stretch;
    }

    .game-toolbar-wallet {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.game-inventory-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.game-inventory-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    flex: 1 1 180px;
}

.game-inventory-filter-label {
    font-size: 12px;
    color: var(--muted);
}

.game-inventory-filter-select {
    margin: 0;
    max-width: none;
    width: 100%;
}

.game-inventory-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-bottom: 2px;
}

.game-inventory-empty {
    margin: 0 0 20px;
}

.game-add-friend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.game-add-friend .game-input {
    margin: 0;
    flex: 1;
    min-width: 140px;
}

.game-friend-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.game-friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.game-friend-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.game-friend-row-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.game-friend-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-soft) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.game-friend-avatar-sm--md {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

/* ——— Friends page ——— */
.game-friends-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.game-catalog-hero--friends {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, #5cb892 16%, var(--surface)) 0%,
        var(--surface) 50%,
        color-mix(in srgb, var(--surface-soft) 88%, var(--surface)) 100%
    );
}

.game-catalog-hero--friends .game-catalog-hero__icon {
    background: color-mix(in srgb, #5cb892 22%, var(--surface-soft));
    color: #3d9a72;
}

html.dark .game-catalog-hero--friends {
    background: linear-gradient(135deg, #141414 0%, var(--surface) 52%, #0f0f0f 100%);
}

html.dark .game-catalog-hero--friends .game-catalog-hero__icon {
    background: #242424;
    color: #d6d6d6;
}

.game-friends-stats .game-stat-card {
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-friends-stats .game-stat-card:hover {
    border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.game-friends-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.game-friends-layout--solo {
    grid-template-columns: 1fr;
}

.game-friends-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-friends-card .game-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.98rem;
}

.game-friends-card .game-card-title i {
    color: var(--muted);
    font-size: 0.9rem;
}

.game-friends-card-hint {
    margin: -4px 0 14px;
    font-size: 0.86rem;
    line-height: 1.45;
}

.game-friends-card--referral {
    border-color: color-mix(in srgb, #5cb892 28%, var(--border));
    background: linear-gradient(
        160deg,
        color-mix(in srgb, #5cb892 10%, var(--surface)) 0%,
        var(--surface) 72%
    );
}

.game-friends-card--referral .game-card-title i {
    color: #3d9a72;
}

.game-referral-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.game-referral-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.game-referral-stat-value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.game-referral-stat-label {
    font-size: 0.75rem;
    color: var(--muted);
}

.game-referral-link-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.game-referral-url {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
}

.game-referral-copy {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding-inline: 12px;
}

.game-referral-copy--done {
    background: color-mix(in srgb, #5cb892 78%, var(--accent));
    border-color: color-mix(in srgb, #5cb892 78%, var(--accent));
}

@media (max-width: 420px) {
    .game-referral-link-row {
        flex-direction: column;
    }

    .game-referral-copy {
        justify-content: center;
        width: 100%;
    }
}

.game-add-friend--stack {
    flex-direction: column;
    align-items: stretch;
}

.game-friends-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.game-friends-field-label {
    font-size: 12px;
    color: var(--muted);
}

.game-friends-field .game-input {
    max-width: none;
    width: 100%;
}

.game-friends-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.game-friends-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, #5cb892 18%, var(--surface-soft));
    color: #2d7a5a;
}

.game-friends-badge--muted {
    background: var(--surface-soft);
    color: var(--muted);
}

html.dark .game-friends-badge {
    background: #2a2a2a;
    color: #d6d6d6;
}

.game-friends-pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-friends-pending {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.game-friends-pending-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.game-friends-pending-main:hover .game-friends-pending-name {
    color: var(--accent);
}

.game-friends-pending-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.game-friends-pending-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-friends-pending-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.game-friends-cancel-btn {
    min-width: 36px;
    padding: 0 10px;
    font-size: 1.15rem;
    line-height: 1;
}

.game-friends-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.game-friends-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.game-friends-toolbar .game-search--toolbar {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.game-friends-contacts-card {
    padding: 0;
    overflow: hidden;
}

.game-friends-contacts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-soft) 50%, var(--surface));
}

.game-friends-contacts-head .game-card-title {
    margin: 0;
}

.game-friends-count {
    font-size: 0.88rem;
    font-weight: 600;
}

.game-friends-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
}

.game-friends-contact:last-child {
    border-bottom: none;
}

.game-friends-contact:hover {
    background: color-mix(in srgb, var(--surface-soft) 65%, var(--surface));
}

.game-friends-contact-link {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.game-friends-contact-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.game-friends-contact-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    font-weight: 800;
    background: var(--surface-soft) center/cover no-repeat;
    border: 2px solid color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.game-friends-online-dot {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.game-friends-contact--online .game-friends-contact-avatar {
    border-color: color-mix(in srgb, #22c55e 45%, var(--border));
}

.game-friends-status--online {
    color: #22c55e;
    font-weight: 600;
}

.game-friends-status--ingame {
    color: var(--accent);
    font-weight: 600;
}

html.dark .game-friends-status--online {
    color: #4ade80;
}

html.dark .game-friends-status--ingame {
    color: #d6d6d6;
}

.game-friends-contact-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.game-friends-contact-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-friends-contact-handle {
    font-size: 0.84rem;
}

.game-friends-contact-meta {
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.game-friends-contact-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.game-friends-inline-form {
    margin: 0;
}

.game-friends-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    text-decoration: none;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.game-friends-icon-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    color: var(--text);
    background: var(--surface-soft);
}

.game-friends-icon-btn--danger:hover {
    border-color: color-mix(in srgb, #ef4444 40%, var(--border));
    color: #f87171;
    background: color-mix(in srgb, #ef4444 10%, var(--surface));
}

.btn--compact {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
}

.game-friends-empty {
    padding: 48px 24px 56px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.game-friends-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px dashed color-mix(in srgb, var(--border) 80%, transparent);
    margin-bottom: 8px;
}

.game-friends-empty-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .game-friends-layout {
        grid-template-columns: 1fr;
    }

    .game-friends-aside {
        order: 2;
    }

    .game-friends-main {
        order: 1;
    }
}

@media (max-width: 520px) {
    .game-friends-stats {
        grid-template-columns: 1fr;
    }

    .game-friends-contact {
        flex-wrap: wrap;
    }

    .game-friends-contact-actions {
        width: 100%;
        justify-content: flex-end;
        padding-left: 66px;
    }
}

.game-profile-hero {
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.game-profile-cover-wrap {
    position: relative;
}

.game-profile-cover {
    min-height: 190px;
}

.game-profile-cover--img {
    background-size: cover;
    background-position: center;
}

.game-profile-cover--gradient {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 18px 22px;
    background: linear-gradient(118deg, #111827 0%, #273552 44%, #4a5f86 100%);
}

html.dark .game-profile-cover--gradient {
    background: linear-gradient(118deg, #141414 0%, #242424 44%, #3a3a3a 100%);
}

.game-profile-cover--gradient span {
    font-size: 1.35rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.06em;
}

.game-profile-banner-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(240px, calc(100% - 32px));
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
    color: #fff;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.22),
        0 0 0 1px color-mix(in srgb, var(--badge-accent, #8b5cf6) 35%, transparent),
        0 0 18px color-mix(in srgb, var(--badge-accent, #8b5cf6) 45%, transparent);
}

.game-profile-banner-badge-art {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.game-profile-banner-badge-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.game-profile-banner-badge-fallback {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.game-profile-banner-badge-label {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-profile-banner-badge--legendary {
    --badge-accent: #f59e0b;
}

.game-profile-banner-badge--mythic {
    --badge-accent: #a855f7;
}

.game-profile-avatar-wrap {
    position: absolute;
    left: 24px;
    bottom: 0;
    transform: translateY(50%);
    z-index: 2;
}

.game-profile-avatar-ring {
    position: relative;
    display: inline-block;
    padding: 4px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(10, 15, 29, 0.18);
}

.game-profile-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: var(--surface-soft) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text);
}

.game-profile-presence {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #22c55e;
    border: 3px solid var(--surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.game-profile-hero-inner {
    padding: 70px 22px 20px;
}

.game-profile-head {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

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

.game-profile-name-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.game-profile-name {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.game-profile-level-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 16%, var(--surface-soft));
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: help;
}

.game-profile-level-pill[data-level-popover] {
    cursor: help;
}

.game-profile-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    cursor: help;
}

.game-profile-rank-badge__img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.game-profile-rank-badge i {
    color: var(--muted);
    font-size: 1rem;
}

.game-profile-conduct-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--conduct-color, #22c55e) 14%, var(--surface-soft));
    border: 1px solid color-mix(in srgb, var(--conduct-color, #22c55e) 38%, var(--border));
    color: var(--conduct-color, #22c55e);
    font-size: 0.82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    cursor: help;
}

.game-profile-conduct-pill[data-tip] {
    cursor: help;
}

.game-profile-level {
    margin: 16px 0 20px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.game-profile-level-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.game-profile-level-title {
    font-weight: 800;
    font-size: 1rem;
}

.game-profile-level-bar {
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 80%, var(--surface));
    overflow: hidden;
}

.game-profile-level-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent-light));
    transition: width 0.25s ease;
}

.game-profile-level-meta {
    margin: 8px 0 0;
    font-size: 0.85rem;
}

.game-profile-conduct {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.game-profile-conduct-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.game-profile-conduct-title {
    margin: 0 0 4px;
    font-size: 1rem;
}

.game-profile-conduct-note {
    margin: 0;
    font-size: 0.82rem;
}

.game-profile-conduct-score {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent-light);
}

.game-profile-conduct-bar {
    margin-top: 12px;
    height: 10px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}

.game-profile-conduct-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #84cc16 55%, #eab308 80%, #ef4444);
    transition: width 0.25s ease;
}

.game-profile-conduct-restrictions {
    margin: 12px 0 0;
    padding-left: 1.1rem;
    color: var(--danger, #ef4444);
    font-size: 0.85rem;
}

.game-profile-conduct-ok {
    margin: 10px 0 0;
    font-size: 0.85rem;
}

.game-profile-vip-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(145deg, #fde68a, #f59e0b);
    color: #78350f;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35), 0 4px 12px rgba(245, 158, 11, 0.25);
    font-size: 14px;
}

/* ——— Сноски (tooltip с «носиком») ——— */
[data-tip] {
    cursor: help;
}

a[data-tip],
button[data-tip] {
    cursor: pointer;
}

.game-tip-bubble {
    position: fixed;
    z-index: 10050;
    max-width: min(280px, calc(100vw - 20px));
    padding: 7px 12px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.97);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.game-tip-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.game-tip-bubble::before {
    content: '';
    position: absolute;
    left: var(--tip-arrow-x, 50%);
    width: 10px;
    height: 10px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    transform: translateX(-50%) rotate(45deg);
}

.game-tip-bubble[data-placement='bottom']::before {
    top: -6px;
    border-bottom: none;
    border-right: none;
}

.game-tip-bubble[data-placement='top']::before {
    bottom: -6px;
    border-top: none;
    border-left: none;
}

html.dark .game-tip-bubble {
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

.game-tip-bubble--level {
    min-width: min(340px, calc(100vw - 24px));
    max-width: 360px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: normal;
    transform: translateY(6px) scale(0.98);
}

.game-tip-bubble--level.is-visible {
    transform: translateY(0) scale(1);
}

.game-tip-bubble--level::before {
    display: none;
}

.game-profile-level--popover {
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    box-shadow:
        0 14px 34px rgba(15, 23, 42, 0.12),
        0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}

html.dark .game-profile-level--popover {
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.42),
        0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.game-profile-level--popover .game-profile-level-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.game-profile-level--popover .game-profile-level-title {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
}

.game-profile-level--popover .game-profile-level-xp {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.game-profile-level--popover .game-profile-level-bar {
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 80%, var(--surface));
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

html.dark .game-profile-level--popover .game-profile-level-bar {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28);
}

.game-profile-level--popover .game-profile-level-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-dim) 0%, var(--accent-light) 100%);
    box-shadow:
        0 0 14px color-mix(in srgb, var(--accent) 42%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-profile-level--popover .game-profile-level-meta {
    margin: 8px 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
}

.game-profile-level--popover .game-profile-level-meta__nums {
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .game-profile-level--popover .game-profile-level-bar-fill {
        transition: none;
    }
}

.game-vip-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: #fbbf24;
    font-weight: 600;
}

.game-vip-hint {
    margin: 0 0 12px;
}

.game-shop-grid--vip {
    margin-top: 4px;
}

.game-shop-card--vip {
    position: relative;
}

.game-card--vip-compact .game-card-title {
    margin-bottom: 12px;
}

.game-vip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.game-vip-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.game-vip-card__info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.game-vip-card__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(145deg, #fde68a, #f59e0b);
    color: #78350f;
    font-size: 14px;
}

.game-vip-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.game-vip-card__name {
    font-size: 0.95rem;
    line-height: 1.2;
}

.game-vip-card__text .game-rarity {
    font-size: 0.78rem;
}

.game-vip-card__buy {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.game-vip-card__price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
}

.game-vip-card__buy form {
    margin: 0;
}

.game-shop-vip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, #fde68a, #f59e0b);
    color: #78350f;
    margin-bottom: 8px;
    font-size: 16px;
}

@media (max-width: 520px) {
    .game-vip-list {
        grid-template-columns: 1fr;
    }

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

    .game-vip-card__buy {
        width: 100%;
        justify-content: space-between;
    }
}

.game-shop-price--fiat {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.game-profile-id-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

a.game-profile-id-pill:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-soft));
}

.game-profile-handle,
.game-profile-joined {
    margin: 6px 0 0;
    font-size: 0.88rem;
}

.game-profile-bio {
    margin: 10px 0 0;
    max-width: 560px;
    line-height: 1.55;
}

.game-profile-quick-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.game-profile-icon-form {
    margin: 0;
}

.game-profile-icon-anchor {
    position: relative;
}

.game-profile-more-menu {
    min-width: 220px;
}

.game-profile-more-menu form {
    margin: 0;
}

.game-profile-more-menu--floating {
    position: fixed;
    z-index: 10060;
}

.game-profile-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-soft) 90%, transparent);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.game-profile-icon-btn:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

.game-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.game-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

a.game-stat-card,
.game-stat-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.game-stat-card:hover,
.game-stat-card--link:hover {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.game-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
}

.game-stat-label {
    color: var(--muted);
    font-size: 13px;
}

.game-stat-card--positive .game-stat-value {
    color: #16a34a;
}

html.dark .game-stat-card--positive .game-stat-value {
    color: #4ade80;
}

.game-pill {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    margin-top: 6px;
}

.game-pill--live {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.game-pill--link {
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.game-pill--link:hover,
.game-pill--link:focus-visible {
    background: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
    transform: translateY(-1px);
}

.game-profile-hint {
    font-size: 13px;
}

.game-profile-inventory {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    padding: 16px;
}

.game-profile-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.game-profile-section-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.game-profile-section-head p {
    margin: 2px 0 0;
    font-size: 13px;
}

.game-profile-inventory-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
}

.game-profile-inventory-strip .game-item-tile,
.game-profile-inventory-strip .game-profile-inventory-tile {
    flex: 0 0 118px;
    width: 118px;
    min-width: 118px;
    scroll-snap-align: start;
}

.game-inventory-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 16px;
}

.game-shop-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.game-shop-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.game-shop-card-img {
    width: 100%;
    height: 96px;
    object-fit: contain;
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    padding: 8px;
}

.game-shop-price {
    font-weight: 800;
    color: var(--accent);
}

.game-inventory-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    align-items: start;
}

.game-catalog-page--inventory .game-inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
}

/* ——— Единая плитка предмета (инвентарь, дроп, оверлей) ——— */
.game-item-tile {
    --item-tile-footer: #64748b;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    border: 1px solid color-mix(in srgb, var(--border) 70%, #cbd5e1);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html.dark .game-item-tile {
    background: color-mix(in srgb, var(--surface) 92%, #fff);
    border-color: color-mix(in srgb, var(--border) 80%, #64748b);
}

.game-item-tile--common { --item-tile-footer: #5da5e3; }
.game-item-tile--rare { --item-tile-footer: #3b82f6; }
.game-item-tile--very_rare { --item-tile-footer: #8b5cf6; }
.game-item-tile--mythic { --item-tile-footer: #d946ef; }
.game-item-tile--legendary { --item-tile-footer: #f59e0b; }

.game-inventory-card--common.game-item-tile,
.game-item-tile.game-inventory-card--common { --item-tile-footer: #5da5e3; }
.game-inventory-card--rare.game-item-tile,
.game-item-tile.game-inventory-card--rare { --item-tile-footer: #3b82f6; }
.game-inventory-card--very_rare.game-item-tile,
.game-item-tile.game-inventory-card--very_rare { --item-tile-footer: #8b5cf6; }
.game-inventory-card--mythic.game-item-tile,
.game-item-tile.game-inventory-card--mythic { --item-tile-footer: #d946ef; }
.game-inventory-card--legendary.game-item-tile,
.game-item-tile.game-inventory-card--legendary { --item-tile-footer: #f59e0b; }

.game-item-tile__stage {
    position: relative;
    aspect-ratio: 1;
    width: 100%;
    padding: 0;
    background: #fff;
}

html.dark .game-item-tile__stage {
    background: color-mix(in srgb, #fff 94%, var(--surface-soft));
}

.game-item-tile__media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 10px 12px;
    overflow: hidden;
}

.game-item-tile__media img,
.game-item-tile__img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.game-item-tile__media > i {
    font-size: 2.2rem;
    color: color-mix(in srgb, var(--item-tile-footer) 70%, #64748b);
}

.game-item-tile__tag {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

.game-item-tile__tag--price {
    top: 5px;
    left: 5px;
    color: #64748b;
}

html.dark .game-item-tile__tag--price {
    color: #475569;
}

.game-item-tile__tag--price i {
    font-size: 0.58rem;
    opacity: 0.9;
}

.game-item-tile__tag--equipped {
    top: 5px;
    right: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    justify-content: center;
    color: #fff;
    background: #22c55e;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    font-size: 0.52rem;
}

.game-item-tile__tag--lots {
    top: 5px;
    right: 5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    justify-content: center;
    color: #fff;
    background: color-mix(in srgb, var(--item-tile-footer) 88%, #334155);
    font-size: 0.58rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

a.game-inventory-card.game-item-tile {
    text-decoration: none;
    color: inherit;
}

.game-catalog-page--market .game-inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
}

.game-market-my-lots-grid {
    align-items: start;
}

.game-market-my-lot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.game-market-my-lot .game-item-tile {
    width: 100%;
}

.game-market-my-lot-pricing {
    margin: 0;
}

.game-market-my-lot-cancel {
    margin: 0;
}

.game-market-item-hero-tile {
    width: min(140px, 100%);
    flex-shrink: 0;
}

.game-item-tile__footer {
    flex-shrink: 0;
    padding: 5px 6px;
    background: var(--item-tile-footer);
    text-align: center;
}

.game-item-tile__name {
    display: block;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-inventory-card.game-item-tile {
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.28s ease;
}

.game-catalog-page .game-inventory-card.is-menu-open {
    opacity: 0;
    transform: scale(0.97);
    pointer-events: none;
}

.game-inventory-card.game-item-tile:hover {
    border-color: color-mix(in srgb, var(--item-tile-footer) 55%, var(--border));
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    transform: translateY(-1px);
}

.game-inventory-card.game-item-tile > .game-inventory-icon,
.game-inventory-card.game-item-tile > .game-inventory-body {
    display: none !important;
}

.game-inventory-section {
    margin-bottom: 24px;
}

.game-inventory-section h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.game-inventory-card {
    position: relative;
    min-width: 0;
    height: auto;
    box-sizing: border-box;
}

.game-inventory-card:not(.game-item-tile) {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    border-left-width: 4px;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.game-inventory-card:not(.game-item-tile):hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.game-inventory-item-modal {
    display: block;
    padding: 0;
}

.game-inventory-item-modal.is-opening:not([hidden]),
.game-inventory-item-modal.is-closing:not([hidden]) {
    display: block;
}

.game-inventory-item-modal .game-modal-backdrop {
    background: rgba(8, 12, 24, 0.58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.game-inventory-item-modal__spotlight {
    position: fixed;
    z-index: 209;
    pointer-events: none;
    transform-origin: center center;
    will-change: transform, opacity;
}

.game-inventory-item-modal__spotlight .game-inventory-card {
    width: 100%;
    margin: 0;
    opacity: 1;
    pointer-events: none;
    transform: none;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
        0 18px 40px rgba(15, 23, 42, 0.28);
}

.game-inventory-item-modal__spotlight[hidden] {
    display: none !important;
}

.game-inventory-item-modal__slot {
    position: fixed;
    z-index: 211;
    width: min(292px, calc(100vw - 24px));
    max-height: min(86vh, 640px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    overflow: visible;
    transform-origin: top left;
    will-change: transform, opacity;
}

.game-inventory-item-modal__slot .game-item-sheet {
    width: 100%;
    max-height: min(86vh, 640px);
    overflow: auto;
}

.game-inventory-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
    outline-offset: 3px;
}

.game-inventory-card.is-empty {
    opacity: 0.65;
}

.game-inventory-card--common { border-left-color: #94a3b8; }
.game-inventory-card--rare { border-left-color: #3b82f6; }
.game-inventory-card--very_rare { border-left-color: #8b5cf6; }
.game-inventory-card--mythic { border-left-color: #ec4899; }
.game-inventory-card--legendary { border-left-color: #f59e0b; }

.game-inventory-equipped-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    color: #fff;
    background: var(--accent);
    border: 2px solid var(--surface);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.game-pill--equipped {
    background: color-mix(in srgb, var(--accent) 16%, var(--surface-soft));
    color: var(--accent);
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.game-pill--equipped i {
    margin-right: 4px;
}

.game-inventory-body {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.game-inventory-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent);
    flex-shrink: 0;
    overflow: visible;
    position: relative;
}

.game-inventory-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 4px;
}

.game-inventory-name {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.game-inventory-headline {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
    min-width: 0;
}

.game-inventory-headline .game-rarity {
    flex-shrink: 0;
    font-size: 0.72rem;
    white-space: nowrap;
}

.game-inventory-desc {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-height: calc(1.35em * 2);
}

.game-inventory-qty {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.game-inventory-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.game-inventory-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
    max-height: 54px;
    overflow: hidden;
}

.game-inventory-flags .game-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-inventory-action {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.game-item-sheet {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    text-align: left;
    box-sizing: border-box;
    cursor: auto;
}

.game-inventory-card > .game-item-sheet {
    position: absolute;
    top: calc(100% - 8px);
    left: 0;
    right: 0;
    width: min(292px, 100%);
    pointer-events: none;
    visibility: hidden;
}

.game-inventory-card > .game-item-sheet[hidden] {
    display: none !important;
}

.game-item-sheet--common { --item-sheet-accent: #64748b; }
.game-item-sheet--rare { --item-sheet-accent: #2563eb; }
.game-item-sheet--very_rare { --item-sheet-accent: #7c3aed; }
.game-item-sheet--mythic { --item-sheet-accent: #db2777; }
.game-item-sheet--legendary { --item-sheet-accent: #d97706; }

.game-item-sheet[hidden] {
    display: none !important;
}

.game-item-sheet__header {
    padding: 14px 16px 12px;
    border-radius: 12px;
    background: var(--item-sheet-accent, var(--accent));
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.game-item-sheet__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.game-item-sheet__kicker {
    margin: 4px 0 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.82);
}

.game-item-sheet__info,
.game-item-sheet__info--tail {
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.game-item-sheet__highlight {
    margin: 0 0 10px;
    font-size: 0.88rem;
    line-height: 1.45;
    font-weight: 650;
    color: #111827;
}

.game-item-sheet__desc {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.55;
    color: #374151;
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-height: min(34vh, 180px);
    overflow-y: auto;
}

.game-item-sheet__foot {
    margin: 10px 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #6b7280;
}

.game-item-sheet__menu {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.game-item-sheet__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.game-item-sheet__row {
    border-top: 1px solid #eceff3;
}

.game-item-sheet__row:first-child {
    border-top: none;
}

.game-item-sheet__row--note {
    padding: 12px 16px;
}

.game-item-sheet__form {
    margin: 0;
}

.game-item-sheet__action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 13px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.game-item-sheet__action:hover,
.game-item-sheet__action:focus-visible {
    background: #f8fafc;
    color: #111827;
    outline: none;
}

.game-item-sheet__action strong {
    color: #111827;
    font-weight: 800;
}

.game-item-sheet__action--primary {
    color: #111827;
    font-weight: 650;
}

.game-item-sheet__badge {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: #9ca3af;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.game-item-sheet__note {
    display: block;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #6b7280;
}

@media (max-width: 720px) {
    .game-inventory-item-modal__spotlight {
        display: none !important;
    }

    .game-catalog-page .game-inventory-card.is-menu-open {
        opacity: 0.42;
    }

    .game-inventory-item-modal__slot {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        top: auto !important;
        bottom: 12px;
        max-height: min(72vh, 560px);
    }
}

.game-item-popover {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--item-popover-accent, var(--accent)) 24%, var(--border));
    border-radius: 14px;
    background: var(--surface);
    box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.14),
        0 0 0 1px color-mix(in srgb, var(--surface) 80%, transparent);
    cursor: auto;
    text-align: left;
    box-sizing: border-box;
    overflow: hidden;
}

.game-inventory-card > .game-item-popover {
    position: absolute;
    top: calc(100% - 8px);
    left: 0;
    right: 0;
    width: min(300px, 100%);
    animation: none;
    pointer-events: none;
    visibility: hidden;
}

.game-inventory-card > .game-item-popover[hidden] {
    display: none !important;
}

.game-item-popover--common { --item-popover-accent: #94a3b8; }
.game-item-popover--rare { --item-popover-accent: #3b82f6; }
.game-item-popover--very_rare { --item-popover-accent: #8b5cf6; }
.game-item-popover--mythic { --item-popover-accent: #ec4899; }
.game-item-popover--legendary { --item-popover-accent: #f59e0b; }

.game-item-popover--common,
.game-item-popover--rare,
.game-item-popover--very_rare,
.game-item-popover--mythic,
.game-item-popover--legendary {
    border-top: none;
}

.game-item-popover[hidden] {
    display: none !important;
}

.game-item-popover-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    min-height: 108px;
    max-height: 140px;
    background:
        radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--item-popover-accent, var(--accent)) 16%, transparent), transparent 64%),
        var(--surface-soft);
    overflow: hidden;
    border-bottom: 2px solid var(--item-popover-accent, var(--border));
}

.game-item-popover-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 8px;
    margin: 0;
}

.game-item-popover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--item-popover-accent, var(--accent));
    font-size: 2.6rem;
}

.game-item-popover-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border: 1px solid color-mix(in srgb, #fff 24%, var(--border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: blur(6px);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.game-item-popover-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px 14px;
    overflow-y: auto;
    min-height: 0;
}

.game-catalog-page .game-inventory-card.is-menu-open .game-item-popover-body {
    flex: 1;
}

@keyframes inventory-pop-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes inventory-pop-modal-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 10px)) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.game-item-popover-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 12px;
    align-items: flex-start;
    min-width: 0;
}

.game-item-popover-title {
    flex: 1;
    min-width: 0;
    font-size: 0.98rem;
    font-weight: 750;
    line-height: 1.3;
    word-break: break-word;
}

.game-item-popover-desc {
    margin: 0;
    width: 100%;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text);
    text-align: left;
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-height: min(42vh, 220px);
    overflow-y: auto;
}

.game-item-popover-meta {
    margin: 0;
    width: 100%;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: left;
}

.game-item-popover-meta strong {
    color: var(--text);
    font-weight: 700;
}

.game-item-popover-actions {
    display: grid;
    gap: 8px;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.game-item-popover .game-market-fee-note {
    margin: 0;
    text-align: left;
    line-height: 1.45;
    font-size: 0.82rem;
}

.game-item-popover-actions .game-inventory-action,
.game-item-popover-actions .game-market-list-form {
    display: grid;
    gap: 8px;
    width: 100%;
    align-items: stretch;
}

.game-item-popover .game-inventory-select {
    width: 100%;
    min-width: 0;
}

.game-inventory-select {
    margin: 0;
    min-width: 160px;
    flex: 1;
}

/* ——— Замена поля на доске (инвентарь) ——— */
.game-field-equip-action {
    gap: 10px;
}

.game-field-equip-action__label {
    flex-shrink: 0;
    color: #6b7280;
}

.game-field-equip-action.is-current .game-field-equip-action__label {
    color: #111827;
    font-weight: 650;
}

.game-field-equip-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.25;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-field-equip-pill--common { background: #94a3b8; }
.game-field-equip-pill--rare { background: #2563eb; }
.game-field-equip-pill--very_rare { background: #7c3aed; }
.game-field-equip-pill--mythic { background: #db2777; }
.game-field-equip-pill--legendary { background: #d97706; }

.game-rarity {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: var(--surface-soft);
    white-space: nowrap;
}

.game-rarity--common { color: #94a3b8; }
.game-rarity--rare { color: #3b82f6; }
.game-rarity--very_rare { color: #8b5cf6; }
.game-rarity--mythic { color: #ec4899; }
.game-rarity--legendary { color: #f59e0b; }

.game-equipped-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.game-equipped-row:last-child {
    border-bottom: none;
}

.game-user {
    text-decoration: none;
    color: var(--muted);
}

.game-user:hover {
    color: var(--text);
}

.game-theme-toggle i {
    transition: transform 0.35s ease;
}

html.dark .game-theme-toggle i {
    transform: rotate(180deg);
}

/* Кнопка темы на экране стола (topbar скрыт) */
.game-play-theme-toggle {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 120;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.game-play-theme-toggle:hover {
    color: var(--text);
}

/* ——— Колокол уведомлений (game shell, без style.css) ——— */
.game-topbar-user-hub .unlias-notif-hub,
.game-topbar-actions .unlias-notif-hub {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.game-topbar-user-hub .unlias-notif-btn,
.game-topbar-actions .unlias-notif-btn {
    position: relative;
    padding: 0;
    font: inherit;
}

.game-topbar-actions .unlias-notif-btn.has-unread {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
    background: color-mix(in srgb, var(--accent) 14%, var(--surface-soft));
    color: var(--accent-light);
}

.game-topbar-actions .unlias-notif-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    background: var(--danger);
    color: #fff;
    border: 2px solid var(--surface);
    box-sizing: border-box;
    pointer-events: none;
}

.game-topbar-user-hub .unlias-notif-panel {
    right: 0;
}

.unlias-notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(360px, 92vw);
    max-height: min(420px, 70vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    z-index: 200;
}

html.dark .unlias-notif-panel {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.unlias-notif-panel[hidden] {
    display: none !important;
}

.unlias-notif-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}

.unlias-notif-readall {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.unlias-notif-readall:hover {
    color: var(--accent-light);
}

.unlias-notif-list {
    overflow: auto;
    flex: 1;
    padding: 8px 6px 10px;
}

.unlias-notif-empty {
    padding: 12px;
    margin: 0;
    text-align: center;
    font-size: 0.9rem;
}

.unlias-notif-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font: inherit;
    background: transparent;
    color: var(--text);
    margin-bottom: 4px;
}

.unlias-notif-item:hover {
    background: var(--surface-soft);
}

.unlias-notif-item:not(.is-read) {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
}

.unlias-notif-item.is-read {
    opacity: 0.7;
}

.unlias-notif-title {
    font-weight: 600;
    font-size: 0.9rem;
    width: 100%;
}

.unlias-notif-foot {
    padding: 8px 14px 10px;
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
}

.unlias-notif-foot a {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.unlias-notif-foot a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.unlias-notif-toast-btn--primary {
    background: var(--accent) !important;
    color: #fff !important;
}

.unlias-notif-body {
    white-space: pre-line;
    display: block;
    margin-top: 4px;
}

.unlias-notif-toast-stack {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.unlias-notif-toast {
    pointer-events: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    animation: unliasNotifToastIn 0.25s ease;
}

.unlias-notif-toast-title {
    display: block;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 6px;
    color: var(--text);
}

.unlias-notif-toast-body,
.unlias-notif-toast-meta,
.unlias-notif-toast-players {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.unlias-notif-toast-body {
    white-space: pre-line;
    margin-bottom: 10px;
}

.unlias-notif-toast-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.unlias-notif-toast-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.unlias-notif-toast-btn--ghost {
    background: var(--surface-soft);
    color: var(--muted);
}

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

.unlias-profile-blocked {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(60vh, 520px);
    padding: 32px 20px;
}

.unlias-profile-blocked__card {
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 36px 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.unlias-profile-blocked__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--danger);
    font-size: 1.35rem;
}

.unlias-profile-blocked__title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 700;
}

.unlias-profile-blocked__text {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}
