/* La Banque — Monopoly entre amis
   Fond clair façon iOS, une seule pièce forte : la carte de solde vert tapis
   gravée comme un billet. Tout le reste reste discret. */

:root {
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface-2: #F7F7F8;
  --ink: #15171A;
  --ink-2: #61656C;
  --ink-3: #9A9EA5;
  --line: rgba(20, 22, 26, .08);
  --felt: #0E3B2E;
  --felt-2: #145240;
  --gold: #E9D9A6;
  --pos: #12804A;
  --neg: #CF3A2C;
  --focus: #2F6FEB;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 8px 24px rgba(16, 24, 20, .06);
  --shadow-lg: 0 24px 60px rgba(10, 20, 15, .22);
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.36, .5, 1);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 10px; }
.num { font-variant-numeric: tabular-nums; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px calc(env(safe-area-inset-bottom, 0px) + 32px);
}
#app.wide { max-width: 980px; }

/* ------------------------------------------------------------ marque */
.mark {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--felt); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(14, 59, 46, .35);
}
.mark svg { width: 30px; height: 30px; }
.mark.sm { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.mark.sm svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------ écrans d'accueil */
.gate {
  min-height: calc(100dvh - 60px);
  display: flex; flex-direction: column; justify-content: center;
  gap: 28px; padding-block: 24px;
}
.gate h1 {
  font: 700 34px/1.08 var(--font-display);
  letter-spacing: -.025em; margin: 18px 0 6px;
}
.gate p.sub { color: var(--ink-2); margin: 0; font-size: 17px; }
.gate form { display: grid; gap: 12px; }
.field {
  width: 100%; height: 56px; padding: 0 18px;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); font-size: 17px;
  box-shadow: var(--shadow); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field:focus { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.err {
  color: var(--neg); font-size: 15px; min-height: 20px; margin: 0;
}
.err:empty { display: none; }
.shake { animation: shake .4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

/* boutons */
.btn {
  height: 56px; border-radius: var(--r-md); padding: 0 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 17px; letter-spacing: -.01em;
  transition: transform .15s var(--ease), opacity .2s, background .2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.felt { background: var(--felt); color: #fff; }
.btn.soft { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn.ghost { background: transparent; color: var(--ink-2); height: 44px; font-weight: 500; font-size: 15px; }
.btn.danger { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.btn.danger.armed { background: var(--neg); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; border-radius: 11px; padding: 0 14px; font-size: 15px; }

/* code de partie : 4 cases dessinées sous un champ invisible */
.code-wrap { position: relative; }
.code-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.code-box {
  height: 76px; border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  display: grid; place-items: center;
  font: 600 34px var(--font-display); letter-spacing: 0;
  transition: border-color .2s, transform .2s var(--spring);
}
.code-box.cur { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.code-box.on { transform: scale(1.04); }
.code-input {
  position: absolute; inset: 0; width: 100%; opacity: 0;
  font-size: 16px; text-transform: uppercase; caret-color: transparent;
}

/* choix du prénom */
.pick { display: grid; gap: 8px; }
.pick button {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--surface); padding: 12px 14px; border-radius: var(--r-md);
  box-shadow: var(--shadow); text-align: left; font-weight: 600; font-size: 17px;
}
.pick button[disabled] { opacity: .45; }
.pick small { margin-left: auto; color: var(--ink-3); font-weight: 400; font-size: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------ avatars */
.av {
  --c: #888;
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--c); color: #fff;
  display: grid; place-items: center; font-weight: 650; font-size: 16px;
  position: relative;
}
.av.sm { width: 28px; height: 28px; font-size: 12px; }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.av.bank { background: var(--felt); color: var(--gold); }
.av.bank svg { width: 55%; height: 55%; }
.av .dot {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px;
  border-radius: 50%; background: #34C759; border: 2px solid var(--surface);
}
.av.sm .dot { width: 9px; height: 9px; }

/* ------------------------------------------------------------ en-tête */
.top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-height: 44px;
}
.top .who { font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.top .meta { color: var(--ink-3); font-size: 13px; }
.top .grow { flex: 1; min-width: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
  background: var(--surface); box-shadow: var(--shadow);
}
.icon-btn svg { width: 20px; height: 20px; }

.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 3px; border-radius: 12px; gap: 2px;
}
.seg button {
  height: 32px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 600;
  color: var(--ink-2); transition: background .2s, color .2s;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ------------------------------------------------------------ la carte */
.card {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  padding: 22px 22px 20px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(233, 217, 166, .16), transparent 55%),
    linear-gradient(160deg, var(--felt-2), var(--felt) 60%);
  box-shadow: 0 18px 40px -12px rgba(14, 59, 46, .55), inset 0 1px 0 rgba(255,255,255,.08);
  aspect-ratio: 1.586;
  display: flex; flex-direction: column;
  isolation: isolate;
}
.card::before {
  /* gravure de billet : rosace de cercles fins */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none' stroke='%23E9D9A6' stroke-opacity='.22' stroke-width='.8'%3E%3Ccircle cx='430' cy='90' r='40'/%3E%3Ccircle cx='430' cy='90' r='60'/%3E%3Ccircle cx='430' cy='90' r='80'/%3E%3Ccircle cx='430' cy='90' r='100'/%3E%3Ccircle cx='430' cy='90' r='120'/%3E%3Ccircle cx='430' cy='90' r='140'/%3E%3Ccircle cx='430' cy='90' r='160'/%3E%3Ccircle cx='430' cy='90' r='180'/%3E%3Ccircle cx='430' cy='90' r='200'/%3E%3Ccircle cx='430' cy='90' r='220'/%3E%3Ccircle cx='430' cy='90' r='240'/%3E%3Ccircle cx='430' cy='90' r='260'/%3E%3Ccircle cx='430' cy='90' r='280'/%3E%3Ccircle cx='430' cy='90' r='300'/%3E%3Ccircle cx='430' cy='90' r='320'/%3E%3Ccircle cx='430' cy='90' r='340'/%3E%3Ccircle cx='430' cy='90' r='360'/%3E%3Ccircle cx='430' cy='90' r='380'/%3E%3Ccircle cx='430' cy='90' r='400'/%3E%3Ccircle cx='430' cy='90' r='420'/%3E%3Ccircle cx='430' cy='90' r='440'/%3E%3Ccircle cx='430' cy='90' r='460'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 520px 520px; background-position: right -40px top -40px; background-repeat: no-repeat;
}
.card .row { display: flex; align-items: center; gap: 10px; }
.card .label { color: rgba(255,255,255,.7); font-size: 15px; font-weight: 500; }
.card .chip {
  margin-left: auto; font-size: 13px; font-weight: 600; letter-spacing: .08em;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(233, 217, 166, .14); color: var(--gold);
}
.card .bal {
  margin-top: auto;
  font: 650 clamp(46px, 14vw, 68px)/1 var(--font-display);
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color .4s;
}
.card .bal .cur { font-weight: 500; opacity: .75; margin-left: .12em; font-size: .62em; letter-spacing: 0; }
.card .bal.up { color: #B6F5CD; }
.card .bal.down { color: #FFD0C7; }
.card .foot { margin-top: 12px; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.75); font-size: 15px; }
.card .foot .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.card.pulse { animation: pulse .9s var(--ease); }
@keyframes pulse { 30% { transform: scale(1.015); } }

/* ------------------------------------------------------------ actions */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 30px; }
.act {
  height: 64px; border-radius: 20px; font-size: 18px; font-weight: 650;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s var(--ease);
}
.act:active { transform: scale(.96); }
.act svg { width: 22px; height: 22px; }
.act.pay { background: var(--ink); color: var(--bg); }
.act.get { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ------------------------------------------------------------ sections */
.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.sec-h h2 { font: 700 22px/1.2 var(--font-display); letter-spacing: -.02em; margin: 0; }
.sec-h span { color: var(--ink-3); font-size: 14px; }

.panel { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }

/* joueurs (carrousel) */
.people { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px 6px; scroll-snap-type: x mandatory; }
.people::-webkit-scrollbar { display: none; }
.person {
  flex: none; width: 112px; scroll-snap-align: start;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
  padding: 14px 12px; display: grid; justify-items: center; gap: 8px; text-align: center;
}
.person .n { font-weight: 600; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .b { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: -6px; }
.person.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--pos); } 100% { box-shadow: var(--shadow); } }

/* historique */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-top: 1px solid var(--line);
}
.feed li:first-child { border-top: 0; }
.feed .pair { display: flex; flex: none; }
.feed .pair .av + .av { margin-left: -10px; box-shadow: 0 0 0 2px var(--surface); }
.feed .txt { flex: 1; min-width: 0; }
.feed .t1 { font-size: 15px; line-height: 1.3; }
.feed .t1 b { font-weight: 600; }
.feed .t2 { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.feed .amt { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 16px; }
.feed .amt.pos { color: var(--pos); }
.feed .amt.neg { color: var(--ink); }
.feed li.cancelled .t1, .feed li.cancelled .amt { text-decoration: line-through; opacity: .45; }
.feed li.sys { justify-content: center; color: var(--ink-3); font-size: 13px; padding: 10px 16px; }
.feed li.new { animation: rowin .5s var(--ease); }
@keyframes rowin { from { background: color-mix(in srgb, var(--pos) 10%, transparent); } }
.empty { padding: 28px 20px; text-align: center; color: var(--ink-3); font-size: 15px; }

/* ------------------------------------------------------------ attente */
.wait { text-align: center; padding-top: 6vh; }
.wait .code-big {
  display: inline-flex; gap: 8px; margin: 18px 0 8px;
}
.wait .code-big span, .code-tiles span {
  width: 60px; height: 72px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow);
  display: grid; place-items: center; font: 650 34px var(--font-display);
}
.wait h1 { font: 700 30px/1.1 var(--font-display); letter-spacing: -.025em; margin: 22px 0 8px; }
.wait p { color: var(--ink-2); margin: 0 auto; max-width: 30ch; }
.roster { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 14px; margin: 34px 0; }
.roster .p { display: grid; justify-items: center; gap: 8px; width: 76px; font-size: 14px; font-weight: 500; animation: popin .5s var(--spring) both; }
.roster .p span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster .p.me span { font-weight: 700; }
@keyframes popin { from { transform: scale(.4); opacity: 0; } }
.breath { display: inline-flex; gap: 6px; margin-top: 8px; }
.breath i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: breath 1.4s infinite ease-in-out; }
.breath i:nth-child(2) { animation-delay: .2s; }
.breath i:nth-child(3) { animation-delay: .4s; }
@keyframes breath { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ fin de partie */
.podium { display: grid; gap: 10px; margin: 26px 0; }
.podium .r {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
  animation: popin .55s var(--spring) both;
}
.podium .rank { width: 22px; color: var(--ink-3); font-weight: 650; font-variant-numeric: tabular-nums; }
.podium .r:first-child { background: var(--felt); color: #fff; }
.podium .r:first-child .rank { color: var(--gold); }
.podium .nm { flex: 1; font-weight: 600; font-size: 17px; }
.podium .vl { font-weight: 650; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ feuilles (sheets) */
.backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .38); z-index: 40;
  opacity: 0; transition: opacity .3s var(--ease);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.backdrop.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  margin: 0 auto; max-width: 560px;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
  background: var(--bg); border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-lg);
  padding: 8px 18px calc(env(safe-area-inset-bottom, 0px) + 16px);
  transform: translateY(105%); transition: transform .42s var(--ease);
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
}
.sheet.on { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--ink-3); opacity: .4; margin: 2px auto 8px; flex: none; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheet-h h3 { font: 700 20px var(--font-display); letter-spacing: -.015em; margin: 0; }
.close { width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 8%, transparent); display: grid; place-items: center; color: var(--ink-2); }
.close svg { width: 14px; height: 14px; }
@media (min-width: 700px) {
  .sheet { bottom: 50%; border-radius: 28px; transform: translateY(calc(50% + 40px)) scale(.97); opacity: 0; transition: transform .35s var(--ease), opacity .25s; }
  .sheet.on { transform: translateY(50%); opacity: 1; }
  .grab { display: none; }
}

/* montant façon Apple Cash */
.amount {
  text-align: center; margin: 10px 0 6px;
  font: 650 64px/1.1 var(--font-display); letter-spacing: -.045em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: color .2s;
}
.amount .cur { font-weight: 500; color: var(--ink-3); font-size: .55em; margin-left: .1em; letter-spacing: 0; }
.amount.zero { color: var(--ink-3); }
.amount.over { color: var(--neg); }
.amount.bump { animation: bump .18s var(--ease); }
@keyframes bump { 50% { transform: scale(1.04); } }
.hint { text-align: center; color: var(--ink-3); font-size: 14px; min-height: 20px; margin-bottom: 10px; }
.hint.bad { color: var(--neg); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.keypad button {
  height: 54px; border-radius: 14px; font: 500 26px var(--font-display);
  transition: background .12s;
  user-select: none; -webkit-user-select: none;
}
.keypad button:active { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.keypad button svg { width: 26px; height: 26px; }
.quick { display: flex; gap: 8px; justify-content: center; margin: -2px 0 12px; flex-wrap: wrap; }
.quick button {
  height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--surface); box-shadow: var(--shadow); font-variant-numeric: tabular-nums;
}

.lbl { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 6px 4px 10px; }
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 14px; }
.target {
  display: grid; justify-items: center; gap: 7px; padding: 12px 6px 10px;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; position: relative;
  transition: transform .2s var(--spring), box-shadow .2s;
}
.target span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); transform: translateY(-2px); }
.target[aria-pressed="true"]::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chips button {
  height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2);
  transition: background .15s, color .15s;
}
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.sheet .cta { position: sticky; bottom: 0; padding-top: 6px; background: linear-gradient(transparent, var(--bg) 14px); margin-top: auto; }

/* recevoir : la paye en gros */
.salary {
  width: 100%; border-radius: var(--r-lg); padding: 22px; text-align: left;
  background: var(--felt); color: #fff; display: flex; align-items: center; gap: 16px;
  margin: 8px 0 12px; box-shadow: 0 14px 30px -12px rgba(14,59,46,.6);
  transition: transform .15s var(--ease);
}
.salary:active { transform: scale(.98); }
.salary .ic { width: 48px; height: 48px; border-radius: 14px; background: rgba(233,217,166,.15); color: var(--gold); display: grid; place-items: center; flex: none; }
.salary .ic svg { width: 26px; height: 26px; }
.salary .s1 { font-size: 15px; color: rgba(255,255,255,.75); }
.salary .s2 { font: 650 30px var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.salary .go { margin-left: auto; font-weight: 600; background: rgba(255,255,255,.14); padding: 9px 14px; border-radius: 999px; font-size: 15px; }

/* succès */
.done { display: grid; justify-items: center; gap: 10px; padding: 26px 0 30px; text-align: center; }
.done svg { width: 84px; height: 84px; }
.done circle { stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .5s var(--ease) forwards; }
.done path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s .35s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h3 { font: 700 26px var(--font-display); letter-spacing: -.02em; margin: 6px 0 0; }
.done p { margin: 0; color: var(--ink-2); }

/* ------------------------------------------------------------ notifications */
#toasts {
  position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 60;
  display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 12px;
}
.toast {
  pointer-events: auto;
  width: min(440px, 100%);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 12px 12px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 12px 34px rgba(0,0,0,.16), 0 0 0 .5px var(--line);
  animation: tin .5s var(--spring);
  transition: transform .35s var(--ease), opacity .35s;
}
.toast.out { transform: translateY(-120%); opacity: 0; }
.toast .pair { display: flex; flex: none; }
.toast .pair .av + .av { margin-left: -12px; box-shadow: 0 0 0 2px var(--surface); }
.toast .tx { flex: 1; min-width: 0; font-size: 15px; line-height: 1.3; }
.toast .tx b { font-weight: 650; }
.toast .tx small { display: block; color: var(--ink-3); font-size: 13px; }
.toast .am { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.toast.mine { box-shadow: 0 12px 34px rgba(0,0,0,.16), 0 0 0 2px var(--pos); }
.toast.mine .am { color: var(--pos); }
.toast.alert .am { color: var(--neg); }
@keyframes tin { from { transform: translateY(-120%) scale(.9); opacity: 0; } }

/* ------------------------------------------------------------ admin */
.adm-grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .adm-grid.two { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.box { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }
.box h2 { font: 700 21px/1.2 var(--font-display); letter-spacing: -.02em; margin: 0 0 4px; }
.box .d { color: var(--ink-2); font-size: 15px; margin: 0 0 16px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.form-row:first-of-type { border-top: 0; }
.form-row label { font-weight: 500; }
.form-row small { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; }
.money-in { position: relative; width: 132px; flex: none; }
.money-in input {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); padding: 0 30px 0 12px; text-align: right;
  font-weight: 600; font-variant-numeric: tabular-nums; font-size: 16px; outline: none;
}
.money-in input:focus { border-color: var(--focus); }
.money-in::after { content: "€"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 500; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 16%, transparent); transition: background .25s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
.switch input:checked + span { background: #34C759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.code-tiles { display: flex; gap: 8px; margin: 6px 0 14px; }
.code-tiles span { width: 64px; height: 78px; font-size: 38px; background: var(--felt); color: var(--gold); box-shadow: none; }

.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.plist li:first-child { border-top: 0; }
.plist .nm { flex: 1; min-width: 0; font-weight: 600; }
.plist .nm small { display: block; color: var(--ink-3); font-weight: 400; font-size: 13px; }
.plist .bal { font: 650 19px var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.x-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.x-btn:hover { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.x-btn svg { width: 16px; height: 16px; }
.inline { display: flex; gap: 8px; }
.inline .field { height: 48px; box-shadow: none; background: var(--surface-2); }
.inline .btn { height: 48px; }
.mini-btn { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 7px 12px; border-radius: 10px; background: var(--surface-2); }
.mini-btn.armed { background: var(--neg); color: #fff; }
.feed .mini-btn { margin-left: 4px; }
.tot { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 14px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.stack { display: grid; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* lien discret vers l'accès admin, en bas de l'écran d'accueil */
.admin-link {
  display: inline-flex; align-items: center; gap: 6px; align-self: center;
  margin-top: 8px; padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--ink-3);
}
.admin-link:hover { color: var(--ink-2); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.admin-link svg { width: 13px; height: 13px; }
