/* Thème « Tapis rouge et noir » : noir chaud, bordeaux, rouge de la marque, titres et chiffres en Host Grotesk, texte dans la police du système.
   Chargé en dernier : il fixe les jetons de couleur et les accents propres à ce parti pris.
   Les gains restent verts, les pertes en corail clair, le rouge vif est celui de la marque et de l'action principale. */

@font-face { font-family:"Host Grotesk"; font-style:normal; font-weight:400 700; font-display:swap; src:url("fonts/host-grotesk-latin.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212; }
@font-face { font-family:"Host Grotesk"; font-style:normal; font-weight:400 700; font-display:swap; src:url("fonts/host-grotesk-latin-ext.woff2") format("woff2"); unicode-range:U+0100-02BA,U+1E00-1EFF,U+20A0-20AB,U+20AD-20C4; }

:root {
  --font-body:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-display:"Host Grotesk",system-ui,-apple-system,"Segoe UI",sans-serif;
  --bg:#0b0708; --rail:#0e090a; --panel:#170d0f; --panel-2:#120a0c; --border:#35191f; --line:#35191f;
  --ink:#f6efec; --muted:#b29a9d; --neutral:#b29a9d; --cream:#fbeee9;
  --accent:#e74953; --accent-text:#ff7d87; --accent-solid:#cf3a47; --accent-solid-hover:#bd2f3c;
  --positive:#7be3a8; --red:#ff9f8a;
  --felt:#1f0d12; --felt-lit:#4a1320; --nav-on:#2c1217; --seg-on:#3b1820;
  --radius-panel:14px;
}
body { font-family:var(--font-body); background:var(--bg); }
h1,h2,h3 { font-family:var(--font-display); font-weight:600; letter-spacing:-.02em; }
.kpi-value,#chartTotal,.bank-total,.account-balance { font-variant-numeric:tabular-nums; }
.sidebar { background:var(--rail); }
.brand { font-family:var(--font-display); font-weight:700; }
.brand-mark,.brand-dot { color:var(--accent); }
nav button.active { background:var(--nav-on); color:var(--accent-text); font-weight:600; }
.panel,.kpi { border-radius:var(--radius-panel); }

/* Boutons : le rouge porte l'action principale, le bordeaux sombre les actions secondaires */
.primary { background:var(--accent-solid); color:#fff; }
@media(hover:hover){ .primary:hover { background:var(--accent-solid-hover); } }
.secondary { background:#1f1013; border-color:#44222b; color:#f3e1e3; }
@media(hover:hover){ .secondary:hover { background:#2a141a; } }
.segmented { background:var(--panel-2); border-color:var(--border); }
.segmented button.selected,.segmented button[aria-pressed="true"] { background:var(--seg-on); color:#ffe6e8; font-weight:600; }
input,textarea,select { background:var(--panel-2); border-color:#44222b; }
input:focus,textarea:focus,select:focus { border-color:var(--accent); outline-color:var(--accent); }
::selection { background:#6a2030; color:#fff; }
.demo-banner,.notice { background:#261014; border-color:#5c2832; color:#f0d5d9; }
.demo-banner button,.notice button { color:var(--accent-text); }
.text-btn,.edit,.delete { color:#e8c4c9; }
.negative { color:var(--red); }

/* Statistiques : le panneau principal devient le tapis bordeaux */
#analyticsView .hero-chart { background:radial-gradient(120% 150% at 12% 0%,var(--felt-lit) 0%,var(--felt) 55%,#150a0d 100%); border-color:#4f2029; position:relative; }
#analyticsView .hero-chart::after { content:"♠ ♥ ♦ ♣"; position:absolute; left:50%; top:16px; transform:translateX(-50%); font-size:18px; letter-spacing:.6em; color:var(--cream); opacity:.10; pointer-events:none; }
#analyticsView .hero-chart .panel-head { position:relative; z-index:1; }
#analyticsView .hero-chart h2 { font-size:19px; }
#analyticsView #chartTotal { font-family:var(--font-display); font-weight:600; font-size:52px; line-height:1; letter-spacing:-.02em; }
#analyticsView #chartTotal.positive { color:var(--cream); }
#analyticsView #chartTotal.negative { color:var(--red); }
#analyticsView #chartTotal.neutral { color:var(--ink); }
#analyticsView .chart-footer { border-top-color:#4f2029; }
#analyticsView .kpis { background:var(--panel-2); border-color:var(--border); }
#analyticsView .kpi-value { font-family:var(--font-display); font-weight:600; }
#analyticsView .stats-bar .segmented button { font-weight:500; }

/* Connexion */
#authScreen { background:radial-gradient(110% 70% at 50% 0%,#33101a 0%,#0e0809 58%,#080506 100%); }
#authScreen .auth-card { background:linear-gradient(180deg,#1a0d10 0%,#140b0d 100%); border-color:#4f2029; }
#authScreen .auth-brand { font-family:var(--font-display); font-weight:700; }
#authScreen .auth-brand>svg,#authScreen .auth-brand-dot { color:var(--accent); }
#authScreen .auth-page-heading h1 { font-family:var(--font-display); }
#authScreen .auth-guest-button { background:var(--accent-solid); border-color:var(--accent-solid); color:#fff; }
@media(hover:hover){ #authScreen .auth-guest-button:hover { background:var(--accent-solid-hover); border-color:var(--accent-solid-hover); } }
#authScreen #authSubmit,#authScreen #onlineAuthSubmit { background:transparent; border-color:var(--accent-solid); color:#ffcdd2; }
#authScreen #authSubmit:hover:enabled,#authScreen #onlineAuthSubmit:hover:enabled { background:#2c1217; border-color:var(--accent); }
#authScreen .auth-tabs>button.selected,#authScreen .online-auth-tabs>button.selected { background:var(--seg-on); color:#ffe6e8; box-shadow:inset 0 0 0 1px #7a2e3a; }

/* Bankroll, Outils et rubriques : chiffres en serif, couleurs de sens conservées */
.bank-total,.account-balance,.kpi-value { font-family:var(--font-display); font-weight:600; }

@media(max-width:700px) {
  #analyticsView #chartTotal { font-size:36px; }
  #analyticsView .hero-chart::after { display:none; }
  #analyticsView .hero-chart h2 { font-size:17px; }
}

/* Graphiques : courbe lissée, aire en dégradé, repères discrets ; un clic agrandit le graphique */
#chart svg,#bankrollHistory .bh-chart svg { cursor:zoom-in; }
svg .chart-grid { stroke:#3a1d24; stroke-dasharray:2 6; }
svg .chart-zero { stroke:#7a3a45; }
svg .chart-line { fill:none; stroke:var(--line); stroke-width:2.8; stroke-linecap:round; stroke-linejoin:round; }
svg .chart-dot { fill:#150a0d; stroke:var(--line); stroke-width:2; }
svg .chart-last { fill:var(--line); stroke:#150a0d; stroke-width:3; }
svg .chart-cursor { stroke:#c9a1a7; stroke-dasharray:3 4; }
svg .chart-peak line { stroke:#c9a1a766; stroke-dasharray:2 4; }
svg .chart-peak circle { fill:var(--cream); }
svg .chart-peak text { fill:var(--cream); font-size:12px; font-weight:600; }
svg .chart-end rect { fill:var(--line); }
svg .chart-end text { fill:#150a0d; font-size:12px; font-weight:700; }
.chart-tooltip { background:linear-gradient(180deg,#2a1217,#1c0c10); border:1px solid #5c2832; border-radius:12px; box-shadow:0 18px 36px -12px #000d; }
dialog.chart-zoom { width:min(1180px,96vw); height:min(760px,92dvh); max-width:none; max-height:none; padding:0; border:1px solid #4f2029; border-radius:22px; background:radial-gradient(120% 120% at 15% 0%,#3a1018,#160a0d 60%); color:var(--ink); box-shadow:0 30px 80px #000c; overflow:hidden; }
dialog.chart-zoom[open] { display:flex; flex-direction:column; }
dialog.chart-zoom::backdrop { background:#000000d0; }
.chart-zoom-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 22px 4px; }
.chart-zoom-head h2 { margin:0 0 6px; font-size:18px; }
#chartZoomValue { display:block; font:600 42px/1 var(--font-display); letter-spacing:-.02em; color:var(--cream); }
#chartZoomValue.negative { color:var(--red); }
.chart-zoom-body { position:relative; flex:1; min-height:0; margin:0 10px 12px; }
.chart-zoom-body svg { display:block; width:100%; height:auto; }
.chart-zoom-body .empty { padding:40px 20px; }
@media(max-width:700px) { dialog.chart-zoom { width:100vw; height:100dvh; border:0; border-radius:0; } #chartZoomValue { font-size:32px; } }

/* Relief et formes : surfaces éclairées par le haut, ombres portées douces, coins arrondis.
   Les fonds propres à une rubrique (tapis des Statistiques, table de jeu) gardent la priorité. */
:root { --radius-panel:18px; --radius-control:12px; --surface:linear-gradient(180deg,#1c0f12 0%,#160b0e 55%,#130a0c 100%); --edge:#371920; --edge-top:#4a222b; --lift:0 1px 2px #0009,0 18px 36px -22px #000; }
.panel,.kpi { background:#160b0e; border-color:var(--edge); box-shadow:none; }
/* Le relief marque ce qui compte : le graphique principal, les cartes de résultat et ce qui flotte (fenêtres, menus) */
.hero-chart,.bankroll-total-card,.sfs-hero,dialog,.profile-menu,.rp-pop { box-shadow:var(--lift); }
.hero-chart { background:var(--surface); border-top-color:var(--edge-top); }
.primary,.secondary { border-radius:999px; }
.primary { box-shadow:0 10px 20px -12px #e7495399; }
.secondary { box-shadow:0 6px 14px -10px #000; }
input,textarea,select { border-radius:var(--radius-control); }
.segmented { border-radius:14px; padding:4px; box-shadow:inset 0 2px 6px #0008; }
.segmented button { border-radius:10px; }
.icon-btn { border-radius:50%; }
input[type=file]::file-selector-button { margin-right:12px; padding:8px 14px; border:1px solid #44222b; border-radius:999px; background:#1f1013; color:#f3e1e3; font:inherit; cursor:pointer; }
html { scrollbar-color:#3f1d25 transparent; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:#3f1d25; border:2px solid transparent; border-radius:10px; background-clip:padding-box; }
::-webkit-scrollbar-track { background:transparent; }

/* Navigation : icônes dessinées, rubrique active en relief */
.sidebar nav button { display:flex; align-items:center; gap:12px; border-radius:12px; }
.nav-icon { width:19px; height:19px; flex:none; opacity:.8; }
nav button.active { background:linear-gradient(180deg,#3a1520,#2a0f17); box-shadow:0 8px 16px -12px #000; }
nav button.active .nav-icon { opacity:1; color:var(--accent-text); }
@media(max-width:700px){
  .sidebar nav { gap:6px; }
  .sidebar nav button { flex-direction:column; justify-content:center; gap:5px; min-height:56px; padding:8px 2px; font-size:12px; }
  .nav-icon { width:20px; height:20px; }
}

/* En-tête de page : titre seul, état de sauvegarde en pastille */
#subtitle:empty { display:none; }
#cloudSyncStatus { display:inline-flex; align-items:center; gap:7px; margin:8px 0 0; padding:5px 12px 5px 10px; border:1px solid var(--edge); border-radius:999px; background:#140a0d; font-size:12px; line-height:1.4; }
#cloudSyncStatus::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.9; }
@media(hover:hover){ #cloudSyncStatus:hover { border-color:#5c2531; color:var(--ink); } }
/* Sessions : l'import reste à portée sans peser comme un bouton */
.sessions-toolbar { display:flex; justify-content:flex-end; margin:0 0 6px; }
.import-link { display:inline-flex; align-items:center; gap:8px; min-height:40px; padding:0 4px; color:#e8c4c9; font-size:13px; font-weight:600; }
.import-link .nav-icon { width:17px; height:17px; }
@media(hover:hover){ .import-link:hover { color:var(--accent-text); } }
.btn-with-icon { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.btn-icon { width:16px; height:16px; flex:none; }
.backup-actions { align-items:center; gap:6px 18px; }
.backup-actions .text-btn { min-height:40px; font-size:13px; font-weight:600; }

/* Calendrier : cases arrondies en relief, gains et pertes teintés en dégradé */
.calendar-grid { gap:6px; }
.day { border-radius:12px; border-color:#331a20; background:linear-gradient(180deg,#1f1114 0%,#170b0e 100%); box-shadow:0 6px 14px -12px #000; transition:border-color .15s ease-out; }
@media(hover:hover){ button.day:hover { border-color:#5c2531; } }
.day.win { background:linear-gradient(180deg,#183026 0%,#11211b 100%); border-color:#2f5c48; }
.day.loss { background:linear-gradient(180deg,#2d1418 0%,#210f12 100%); border-color:#6a2e38; }
.day.blank { box-shadow:none; background:none; }
.day.selected { outline:2px solid #e8b9c0; outline-offset:1px; }
.day strong { font-size:12px; font-variant-numeric:tabular-nums; letter-spacing:0; }
.day .amt-short { display:none; }
@media(max-width:700px){
  .calendar-grid { gap:4px; padding:8px; }
  .day { border-radius:10px; }
  .day .amt-full { display:none; }
  .day .amt-short { display:inline; }
  .day strong { font-size:12px; }
}

/* ---------- Menus déroulants : même hauteur et même chevron sur tous les navigateurs ----------
   Safari dessinait un petit bouton natif qui ignorait la hauteur et le retrait du texte. */
:where(select:not([multiple]):not([size])) { -webkit-appearance:none; appearance:none; min-height:44px; cursor:pointer; text-overflow:ellipsis; }
select:not([multiple]):not([size]) { padding-right:40px !important; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a9ae' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") !important; background-repeat:no-repeat !important; background-position:right 14px center !important; background-size:16px !important; }
@media(hover:hover){ select:not([multiple]):not([size]):hover { border-color:#6a3440; } }
#handWizard .replay-playback select,#handWizard .hand-participant-row select { padding-right:24px !important; background-position:right 6px center !important; background-size:12px !important; }
.form-grid>label>select,.form-grid>label>input:not([type=checkbox]):not([type=radio]) { min-height:var(--control-height); }

/* ---------- Libellés de champs avec icône ---------- */
.field-label { display:flex; align-items:center; gap:8px; min-width:0; }
.field-label>span { min-width:0; }
.field-icon { flex:none; width:17px; height:17px; fill:none; stroke:var(--accent-text); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; opacity:.9; }
label:has(.field-icon) .rp-trigger .rp-ico { display:none; }
.form-grid>label { transition:color .15s; }
.form-grid>label:focus-within .field-label { color:#fff; }
.form-grid>label:focus-within .field-icon { opacity:1; transform:scale(1.08); }
.field-icon { transition:transform .2s cubic-bezier(.2,.8,.2,1), opacity .15s; }
dialog .modal-head h2 { font-size:24px; }

/* ---------- Ouverture des fenêtres : légère montée ---------- */
dialog[open] { animation:river-dialog-in .32s cubic-bezier(.16,1,.3,1); }
dialog[open]::backdrop { animation:river-backdrop-in .25s ease-out; }
@keyframes river-dialog-in { from { opacity:0; transform:translateY(14px) scale(.985); } to { opacity:1; transform:none; } }
@keyframes river-backdrop-in { from { opacity:0; } to { opacity:1; } }

/* ---------- Cartes d'événement ---------- */
.event-card { border-left:0; margin:10px 12px; padding:16px 18px; border:1px solid #3d1c24; border-top-color:#52242e; border-radius:16px; background:linear-gradient(180deg,#24121a,#1a0d11); box-shadow:0 1px 2px #0008,0 14px 26px -20px #000; }
.event-card .event-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.event-card .event-card-head strong { font:600 17px var(--font-display); color:var(--cream); }
.event-card .event-label { display:inline-flex; align-items:center; gap:6px; flex:none; padding:5px 11px; border-radius:999px; background:#3a1720; color:#ffd9dd; font-size:13px; font-weight:600; font-variant-numeric:tabular-nums; }
.ev-icon { flex:none; width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.event-card .event-facts { display:flex; flex-wrap:wrap; gap:8px 16px; margin:12px 0 4px; color:#d5bcc0; font-size:13px; line-height:1.4; }
.event-card .event-facts>span { display:inline-flex; align-items:center; gap:6px; min-width:0; }
.event-card .event-facts .ev-icon { color:var(--accent-text); }
.event-card .event-notes { margin:10px 0 0; color:#c3a8ac; font-size:13px; }
.event-card .event-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:14px; }
.event-card .event-actions .primary,.event-card .event-actions .secondary { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 16px; font-size:13px; font-weight:600; text-decoration:none; }
.event-card .event-actions .ev-icon { width:16px; height:16px; }
.event-card .event-delete { width:44px; padding:0 !important; justify-content:center; margin-left:auto; color:#e9b3b9; }
@media(prefers-reduced-motion:reduce){ dialog[open],dialog[open]::backdrop { animation:none; } .field-icon { transition:none; } }
/* Même taille de texte pour tous les champs des formulaires */
.form-grid input:not([type=checkbox]):not([type=radio]),.form-grid select,.form-grid textarea { font-size:15px; }
.form-grid input::placeholder,.form-grid textarea::placeholder { font-size:14px; }
.rooms-root input:not([type=checkbox]):not([type=radio]) { min-height:44px; }
#addDayEvent.day-add { display:inline-flex; align-items:center; gap:7px; min-height:44px; padding:0 16px; font-size:13px; font-weight:600; }

/* ---------- Palette secondaire : chaque chose a sa couleur ----------
   Cash = turquoise, MTT = ambre, gains = vert, pertes = corail ; les rubriques ont chacune leur teinte. */
:root { --cash:#ffd166; --mtt:#6aa8ff; --sky:#73b4ff; --stats:#4fc3d0; --ivory:#efe2d2; --rose:#ff8fb1; --mint:#7be3a8; --coral:#ff9f8a; --orange:#ffad66; }
.badge { display:inline-flex; align-items:center; gap:6px; padding:3px 9px 3px 8px; border-radius:999px; font-size:12px; font-weight:600; }
.badge .badge-dot { width:7px; height:7px; border-radius:50%; background:currentColor; }
.badge.cash { color:var(--cash); background:color-mix(in srgb,var(--cash) 12%,transparent); border-color:color-mix(in srgb,var(--cash) 34%,transparent); }
.badge.mtt { color:var(--mtt); background:color-mix(in srgb,var(--mtt) 12%,transparent); border-color:color-mix(in srgb,var(--mtt) 34%,transparent); }
.event-chip { gap:6px; padding:4px 7px; border-radius:7px; font-weight:600; }
.event-chip .chip-dot { flex:none; width:6px; height:6px; border-radius:50%; background:currentColor; }
.event-chip.mtt { color:#dbe8ff; background:color-mix(in srgb,var(--mtt) 20%,#1a0d10); }
.event-chip.cash { color:#fff0c4; background:color-mix(in srgb,var(--cash) 20%,#1a0d10); }

/* Menu : une teinte par rubrique */
.sidebar nav button[data-view="analytics"] { --hue:var(--stats); }
.sidebar nav button[data-view="sessions"] { --hue:var(--cash); }
.sidebar nav button[data-view="calendar"] { --hue:var(--mtt); }
.sidebar nav button[data-view="hands"] { --hue:var(--ivory); }
.sidebar nav button[data-view="bankroll"] { --hue:var(--mint); }
.sidebar nav button[data-view="tools"] { --hue:var(--orange); }
.sidebar nav button[data-view="friends"] { --hue:var(--rose); }
.sidebar nav button .nav-icon { color:var(--hue,currentColor); opacity:.8; transition:opacity .15s, transform .2s cubic-bezier(.2,.8,.2,1); }
.sidebar nav button.active { background:linear-gradient(180deg,color-mix(in srgb,var(--hue,#e74953) 20%,#1a0d10),color-mix(in srgb,var(--hue,#e74953) 11%,#140a0c)) !important; color:#fff !important; box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--hue,#e74953) 30%,transparent), 0 8px 18px -12px #000; }
.sidebar nav button.active .nav-icon { opacity:1; transform:scale(1.08); }
@media(hover:hover){ .sidebar nav button:hover .nav-icon { opacity:1; } }

/* Chiffres clés : une lueur de couleur différente par carte */

/* Icônes des formulaires : une couleur par famille */
.field-label:has(use[href^="#fi-calendar"]) .field-icon { stroke:var(--sky); }
.field-label:has(use[href^="#fi-clock"]) .field-icon,.field-label:has(use[href="#fi-pause"]) .field-icon,.field-label:has(use[href="#fi-hourglass"]) .field-icon { stroke:var(--ivory); }
.field-label:has(use[href="#fi-pin"]) .field-icon,.field-label:has(use[href="#fi-link"]) .field-icon { stroke:var(--rose); }
.field-label:has(use[href="#fi-cards"]) .field-icon,.field-label:has(use[href="#fi-chips"]) .field-icon,.field-label:has(use[href="#fi-trophy"]) .field-icon { stroke:var(--mtt); }
.field-label:has(use[href="#fi-in"]) .field-icon { stroke:var(--coral); }
.field-label:has(use[href="#fi-out"]) .field-icon,.field-label:has(use[href="#fi-coin"]) .field-icon { stroke:var(--mint); }
.field-label:has(use[href="#fi-exchange"]) .field-icon,.field-label:has(use[href="#fi-swap"]) .field-icon,.field-label:has(use[href="#fi-repeat"]) .field-icon,.field-label:has(use[href="#fi-users"]) .field-icon { stroke:var(--cash); }
/* Cartes d'événement : icônes assorties */
.event-card .event-facts>span:has(use[href="#fi-pin"]) .ev-icon { color:var(--rose); }
.event-card .event-facts>span:has(use[href="#fi-cards"]) .ev-icon { color:var(--mtt); }
.event-card .event-facts>span:has(use[href="#fi-in"]) .ev-icon { color:var(--mint); }
.event-card .event-facts>span:has(use[href="#fi-calendar"]) .ev-icon { color:var(--sky); }

/* ---------- Téléphone : menu en bas de l'écran ----------
   Cinq entrées à portée de pouce ; « Plus » ouvre Calendrier, Bankroll et Social. */
.nav-more,.nav-more-sheet { display:none !important; }
@media(max-width:700px){
  .sidebar { padding:14px 17px 10px; }
  .sidebar nav { position:fixed; left:0; right:0; bottom:0; z-index:60; display:grid !important; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px; margin:0 !important; width:auto !important; padding:6px 6px calc(6px + env(safe-area-inset-bottom)); background:color-mix(in srgb,#0e090a 90%,transparent); -webkit-backdrop-filter:blur(16px) saturate(140%); backdrop-filter:blur(16px) saturate(140%); border-top:1px solid #ffffff12; box-shadow:0 -10px 30px -18px #000; }
  .sidebar nav > button[data-view="calendar"],.sidebar nav > button[data-view="bankroll"],.sidebar nav > button[data-view="friends"] { display:none !important; }
  .sidebar nav > button,.nav-more { display:flex !important; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:54px; padding:6px 2px !important; border-radius:12px; font-size:12px !important; line-height:1.1; text-align:center; white-space:nowrap; }
  .sidebar nav > button span,.nav-more span { overflow:hidden; text-overflow:ellipsis; max-width:100%; }
  .sidebar nav > button.active,.nav-more.active { box-shadow:none !important; }
  .nav-more { width:100%; border:0; background:none; color:#b2a3a4; }
  .nav-more[aria-expanded="true"] { background:#2a1218; color:#fff; }
  .nav-more.active { color:#fff; background:color-mix(in srgb,#e74953 16%,#140a0c); }
  .nav-more-sheet:not([hidden]) { display:grid !important; position:fixed; left:10px; right:10px; bottom:calc(76px + env(safe-area-inset-bottom)); z-index:61; gap:4px; padding:8px; border:1px solid #4a222b; border-top-color:#5e2b36; border-radius:18px; background:linear-gradient(180deg,#22121a,#180c10); box-shadow:0 24px 48px -18px #000; animation:nav-sheet-in .24s cubic-bezier(.16,1,.3,1); transform-origin:85% 100%; }
  .nav-more-sheet button { display:flex !important; flex-direction:row !important; align-items:center; justify-content:flex-start !important; gap:14px !important; min-height:52px; padding:0 16px !important; border-radius:12px; font-size:15px !important; text-align:left; }
  .nav-more-sheet .nav-icon { width:22px; height:22px; }
  main { padding-bottom:calc(92px + env(safe-area-inset-bottom)) !important; }
  #toast { bottom:calc(84px + env(safe-area-inset-bottom)); }
}
@keyframes nav-sheet-in { from { opacity:0; transform:translateY(10px) scale(.97); } to { opacity:1; transform:none; } }
@media(prefers-reduced-motion:reduce){ .nav-more-sheet:not([hidden]) { animation:none; } }
/* Boutons du menu « Plus » (placé hors de la barre) */
.nav-more-sheet button { width:100%; border:0; background:none; color:#ecdcdf; font:inherit; cursor:pointer; }
.nav-more-sheet button:active { transform:scale(.98); }
@media(hover:hover){ .nav-more-sheet button:hover { background:#ffffff0a; } }
.nav-more-sheet button.active,.nav-more-sheet button[aria-current="page"] { background:#2c1218; color:#fff; }
.nav-more-sheet button[data-view="calendar"] .nav-icon { color:var(--mtt); }
.nav-more-sheet button[data-view="bankroll"] .nav-icon { color:var(--mint); }
.nav-more-sheet button[data-view="friends"] .nav-icon { color:var(--rose); }

/* Cibles tactiles : 44 px minimum pour les boutons d'icône de l'interface générale */
.modal-head .icon-btn,.profile-toggle { min-width:44px; min-height:44px; }

/* ---------- Statistiques : chiffres clés en une rangée au-dessus de la courbe (maquette Superdesign A) ---------- */
#analyticsView .kpis--row { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; margin:0 0 16px; background:none; border:0; border-radius:0; overflow:visible; }
#analyticsView .kpis--row .kpi { padding:16px; border:1px solid var(--edge); border-radius:16px; background:#160b0e; }
#analyticsView .kpis--row .kpi-top { display:flex; align-items:center; gap:8px; justify-content:flex-start; color:var(--muted); font-size:13px; }
#analyticsView .kpis--row .kpi-value { margin:10px 0 4px; font-size:clamp(20px,1.7vw,26px); white-space:nowrap; font-variant-numeric:tabular-nums; }
#analyticsView .kpis--row small { color:var(--muted); font-size:12px; }
.kpi-icon { width:16px; height:16px; flex:none; color:var(--accent-text); }
.kpi-icon *, .nav-icon * { stroke-width:1.5; }
.sidebar nav button.active .nav-icon *, .nav-more.active .nav-icon * { stroke-width:2; }
@media(max-width:1100px){ #analyticsView .kpis--row { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:700px){ #analyticsView .kpis--row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } #analyticsView .kpis--row .kpi { padding:14px; } }

/* ---------- Ressenti : appui, transitions précises, texte net ---------- */
html { -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
h1,h2,h3 { text-wrap:balance; }
p { text-wrap:pretty; }
.primary,.secondary,.text-btn,.icon-btn,nav button,.segmented button,.nav-more { transition-property:transform,background-color,color,border-color,box-shadow; transition-duration:.15s; transition-timing-function:cubic-bezier(.2,0,0,1); }
.primary:not(:disabled):active,.secondary:not(:disabled):active,.text-btn:not(:disabled):active,.icon-btn:not(:disabled):active,nav button:not(:disabled):active,.segmented button:active,.nav-more:active { transform:scale(.96); }
@media(prefers-reduced-motion:reduce){ .primary:active,.secondary:active,.text-btn:active,.icon-btn:active,nav button:active,.segmented button:active,.nav-more:active { transform:none; } }
#analyticsView .kpis--row .kpi:nth-child(n) { grid-column:auto; border:1px solid var(--edge); border-radius:16px; }
#analyticsView .kpis--row .kpi-value { overflow-wrap:normal; }
/* Barre du bas : « Statistiques » ne tient pas en 75 px, le libellé court « Stats » le remplace sur téléphone */
@media(max-width:700px){
  .sidebar nav > button[data-view="analytics"] > span { font-size:0 !important; }
  .sidebar nav > button[data-view="analytics"] > span::after { content:"Stats"; font-size:12px; }
}

/* ---------- Rejeu d'une main : une seule barre de commandes ---------- */
.rp-bar { display:flex; align-items:center; gap:10px; margin:0 0 14px; padding:8px 10px 8px 8px; border:1px solid var(--edge); border-radius:999px; background:#160b0e; }
.rp-step,.rp-play,.rp-speed { flex:none; display:grid; place-items:center; padding:0; cursor:pointer; transition-property:transform,background-color,opacity; transition-duration:.15s; transition-timing-function:cubic-bezier(.2,0,0,1); }
.rp-step { width:44px; height:44px; border:1px solid #44222b; border-radius:50%; background:#1f1013; color:#f3e1e3; }
.rp-step:disabled { opacity:.35; cursor:default; }
.rp-play { width:48px; height:48px; border:0; border-radius:50%; background:var(--accent-solid); color:#fff; box-shadow:0 8px 18px -10px #e74953aa; }
.rp-step:not(:disabled):active,.rp-play:active,.rp-speed:active { transform:scale(.96); }
.rp-ico { width:20px; height:20px; }
.rp-play .rp-ico { width:22px; height:22px; }
.rp-track { flex:1; min-width:0; margin:0; display:block; }
.rp-track input[type=range] { -webkit-appearance:none; appearance:none; display:block; width:100%; height:6px; min-height:0 !important; margin:0; padding:0; border:0; border-radius:99px; background:linear-gradient(to right,var(--accent) var(--rp-pct,0%),#ffffff1f var(--rp-pct,0%)); cursor:pointer; }
.rp-track input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:20px; height:20px; border-radius:50%; background:#f6efec; box-shadow:0 1px 4px #0009; }
.rp-track input[type=range]::-moz-range-thumb { width:20px; height:20px; border:0; border-radius:50%; background:#f6efec; }
.rp-status { flex:none; display:flex; flex-direction:column; align-items:flex-end; min-width:64px; line-height:1.25; }
.rp-status b { font:600 15px var(--font-display); color:#fff; }
.rp-count { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.rp-speed { min-width:48px; height:44px; padding:0 10px; border:1px solid #44222b; border-radius:999px; background:none; color:#f3e1e3; font-weight:600; font-size:13px; font-variant-numeric:tabular-nums; }
#handWizard.replay-fullscreen .rp-bar { position:sticky; top:0; z-index:4; }
.rp-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.rp-footer-main { display:flex; gap:8px; flex-wrap:wrap; margin-left:auto; }
/* Dans le dialogue : la barre d'options vide ne prend plus de place, la table reprend la hauteur libérée. */
#handWizard.replay-view #handViewOptions:empty { display:none; }
#handWizard.replay-view .rp-bar { margin:12px 0 10px; }
#handWizard.replay-view .poker-table-scene { height:calc(100cqh - 124px); }
#handWizard.replay-view .rp-footer > .text-btn { min-height:44px; padding:0 6px; font-size:14px; }
#handWizard.replay-view .rp-footer-main > button { min-height:44px; padding:0 18px; font-size:14px; }
@media(max-width:560px){
  .rp-bar { flex-wrap:wrap; row-gap:6px; border-radius:20px; padding:8px 10px 6px; }
  .rp-track { order:5; flex-basis:100%; padding:8px 4px; }
  .rp-status { margin-left:auto; }
  .rp-long { display:none; }
  .rp-bar--edit { flex-wrap:nowrap; }
  .rp-bar--edit .rp-track { order:0; flex-basis:auto; padding:0 6px; }
  /* Sur téléphone, le rejeu prend tout l'écran : plus besoin du bouton « Plein écran ». */
  #handWizard.hand-wizard.replay-view { inset:0; width:100dvw; height:100dvh; max-width:none; max-height:100dvh; margin:0; border:0; border-radius:0; }
  #handWizard.replay-view .replay-fullscreen-button { display:none; }
  #handWizard.replay-view .wizard-top { padding-top:max(7px,env(safe-area-inset-top)); }
  #handWizard.replay-view .poker-table-scene { height:calc(100cqh - 158px); }
  #handWizard.replay-view .rp-footer { flex-wrap:nowrap; }
  #handWizard.replay-view .rp-footer-main { flex-wrap:nowrap; }
  #handWizard.replay-view .rp-footer-main > button { padding:0 14px; }
  #handWizard.replay-view .dealer-button { right:-13px; top:-9px; }
}
@media(prefers-reduced-motion:reduce){ .rp-step:active,.rp-play:active,.rp-speed:active { transform:none; } }

/* Informations courtes d'une carte (date, position, format) : alignées, séparées par un point discret. */
.meta-row { display:flex; flex-wrap:wrap; align-items:center; column-gap:8px; row-gap:4px; }
.meta-row > span:not(.meta-demo) + span:not(.meta-demo)::before { content:""; display:inline-block; width:3px; height:3px; margin-right:8px; border-radius:50%; background:currentColor; opacity:.5; vertical-align:middle; }
.meta-demo { display:inline-flex; align-items:center; padding:1px 8px; border:1px solid #44222b; border-radius:999px; color:var(--muted); font-size:12px; line-height:1.5; }
.hand-pot .meta-row b { color:var(--ink); font-weight:600; font-variant-numeric:tabular-nums; }
/* Noms des joueurs pendant le rejeu : bloc replié en bas, qui s'ouvre dans le flux (plus de menu flottant en haut). */
#handWizard.replay-view #wizardBody > .hand-participants { margin:12px 0 0; border:1px solid #44222b; border-radius:14px; }
#handWizard.replay-view #wizardBody > .hand-participants > summary { min-height:44px; display:flex; align-items:center; padding:0 14px; font-size:14px; }
#handWizard.replay-view #wizardBody > .hand-participants .hand-participants-body { position:static; width:auto; max-height:none; border:0; border-top:1px solid #44222b; border-radius:0 0 14px 14px; box-shadow:none; }

/* Statistiques : 5 chiffres clés sans case vide (3 + 2 sur tablette, 2 + 2 + 1 large sur téléphone) */
@media(max-width:1100px){ #analyticsView .kpis--row { grid-template-columns:repeat(6,minmax(0,1fr)); } #analyticsView .kpis--row .kpi:nth-child(n) { grid-column:span 2; } #analyticsView .kpis--row .kpi:nth-child(n+4) { grid-column:span 3; } }
@media(max-width:700px){ #analyticsView .kpis--row { grid-template-columns:repeat(2,minmax(0,1fr)); } #analyticsView .kpis--row .kpi:nth-child(n) { grid-column:auto; } #analyticsView .kpis--row .kpi:nth-child(5):last-child { grid-column:1 / -1; } }

/* Sessions : quand le tableau défile de côté, le résultat net reste visible à droite */
@media(max-width:1100px){
  #sessionTable th:last-child,#sessionTable td:last-child { position:sticky; right:0; z-index:1; box-shadow:-14px 0 14px -12px #000; }
  #sessionTable td:last-child { background:#160b0e; }
  #sessionTable th:last-child { background:#201314; }
  .session-edit-mode #sessionTable tr[data-session-row]:hover td:last-child { background:#321e22; }
}

/* Finitions 21/11 (suite) : plus de barre sur un seul côté des blocs, une teinte pleine à la place */
.hand-notes { margin:16px 0; padding:10px 13px; border:1px solid #ffffff0d; border-left:1px solid #ffffff0d; border-radius:10px; background:#ffffff08; }
.analysis-study-question { padding:10px 13px; border:1px solid #9e5f6933; border-radius:10px; background:#9e5f691a; }
.hand-wizard .winner-summary { padding:8px 14px; border:1px solid #7be3a833; border-radius:10px; background:#7be3a812; }
.room-message.mine { padding:12px 13px; border:1px solid #95646c33; border-radius:12px; background:#2a161a; }
.room-message blockquote { border:1px solid #86636933; border-radius:8px; }

/* Mains : le menu « Actions » prend la forme des autres boutons, chevron dessiné au lieu du caractère ⌄ */
.hand-options>summary { border-radius:999px; border-color:#44222b; background:#1f1013; color:#f3e1e3; font-weight:600; box-shadow:0 6px 14px -10px #000; }
.hand-options[open]>summary { border-color:#6a2e38; background:#2a1519; }
.hand-options>summary::after { content:''; width:10px; height:10px; background:currentColor; opacity:.7; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; transition:transform .2s cubic-bezier(.2,0,0,1); }
.hand-options[open]>summary::after { transform:rotate(180deg); }
/* Le résultat d'une main reste sur une ligne (« +48,88 BB » se coupait sur téléphone) ; libellés sans espacement de capitales */
.journal-head>strong { flex:none; white-space:nowrap; font-variant-numeric:tabular-nums; }
.card-caption { letter-spacing:0; }

/* Social : sur téléphone le premier onglet ne colle plus au bord de l'écran quand la bande s'aligne */
@media(max-width:650px){ #socialRoot .social-tabs { scroll-padding-inline:16px; } }

/* Rejeu et saisie de main : le tapis reprend le feutre rouge de River (accueil, connexion) au lieu du vert.
   Textes du centre éclaircis pour rester lisibles sur le rouge (≥ 4,5:1). */
.hand-wizard .poker-felt { border-color:#2a070c; background:radial-gradient(120% 90% at 50% 35%,#8a2232 0%,#5a1220 48%,#34090f 100%); box-shadow:inset 0 0 0 1px #ffffff14,inset 0 0 50px #0007,0 0 0 1px #ffffff14,0 18px 35px -14px #000; }
.hand-wizard .poker-felt::after { border-color:#f6efec1a; }
.hand-wizard .table-potlabel { color:#ecdadd; }
.hand-wizard .table-pot-value { color:#f6efec; font-variant-numeric:tabular-nums; }
.hand-wizard .table-street { color:#ecdadd; }

/* Blocs dépliables restants (« Joueurs » de la saisie de main, « Utiliser un compte local ») : chevron dessiné au lieu du triangle du navigateur */
#handWizard .hand-participants { border-color:#3d1c24; border-radius:12px; }
#handWizard .hand-participants>summary,#authScreen .local-account-details>summary { display:flex; align-items:center; gap:8px; min-height:44px; list-style:none; font-weight:600; }
#handWizard .hand-participants>summary { padding:0 14px; font-size:13px; }
#authScreen .local-account-details>summary { justify-content:center; }
#handWizard .hand-participants>summary::-webkit-details-marker,#authScreen .local-account-details>summary::-webkit-details-marker { display:none; }
#handWizard .hand-participants>summary::before,#authScreen .local-account-details>summary::after { content:''; flex:none; width:10px; height:10px; background:currentColor; opacity:.7; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; transform:rotate(-90deg); transition:transform .2s cubic-bezier(.2,0,0,1); }
#authScreen .local-account-details>summary::after { transform:none; }
#handWizard .hand-participants[open]>summary::before { transform:none; }
#authScreen .local-account-details[open]>summary::after { transform:rotate(180deg); }
@media(prefers-reduced-motion:reduce){ #handWizard .hand-participants>summary::before,#authScreen .local-account-details>summary::after,.hand-options>summary::after { transition:none; } }

/* Saisie de main : boutons d'action et étapes en pastilles, comme le reste de l'appli */
#handWizard .table-action-buttons button { border-radius:999px; }
#handWizard .wizard-steps>span { border-radius:999px; padding-inline:12px; }

/* Tous les blocs dépliables : plus de triangle du navigateur. Ceux qui n'avaient pas leur propre flèche
   (salons, mains partagées, sauvegardes, historique, analyse…) reçoivent le même chevron dessiné. */
summary { list-style:none; cursor:pointer; }
summary::-webkit-details-marker { display:none; }
:is(details:not([class]):not(.bankroll-history details),.room-create,.room-pinned,.room-attachments,.hand-history,.analysis-street,.history-import-errors)>summary:not([aria-label])::before { content:''; display:inline-block; width:10px; height:10px; margin-right:8px; vertical-align:-1px; background:currentColor; opacity:.7; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; transform:rotate(-90deg); transition:transform .2s cubic-bezier(.2,0,0,1); }
:is(details:not([class]):not(.bankroll-history details),.room-create,.room-pinned,.room-attachments,.hand-history,.analysis-street,.history-import-errors)[open]>summary:not([aria-label])::before { transform:none; }
@media(prefers-reduced-motion:reduce){ summary::before { transition:none !important; } }

/* Notifications : le nom et la phrase se suivent sur la même ligne (avant : deux colonnes et « Bruno Démosuit ») */
.social-notification-target { display:block; width:100%; }
.social-notification-target strong { display:inline; }

/* Forum sur téléphone : « Catégorie » et « Tri » l'un sous l'autre pour ne plus couper « Toutes les catégories » ; cases à cocher aux couleurs de River */
@media(max-width:420px){ .room-filters { grid-template-columns:1fr; } }
input[type=checkbox],input[type=radio],progress { accent-color:#e74953; }

/* Salons : étoile des favoris dessinée, alignée dans son bouton */
.room-favorite,[data-room-favorite] { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:44px; min-height:44px; }
[data-room-favorite] .room-star { flex:none; }

/* Table des mains : matière et mouvement (21/11).
   Grain de feutre très fin sur le tapis ; sièges en verre dépoli posés dessus ; dos de carte pendant la distribution
   (table-motion.js) ; reflet qui passe sur les boutons d'action au survol, et léger enfoncement au clic. */
:root { --felt-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .85 0 0 0 0 .87 .55 0 0 0 -.22'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); }
.hand-wizard .poker-felt { background:var(--felt-grain),radial-gradient(120% 90% at 50% 35%,#8a2232 0%,#5a1220 48%,#34090f 100%); }
.hand-wizard .table-seat { background:rgb(30 14 18 / .72); -webkit-backdrop-filter:blur(12px) saturate(150%); backdrop-filter:blur(12px) saturate(150%); border-color:rgb(255 255 255 / .12); box-shadow:inset 0 1px 0 rgb(255 255 255 / .07),0 10px 22px -12px #000; }
.hand-wizard .table-seat.folded { background:rgb(24 12 15 / .5); }
.deal-back { position:absolute; inset:-1px; border-radius:inherit; background:repeating-linear-gradient(45deg,#7a1d2b 0 3px,#5f1521 3px 6px); box-shadow:inset 0 0 0 2px #f6efec; pointer-events:none; }
#handWizard .table-action-buttons button { position:relative; overflow:hidden; isolation:isolate; }
#handWizard .table-action-buttons button::before { content:''; position:absolute; inset:0; z-index:-1; background:linear-gradient(105deg,transparent 30%,rgb(255 255 255 / .26) 48%,rgb(255 255 255 / .06) 56%,transparent 70%); translate:-130% 0; pointer-events:none; }
@media(hover:hover){ #handWizard .table-action-buttons button:hover::before { translate:130% 0; transition:translate .75s cubic-bezier(.2,.7,.2,1); } }
@media(prefers-reduced-motion:reduce){ #handWizard .table-action-buttons button:hover::before { transition:none; translate:-130% 0; } }

/* Statistiques : risque de ruine (risk-panel.js) — réglages à gauche, résultat à droite ; empilés sur téléphone */
.risk-panel { margin-top:22px; }
.risk-body { display:grid; grid-template-columns:minmax(220px,300px) minmax(0,1fr); gap:28px; padding:6px 22px 22px; }
.risk-inputs { display:grid; gap:12px; align-content:start; }
.risk-inputs label { display:grid; gap:6px; margin:0; color:var(--muted); font-size:13px; }
.risk-inputs input { min-height:44px; font-variant-numeric:tabular-nums; }
.risk-source { margin:2px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.risk-source .text-btn { font-size:12px; font-weight:600; padding:4px 0; }
.risk-result { display:grid; gap:14px; align-content:start; min-width:0; }
.risk-figure { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 14px; }
.risk-figure > span:first-child { flex-basis:100%; color:var(--muted); font-size:13px; }
.risk-value { font:650 clamp(34px,4vw,46px)/1 var(--font-display); letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.risk-value.is-low { color:#7be3a8; } .risk-value.is-moderate { color:#ffa94d; } .risk-value.is-critical { color:#ff6b74; }
.risk-badge { padding:4px 11px; border-radius:999px; font-size:12px; font-weight:650; border:1px solid currentColor; }
.risk-badge.is-low { color:#7be3a8; background:#7be3a814; } .risk-badge.is-moderate { color:#ffa94d; background:#ffa94d14; } .risk-badge.is-critical { color:#ff6b74; background:#ff6b7414; }
.risk-gauge { position:relative; display:grid; grid-template-columns:repeat(3,1fr); gap:4px; height:12px; margin-top:4px; }
.risk-gauge i { border-radius:999px; opacity:.35; }
.risk-gauge .is-low { background:#7be3a8; } .risk-gauge .is-moderate { background:#ffa94d; } .risk-gauge .is-critical { background:#ff6b74; }
.risk-gauge b { position:absolute; top:50%; left:calc(var(--p) * 100%); width:6px; height:24px; margin:-12px 0 0 -3px; border-radius:999px; background:#f6efec; box-shadow:0 0 0 3px #170d0f,0 4px 10px -2px #000; transition:left .6s cubic-bezier(.16,1,.3,1); }
.risk-scale { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; color:var(--muted); font-size:12px; }
.risk-scale span:nth-child(2) { text-align:center; } .risk-scale span:last-child { text-align:right; }
.risk-facts, .risk-kelly { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0; }
.risk-facts > div, .risk-kelly > div { display:grid; gap:4px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#ffffff05; }
.risk-facts dt, .risk-kelly dt { color:var(--muted); font-size:12px; }
.risk-facts dd, .risk-kelly dd { margin:0; color:var(--ink); font:600 15px/1.3 var(--font-display); font-variant-numeric:tabular-nums; }
.risk-advice { display:grid; gap:10px; padding:14px 16px; border:1px solid var(--line); border-radius:14px; }
.risk-advice h3 { margin:0; font:650 15px var(--font-display); color:var(--cream); }
.risk-advice p { margin:0; color:#e8d6d9; font-size:13px; line-height:1.55; }
.risk-advice.is-ok { border-color:#7be3a840; background:#7be3a80d; }
.risk-advice.is-warn { border-color:#ffa94d40; background:#ffa94d0d; }
.risk-advice.is-bad { border-color:#ff6b7440; background:#ff6b740d; }
.risk-note, .risk-empty { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
@media(max-width:760px){
  .risk-body { grid-template-columns:minmax(0,1fr); gap:20px; padding:4px 16px 18px; }
  .risk-inputs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .risk-source { grid-column:1 / -1; }
  .risk-facts, .risk-kelly { grid-template-columns:minmax(0,1fr); }
  .risk-scale small { display:none; }
}
@media(prefers-reduced-motion:reduce){ .risk-gauge b { transition:none; } }
.risk-gauge i { transition:opacity .4s; }
.risk-gauge.is-low i.is-low, .risk-gauge.is-moderate i.is-moderate, .risk-gauge.is-critical i.is-critical { opacity:1; }
.risk-scale small { font-size:inherit; }

.pt-var-chart { position:relative; }

/* Rejeu de la main : cartes plus grandes, proportionnelles à la table (cqw/cqh = corps du dialogue).
   --rp-board = largeur d'une carte du tableau, --rp-hole = largeur d'une carte des joueurs ; hauteur = 1,38 × largeur. */
#handWizard.replay-view { --rp-board:clamp(30px, min(4.8cqw, 9.5cqh), 58px); --rp-hole:clamp(24px, min(3.5cqw, 6.8cqh), 42px); }
#handWizard.replay-view .table-board { min-height:calc(var(--rp-board) * 1.38); gap:calc(var(--rp-board) * .12); }
#handWizard.replay-view .table-board .poker-card { width:var(--rp-board); height:calc(var(--rp-board) * 1.38); border-radius:calc(var(--rp-board) * .13); font-size:calc(var(--rp-board) * .5); }
#handWizard.replay-view .seat-hole { flex-basis:calc(var(--rp-hole) * 1.38); min-height:calc(var(--rp-hole) * 1.38); gap:3px; }
#handWizard.replay-view .seat-hole .poker-card { width:var(--rp-hole); height:calc(var(--rp-hole) * 1.38); border-radius:calc(var(--rp-hole) * .13); font-size:max(12px, calc(var(--rp-hole) * .5)); }
/* Le siège s'élargit pour ses deux cartes et reste entier dans la table. */
#handWizard.replay-view .table-seat { --sw:max(94px, calc(var(--rp-hole) * 2 + 18px)); width:var(--sw);
  left:clamp(calc(var(--sw) / 2 + 2px), var(--seat-x), calc(100% - var(--sw) / 2 - 2px));
  top:clamp(calc(var(--rp-hole) * .69 + 36px), var(--seat-y), calc(100% - var(--rp-hole) * .69 - 36px)); }
@media (max-width:700px) {
  #handWizard.replay-view { --rp-board:clamp(26px, min(9.4cqw, 6cqh), 42px); --rp-hole:clamp(20px, min(7.4cqw, 4.6cqh), 32px); }
  #handWizard.replay-view .table-board { max-width:none; }
  #handWizard.replay-view .table-seat { --sw:max(68px, calc(var(--rp-hole) * 2 + 10px));
    left:clamp(calc(var(--sw) / 2 + 2px), var(--mobile-x), calc(100% - var(--sw) / 2 - 2px));
    top:clamp(calc(var(--rp-hole) * .69 + 32px), var(--mobile-y), calc(100% - var(--rp-hole) * .69 - 32px)); }
}

/* Fin de main avec abattage (table-motion.js) : les cinq cartes gagnantes se soulèvent et s'éclairent
   l'une après l'autre ; les autres cartes visibles pâlissent. Seuls translate, opacity et l'ombre bougent. */
.poker-table-scene.is-showdown .river-playing-card:not(.card-back) { transition:opacity .45s ease-out var(--best-wait,160ms), translate .5s cubic-bezier(.16,1,.3,1), box-shadow .5s ease-out; }
.poker-table-scene.is-showdown .river-playing-card:not(.card-back):not(.is-best) { opacity:.42; }
.poker-table-scene.is-showdown .river-playing-card.is-best { animation:best-rise .62s cubic-bezier(.16,1,.3,1) both; animation-delay:calc(var(--best-wait,160ms) + var(--best-i,0) * 70ms); }
@keyframes best-rise {
  0%   { translate:0 0; box-shadow:0 2px 3px #0003; }
  55%  { translate:0 -9px; box-shadow:0 0 0 2px #7be3a8, 0 10px 22px -6px #7be3a8aa; }
  100% { translate:0 -5px; box-shadow:0 0 0 2px #7be3a8cc, 0 8px 18px -8px #7be3a899; }
}
@media (prefers-reduced-motion: reduce) {
  .poker-table-scene.is-showdown .river-playing-card.is-best { animation:none; translate:0 -4px; box-shadow:0 0 0 2px #7be3a8cc; }
  .poker-table-scene.is-showdown .river-playing-card:not(.card-back) { transition:none; }
}

/* Petite fête après une session gagnante (river-motion.js) : carte de verre au centre, jetons qui jaillissent. */
.rm-win { position:fixed; inset:0; z-index:9000; display:grid; place-items:center; pointer-events:none; }
.rm-win__card { position:relative; display:grid; justify-items:center; gap:4px; padding:18px 30px 20px; border:1px solid #7be3a833; border-radius:22px; background:rgb(20 9 13 / .78); -webkit-backdrop-filter:blur(14px) saturate(1.2); backdrop-filter:blur(14px) saturate(1.2); box-shadow:0 30px 60px -24px #000, 0 0 0 1px #ffffff0d inset, 0 0 60px -20px #7be3a866; }
.rm-win__card small { color:#c6babc; font:600 13px/1.2 var(--font-display, system-ui); letter-spacing:.04em; text-transform:uppercase; }
.rm-win__card b { color:#7be3a8; font:750 clamp(34px, 8vw, 54px)/1 var(--font-display, system-ui); font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.rm-chip { position:absolute; left:calc(50% - 11px); top:calc(50% - 11px); width:22px; height:22px; border-radius:50%; background:repeating-conic-gradient(var(--c) 0 32deg, #fff 32deg 45deg); box-shadow:inset 0 0 0 4px var(--c), inset 0 0 0 5px #0004, 0 4px 8px -2px #0008; }

/* Passage fluide entre rubriques (app.js navigate) : seule la zone principale change, le menu reste immobile. */
/* Le nom n'est posé que pendant le passage : hors transition, main ne crée pas de contexte d'empilement. */
html.rv-nav main { view-transition-name:river-main; }
::view-transition-old(root), ::view-transition-new(root) { animation:none; }
::view-transition-old(river-main) { animation:rv-page-out .16s ease-in both; }
::view-transition-new(river-main) { animation:rv-page-in .34s cubic-bezier(.16,1,.3,1) both; }
@keyframes rv-page-out { to { opacity:0; translate:0 -6px; } }
@keyframes rv-page-in { from { opacity:0; translate:0 14px; } }
/* Navigateurs sans « View Transitions » : la nouvelle rubrique entre seule. */
section.view-in { animation:rv-page-in .34s cubic-bezier(.16,1,.3,1) both; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(river-main), ::view-transition-new(river-main), section.view-in { animation:none; }
}

/* Table des mains : « Hero » devient une petite pastille à côté de la position ; elle passe à la ligne
   quand le siège est étroit (avant : « UTG+1 · Hero » débordait du siège sur téléphone). */
#handWizard .table-seat .seat-position { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:2px 4px; max-width:100%; white-space:normal; line-height:14px; }
#handWizard .seat-hero-tag { display:inline-block; padding:0 5px; border:1px solid #e7495366; border-radius:999px; background:#e7495324; color:#ffe0e3; font-size:12px; font-weight:650; line-height:14px; }

/* Téléphone : aucune page ne doit défiler de côté. Les tableaux défilent dans leur propre cadre. */
main { min-width:0; max-width:100%; overflow-x:clip; }
@media (max-width:480px) {
  .pt-eq small { white-space:normal; }
  .day-card-actions { display:flex; flex-wrap:wrap; gap:4px 14px; }
}
.day-card-actions { display:flex; flex-wrap:wrap; align-items:center; gap:4px 16px; }
/* Saisie d'une main en plein écran : la table prend la hauteur libérée (le corps défile au besoin). */
#handWizard.replay-fullscreen:not(.replay-view) .poker-table-scene { height:clamp(360px, calc(100dvh - 330px), 680px); }
@media (max-width:700px) { #handWizard.replay-fullscreen:not(.replay-view) .poker-table-scene { height:clamp(380px, calc(100dvh - 340px), 620px); } }
/* Siège du Hero : la pastille « Hero » ajoute une ligne, le siège est plus haut : il garde sa place dans la table. */
#handWizard.replay-view .table-seat.hero-seat { top:clamp(calc(var(--rp-hole) * .69 + 48px), var(--seat-y), calc(100% - var(--rp-hole) * .69 - 48px)); }
@media (max-width:700px) { #handWizard.replay-view .table-seat.hero-seat { top:clamp(calc(var(--rp-hole) * .69 + 46px), var(--mobile-y), calc(100% - var(--rp-hole) * .69 - 46px)); } }
/* Cartes gagnantes d'un joueur : liseré seulement, sans se soulever (elles recouvraient le statut « Gagnant »). */
.poker-table-scene.is-showdown .seat-hole .river-playing-card.is-best { animation-name:best-ring; }
@keyframes best-ring { 0% { box-shadow:0 2px 3px #0003; } 55% { box-shadow:0 0 0 2px #7be3a8, 0 8px 18px -6px #7be3a8aa; } 100% { box-shadow:0 0 0 2px #7be3a8cc, 0 6px 14px -8px #7be3a899; } }
