/* FUT Bourse — feuille de match : craie claire, vert pelouse pour acheter,
   orange signal pour vendre, chiffres façon tableau d'affichage. */
:root {
  --paper: #F2F4F1;
  --surface: #FFFFFF;
  --ink: #17211B;
  --muted: #5E6A62;
  --line: #DADFD8;
  --line-2: #E8ECE6;
  --buy: #0E7A45;
  --buy-soft: #E3F2EA;
  --sell: #C2410C;
  --sell-soft: #FBEADF;
  --soon: #2F5D8C;
  --bad: #B42318;
  --good: #0E7A45;
  --num: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--soon); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.pos { color: var(--good); } .neg { color: var(--bad); }

/* ------------------------------------------------ barre */
.bar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.mark { font: 700 22px/1 var(--num); text-decoration: none; letter-spacing: .01em; white-space: nowrap; }
.nav { display: flex; gap: 22px; flex: 1; height: 100%; }
.nav a { display: flex; align-items: center; text-decoration: none; color: var(--muted); font-weight: 500;
  font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); border-bottom-color: var(--ink); }
.bar-right { display: flex; align-items: center; gap: 16px; }
.wallet { font: 600 20px/1 var(--num); white-space: nowrap; }
.wallet small { font: 500 13px var(--text); color: var(--muted); margin-left: 4px; }

/* ------------------------------------------------ page */
.page { max-width: 1120px; margin: 0 auto; padding: 36px 24px 120px; }
.day { font: 600 44px/1.05 var(--num); margin: 0; letter-spacing: -.005em; }
.lede { font-size: 18px; margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.lede b { color: var(--ink); font-weight: 600; }
h2 { font: 600 24px/1.2 var(--num); margin: 44px 0 14px; }
h2 .count { font-weight: 500; color: var(--muted); margin-left: 6px; }
.context { margin: 22px 0 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--ink); max-width: 75ch; }

/* bande de chiffres */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 28px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; }
.figures > div { padding: 16px 20px; }
.figures > div + div { border-left: 1px solid var(--line-2); }
.figures .v { font: 600 30px/1.1 var(--num); font-variant-numeric: tabular-nums; }
.figures .l { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------ ordres */
.orders { display: flex; flex-direction: column; gap: 12px; }
.order { display: grid; grid-template-columns: 132px 1fr 190px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; }
.order .verb { padding: 20px 18px; font: 700 30px/1 var(--num); }
.order.buy .verb { background: var(--buy-soft); color: var(--buy); }
.order.sell .verb { background: var(--sell-soft); color: var(--sell); }
.order .verb small { display: block; font: 500 13px/1.3 var(--text); color: var(--muted); margin-top: 10px; }
.order .what { padding: 18px 20px; min-width: 0; }
.order .who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.order .who b { font-size: 18px; font-weight: 600; }
.order .why { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 15px; }
.order .why li { margin-top: 3px; padding-left: 14px; position: relative; }
.order .why li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 1px; background: var(--muted); }
.order .deal { padding: 18px 20px; border-left: 1px solid var(--line-2); display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.order .price { font: 700 40px/1 var(--num); font-variant-numeric: tabular-nums; }
.order .price-l { font-size: 13px; color: var(--muted); }
.order .gain { font-size: 14px; color: var(--muted); }

.tag { display: inline-block; font-size: 13px; font-weight: 500; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface); white-space: nowrap; }
.tag.err { border-color: #F1C4BE; color: var(--bad); }

/* ------------------------------------------------ boutons & champs */
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px;
  padding: 8px 14px; font-weight: 500; font-size: 15px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #B9C1B7; }
.btn.solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.solid:hover { background: #26332B; }
.btn.buy { background: var(--buy); border-color: var(--buy); color: #fff; }
.btn.sell { background: var(--sell); border-color: var(--sell); color: #fff; }
.btn.link { border: 0; background: none; padding: 4px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: wait; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

label { display: block; font-size: 14px; font-weight: 500; margin: 16px 0 6px; }
input[type=text], input[type=number], input[type=url] { width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }
input:focus { outline: 2px solid var(--soon); outline-offset: -1px; border-color: transparent; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 12px 14px; text-align: left; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button b { display: block; font-weight: 600; color: inherit; }

/* ------------------------------------------------ tableaux */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F8FAF7; }
td.r, th.r { text-align: right; }
td .n { font: 600 19px/1 var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl b { font-weight: 600; }
.pl span { color: var(--muted); font-size: 14px; margin-left: 6px; }
.status { font-weight: 600; font-size: 15px; white-space: nowrap; }
.status.ACHETER { color: var(--buy); } .status.VENDRE { color: var(--sell); }
.status.SURVEILLER { color: var(--soon); } .status.GARDER, .status.ATTENDRE, .status.OBSERVATION { color: var(--muted); font-weight: 500; }
svg.spark { width: 96px; height: 28px; display: block; }

.empty { border: 1px dashed #C7CEC5; border-radius: 10px; padding: 32px; max-width: 640px; }
.empty p { margin: 0 0 16px; font-size: 17px; }

/* ------------------------------------------------ panneau latéral (fiche joueur) */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(23,33,27,.32); opacity: 0; pointer-events: none; transition: opacity .18s; }
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--paper);
  border-left: 1px solid var(--line); overflow-y: auto; padding: 28px 28px 60px; transform: translateX(24px); transition: transform .2s; }
.sheet.open .sheet-panel { transform: none; }
.sheet h3 { font: 600 32px/1.05 var(--num); margin: 0; }
.verdict { margin-top: 20px; padding: 18px 20px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.verdict .v { font: 700 26px/1.1 var(--num); }
.verdict.ACHETER { border-left: 4px solid var(--buy); } .verdict.ACHETER .v { color: var(--buy); }
.verdict.VENDRE { border-left: 4px solid var(--sell); } .verdict.VENDRE .v { color: var(--sell); }
.verdict ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.verdict li { margin-top: 3px; }
.chart { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px 4px; }
.chart svg { width: 100%; height: 210px; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 4px 10px 6px; }
.legend i { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: 6px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.facts div { padding: 10px 14px; } .facts div + div { border-left: 1px solid var(--line-2); }
.facts .l { font-size: 13px; color: var(--muted); } .facts .v { font: 600 22px/1.2 var(--num); font-variant-numeric: tabular-nums; }
details { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; }
summary { cursor: pointer; font-weight: 500; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ------------------------------------------------ modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(23,33,27,.32); display: none; place-items: center; padding: 16px; }
.modal.open { display: grid; }
.modal-box { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; width: min(560px, 100%);
  max-height: 92vh; overflow: auto; padding: 26px; }
.modal-box h3 { font: 600 28px/1.1 var(--num); margin: 0 0 4px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-top: 8px; max-width: 86ch; border: 1px solid; }
.alert.spike { background: var(--sell-soft); border-color: #F0CDB4; }
.alert.drop { background: var(--buy-soft); border-color: #BFDCCB; }
.alert b { margin-right: 6px; }
.agenda { list-style: none; margin: 0; padding: 0; max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.agenda li { display: grid; grid-template-columns: 250px 1fr; gap: 16px; padding: 10px 16px; }
.agenda li + li { border-top: 1px solid var(--line-2); }
.agenda .when { color: var(--muted); }
.agenda .when::first-letter { text-transform: uppercase; }
.status.state-spike { color: var(--sell); } .status.state-drop { color: var(--buy); }
.status.state-calm, .status.state-learning { color: var(--muted); font-weight: 500; }
h4.sub { font: 600 20px/1.2 var(--num); margin: 28px 0 8px; }
.heatmap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.hm-row { display: grid; grid-template-columns: 40px repeat(8, 1fr); gap: 3px; align-items: center; }
.hm-row + .hm-row { margin-top: 3px; }
.hm-head span { font-size: 11px; color: var(--muted); }
.hm-day { font-size: 13px; color: var(--muted); }
.hm-cell { height: 22px; border-radius: 3px; border: 1px solid var(--line-2); }
input[type=datetime-local] { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; }

.auth { max-width: 460px; margin: 40px auto 0; }
body.auth-mode .bar { display: none; }
.who { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 15px; }
input[type=password] { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-top: 16px; max-width: 760px; }
.panel h3 { font: 600 21px/1.2 var(--num); margin: 0 0 4px; }
dl.guide { margin: 8px 0 0; display: grid; grid-template-columns: 130px 1fr; gap: 10px 18px; }
dl.guide dt { font-weight: 600; } dl.guide dd { margin: 0; color: var(--muted); }
pre.out { white-space: pre-wrap; background: var(--paper); border-radius: 8px; padding: 12px; font-size: 14px; margin: 12px 0 0; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); background: var(--ink); color: #fff;
  border-radius: 8px; padding: 11px 16px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; font-size: 15px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ------------------------------------------------ mobile */
@media (max-width: 900px) {
  .who b { display: none; }
  .bar-in { height: 56px; gap: 12px; padding: 0 16px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; height: auto; gap: 0; background: var(--surface); border-top: 1px solid var(--line);
    overflow-x: auto; padding: 0 6px env(safe-area-inset-bottom); }
  .nav a { padding: 14px 12px; font-size: 14px; border-bottom: 0; border-top: 2px solid transparent; margin: 0; }
  .nav a.on { border-top-color: var(--ink); }
  .bar-right { margin-left: auto; }
  .page { padding: 24px 16px 110px; }
  .day { font-size: 36px; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > div:nth-child(3) { border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .order { grid-template-columns: 1fr; }
  .order .verb { padding: 14px 18px; display: flex; align-items: baseline; gap: 12px; font-size: 26px; }
  .order .verb small { margin: 0; }
  .order .deal { border-left: 0; border-top: 1px solid var(--line-2); flex-direction: row; align-items: flex-end; }
  .hide-m { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { border-left: 0; } .facts div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .two, .seg { grid-template-columns: 1fr; } .seg button + button { border-left: 0; border-top: 1px solid var(--line); }
  .agenda li { grid-template-columns: 1fr; gap: 0; }
  dl.guide { grid-template-columns: 1fr; gap: 2px; } dl.guide dd { margin-bottom: 10px; }
  .sheet-panel { padding: 22px 18px 60px; }
}
@media (max-width: 520px) { .hide-s { display: none; } .who span.tag { display: none; } .mark { font-size: 19px; } .bar-right .btn { padding: 7px 10px; font-size: 14px; } .wallet { font-size: 17px; } }
