:root {
  --navy: #0E2A47;
  --green: #1F7A3D;
  --green-dark: #1B6E37;
  --yellow: #FFC93C;
  --bg: #F3F6F1;
  --line: #B9C6B5;
  --muted: #3F5247;
  --error: #B42318;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #E3EBDF; color: var(--navy); font-family: var(--body); font-size: 16px; }
button, input { font-family: var(--body); }
h1, h2, h3, p { margin: 0; }

.screen { max-width: 440px; margin: 0 auto; min-height: 100dvh; background: var(--bg); display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.screen.wide { max-width: 760px; }
@media (min-width: 600px) {
  .screen { margin: 24px auto; min-height: calc(100dvh - 48px); border-radius: 24px; overflow: hidden; box-shadow: 0 8px 30px rgba(14, 42, 71, .15); }
}

/* Bandeau terrain */
.hero { position: relative; padding: calc(24px + env(safe-area-inset-top, 0px)) 24px 28px; color: #fff;
  background: repeating-linear-gradient(90deg, var(--green) 0 48px, var(--green-dark) 48px 96px); }
.hero.tall { min-height: 300px; display: flex; flex-direction: column; justify-content: space-between; }
.hero .ball { position: absolute; right: 26px; top: 48px; }
.chip { display: inline-block; align-self: flex-start; background: #fff; color: var(--navy); border-radius: 999px; padding: 5px 12px; font-size: 14px; font-weight: 800; }
.chip.yellow { background: #FFF0B8; color: #5C4300; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 76px; line-height: .9; letter-spacing: .01em; margin-top: 56px; }
.tagline { margin-top: 12px; font-size: 18px; font-weight: 800; line-height: 1.3; }
.hello { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; margin-top: 18px; }

.panel { flex: 1; display: flex; flex-direction: column; padding: 24px; }
.title { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1.1; }
.subtitle { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; margin-bottom: 8px; }

/* Formulaires */
.label { display: block; margin-top: 18px; font-size: 15px; font-weight: 800; color: var(--muted); }
.field { display: block; width: 100%; height: 56px; margin-top: 8px; padding: 0 16px; background: #fff; border: 2px solid var(--line);
  border-radius: 16px; font-size: 20px; font-weight: 700; color: var(--navy); }
.pin { display: flex; gap: 12px; margin-top: 8px; }
.pin input { flex: 1; min-width: 0; height: 60px; text-align: center; font-size: 26px; font-weight: 800; background: #fff;
  border: 2px solid var(--line); border-radius: 16px; color: var(--navy); }
.field:focus-visible, .pin input:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-color: var(--navy); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: 16px; }
.cols > div { min-width: 0; }
.error { min-height: 1.4em; margin-top: 12px; color: var(--error); font-weight: 800; }
.ok { color: var(--green); font-weight: 800; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 60px; padding: 0 20px;
  border: 0; border-radius: 16px; background: var(--yellow); color: var(--navy); font-size: 21px; font-weight: 800; cursor: pointer; text-decoration: none; }
.btn:focus-visible, .link:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.btn.ghost { background: transparent; border: 2px solid var(--line); }
.btn.danger { background: var(--error); color: #fff; }
.btn.small { width: auto; height: 44px; padding: 0 14px; font-size: 15px; }
.btn[disabled] { cursor: not-allowed; }
.link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--navy); font-size: 15px; font-weight: 800; text-decoration: underline; background: none; border: 0; cursor: pointer; }
.center { display: flex; justify-content: center; margin-top: auto; padding-top: 16px; }

/* Choix du mode */
.modes { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.mode { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; text-align: left; background: #fff; border: 2px solid var(--line);
  border-radius: 18px; color: var(--navy); font-size: 16px; }
.mode strong { display: block; font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.mode span.desc { color: var(--muted); font-weight: 600; }
.mode .tag { margin-left: auto; flex: none; background: #FFF0B8; color: #5C4300; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 800; }
.mode .ico { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #E6EEE3; display: flex; align-items: center; justify-content: center; }
.note { margin-top: 16px; color: var(--muted); font-weight: 600; line-height: 1.45; }

/* Espace parent */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 18px; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid #DCE4D9; }
.row:last-child { border-bottom: 0; }
.row .name { font-size: 20px; font-weight: 800; }
.row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { color: var(--muted); font-weight: 600; padding: 8px 0; }
.add { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 600px) { .add.cols { grid-template-columns: 1fr 1fr; column-gap: 20px; } }

/* Boîtes de dialogue */
dialog { width: min(92vw, 420px); padding: 20px; border: 0; border-radius: 20px; background: #fff; color: var(--navy); }
dialog::backdrop { background: rgba(14, 42, 71, .55); }
dialog .buttons { display: flex; gap: 10px; margin-top: 18px; }
dialog .buttons .btn { height: 52px; font-size: 18px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
