/* TICKSTRIKE admin panel. Hand-written, no framework, no external resource. Dark violet like the game,
   yellow for the main action. Works from a phone (one column) to a desktop browser. */

:root {
    --bg: #17102b;
    --panel: #221a3d;
    --panel-2: #2c2250;
    --line: #43377a;
    --text: #f1edff;
    --muted: #b3a8d9;
    --link: #c9b8ff;
    --yellow: #ffd23f;
    --yellow-text: #2a2100;
    --red: #ff6b6b;
    --red-bg: #4a1c2c;
    --green: #6fe3a1;
    --green-bg: #173d2f;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--link); }
a:hover { color: #fff; }

code {
    font: 0.95em ui-monospace, Consolas, "Courier New", monospace;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

h1 { font-size: 1.6rem; margin: 0.5rem 0 1rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; color: var(--muted); }
p { margin: 0.5rem 0; }

/* ---------- frame ---------- */

.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    padding: 0.6rem 1rem;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; letter-spacing: 0.04em; color: var(--yellow); text-decoration: none; }

.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem; flex: 1; }

.top nav a {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.top nav a:hover { background: var(--panel-2); }
.top nav a.active { background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--yellow); }

.logout { display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.who { color: var(--muted); }

main { max-width: 1100px; margin: 0 auto; padding: 1rem; }

.crumb { margin: 0; }

/* ---------- blocks ---------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin: 0 0 1rem;
}

.narrow { max-width: 30rem; margin-left: auto; margin-right: auto; }

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tile {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    color: var(--text);
    text-decoration: none;
}

.tile:hover { border-color: var(--yellow); }
.tile .value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.tile .label { color: var(--muted); }

dl { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: 0.35rem 1rem; margin: 0.5rem 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

ul { margin: 0.5rem 0; padding-left: 1.2rem; }
ul.ids { list-style: none; padding-left: 0; }
ul.ids li { padding: 0.2rem 0; overflow-wrap: anywhere; }

.hint { color: var(--muted); font-size: 0.9rem; }
.warn { color: var(--yellow); }
.empty { color: var(--muted); text-align: center; padding: 1.5rem; }

.notice, .error {
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin: 0.75rem 0;
}

.notice { background: var(--green-bg); border: 1px solid var(--green); }
.error { background: var(--red-bg); border: 1px solid var(--red); }

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    vertical-align: middle;
}

.badge.banned { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.badge.ok { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }

/* ---------- tables ---------- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    margin-bottom: 1rem;
}

table { width: 100%; border-collapse: collapse; }

th, td {
    text-align: left;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th { background: var(--panel-2); white-space: nowrap; font-weight: 600; }
th a { color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
.num { text-align: right; }
td { overflow-wrap: anywhere; }
/* Short cells stay on one line; on a phone the table scrolls sideways instead of growing tall. */
table.compact td, td.when { white-space: nowrap; overflow-wrap: normal; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; }

/* ---------- forms ---------- */

label { display: block; margin: 0.9rem 0 0.3rem; }

input[type="text"], input[type="password"], input[type="search"], input[type="date"] {
    width: 100%;
    padding: 0.6rem 0.7rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
}

input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0.75rem 0; padding: 0.5rem 0.9rem 0.8rem; }
legend { color: var(--muted); padding: 0 0.4rem; }

label.check { display: flex; align-items: center; gap: 0.5rem; margin: 0.45rem 0; }
label.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--yellow); }

button, a.button {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    font: inherit;
    font-weight: 600;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}

button:hover, a.button:hover { border-color: var(--yellow); color: #fff; }
button.primary { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-text); }
button.primary:hover { filter: brightness(1.08); color: var(--yellow-text); }
button.danger { background: var(--red); border-color: var(--red); color: #2b0508; }
button.danger:hover { filter: brightness(1.08); color: #2b0508; }

.narrow form button.primary { width: 100%; margin-top: 1.1rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.search { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.search input[type="search"] { flex: 1 1 14rem; width: auto; }
.search label.check { margin: 0; }

@media (max-width: 600px) {
    main { padding: 0.75rem; }
    h1 { font-size: 1.35rem; }
    dl { grid-template-columns: 1fr; gap: 0 0; }
    dd { margin-bottom: 0.5rem; }
    th, td { padding: 0.5rem 0.6rem; }
    .top nav { order: 3; flex-basis: 100%; }
    .logout { margin-left: auto; }
}
