:root {
  --bg: #0b0b0d;
  --panel: #151519;
  --panel-2: #1d1d23;
  --line: #2a2a32;
  --text: #f2f2f4;
  --muted: #9a9aa6;
  --accent: #e01b2b;
  --accent-2: #7a0d17;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Jost", "Futura", "Century Gothic", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #000 0%, #121216 100%);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 16px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  font-weight: 700;
  font-size: 22px;
}

.topbar h1 { margin: 0; font-size: 22px; letter-spacing: .04em; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* --- gg36 Branding --- */
.gg36 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .02em;
}
.gg36 img { display: block; width: auto; }
.gg36:hover img { filter: brightness(1.12); }
.gg36.small { font-size: 12px; }

main { flex: 1; padding: 24px 28px 40px; max-width: 1400px; width: 100%; margin: 0 auto; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 320px; flex: 1; }
.field label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

select {
  appearance: none;
  background: var(--panel-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa6' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center/18px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 40px 11px 14px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.actions { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 14px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #3d3d48; background: #24242b; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #f02233; border-color: #f02233; }

.status { color: var(--muted); font-size: 14px; margin: 18px 2px 6px; }
.status.error { color: #ff7b86; }
.status .badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: #22301f; color: #8fd694; font-size: 12px; border: 1px solid #2f4a2c;
}
.status .badge.live { background: #33231f; color: #ffa39c; border-color: #5a2f28; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card.edited { border-color: var(--accent-2); box-shadow: 0 0 0 1px rgba(224, 27, 43, .25); }
.card img { display: block; width: 100%; height: auto; background: #000; }
.card .meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line);
}
.card .meta-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta strong { color: var(--text); font-weight: 500; }
.card a.dl { color: #cfd0d8; text-decoration: none; border-bottom: 1px solid #3a3a45; white-space: nowrap; }
.card a.dl:hover { color: #fff; border-color: var(--accent); }

/* --- Editierfelder --- */
.fields { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.field-inline { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.field-inline:first-child { flex: 0 0 64px; }
.field-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
}
.field-input {
  width: 100%;
  background: #0e0e12;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 7px 9px;
}
.field-input:focus { outline: none; border-color: var(--accent); background: #121216; }

.reset {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.reset:hover:not(:disabled) { color: var(--text); border-color: var(--line); }
.reset:disabled { opacity: .25; cursor: default; }

.card.trainer { border-color: var(--accent-2); }

footer { border-top: 1px solid var(--line); padding: 16px 28px; color: var(--muted); font-size: 12px; }
footer a { color: #cfd0d8; }
footer code { color: #cfd0d8; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-row p { margin: 0; }

.spinner {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid #444; border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
