/* Diseñador de Tareas de Fútbol — estilos
 * Todo va dentro de .dtf-root para no chocar con Astra ni con otros plugins.
 */
.dtf-root {
  --ink: #0f1a16;
  --ink-2: #1a2925;
  --line: #dce4df;
  --paper: #ffffff;
  --paper-2: #f4f7f4;
  --text: #16241f;
  --muted: #6b7d75;
  --cono: #f2761f;      /* naranja cono: el acento de la herramienta */
  --lima: #bfe14a;      /* lima: acciones que abren algo nuevo */
  --tiza: #2f6fb0;
  --ok: #1f9d5b;
  --danger: #d33b3b;
  --r: 10px;
  --shadow: 0 1px 2px rgba(15,26,22,.06), 0 8px 24px rgba(15,26,22,.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
.dtf-root *, .dtf-root *::before, .dtf-root *::after { box-sizing: border-box; }
.dtf-root :where(button) { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; margin: 0; text-transform: none; letter-spacing: 0; box-shadow: none; }
.dtf-root :where(button):hover { box-shadow: none; }
.dtf-root input, .dtf-root select { font: inherit; color: inherit; margin: 0; }
.dtf-root h3, .dtf-root h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.dtf-root p { margin: 0; }
.dtf-root ul { margin: 0; padding: 0; list-style: none; }

.dtf-app {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---------- cabecera ---------- */
.dtf-top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--ink); color: #eaf2ee;
}
.dtf-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.dtf-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--cono); box-shadow: 0 0 0 3px rgba(242,118,31,.25); }
.dtf-title {
  flex: 1 1 auto; min-width: 90px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #fff; border-radius: 8px; padding: 7px 11px; font-size: 14px; font-weight: 600;
}
.dtf-title::placeholder { color: rgba(255,255,255,.45); font-weight: 400; }
.dtf-title:focus { outline: 2px solid var(--cono); outline-offset: 1px; }
.dtf-acts { display: flex; gap: 6px; flex: 0 0 auto; }

.dtf-b {
  background: linear-gradient(180deg, #ffffff 0%, #e4eae5 100%);
  border: 1px solid #c1cdc5; border-radius: 8px;
  padding: 7px 11px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(15,26,22,.12);
  transition: transform .06s ease, background .15s ease, box-shadow .1s ease;
}
.dtf-b:hover { background: linear-gradient(180deg, #ffffff 0%, #dce4de 100%); }
.dtf-b:active { transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(15,26,22,.2); }
.dtf-b--go {
  background: linear-gradient(180deg, #ff9152 0%, var(--cono) 100%); border-color: #d9640f; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 2px rgba(0,0,0,.18);
}
.dtf-b--go:hover { background: linear-gradient(180deg, #ff9d63 0%, #f0700f 100%); }
.dtf-b--danger {
  background: linear-gradient(180deg, #fff5f5 0%, #ffe3e3 100%); color: var(--danger); border-color: #eab6b6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 2px rgba(15,26,22,.08);
}
.dtf-b--sm { padding: 5px 9px; font-size: 12px; }
.dtf-b.is-on {
  background: linear-gradient(180deg, #29a86b 0%, var(--ok) 100%); border-color: #16814f; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 2px rgba(0,0,0,.18);
}
.dtf-top .dtf-b {
  background: linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.06) 100%);
  border-color: rgba(255,255,255,.22); color: #eaf2ee;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 2px rgba(0,0,0,.22);
}
.dtf-top .dtf-b:hover { background: linear-gradient(180deg, rgba(255,255,255,.24) 0%, rgba(255,255,255,.1) 100%); }
.dtf-top .dtf-b--go { background: linear-gradient(180deg, #ff9152 0%, var(--cono) 100%); border-color: #d9640f; color: #fff; }
.dtf-b--only-mobile { display: none; }
.dtf-top .dtf-b--limpiar { background: linear-gradient(180deg, #ff9152 0%, var(--cono) 100%); border-color: #d9640f; color: #fff; }
.dtf-top .dtf-b--nueva { background: linear-gradient(180deg, #d3ef82 0%, var(--lima) 100%); border-color: #9dbb47; color: #1b2c15; }
.dtf-top .dtf-b--limpiar:hover, .dtf-top .dtf-b--nueva:hover { filter: brightness(1.06); }

/* ---------- estructura ---------- */
.dtf-main { display: grid; grid-template-columns: clamp(178px, 15vw, 220px) minmax(0,1fr) clamp(168px, 13vw, 200px); gap: 7px; padding: 7px; align-items: start; }

.dtf-pal, .dtf-props {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  max-height: 74vh; overflow: auto; overscroll-behavior: contain;
}
.dtf-tabs { display: flex; gap: 2px; padding: 6px; position: sticky; top: 0; background: var(--paper); border-bottom: 1px solid var(--line); z-index: 2; flex-wrap: wrap; }
.dtf-tab {
  flex: 1 1 auto; padding: 6px 4px; border-radius: 7px; font-size: 11.5px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.dtf-tab.is-on { background: var(--ink); color: #fff; }
.dtf-panes { padding: 8px; }

.dtf-group { margin-bottom: 14px; }
.dtf-group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 7px; }
.dtf-list { display: flex; flex-wrap: wrap; gap: 5px; }
.dtf-opt {
  border: 1px solid #c1cdc5; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; font-weight: 600;
  background: linear-gradient(180deg, #ffffff 0%, #e4eae5 100%); display: inline-flex; align-items: center; gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(15,26,22,.1);
  transition: transform .06s ease, background .15s ease, box-shadow .1s ease;
}
.dtf-opt:hover { background: linear-gradient(180deg, #ffffff 0%, #dce4de 100%); }
.dtf-opt:active { transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(15,26,22,.18); }
.dtf-opt.is-on {
  background: linear-gradient(180deg, #16261f 0%, var(--ink) 100%); color: #fff; border-color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.22);
}
.dtf-opt--go {
  background: linear-gradient(180deg, #ff9152 0%, var(--cono) 100%); color: #fff; border-color: #d9640f;
  width: 100%; justify-content: center; margin-top: 6px;
}
.dtf-opt--go:hover { background: linear-gradient(180deg, #ff9d63 0%, #f0700f 100%); }
.dtf-opt--surf i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.15); }

.dtf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.dtf-grid--pat { grid-template-columns: repeat(5, 1fr); }
.dtf-grid--arr { grid-template-columns: repeat(2, 1fr); }
.dtf-item {
  border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2);
  padding: 5px 3px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.dtf-item svg { width: 100%; height: 38px; display: block; background: #46825c; border-radius: 6px; }
.dtf-grid--arr .dtf-item svg, .dtf-grid--pat .dtf-item svg { height: 34px; }
.dtf-item span { font-size: 10px; line-height: 1.15; color: var(--muted); font-weight: 600; text-align: center; }
.dtf-item.is-on { border-color: var(--cono); box-shadow: 0 0 0 2px rgba(242,118,31,.25); }

.dtf-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.dtf-lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.dtf-row select, .dtf-in {
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-size: 12.5px; background: var(--paper); max-width: 140px;
}
.dtf-row input[type=range] { width: 130px; accent-color: var(--cono); }
.dtf-row--col { flex-direction: column; align-items: stretch; gap: 4px; }
.dtf-ta { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font: inherit; font-size: 13px; line-height: 1.4; background: var(--paper); resize: vertical; min-height: 76px; }
.dtf-ta:focus { outline: 2px solid var(--cono); }
.dtf-tip .dtf-b { margin-top: 4px; }
.dtf-sw { display: flex; flex-wrap: wrap; gap: 4px; }
.dtf-pair { display: inline-flex; gap: 4px; }
.dtf-pair .dtf-b { min-width: 34px; font-size: 15px; line-height: 1; padding: 6px 0; text-align: center; }
.dtf-chip { width: 20px; height: 20px; border-radius: 5px; border: 1px solid rgba(0,0,0,.22); padding: 0; }
.dtf-chip.is-on { box-shadow: 0 0 0 2px var(--ink); }
.dtf-chip--custom { position: relative; overflow: hidden; background: conic-gradient(#e11d2e,#ffd400,#22c55e,#1f4fd8,#e11d2e); }
.dtf-chip--custom input { position: absolute; inset: -6px; opacity: 0; width: 200%; height: 200%; cursor: pointer; }
.dtf-sw2 { position: relative; display: inline-block; width: 40px; height: 22px; }
.dtf-sw2 input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.dtf-sw2 span { position: absolute; inset: 0; background: #cdd7d1; border-radius: 999px; transition: background .15s; }
.dtf-sw2 span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; }
.dtf-sw2 input:checked + span { background: var(--ok); }
.dtf-sw2 input:checked + span::after { transform: translateX(18px); }
.dtf-tip { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.4; }

/* ---------- campo ---------- */
.dtf-stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dtf-canvas-wrap { position: relative; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: #2f6b45; }
.dtf-canvas { display: block; width: 100%; height: auto; touch-action: none; -webkit-user-select: none; user-select: none; }
.dtf-stage.is-placing .dtf-canvas { cursor: crosshair; }
.dtf-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%) translateY(6px);
  background: rgba(15,26,22,.86); color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; opacity: 0; transition: .18s; pointer-events: none;
}
.dtf-hint.is-on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; cursor: pointer; }
.dtf-hint b { color: var(--cono); }

.dtf-scenes { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 9px; }
.dtf-scene-list { display: flex; gap: 4px; flex-wrap: wrap; }
.dtf-scene {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid #c1cdc5;
  background: linear-gradient(180deg, #ffffff 0%, #e4eae5 100%); font-weight: 700; font-size: 12.5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(15,26,22,.1);
}
.dtf-scene:hover { background: linear-gradient(180deg, #ffffff 0%, #dce4de 100%); }
.dtf-scene.is-on {
  background: linear-gradient(180deg, #16261f 0%, var(--ink) 100%); color: #fff; border-color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.22);
}
.dtf-scene-acts { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.dtf-vel { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dtf-vel select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font-size: 12px;
  background: var(--paper); text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; }

/* ---------- propiedades ---------- */
.dtf-props { padding: 8px; }
.dtf-props-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.dtf-props-acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.dtf-x { font-size: 20px; line-height: 1; color: var(--muted); padding: 0 4px; }
.dtf-empty { color: var(--muted); font-size: 12.5px; }
.dtf-empty strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 4px; }

/* ---------- ficha de texto ---------- */
.dtf-doc { background: var(--paper); border-top: 1px solid var(--line); padding: 14px; }
.dtf-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dtf-doc-head h3 { font-size: 14px; }
.dtf-doc-acts { display: flex; gap: 5px; flex-wrap: wrap; }
.dtf-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.dtf-f { display: flex; flex-direction: column; gap: 3px; }
.dtf-f span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dtf-f input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: var(--paper-2); width: 100%; }
.dtf-f input:focus, .dtf-in:focus, .dtf-row select:focus { outline: 2px solid var(--cono); outline-offset: 0; }

.dtf-editor-bar { display: flex; flex-wrap: wrap; gap: 3px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; padding: 5px; background: var(--paper-2); }
.dtf-eb {
  padding: 5px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--text);
  border: 1px solid #c1cdc5; background: linear-gradient(180deg, #ffffff 0%, #e4eae5 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 1px rgba(15,26,22,.08);
}
.dtf-eb:hover { background: linear-gradient(180deg, #ffffff 0%, #dce4de 100%); }
.dtf-eb:active { transform: translateY(1px); }
.dtf-editor {
  border: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); padding: 14px 16px;
  min-height: 180px; background: var(--paper); font-size: 15px; line-height: 1.65; outline: none;
}
.dtf-editor:empty::before { content: attr(data-ph); color: #9aaaa2; }
.dtf-editor:focus { border-color: var(--cono); }
.dtf-editor h2 { font-size: 19px; margin: 14px 0 6px; }
.dtf-editor h3 { font-size: 16px; margin: 12px 0 4px; }
.dtf-editor ul, .dtf-editor ol { padding-left: 22px; margin: 6px 0; list-style: revert; }
.dtf-editor li { list-style: inherit; }

/* ---------- logos ---------- */
.dtf-logos { display: flex; flex-direction: column; gap: 6px; }
.dtf-logo { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px; background: var(--paper-2); }
.dtf-logo img { width: 46px; height: 46px; object-fit: contain; background: #46825c; border-radius: 6px; flex: 0 0 auto; }
.dtf-logo-b { display: flex; gap: 4px; flex-wrap: wrap; }
.dtf-logo.is-sel { border-color: var(--cono); box-shadow: 0 0 0 2px rgba(242,118,31,.22); }
.dtf-opt input[type=file] { display: none; }

/* ---------- avisos y modal ---------- */
.dtf-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 999999;
}
.dtf-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.dtf-modal { position: fixed; inset: 0; background: rgba(11,20,17,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 999998; }
.dtf-modal[hidden] { display: none; }
.dtf-modal-in { background: var(--paper); border-radius: 14px; padding: 18px; width: 100%; max-width: 520px; max-height: 86vh; overflow: auto; position: relative; }
.dtf-modal-in h3 { font-size: 17px; margin-bottom: 4px; }
.dtf-modal-in h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 16px 0 7px; }
.dtf-modal-in .dtf-x { position: absolute; top: 10px; right: 12px; }
.dtf-modal-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.dtf-modal-acts .dtf-b { cursor: pointer; }
.dtf-lib { margin-top: 10px; }
.dtf-lib li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dtf-lib strong { display: block; font-size: 13.5px; }
.dtf-lib em { font-size: 11.5px; color: var(--muted); font-style: normal; }

/* ---------- móvil ---------- */
@media (max-width: 980px) {
  .dtf-main { grid-template-columns: 1fr; padding: 8px; gap: 8px; }
  .dtf-stage { order: 1; }
  .dtf-props { order: 2; max-height: none; }
  .dtf-props:not(.is-on) { display: none; }
  .dtf-pal { order: 3; max-height: 46vh; }
  .dtf-b--only-mobile { display: inline-block; }
  .dtf-brand span:not(.dtf-dot) { display: none; }
  .dtf-brand { font-size: 0; }
  .dtf-doc { display: none; }
  .dtf-doc.is-open { display: block; }
  .dtf-grid { grid-template-columns: repeat(4, 1fr); }
  .dtf-item svg { height: 42px; }
  .dtf-tab { font-size: 11px; padding: 8px 4px; }
  .dtf-chip { width: 26px; height: 26px; }
  .dtf-scene { width: 34px; height: 34px; }
  .dtf-b { padding: 8px 11px; }
}
@media (max-width: 520px) {
  .dtf-grid { grid-template-columns: repeat(3, 1fr); }
  .dtf-grid--pat { grid-template-columns: repeat(5, 1fr); }
  .dtf-grid--arr { grid-template-columns: repeat(2, 1fr); }
  .dtf-title { font-size: 13px; }
  .dtf-acts .dtf-b { padding: 8px 9px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dtf-root *, .dtf-root *::before { transition: none !important; }
}
