:root {
    --bg: #0e3a5c;
    --bg2: #1b6aa5;
    --card: #ffffff;
    --text: #1d2b36;
    --muted: #6b7c8a;
    --green: #3fa535;
    --green-dark: #2d7d26;
    --border: #d4dde4;
    --error-bg: #fde8e8;
    --error: #b42318;
    --ok-bg: #e5f6e1;
    --ok: #2d7d26;
}

@media (prefers-color-scheme: dark) {
    :root {
        --card: #1c2733;
        --text: #e6edf3;
        --muted: #93a4b3;
        --border: #314253;
        --error-bg: #3d1d1d;
        --error: #ff9b91;
        --ok-bg: #1c3a1c;
        --ok: #8fd987;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Ubuntu, "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg2), var(--bg)) fixed;
}

.top {
    padding: 18px 16px;
    text-align: center;
}

.logo {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #0a2a43, 0 0 18px rgba(255, 255, 255, .25);
}

main {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 32px;
}

.card {
    background: var(--card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, .2);
}

.card.narrow { max-width: 420px; margin: 0 auto; }

h1 { margin: 0 0 6px; font-size: 24px; }

.muted { color: var(--muted); font-size: 14px; }

a { color: var(--bg2); }

form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }

input:not([type=radio]) {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: transparent;
    color: var(--text);
}

input:focus { outline: none; border-color: var(--bg2); }

.gender { display: flex; gap: 20px; }
.gender label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }

.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.btn.green { background: var(--green); box-shadow: 0 4px 0 var(--green-dark); }
.btn.green:hover { filter: brightness(1.08); }
.btn.green:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-dark); }
.btn.big { font-size: 20px; padding: 16px 28px; margin: 12px 0; }

.error, .success { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.error { background: var(--error-bg); color: var(--error); }
.success { background: var(--ok-bg); color: var(--ok); }

.me { display: flex; gap: 24px; align-items: center; }
.avatar { width: 128px; image-rendering: pixelated; flex-shrink: 0; }
.motto { font-style: italic; color: var(--muted); margin: 0 0 8px; }
.rank { display: inline-block; background: #f5a623; color: #3b2600; font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 99px; margin: 0 0 8px; }

.wallet { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 600; }
.wallet li { display: flex; align-items: center; gap: 6px; }
.coin { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.coin.credits { background: #f5c518; }
.coin.duckets { background: #c46ee0; }
.coin.diamonds { background: #4fc3f7; transform: rotate(45deg); border-radius: 2px; }

footer { text-align: center; color: rgba(255, 255, 255, .7); font-size: 13px; padding: 16px; }

@media (max-width: 560px) {
    .me { flex-direction: column; text-align: center; }
    .wallet { justify-content: center; }
}

/* --- Admin --- */
main:has(.admin-grid), main:has(table.users) { max-width: 1000px; }
h2 { margin: 0 0 8px; font-size: 18px; }
.spaced { margin-top: 16px; }
.back { color: #fff; font-weight: 600; text-decoration: none; }
.admin-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
form.inline { flex-direction: row; gap: 8px; }
form.inline input { flex: 1; }
select { padding: 10px 12px; border: 2px solid var(--border); border-radius: 8px; font: inherit; background: var(--card); color: var(--text); }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--border); }
table.users td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.users a { font-weight: 700; text-decoration: none; }
img.head { width: 33px; height: 33px; object-fit: cover; object-position: top; image-rendering: pixelated; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-left: 4px; vertical-align: middle; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.admin-grid .card form { margin: 8px 0; }
.quick { display: flex; gap: 6px; }
.quick button { flex: 1; padding: 6px; border: 2px solid var(--border); border-radius: 6px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.btn.red { background: #c0392b; box-shadow: 0 4px 0 #8e2a20; }
.btn.grey { background: #6b7c8a; box-shadow: 0 4px 0 #4a5862; }
.log { list-style: none; padding: 0; margin: 0; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.admin-link { display: inline-block; margin-left: 8px; }
@media (max-width: 640px) { table.users th:nth-child(5), table.users td:nth-child(5), table.users th:nth-child(6), table.users td:nth-child(6) { display: none; } }
