/*
 * teamsport11 – sketches of exercises (package Q «Lavagna», 12.11.2026): the sketch and its legend, the player of
 * board.js (play, steps, speed), the plan of a training session on its appointment and the editor of a sketch
 * (board-editor.js). Uses the tokens of app.css.
 */
.ai-diagram { margin: 6px 0; }
.ai-diagram-svg { display: block; width: 100%; max-width: 460px; height: auto; border-radius: 10px; }
.ai-diagram figcaption { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.ai-lg { display: inline-flex; align-items: center; gap: 5px; }
.ai-lg::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); }
.ai-lg-team_a::before { background: #2563eb; } .ai-lg-team_b::before { background: #dc2626; }
.ai-lg-team_c::before { background: #f8fafc; border: 1px solid #111827; } .ai-lg-team_d::before { background: #7c3aed; }
.ai-lg-team_n::before { background: #facc15; } .ai-lg-team_gk::before { background: #111827; border: 1px solid #fff; }
.ai-lg-ball::before { background: #fff; border: 2px solid #111827; width: 8px; height: 8px; }
.ai-lg-cone::before { background: none; width: 0; height: 0; border-radius: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid #f97316; }
.ai-lg-pole::before { width: 3px; border-radius: 0; background: #ca8a04; }
.ai-lg-goal::before, .ai-lg-minigoal::before { border-radius: 2px; background: none; border: 2px solid var(--muted); width: 6px; }
.ai-lg-arrow_pass::before, .ai-lg-arrow_run::before, .ai-lg-arrow_dribble::before, .ai-lg-arrow_shot::before { width: 18px; height: 0; border-radius: 0; background: none; border-top: 2px solid var(--muted); }
.ai-lg-arrow_run::before { border-top-style: dashed; }
.ai-lg-arrow_dribble::before { border-top-style: dotted; border-top-width: 3px; }
.ai-lg-arrow_shot::before { border-top: 4px solid #ca8a04; }
.ai-lg-size { margin-left: auto; }
.ai-lg-marker::before { width: 9px; height: 9px; background: #f97316; }
.ai-lg-ring::before { background: none; border: 2px solid #38bdf8; }
.ai-lg-hurdle::before { width: 12px; height: 4px; border-radius: 2px; background: #ca8a04; }
.ai-lg-ladder::before { width: 14px; height: 7px; border-radius: 1px; background: none; border: 2px solid #ca8a04; }
.ai-lg-mannequin::before { width: 6px; height: 12px; border-radius: 3px; background: #a3a3a3; }
.ai-lg-net::before { width: 0; height: 12px; border-radius: 0; background: none; border-left: 2px dashed var(--muted); }
/* Board 2 (19.11.2026): green team, coach, heap of balls, high ball, alternative way. */
.ai-lg-team_e::before { background: #16a34a; }
.ai-lg-coach::before { width: 7px; height: 12px; border-radius: 3px; background: #14532d; }
.ai-lg-balls::before { width: 12px; height: 8px; background: radial-gradient(circle at 25% 60%, #fff 30%, transparent 32%), radial-gradient(circle at 75% 60%, #fff 30%, transparent 32%), #6b7280; border-radius: 4px; }
.ai-lg-arrow_lob::before, .ai-lg-arrow_alt::before { width: 18px; height: 0; border-radius: 0; background: none; border-top: 3px dotted var(--muted); }
.ai-lg-arrow_alt::before { border-top: 2px solid #9ca3af; }

/* Player: the arrows of the past steps faint, the current one bright, the coming ones hidden. */
.board .ai-diagram-svg g[data-g] { transition: opacity .25s; }
.board .ai-diagram-svg g.is-past { opacity: .28; }
.board .ai-diagram-svg g.is-next { opacity: 0; }
/* Alternative ways (board 2): always there, faint while it plays. */
.board.is-playing .ai-diagram-svg g.is-alt { opacity: .35; }
.board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px; max-width: 460px; }
.board-bar .btn { min-width: 40px; justify-content: center; }
.board-bar .btn[disabled] { opacity: .45; cursor: default; }
.board-loop { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.board-loop input { margin: 0; }
.board-status { margin-left: auto; font-variant-numeric: tabular-nums; }
.board-issues { margin-top: 6px; font-size: .82rem; color: var(--warn); max-width: 460px; }
.board-issues summary { cursor: pointer; }
.board-issues ul { margin: 4px 0 0; padding-left: 1.1rem; }
.board-repair { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .board .ai-diagram-svg g[data-g] { transition: none; } }

/* Intensity of a block or a session. */
.badge.intensity-low { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.intensity-medium { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.intensity-high { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* Plan of the session on the appointment. */
.plan-head { margin-bottom: 8px; }
.plan-title { margin: 0 0 4px; }
.plan-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 6px; }
.plan-tools { margin: 4px 0 10px; }
.plan-tools .hint { margin: 0; }
.plan-edit-head { margin: 0 0 12px; }
.plan-edit-head > summary { list-style: none; display: inline-flex; }
.plan-edit-head > summary::-webkit-details-marker { display: none; }
.plan-edit-head[open] > summary { margin-bottom: 10px; }
.plan-head-form { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); max-width: 900px; }
.plan-delete { margin-top: 10px; }
.plan-blocks { margin: 10px 0; padding-left: 1.4rem; display: grid; gap: 12px; }
.plan-block { padding: 10px 12px; border-left: 3px solid var(--brand-soft); background: color-mix(in srgb, var(--bg) 50%, var(--surface)); border-radius: 6px; scroll-margin-top: calc(var(--header-h, 61px) + 12px); }
.plan-block::marker { font-weight: 700; color: var(--brand); }
.plan-block:target { border-left-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.plan-block-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.plan-block-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.plan-block p { margin: 4px 0; }
.plan-block-body.has-diagram { display: grid; gap: 4px 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .plan-block-body.has-diagram { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); align-items: start; } }
.plan-block-tools { margin-top: 8px; gap: 6px; }

/* Editor of a sketch. */
.plan-editor { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1200px) { .plan-editor { grid-template-columns: minmax(320px, 1fr) minmax(0, 1.5fr); } }
.plan-editor-actions { margin-top: 16px; }
.plan-editor-board h2 { margin-bottom: 8px; }
.be.is-ready .be-static { display: none; }
.be-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.be-group { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.be-tool { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; min-width: 36px; padding: 4px 8px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--ink); font: inherit; font-size: .82rem; cursor: pointer; justify-content: center; }
.be-tool:hover { background: var(--surface); border-color: var(--line); }
.be-tool[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.be-tool:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.be-icon { font-weight: 700; font-size: .95rem; line-height: 1; min-width: 1em; text-align: center; }
.be-tool-team-a .be-icon, .be-tool-team-b .be-icon, .be-tool-team-c .be-icon, .be-tool-team-d .be-icon, .be-tool-team-e .be-icon, .be-tool-team-n .be-icon, .be-tool-team-gk .be-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: .7rem; }
.be-tool-team-a .be-icon { background: #2563eb; } .be-tool-team-b .be-icon { background: #dc2626; }
.be-tool-team-c .be-icon { background: #f8fafc; color: #111827; box-shadow: 0 0 0 1px #111827 inset; } .be-tool-team-d .be-icon { background: #7c3aed; }
.be-tool-team-e .be-icon { background: #16a34a; } .be-tool-team-n .be-icon { background: #facc15; color: #111827; } .be-tool-team-gk .be-icon { background: #111827; box-shadow: 0 0 0 1px #fff inset; }
.be-label { white-space: nowrap; }
@media (max-width: 1500px) { .be-group:not(:first-child) .be-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.be-area { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin-bottom: 8px; font-size: .85rem; }
.be-num { display: grid; gap: 2px; font-weight: 600; color: var(--muted); }
.be-num input { width: 84px; min-height: 34px; padding: 4px 8px; }
.be-preset { width: auto; min-height: 34px; padding: 4px 8px; }
.be-check { display: inline-flex; align-items: center; gap: 6px; }
.be-check input { margin: 0; }
/* Board 2 (19.11.2026): pitch, markings, sizes, names of the teams, the picture to draw over. */
.be-more { margin: -2px 0 8px; font-size: .85rem; max-width: 900px; }
.be-more > summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.be-more-body { display: grid; gap: 8px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.be-marks, .be-legend, .be-trace { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.be-sub { font-weight: 600; color: var(--muted); }
.be-legend input { width: 150px; min-height: 32px; padding: 3px 8px; }
.be-trace input[type="file"] { max-width: 240px; }
.be-trace input[type="range"] { flex: 0 0 140px; width: 140px; min-height: 0; padding: 0; }
.be-props .be-check { font-size: .85rem; }
.be-canvas { position: relative; border-radius: 12px; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; max-width: 900px; }
.be-canvas[data-tool="select"] { cursor: default; }
.be-canvas:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent); }
.be-canvas .ai-diagram-svg { max-width: none; }
.be-props { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 44px; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); max-width: 900px; }
.be-props p { margin: 0; }
.be-what { font-size: .9rem; }
.be-field { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.be-field select, .be-field input { width: auto; min-height: 32px; padding: 3px 8px; }
.be-field input[type="number"] { width: 70px; }
.be-props .hint { margin: 0; }
.be-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 900px; }
.be-foot .btn[disabled] { opacity: .45; cursor: default; }
.be-status { margin: 0 0 0 auto; color: var(--muted); }
.be-status.ok { color: var(--ok); } .be-status.warn { color: var(--warn); } .be-status.bad { color: var(--danger); }
.be-help { max-width: 900px; }
.be-preview { margin-top: 10px; }
.be-preview .ai-diagram-svg { max-width: 640px; }

@media print {
  .ai-diagram-svg { print-color-adjust: exact; -webkit-print-color-adjust: exact; max-width: 380px; }
  .board-bar, .board-issues, .plan-tools, .plan-block-tools, .plan-edit-head { display: none !important; }
  .plan-block { break-inside: avoid; background: none; border-left-color: #999; }
}
/* E-mail and library next to each other under the plan (12.11.2026). */
.plan-share-tools { align-items: flex-start; margin-top: 8px; }
.plan-share-tools .ai-mail[open] { flex-basis: 100%; order: 2; }

/* Explanation per step of a tactical board (13.11.2026): the step that plays is highlighted. */
.board-steps { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .9rem; }
.board-steps li { display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; border-radius: 6px; transition: background .2s, opacity .2s; }
.board-steps li.is-now { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.board-steps li.is-past { opacity: .6; }
.board-step-n { flex: none; display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; background: #111827; color: #fff; font-size: .75rem; font-weight: 700; }

/* Presenting a board (15.11.2026, to show it on an iPad): the whole screen, title, player and the explanation at the
   side (below on a screen standing upright), ‹ › and the list of the boards of the set. */
.board-bar .board-max { font-size: 1rem; }
.board-bar.is-static { margin: 6px 0 2px; }
.bp { position: fixed; inset: 0; z-index: 58; display: flex; flex-direction: column; padding: 10px 14px 12px; background: var(--bg); color: var(--ink);
  padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.bp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bp-title { flex: 1 1 220px; min-width: 0; margin: 0; font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-nav { display: flex; align-items: center; gap: 6px; }
.bp-nav .btn { min-width: 44px; min-height: 44px; justify-content: center; font-size: 1.3rem; line-height: 1; }
.bp-nav .btn[disabled] { opacity: .4; cursor: default; }
.bp-pick { width: auto; max-width: min(320px, 44vw); min-height: 44px; }
.bp-count { font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: center; }
.bp-close { min-height: 44px; }
.bp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 30%); gap: 16px; margin-top: 10px; }
.bp-body.no-side { grid-template-columns: minmax(0, 1fr); }
.bp-stage { display: flex; min-height: 0; min-width: 0; touch-action: pan-y; }
.bp-stage figure.board { flex: 1; display: flex; flex-direction: column; min-height: 0; margin: 0; }
.bp-stage .ai-diagram-svg { flex: 1 1 0; min-height: 0; width: 100%; max-width: none; }
.bp-stage .board-bar { max-width: none; justify-content: center; margin-top: 10px; gap: 10px; }
.bp-stage .board-bar .btn { min-width: 52px; min-height: 46px; font-size: 1.1rem; }
.bp-stage .board-bar .board-max { display: none; }
.bp-stage .board-status { margin-left: 8px; font-size: .95rem; }
.bp-stage figcaption { justify-content: center; font-size: .85rem; }
.bp-stage .board-issues { display: none; }
.bp-side { min-height: 0; overflow: auto; font-size: 1.05rem; line-height: 1.45; padding-right: 4px; }
.bp-side .tactics-comment { font-size: 1.15rem; font-weight: 600; margin-top: 0; }
.bp-side .board-steps { font-size: 1.05rem; gap: 6px; }
.bp-side .board-steps li { padding: 6px 10px; }
.bp-side .plan-block-text p { margin: 0 0 8px; }
@media (orientation: portrait), (max-width: 860px) {
  .bp-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .bp-side { max-height: 34vh; }
  .bp-title { flex-basis: 100%; order: -1; white-space: normal; font-size: 1.15rem; }
  .bp-nav { flex: 1 1 auto; }
  .bp-pick { flex: 1 1 auto; max-width: none; min-width: 0; }
}
@media print { .bp, .board-max { display: none !important; } }

/* Own boards (17.11.2026): a picture instead of or next to the sketch, a video of the exercise or the board. */
.plan-block-boards { display: grid; gap: 10px; align-content: start; min-width: 0; }
.board-image img { display: block; width: 100%; max-width: 460px; height: auto; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.board-image-link { display: block; max-width: 460px; }
.board-video { display: grid; gap: 6px; max-width: 460px; }
.board-video .embed { max-width: 460px; }
.board-steps.is-static { margin: 6px 0; }
.bp-stage figure.board-image .board-image-link { flex: 1 1 0; min-height: 0; display: flex; max-width: none; }
.bp-stage figure.board-image img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
.board-media-fields { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0 0; display: grid; gap: 8px; min-width: 0; }
.board-media-fields legend { font-weight: 600; padding: 0 4px; }
.board-media-fields .field { margin: 0; }
.board-media-current { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.board-media-current img { display: block; max-width: 240px; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.board-media-fields input[type="file"] { max-width: 100%; width: 100%; }
.board-media-fields input { min-width: 0; }
