/* L'app d'analyse de padel : les couleurs des maquettes (fond clair, encre presque noire, citron
   pour soi, bleu pour les actions), en clair et en sombre, du téléphone à l'ordinateur. */

@font-face {
  font-family: Inter;
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: Figtree;
  src: url('/fonts/figtree.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --ground: #f5f6f2;
  --surface: #ffffff;
  --ink: #12161c;
  --muted: #59606b;
  --line: #e6e8ec;
  --blue: #1e4fd0;
  --blue-ink: #ffffff;
  --lime: #d4f25a;
  --night: #12161c;
  --night-2: #2a3039;
  --soft: #b9c0cc;
  --good: #1c7a4a;
  --bad: #b4471f;
  --radius: 16px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d1015;
    --surface: #171b22;
    --ink: #eef0f3;
    --muted: #a3abb7;
    --line: #2a3039;
    --blue: #5b84f0;
    --blue-ink: #0d1015;
    --night: #1d222b;
    --night-2: #2f3642;
    --good: #5cc48b;
    --bad: #f08a62;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font:
    16px/1.45 Inter,
    system-ui,
    -apple-system,
    sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a {
  color: var(--blue);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
img,
video,
svg {
  max-width: 100%;
}

/* ───────── menu : en bas sur téléphone, en haut sur ordinateur ───────── */

.nav {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav .brand {
  display: none;
}
.tabs-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--nav-h);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
}
.tab[aria-current='page'] {
  color: var(--blue);
  font-weight: 600;
}
@media (min-width: 860px) {
  body {
    padding-bottom: 0;
    padding-top: var(--nav-h);
  }
  .nav {
    top: 0;
    bottom: auto;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: var(--nav-h);
  }
  .nav .brand {
    display: block;
    font:
      700 20px Figtree,
      Inter,
      sans-serif;
    color: var(--ink);
    text-decoration: none;
  }
  .tabs-nav {
    display: flex;
    gap: 4px;
    height: auto;
  }
  .tab {
    flex-direction: row;
    gap: 8px;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 10px;
  }
  .tab:hover {
    background: var(--ground);
  }
}

/* ───────── mise en page ───────── */

.page {
  margin: 0 auto;
  padding: 20px 16px;
}
.narrow {
  max-width: 640px;
}
.wide {
  max-width: 1120px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stack-s {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.row.between {
  justify-content: space-between;
}
.row.gap {
  flex-wrap: wrap;
  gap: 8px;
}
.grow {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.report > *,
.stack > * {
  min-width: 0;
}
@media (min-width: 960px) {
  .report {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* ───────── texte ───────── */

.h1,
.h2,
.display,
.bar-title,
.big,
.num {
  font-family: Figtree, Inter, sans-serif;
}
.h1 {
  font-size: 28px;
  margin: 0;
  font-weight: 700;
}
.h2 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
}
.display {
  font-size: clamp(34px, 8vw, 52px);
  line-height: 1.05;
  margin: 0;
  font-weight: 800;
}
.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.lead {
  font-size: 17px;
  margin: 0;
}
.muted {
  color: var(--muted);
  margin: 0;
}
.soft {
  color: var(--soft);
  margin: 0;
}
.small {
  font-size: 13px;
}
.accent {
  color: var(--lime);
  font-weight: 600;
}
.good {
  color: var(--good);
}
.bad {
  color: var(--bad);
}
.error {
  color: var(--bad);
  margin: 0;
  font-weight: 600;
}
.big {
  font-size: 26px;
  font-weight: 700;
  display: block;
}
.num {
  font-size: 22px;
  font-weight: 700;
}

/* ───────── barres, boutons ───────── */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 0;
  max-width: 1120px;
  margin: 0 auto;
}
.bar-title {
  font-size: 17px;
  margin: 0;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--line);
}
.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary {
  background: var(--blue);
  color: var(--blue-ink);
  border-color: var(--blue);
}
.btn.accent-btn {
  background: var(--lime);
  color: #12161c;
  border-color: var(--lime);
  align-self: flex-start;
  padding: 0 24px;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--blue);
}
.btn.danger {
  color: var(--bad);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.small-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 10px;
}
.round-btn {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: var(--blue);
  color: var(--blue-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}
a.link.soft {
  color: var(--soft);
}
.btn:focus-visible,
.icon-btn:focus-visible,
.tab:focus-visible,
.chip:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ───────── cartes ───────── */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  color: inherit;
  text-decoration: none;
}
.callout {
  border: 2px solid var(--lime);
}
.dark-card,
.hero {
  background: var(--night);
  color: #fff;
}
.dark-card {
  border-radius: 18px;
  padding: 18px;
}
.hero {
  margin-top: 8px;
}
.hero .page {
  padding-top: 18px;
  padding-bottom: 22px;
}
.landing {
  margin-top: 0;
}
.landing .page {
  padding-top: 48px;
  padding-bottom: 40px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--night-2);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--lime);
  transition: width 0.3s;
}
.pill {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--line);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pill.yes {
  background: var(--lime);
  color: #12161c;
}
.pill.wait {
  background: transparent;
  border: 1px dashed var(--muted);
  color: var(--muted);
}
.match-row {
  min-height: 64px;
}

/* ───────── rapport ───────── */

.players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 12px;
}
.player {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 2px solid transparent;
}
.player.is-me {
  border-color: var(--lime);
}
.pics {
  display: flex;
  gap: 8px;
  align-items: stretch;
  height: 132px;
}
.photo {
  height: 132px;
  width: 88px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--line);
}
.photo.none {
  display: flex;
  align-items: center;
  justify-content: center;
  font:
    700 32px Figtree,
    sans-serif;
  color: var(--muted);
}
.heat {
  height: 132px;
  width: auto;
  border-radius: 6px;
}
.kv {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}
.kv div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  font-weight: 600;
}
video {
  width: 100%;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 16 / 9;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.chip {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ground);
  font-size: 13px;
  cursor: pointer;
}
.mine {
  border: 2px solid var(--lime);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tile {
  background: var(--ground);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.page > .tiles .tile {
  background: var(--surface);
}
.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  font-size: 14px;
}
.steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.moment {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--ground);
  text-align: left;
  cursor: pointer;
}
.tip {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ground);
  font-size: 14px;
}
.more summary {
  cursor: pointer;
  color: var(--muted);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.chart {
  width: 100%;
  height: auto;
  display: block;
}

/* ───────── envoi ───────── */

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--line);
  border-radius: 12px;
  padding: 4px;
}
.tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.tabs button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
}
.thumb {
  width: 56px;
  height: 38px;
  border-radius: 8px;
  background: #2a5c9e;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.clip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drop {
  min-height: 56px;
  border-radius: 14px;
  border: 2px dashed var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.field input:not([type='range']),
.field-input {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 14px;
  font-size: 16px;
  color: var(--ink);
}
.field input[type='range'] {
  width: 100%;
  accent-color: var(--blue);
}
.frame {
  position: relative;
  border-radius: 12px;
  overflow: visible;
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.frame canvas#pic {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  cursor: crosshair;
}
.frame svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.loupe {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 70px;
  border: 3px solid var(--lime);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  background: #000;
}

/* ───────── accueil ───────── */

.how {
  list-style: none;
  counter-reset: how;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.how li {
  counter-increment: how;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 16px 16px 60px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.how li::before {
  content: counter(how);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: var(--lime);
  color: #12161c;
  font:
    700 16px Figtree,
    sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how span {
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--ground);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  max-width: calc(100vw - 32px);
  transition: opacity 0.3s;
}
.toast.gone {
  opacity: 0;
}
@media (min-width: 860px) {
  .toast {
    bottom: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ───────── zones, équipes, étiquettes, mode rallye ───────── */

.zones {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
}
.z-def {
  background: #2a5c9e;
}
.z-tra {
  background: #8fa7c9;
}
.z-vol {
  background: var(--lime);
}
.zone-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  font:
    600 11px Inter,
    sans-serif;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.badge.strong {
  background: #d9f2e3;
  color: #14593a;
}
.badge.ok {
  background: #e3eafb;
  color: #1a3f9e;
}
.badge.low {
  background: #fbe6dc;
  color: #8a3416;
}
.teams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}
.team {
  background: var(--ground);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid transparent;
}
.team.is-me {
  border-color: var(--lime);
}
.rally-bar {
  align-items: center;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  min-height: 44px;
  cursor: pointer;
}
.switch input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}
.moment-n {
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: var(--lime);
  color: #12161c;
  font:
    700 14px Figtree,
    sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.demo-note {
  margin: 0;
  border-left: 0;
  background: var(--surface);
  outline: 1px dashed var(--muted);
}
.warn {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fbe6dc;
  color: #8a3416;
  font-size: 14px;
}
.ok-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #d9f2e3;
  color: #14593a;
  font-size: 14px;
}
.court-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #2a5c9e;
  border-radius: 12px;
  padding: 8px;
  position: relative;
  max-width: 260px;
}
.court-pick::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 3px;
  background: #fff;
  transform: translateY(-50%);
  pointer-events: none;
}
.court-pick button {
  min-height: 56px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.court-pick button[aria-pressed='true'] {
  background: var(--lime);
  color: #12161c;
  border-color: var(--lime);
}
.cam {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.cam video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  aspect-ratio: auto;
}
.cam svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.glossary dt {
  font-weight: 700;
  margin-top: 12px;
}
.glossary dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.shot-types {
  display: grid;
  gap: 6px;
}
.shot-type {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 8px;
}
.shot-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.shot-bar > span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
}
.shot-type b {
  text-align: right;
}
.block {
  display: block;
}
