:root {
    --accent: #00C853;
    --accent-2: #0eeb6f;
    --danger: #ee4848;
    --bg: #080a0f;
    --bg-2: #0c0e15;
    --card: rgba(15, 17, 25, .88);
    --card-2: rgba(20, 23, 33, .92);
    --border: rgba(84, 98, 116, .32);
    --text: #ecf1f7;
    --muted: #8a94a4;
    --soft: rgba(0, 200, 83, .14);
    --shadow: 0 26px 80px rgba(0, 0, 0, .42);
    --radius: 24px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    overflow-x: hidden;
}

.bg-layer {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(110deg, rgba(8, 10, 15, .94), rgba(8, 10, 15, .88)),
        radial-gradient(circle at 20% 15%, rgba(0, 200, 83, .16), transparent 28%),
        radial-gradient(circle at 85% 70%, rgba(0, 200, 83, .10), transparent 26%),
        url('../img/bg.png') center/cover no-repeat;
    z-index: -3;
}

.grid-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .28;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at 50% 30%, black, transparent 70%);
    z-index: -2;
}

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

.center-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 20px;
    background: linear-gradient(180deg, rgba(12, 14, 21, .96), rgba(8, 10, 15, .92));
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand img { width: 154px; height: auto; display: block; }
.brand span { color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.nav { display: grid; gap: 8px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    color: var(--muted);
    font-weight: 750;
    border: 1px solid transparent;
    border-radius: 16px;
    transition: .22s ease;
}
.nav-link span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--accent);
    border-radius: 10px;
    background: rgba(0, 200, 83, .10);
}
.nav-link:hover, .nav-link.active {
    color: var(--text);
    border-color: rgba(0, 200, 83, .26);
    background: linear-gradient(135deg, rgba(0, 200, 83, .16), rgba(20, 23, 33, .74));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 30px rgba(0, 200, 83, .06);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .035);
}
.sidebar-footer strong { display: block; max-width: 178px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer small { display: block; margin-top: 3px; color: var(--muted); }
.online-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 8px rgba(0, 200, 83, .10), 0 0 22px rgba(0, 200, 83, .7);
}

.main {
    padding: 34px;
    min-width: 0;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}
.topbar h1, .auth-card h1 { margin: 4px 0 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.04em; }
.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.muted { color: var(--muted); line-height: 1.65; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 15px;
    border-radius: 999px;
    color: #dfffee;
    background: rgba(0, 200, 83, .11);
    border: 1px solid rgba(0, 200, 83, .22);
    font-weight: 800;
}
.status-pill i { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 16px rgba(0,200,83,.9); }

.panel-card,
.stat-card {
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--card), rgba(12, 14, 21, .84));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.auth-card {
    width: min(510px, 100%);
    padding: 34px;
    position: relative;
    overflow: hidden;
}
.auth-card::before,
.panel-card::before,
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.10), transparent 34%, rgba(0, 200, 83, .06));
    opacity: .8;
}
.auth-card > *, .panel-card > *, .stat-card > * { position: relative; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-logo img { width: 230px; max-width: 76%; filter: drop-shadow(0 0 22px rgba(0, 200, 83, .20)); }

.auth-form { display: grid; gap: 15px; margin-top: 24px; }
label span { display: block; margin-bottom: 8px; color: #c7d0dc; font-size: 13px; font-weight: 800; }
input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    color: var(--text);
    outline: none;
    border: 1px solid rgba(84, 98, 116, .42);
    border-radius: 16px;
    background: rgba(8, 10, 15, .74);
    font: inherit;
    transition: .2s ease;
}
input::placeholder { color: #596575; }
input:focus {
    border-color: rgba(0, 200, 83, .78);
    box-shadow: 0 0 0 4px rgba(0, 200, 83, .09), 0 0 30px rgba(0, 200, 83, .08);
}
.primary-button,
.primary-link,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.primary-button,
.primary-link {
    color: #041109;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 16px 34px rgba(0, 200, 83, .22);
}
.primary-button { width: 100%; margin-top: 6px; font-size: 15px; }
.primary-button:hover,
.primary-link:hover,
.ghost-button:hover { transform: translateY(-1px); }
.primary-button:hover,
.primary-link:hover { box-shadow: 0 20px 42px rgba(0, 200, 83, .31); }
.ghost-button {
    color: #d7dfeb;
    border: 1px solid rgba(84, 98, 116, .42);
    background: rgba(255, 255, 255, .035);
}
.ghost-button:hover { border-color: rgba(0, 200, 83, .42); background: rgba(0, 200, 83, .08); }

.hint-box {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding: 14px;
    border-radius: 16px;
    color: #b8c2d0;
    background: rgba(0, 200, 83, .07);
    border: 1px solid rgba(0, 200, 83, .16);
}
.hint-box p { margin: 0; font-size: 13px; line-height: 1.55; }
.hint-box span { color: var(--accent); }

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .045);
    color: #e8eef5;
}
.alert.error { border-color: rgba(238, 72, 72, .32); background: rgba(238, 72, 72, .10); }
.alert.success { border-color: rgba(0, 200, 83, .32); background: rgba(0, 200, 83, .10); }
.floating-alert { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); z-index: 5; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    min-height: 136px;
}
.stat-card p { margin: 16px 0 6px; color: var(--muted); font-weight: 750; }
.stat-card strong { font-size: 32px; letter-spacing: -.04em; }
.stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--accent);
    background: rgba(0, 200, 83, .11);
    box-shadow: inset 0 0 0 1px rgba(0, 200, 83, .18);
}

.panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
    gap: 18px;
    margin-bottom: 18px;
}
.panel-card { position: relative; overflow: hidden; padding: 24px; }
.panel-card h2 { margin: 8px 0 8px; font-size: 25px; letter-spacing: -.03em; }
.actions-row { display: flex; gap: 10px; margin-top: 20px; }
.mini-profile h2 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.section-head h2 { margin: 4px 0 0; }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid rgba(84, 98, 116, .22); }
.players-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    background: rgba(8, 10, 15, .48);
}
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .055); }
th {
    color: #9da8b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .10em;
    background: rgba(255, 255, 255, .035);
}
td { color: #dce5ef; font-weight: 650; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: rgba(0, 200, 83, .055); }
.player-name { display: flex; align-items: center; gap: 10px; }
.avatar-dot {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #021006;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-size: 12px;
    font-weight: 950;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #ccffe0;
    background: rgba(0, 200, 83, .10);
    border: 1px solid rgba(0, 200, 83, .19);
    font-size: 12px;
    font-weight: 900;
}
.badge.gray { color: #cbd5e1; background: rgba(148, 163, 184, .10); border-color: rgba(148, 163, 184, .18); }
.badge.gold { color: #ffe8aa; background: rgba(245, 190, 67, .10); border-color: rgba(245, 190, 67, .24); }
.badge.diamond { color: #cceaff; background: rgba(72, 178, 255, .10); border-color: rgba(72, 178, 255, .24); }
.badge.danger { color: #ffb5b5; background: rgba(238, 72, 72, .10); border-color: rgba(238, 72, 72, .24); }
.loading-row, .empty-row { text-align: center; color: var(--muted); padding: 26px; }
.table-foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.mini-list { display: grid; gap: 10px; }
.mini-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid rgba(84, 98, 116, .22);
    background: rgba(255, 255, 255, .035);
}
.mini-player strong { display: block; }
.mini-player small { color: var(--muted); }

.reveal-up { animation: revealUp .46s ease both; }
.delay-1 { animation-delay: .06s; }
.delay-2 { animation-delay: .12s; }
@keyframes revealUp {
    from { opacity: 0; transform: translateY(16px) scale(.985); filter: blur(8px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; padding: 18px; }
    .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar-footer { display: none; }
    .brand { justify-content: space-between; }
    .main { padding: 22px; }
    .stats-grid, .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .center-shell { padding: 16px; }
    .auth-card { padding: 24px; }
    .topbar, .section-head { align-items: flex-start; flex-direction: column; }
    .top-actions { width: 100%; }
    .ghost-button { width: 100%; }
    .nav { grid-template-columns: 1fr; }
    .brand { flex-direction: column; align-items: flex-start; }
    .brand img { width: 138px; }
    .table-foot { flex-direction: column; }
}

/* Web ACP v0.3.7 - kary czasowe z wyborem jednostki + blokada niezalogowanych */
select,
textarea {
    width: 100%;
    padding: 0 16px;
    color: var(--text);
    outline: none;
    border: 1px solid rgba(84, 98, 116, .42);
    border-radius: 16px;
    background: rgba(8, 10, 15, .74);
    font: inherit;
    transition: .2s ease;
}
select { height: 54px; }
textarea {
    min-height: 120px;
    padding-top: 14px;
    resize: vertical;
}
select:focus,
textarea:focus {
    border-color: rgba(0, 200, 83, .78);
    box-shadow: 0 0 0 4px rgba(0, 200, 83, .09), 0 0 30px rgba(0, 200, 83, .08);
}
textarea::placeholder { color: #596575; }
.primary-button.fit { width: auto; margin-top: 0; }
.table-action {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 200, 83, .24);
    color: #dfffee;
    background: rgba(0, 200, 83, .10);
    font-weight: 900;
    cursor: pointer;
    transition: .18s ease;
    white-space: nowrap;
}
.table-action:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 200, 83, .52);
    background: rgba(0, 200, 83, .16);
}

.table-action:disabled,
.table-action.disabled {
    cursor: not-allowed;
    color: #8692a4;
    border-color: rgba(84, 98, 116, .28);
    background: rgba(255, 255, 255, .035);
    transform: none;
    opacity: .72;
}
.table-action:disabled:hover,
.table-action.disabled:hover {
    transform: none;
    border-color: rgba(84, 98, 116, .28);
    background: rgba(255, 255, 255, .035);
}
.punishment-modal[hidden] { display: none; }
.punishment-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 50;
}
.punishment-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(10px);
}
.punishment-card {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(84, 98, 116, .34);
    background: linear-gradient(145deg, rgba(15, 17, 25, .98), rgba(10, 12, 18, .96));
    box-shadow: 0 34px 110px rgba(0, 0, 0, .62);
    animation: revealUp .24s ease both;
}
.section-head.compact { margin-bottom: 14px; }
.small { font-size: 13px; margin: 6px 0 0; }
.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    border: 1px solid rgba(84, 98, 116, .42);
    color: var(--text);
    background: rgba(255, 255, 255, .04);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.icon-button:hover {
    border-color: rgba(238, 72, 72, .42);
    background: rgba(238, 72, 72, .10);
}
.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(160px, .9fr) minmax(0, .7fr);
    gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.hint-box.compact { margin-top: 14px; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}
.form-message {
    min-height: 22px;
    margin-top: 12px;
    color: var(--muted);
    font-weight: 800;
}
.form-message.success { color: #baffd5; }
.form-message.error { color: #ffb5b5; }
body.modal-open { overflow: hidden; }

@media (max-width: 760px) {
    .form-grid { grid-template-columns: 1fr; }
    .modal-actions { flex-direction: column; }
    .primary-button.fit { width: 100%; }
}

/* Web ACP v0.3.7 - osobna zakładka kar offline + blokada offline dla graczy online */
.punishment-tools {
    margin-top: 18px;
    align-items: stretch;
}
.uid-punish-row,
.search-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 16px;
}

.search-card.wide {
    grid-template-columns: minmax(0, 1fr) 160px;
    max-width: 920px;
}
.search-result-row.is-online {
    border-color: rgba(0, 200, 83, .22);
    background: linear-gradient(135deg, rgba(0, 200, 83, .065), rgba(255, 255, 255, .028));
}
.search-result-row.no-serial {
    border-color: rgba(238, 72, 72, .18);
    background: linear-gradient(135deg, rgba(238, 72, 72, .055), rgba(255, 255, 255, .028));
}

.search-results {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.search-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid rgba(84, 98, 116, .22);
    background: rgba(255, 255, 255, .035);
}
.search-result-row strong { display: block; }
.search-result-row small { color: var(--muted); }
.search-result-row .serial-line { display: block; margin-top: 2px; color: #97a6b8; }
.search-result-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.compact-row {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(84, 98, 116, .22);
    background: rgba(255, 255, 255, .035);
}
.compact-row.error { color: #ffb5b5; border-color: rgba(238, 72, 72, .28); background: rgba(238, 72, 72, .08); }
@media (max-width: 760px) {
    .uid-punish-row,
    .search-card,
    .search-result-row {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }
    .uid-punish-row .primary-button.fit,
    .search-card .ghost-button,
    .search-result-actions .table-action {
        width: 100%;
    }
    .search-result-actions {
        justify-content: stretch;
    }
}

/* Web ACP v0.3.14 - lista administracji */
.admins-table { min-width: 1260px; }
.admins-table-wrap { margin-top: 16px; }
.rank-pill {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 11px;
    border-radius: 999px;
    color: #dfffee;
    background: rgba(0, 200, 83, .10);
    border: 1px solid rgba(0, 200, 83, .20);
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}
.mini-badge { margin-left: 8px; }
.permission-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 380px;
    max-width: 620px;
}
.admin-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    min-width: 260px;
}
.danger-action {
    color: #ffd4d4;
    border-color: rgba(238, 72, 72, .26);
    background: rgba(238, 72, 72, .10);
}
.danger-action:hover {
    border-color: rgba(238, 72, 72, .45);
    background: rgba(238, 72, 72, .16);
}
.protected-admin {
    background: linear-gradient(90deg, rgba(238, 72, 72, .035), transparent);
}
.serial-line {
    color: #9fb0c4;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}
.admin-edit-card { width: min(920px, 100%); }
.admin-form-grid { grid-template-columns: minmax(0, 1.2fr) minmax(160px, .8fr); }
.permissions-editor > span {
    display: block;
    margin-bottom: 10px;
    color: #c7d0dc;
    font-size: 13px;
    font-weight: 900;
}
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.permission-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 68px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(84, 98, 116, .28);
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
}
.permission-toggle input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 2px 0 0;
    accent-color: var(--accent);
}
.permission-toggle strong {
    display: block;
    color: #eef4fb;
    font-size: 13px;
    line-height: 1.2;
}
.permission-toggle small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}
@media (max-width: 760px) {
    .admin-form-grid,
    .permissions-grid { grid-template-columns: 1fr; }
    .admin-actions { min-width: 0; }
    .admin-actions .table-action { width: 100%; }
}

/* Web ACP v0.3.14 - administracja */
.compact-actions {
    margin-top: 0;
    align-items: center;
    flex-wrap: wrap;
}

/* Web ACP v0.3.14 - avatary Discord w liście administracji */
.avatar-dot.has-image {
    overflow: hidden;
    padding: 0;
    background: rgba(255, 255, 255, .06);
    font-size: 0;
}
.avatar-dot.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.player-name strong { display: block; }
.player-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 800; }

.profile-name-row { margin-bottom: 14px; align-items: center; }
