/* Pepper Testportal – ein Stylesheet für alle Seiten. Dunkel als Standard (passt zum Logo), hell nach Systemeinstellung. */
:root {
  --bg: #0b0c10;
  --surface: #14161d;
  --surface-2: #1b1e27;
  --border: #2a2e3a;
  --text: #eceef3;
  --muted: #9aa0ae;
  --brand: #e5484d;
  --brand-2: #ff8a3d;
  --brand-text: #fff;
  --ok: #30a46c;
  --ok-bg: rgba(48, 164, 108, 0.16);
  --bad: #e5484d;
  --bad-bg: rgba(229, 72, 77, 0.16);
  --skip: #8b8d98;
  --skip-bg: rgba(139, 141, 152, 0.18);
  --warn-bg: rgba(255, 138, 61, 0.14);
  --focus: #ffb36b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-2: #f0f1f4;
    --border: #dcdfe6;
    --text: #15171c;
    --muted: #5d6270;
    --ok-bg: rgba(48, 164, 108, 0.12);
    --bad-bg: rgba(229, 72, 77, 0.1);
    --skip-bg: rgba(139, 141, 152, 0.14);
    --warn-bg: rgba(255, 138, 61, 0.14);
    --focus: #c2410c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.06);
    color-scheme: light;
  }
}

* {
  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,
    Inter,
    sans-serif;
  overflow-wrap: anywhere;
}
a {
  color: var(--brand-2);
}
img,
video {
  max-width: 100%;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
h1 {
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0.4em 0;
}
h2 {
  font-size: 1.2rem;
  margin: 0 0 0.4em;
}
h2.sub {
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
h3 {
  font-size: 1.05rem;
  margin: 0;
}
p {
  margin: 0.5em 0;
}
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 0.3em;
  font-size: 0.92em;
}
blockquote {
  margin: 0.5em 0;
  padding-left: 0.8em;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
ul,
ol {
  margin: 0.4em 0;
  padding-left: 1.3em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.hidden {
  display: none !important;
}

/* ---------- Kopfzeile */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.brand img {
  border-radius: 10px;
}
.top nav {
  display: flex;
  align-items: center;
  gap: 4px 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.9rem;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 4px;
}
.nav-link:hover {
  color: var(--text);
}
.me {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.me img {
  border-radius: 50%;
}
.logout {
  display: inline;
  margin: 0;
}
.btn-link {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 8px 4px;
}
.btn-link:hover {
  color: var(--text);
  text-decoration: underline;
}
@media (max-width: 560px) {
  .brand span,
  .me span:not(.tag) {
    display: none;
  }
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px max(14px, env(safe-area-inset-left)) 120px;
}

/* ---------- Bausteine */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 12px 0;
}
.hero {
  text-align: center;
  max-width: 560px;
  margin: 8vh auto 0;
  padding: 28px 22px;
}
.hero-logo {
  border-radius: 22px;
}
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--brand-2);
}
.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  margin-left: auto;
}
.pill-submitted,
.pill-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.pill-blocked,
.pill-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.pill-skip {
  background: var(--skip-bg);
  color: var(--skip);
}
.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.alert-bad {
  background: var(--bad-bg);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
}
.alert-ok {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
}
.alert-warn {
  background: var(--warn-bg);
  border-color: color-mix(in srgb, var(--brand-2) 45%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--muted);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: var(--brand-text);
}
.btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn-discord {
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
  margin: 12px 0;
  padding: 12px 22px;
  font-size: 1.05rem;
}
.btn-small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.9rem;
}

progress.bar {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
progress.bar::-webkit-progress-bar {
  background: var(--surface-2);
  border-radius: 999px;
}
progress.bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
}
progress.bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
}

/* ---------- Startseite */
.plans {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plan-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.plan-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ---------- Bericht */
.run-head {
  position: sticky;
  top: 53px;
  z-index: 10;
  background: var(--bg);
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
@media (max-width: 560px), (max-height: 600px) {
  /* am Handy nicht festhalten – sonst bleibt zu wenig Platz für die Punkte */
  .run-head {
    position: static;
  }
}
.run-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.run-title h1 {
  font-size: 1.3rem;
  margin: 0;
}
.run-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.run-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.save-state {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.3em;
}
.save-state.bad {
  color: var(--bad);
}

details.intro > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 4px 0;
}
.stage {
  padding: 0;
  overflow: hidden;
}
.stage > header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.stage-no {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stage-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stage-text {
  padding: 4px 16px 0;
}
.stage-text .hint {
  color: var(--muted);
}
.items {
  list-style: none;
  margin: 0;
  padding: 8px 10px 10px;
}
.item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  background: var(--surface);
  scroll-margin-top: 140px;
}
.item.st-ok {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--border));
}
.item.st-bad {
  border-color: color-mix(in srgb, var(--bad) 65%, var(--border));
  background: color-mix(in srgb, var(--bad-bg) 40%, var(--surface));
}
.item.st-skip {
  border-color: color-mix(in srgb, var(--skip) 50%, var(--border));
}
.item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.item-nr {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.neu {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-2);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 6px;
  text-transform: uppercase;
}
.item dl {
  margin: 0;
  display: grid;
  gap: 4px;
}
.item dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 4px;
}
.item dd {
  margin: 0;
}
.item dd.tun {
  font-weight: 600;
}
.choice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.choice button {
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
}
.choice button[aria-pressed="true"].c-ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.choice button[aria-pressed="true"].c-bad {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.choice button[aria-pressed="true"].c-skip {
  background: var(--skip);
  border-color: var(--skip);
  color: #fff;
}
.choice button:disabled {
  cursor: default;
  opacity: 0.7;
}
.detail {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.detail label {
  font-size: 0.85rem;
  font-weight: 600;
}
textarea,
input[type="text"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
textarea {
  min-height: 84px;
  resize: vertical;
}
textarea.console {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  min-height: 64px;
}

.files {
  display: grid;
  gap: 8px;
}
.drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.drop.over {
  border-color: var(--brand-2);
  background: var(--warn-bg);
}
.drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.thumbs li {
  position: relative;
  width: 96px;
}
.thumbs a {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.thumbs img,
.thumbs video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumbs .rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}
.thumbs .up {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 4px;
}

.stage-foot {
  padding: 0 16px 14px;
}
.issues {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.issues li {
  border-left: 3px solid var(--brand-2);
  padding: 4px 10px;
  margin: 6px 0;
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}
.issues li.blocker {
  border-left-color: var(--bad);
}
.issues li.done {
  opacity: 0.65;
}
.issues pre {
  white-space: pre-wrap;
  font-size: 0.82rem;
  margin: 4px 0;
}

.blocked-box {
  border: 2px solid var(--bad);
}
.submit-box {
  text-align: center;
}

dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
dialog form {
  padding: 18px;
  display: grid;
  gap: 10px;
}
dialog h2 {
  margin: 0;
}
.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 24px);
}
.toast.bad {
  border-color: var(--bad);
}

/* ---------- Admin */
.admin-grid {
  display: grid;
  gap: 12px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr.hl td {
  background: var(--warn-bg);
}
.plan-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.plan-list a {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.plan-list a[aria-current="true"] {
  border-color: var(--brand);
}
.finding {
  border-left: 3px solid var(--bad);
  padding: 6px 10px;
  margin: 8px 0;
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.gallery figure {
  margin: 0;
}
.gallery a {
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.gallery img,
.gallery video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery figcaption {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}
