/* Velohunt – Look: Radweg-Beschilderung (DIN-artige Barlow), Asphalt, Radweg-Blau, gelbes Trikot */
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('/fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('/fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url('/fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }

:root {
  --asphalt: #1f252d;
  --blue: #0f4fa8;
  --blue-dark: #0b3a7e;
  --yellow: #ffd60a;
  --chalk: #f1f3ef;
  --paper: #ffffff;
  --muted: #566170;
  --line: #cdd5d1;
  --red: #c62d25;
  --bar: 58px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--asphalt);
  font: 400 17px/1.5 var(--text);
  min-height: 100dvh;
}
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1; margin: 0; letter-spacing: 0; }
h2 { font-size: 2rem; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 .8em; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); padding: 8px 12px; z-index: 2000; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
#view:focus { outline: none; }

/* ───── Topbar ───── */
.topbar { background: var(--blue); color: #fff; position: sticky; top: 0; z-index: 1000; height: var(--bar); }
.topbar :focus-visible { outline-color: var(--yellow); }
.bar { display: flex; align-items: center; justify-content: space-between; height: var(--bar); gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 1.8rem/1 var(--display); }
.nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.navlink { color: #fff; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; display: inline-flex; align-items: center; gap: 8px; }
.navlink:hover { background: rgba(255,255,255,.14); }
.navlink.active { box-shadow: inset 0 -3px 0 var(--yellow); border-radius: 6px 6px 0 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; flex: none; display: inline-block; }

/* ───── Buttons & Formulare ───── */
.btn {
  appearance: none; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1.05rem/1 var(--text); padding: 13px 20px; border-radius: 6px; border: 2px solid var(--asphalt);
  background: var(--yellow); color: var(--asphalt); min-height: 46px;
}
.btn:hover { background: #ffe14d; }
.btn:active { transform: translateY(1px); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-dark); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(31,37,45,.07); }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: rgba(198,45,37,.08); }
.btn.big { font-size: 1.2rem; padding: 16px 22px; min-height: 56px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .legend { font-weight: 600; }
.field > .check { font-weight: 500; }
.field .hint { color: var(--muted); font-size: .9rem; }
input[type=text], input[type=password], input[type=number], select {
  font: 500 1rem/1.2 var(--text); color: inherit; background: var(--paper);
  border: 2px solid var(--asphalt); border-radius: 6px; padding: 11px 12px; width: 100%; min-height: 46px;
}
input[type=color] { width: 64px; height: 46px; padding: 3px; border: 2px solid var(--asphalt); border-radius: 6px; background: var(--paper); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--blue); height: 32px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.check small { display: block; color: var(--muted); font-weight: 400; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; min-width: 56px; text-align: center; padding: 10px 14px; border: 2px solid var(--asphalt); border-radius: 6px; font-weight: 700; background: var(--paper); }
.seg input:checked + span { background: var(--asphalt); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row output { font: 800 1.8rem/1 var(--display); min-width: 5.5ch; text-align: right; }
.form-error { background: #fbe3e1; color: #7d1a15; border-left: 5px solid var(--red); padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; font-weight: 500; }
.form-ok { background: #e2f3e8; border-left: 5px solid #2f8f5b; padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; }

/* ───── Startseite ───── */
.hero { background: var(--paper); border-bottom: 2px solid var(--asphalt); }
.hero-inner { display: grid; gap: 24px; padding-top: 36px; padding-bottom: 36px; align-items: center; }
.hero h1 { font-size: clamp(3.3rem, 13vw, 6.6rem); line-height: .88; margin-bottom: 18px; }
.hero .lead { font-size: 1.2rem; max-width: 34ch; color: #313a45; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero-art { width: 100%; max-width: 480px; justify-self: center; }
.hero-art text { font-family: var(--display); font-weight: 700; }

.home-grid { display: grid; gap: 40px; padding-top: 40px; padding-bottom: 64px; }
.home-grid h2 { margin-bottom: 6px; }
.home-grid .sub { color: var(--muted); margin-bottom: 16px; }

.board { width: 100%; border-collapse: collapse; background: var(--paper); border: 2px solid var(--asphalt); border-radius: 8px; overflow: hidden; }
.board th { text-align: right; font-weight: 600; font-size: .9rem; color: var(--muted); padding: 9px 10px; border-bottom: 2px solid var(--asphalt); background: #e7ebe7; }
.board th:nth-child(1), .board th:nth-child(2) { text-align: left; }
.board td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.board tr:last-child td { border-bottom: 0; }
.board td.rank { text-align: left; font: 800 1.5rem/1 var(--display); width: 2.6rem; }
.board td.who { text-align: left; font-weight: 600; max-width: 0; width: 100%; }
.board td.who span.name { display: flex; align-items: center; gap: 8px; }
.board td.who .name b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board td.who .dot { border-color: var(--asphalt); }
.board td.pts { font: 800 1.6rem/1 var(--display); }
.board tr.leader td { background: var(--yellow); border-bottom-color: rgba(31,37,45,.25); }
.board tr.mine td.who b::after { content: ' (du)'; font-weight: 500; color: var(--muted); }
.board tr.leader.mine td.who b::after { color: var(--asphalt); }
.tag { font: 700 .8rem/1 var(--text); background: var(--asphalt); color: var(--yellow); padding: 4px 7px; border-radius: 3px; flex: none; }

.empty { border: 2px dashed var(--line); border-radius: 8px; padding: 22px; background: rgba(255,255,255,.6); }
.empty p:last-child { margin-bottom: 0; }

.games { display: grid; gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.game { display: grid; gap: 4px; padding: 14px 16px; background: var(--paper); border: 2px solid var(--asphalt); border-radius: 8px; text-decoration: none; color: inherit; }
.game:hover { background: #fffbe0; }
.game .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.game strong { font: 800 1.35rem/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game .info { color: var(--muted); font-size: .95rem; }
.pill { font: 700 .82rem/1 var(--text); padding: 5px 9px; border-radius: 99px; border: 2px solid var(--asphalt); white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 6px; }
.pill.running { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill.running::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: pulse 1.6s infinite; }
.pill.lobby { background: var(--yellow); }
.pill.finished { background: transparent; color: var(--muted); border-color: var(--line); }
.joinform { display: flex; gap: 8px; }
.joinform input { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.joinform .btn { flex: none; }

/* ───── Auth / Karten-Layout / Einstellungen ───── */
.narrow { max-width: 460px; margin: 0 auto; padding: 36px 20px 64px; }
.narrow h1 { font-size: 3rem; margin-bottom: 20px; }
.card { background: var(--paper); border: 2px solid var(--asphalt); border-radius: 10px; padding: 20px; }
.card + .card { margin-top: 20px; }
.card h2 { font-size: 1.7rem; margin-bottom: 14px; }
.settings { max-width: 640px; margin: 0 auto; padding: 32px 20px 64px; }
.settings > h1 { font-size: 3rem; margin-bottom: 6px; }
.settings > .muted { margin-bottom: 22px; }
.inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
details.danger summary { cursor: pointer; font-weight: 600; color: var(--red); }
details.danger[open] summary { margin-bottom: 12px; }

/* ───── Karte + Seitenpanel ───── */
.split { display: grid; grid-template-columns: 1fr; }
.map { height: 52dvh; min-height: 320px; background: #dfe6e2; position: relative; z-index: 0; }
.panel { padding: 20px; background: var(--chalk); }
.map-hint { position: absolute; z-index: 500; left: 50%; top: 14px; transform: translateX(-50%); background: var(--asphalt); color: #fff; padding: 9px 14px; border-radius: 6px; font-weight: 600; pointer-events: none; width: max-content; max-width: calc(100% - 28px); text-align: center; }
.panel h1 { font-size: 2.6rem; margin: 10px 0 8px; overflow-wrap: anywhere; }
.panel-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code { font: 700 .95rem/1 var(--text); color: var(--muted); letter-spacing: .06em; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 16px 0; padding: 14px 0; border-top: 2px solid var(--asphalt); border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; font: 700 1.35rem/1.1 var(--display); }
.stack { display: grid; gap: 10px; margin: 16px 0; }
.banner { background: var(--yellow); border: 2px solid var(--asphalt); border-radius: 8px; padding: 14px 16px; margin: 16px 0; font: 700 1.5rem/1.15 var(--display); }
.nearest { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; background: var(--asphalt); color: #fff; border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
.nearest .arrow { width: 64px; height: 64px; }
.nearest .big { font: 800 2.4rem/1 var(--display); color: var(--yellow); }
.nearest .tiny { font-size: .85rem; color: #b8c2cc; margin-top: 4px; }
.nearest .warn { color: #ffb4ad; }
.list { list-style: none; margin: 8px 0 22px; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow small { display: block; color: var(--muted); }
.list .num { font: 800 1.3rem/1 var(--display); }
.panel h2 { font-size: 1.6rem; margin-top: 24px; }
.badge { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--asphalt); background: var(--yellow); display: grid; place-items: center; font: 800 1rem/1 var(--display); flex: none; }
.badge.done { color: #fff; }
.note { background: #e7ebe7; border-radius: 6px; padding: 10px 12px; font-size: .92rem; margin: 12px 0; }

@media (max-width: 520px) {
  .board .tag { display: none; }
  .board td, .board th { padding: 9px 6px; }
  .board td.rank { width: 2rem; }
}
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.1fr .9fr; padding-top: 56px; padding-bottom: 56px; }
  .home-grid { grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: start; }
  .split { grid-template-columns: 1fr 420px; height: calc(100dvh - var(--bar)); }
  .map { height: 100%; }
  .panel { overflow-y: auto; border-left: 2px solid var(--asphalt); }
}

/* ───── Leaflet-Marker ───── */
.vh-icon { background: none; border: 0; }
.flag { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--asphalt); display: grid; place-items: center; font: 800 17px/1 var(--display); color: var(--asphalt); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.flag.done { color: #fff; }
.center-pin { width: 16px; height: 16px; background: var(--asphalt); border: 2px solid #fff; transform: rotate(45deg); }
.me-dot { position: relative; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.me-dot::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--blue); animation: ring 2s ease-out infinite; }
.rider { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; color: #fff; display: grid; place-items: center; font: 800 13px/1 var(--display); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.leaflet-container { font-family: var(--text); }

/* ───── Toasts ───── */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; z-index: 3000; pointer-events: none; padding: 0 16px; }
.toast { background: var(--asphalt); color: #fff; padding: 12px 16px; border-radius: 8px; font-weight: 600; max-width: 460px; box-shadow: 0 4px 16px rgba(0,0,0,.3); transition: opacity .4s, transform .4s; }
.toast.win { background: var(--yellow); color: var(--asphalt); border: 2px solid var(--asphalt); font: 800 1.35rem/1.15 var(--display); }
.toast.err { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pill.running::before, .me-dot::after { animation: none; }
  .toast { transition: none; }
}

/* ═══════════════════════════ Erweiterungen: Konten, Fotos, Quests, Teams, Admin ═══════════════════════════ */

/* ───── Avatare & Chips ───── */
.avatar { border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--asphalt); }
.avatar.fallback { display: grid; place-items: center; color: #fff; font: 700 1rem/1 var(--display); border: 2px solid var(--asphalt); }
.chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; font-weight: 600; max-width: 100%; }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.team { text-decoration: none; }
.small-num { font: 700 .92rem/1 var(--text) !important; color: var(--muted); }

/* ───── Topbar: Suche, Glocke, Nutzermenü ───── */
.topbar-right { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { position: relative; background: transparent; border: 0; color: #fff; cursor: pointer; padding: 8px; border-radius: 50%; display: grid; place-items: center; min-height: 40px; min-width: 40px; }
.icon-btn:hover { background: rgba(255,255,255,.14); }
.badge-num { position: absolute; top: 2px; right: 2px; background: var(--yellow); color: var(--asphalt); font: 800 .68rem/1 var(--text); min-width: 17px; height: 17px; border-radius: 99px; display: grid; place-items: center; padding: 0 3px; border: 2px solid var(--blue); }
.user-btn { background: transparent; border: 0; color: #fff; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 99px; font-weight: 600; }
.user-btn:hover { background: rgba(255,255,255,.14); }
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper); color: var(--asphalt); border: 2px solid var(--asphalt); border-radius: 8px; min-width: 240px; max-width: min(90vw, 340px); box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 1200; overflow: hidden; }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.menu-head a { font-weight: 600; }
.menu-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 11px 14px; text-decoration: none; color: inherit; font: inherit; cursor: pointer; }
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { background: var(--chalk); }
.menu-item.muted { color: var(--muted); cursor: default; }
.menu-item.muted:hover { background: transparent; }
.menu-item small { color: var(--muted); font-size: .82rem; }
.notif-item.unread { background: #fff8dd; }
.search-box { position: relative; }
.search-input { min-height: 40px; border-radius: 99px; border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12); color: #fff; padding: 0 14px; width: 190px; font: 500 .95rem/1 var(--text); }
.search-input::placeholder { color: rgba(255,255,255,.75); }
.search-input:focus { background: #fff; color: var(--asphalt); }
.search-input:focus::placeholder { color: var(--muted); }
.searchresults { position: absolute; top: calc(100% + 8px); left: 0; width: max(260px, 100%); background: var(--paper); color: var(--asphalt); border: 2px solid var(--asphalt); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); overflow: hidden; z-index: 1200; }
.searchresult { display: flex; align-items: center; gap: 10px; padding: 9px 12px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.searchresult:last-child { border-bottom: 0; }
.searchresult:hover { background: var(--chalk); }
.searchresult.muted { color: var(--muted); }

/* ───── Modal-Dialoge ───── */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,24,29,.55); display: grid; place-items: center; z-index: 2500; padding: 16px; }
.modal { background: var(--paper); border: 2px solid var(--asphalt); border-radius: 10px; width: min(480px, 100%); max-height: 90dvh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 2px solid var(--asphalt); }
.modal-head h2 { font-size: 1.6rem; }
.modal-close { background: transparent; border: 0; font-size: 1.3rem; cursor: pointer; padding: 6px 10px; line-height: 1; color: var(--asphalt); }
.modal-body { padding: 18px; }

/* ───── Ankündigung, Aktivität ───── */
.announcement { background: var(--yellow); border-bottom: 2px solid var(--asphalt); padding: 10px 0; font-weight: 600; text-align: center; margin: -1px 0 0; }
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.activity-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.activity-list li:last-child { border-bottom: 0; }
.activity-list .grow { flex: 1; min-width: 0; }
.activity-list small { color: var(--muted); flex: none; }

/* ───── Profil & Erfolge ───── */
.profile-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.profile-head .avatar, .profile-head .avatar.fallback { width: 88px; height: 88px; font-size: 2rem; }
.profile-head h1 { font-size: 2.6rem; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.facts-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 480px) { .facts-4 { grid-template-columns: repeat(4, 1fr); } }
.achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0 20px; }
.achv { border: 2px solid var(--line); border-radius: 8px; padding: 12px; background: var(--paper); opacity: .55; }
.achv.earned { border-color: var(--asphalt); opacity: 1; background: #fffbe0; }
.achv-title { font-weight: 700; margin-bottom: 8px; }
.achv-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.achv-fill { height: 100%; background: var(--blue); }
.achv.earned .achv-fill { background: var(--yellow); }
.achv-val { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ───── Fotos ───── */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid var(--asphalt); text-decoration: none; display: block; background: var(--asphalt); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-badge { position: absolute; top: 6px; right: 6px; background: rgba(31,37,45,.75); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; font-size: .95rem; }
.tile-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 18px 8px 6px; background: linear-gradient(to top, rgba(0,0,0,.7), transparent); color: #fff; font-size: .8rem; font-weight: 600; }
.tile-foot .avatar, .tile-foot .avatar.fallback { border-color: #fff; }
.tile-foot span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-detail img { width: 100%; border-radius: 10px; border: 2px solid var(--asphalt); display: block; }
.photo-pin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--asphalt); overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.photo-pin img { width: 100%; height: 100%; object-fit: cover; }
.comments { margin-top: 10px; }
.comment-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.comment-list li { display: flex; align-items: flex-start; gap: 10px; }
.comment-list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ava-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* ───── Reiter (Tabs) ───── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.tab { background: var(--paper); border: 2px solid var(--asphalt); border-radius: 99px; padding: 8px 16px; font: 700 .95rem/1 var(--text); cursor: pointer; color: var(--asphalt); min-height: 40px; }
.tab.active { background: var(--asphalt); color: #fff; }

/* ───── Quests ───── */
.quest-card h2 { font-size: 1.5rem; }
.pill.quest-open { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill.quest-pending { background: var(--yellow); }
.pill.quest-done { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
.pill.quest-closed { background: transparent; color: var(--muted); border-color: var(--line); }

/* ───── Teams ───── */
.invite-code { font: 800 1.5rem/1 var(--display); letter-spacing: .08em; background: var(--chalk); border: 2px solid var(--asphalt); border-radius: 6px; padding: 8px 14px; }
.field-group { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; margin: -6px 0 14px; display: grid; gap: 12px; }

/* ───── Admin ───── */
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; margin: 14px 0 24px; border-bottom: 2px solid var(--asphalt); padding-bottom: 10px; }
.admin-nav .navlink { color: var(--asphalt); }
.admin-nav .navlink:hover { background: rgba(31,37,45,.07); }
.admin-nav .navlink.active { background: var(--asphalt); color: #fff; box-shadow: none; border-radius: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--paper); border: 2px solid var(--asphalt); border-radius: 8px; padding: 14px; }
.kpi-val { font: 800 2rem/1 var(--display); }
.kpi-label { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--paper); border: 2px solid var(--asphalt); border-radius: 8px; overflow: hidden; }
.admin-table th { text-align: left; font-size: .85rem; color: var(--muted); padding: 9px 10px; border-bottom: 2px solid var(--asphalt); background: #e7ebe7; white-space: nowrap; }
.admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); }
.submission { display: flex; gap: 14px; align-items: flex-start; }
.sub-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 2px solid var(--asphalt); flex: none; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list a { display: block; padding: 12px 0; text-decoration: none; color: inherit; }
.notif-list small { display: block; color: var(--muted); margin-top: 2px; }

@media (max-width: 860px) {
  .bar { flex-wrap: wrap; height: auto; min-height: var(--bar); padding: 10px 0; row-gap: 8px; }
  .brand { order: 1; }
  .topbar-right { order: 2; margin-left: auto; }
  .search-input { width: 130px; }
  .nav { order: 3; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .navlink { max-width: none; }
}
@media (max-width: 480px) {
  .photo-grid, .achv-grid, .kpis { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .admin-table { display: block; overflow-x: auto; }
  .search-input { width: 100px; }
}
