/* Bogensportgruppe – Design-Grundlage. Neonfarben nur als Fläche mit dunkler Schrift. */
/* Schriften: Manrope und Barlow Condensed (SIL Open Font License), lokal eingebunden. */
@font-face { font-family: "Manrope"; font-weight: 500; font-style: normal; font-display: swap; src: url("../../assets/fonts/manrope-500.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-style: normal; font-display: swap; src: url("../../assets/fonts/manrope-600.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-style: normal; font-display: swap; src: url("../../assets/fonts/manrope-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../../assets/fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../../assets/fonts/barlow-condensed-700.woff2") format("woff2"); }

:root {
  --font-d: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-b: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
  --tab-h: 68px;
  --gelb: #F2C400; --blau: #4D93FF; --rot: #FF5A5A;
  color-scheme: dark;
}
html[data-theme="dark"] {
  --bg: #101113; --s1: #181A1D; --s2: #222529; --line: #33373C; --tx: #ECEEF0; --mu: #9BA1A8;
  --a-anthrazit: #D8DCE0; --a-gelb: #E6FF2E; --a-pink: #FF3D9A; --a-orange: #FF8A1F; --a-gruen: #2EFF8B;
  --ink: #0D0E10; color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #EEF0F2; --s1: #FFFFFF; --s2: #E3E6E9; --line: #CDD1D6; --tx: #14161A; --mu: #565D65;
  --a-anthrazit: #2B2F33; --a-gelb: #C8E000; --a-pink: #E5157F; --a-orange: #F26B00; --a-gruen: #00C968;
  --ink: #0D0E10; color-scheme: light;
}
html[data-theme="light"][data-accent="anthrazit"] { --ink: #FFFFFF; }
html[data-accent="anthrazit"] { --acc: var(--a-anthrazit); }
html[data-accent="gelb"] { --acc: var(--a-gelb); }
html[data-accent="pink"] { --acc: var(--a-pink); }
html[data-accent="orange"] { --acc: var(--a-orange); }
html[data-accent="gruen"] { --acc: var(--a-gruen); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--tx); font: 500 16px/1.5 var(--font-b);
  -webkit-tap-highlight-color: transparent; min-height: 100vh; min-height: 100dvh;
}
body.noscroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 700; letter-spacing: .01em; line-height: 1.1; margin: 0; }
h2 { font-size: 24px; } h3 { font-size: 20px; margin-bottom: 8px; }
p { margin: 0 0 10px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.boot { padding: 40px 16px; text-align: center; color: var(--mu); }
.muted { color: var(--mu); }
.center { text-align: center; }
.hint { color: var(--mu); font-size: 14px; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }

/* Layout */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 30px; flex: 1; }
.page { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px; outline: none; }
.stack > * + * { margin-top: 14px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--s1); border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; color: var(--mu); font-size: 12px; font-weight: 700; }
.tab.on { color: var(--tx); }
.tab.on .tab-ic { background: var(--s2); }
.tab-ic { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; }
.tab.cta .tab-ic { width: 56px; height: 56px; border-radius: 28px; background: var(--acc); color: var(--ink); margin-top: -22px; border: 4px solid var(--bg); }
.tab.cta.on .tab-ic { background: var(--acc); }
.tab.cta .tab-l { margin-top: 0; }
@media (min-width: 900px) {
  .shell { padding-bottom: 0; padding-left: 112px; }
  .tabbar { top: 0; right: auto; width: 112px; height: auto; grid-template-columns: 1fr; align-content: center; gap: 6px; border-top: 0; border-right: 1px solid var(--line); padding: 0; }
  .tab { min-height: 72px; }
  .tab.cta .tab-ic { margin-top: 0; border: 0; }
  .page { max-width: 760px; }
}

/* Karten, Formulare */
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
label { display: block; margin: 14px 0 6px; font-weight: 700; font-size: 14px; }
.card > label:first-child { margin-top: 0; }
input[type=text], input[type=password], input[type=date], input[type=url], input[type=tel], input[type=email], input[type=search] {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 16px;
}
input:focus { outline: 3px solid var(--acc); outline-offset: 1px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-wrap .icon-btn { position: absolute; right: 2px; top: 2px; }
.form-err { color: var(--rot); font-weight: 700; margin: 12px 0 0; }
html[data-theme="light"] .form-err { color: #C21F1F; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--s2); font-weight: 700; cursor: pointer; text-align: center;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--acc); color: var(--ink); border-color: transparent; }
.btn.danger { background: var(--rot); color: #0D0E10; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.block { display: flex; width: 100%; margin-top: 16px; }
.btn.small { min-height: 44px; padding: 6px 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row-actions .btn { flex: 1 1 140px; }
.icon-btn { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--s2); }
.sheet-b > * + * { margin-top: 0; }

/* Auswahl-Kacheln */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.seg-b { min-height: 48px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; cursor: pointer; color: var(--mu); }
.seg-b.on { background: var(--acc); color: var(--ink); }
.seg-b:disabled { opacity: .5; }
/* Tab-Leiste mit mehreren Reitern: nie umbrechen, nie überlaufen */
.seg.seg-tabs { display: flex; gap: 3px; padding: 4px; }
.seg.seg-tabs .seg-b { flex: 1 1 auto; min-width: 0; padding: 0 8px; font-size: 14px; white-space: nowrap; }
@media (max-width: 360px) { .seg.seg-tabs .seg-b { font-size: 13px; padding: 0 5px; } }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 52px; height: 52px; border-radius: 50%; border: 3px solid transparent; display: grid; place-items: center; cursor: pointer; color: transparent; background: var(--c); box-shadow: inset 0 0 0 1px rgba(128,128,128,.4); }
.sw[aria-checked="true"] { border-color: var(--tx); color: var(--ink); }
.sw[data-a="anthrazit"] { --c: var(--a-anthrazit); } .sw[data-a="gelb"] { --c: var(--a-gelb); }
.sw[data-a="pink"] { --c: var(--a-pink); } .sw[data-a="orange"] { --c: var(--a-orange); } .sw[data-a="gruen"] { --c: var(--a-gruen); }
html[data-theme="light"] .sw[data-a="anthrazit"][aria-checked="true"] { color: #fff; }

/* Listen */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; width: 100%; padding: 8px 4px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; }
.list > .row:first-child { border-top: 0; }
.row.disabled { opacity: .5; cursor: default; }
.row.off strong { text-decoration: line-through; opacity: .7; }
.row-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-t small { color: var(--mu); font-size: 13px; }
.row-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--s2); }
.card.list { padding: 4px 12px; }
.avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--acc); color: var(--ink); font-family: var(--font-d); font-weight: 700; font-size: 17px; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.who { display: flex; align-items: center; gap: 14px; }
.who p { margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--mu); } .kv dd { margin: 0; font-weight: 700; }

/* Start */
.hero { padding: 8px 0 4px; }
.eyebrow { color: var(--mu); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin: 0; }
.big { font-size: 44px; }
.tile-cta { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r); background: var(--acc); color: var(--ink); }
.tile-cta .tile-t { flex: 1; display: flex; flex-direction: column; }
.tile-cta strong { font-family: var(--font-d); font-size: 28px; line-height: 1; }
.tile-cta small { font-size: 14px; font-weight: 600; opacity: .8; }
.tile-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: rgba(0,0,0,.14); }
.empty { text-align: center; padding: 36px 8px; }
.empty-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--s2); margin-bottom: 12px; }
.seg + .empty { margin-top: 8px; }

/* Anmeldung */
.login { max-width: 420px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top)) 16px 40px; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 { font-size: 40px; margin-top: 10px; }
.login-card { margin-top: 8px; }

/* Hinweise */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--s2); font-weight: 700; font-size: 13px; }
.chip.off { background: var(--gelb); color: #0D0E10; }
.banner { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--acc); color: var(--ink); font-weight: 700; }
.banner .btn.primary { background: var(--ink); color: var(--tx); }
html[data-theme="light"] .banner .btn.primary { color: #fff; background: #14161A; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 30; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px; background: var(--tx); color: var(--bg); font-weight: 700; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--rot); color: #0D0E10; }

/* Blatt */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--s1); border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; }
.sheet-h h2 { padding: 8px 0; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
.temp-pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: .06em; text-align: center; padding: 18px 8px; margin: 10px 0; border-radius: 14px; background: var(--bg); border: 1px dashed var(--acc); user-select: all; word-break: break-all; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.card > .btn.ghost { display: flex; width: 100%; margin-top: 10px; }

/* ===== Meilenstein 2: Runde, Erfassung, Ergebnis, Parcours ===== */
.lnk { text-decoration: underline; font-weight: 700; }
.btn.big { min-height: 56px; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip.ok { background: var(--acc); color: var(--ink); }
.chip.warn { background: var(--gelb); color: #0D0E10; }
.chip.pend { background: var(--s2); }
.chip.gst { border: 0; cursor: pointer; background: var(--s2); min-height: 40px; }

/* Auswahlkacheln */
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tiles.col { flex-direction: column; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); text-align: left; cursor: pointer; }
.tile small { color: var(--mu); font-size: 13px; }
.tile.on { border-color: var(--acc); background: var(--s2); box-shadow: inset 0 0 0 1px var(--acc); }
.tile.person { flex-direction: row; align-items: center; gap: 10px; font-weight: 700; }
.tile.person .avatar { width: 32px; height: 32px; font-size: 14px; background: var(--s2); color: var(--tx); }
.tile.person.on .avatar { background: var(--acc); color: var(--ink); }
.guest-add { display: flex; gap: 10px; margin-top: 10px; }
.guest-add .btn { flex: none; }

/* Erfassung */
.shell.focus { padding-bottom: 0; }
.shell.focus .tabbar { display: none; }
@media (min-width: 900px) { .shell.focus { padding-left: 0; } }
.erf { padding-bottom: 96px; }
.erf > * + * { margin-top: 12px; }
.scorestrip { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 3; display: flex; align-items: center; gap: 10px; padding: 8px 0; background: var(--bg); }
.scores { display: flex; gap: 8px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.sc { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 4px 10px; border-radius: 12px; background: var(--s1); border: 1px solid var(--line); }
.sc small { color: var(--mu); font-size: 12px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc strong { font-family: var(--font-d); font-size: 22px; line-height: 1.1; }
.st-head { display: flex; align-items: center; justify-content: space-between; }
.st-no { font-family: var(--font-d); font-weight: 700; font-size: 40px; line-height: 1; }
.st-head small { color: var(--mu); font-weight: 700; }
.shooter .sh-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.shooter .sh-head strong { font-size: 18px; flex: 1; min-width: 80px; }
.shooter.off { opacity: .7; }
.shooter.off .sh-head { margin-bottom: 6px; }
.dists { display: flex; gap: 8px; }
.dist { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.dist.gelb { background: var(--gelb); } .dist.blau { background: var(--blau); } .dist.rot { background: var(--rot); }
.dist.on { border-color: var(--tx); }
.otiles { display: grid; gap: 8px; }
.otiles.golf { grid-template-columns: repeat(4, 1fr); }
.otiles.hunter, .otiles.points { grid-template-columns: repeat(2, 1fr); }
.otile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); cursor: pointer; }
.otiles.hunter .otile, .otiles.points .otile { flex-direction: row; justify-content: space-between; padding: 6px 14px; min-height: 58px; }
.otiles.hunter .otile.wide, .otiles.points .otile.wide { grid-column: 1 / -1; }
.ot-n { font-family: var(--font-d); font-weight: 700; font-size: 30px; line-height: 1; }
.ot-l { font-size: 13px; color: var(--mu); font-weight: 700; }
.otiles.hunter .ot-n, .otiles.points .ot-n { order: 2; }
.otiles.points .ot-l { text-align: left; }
button.pen { margin-top: 10px; min-height: 48px; }
button.pen.on { background: var(--acc); border-color: var(--acc); color: var(--ink); }
button.pen:disabled { opacity: .5; }
.otile.on { background: var(--acc); border-color: var(--acc); color: var(--ink); }
.otile.on .ot-l { color: var(--ink); opacity: .8; }
.otile:active { transform: scale(.97); }
.note { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--s1); }
.note.warn { border-color: var(--gelb); }
.note p { margin: 0 0 8px; }
.hint.sync { margin: 0; text-align: center; }
.hint.sync.ok { opacity: .7; }
.erf-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--s1); border-top: 1px solid var(--line); }
.erf-bar .btn { min-height: 56px; }
.erf-bar .nav { flex: 0 0 64px; padding: 0; }
.erf-bar .mid { flex: 1; max-width: 240px; }
.erf-bar .next { flex: 1 1 140px; max-width: 220px; font-size: 18px; }
.erf-bar .next.go { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--acc) 35%, transparent); } }
.stgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin: 8px 0; }
.stg { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); font-weight: 800; font-size: 17px; cursor: pointer; }
.stg small { font-size: 11px; color: var(--mu); line-height: 1; }
.stg.s-done { background: var(--acc); border-color: var(--acc); color: var(--ink); }
.stg.s-done small { color: var(--ink); }
.stg.s-part { border-color: var(--acc); box-shadow: inset 0 -7px 0 var(--acc); }
.stg.edit.s-part { background: var(--s2); box-shadow: none; border-color: var(--acc); }
.stg.cur { outline: 3px solid var(--tx); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .cnt { min-width: 56px; text-align: center; font-family: var(--font-d); font-size: 32px; }
.stepper .btn { min-width: 56px; font-size: 22px; }
.end-row { display: flex; justify-content: space-between; }
.sheet .block + .block { margin-top: 10px; }

/* Ergebnis */
.rank .avatar { font-size: 18px; }
.pts { display: flex; flex-direction: column; align-items: flex-end; }
.pts strong { font-family: var(--font-d); font-size: 32px; line-height: 1; }
.pts small { color: var(--mu); font-size: 12px; }
.tbl-wrap { overflow-x: auto; margin: 0 -6px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 15px; }
.tbl th, .tbl td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl thead th { font-size: 13px; color: var(--mu); }
.tbl tbody th { position: sticky; left: 0; background: var(--s1); color: var(--mu); font-weight: 700; }
.tbl .v { display: inline-block; min-width: 20px; margin: 0 2px; font-weight: 800; border-bottom: 3px solid transparent; }
.tbl .v.none { color: var(--mu); font-weight: 400; }
.tbl .v.kill { color: var(--acc); }
html[data-theme="light"] .tbl .v.kill { color: var(--tx); text-decoration: underline wavy; }
.tbl .d-gelb { border-bottom-color: var(--gelb); } .tbl .d-blau { border-bottom-color: var(--blau); } .tbl .d-rot { border-bottom-color: var(--rot); }
.tbl .na { color: var(--mu); }

/* M3 Auswertung */
.filters { gap: 10px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mu); }
.field-inline select { min-height: 48px; width: 100%; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.check input { width: 22px; height: 22px; accent-color: var(--acc); flex: none; }
.bar-row { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
.bar-l { color: var(--mu); }
.bar-t { height: 14px; border-radius: 7px; background: var(--s2); overflow: hidden; }
.bar-f { display: block; height: 100%; border-radius: 7px; background: var(--acc); }
.bar-f.a0 { background: var(--mu); }
.bar-v { font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--mu); }
.dot.d-gelb { background: var(--gelb); } .dot.d-blau { background: var(--blau); } .dot.d-rot { background: var(--rot); }
.tbl th:first-child { text-align: left; white-space: nowrap; }
.field-inline, .check { margin: 0; font-weight: 600; }
select { min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font-size: 16px; }
select:focus { outline: 3px solid var(--acc); outline-offset: 1px; }

/* M4 Chat */
.tab-ic { position: relative; }
.badge { position: absolute; top: -2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--acc); color: var(--ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.badge[hidden] { display: none; }
.chat { padding-bottom: 84px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; }
.day { align-self: center; margin: 10px 0 2px; padding: 3px 12px; border-radius: 12px; background: var(--s2); color: var(--mu); font-size: 12px; font-weight: 700; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-b { position: relative; padding: 8px 12px; border-radius: 16px; background: var(--s1); border: 1px solid var(--line); min-width: 64px; }
.msg.me .msg-b { background: var(--acc); color: var(--ink); border-color: transparent; }
.msg.pend .msg-b { opacity: .7; }
.msg-n { display: block; font-size: 12px; color: var(--mu); margin-bottom: 2px; }
.msg-t { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.35; }
.msg-m { display: block; margin-top: 3px; font-size: 11px; opacity: .65; text-align: right; }
.msg-err { display: block; font-size: 12px; color: var(--rot); }
.msg-x { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 13px; border: 1px solid var(--line); background: var(--s1); color: var(--mu); display: none; place-items: center; cursor: pointer; }
.msg-b:hover .msg-x, .msg-b:focus-within .msg-x, .msg.pend .msg-x { display: grid; }
@media (hover: none) { .msg-x { display: grid; opacity: .55; width: 22px; height: 22px; top: -6px; right: -6px; } }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; flex: none; }
.ph { display: block; padding: 0; border: 0; background: none; border-radius: 12px; overflow: hidden; margin-bottom: 6px; cursor: zoom-in; position: relative; }
.ph img { display: block; max-width: 100%; height: auto; border-radius: 12px; background: var(--s2); }
.ph.up { cursor: default; } .ph.up img { width: 200px; opacity: .6; }
.ph-s { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; }
.chat-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 5; background: var(--s1); border-top: 1px solid var(--line); padding: 8px 10px; }
.chat-row { display: flex; align-items: flex-end; gap: 6px; max-width: 640px; margin: 0 auto; }
.chat-in { flex: 1; min-height: 44px; max-height: 130px; resize: none; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: inherit; font-size: 16px; line-height: 1.3; }
.chat-in:focus { outline: 3px solid var(--acc); outline-offset: 1px; }
.chat-row .icon-btn { width: 44px; height: 44px; flex: none; }
.chat-row .send { background: var(--acc); color: var(--ink); border-radius: 22px; }
.emo-ic { font-size: 22px; line-height: 1; }
.emoji-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-width: 640px; margin: 0 auto 8px; }
.emoji-panel[hidden] { display: none; }
.emoji { min-height: 42px; font-size: 24px; background: none; border: 0; border-radius: 10px; cursor: pointer; }
.emoji:active { background: var(--s2); }
.lb { background: rgba(0,0,0,.92); align-items: center; justify-content: center; display: flex; }
.lb-img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
.lb-x { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; color: #fff; }

.legal h3 { margin: 1rem 0 .25rem; font-size: 1rem; }
.legal p, .legal li { line-height: 1.5; }
.legal ul { padding-left: 1.2rem; margin: .25rem 0; }

input[type=date] { display: block; appearance: none; -webkit-appearance: none; font-family: inherit; font-weight: 600; color: var(--tx); text-align: left; cursor: pointer; }
input[type=date]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .75; padding: 6px; border-radius: 8px; }
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--s2); }
.row-actions input[type=date] { width: auto; flex: 1 1 160px; min-width: 0; }
.row-actions input[type=text] { width: auto; flex: 1 1 200px; min-width: 0; }
.hint.warn { color: var(--gelb); }
.kv dd.bad { color: var(--rot, #ff5a5a); }
.tbl .num { text-align: right; }
.err-row small { word-break: break-word; }
.st-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.st-n { font-weight: 800; color: var(--mu); text-align: center; }
.st-v { text-align: right; font-weight: 700; } .st-v small { display: block; color: var(--mu); font-weight: 500; }
.st-row.weak .st-n { color: var(--gelb); } .st-row.weak .bar-f { background: var(--gelb); }
svg.trend { width: 100%; height: auto; display: block; }
.trend .tg { stroke: var(--s2); stroke-width: 1; }
.trend .tl { fill: var(--mu); font-size: 10px; }
.trend .tline { stroke: var(--acc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .tdot { fill: var(--acc); stroke: var(--s1, var(--bg)); stroke-width: 2; }
.trend .tdot.sel { r: 6; }
.trend .thit { fill: transparent; cursor: pointer; }
.trend-read { font-weight: 700; margin: 6px 0; }

/* Ergebnistabelle (v0.12): linksbündig, Zahlen als feste Felder, Summenzeile */
.tbl.res th, .tbl.res td { text-align: left; }
.tbl.res thead th { padding-bottom: 6px; }
.tbl.res .vs { display: inline-flex; gap: 4px; }
.tbl.res .v { box-sizing: border-box; min-width: 30px; margin: 0; padding: 3px 6px; text-align: center; border-radius: 7px; background: var(--s2); color: var(--tx); font-variant-numeric: tabular-nums; border-bottom: 3px solid transparent; text-decoration: none; }
.tbl.res .v.none { background: transparent; color: var(--mu); }
.tbl.res .v.q-best { background: color-mix(in srgb, var(--acc) 28%, var(--s2)); color: var(--tx); }
.tbl.res .v.q-mid { background: color-mix(in srgb, var(--gelb) 30%, var(--s2)); }
.tbl.res .v.q-bad { background: color-mix(in srgb, var(--rot) 32%, var(--s2)); }
.tbl.res .d-gelb { border-bottom-color: var(--gelb); } .tbl.res .d-blau { border-bottom-color: var(--blau); } .tbl.res .d-rot { border-bottom-color: var(--rot); }
.tbl.res tbody tr:nth-child(even) th, .tbl.res tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--s2) 35%, transparent); }
.tbl.res tbody tr:nth-child(even) th { background: color-mix(in srgb, var(--s2) 35%, var(--s1)); }
.tbl.res tfoot th, .tbl.res tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-size: 16px; }
.tbl.res .na { color: var(--mu); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.info-block .row-actions { flex-wrap: wrap; }
.info-block a.btn { text-decoration: none; }
textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--tx); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tbl.res th, .tbl.res td { padding: 7px 6px; }
.tbl.res .vs { gap: 3px; }
.tbl.res .v { min-width: 26px; padding: 3px 4px; font-size: 14px; }
html .tbl.res .v.kill { text-decoration: none; box-shadow: inset 0 0 0 2px var(--acc); }
/* Turniere (v0.12) */
html[data-theme="light"], html[data-theme="light"] .viz { --s1c: #2a78d6; --s2c: #eb6834; --s3c: #1baf7a; --s4c: #eda100; --s5c: #e87ba4; --s6c: #008300; --s7c: #6250d6; --s8c: #e34948; }
html[data-theme="dark"] { --s1c: #3987e5; --s2c: #d95926; --s3c: #199e70; --s4c: #c98500; --s5c: #d55181; --s6c: #008300; --s7c: #9085e9; --s8c: #e66767; }
svg.race { width: 100%; height: auto; display: block; touch-action: pan-y; }
.race .rg { stroke: var(--s2); stroke-width: 1; } .race .rl { fill: var(--mu); font-size: 10px; } .race .rx { stroke: var(--mu); stroke-width: 1; stroke-dasharray: 3 3; }
.race .rline { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; } .race .rdot { stroke: var(--s1); stroke-width: 2; }
.race .s1 { stroke: var(--s1c); fill: var(--s1c); } .race .s2 { stroke: var(--s2c); fill: var(--s2c); } .race .s3 { stroke: var(--s3c); fill: var(--s3c); } .race .s4 { stroke: var(--s4c); fill: var(--s4c); }
.race .s5 { stroke: var(--s5c); fill: var(--s5c); } .race .s6 { stroke: var(--s6c); fill: var(--s6c); } .race .s7 { stroke: var(--s7c); fill: var(--s7c); } .race .s8 { stroke: var(--s8c); fill: var(--s8c); }
.race .rdot { stroke: var(--s1); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; font-size: 14px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.s1 { background: var(--s1c); } .sw.s2 { background: var(--s2c); } .sw.s3 { background: var(--s3c); } .sw.s4 { background: var(--s4c); } .sw.s5 { background: var(--s5c); } .sw.s6 { background: var(--s6c); } .sw.s7 { background: var(--s7c); } .sw.s8 { background: var(--s8c); }
.race-read { font-weight: 700; margin: 6px 0; font-size: 14px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; margin: 12px 0; }
.pod { background: var(--s2); border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; min-height: 84px; justify-content: flex-end; overflow-wrap: anywhere; }
.pod.p1 { min-height: 112px; box-shadow: inset 0 0 0 2px var(--acc); } .pod.p3 { min-height: 70px; } .pod.none { background: transparent; }
.pod-n { font-family: var(--font-d); font-size: 26px; font-weight: 800; } .pod small { color: var(--mu); }
.row.unranked { opacity: .78; }
.race path.rline { fill: none; }

/* Rechte-Editor (Nutzerverwaltung) */
.rights { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.rights h3 { margin: 6px 0 0; }
.rights h4 { margin: 10px 0 2px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--mu); }
.rights .check.row { align-items: flex-start; padding: 6px 0; }
.rights .check.row input { margin-top: 2px; }
.stack-s { display: flex; flex-direction: column; gap: 2px; }

/* Parcours-Auswahl, Favoriten */
.pick-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.pick-row:last-child { border-bottom: 0; }
.pick-row.on { background: var(--s2); }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 6px; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.pick-main small { color: var(--mu); font-size: 13px; }
.star { width: 48px; min-height: 48px; flex: none; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--mu); cursor: pointer; }
.star.on { color: var(--acc); }
.picked { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border: 2px solid var(--acc); border-radius: 14px; background: var(--s2); }
.picked .row-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.picked small { color: var(--mu); font-size: 13px; }
input[type=search] { -webkit-appearance: none; appearance: none; }
.stack > select { width: 100%; }

/* Desktop: Seitenleiste statt Tab-Leiste – Eingabeleiste des Chats und Hinweise richten sich nach dem Inhaltsbereich */
@media (min-width: 900px) {
  .chat-bar { left: 112px; bottom: 0; }
  .page:has(> .chat) { max-width: 920px; }
  .chat-row { max-width: 888px; }
  .msg { max-width: 75%; }
  .toast { bottom: 24px; left: calc(50% + 56px); }
}
@media (min-width: 900px) and (max-width: 1100px) { .page:has(> .chat) { max-width: 760px; } .chat-row { max-width: 728px; } }

/* Golfplätze (v0.2.0) */
a.row { color: inherit; text-decoration: none; }
.row small.warn-t { color: var(--gelb); font-weight: 700; }
html[data-theme="light"] .row small.warn-t { color: #8A6D00; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.card > select, .sheet-b > select { width: 100%; }
input[type=search] { -webkit-appearance: none; appearance: none; }
.dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(128,128,128,.55); }
.row > .dot { margin-right: 0; }
.tee-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 12px 0 4px; }
.tee-info .dot { margin-right: 0; }
.tbl-wrap { overflow-x: auto; margin: 10px -4px 0; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 10px; text-align: center; border-top: 1px solid var(--line); font-size: 15px; }
.tbl thead th { border-top: 0; color: var(--mu); font-size: 13px; font-weight: 700; }
.tbl tbody th { text-align: left; font-weight: 700; white-space: nowrap; }
.tbl tr.sum th, .tbl tr.sum td { background: var(--s2); font-weight: 700; }
.holes { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hole-row { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 10px; align-items: center; }
.hole-row.head { color: var(--mu); font-size: 13px; font-weight: 700; }
.hole-row select, .hole-row input { width: 100%; min-height: 48px; }
.hole-row input { padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; text-align: center; }
.distgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.dgcell { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 12px; color: var(--mu); }
.dgcell input { min-height: 44px; padding: 6px 8px; text-align: center; }
.sheet-b input[inputmode] { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }

/* ---- v0.3.0: Runden ---- */
.dot.big { width: 18px; height: 18px; }
.round-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.round-head .muted { margin: 2px 0 0; }
.round-head .chips { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.card .stat { background: var(--bg); }
.stat-v { font: 700 28px/1.1 var(--font-d); }
.stat-l { color: var(--mu); font-size: 12px; }
.stat-s { color: var(--mu); font-size: 13px; font-weight: 700; }
.hole-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hchip { min-width: 40px; min-height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--s1); color: var(--tx); font-weight: 700; cursor: pointer; }
.hchip.done { background: var(--s2); }
.hchip.cur { background: var(--acc); color: var(--ink); border-color: transparent; }
.holecard .hole-head { display: flex; justify-content: space-between; align-items: baseline; }
.hole-no { font: 700 30px/1.1 var(--font-d); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.qbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--tx); cursor: pointer; }
.qbtn small { color: var(--mu); font-size: 12px; }
.qbtn strong { font: 700 26px/1.1 var(--font-d); }
.qbtn.on { background: var(--acc); border-color: transparent; }
.qbtn.on small, .qbtn.on strong { color: var(--ink); }
.holecard .stepper { justify-content: center; margin: 6px 0; }
.holecard .stepper .cnt { font-size: 44px; min-width: 80px; }
.holecard .stepper .btn { min-width: 72px; min-height: 56px; }
.pts { text-align: center; font-weight: 700; margin: 6px 0; }
.btn.ghost.on { background: var(--s2); border-color: var(--acc); }
.opt summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.opt-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.opt-row .seg { flex: 1 1 200px; }
.opt-row .stepper .cnt { font-size: 26px; min-width: 40px; }
.opt-row .stepper .btn { min-width: 48px; min-height: 44px; }
.nav2 .btn { flex: 1 1 0; }
.tbl.score th, .tbl.score td { padding: 8px 6px; }
.tbl tr.sum th, .tbl tr.sum td { font-weight: 800; background: var(--s2); }
.lnkbtn { min-width: 36px; min-height: 36px; border: 0; background: transparent; color: var(--acc); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; }
button.row { width: 100%; text-align: left; background: transparent; color: inherit; border: 0; font: inherit; cursor: pointer; }

/* ---- v0.4.0: Auswertung ---- */
.lc-wrap { width: 100%; }
.lc { width: 100%; height: auto; display: block; }
.lc-grid { stroke: var(--line); stroke-width: 1; }
.lc-ref { stroke: var(--mu); stroke-width: 1; }
.lc-tick { fill: var(--mu); font: 600 11px var(--font-b); }
.lc-line { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { fill: var(--acc); stroke: var(--s1); stroke-width: 2; r: 5px; }
.lc-dot.sel { r: 7px; }
.lc-hit { fill: transparent; cursor: pointer; }
.lc-hit:focus-visible { outline: 3px solid var(--acc); }
.lc-val { fill: var(--tx); font: 700 13px var(--font-b); }
.lc-detail { margin: 6px 0 0; color: var(--tx); font-size: 14px; min-height: 22px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 10px; }
.bar-l { color: var(--tx); font-size: 14px; }
.bar-t { display: block; height: 14px; }
.bar-f { display: block; height: 14px; min-width: 2px; background: var(--acc); border-radius: 0 4px 4px 0; }
.bar-v { color: var(--mu); font-size: 13px; font-weight: 700; min-width: 64px; text-align: right; }
.row.board { cursor: default; }
a.row.board { cursor: pointer; }
.row.board.me { background: var(--s2); border-radius: 12px; }
.rank { flex: 0 0 28px; text-align: center; font: 700 20px/1 var(--font-d); color: var(--mu); }
.board-v { font: 700 24px/1 var(--font-d); }
.stats.two { grid-template-columns: repeat(2, 1fr); }
.card .tbl { width: 100%; }
.bar-row { grid-template-columns: 124px 1fr auto; }
.opt .tbl td:first-child { white-space: normal; text-align: left; }
.tbl.compact { table-layout: fixed; font-size: 14px; }
.tbl.compact th, .tbl.compact td { padding: 8px 2px; white-space: normal; overflow-wrap: anywhere; }
.tbl.compact th:first-child, .tbl.compact td:first-child { width: 12%; }
.tbl.compact th { line-height: 1.2; vertical-align: bottom; }

/* v0.5.0: Auswertung je Platz */
.tbl tr.hard td { font-weight: 700; }
.tbl tr.hard td:first-child::before { content: "\25B2\00a0"; font-size: 10px; }

/* v0.6.0: Wetterkarte und Entfernung zum Grün */
.card.wx { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.wx-main { display: flex; align-items: center; gap: 14px; }
.wx-t { font-size: 28px; line-height: 1; white-space: nowrap; }
.wx-main p { margin: 2px 0 0; }
.wx-next { margin: 0; font-size: 13px; }
.wx-attr { margin: 0; font-size: 12px; }
.gps { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin: 8px 0; }
.gps .gps-v { margin: 0; font-size: 20px; }
.gps .hint { margin: 0; }

.holemap { position: relative; z-index: 0; isolation: isolate; width: 100%; box-sizing: border-box; min-width: 0; height: 300px; border-radius: 12px; overflow: hidden; background: var(--bg2, #1c1c1f); margin: 8px 0; }
.holemap .leaflet-control-attribution { font-size: 10px; }
.hm-pin span { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #111; font-weight: 700; font-size: 14px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hm-pin.tee span { background: #f2c400; }
.hm-pin.green span { background: #2eb86a; }
.hm-me i { display: block; width: 16px; height: 16px; border-radius: 50%; background: #4d93ff; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(77,147,255,.4); }
.tee-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: 8px 0; }
.tee-box .row-actions { width: 100%; flex-wrap: wrap; }
.tee-box .hint { margin: 0; }
.tee-sets { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tee-sets select, .tee-sets input { width: 100%; }
.tee-info { margin: 0; font-size: 16px; }
