:root {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --danger: #9b1c31;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.top-nav {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1.4rem 1.1rem 1.8rem;
    background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.1), transparent 45%), #0b1220;
    position: sticky;
    top: 0;
    height: 100vh;
    width: 280px;
    z-index: 6;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.35);
}

.top-nav nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.top-nav nav a {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    background: transparent;
    border: none;
    position: relative;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.95rem;
}

.top-nav nav a:hover,
.top-nav nav a:focus-visible {
    color: var(--accent);
    background: rgba(56, 189, 248, 0.12);
    transform: translateX(2px);
}

.top-nav nav a.is-active {
    color: var(--accent);
    background: rgba(56, 189, 248, 0.18);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.18);
}

.top-nav nav .nav-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    border-radius: 12px;
    border: none;
    background: transparent;
}

.top-nav nav .nav-sub-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

.top-nav nav .nav-parent-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
}

.top-nav nav .nav-sub-parent-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}

.top-nav nav .nav-sub-parent {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.top-nav nav .nav-sub-parent--toggle {
    justify-content: space-between;
}

.top-nav nav .nav-toggle-sub {
    padding: 0.35rem 0.45rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
    min-width: 32px;
    transition: color 0.15s ease, transform 0.15s ease;
}

.top-nav nav .nav-toggle-sub:hover,
.top-nav nav .nav-toggle-sub:focus-visible {
    color: var(--accent);
}

.top-nav nav .nav-toggle-sub.nav-toggle-sub--nested {
    padding: 0.35rem 0.5rem;
    min-width: 32px;
}

.top-nav nav .nav-toggle-sub::before {
    content: '\25be';
    font-size: 0.9rem;
    display: inline-block;
    transition: transform 0.2s ease;
}

.top-nav nav .nav-toggle-sub.is-collapsed::before {
    transform: rotate(-90deg);
}

.top-nav nav .nav-parent {
    font-weight: 800;
    letter-spacing: 0.01em;
    flex: 1 1 auto;
    width: auto;
}

.top-nav nav .nav-sub {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 0.6rem;
    margin-left: 0.2rem;
    border-left: none;
}

/* Scrollbar styling for the nav area */
.top-nav nav::-webkit-scrollbar {
    width: 8px;
}

.top-nav nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.top-nav nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 10px;
}

.top-nav nav::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.6);
}

.top-nav nav .nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Hide nav scrollbar while keeping scroll */
.top-nav nav {
    scrollbar-width: none;
}

.top-nav nav::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.top-nav nav .nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding-left: 0.1rem;
}

.top-nav nav .nav-sub-nested {
    margin-left: 0.65rem;
    padding-left: 0.65rem;
    border-left: none;
    gap: 0.25rem;
}

.top-nav nav .nav-sub.is-collapsed {
    display: none;
}

.top-nav nav .nav-sub a {
    font-weight: 600;
    background: transparent;
    border-color: transparent;
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    position: relative;
}

.nav-icon::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 3px;
    border: 2px solid var(--accent);
    background: rgba(56, 189, 248, 0.16);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.14);
    display: block;
}

.nav-text {
    flex: 1 1 auto;
}

.nav-caret {
    width: 12px;
    height: 12px;
    display: inline-block;
}

.nav-caret::before {
    content: '\25be';
    font-size: 0.9rem;
    display: block;
    transition: transform 0.2s ease;
}

.nav-sub-parent[aria-expanded="false"] .nav-caret::before {
    transform: rotate(-90deg);
}

.nav-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 7;
    padding: 0.55rem;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.7);
    background: rgba(2, 6, 23, 0.95);
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    display: none;
    min-width: 44px;
    min-height: 44px;
    text-indent: -9999px;
    overflow: hidden;
    transition: left 0.2s ease, transform 0.2s ease;
}

.nav-toggle::after {
    content: '\2630';
    display: block;
    text-indent: 0;
    font-size: 1.15rem;
    line-height: 1;
}

.nav-toggle.is-open::after {
    content: '\2715';
    font-size: 1.25rem;
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, backdrop-filter 0.2s ease;
    z-index: 4;
    display: none;
}

.user-chip {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.wallet-chip {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    margin: 0.25rem 0 1rem;
    font-weight: 700;
}

.wallet-chip .wallet-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.wallet-chip .wallet-amount {
    font-size: 1rem;
    color: var(--accent);
}

.nav-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.18);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.brand-name {
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-sub {
    font-size: 0.85rem;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.6);
}

.badge.success {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.7);
    color: #4ade80;
}

.badge.danger {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.badge.warning {
    background: rgba(234, 179, 8, 0.2);
    border-color: rgba(234, 179, 8, 0.6);
    color: #fbbf24;
}
.badge.primary {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
    color: #bfdbfe;
}

.user-chip .badge {
    font-size: 0.65rem;
    padding: 0.05rem 0.4rem;
}

.hidden {
    display: none !important;
}

.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 {
    background: var(--accent);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    color: #0f172a;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn.danger,
.btn.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn.sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.btn.icon-only {
    padding: 0.3rem;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.btn.sm.danger {
    background: var(--danger);
    color: #fff;
}

.page {
    grid-column: 2;
    padding: 2rem 2.5rem;
    max-width: none;
    width: 100%;
    margin: 0;
}

.hero {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.hero .card {
    flex: 1;
}

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
}

.referral-card {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.referral-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.referral-pill {
    min-width: 180px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
    text-align: right;
}

.referral-pill .label {
    font-size: 0.85rem;
    color: var(--muted);
}

.referral-pill .value {
    font-weight: 800;
    font-size: 1.2rem;
}

.referral-link {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.referral-link__row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
}

.referral-link input {
    width: 100%;
    border-radius: 10px;
    padding: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #0f172a;
    color: var(--text);
}

.referral-metrics {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.referral-metrics strong {
    font-size: 1.2rem;
}

.referral-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.referral-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 1rem;
}

.referral-chart-panel {
    overflow-x: auto;
}

.referral-chart {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.referral-branch {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.referral-card-node {
    background: #0ea5e9;
    color: #0b1220;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    min-width: 150px;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.35);
}

.referral-card-name {
    color: #0b1220;
}

.referral-card-balance {
    font-weight: 800;
    font-size: 0.95rem;
}

.referral-card-balance.primary {
    color: #0b1220;
}

.referral-card-balance.secondary {
    color: #c3424f;
}

.referral-children {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.2rem;
    padding-top: 1rem;
    position: relative;
}

.referral-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 50%;
    border-top: 1px dashed rgba(148, 163, 184, 0.6);
}

.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.16), transparent 45%), rgba(11, 18, 32, 0.95);
}

.dashboard-hero__copy h2 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.6rem, 2vw + 0.5rem, 2.2rem);
}

.dashboard-hero__copy p {
    margin: 0;
    color: #cbd5e1;
    font-size: 1rem;
}

.dashboard-hero__actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.btn-cta {
    padding: 0.65rem 1.2rem;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid rgba(56, 189, 248, 0.7);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn-cta.primary {
    background: linear-gradient(120deg, #38bdf8, #1dd3b0);
    color: #0b1220;
    box-shadow: 0 12px 24px rgba(56, 189, 248, 0.35);
}

.btn-cta.secondary {
    background: transparent;
    color: #cbd5e1;
}

.btn-cta:hover,
.btn-cta:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(56, 189, 248, 0.35);
    color: #0b1220;
    background: linear-gradient(120deg, #38bdf8, #60e8c5);
}

.game-launcher {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.game-launcher form {
    width: 100%;
}

.game-launcher .btn {
    width: 100%;
    border-radius: 12px;
    font-weight: 800;
}

.game-launcher .btn.primary {
    background: linear-gradient(90deg, #38bdf8, #16a4f3);
    border: none;
    color: #0b1220;
}

.game-launcher .btn.secondary {
    background: transparent;
    border: 1px solid rgba(56, 189, 248, 0.7);
    color: #8acff7;
}

.game-launcher .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-card {
    max-width: 420px;
    margin: 2rem auto;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

label {
    font-size: 0.95rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

input, select {
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #0f172a;
    color: var(--text);
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-danger {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card small {
    color: var(--muted);
}

.admin-section + .admin-section {
    margin-top: 1.5rem;
}

.admin-section {
    display: none;
}

.admin-section.is-active {
    display: block;
}

.user-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.user-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.user-stat--danger {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.05);
}

.user-stat__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.user-stat__value {
    font-size: 2rem;
    font-weight: 800;
}

.user-stat__sub {
    color: var(--muted);
    font-size: 0.9rem;
}

.user-panel__controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 0.75rem 0.25rem 0.75rem 0;
}

.user-search {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.06);
    min-width: 260px;
    flex: 0 1 360px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.user-search input {
    border: none;
    background: transparent;
    color: var(--text);
    width: 100%;
    outline: none;
    font-size: 1rem;
}

.user-filter-btn {
    min-width: 44px;
    padding: 0.55rem 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-table-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    overflow: visible;
    position: relative;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.25);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.user-table thead th {
    text-align: left;
    padding: 0.9rem 0.8rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.user-table tbody td {
    padding: 0.85rem 0.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: middle;
}

.user-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.08);
}

.user-table input[type="checkbox"] {
    accent-color: var(--accent);
}

.user-row.is-hidden {
    display: none;
}

.user-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.4);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--text);
}

.user-name-meta .user-name {
    font-weight: 700;
}

.user-name-meta .user-handle {
    color: var(--muted);
    font-size: 0.9rem;
}

.user-contact {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.user-email {
    font-weight: 700;
}

.user-username {
    color: var(--muted);
}

.user-role-pill {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.user-actions {
    position: relative;
}

.user-actions summary {
    list-style: none;
    cursor: pointer;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.02);
    font-weight: 700;
}

.user-actions summary::-webkit-details-marker {
    display: none;
}

.user-actions[open] summary {
    border-color: rgba(56, 189, 248, 0.6);
    color: var(--accent);
}

.user-actions__inner {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.user-actions .inline-form input[type="number"],
.user-actions .inline-form input[type="text"] {
    width: 100%;
}

.user-actions-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    flex-wrap: nowrap;
}

.user-actions-menu {
    position: relative;
    flex-shrink: 0;
}

.user-actions-cell .btn {
    flex-shrink: 0;
}

.user-actions-toggle {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: radial-gradient(circle at 30% 30%, rgba(148, 163, 184, 0.16), rgba(255, 255, 255, 0.02));
    color: var(--text);
    padding: 0.42rem 0.58rem;
    border-radius: 10px;
    cursor: pointer;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.user-actions-toggle:hover,
.user-actions-toggle:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.16);
}

.user-actions-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #0b1220;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    min-width: 180px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
    padding: 0.3rem 0;
    display: none;
    z-index: 30;
    overflow: hidden;
}

.user-actions-dropdown.is-open {
    display: block;
}

.user-actions-item {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    text-align: left;
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.user-actions-item:hover,
.user-actions-item:focus-visible {
    background: rgba(56, 189, 248, 0.14);
}

.user-editor {
    position: fixed;
    inset: 0;
    z-index: 20;
}

.user-editor.hidden {
    display: none;
}

.user-editor__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.user-editor__panel {
    position: relative;
    margin: 4vh auto;
    max-width: 1100px;
    background: #0c1424;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
    padding: 1.5rem;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 1rem;
    max-height: 92vh;
}

.user-editor__header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.user-editor__avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.5);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.2rem;
}

.user-editor__name {
    font-size: 1.3rem;
    font-weight: 800;
}

.user-editor__meta {
    color: var(--muted);
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.user-editor__meta .dot {
    opacity: 0.6;
}

.user-editor__close {
    align-self: start;
}

.user-editor__body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
    height: 100%;
}

.user-editor__nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 0.6rem;
}

.user-editor__tab {
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.user-editor__tab:hover {
    border-color: rgba(56, 189, 248, 0.4);
}

.user-editor__tab.is-active {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
}

.user-editor__tab--danger {
    color: #fda4af;
}

.user-editor__content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    overflow: auto;
}

.user-editor__section {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.user-editor__section.is-active {
    display: flex;
}

.user-editor__form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.user-editor__actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

.user-editor__form label {
    width: 100%;
}

.user-editor__status {
    min-height: 1.1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.role-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 1rem 1.2rem;
}

.role-builder.hidden {
    display: none;
}

.role-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

.role-list__header {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.role-list__search input {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #0f172a;
    color: var(--text);
    min-width: 220px;
}

.role-list__table-wrap {
    overflow: auto;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.role-list__table {
    width: 100%;
    border-collapse: collapse;
}

.role-list__table th,
.role-list__table td {
    padding: 0.75rem 0.7rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    text-align: left;
}

.role-list__table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.role-list__table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.role-builder__header {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.role-builder__label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text);
}

.role-builder__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.role-builder__toggle input {
    display: none;
}

.role-builder__toggle-ui {
    width: 46px;
    height: 24px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.4);
    position: relative;
    transition: background 0.15s ease;
}

.role-builder__toggle-ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0c1424;
    transition: transform 0.15s ease;
}

.role-builder__toggle input:checked + .role-builder__toggle-ui {
    background: rgba(56, 189, 248, 0.7);
}

.role-builder__toggle input:checked + .role-builder__toggle-ui::after {
    transform: translateX(18px);
}

.role-builder__toggle-label {
    color: var(--muted);
    font-size: 0.95rem;
}

.role-builder__table {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.role-builder__table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.role-builder__table-title {
    font-weight: 700;
}

.role-builder__select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.role-builder__table-scroll {
    max-height: 420px;
    overflow: auto;
}

.role-builder__table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.role-builder__table th,
.role-builder__table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    text-align: left;
}

.role-builder__table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.role-builder__table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.role-builder__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.balance-modal {
    position: fixed;
    inset: 0;
    z-index: 25;
}

.balance-modal.hidden {
    display: none;
}

.balance-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

.balance-modal__panel {
    position: relative;
    margin: 6vh auto;
    max-width: 520px;
    background: #0c1424;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 1.2rem;
}

.balance-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.balance-modal__user {
    color: var(--muted);
    font-size: 0.95rem;
}

.balance-modal__close {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.balance-modal__body {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0;
}

.balance-modal__current {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.balance-modal__amount {
    color: var(--accent);
    font-weight: 800;
}

.balance-modal__field input {
    margin-top: 0.35rem;
    width: 100%;
}

.balance-modal__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem;
}

.balance-modal__radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 0.7rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.balance-modal__radio input {
    accent-color: var(--accent);
}

.balance-modal__radio.is-active {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(56, 189, 248, 0.08);
}

.balance-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
}

.balance-modal__status {
    min-height: 1.1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.icon-filter {
    position: relative;
    width: 16px;
    height: 16px;
    display: inline-block;
}

.icon-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1px;
    width: 14px;
    height: 6px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
}

.icon-filter::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 5px;
    width: 6px;
    height: 10px;
    background: currentColor;
    border-radius: 0 0 3px 3px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.admin-panel {
    position: sticky;
    top: 100px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-panel__nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.admin-panel__nav a {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-weight: 600;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.admin-panel__nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(56, 189, 248, 0.15);
}

.admin-panel__nav a.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(56, 189, 248, 0.2);
}

.admin-panel__nav-group {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.admin-panel__nav-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.admin-panel__nav-child {
    font-size: 0.95rem;
    padding-left: 0.5rem;
}

.admin-panel__meta {
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.admin-panel__meta .label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
}

.admin-panel__meta strong {
    color: var(--text);
    font-size: 1.1rem;
}

.referral-summary {
    margin: 0.4rem 0 0.6rem;
    color: var(--muted);
    font-weight: 700;
}

.referral-tier-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
}

.referral-tier-list li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.referral-tier-list li strong {
    color: var(--text);
    font-size: 1.05rem;
}

.admin-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-clock {
    padding: 0.45rem 0.8rem;
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.admin-main section[id] {
    scroll-margin-top: 120px;
}

.admin-users {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) minmax(360px, 3fr);
    gap: 1.5rem;
    align-items: flex-start;
}

.admin-users__list table.compact td,
.admin-users__list table.compact th {
    padding: 0.4rem 0.3rem;
}

[data-user-row].is-active {
    background: rgba(56, 189, 248, 0.12);
}

.admin-users__list-header {
    margin-bottom: 0.8rem;
}

.admin-users__detail {
    position: relative;
    min-height: 320px;
}

.admin-users__detail.is-loading::after {
    content: 'Loading...';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(2, 6, 23, 0.8);
    border-radius: 12px;
}

.admin-users__empty {
    border: 1px dashed rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.admin-user-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 1.2rem;
}

.admin-user-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-user-role {
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.5);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-user-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem 1.2rem;
    margin: 1rem 0;
}

.admin-user-info dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.admin-user-info dd {
    margin: 0.2rem 0 0;
    font-weight: 600;
}

.admin-user-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-user-stats > div {
    flex: 1;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.admin-user-stats .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
}

.admin-user-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem 1rem;
}

.admin-user-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.admin-user-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.admin-mini-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-mini-table th,
.admin-mini-table td {
    padding: 0.35rem 0.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    text-align: left;
}

.admin-mini-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-users__detail .alert {
    margin: 1rem 0;
}

.admin-users__detail .alert.hidden {
    display: none;
}

.admin-user-password {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 1rem;
    margin-top: 1rem;
}

.admin-user-password__form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.admin-user-password__form .btn {
    align-self: flex-start;
}

.admin-sections--tabs .admin-section {
    display: none;
}

.admin-sections--tabs .admin-section.is-active {
    display: block;
}

.settings-wrapper {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 1.5rem;
}

.settings-subnav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-subnav__btn {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    color: var(--text);
    font-weight: 600;
    text-align: left;
}

.settings-subnav__btn.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(56, 189, 248, 0.15);
}

.settings-panel {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.settings-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.settings-summary > div {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.settings-summary .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
}

.settings-info-box {
    border: 1px dashed rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    padding: 1rem;
}

.muted-list {
    list-style: disc;
    margin: 0.6rem 0 0 1.2rem;
    color: var(--muted);
    padding: 0;
}

.admin-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.5rem 0.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.data-table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.table-actions form {
    margin: 0;
}

.game-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.game-select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    z-index: 20;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 21;
}

.modal__dialog {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 1.25rem;
    width: min(420px, 90vw);
    box-shadow: 0 20px 60px rgba(15, 15, 30, 0.65);
}

.modal__dialog h4 {
    margin: 0 0 0.5rem;
}

.modal__dialog p {
    margin: 0 0 1rem;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.text-success {
    color: #4ade80;
}

.text-danger {
    color: #f87171;
}

.tx-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}

.tx-summary__item {
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.tx-summary__label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tx-summary__value {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.tx-summary__value.success { color: #22c55e; }
.tx-summary__value.danger { color: #ef4444; }

.tx-summary__hint {
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.tx-log-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.tx-log__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.tx-log__filters label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tx-log__filters input[type="search"],
.tx-log__filters select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--text);
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    min-width: 240px;
}

.tx-count {
    color: var(--muted);
    font-size: 0.95rem;
    margin-left: auto;
}

.tx-table-wrapper {
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.tx-table-wrapper table {
    min-width: 840px;
}

.tx-user__name {
    font-weight: 700;
}

.tx-user__meta {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.tx-reason__label {
    font-weight: 600;
}

.tx-reason__code {
    margin-left: 0.35rem;
    font-size: 0.85rem;
}

.tx-amount {
    font-weight: 700;
}

.tx-amount.positive { color: #22c55e; }
.tx-amount.negative { color: #ef4444; }

.tx-meta {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.inline-form {
    display: inline-block;
    margin-left: 1rem;
}

.table {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.table-row {
    display: grid;
    grid-template-columns: 0.5fr 0.8fr 0.8fr 1.4fr 0.8fr;
    gap: 0.8rem;
    padding: 0.4rem 0.6rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
}

.table-row.head {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.table-actions {
    display: flex;
    justify-content: flex-end;
}

.play-wrapper {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) 300px;
    gap: 1.5rem;
    align-items: start;
}

.chess-board {
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: #ceb594;
    border: 10px solid #3c2a1e;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    width: min(100%, 760px);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto;
    perspective: none;
    transform: none;
    transform-origin: center;
    transition: none;
    will-change: auto;
    touch-action: none;
    overscroll-behavior: contain;
}

.chess-board::before {
    display: none;
}

.chess-board.board-frozen {
    pointer-events: none;
    opacity: 0.96;
    filter: grayscale(0.08);
}

.chess-board.board-frozen .square {
    cursor: default;
}

.chess-board:hover {
    transform: none;
    box-shadow: 0 28px 55px rgba(0, 0, 0, 0.6);
}

.board-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    flex: 1;
    transform-style: preserve-3d;
}

.square {
    width: 100%;
    height: 100%;
    font-size: clamp(2rem, 4vw, 2.8rem);
    border: none;
    cursor: pointer;
    color: #1b1a17;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
    font-family: 'Segoe UI Symbol', 'Noto Sans Symbols', 'Arial Unicode MS', sans-serif;
    position: relative;
    border-radius: 0;
    box-shadow: none;
    transform-style: flat;
    overflow: hidden;
    touch-action: none;
}

.square-label {
    position: absolute;
    font-size: 0.6rem;
    font-weight: 600;
    pointer-events: none;
    text-transform: lowercase;
    opacity: 0.9;
    z-index: 0;
}

.square-label__file {
    right: 6px;
    bottom: 6px;
}

.square-label__rank {
    left: 6px;
    top: 6px;
}

.square.dark .square-label {
    color: rgba(249, 250, 246, 0.8);
}

.square.light .square-label {
    color: rgba(32, 36, 30, 0.75);
}

.square.dark {
    background: #ceb594;
    color: #f8f8f5;
}

.square.light {
    background: #e8dabe;
    color: #1b1a17;
}

.timer-panel {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.timer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.timer-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.square.selected {
    box-shadow:
        inset 0 0 0 4px rgba(250, 224, 128, 0.9),
        0 0 18px rgba(250, 224, 128, 0.6);
}

.square.drag-over {
    box-shadow:
        inset 0 0 0 4px rgba(59, 130, 246, 0.9),
        inset 0 0 0 999px rgba(59, 130, 246, 0.12);
}

.square.last-move {
    box-shadow:
        inset 0 0 0 4px rgba(245, 208, 39, 0.7),
        0 0 18px rgba(245, 208, 39, 0.45);
}

.square.last-move-target {
    box-shadow:
        inset 0 0 0 4px rgba(245, 208, 39, 0.9),
        inset 0 0 0 999px rgba(245, 208, 39, 0.14),
        0 0 20px rgba(245, 208, 39, 0.45);
}

.square.hint::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(185, 220, 85, 0.8);
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 10px rgba(50, 120, 20, 0.35);
    z-index: 2;
}

.square.hint-capture::after {
    width: 70%;
    height: 70%;
    border: 4px solid rgba(248, 113, 113, 0.85);
    background: rgba(248, 113, 113, 0.05);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
    z-index: 2;
}

.piece {
    display: block;
    width: 82%;
    height: 82%;
    font-size: 1em;
    line-height: 1;
    position: relative;
    transform: translateZ(0);
    transition: none;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
    user-select: none;
    -webkit-user-drag: none;
}

.piece.white {
    color: #fdfdfd;
}

.piece.black {
    color: #0a0907;
}

.square:active .piece,
.square.selected .piece {
    transform: none;
}

.drag-preview {
    pointer-events: none;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}

.board-popup {
    position: absolute;
    inset: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
    z-index: 5;
    text-align: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.board-popup.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.board-popup.check {
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 20px 40px rgba(251, 191, 36, 0.25);
}

.board-popup.checkmate {
    border-color: rgba(248, 113, 113, 0.7);
    box-shadow: 0 20px 40px rgba(248, 113, 113, 0.3);
}

.board-popup__title {
    font-size: 1.5rem;
    margin: 0;
}

.board-popup__text {
    margin: 0;
    color: var(--muted);
    max-width: 16rem;
}

.board-popup .popup-dismiss {
    margin-top: 0.5rem;
}

.board-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.board-card h2 {
    display: none;
}

.moves-card {
    max-height: 600px;
    overflow: auto;
}

.time-control-card {
    margin-top: 1.2rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.time-groups {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.time-group__title {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.time-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.time-chip {
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.08);
    color: #e5e7eb;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s, border 0.2s, color 0.2s;
}

.time-chip:hover {
    background: #273245;
}

.time-chip--active {
    background: #253220;
    border-color: #7dd56f;
    color: #d1fae5;
}

.player-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: linear-gradient(135deg, rgba(9, 16, 28, 0.9), rgba(17, 36, 58, 0.8));
    backdrop-filter: blur(8px);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 15px 35px rgba(6, 12, 24, 0.45);
    margin-bottom: 1rem;
    width: 100%;
    max-width: none;
}

.player-strip.top {
    margin-bottom: 1.25rem;
    margin-left: 0;
    margin-right: 0;
}

.player-strip.bottom {
    margin-top: 1.25rem;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
}

.player-strip.active {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.2);
}

.player-meta {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1 1 50%;
}

.player-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 50%;
    justify-content: flex-end;
    margin-left: auto;
}

.capture-icons {
    display: flex;
    gap: 0.15rem;
    align-items: center;
    flex-wrap: wrap;
}

.capture-icons--empty {
    display: none;
}

.capture-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.8);
}

.capture-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.capture-count-badge {
    font-size: 0.7rem;
    color: #000;
}

.score-value:empty {
    display: none;
}

.player-label {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    gap: 0.15rem;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
}

.player-caption {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.player-timer {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    align-self: flex-start;
}

.material-score {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.score-row.active {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.2);
}

.score-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.score-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

.score-dot.white {
    background: #f8fafc;
}

.score-dot.black {
    background: #0f172a;
    border: 2px solid rgba(248, 250, 252, 0.6);
}

.score-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 2.5rem;
    text-align: center;
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#move-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.status-panel {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
}

.page-footer {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

@media (max-width: 960px) {
    body {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .top-nav {
        width: 190px;
        height: 100vh;
        position: sticky;
        top: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
        padding: 1.1rem 0.9rem 1.4rem;
        border-right: 1px solid rgba(148, 163, 184, 0.18);
    }

    .top-nav nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .top-nav nav a {
        width: 100%;
    }

    .page {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 720px) {
    body {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    .top-nav {
        flex-wrap: nowrap;
        gap: 0.8rem;
        padding: 1rem 0.9rem 1.2rem;
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.22s ease, box-shadow 0.22s ease;
        width: 210px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
        pointer-events: none;
    }

    body.nav-open {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    body.nav-open .top-nav {
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
    }

    .nav-overlay {
        opacity: 1;
        pointer-events: auto;
        display: none;
    }

    body.nav-open .nav-overlay {
        display: block;
        backdrop-filter: blur(8px);
        opacity: 1;
        pointer-events: auto;
    }

    .chess-board {
        width: 100%;
        max-width: calc(100vw - 1.25rem);
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .top-nav nav {
        flex-wrap: nowrap;
        gap: 0.4rem;
    }

    .page {
        padding: 1rem;
    }

    .card {
        padding: 1.1rem;
        border-radius: 14px;
    }

    .chess-board {
        width: min(100vw - 1.5rem, 720px);
        max-width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .player-strip {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .player-strip.top,
    .player-strip.bottom {
        margin-left: 0;
        margin-right: 0;
    }

    .player-score {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .player-score .score-value {
        align-self: flex-end;
    }
}

@media (max-width: 640px) {
    .player-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .player-score {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .capture-icons {
        max-width: 100%;
    }

    .player-strip .score-value {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .top-nav nav {
        width: 100%;
    }
}

@media (max-width: 960px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-panel {
        position: static;
    }

    .admin-panel__nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .admin-panel__nav a {
        flex: 1 1 45%;
        text-align: center;
    }

    .admin-panel__nav-group {
        flex: 1 1 100%;
    }

    .admin-users {
        grid-template-columns: 1fr;
    }

    .admin-user-stats {
        flex-direction: column;
    }

    .settings-wrapper {
        grid-template-columns: 1fr;
    }

    .hero {
        flex-direction: column;
    }

    .play-wrapper {
        grid-template-columns: 1fr;
    }
}
.player-caption {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

/* Player strip refinement */
.player-strip {
    background: #2d2c29;
    border: 1px solid #1f1d1a;
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.player-left { gap: 0.65rem; }

.player-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4b5563, #1f2937);
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.player-clock {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #ffffff;
    color: #0f172a;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    font-weight: 700;
}

.clock-icon { font-size: 0.95rem; }

.player-timer { font-size: 1.05rem; font-weight: 700; }

.player-timer.timer-active {
      background: #0f172a;
      color: #f0f9ff;
      border-color: rgba(56, 189, 248, 0.55);
      box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  }

.player-timer--bot {
    opacity: 0.55;
}

.player-meta .player-clock {
    margin-left: auto;
    margin-right: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.player-clock--right {
    margin-left: 0;
    margin-right: 0;
    justify-content: flex-end;
}

.player-strip .player-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
}

.player-strip .player-score .score-value {
    min-width: 3rem;
    text-align: right;
}

.player-strip .player-score .player-clock {
    margin-left: 0;
}

.single-clock {
    display: none;
}






