/* TUTO-GRID.CSS v2 (29/11/2026)
 * Tutoriel du site calque sur celui de l app (tutorial_screen.dart +
 * tutorial_demo.dart) : en-tete « livre + titre », une carte blanche avec
 * UNE grille animee et sa legende, le texte de l etape, le segmente 1 a 5
 * en pied de page, la pilule « Commencer a jouer » sur la derniere etape.
 * La grille a le rendu de la grille de jeu de la page principale
 * (grille.js + grid-app.css) : cadre et lignes de region 3 px, lignes
 * fines 1 px, 513 px sur ordinateur, min(96vw, 520px) sur telephone,
 * chiffres Inter 700, rampe de lumiere, email, biseau, selection, estompe.
 */

/* ---------- Page ---------- */
body.ta-page { background: #FAFBFC !important; }
html body .tutorial-steps.ta-host {
  height: auto !important; min-height: 0 !important; width: 100% !important;
  background: none !important; border: 0 !important; box-shadow: none !important;
  border-radius: 0 !important; overflow: visible !important; backdrop-filter: none !important;
  display: block !important; padding: 0 !important; margin: 0 auto !important;
}
html body .tutorial-container { max-width: 1100px; }

.ta { --ink: #0F172A; --ink2: #1C1C1E; --soft: #64748B; --hair: #EEF1F5; --track: #F1F3F7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  width: 100%; max-width: 1060px; margin: 0 auto; padding: 14px 0 70px; color: var(--ink2); }

.ta-hero { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 12px; }
.ta-hero img { width: 54px; height: 54px; object-fit: contain; animation: taFloat 4.2s ease-in-out infinite; }
.ta-hero h1 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -.02em; color: var(--ink2); }
@keyframes taFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(-2deg); } }

.ta-card { background: #fff; border: 1px solid var(--hair); border-radius: 18px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .05); padding: 26px 30px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 40px; align-items: center; }
.ta-demo { display: flex; flex-direction: column; align-items: center; }
.ta-legend { height: 30px; margin-top: 16px; display: flex; align-items: center; justify-content: center; }

.ta-side { align-self: stretch; display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; }
.ta-side .ta-seg { width: 100%; margin-top: 28px; }
.ta-text { max-width: 420px; text-align: center; }
.ta-text.ta-swap { animation: taText .26s ease-out; }
@keyframes taText { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ta-title { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 900; letter-spacing: -.02em; color: var(--ink2); }
.ta-body { margin: 10px 0 0; font-size: 16.5px; line-height: 1.55; color: #374151; }
.ta-punch { margin: 14px 0 0; font-size: 16.5px; line-height: 1.5; font-weight: 800; color: var(--ink2); }
.ta-tip { margin: 14px 0 0; font-size: 13.5px; line-height: 1.45; color: #6B7280; }
.ta-pill { margin: 20px auto 0; display: block; width: 260px; max-width: 100%; padding: 13px 8px;
  border-radius: 13px; border: 1px solid var(--hair); background: #fff; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .13); transition: transform .12s ease, box-shadow .12s ease; }
.ta-pill:hover { box-shadow: 0 3px 10px rgba(15, 23, 42, .14); }
.ta-pill:active { transform: scale(.97); }

/* Segmente 1 a 5 (LbSegmented) */
.ta-seg { margin: 16px auto 0; max-width: 340px; }
.ta-seg-track { position: relative; height: 38px; padding: 3px; border-radius: 13px; background: var(--track);
  display: grid; grid-template-columns: repeat(5, 1fr); box-sizing: border-box; }
.ta-seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 5);
  background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(15, 23, 42, .13);
  transition: transform .26s cubic-bezier(.215, .61, .355, 1); }
.ta-seg button { position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--soft); border-radius: 10px; }
.ta-seg button.on { font-weight: 700; color: var(--ink); }

/* Legendes */
.ta-chip { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--track);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: opacity .2s linear; }
.ta-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; box-sizing: border-box;
  border: .5px solid rgba(0, 0, 0, .10); }
.ta-key { width: 17px; height: 20px; border-radius: 5px; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; color: #1F2937; line-height: 1;
  background: linear-gradient(180deg, #FFFFFF 0%, #F3F6FA 100%); box-shadow: 0 1px 0 rgba(15, 23, 42, .14), inset 0 0 0 1px rgba(71, 85, 105, .18); }
.ta-sep { width: 1px; height: 14px; margin: 0 2px; background: #C7C7CC; flex: none; }
.ta-op { font-size: 12px; font-weight: 800; color: #6B7280; }
.ta-mini { width: 21px; height: 21px; border-radius: 5px; box-sizing: border-box; border: 1.6px solid #007aff;
  background: #5BD87A; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; color: #191B1F; }
.ta-slot { position: relative; flex: none; }
.ta-slot.r { width: 13px; height: 13px; }
.ta-slot.k { width: 17px; height: 20px; }
.ta-slot .ta-dash { position: absolute; inset: 0; box-sizing: border-box; border: 1.5px dashed #C7C7CC; }
.ta-slot.r .ta-dash { border-radius: 50%; }
.ta-slot.k .ta-dash { border-radius: 5px; }
.ta-slot.want .ta-dash { border: 2px dashed #2FAE52; }
.ta-slot .ta-in { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ta-zones { position: relative; width: 282px; height: 30px; padding: 3px; box-sizing: border-box; border-radius: 10px;
  background: var(--track); display: grid; grid-template-columns: repeat(3, 1fr); }
.ta-zones i { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); background: #fff;
  border-radius: 8px; box-shadow: 0 1px 3px rgba(15, 23, 42, .13); transition: transform .3s cubic-bezier(.215, .61, .355, 1); }
.ta-zones span { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--soft); white-space: nowrap; overflow: hidden; }
.ta-zones span.on { font-weight: 700; color: var(--ink); }
.ta-touch { min-width: 200px; justify-content: center; }
.ta-touch b { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.ta-touch .ta-pips { display: inline-flex; gap: 4px; margin-right: 2px; }
.ta-touch .ta-pips u { width: 6px; height: 6px; border-radius: 50%; background: #C7C7CC; }
.ta-touch .ta-pips u.on { background: #007aff; }

/* ---------- La grille (rendu de la grille de jeu) ---------- */
.tg {
  --tg-size: 513px;
  --tg-font: 32px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px;
  width: var(--tg-size); height: var(--tg-size); min-width: var(--tg-size); box-sizing: border-box;
  border: 3px solid transparent;
  background: linear-gradient(135deg, #41464D 0%, #31363E 50%, #2D3239 100%); background-origin: border-box;
  border-radius: 1.2px;
  box-shadow: 0 0 0 2px #F3EFE8, 0 6px 16px -4px rgba(42, 51, 70, .18), 0 1px 3px rgba(42, 51, 70, .08);
  position: relative; isolation: isolate; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.tg-region { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1px; min-width: 0; min-height: 0; }
.tg-cell {
  --ramp: rgba(0, 0, 0, 0); --ink: #191B1F;
  position: relative; min-width: 0; min-height: 0; border-radius: 1.2px;
  background-color: #E9F0FF;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.541) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0) 60%, rgba(0,0,0,.031) 100%),
    linear-gradient(var(--ramp), var(--ramp));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.144), inset 2px 0 0 rgba(255,255,255,.081), inset 0 -2px 0 rgba(0,0,0,.063), inset -2px 0 0 rgba(0,0,0,.036);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: var(--tg-font); font-weight: 700; line-height: 1;
  transition: opacity .22s ease, box-shadow .22s ease, background-color .15s ease;
}
.tg-face {
  position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.196) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0) 60%, rgba(0,0,0,.063) 100%),
    linear-gradient(var(--ramp), var(--ramp));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.144), inset 2px 0 0 rgba(255,255,255,.081), inset 0 -2px 0 rgba(0,0,0,.063), inset -2px 0 0 rgba(0,0,0,.036);
  transition: filter .12s ease, box-shadow .22s ease;
}
.tg-dig { position: relative; z-index: 2; text-shadow: 0 1px 0 rgba(255,255,255,.32); transition: transform .12s ease; }
.tg-cell:not(.filled) .tg-dig { text-shadow: 0 1px 0 rgba(255,255,255,.95); }
.tg-flash { position: absolute; inset: 0; border-radius: inherit; background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
.tg-cell::after { content: ''; position: absolute; inset: 0; background: #666; opacity: 0; pointer-events: none; border-radius: inherit; z-index: 15; transition: opacity 150ms ease; }
.tg.tg-live .tg-cell { cursor: pointer; }
@media (hover: hover) { .tg.tg-live .tg-cell:hover::after { opacity: .12; transition: opacity 70ms ease; } }

.tg-cell.dim, .tg-cell.dim .tg-face { box-shadow: inset 0 4px 8px rgba(0,0,0,.5); }
.tg-cell.sel { z-index: 30; }
.tg-cell.sel:not(.filled) { background-color: #FFFFFF; }
.tg-cell.sel .tg-face {
  background-image: linear-gradient(var(--ramp), var(--ramp)); filter: brightness(1.05) saturate(1.08);
  box-shadow: inset 0 3px 7px rgba(0,0,0,.20), inset 0 2px 0 rgba(0,0,0,.13), inset 2px 0 0 rgba(0,0,0,.08), inset 0 -2px 0 rgba(255,255,255,.17), inset -2px 0 0 rgba(255,255,255,.11);
}
.tg-cell.sel .tg-dig { transform: scale(.97); }
.tg-cell.sel::before, .tg-cell.call::before {
  content: ''; position: absolute; inset: -2px; border: 4px solid #007aff; box-shadow: 0 0 0 1px #007aff;
  pointer-events: none; z-index: 200; box-sizing: border-box;
}
.tg-cell.call { z-index: 30; }
.tg-cell.call::before { border-width: 3px; border-radius: 4px; opacity: calc(.35 + .65 * var(--call, 0));
  box-shadow: 0 0 0 calc(1px + 6px * var(--call, 0)) rgba(0, 122, 255, calc(.30 * var(--call, 0))); }

@media (prefers-reduced-motion: reduce) {
  .tg-cell, .tg-face, .tg-cell::after, .ta-seg-thumb, .ta-zones i { transition: none; }
  .ta-hero img, .ta-text.ta-swap { animation: none; }
}

/* ---------- Tablette ---------- */
@media (max-width: 1060px) and (min-width: 769px) {
  .ta-card { grid-template-columns: 1fr; row-gap: 22px; justify-items: center; }
}

/* ---------- Telephone ---------- */
@media (max-width: 768px) {
  html body .tutorial-container, html body #main-content.tutorial-container { padding: 0 !important; }
  .ta { padding: 12px 0 18px; }
  .ta-hero { margin: 4px 0 10px; }
  .ta-hero img { width: 46px; height: 46px; }
  .ta-hero h1 { font-size: 22px; }
  .ta-card { grid-template-columns: 1fr; row-gap: 14px; padding: 18px 0 16px; border-radius: 18px; margin: 0 2vw; justify-items: center; }
  .tg { --tg-size: min(calc(96vw - 2px), 520px); --tg-font: clamp(24px, 6.5vw, 30px); }
  .ta-text { padding: 0 16px; }
  .ta-title { font-size: 19px; }
  .ta-body, .ta-punch { font-size: 15px; }
  .ta-side { width: 100%; }
  .ta-side .ta-seg { margin: 16px 0 0; padding: 0 12px; box-sizing: border-box; max-width: 380px; }
  .ta-zones { width: min(282px, 86vw); }
}

/* 29/11 : textes du tutoriel justifies (titre centre) */
.ta-body, .ta-punch, .ta-tip { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }
.ta-text { width: 100%; }
