/* Tableau Tactikofoot (bêta) : direction artistique de la chaîne — fond #111, encre crème #F4EBD9, accent jaune
   #F2E21C, surfaces #232323 ; Roboto et Roboto Condensed (Apache 2.0, LICENCE-roboto-apache-2.0.txt). */
@font-face { font-family: 'Tactiko Roboto'; src: url('fonts/roboto-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Tactiko Roboto'; src: url('fonts/roboto-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Tactiko Roboto'; src: url('fonts/roboto-700.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Tactiko Roboto Condensed'; src: url('fonts/roboto-condensed-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root { --fond: #111111; --encre: #f4ebd9; --accent: #f2e21c; --surface: #1b1b1b; --surface-2: #232323; --trait: #333; --doux: #a8a296; --alerte: #ff6b5b; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fond); color: var(--encre); font: 500 14px/1.4 'Tactiko Roboto', sans-serif; }
body { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }

.tb-app { position: fixed; inset: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr) 300px; grid-template-rows: 56px minmax(0, 1fr) 64px; }
.tb-app[data-panel="off"] { grid-template-columns: 64px minmax(0, 1fr) 0; }
.tb-app[data-panel="off"] .tb-side { display: none; }

/* En-tête : marque, titre du schéma, créateur, exports. */
.tb-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--trait); background: var(--fond); min-width: 0; }
.tb-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.tb-brand img { width: 34px; height: 34px; }
.tb-brand b { font: 700 19px/1 'Tactiko Roboto Condensed', sans-serif; letter-spacing: 0.04em; }
.tb-beta { font: 700 11px/1 'Tactiko Roboto', sans-serif; color: #111; background: var(--accent); padding: 4px 6px; border-radius: 4px; letter-spacing: 0.06em; }
.tb-title { flex: 1 1 200px; min-width: 120px; max-width: 420px; height: 36px; padding: 0 10px; background: var(--surface); border: 1px solid var(--trait); border-radius: 8px; }
.tb-who { color: var(--doux); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.tb-spacer { flex: 1; }

.tb-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; min-width: 36px; padding: 0 12px; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 13px; }
.tb-btn:hover { border-color: #5c5c5c; background: var(--surface-2); }
.tb-btn:disabled { opacity: 0.4; cursor: default; }
.tb-btn[aria-pressed="true"] { background: var(--encre); color: #111; border-color: var(--encre); }
.tb-btn.tb-main { background: var(--accent); color: #111; border-color: var(--accent); }
.tb-btn.tb-main:hover { background: #fff04a; }
.tb-btn svg { width: 18px; height: 18px; flex: none; }
.tb-btn kbd { font: 600 10px/1 'Tactiko Roboto', sans-serif; color: var(--doux); border: 1px solid var(--trait); border-radius: 4px; padding: 2px 4px; }

/* Outils (colonne de gauche). */
.tb-tools { grid-row: 2 / 4; grid-column: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; border-right: 1px solid var(--trait); overflow-y: auto; }
.tb-tool { width: 46px; height: 46px; padding: 0; flex-direction: column; gap: 2px; font-size: 10px; }
.tb-tool span { font-size: 9.5px; font-weight: 600; }
.tb-sep { width: 36px; height: 1px; background: var(--trait); margin: 4px 0; flex: none; }
.tb-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--trait); cursor: pointer; padding: 0; flex: none; }
.tb-swatch[aria-pressed="true"] { border-color: var(--encre); box-shadow: 0 0 0 2px var(--fond), 0 0 0 4px var(--encre); }

/* Terrain. */
.tb-stage { grid-row: 2; grid-column: 2; position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 14px; background: #0b0b0b; }
.tb-canvas { display: block; touch-action: none; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.tb-canvas[data-tool="move"] { cursor: default; }
.tb-canvas[data-tool="move"][data-hover="1"] { cursor: grab; }
.tb-canvas[data-drag="1"] { cursor: grabbing; }
.tb-canvas[data-tool="pass"], .tb-canvas[data-tool="run"], .tb-canvas[data-tool="zone"], .tb-canvas[data-tool="rect"] { cursor: crosshair; }
.tb-canvas[data-tool="erase"] { cursor: cell; }
.tb-toast { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--encre); color: #111; padding: 9px 14px; border-radius: 8px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,0.5); pointer-events: none; max-width: 90%; }
.tb-toast[data-tone="warn"] { background: var(--alerte); color: #fff; }

/* Étapes (bas). */
.tb-steps { grid-row: 3; grid-column: 2; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-top: 1px solid var(--trait); overflow-x: auto; min-width: 0; }
.tb-chips { display: flex; gap: 6px; flex: none; }
.tb-step { min-width: 74px; }
.tb-step[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #111; }
.tb-speed { display: flex; align-items: center; gap: 8px; color: var(--doux); font-size: 12px; flex: none; }
.tb-speed input { width: 110px; accent-color: var(--accent); }

/* Panneau de droite. */
.tb-side { grid-row: 2 / 4; grid-column: 3; border-left: 1px solid var(--trait); overflow-y: auto; padding: 6px 14px 20px; background: var(--fond); }
.tb-side h2 { font: 700 12px/1 'Tactiko Roboto', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--doux); margin: 18px 0 10px; }
.tb-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.tb-row label { flex: 0 0 76px; color: var(--doux); font-size: 12.5px; }
.tb-row input[type="text"], .tb-row input[type="number"], .tb-row select { flex: 1; min-width: 0; height: 34px; padding: 0 9px; background: var(--surface); border: 1px solid var(--trait); border-radius: 7px; }
.tb-row input[type="number"] { flex: 0 0 70px; }
.tb-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-colors .tb-swatch { width: 24px; height: 24px; }
.tb-seg { display: flex; gap: 4px; flex: 1; }
.tb-seg .tb-btn { flex: 1; padding: 0 6px; }
.tb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tb-list li { display: flex; align-items: center; gap: 6px; }
.tb-list .tb-open { flex: 1; justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; }
.tb-list .tb-open[aria-current="true"] { border-color: var(--accent); }
.tb-hint { color: var(--doux); font-size: 12px; margin: 6px 0; }
.tb-legal { color: var(--doux); font-size: 11.5px; margin-top: 24px; border-top: 1px solid var(--trait); padding-top: 12px; }

/* Porte d'entrée : code d'accès. */
.tb-gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 50% 30%, #1d1d1d, #0a0a0a 70%); z-index: 10; }
.tb-gate-card { width: min(440px, 100%); background: var(--fond); border: 1px solid var(--trait); border-radius: 14px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.tb-gate-card img { width: 72px; height: 72px; display: block; margin-bottom: 14px; }
.tb-gate-card h1 { font: 700 30px/1.05 'Tactiko Roboto Condensed', sans-serif; margin: 0 0 6px; letter-spacing: 0.02em; }
.tb-gate-card p { color: var(--doux); margin: 8px 0; }
.tb-gate-code { width: 100%; height: 50px; margin: 14px 0 10px; padding: 0 14px; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; font: 700 20px/1 'Tactiko Roboto', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; }
.tb-gate-error, .tb-gate-card .tb-gate-error { color: var(--alerte); min-height: 20px; font-weight: 600; }
.tb-gate .tb-btn { width: 100%; height: 46px; font-size: 15px; }
.tb-gate small { display: block; color: var(--doux); margin-top: 16px; font-size: 12px; }

/* Export du clip : fenêtre d'attente. */
.tb-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 20; }
.tb-modal-card { background: var(--fond); border: 1px solid var(--trait); border-radius: 12px; padding: 22px 24px; width: min(420px, 92%); }
.tb-modal-card h2 { margin: 0 0 8px; font: 700 20px/1.1 'Tactiko Roboto Condensed', sans-serif; }
.tb-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 14px 0; }
.tb-bar i { display: block; height: 100%; width: 0; background: var(--accent); }

/* Page de confidentialité (texte qui défile). */
body.tb-doc { overflow: auto; }
.tb-doc main { max-width: 760px; margin: 0 auto; padding: 32px 18px 60px; }
.tb-doc h1 { font: 700 30px/1.1 'Tactiko Roboto Condensed', sans-serif; }
.tb-doc h2 { font: 700 18px/1.2 'Tactiko Roboto', sans-serif; color: var(--accent); margin-top: 28px; }
.tb-doc li { margin: 6px 0; }

@media (max-width: 900px) {
  .tb-app { grid-template-columns: 56px minmax(0, 1fr) 0; }
  .tb-app[data-panel="on"] .tb-side { display: block; position: fixed; right: 0; top: 56px; bottom: 0; width: min(320px, 90vw); z-index: 5; }
  .tb-app:not([data-panel="on"]) .tb-side { display: none; }
  .tb-who, .tb-brand b { display: none; }
}
