/* Administration page: a plain scrolling page (the game page never scrolls on mobile). */

html:has(body.admin), body.admin { position: static; overflow: auto; height: auto; min-height: 100vh; user-select: auto; -webkit-user-select: auto; }
body.admin { background: var(--bg); }

.admin-page {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-head { display: flex; align-items: center; gap: 12px; }
.admin-head > div { flex: 1; min-width: 0; }
.admin-head h1 { margin: 0; font-size: 1.3rem; }

#admin-content { display: flex; flex-direction: column; gap: 16px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats div, .panel {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
}
.stats div { display: flex; flex-direction: column; }
.stats strong { font-size: 1.6rem; line-height: 1.1; }
.stats span { color: var(--muted); font-size: .85rem; }

.panel { display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-size: 1.05rem; flex: 1; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head input[type="search"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  min-width: 0;
}
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; }
.check input { accent-color: var(--accent); }

.announce { flex-direction: row; align-items: flex-end; }
.announce .field { flex: 1; }

.table-wrap { overflow-x: auto; }
.users { width: 100%; border-collapse: collapse; font-size: .9rem; }
.users th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.users td { padding: 10px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); vertical-align: top; }
.users tr.disabled td { opacity: .6; }
.users .name { font-weight: 700; }
.badge { display: inline-block; margin: 2px 4px 0 0; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge.online { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.badge.admin { background: color-mix(in srgb, #8b8bff 25%, transparent); color: #c2c2ff; }
.badge.blocked { background: rgba(255, 122, 138, .16); color: var(--danger); }
.save-line { display: block; white-space: nowrap; }
.save-line a { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: .8rem;
  cursor: pointer;
}
.actions button:hover { border-color: var(--accent); }
.actions button.danger { color: var(--danger); }
.actions button.danger:hover { border-color: var(--danger); }
.actions button:disabled { opacity: .4; cursor: default; border-color: var(--border); }

.password-dialog form { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.password-dialog h2 { margin: 0; font-size: 1.1rem; }
.password { padding: 12px; border-radius: 10px; background: var(--surface); font-size: 1.2rem; text-align: center; user-select: all; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 720px) {
  .announce { flex-direction: column; align-items: stretch; }
  .users thead { display: none; }
  .users, .users tbody, .users tr, .users td { display: block; }
  .users tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .users td { border: 0; padding: 3px 0; }
  .users td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); }
}
