:root {
  color-scheme: dark;
  --bg: #0d1011;
  --panel: #15191b;
  --panel-2: #1c2225;
  --line: #293235;
  --text: #f0f2f2;
  --muted: #9aa5a8;
  --accent: #00a98f;
  --danger: #c44545;
  --warn: #d09328;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #07100f;
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101415;
  color: var(--text);
  outline: none;
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 15px;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 22px;
  align-content: center;
  padding: 24px;
}

.brand-block {
  text-align: center;
}

.brand {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 44px;
  letter-spacing: 1px;
}

.brand.small {
  font-size: 30px;
  text-align: left;
}

.subtitle,
.staff-meta,
.muted {
  color: var(--muted);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
}

.error {
  min-height: 20px;
  color: var(--danger);
}

.admin-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #101415;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab,
.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.tab {
  text-align: left;
}

.tab.active,
.ghost:hover,
.tab:hover {
  border-color: var(--accent);
}

.content {
  padding: 24px;
  overflow: auto;
}

.tab-page {
  display: grid;
  gap: 18px;
}

.page-head,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar input {
  max-width: 360px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
}

.list,
.games-list {
  display: grid;
  gap: 10px;
}

.list {
  padding: 12px;
}

.row,
.game-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
}

.row-title {
  font-weight: 800;
}

.row-meta {
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.game-card {
  display: grid;
  grid-template-columns: 150px 130px 1fr 120px auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  color: var(--text);
  text-transform: none;
  font-size: 13px;
}

.toggle input {
  width: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.status-on {
  background: #118a68;
}

.status-off {
  background: #963232;
}

.status-updating {
  background: var(--warn);
}

.update-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  max-width: 680px;
}

.batch-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.batch-grid,
.staff-grid {
  padding: 0;
  border: 0;
  background: transparent;
}

.toolbar select {
  max-width: 170px;
}

.update-editor {
  display: grid;
  grid-template-columns: 110px 140px 1fr auto auto;
  gap: 10px;
  align-items: end;
}

.update-editor textarea {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111617;
  color: var(--text);
  padding: 12px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

@media (max-width: 880px) {
  .admin-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-card,
  .form-grid,
  .row,
  .update-editor {
    grid-template-columns: 1fr;
  }

  .row-actions,
  .page-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}
