:root {
  --bg: #f3f1ea;
  --surface: #ffffff;
  --text: #1f2a24;
  --muted: #6b7a70;
  --line: #dcd8cc;
  --accent: #e8743b;
  --accent-dark: #c85a24;
  --green: #1d3a2a;
  --ok: #2f8f5b;
  --bad: #c43d3d;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121714;
    --surface: #1b231e;
    --text: #e8ece9;
    --muted: #93a39a;
    --line: #2d3832;
    --green: #0d1a13;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
[hidden] { display: none !important; }
h1, h2 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.topbar {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 14px; background: var(--green); color: #fff;
}


.view { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 9px 16px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: default; }

/* Auth */
.auth { max-width: 420px; margin: 40px auto; }
.tabs { display: flex; gap: 4px; margin: 18px 0; background: var(--bg); padding: 4px; border-radius: 10px; }
.tab { flex: 1; font: inherit; border: 0; background: transparent; padding: 8px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
form input {
  display: block; width: 100%; margin-top: 6px; font: inherit; padding: 10px 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.auth form .btn { width: 100%; }
.error { color: var(--bad); min-height: 1.2em; font-size: 14px; margin: 0 0 10px; }

/* Lobby */
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .lobby { grid-template-columns: minmax(0, 1fr); } }
.stands { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 14px; margin-top: 14px; }
.stand {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; transition: transform .1s, border-color .1s;
}
.stand:hover { border-color: var(--accent); transform: translateY(-2px); }
.stand-top { display: flex; justify-content: space-between; align-items: center; }
.stand-nr { font-size: 12px; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .6px; }
.level { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-weight: 600; }
.stand h3 { margin: 0; font-size: 17px; }
.stand p { margin: 0; font-size: 14px; color: var(--muted); flex: 1; }
.stand .best { font-size: 13px; border-top: 1px solid var(--line); padding-top: 8px; }

.board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.board-head h2 { margin: 0; }
select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.board { width: 100%; border-collapse: collapse; font-size: 14px; }
.board th, .board td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.board th { font-size: 12px; color: var(--muted); font-weight: 600; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board tr.me td { color: var(--accent-dark); font-weight: 700; }
.history { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.history li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.history li span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }

/* Spiel */
#view-game { max-width: 1320px; }
.game-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.game-title { font-weight: 700; font-size: 18px; text-align: center; }
.game-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
#canvas { display: block; width: 100%; height: auto; cursor: none; touch-action: none; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); padding: 16px; }
.result { width: min(440px, 100%); text-align: center; margin: 0; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.result-stats span { display: block; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-stats small { color: var(--muted); }
.row { display: flex; gap: 10px; justify-content: center; }

@media (max-width: 600px) {
  .game-bar .btn { padding: 7px 10px; font-size: 13px; }
  .game-title { font-size: 15px; }
}

/* ---------- Navigation ---------- */

.mainnav a {
  color: rgba(255,255,255,.75); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 7px 14px; border-radius: 8px;
}
.mainnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.mainnav a.active { color: #fff; background: rgba(255,255,255,.16); }
.view.wide { max-width: 1400px; }
.small { font-size: 13px; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-dark); font-weight: 700; cursor: pointer; }
.link:hover { text-decoration: underline; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.row-between h2 { margin: 0; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.empty { text-align: center; padding: 40px 20px; }
.note { background: color-mix(in srgb, var(--accent) 12%, transparent); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.warn { color: var(--accent-dark); font-weight: 600; }
h3 { font-size: 15px; margin: 14px 0 8px; }

/* ---------- Filter ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filters label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
}
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0 0 0 4px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td small, table.data th small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
table.data th small { display: inline; }
table.data tr.subtotal th, table.data tr.subtotal td { font-weight: 700; border-top: 2px solid var(--line); }
table.data tr.sel th { box-shadow: inset 3px 0 var(--accent); }
table.data td.win { font-weight: 800; box-shadow: inset 0 -3px var(--ok); }
table.data td.actions { text-align: right; }
.matrix td.num { min-width: 70px; }
.bar { position: relative; height: 22px; background: var(--bg); border-radius: 6px; min-width: 120px; overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--ok) 55%, transparent); }
.bar em { position: relative; font-style: normal; font-weight: 700; font-size: 13px; padding-left: 8px; line-height: 22px; }

.pass-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.pass-block h3 { margin-top: 4px; }
table.grid td, table.grid th { padding: 5px 8px; }

/* ---------- Profil ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin: 12px 0 8px; }
.kpis > div { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.kpis span { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpis small { display: block; color: var(--muted); }
.kpis .up, .kpis .down { display: block; font-size: 12px; font-weight: 600; margin-top: 4px; }
.kpis .up { color: var(--ok); }
.kpis .down { color: var(--bad); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 24px; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: 70px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; }
.hbar > div { background: var(--bg); height: 16px; border-radius: 4px; overflow: hidden; }
.hbar span { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.hbar span.bad { background: var(--bad); }
.hbar em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
ol.plain { margin: 0; padding-left: 20px; font-size: 14px; }
ol.plain li { margin-bottom: 4px; }
ol.plain span { color: var(--muted); }
.trend { display: flex; gap: 10px; align-items: flex-end; overflow-x: auto; padding-bottom: 4px; }
.trend-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; font-size: 12px; }
.trend-bar { height: 110px; width: 26px; background: var(--bg); border-radius: 5px; display: flex; align-items: flex-end; overflow: hidden; }
.trend-bar span { width: 100%; background: var(--ok); }
.trend-col em { font-style: normal; font-weight: 700; }

/* ---------- Erfassen ---------- */
.erfassen { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .erfassen { grid-template-columns: minmax(0, 1fr); } }
.new-session { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.new-session input { flex: 1 1 110px; min-width: 0; margin: 0; }
.new-session input[type="date"] { flex-basis: 100%; }
input, textarea {
  font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 13px; tab-size: 8; }
.session-list { list-style: none; margin: 0; padding: 0; }
.session-list button {
  width: 100%; text-align: left; font: inherit; background: none; border: 0; border-radius: 8px;
  padding: 8px 10px; cursor: pointer; color: var(--text);
}
.session-list button:hover { background: var(--bg); }
.session-list button.active { background: var(--green); color: #fff; }
.session-list small { display: block; opacity: .7; font-size: 12px; }
.session-edit, .pass-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.session-edit label, .pass-meta label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; margin: 0; }
.session-edit .grow, .pass-meta .grow { flex: 1 1 200px; }
.shooter-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0; }
form.inline { display: flex; gap: 6px; }
form.inline input { width: 150px; padding: 5px 8px; }
table.entry th, table.entry td { padding: 3px 6px; }
table.entry td input {
  width: 64px; text-align: center; padding: 6px; font-variant-numeric: tabular-nums; font-weight: 600;
}
table.entry input.miss { background: hsla(0, 65%, 48%, 0.18); border-color: hsla(0, 65%, 48%, 0.5); }
table.entry input.unclear { background: hsla(40, 90%, 50%, 0.2); border-color: hsla(40, 90%, 45%, 0.7); }
table.entry input.invalid { border-color: var(--bad); box-shadow: 0 0 0 2px hsla(0, 65%, 48%, 0.3); }
.import-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.import-item {
  display: grid; grid-template-columns: 90px 90px 1fr; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
}
.import-item.off { opacity: .45; }
.import-item .check { display: flex; gap: 6px; align-items: center; font-weight: 600; margin: 0; }
.import-item .stand-in { width: 80px; padding: 5px 8px; text-transform: uppercase; }
.import-item .warnings { grid-column: 1 / -1; margin: 0; padding-left: 18px; color: var(--accent-dark); font-size: 13px; }

@media (max-width: 700px) {
  .import-item { grid-template-columns: 1fr 1fr; }
  .import-item .who { grid-column: 1 / -1; }
}

/* ---------- Stände ---------- */
h1 + .muted { margin-top: 0; }
.line-section { margin-top: 26px; }
.stand-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 14px; }
.stand-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .1s, border-color .1s;
}
.stand-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stand-photo { position: relative; aspect-ratio: 16 / 10; background: var(--bg); display: grid; place-items: center; }
.stand-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-photo { color: var(--muted); font-size: 13px; }
.stand-code {
  position: absolute; left: 10px; bottom: 10px; background: var(--green); color: #fff; font-weight: 800;
  padding: 3px 10px; border-radius: 8px; font-size: 18px;
}
.photo-count { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.stand-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.stand-body p { margin: 0; }
.lock { color: var(--accent-dark); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stand-stats { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.stand-mine { font-weight: 700; }

.stand-detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 12px; }
@media (max-width: 900px) { .stand-detail { grid-template-columns: 1fr; } }
.main-photo { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg); aspect-ratio: 3 / 2; }
.main-photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.empty-photo { display: grid; place-items: center; color: var(--muted); }
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.nav-btn.left { left: 10px; } .nav-btn.right { right: 10px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: 0 0 auto; width: 84px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.img-admin { margin-top: 12px; font-size: 14px; }
.img-admin summary { cursor: pointer; font-weight: 600; }
.img-row { display: grid; grid-template-columns: 64px 1fr 80px auto; gap: 8px; align-items: center; margin-top: 8px; }
.img-row .mini { width: 64px; height: 42px; object-fit: cover; border-radius: 4px; }
.img-row input { min-width: 0; padding: 5px 8px; }
.mt { margin-top: 22px; }
.pre { white-space: pre-wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; margin: 0; }
.stack textarea { font-family: inherit; font-size: 14px; }
.target-strip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.target-strip div { border-radius: 6px; text-align: center; padding: 6px 0; font-size: 12px; }
.target-strip strong { display: block; font-size: 14px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: grid; place-items: center; z-index: 50; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.lightbox button { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: #fff; font-size: 34px; cursor: pointer; }

/* ---------- Profil und Benutzer ---------- */
.profile-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 4px 0 0; }
.filter-inline { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.narrow { max-width: 460px; }
.success { color: var(--ok); min-height: 1.2em; font-size: 14px; margin: 0; }
td.good { color: var(--ok); font-weight: 700; }
td.bad { color: var(--bad); font-weight: 700; }
table.data tr.me td { font-weight: 700; color: var(--accent-dark); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.shooter-list { list-style: none; margin: 0 0 12px; padding: 0; }
.shooter-list li { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.shooter-list input { padding: 5px 8px; width: 160px; }
select { max-width: 100%; }

a { color: var(--accent); }
a.btn { text-decoration: none; display: inline-block; }

/* ---------- Kopfzeile wie faas.systems: Menü links, Konto rechts ---------- */
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: #fff;
}
.icon-button:hover, .icon-button[aria-expanded="true"] { background: rgba(255,255,255,.14); }
.icon-button .icon { width: 22px; height: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-titel { display: flex; flex-direction: column; line-height: 1.15; }
.brand-titel strong { font-size: 16px; }
.brand-titel span { font-size: 12px; color: rgba(255,255,255,.65); }
.mainnav { display: flex; gap: 4px; margin-left: 18px; }
.mainnav a {
  color: rgba(255,255,255,.78); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 7px 13px; border-radius: 8px; white-space: nowrap;
}
.mainnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.mainnav a.active { color: #fff; background: rgba(255,255,255,.16); }
.topbar-rechts { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.benutzer-knopf { display: inline-flex; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.benutzer-knopf:hover .avatar, .benutzer-knopf[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.avatar.gross { width: 44px; height: 44px; font-size: 15px; }

.menue-schicht { position: fixed; inset: 0; z-index: 75; }
.apps-menue, .benutzer-menue {
  position: fixed; top: 58px; z-index: 76;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 38px rgba(16, 24, 40, .22);
}
.apps-menue { left: 10px; width: min(380px, calc(100vw - 20px)); max-height: calc(100vh - 70px); overflow-y: auto; padding: 14px; }
.apps-gitter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.apps-kachel {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 9px; border-radius: 10px;
  color: var(--text); text-decoration: none; text-align: center;
}
.apps-kachel:hover { background: var(--bg); text-decoration: none; }
.apps-zeichen {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%; background: var(--green); color: #fff;
}
.apps-zeichen .icon { width: 22px; height: 22px; }
.apps-kachel.active .apps-zeichen { background: var(--accent); }
.apps-kachel.active .apps-name { font-weight: 700; }
.apps-name { font-size: 12px; line-height: 1.25; word-break: break-word; }
.apps-trenner { margin: 14px 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.benutzer-menue { right: 10px; width: min(290px, calc(100vw - 20px)); padding: 6px; }
.benutzer-kopf { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); }
.benutzer-kopf > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.benutzer-kopf strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.benutzer-kopf .muted { font-size: 13px; }
.benutzer-liste { display: flex; flex-direction: column; padding: 6px 0; }
.benutzer-liste a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--text); font-size: 15px; text-decoration: none;
}
.benutzer-liste a:hover { background: var(--bg); text-decoration: none; }
.benutzer-liste .icon { width: 18px; height: 18px; color: var(--muted); }
.benutzer-fuss { padding: 6px; border-top: 1px solid var(--line); }
.benutzer-fuss .btn { display: flex; align-items: center; gap: 9px; width: 100%; }
.benutzer-fuss .icon { width: 17px; height: 17px; }

@media (max-width: 1080px) {
  .mainnav { display: none !important; }
}
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .apps-menue { left: 8px; right: 8px; width: auto; }
  .apps-gitter { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Anzeige für Handy, Tablet und Desktop ---------- */
.only-sm, table.data td small.only-sm { display: none; }
table.data .stick { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.data tr.subtotal .stick, table.data tr.sel .stick { background: var(--surface); }
.wrap { white-space: normal !important; }
.view.wide { max-width: 1400px; }

/* Tablet: zwei weniger wichtige Spalten weg, etwas enger */
@media (max-width: 900px) {
  table.data .opt2 { display: none; }
  .filters { gap: 10px; }
  .stand-detail { gap: 14px; }
}

/* Handy */
@media (max-width: 640px) {
  .view { padding: 14px 12px 32px; }
  .card { padding: 14px; border-radius: 10px; margin-bottom: 12px; }
  h1 { font-size: 22px; }
  h2 { font-size: 17px; }
  table.data { font-size: 13px; }
  table.data th, table.data td { padding: 7px 5px; }
  table.data .opt { display: none; }
  .only-sm, table.data td small.only-sm { display: block; }
  .bar { min-width: 64px; }
  .bar em { padding-left: 6px; font-size: 12px; }
  .matrix td.num { min-width: 54px; }

  /* Filter untereinander in voller Breite */
  .filters { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .filters label:first-child { grid-column: 1 / -1; }
  .filters select { width: 100%; }
  .filters .chips { grid-column: 1 / -1; }

  /* Tabellen als Karten (Benutzer, Durchgänge im Erfassen) */
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr { display: block; width: 100%; }
  table.stack-sm tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.stack-sm td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border: 0; padding: 4px 0; white-space: normal; text-align: right;
  }
  table.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex-shrink: 0; }
  table.stack-sm td:not([data-label])::before { content: none; }
  table.stack-sm td.actions { justify-content: flex-end; padding-top: 8px; }
  table.stack-sm td select { max-width: 60%; }

  .row-between { align-items: flex-start; }
  .profile-head { align-items: flex-start; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpis > div { padding: 10px 12px; }
  .kpis span { font-size: 22px; }
  .hbar { grid-template-columns: 74px 1fr 36px; }
  .import-item { grid-template-columns: 1fr 1fr; }
  .img-row { grid-template-columns: 56px 1fr; }
  .img-row select, .img-row .btn { grid-column: span 1; }
  .target-strip { grid-template-columns: repeat(5, 1fr); }
  .result-stats span { font-size: 24px; }
  .game-bar { gap: 8px; }
  .game-bar .btn { padding: 7px 10px; font-size: 13px; }
  #back .long { display: none; }
  .stand-detail h1 { font-size: 20px; }
  .session-edit, .pass-meta { display: grid; grid-template-columns: 1fr 1fr; }
  .session-edit .grow, .pass-meta .grow { grid-column: 1 / -1; }
  .session-edit .btn { width: 100%; }
}

/* Finger statt Maus: größere Ziele, kein Zoom beim Antippen von Feldern (iOS) */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  input, select { min-height: 40px; }
  .chip { padding: 9px 15px; }
  .btn.small { padding: 8px 12px; min-height: 36px; }
  .link { display: inline-block; padding: 6px 0; }
  table.entry td input { width: 58px; min-height: 42px; }
  .thumbs button { width: 96px; height: 64px; }
  .tab { padding: 11px; }
}

[data-edit-pass] { display: inline-flex; align-items: center; gap: 6px; }
[data-edit-pass] .icon { width: 16px; height: 16px; }
@media (max-width: 640px) { [data-edit-pass] .long { display: none; } }

/* Spiel: Hinweise je nach Bedienung, Querformat am Handy nutzt die ganze Höhe */
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-touch { display: inline; } .hint-mouse { display: none; } }
@media (orientation: landscape) and (max-height: 540px) {
  #view-game { padding: 6px 10px 10px; }
  #view-game .game-bar { margin-bottom: 6px; }
  #view-game .game-bar .btn { padding: 5px 10px; }
  #view-game .game-hint { display: none; }
  .game-wrap { width: min(100%, calc((100vh - 60px - 56px) * 16 / 9)); margin: 0 auto; }
}

@media (max-width: 640px) { table.stack-sm td.opt2 { display: flex; } }

.main-photo { max-height: 62vh; }
.main-photo img { max-height: 62vh; }

/* Ab!-Knopf unter dem Spielfeld */
.ab-row { display: flex; justify-content: center; margin: 14px 0 6px; }
.ab-btn {
  min-width: 220px; min-height: 56px; font-size: 22px; font-weight: 800; letter-spacing: .5px;
  border-radius: 14px; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.ab-btn:disabled { opacity: .45; }
.ab-btn.calling { opacity: 1; background: var(--accent-dark); }
@media (max-width: 640px) { .ab-btn { width: 100%; } }
@media (orientation: landscape) and (max-height: 540px) {
  .ab-row { margin: 6px 0 0; }
  .ab-btn { min-height: 44px; font-size: 18px; }
  .game-wrap { width: min(100%, calc((100vh - 60px - 56px - 52px) * 16 / 9)); }
}

/* ---------- Schießstand und Jagd ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0 0 4px; }
.page-head p { margin: 0; }
.btn.big { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; font-size: 16px; }
.btn .icon, .btn.small .icon { width: 18px; height: 18px; }
.btn.small { display: inline-flex; align-items: center; gap: 6px; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.subtabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.section-title { margin: 6px 0 12px; }
.h2 { font-size: 20px; margin: 0; }
.tiny { font-size: 12px; }
.kicker { font-size: 12px; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .5px; }

.range-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; margin-bottom: 22px; }
.range-card h3 { margin: 2px 0 6px; font-size: 19px; }
.range-card h4 { margin: 10px 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.range-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 6px 18px; }
.plain-list { margin: 0; padding-left: 18px; font-size: 14px; }
.range-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.range-mine { margin: 6px 0 2px; font-size: 14px; }

.target-grid, .hunt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px; margin-bottom: 20px; }
.target-card, .hunt-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .1s, border-color .1s;
}
.target-card:hover, .hunt-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.target-thumb, .hunt-photo { position: relative; aspect-ratio: 4 / 3; background: var(--bg); display: grid; place-items: center; color: var(--muted); }
.target-thumb img, .hunt-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph .icon { width: 40px; height: 40px; }
.score-badge { position: absolute; left: 10px; bottom: 10px; background: var(--green); color: #fff; font-weight: 800; font-size: 18px; padding: 3px 10px; border-radius: 8px; }
.score-badge small { font-weight: 600; opacity: .7; font-size: 12px; }
.vis-badge { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.55); color: #fff; border-radius: 999px; width: 28px; height: 28px; display: grid; place-items: center; }
.vis-badge .icon { width: 15px; height: 15px; }
.target-body, .hunt-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.user-line { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.user-line .icon { width: 14px; height: 14px; }

.type-stats { display: grid; gap: 18px; }
.type-stat h3 { margin: 0 0 8px; }
.kpis.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.kpis.compact span { font-size: 20px; }
@media (max-width: 640px) { .kpis.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 18px; align-items: start; margin-top: 12px; }
@media (max-width: 900px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.editor-side .card { margin-bottom: 14px; }
.canvas-wrap { position: relative; overflow: auto; max-height: 78vh; border-radius: 8px; background: #000; -webkit-overflow-scrolling: touch; }
.canvas-wrap canvas { display: block; width: 100%; height: auto; touch-action: manipulation; cursor: pointer; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px; border: 0; background: var(--surface); color: var(--text); cursor: pointer; min-height: 38px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--green); color: #fff; }
.photo-pick { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 14px; text-align: center; }
.pick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer;
  padding: 28px 30px; border: 2px dashed var(--accent); border-radius: 16px; color: var(--text); font-weight: 700; font-size: 17px; width: min(100%, 360px);
}
.pick-btn .icon { width: 44px; height: 44px; color: var(--accent); }
.pick-alt { color: var(--accent); cursor: pointer; font-weight: 600; }
.tips { text-align: left; margin: 6px 0 0; padding-left: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .three { grid-template-columns: 1fr 1fr; } }
.custom-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.custom-fields[hidden] { display: none; }
.vis-choice { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.vis-choice legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.vis-choice label { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; font-size: 15px !important; }
.vis-choice input { min-height: auto !important; width: 18px; height: 18px; margin: 0; }
.vis-choice .icon { width: 17px; height: 17px; color: var(--muted); }
.vis-choice .sub { padding-left: 26px; font-size: 14px !important; }
.ring-list { display: flex; flex-wrap: wrap; gap: 5px; }
.ring { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: 14px; background: var(--bg); }
.ring.r10, .ring.r9 { background: hsla(130, 60%, 45%, .3); }
.ring.r8, .ring.r7 { background: hsla(80, 60%, 45%, .3); }
.ring.r6, .ring.r5 { background: hsla(40, 80%, 50%, .3); }
.ring.r4, .ring.r3, .ring.r2, .ring.r1, .ring.r0 { background: hsla(0, 65%, 50%, .28); }
.form-narrow { max-width: 760px; margin: 12px auto 0; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.photo-item { position: relative; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item button { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; cursor: pointer; }
.strecke-total { font-size: 15px; margin: 4px 0 10px; }
.strecke-total strong { font-size: 26px; }
.hbar.wide { grid-template-columns: 120px 1fr 40px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; margin: 0; }

/* ---------- Bereiche ---------- */
button.brand { font: inherit; background: none; border: 0; padding: 4px 8px 4px 2px; border-radius: 10px; cursor: pointer; text-align: left; }
button.brand:hover { background: rgba(255,255,255,.08); }
.bereich-logo {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,255,255,.12); color: #fff;
}
.bereich-logo img { width: 28px; height: 28px; }
.bereich-logo .icon { width: 21px; height: 21px; }
.bereich-logo.schiessstand { background: #2d5d8a; }
.bereich-logo.jagd { background: #5b7f2e; }
.bereich-logo.clay { background: rgba(255,255,255,.12); }
.bereich-logo.gross { width: 46px; height: 46px; border-radius: 50%; }
.bereich-logo.gross img { width: 34px; height: 34px; }
.bereich-logo.gross.clay { background: var(--green); }
.bereich-kachel.active .bereich-logo { box-shadow: 0 0 0 3px var(--accent); }
.apps-titel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
/* Auf dem Desktop stehen die Seiten oben in der Leiste, die Reiter im Inhalt wären doppelt */
@media (min-width: 1081px) { .subtabs { display: none; } }
