@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Condensed:wght@600;700&display=swap');

:root {
    --bg: #12151c;
    --bg-soft: #171b24;
    --surface: #1a1f2b;
    --surface-solid: #1c2230;
    --surface-hover: #242b3a;
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.28);
    --accent: #3b82f6;
    --accent-2: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.18);
    --text: #e8edf5;
    --muted: #8b95a8;
    --green: #22c55e;
    --red: #ef4444;
    --sidebar-w: 260px;
    --radius: 10px;
    --radius-sm: 8px;
    --overlay: rgba(8, 10, 16, 0.72);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
    --bg: #e8ecf2;
    --bg-soft: #dce2eb;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --surface-hover: #f1f4f8;
    --border: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.18);
    --accent: #1d4ed8;
    --accent-2: #2563eb;
    --accent-glow: rgba(29, 78, 216, 0.14);
    --text: #0f172a;
    --muted: #64748b;
    --green: #16a34a;
    --red: #dc2626;
    --overlay: rgba(15, 23, 42, 0.42);
    --shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

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

body {
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.04), transparent 42%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] body::before {
    background: linear-gradient(180deg, rgba(29, 78, 216, 0.04), transparent 42%);
}

.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* Login */
.login-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    position: relative;
    z-index: 1;
}

.login-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 72px;
    border-right: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.06), transparent 50%);
}

.login-brand .logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
    color: var(--text);
}

.login-brand .logo img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.28);
}

.login-brand h2 {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    max-width: 420px;
    margin-bottom: 16px;
}

.login-brand p {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 380px;
    line-height: 1.7;
}

.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    box-shadow: var(--shadow);
}

.auth-box h1 {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.auth-box .sub { color: var(--muted); margin-bottom: 28px; font-size: 0.95rem; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 15px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    transition: 0.18s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: none;
}

[data-theme="light"] .btn-primary { color: #fff; }

.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-sm { padding: 8px 13px; font-size: 0.82rem; }
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(59, 130, 246, 0.08); }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.25); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-yellow {
    background: rgba(234, 179, 8, 0.16);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.35);
}
.btn-yellow:hover { background: rgba(234, 179, 8, 0.28); filter: brightness(1.05); }
[data-theme="light"] .btn-yellow {
    background: rgba(234, 179, 8, 0.18);
    color: #a16207;
    border-color: rgba(202, 138, 4, 0.4);
}
.btn-block { width: 100%; }

.error-msg {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.88rem;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    position: relative;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.sidebar-backdrop {
    display: none;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-solid);
    cursor: pointer;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(45, 212, 191, 0.25);
    background: #0b1220;
}

[data-theme="light"] .brand-mark {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

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

.brand-text strong {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 0.98rem;
    letter-spacing: -0.02em;
}

.brand-text span {
    font-size: 0.72rem;
    color: var(--muted);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.user-meta { min-width: 0; }
.user-meta .username {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta .role {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
}

.user-site {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 2px;
}

.nav-section {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 14px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
    border: 1px solid transparent;
    transition: 0.15s;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
    text-decoration: none;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--text);
    border-color: rgba(59, 130, 246, 0.25);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-icon svg { width: 20px; height: 20px; }
.nav-item.active .nav-icon { color: var(--accent); opacity: 1; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.nav-item.logout { color: var(--red); }
.nav-item.logout:hover { background: rgba(248, 113, 113, 0.08); }

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 0 36px 48px;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    z-index: 20;
}

.topbar-hint {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-clock {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    padding: 8px 12px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.theme-toggle { min-width: 88px; }

.page-body { padding-top: 12px; }

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

.page-header h2 {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-header .subtitle { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.hero-stats.four { grid-template-columns: repeat(4, 1fr); }
.hero-stats.five { grid-template-columns: repeat(5, 1fr); }

.hero-stat {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.hero-stat .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.hero-stat .value {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hero-stat.primary .value { color: var(--accent); }
.hero-stat.warn .value { color: #fbbf24; }
.hero-stat.danger .value { color: var(--red); }

.hero-stat-click {
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.hero-stat-click:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.rtp-edit-hint {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: lowercase;
    letter-spacing: 0;
    margin-left: 4px;
    opacity: 0.85;
}

.card {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

.card-header h3 {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 650;
}
.card-header a { font-size: 0.85rem; font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.table-wrap { overflow-x: auto; }

.live-players-wrap {
    max-height: 70vh;
    overflow: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

th {
    text-align: left;
    padding: 11px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:hover td { background: rgba(59, 130, 246, 0.03); }
tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-green { background: rgba(52, 211, 153, 0.14); color: var(--green); }
.badge-red { background: rgba(248, 113, 113, 0.14); color: var(--red); }
.badge-blue { background: rgba(56, 189, 248, 0.14); color: var(--accent-2); }
.badge-gold { background: rgba(59, 130, 246, 0.14); color: var(--accent); }
.badge-orange { background: rgba(251, 146, 60, 0.14); color: #fb923c; }
.badge-muted { background: var(--surface-hover); color: var(--muted); }

.key-box {
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    background: var(--bg-soft);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.key-box:hover { border-color: var(--accent); }

.empty {
    text-align: center;
    padding: 48px;
    color: var(--muted);
    font-size: 0.9rem;
}

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

.filters select {
    padding: 10px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
}

.log-body {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.76rem;
    color: var(--muted);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: 28px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow);
}

.modal h3 {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    margin-bottom: 18px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.modal.modal-lg { max-width: 720px; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 640px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 999px;
    transition: 0.2s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.db-layout {
    align-items: start;
}

.db-table-list {
    display: grid;
    gap: 6px;
    max-height: 520px;
    overflow: auto;
}

.db-table-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.db-table-btn:hover,
.db-table-btn.active {
    border-color: var(--accent);
    background: rgba(45, 212, 191, 0.08);
}

.db-table-wrap {
    max-height: 420px;
    overflow: auto;
}

.db-table-wrap table {
    font-size: 0.78rem;
}

.db-table-wrap td,
.db-table-wrap th {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

textarea#db-sql {
    width: 100%;
    min-height: 90px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--text);
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent);
    color: #042f2e;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 2000;
    box-shadow: 0 4px 14px var(--accent-glow);
}

[data-theme="light"] .toast { color: #fff; }

.provider-box {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    margin-bottom: 14px;
}

.games-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.games-search {
    flex: 1;
    min-width: 220px;
    max-width: 360px;
    padding: 12px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
}

.games-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.games-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
}

.games-tab {
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.games-tab.active {
    background: var(--accent);
    color: #042f2e;
}

[data-theme="light"] .games-tab.active { color: #fff; }

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

.game-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s;
}

.game-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.game-thumb {
    aspect-ratio: 4 / 3;
    background: var(--surface-hover);
    position: relative;
    overflow: hidden;
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--muted);
}

.game-body { padding: 12px; }

.game-body .name {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-body .meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    font-size: 0.72rem;
    color: var(--muted);
}

.game-id {
    font-family: ui-monospace, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
}

/* Loading */
.loading-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 280px;
    width: 100%;
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid var(--border-strong);
    border-top-color: var(--accent);
    animation: spin 0.75s linear infinite;
}

.spinner.sm {
    width: 22px;
    height: 22px;
    border-width: 2px;
}

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

.games-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 14px;
    width: 100%;
    grid-column: 1 / -1;
}

.skel-card {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    overflow: hidden;
}

.skel-thumb {
    aspect-ratio: 4 / 3;
    background: linear-gradient(90deg, var(--surface-hover) 25%, var(--bg-soft) 50%, var(--surface-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

.skel-lines { padding: 12px; display: grid; gap: 8px; }
.skel-line {
    height: 10px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-hover) 25%, var(--bg-soft) 50%, var(--surface-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}
.skel-line.short { width: 55%; }

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.games-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.games-pager-info {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 14, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 1;
    transition: opacity 0.25s ease;
}

.page-loader.hiding {
    opacity: 0;
    pointer-events: none;
}

.page-loader-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.loader-arc {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2.5px solid rgba(148, 163, 184, 0.16);
    border-top-color: var(--accent);
    animation: spin 0.7s linear infinite;
}

.page-loader-box span {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.85;
}

.page-loader-sub {
    font-size: 0.72rem !important;
    letter-spacing: 0.08em !important;
    text-transform: none !important;
    color: rgba(148, 163, 184, 0.75) !important;
    margin-top: -8px;
}

/* İşlem göstergesi (kaydetme/yükleme gibi POST işlemleri sırasında) */
.action-loader {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.action-loader.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.action-loader-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--bg-soft, #10141c);
    border: 1px solid var(--border-strong, rgba(148, 163, 184, 0.25));
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.04em;
}

.action-loader-spin {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-top-color: var(--accent);
    animation: spin 0.6s linear infinite;
}

.toast-error {
    background: #b91c1c;
    color: #fff;
    box-shadow: 0 8px 32px rgba(185, 28, 28, 0.4);
}

body.panel-loading .main {
    filter: blur(6px) brightness(0.7);
    transition: filter 0.25s ease;
}

body:not(.panel-loading) .main {
    filter: none;
    transition: filter 0.35s ease;
}

.health-checks {
    display: grid;
    gap: 10px;
}

.health-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    flex-wrap: wrap;
}

.health-row .left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-dot.ok { background: var(--green); box-shadow: 0 0 10px rgba(52, 211, 153, 0.45); }
.health-dot.warn { background: #fbbf24; box-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
.health-dot.error { background: var(--red); box-shadow: 0 0 10px rgba(248, 113, 113, 0.45); }

.health-row .title { font-weight: 650; font-size: 0.92rem; }
.health-row .detail { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.health-summary {
    display: grid;
    gap: 10px;
}

.health-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 650;
    border: 1px solid var(--border);
    background: var(--bg-soft);
}

@media (max-width: 1100px) {
    .hero-stats, .hero-stats.four, .hero-stats.five { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
    .login-split { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-form-side { padding: 24px 16px; min-height: 100vh; }
    .auth-box { padding: 28px 22px; max-width: 100%; }
    .hero-stats, .hero-stats.four { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .menu-toggle { display: flex; }
    .sidebar-close { display: grid; place-items: center; }

    .sidebar {
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        box-shadow: none;
        width: min(300px, 86vw);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.45);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 14, 0.55);
        backdrop-filter: blur(3px);
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }

    td[style*="white-space:nowrap"] {
        white-space: normal !important;
    }

    td .btn {
        display: inline-flex;
        margin: 3px 2px;
    }

    .main {
        margin-left: 0;
        padding: 0 16px 40px;
        width: 100%;
    }

    .topbar {
        padding: 14px 0 12px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .topbar-hint {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-clock {
        font-size: 0.72rem;
        padding: 7px 8px;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .theme-toggle {
        min-width: auto;
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
    }

    .page-header h2 { font-size: 1.4rem; }
    .page-header .btn { width: 100%; }

    .card { padding: 16px; border-radius: 12px; }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hero-stat { padding: 16px; }
    .hero-stat .value { font-size: 1.45rem; }

    .table-wrap {
        margin: 0 -4px;
        border-radius: 10px;
        -webkit-overflow-scrolling: touch;
    }

    table { min-width: 560px; font-size: 0.82rem; }
    th, td { padding: 10px 12px; }

    .btn-sm { padding: 8px 11px; }
    td .btn { margin: 2px 0; }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filters select,
    .filters .btn { width: 100%; }

    .games-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .games-search {
        max-width: none;
        width: 100%;
        min-width: 0;
    }

    .games-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .games-tab { flex: 1; text-align: center; padding: 10px 8px; }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .game-body { padding: 10px; }
    .game-body .name { font-size: 0.8rem; }
    .games-pager {
        flex-direction: column;
        gap: 10px;
    }
    .games-pager .btn { width: 100%; }

    .modal {
        padding: 22px 18px;
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-actions .btn { width: 100%; }

    .page-loader-box { padding: 28px 24px; min-width: 0; width: min(280px, 86vw); }
    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        text-align: center;
    }

    .key-box { max-width: 110px; }
    .provider-box { padding: 16px; }
}

@media (max-width: 480px) {
    .hero-stats, .hero-stats.four { grid-template-columns: 1fr; }
    .main { padding: 0 12px 32px; }
    .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .topbar-hint { display: none; }
    .user-card { padding: 10px; }
    .brand-text strong { font-size: 0.9rem; }
}


/* ── Sistem Ayarları ── */
.settings-grid {
    display: grid;
    gap: 16px;
    max-width: 860px;
}
.card-desc {
    color: var(--muted);
    font-size: 0.9rem;
    margin: -4px 0 18px;
    line-height: 1.45;
}
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}
.setting-row:first-of-type { border-top: none; padding-top: 0; }
.setting-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.setting-meta strong {
    font-size: 0.95rem;
    font-weight: 600;
}
.setting-meta span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}
.settings-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: var(--surface-hover);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    transition: 0.18s;
}
.switch-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.18s;
}
.switch input:checked + .switch-slider {
    background: var(--accent);
    border-color: var(--accent);
}
.switch input:checked + .switch-slider::before {
    transform: translateX(20px);
}
