:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #2b2622;
  --muted: #8a8178;
  --accent: #c8541f;
  --accent-dark: #a8430f;
  --line: #e7e0d6;
  --ok: #2e7d32;
  --pending: #b8860b;
  --danger: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--accent);
  color: #fff;
}
.topbar .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar nav a { color: #fff; text-decoration: none; opacity: .92; }
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

.container { max-width: 820px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

h1 { margin-top: .25rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { background: #fdecea; color: var(--danger); padding: .6rem .8rem; border-radius: 8px; }
.info { background: #eaf5ea; color: var(--ok); padding: .6rem .8rem; border-radius: 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.form { display: flex; flex-direction: column; gap: .75rem; max-width: 460px; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .92rem; }
.form label.checkbox { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
input, select, textarea {
  font: inherit;
  padding: .55rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .55rem .9rem;
}
button:hover { background: var(--accent-dark); }
button.danger { background: var(--danger); }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; padding: .5rem .9rem; border-radius: 8px; font-weight: 600; }

.inline { display: inline; }
.inline.logout button.linkbtn { background: transparent; color: #fff; padding: 0; text-decoration: underline; }

.login-wrap { max-width: 420px; margin: 2rem auto; }

/* Leaderboard */
.board { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.board th, .board td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
.board th { background: #faf6f0; }
.board .rank-cell { width: 3ch; font-weight: 700; }
.board .points-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.board .title-cell { color: var(--accent-dark); }
.board tr.me { background: #fff5ee; }

/* Feed */
.feed-head { display: flex; align-items: center; justify-content: space-between; }
.feed { display: grid; gap: 1rem; }
.feeditem img { width: 100%; max-height: 460px; object-fit: cover; border-radius: 8px; display: block; }
.feeditem .meta { margin-top: .6rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.feeditem .caption { margin: .4rem 0 0; }
.feeditem .actions { margin-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.voted { color: var(--ok); font-weight: 600; }

.badge { font-size: .78rem; padding: .12rem .5rem; border-radius: 999px; font-weight: 700; }
.badge.approved { background: #eaf5ea; color: var(--ok); }
.badge.pending { background: #fbf3df; color: var(--pending); }

/* Abstimm-Sektion auf der Startseite */
.vote-now { margin-bottom: 1.75rem; }
.vote-now h2 { margin-top: 0; }

/* Swipe-Deck */
.swipe-deck { position: relative; }
.swipe-card {
  display: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  touch-action: pan-y;
  user-select: none;
}
.swipe-card.active { display: block; }
.swipe-card img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  pointer-events: none;
}
.swipe-card .swipe-meta { margin-top: .6rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.swipe-controls { display: flex; gap: 1rem; justify-content: center; margin-top: .9rem; }
.swipe-controls button { min-width: 150px; font-size: 1.05rem; }
.swipe-yes { background: var(--ok); }
.swipe-yes:hover { background: #256528; }
.swipe-reject { background: var(--danger); }
.swipe-reject:hover { background: #9c2c20; }
button.reject { background: var(--danger); }
button.reject:hover { background: #9c2c20; }
.swipe-done { text-align: center; padding: 1.5rem; font-weight: 700; }
.swipe-hint { text-align: center; margin-top: .5rem; }

/* Mitglieder-Links */
.memberlink { color: var(--accent-dark); text-decoration: none; }
.memberlink:hover { text-decoration: underline; }
.board .memberlink { color: inherit; font-weight: 600; }
.feeditem img { cursor: zoom-in; }

/* Kommentare */
.comments { margin-top: .75rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.comment { margin: .25rem 0; }
.comment-form { display: flex; gap: .4rem; margin-top: .5rem; }
.comment-form input[name="body"] { flex: 1; }
button.small { padding: .3rem .55rem; font-size: .85rem; }

/* Admin */
.admin-actions { display: flex; flex-direction: column; gap: .4rem; }
.admin-actions form { display: flex; gap: .3rem; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pending-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
