:root {
  --sgr-red: #c83231;
  --sgr-red-dark: #9d2525;
  --sgr-red-soft: #f8e9e7;
  --ink: #191915;
  --muted: #6f6d68;
  --canvas: #f5f3ef;
  --surface: #fff;
  --surface-raised: #fffdfb;
  --line: #e6e1dc;
  --success: #21845a;
  --warning: #bb741d;
  --danger: #b42318;
  --gold: #d8a724;
  --silver: #98a1a7;
  --bronze: #b87547;
  --shadow-sm: 0 4px 16px rgba(42, 34, 28, .07);
  --shadow-lg: 0 22px 60px rgba(42, 34, 28, .16);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --content: 1120px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--canvas); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% -5%, rgba(200, 50, 49, .08), transparent 32rem),
    var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }

:focus-visible { outline: 3px solid rgba(200, 50, 49, .35); outline-offset: 3px; }

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 1000;
  padding: .75rem 1rem;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 78px;
  padding: .7rem max(1rem, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid rgba(230, 225, 220, .85);
  background: rgba(255, 253, 251, .9);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  text-decoration: none;
  min-width: 0;
}
.brand img { width: 118px; height: auto; display: block; }
.brand span { display: grid; min-width: 0; line-height: 1.15; }
.brand strong { overflow: hidden; font-size: .98rem; text-overflow: ellipsis; white-space: nowrap; }
.brand small { margin-top: .25rem; color: var(--muted); font-size: .77rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-actions { display: flex; align-items: center; gap: .55rem; }
.icon-button, .sync-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
}
.icon-button { width: 44px; border-radius: 50%; font-weight: 800; text-transform: uppercase; }
.sync-pill { display: flex; align-items: center; gap: .45rem; padding: 0 .75rem; border-radius: 999px; font-size: .78rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px rgba(187, 116, 29, .12); }
.sync-pill.synced .status-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(33, 132, 90, .12); }
.sync-pill.offline .status-dot, .sync-pill.error .status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(180, 35, 24, .12); }

.cockpit-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border-radius: 999px;
  background: #1a202c;
  color: #f7fafc;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: all .15s ease;
  min-height: 40px;
}
.cockpit-pill:hover { background: #2d3748; transform: translateY(-1px); }

.viewer-link-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .02em;
  box-shadow: var(--shadow-sm);
  transition: all .15s ease;
  min-height: 40px;
}
.viewer-link-pill:hover { background: #f7f5f2; transform: translateY(-1px); }

.admin-mode .app-header {
  border-bottom: 2px solid #d97706;
}
.admin-mode .brand strong::after {
  content: " · ADMIN";
  font-size: .68rem;
  font-weight: 850;
  color: #d97706;
  vertical-align: middle;
  margin-left: .35rem;
}

.network-banner {
  position: sticky;
  top: 78px;
  z-index: 20;
  padding: .65rem 1rem;
  background: #fff2d9;
  color: #70420c;
  text-align: center;
  font-size: .86rem;
  border-bottom: 1px solid #efd7ab;
}

#app-main { max-width: var(--content); margin: 0 auto; padding: 1.1rem 1rem 2rem; }
.view-stack { display: grid; gap: 1rem; }
.section { display: grid; gap: .8rem; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.section-header h1, .section-header h2, .section-header p { margin: 0; }
.section-header h1 { font-size: clamp(1.55rem, 5vw, 2.5rem); letter-spacing: -.04em; }
.section-header h2 { font-size: 1.17rem; letter-spacing: -.02em; }
.section-header p { color: var(--muted); font-size: .9rem; }

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1.25rem;
  padding: .9rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #a22424 0%, var(--sgr-red) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(157, 37, 37, .15);
}
.hero-copy { display: flex; flex-direction: column; gap: .2rem; }
.eyebrow { margin: 0; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.hero h1 { margin: 0; font-size: 1.35rem; line-height: 1.15; letter-spacing: -.02em; }
.hero-stat { display: flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(8px); white-space: nowrap; }
.hero-stat strong { font-size: 1.05rem; font-weight: 850; line-height: 1; }
.hero-stat span { font-size: .78rem; opacity: .9; }


.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 1rem; }
.card-title { margin: 0; font-size: 1rem; }
.card-subtitle { margin: .3rem 0 0; color: var(--muted); font-size: .84rem; }
.space-top-sm { margin-top: .55rem; }
.space-top { margin-top: 1rem; }
.next-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; padding: 1rem; }
.date-tile { display: grid; place-items: center; width: 54px; height: 58px; border-radius: 14px; background: var(--sgr-red-soft); color: var(--sgr-red-dark); }
.date-tile strong { font-size: 1.25rem; line-height: 1; }
.date-tile small { font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.mini-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* EDLES 3D-SIEGERPODEST */
.podium-stage {
  padding: 1.3rem .85rem .55rem;
  background: radial-gradient(circle at 50% 25%, #ffffff 0%, #faf8f5 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.03);
}
.podium-deck {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: flex-end;
  gap: .65rem;
}
.podium-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  position: relative;
  cursor: pointer;
  transition: transform .18s cubic-bezier(0.16, 1, 0.3, 1);
}
.podium-pillar:hover {
  transform: translateY(-3px);
}
.podium-hero-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  margin-bottom: .65rem;
  width: 100%;
  position: relative;
  z-index: 2;
}
.gold-crown {
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: -.25rem;
  animation: floatCrown 2.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(217, 167, 38, 0.4));
}
@keyframes floatCrown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.podium-avatar-ring {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  position: relative;
}
.podium-pillar.step-1 .podium-avatar-ring {
  width: 56px;
  height: 56px;
  border: 3px solid #f4d068;
  box-shadow: 0 6px 18px rgba(217, 167, 38, 0.35);
}
.podium-pillar.step-2 .podium-avatar-ring {
  border: 2.5px solid #cbd5e1;
}
.podium-pillar.step-3 .podium-avatar-ring {
  border: 2.5px solid #e8ba95;
}
.podium-avatar-initials {
  font-size: .9rem;
  font-weight: 850;
  color: var(--ink);
}
.podium-pillar.step-1 .podium-avatar-initials {
  font-size: 1.05rem;
}
.podium-person-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .84rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: .15rem;
}
.podium-score-pill {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(0,0,0,.05);
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-pillar.step-1 .podium-score-pill {
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
}
.podium-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px 16px 4px 4px;
  position: relative;
}
.podium-pillar.step-1 .podium-block {
  min-height: 130px;
  background: linear-gradient(180deg, #fff3c4 0%, #f4d068 35%, #d9a726 100%);
  color: #5a4106;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 24px rgba(217, 167, 38, 0.25);
}
.podium-pillar.step-2 .podium-block {
  min-height: 96px;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 40%, #cbd5e1 100%);
  color: #334155;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 4px 14px rgba(0,0,0,0.06);
}
.podium-pillar.step-3 .podium-block {
  min-height: 72px;
  background: linear-gradient(180deg, #fdeddd 0%, #e8ba95 40%, #c48356 100%);
  color: #522d14;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 4px 14px rgba(0,0,0,0.06);
}
.podium-rank-num {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
}
.podium-pillar.step-1 .podium-rank-num {
  font-size: 2.1rem;
}
.podium-rank-sub {
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .85;
  margin-top: .15rem;
}
.podium-baseboard {
  height: 5px;
  background: linear-gradient(90deg, #cbd5e1 0%, #d9a726 50%, #c48356 100%);
  border-radius: 4px;
  margin-top: 6px;
  opacity: .85;
}
.empty-pillar {
  visibility: hidden;
}

.ranking-list { overflow: hidden; }
.ranking-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .65rem;
  min-height: 66px;
  padding: .7rem 1rem;
  border-top: 1px solid var(--line);
}
.ranking-row:first-child { border-top: 0; }
.clickable-row {
  cursor: pointer;
  transition: background .12s ease;
}
.clickable-row:hover {
  background: #fcfaf7;
}
.rank { font-size: .9rem; font-weight: 850; color: var(--muted); }
.person-name { min-width: 0; }
.person-name strong, .person-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name strong { font-size: .94rem; }
.person-name span { margin-top: .2rem; color: var(--muted); font-size: .76rem; }
.points { text-align: right; }
.points strong { display: block; font-size: 1.08rem; }
.points small { color: var(--muted); }
.row-arrow {
  display: flex;
  align-items: center;
  color: var(--muted);
  opacity: .5;
  margin-left: .2rem;
}
.clickable-row:hover .row-arrow {
  opacity: 1;
  color: var(--sgr-red);
}

.grid { display: grid; gap: .8rem; }
.discipline-grid, .action-grid { grid-template-columns: 1fr; }
.discipline-card, .action-card { width: 100%; text-align: left; color: inherit; }
button.discipline-card, button.action-card { padding: 0; }
.discipline-card { overflow: hidden; }
.discipline-accent { height: 5px; background: var(--sgr-red); }
.discipline-card .card-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .8rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .75rem; color: var(--muted); font-size: .76rem; }
.meta-row span { display: inline-flex; align-items: center; gap: .3rem; }
.badge { display: inline-flex; align-items: center; width: fit-content; min-height: 25px; padding: .2rem .55rem; border-radius: 999px; background: #efede9; color: #5f5a56; font-size: .7rem; font-weight: 760; }
.badge.open { background: #e6f4ed; color: #176b47; }
.badge.completed { background: var(--sgr-red-soft); color: var(--sgr-red-dark); }

.button, .button-secondary, .button-quiet, .button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 48px;
  padding: .75rem 1rem;
  border-radius: 14px;
  font-weight: 760;
  text-decoration: none;
}
.button { border: 1px solid var(--sgr-red); background: var(--sgr-red); color: #fff; box-shadow: 0 8px 20px rgba(200, 50, 49, .18); }
.button:hover { background: var(--sgr-red-dark); }
.button-secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.button-quiet { min-height: 40px; padding: .45rem .7rem; border: 0; background: transparent; color: var(--sgr-red-dark); }
.button-danger { border: 1px solid #f2b8b5; background: #fff4f3; color: var(--danger); }
.button.full, .button-secondary.full { width: 100%; }

.empty-state { display: grid; justify-items: start; gap: .6rem; min-height: 170px; padding: 1.25rem; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--sgr-red-soft); color: var(--sgr-red); }
.empty-state h2, .empty-state p { margin: 0; }
.empty-state p { color: var(--muted); line-height: 1.5; }

.capture-header { display: flex; align-items: center; gap: .75rem; }
.capture-eyebrow { margin: 0; color: var(--sgr-red); }
.capture-title { margin: .2rem 0 0; }
.back-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transform: rotate(180deg); }
.result-list { display: grid; gap: .65rem; }
.result-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(92px, 130px); align-items: center; gap: .7rem; padding: .75rem; }
.result-entry input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--sgr-red); }
.result-input, .field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d9d3cd;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}
.result-input { padding: .65rem; text-align: right; font-weight: 750; }
.result-input:disabled { background: #f0eeeb; }
.save-bar { position: sticky; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 15; padding: .8rem 0; background: linear-gradient(transparent, var(--canvas) 22%); }

.petanque-board { display: grid; gap: .9rem; padding: 1rem; }
.team-panel { display: grid; gap: .65rem; padding: .9rem; border-radius: 16px; background: #f3f0ec; }
.team-panel h3 { margin: 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.team-panel select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: .6rem; font-size: 16px; }
.score-line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .7rem; }
.score-line input { width: 100%; min-width: 0; height: 74px; border: 1px solid var(--line); border-radius: 16px; text-align: center; font-size: 2rem; font-weight: 900; }
.score-line span { font-size: 1.5rem; color: var(--muted); }
.petanque-preview { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .8rem; border-radius: 14px; background: var(--sgr-red-soft); color: var(--sgr-red-dark); text-align: center; }
.petanque-preview strong, .petanque-preview span { display: block; }
.petanque-preview strong { font-size: 1.25rem; }
.petanque-preview span { margin-top: .15rem; font-size: .72rem; }

.action-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.action-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--sgr-red-soft); color: var(--sgr-red-dark); }
.list-card { overflow: hidden; }
.list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; min-height: 66px; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.danger-text { color: var(--danger) !important; }
.petanque-match-item { padding: .75rem 1rem; }
.list-item button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: #f2efec; color: var(--ink); }
.archive-row { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; color: inherit; text-align: left; }

.field-grid { display: grid; gap: .85rem; }
.field { display: grid; gap: .38rem; }
.field label, .field > span { font-size: .8rem; font-weight: 750; }
.field small { color: var(--muted); line-height: 1.4; }
.field input, .field select, .field textarea { padding: .7rem .8rem; }
.check-field { display: flex; align-items: flex-start; gap: .65rem; }
.check-field input { width: 21px; height: 21px; accent-color: var(--sgr-red); }
.spaced-field { margin-top: .85rem; }
.spaced-check { margin-top: 1rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1rem; }
.inline-note { padding: .8rem; border-radius: 12px; background: #f3f0ec; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.danger-zone { border-color: #f0c6c2; background: #fff9f8; }

.wizard-progress { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; }
.wizard-step-pill { flex: 1; height: 6px; border-radius: 99px; background: #e8e4df; transition: background .2s ease; }
.wizard-step-pill.active { background: var(--sgr-red); }
.wizard-step-pill.completed { background: var(--sgr-red-dark); }
.wizard-checklist { display: grid; gap: .5rem; max-height: 280px; overflow-y: auto; padding-right: .2rem; }
.wizard-check-item { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; user-select: none; }
.wizard-check-item input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--sgr-red); }
.wizard-check-info { display: flex; flex-direction: column; gap: .1rem; }
.wizard-check-info strong { font-size: .9rem; }
.wizard-check-info span { font-size: .76rem; color: var(--muted); }
.wizard-summary-card { display: grid; gap: .75rem; padding: 1rem; border-radius: 16px; background: #f6f3ee; border: 1px solid #e7e2db; }
.wizard-summary-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.wizard-summary-row strong { color: var(--sgr-red-dark); }


.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; background: rgba(25, 25, 21, .46); backdrop-filter: blur(5px); }
.modal { max-height: min(90vh, 760px); overflow: auto; padding: 1rem; border-radius: 24px 24px 0 0; background: var(--surface-raised); box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-header h2 { margin: 0; font-size: 1.2rem; }
.modal-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1eeeb; }

.toast-root { position: fixed; left: 1rem; right: 1rem; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 200; display: grid; justify-items: center; pointer-events: none; }
.toast { max-width: 520px; padding: .8rem 1rem; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 70px;
  padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 251, .94);
  backdrop-filter: blur(18px);
}
.bottom-nav.viewer-nav {
  grid-template-columns: repeat(3, 1fr);
}
.bottom-nav.admin-nav {
  grid-template-columns: repeat(4, 1fr);
}
.bottom-nav button { display: grid; place-items: center; align-content: center; gap: .2rem; min-width: 0; min-height: 55px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: .67rem; }
.bottom-nav button.active { color: var(--sgr-red); background: var(--sgr-red-soft); font-weight: 800; }
.admin-mode .bottom-nav button.active { color: #d97706; background: #fef3c7; }
.nav-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.action-buttons-inline {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.loading-state { display: grid; gap: 1rem; }
.loading-state p { text-align: center; color: var(--muted); }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #ebe7e2 25%, #f5f2ee 40%, #ebe7e2 65%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
.hero-skeleton { height: 68px; }
.card-skeleton { height: 170px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (min-width: 640px) {
  #app-main { padding: 1.5rem 1.5rem 3rem; }
  .app-header { padding-left: max(1.5rem, calc((100vw - var(--content)) / 2)); padding-right: max(1.5rem, calc((100vw - var(--content)) / 2)); }
  .brand img { width: 146px; }
  .brand strong { font-size: 1.08rem; }
  .discipline-grid, .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { place-items: center; padding: 1rem; }
  .modal { width: min(620px, 100%); border-radius: 24px; }
}

@media (max-width: 460px) {
  .sync-pill { width: 44px; padding: 0; justify-content: center; }
  .sync-pill > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (min-width: 960px) {
  .dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(340px, .7fr); gap: 1rem; align-items: start; }
  .discipline-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bottom-nav { left: 50%; right: auto; bottom: 1rem; width: min(620px, calc(100% - 2rem)); transform: translateX(-50%); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
  .app-shell { padding-bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Mobile First Jassen & Erfassung UI */
.jass-entry {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .85rem 1rem;
}
.jass-person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.jass-check-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1rem;
  cursor: pointer;
}
.jass-check-label input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--sgr-red);
}
.jass-total-badge {
  display: inline-flex;
  align-items: center;
  padding: .3rem .65rem;
  border-radius: 8px;
  background: var(--line);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}
.jass-total-badge.active {
  background: var(--sgr-red-soft);
  color: var(--sgr-red-dark);
}
.jass-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.jass-input-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.jass-input-field span {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 600;
}
.jass-input {
  font-size: 1.1rem;
  text-align: center;
  font-weight: 800;
}

/* ELEGANTE ATHLETEN-KARTE */
.athlete-card {
  padding: 1.15rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(0,0,0,.03);
  display: grid;
  gap: .8rem;
}
.athlete-card.unselected {
  background: #faf8f5;
  border-style: dashed;
}
.athlete-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.athlete-hero {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}
.athlete-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2b333a 0%, #151a1e 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 850;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  flex-shrink: 0;
}
.athlete-avatar.placeholder {
  background: #e6e2dc;
  color: #78716c;
  font-size: 1.4rem;
  box-shadow: none;
}
.athlete-identity {
  min-width: 0;
}
.athlete-name-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.athlete-name {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 850;
  line-height: 1.2;
  color: var(--ink);
}
.athlete-switch-btn {
  border: 0;
  background: #ede8e1;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  padding: .2rem .5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s ease;
}
.athlete-switch-btn:hover {
  background: #ded7ce;
  color: var(--ink);
}
.athlete-subtitle {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .78rem;
}
.athlete-rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: .45rem .6rem;
  border-radius: 14px;
  background: #f4f1ec;
  color: var(--ink);
  border: 1px solid #e2ddd6;
  text-align: center;
  flex-shrink: 0;
}
.athlete-rank-badge.top-1 {
  background: linear-gradient(135deg, #fff3c4 0%, #f4d068 100%);
  color: #694e09;
  border-color: #e2b93b;
  box-shadow: 0 4px 12px rgba(226, 185, 59, 0.25);
}
.athlete-rank-badge.top-2 {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #334155;
  border-color: #cbd5e1;
}
.athlete-rank-badge.top-3 {
  background: linear-gradient(135deg, #fdeddd 0%, #e8ba95 100%);
  color: #673d22;
  border-color: #c48356;
}
.athlete-rank-label {
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .08em;
  opacity: .8;
}
.athlete-rank-value {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  margin-top: .1rem;
}
.athlete-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
  padding: .65rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.athlete-stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.stat-label {
  font-size: .68rem;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stat-val {
  font-size: 1.05rem;
  font-weight: 850;
  color: var(--ink);
  margin-top: .15rem;
}
.stat-val small {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
}
.athlete-sim-box {
  background: #fbf9f6;
  border: 1px solid #e8e2d9;
  border-radius: 14px;
  padding: .75rem .85rem;
  display: grid;
  gap: .55rem;
}
.athlete-sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.sim-title-label {
  font-size: .78rem;
  font-weight: 800;
  color: var(--ink);
}
.athlete-sim-select {
  padding: .35rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: .82rem;
  font-weight: 600;
  max-width: 190px;
}
.athlete-sim-targets {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}
.sim-targets-label {
  font-size: .74rem;
  font-weight: 750;
  color: var(--muted);
}
.sim-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.sim-rank-btn {
  min-width: 32px;
  height: 30px;
  padding: 0 .45rem;
  border-radius: 8px;
  border: 1px solid #dcd7cf;
  background: #fff;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
  transition: all .12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sim-rank-btn:hover {
  border-color: var(--sgr-red);
}
.sim-rank-btn.active {
  background: var(--sgr-red);
  border-color: var(--sgr-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(200, 50, 49, 0.25);
}
.athlete-prediction {
  padding: .55rem .75rem;
  border-radius: 10px;
  font-size: .84rem;
  line-height: 1.4;
  border-left: 3px solid #cbd5e1;
  background: #fff;
}
.athlete-prediction.positive {
  border-left-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}
.athlete-prediction.stable {
  border-left-color: #0284c7;
  background: #f0f9ff;
  color: #0369a1;
}
.athlete-prediction.neutral {
  border-left-color: #64748b;
  background: #f8fafc;
  color: #334155;
}
.podium-alert {
  color: #b45309;
}
.athlete-card-actions {
  display: flex;
  justify-content: flex-end;
}
.athlete-profile-btn {
  font-size: .84rem;
  font-weight: 800;
  color: var(--sgr-red-dark);
  padding: .3rem .4rem;
  cursor: pointer;
}
.athlete-unselected-content {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.athlete-unselected-picker select {
  font-size: .92rem;
  font-weight: 600;
}
.compact-select.full {
  width: 100%;
}

/* Suchleisten */
.search-box { position: relative; display: flex; align-items: center; width: 100%; }
.search-input {
  width: 100%;
  min-height: 44px;
  padding: .6rem 2.2rem .6rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: .9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus {
  border-color: var(--sgr-red);
  box-shadow: 0 0 0 3px rgba(200, 50, 49, .15);
  outline: none;
}
.search-clear-btn {
  position: absolute;
  right: .55rem;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #edeae5;
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s ease;
}
.search-clear-btn:hover {
  background: #ded9d1;
  color: var(--ink);
}

/* Detail Modals */
.member-detail-view, .discipline-detail-view { display: grid; gap: .8rem; }
.member-detail-hero { display: flex; align-items: center; gap: .9rem; padding: .4rem 0; }
.member-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--sgr-red-soft);
  color: var(--sgr-red-dark);
  font-size: 1.2rem;
  font-weight: 850;
  flex-shrink: 0;
}
.member-hero-meta h2 { margin: 0; font-size: 1.25rem; }
.member-hero-meta .card-subtitle { margin-top: .15rem; }
.member-stats-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); gap: .5rem; }
.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .55rem .4rem;
  border-radius: 12px;
  text-align: center;
}
.stat-pill span { font-size: .68rem; text-transform: uppercase; font-weight: 700; opacity: .8; }
.stat-pill strong { font-size: 1.05rem; font-weight: 850; margin-top: .15rem; }
.stat-pill.rank-pill { background: #fef3c7; color: #92400e; }
.stat-pill.points-pill { background: #e0f2fe; color: #0369a1; }
.stat-pill.disc-pill { background: #f1f5f9; color: #475569; }
.stat-pill.drop-pill { background: #fee2e2; color: #991b1b; }

.member-disc-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 1rem; }
.member-disc-points { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.member-disc-points strong { font-size: .95rem; }
.discarded-item { opacity: .65; background: #faf9f7; }
.strikethrough { text-decoration: line-through; color: var(--muted); }
.drop-badge { display: inline-block; padding: .15rem .45rem; border-radius: 6px; background: #fee2e2; color: #b91c1c; font-size: .68rem; font-weight: 750; }

/* Spotlight Nächster Wettkampf */
.next-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1rem;
  border-left: 4px solid var(--sgr-red);
  background: #fff;
  transition: transform .12s ease, box-shadow .12s ease;
}
.next-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.next-copy { min-width: 0; }
.next-eyebrow {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--sgr-red);
  margin: 0 0 .15rem 0;
  letter-spacing: .06em;
}

/* Disziplin-Karten Erweiterungen */
.disc-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: .25rem;
}
.completed-accent {
  background: #176b47 !important;
}
.winner-badge {
  background: #fef3c7 !important;
  color: #92400e !important;
  font-weight: 750;
}
.meta-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: .85rem 1rem;
}

/* Archiv-Zeilen */
.archive-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: .85rem 1rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-top: 1px solid var(--line);
}
.archive-row:first-child { border-top: 0; }
.archive-row:hover { background: #fdfbf7; }

/* Expand Button */
.expand-button {
  font-size: .88rem;
  font-weight: 750;
  min-height: 44px;
}

/* Disziplin-Konfigurator Styles */
.configurator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0;
}
.mode-card {
  padding: 0.85rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
}
.mode-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.mode-card.active {
  border-color: var(--sgr-red);
  background: #fff5f5;
  box-shadow: 0 0 0 1px var(--sgr-red);
}
.mode-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mode-card-icon {
  font-size: 1.3rem;
  line-height: 1;
}
.mode-card-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
}
.mode-card-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
  margin: 0;
}
.configurator-subpanel {
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin: 0.75rem 0;
  animation: fadeIn 0.15s ease-out;
}
.preview-mockup-frame {
  margin-top: 1rem;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  padding: 1rem;
}
.preview-mockup-header {
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}



