/* Generador y Draft 2v2: usa los colores, letras y curvas de la página */
@keyframes v2Entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes v2Revela { from { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-8%) skewX(-10deg); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
@keyframes v2Barre { from { transform: translateX(-140%) skewX(-18deg); } to { transform: translateX(430%) skewX(-18deg); } }
@keyframes v2Late { 50% { opacity: .55; transform: scale(1.08); } }
.v2-pes { display: flex; gap: 4px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.v2-pes button { min-height: 44px; padding: 0 18px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: 800 1.15rem/1 var(--font-display); cursor: pointer; transition: color 160ms ease, border-color 160ms ease; }
.v2-pes button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--fg); }
.v2-cuerpo { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 18px; animation: v2Entra 260ms var(--ease-out) both; }
.v2-caja { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v2-ancho, .v2-lab { grid-column: 1 / -1; }
.v2-lab { display: grid; gap: 6px; }
.v2-t { display: flex; align-items: center; gap: 8px; font: 800 1.05rem/1 var(--font-display); color: var(--fg); }
.v2-cuenta, .v2-nb { padding: 2px 7px; border-radius: 999px; background: var(--bg); font: 600 .75rem/1.3 var(--font-mono); color: var(--fg); }
.v2-caja textarea { width: 100%; min-height: 220px; line-height: 1.6; }
.v2-nota { margin-top: 6px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.v2-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.v2-acc { margin-top: 14px; }
.v2-enc { justify-content: space-between; margin-top: 24px; }
.v2-der { margin-left: auto; }
.v2-seed { margin-left: auto; color: var(--muted); font: 500 .82rem/1 var(--font-mono); }
.v2-seed b { color: var(--fg); }
.v2-sws { display: grid; gap: 8px; }
.v2-sw { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; color: var(--fg); cursor: pointer; }
.v2-sw input { appearance: none; flex: none; width: 34px !important; min-height: 20px !important; height: 20px; padding: 0 !important; border-radius: 999px !important; background: var(--line) !important; position: relative; cursor: pointer; transition: background 160ms ease; }
.v2-sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform 160ms var(--ease-out); }
.v2-sw input:checked { background: var(--accent) !important; }
.v2-sw input:checked::after { transform: translateX(14px); }
.v2-reglas { display: grid; gap: 8px; }
.v2-regla { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); }
.v2-regla input { text-align: center; font-family: var(--font-mono); }
.v2-equipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 14px; }
.v2-eq { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color 160ms ease; }
.v2-nuevo .v2-eq { animation: v2Entra 320ms var(--ease-out) both; animation-delay: calc(min(var(--i), 16) * 45ms); }
.v2-eq.sobre { border-color: var(--accent); }
.v2-eq header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.v2-eq header input { flex: 1; min-width: 0; min-height: 30px; padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--fg); font: 800 1.2rem/1 var(--font-display); }
.v2-eq header input:focus { outline: 0; border-bottom-color: var(--accent); }
.v2-eq h3 { font: 800 1.5rem/1 var(--font-display); }
.v2-n { color: var(--muted); font: 500 .75rem/1 var(--font-mono); }
.v2-aviso { margin-bottom: 8px; padding: 4px 8px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: .75rem; }
.v2-j { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--fg); font: 500 .92rem/1.2 var(--font-body); text-align: left; cursor: grab; }
.v2-j span { min-width: 0; overflow-wrap: anywhere; }
.v2-j em { margin-left: auto; color: var(--muted); font: 500 .72rem/1 var(--font-mono); font-style: normal; }
.v2-j:active { transform: scale(.97); }
.v2-j.on { border-color: var(--cyan); }
.v2-arr { opacity: .4; }
.v2-punto { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.v2-leyenda { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; color: var(--muted); font-size: .8rem; }
.v2-leyenda span { display: flex; align-items: center; gap: 6px; }
.v2-cap { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; overflow: hidden; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); animation: v2Entra 260ms var(--ease-out) both; }
.v2-cap::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14), transparent); pointer-events: none; animation: v2Barre 900ms var(--ease-out) both; }
.v2-cap b { display: block; font: 900 clamp(2rem, 4vw, 3rem)/1 var(--font-display); overflow-wrap: anywhere; animation: v2Revela 420ms var(--ease-out) both; }
.v2-et { display: block; margin-bottom: 6px; color: var(--accent-text); font: 500 .72rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.v2-tiempo { display: flex; align-items: center; gap: 12px; }
.v2-reloj { color: var(--cyan); font: 900 2.6rem/1 var(--font-display); font-variant-numeric: tabular-nums; animation: none !important; }
.v2-reloj.urge { color: var(--accent-text); animation: v2Late 1s ease-in-out infinite !important; }
.v2-cap > .v2-tiempo b { display: inline-block; }
.v2-centro > .v2-t, #v2-arena > .v2-t { margin-top: 18px; }
.v2-t span:not(.v2-nb) { color: var(--muted); font: 500 .8rem/1 var(--font-body); }
.v2-duos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin-top: 10px; max-height: 300px; overflow-y: auto; }
.v2-duo { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); font: 500 .92rem/1.2 var(--font-body); text-align: left; cursor: pointer; transition: border-color 140ms ease, transform 140ms var(--ease-out); }
.v2-duo span { min-width: 0; overflow-wrap: anywhere; }
.v2-duo em, .v2-fm em { margin-left: auto; padding: 2px 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font: 500 .68rem/1.2 var(--font-mono); font-style: normal; }
.v2-duo:active { transform: scale(.97); }
.v2-duo:disabled { opacity: .35; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .v2-j:hover { background: var(--bg); }
  .v2-duo:not(:disabled):hover { border-color: var(--accent); }
  .v2-pes button:hover { color: var(--fg); }
}
.v2-sorteo { display: grid; justify-items: center; gap: 12px; padding: 34px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.v2-sorteo > b { font: 900 clamp(2rem, 4vw, 3rem)/1 var(--font-display); }
.v2-gira { min-height: 1em; color: var(--accent-text); overflow-wrap: anywhere; }
.v2-listo b { animation: v2Revela 480ms var(--ease-out) both; }
.v2-formados { display: grid; gap: 6px; margin-top: 10px; }
.v2-fm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); animation: v2Entra 260ms var(--ease-out) both; }
.v2-fm b { font-weight: 600; overflow-wrap: anywhere; }
.v2-fm.hold { border-color: var(--accent); }
.v2-x { color: var(--muted); }
.v2-lnk { padding: 0; border: 0; background: none; color: var(--fg); font: 600 1rem/1.2 var(--font-body); text-decoration: underline; cursor: pointer; }
.v2-fm em { margin-left: 0; }
.v2-grande { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 20px clamp(16px, 3vw, 36px); overflow-y: auto; border: 0; background: var(--bg); color: var(--fg); animation: v2Entra 240ms var(--ease-out) both; }
.v2-grande > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.v2-grande h2 { font: 800 2.2rem/1 var(--font-display); }
.v2-grande input { width: 76px; min-height: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); text-align: center; }
.v2-grande .v2-equipos { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.v2-grande .v2-j { cursor: default; font-size: 1.1rem; }
/* Panel: menú por grupos y accesos directos */
.ap-accesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 18px; }
.ap-acc { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ap-acc h3 { font: 800 1.05rem/1 var(--font-display); color: var(--muted); }
.ap-acc button { display: block; padding: 3px 0; border: 0; background: none; color: var(--fg); font: 500 .95rem/1.2 var(--font-body); text-align: left; cursor: pointer; transition: color 140ms ease; }
.ap-acc button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .ap-acc button:hover { color: var(--accent-text); } }
.ap-nav .ap-nuevo { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 .65rem/1.3 var(--font-mono); }
.ap-nav button[aria-current="page"] .ap-nuevo { background: #fff; color: var(--accent); }
#ir-panel { display: inline-flex !important; white-space: nowrap; }
#ir-panel[hidden] { display: none !important; }
@media (max-width: 440px) { #ir-panel { min-height: 34px; padding: 0 10px; font-size: .78rem; } }
@media (max-width: 860px) {
  .v2-cuerpo { grid-template-columns: minmax(0, 1fr); }
  .v2-seed { margin-left: 0; }
}
.v2-caja [hidden] { display: none !important; }
.panel-vista .ap-nav { gap: 2px; }
.panel-vista .ap-nav button { min-height: 34px; }
.panel-vista .ap-nav .ap-grp { padding: 10px 12px 4px; }
.ap-accesos { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 440px) { html.con-sesion #login-btn .lt { display: none; } }
@media (max-width: 440px) { html:has(#ir-panel:not([hidden])) .lg-nav { --lgh: 34px; } }
@media (max-width: 380px) { html:has(#ir-panel:not([hidden])) .lg-nav { --lgh: 24px; } #ir-panel { padding: 0 8px; } }
/* Página propia: el generador usa todo el ancho */
.ap-nav button[data-v="v2"] > span::after, .ap-acc button[data-v="v2"]::after { content: " \2197"; }
.v2-stream .v2-cuerpo { grid-template-columns: minmax(0, 1fr); }
.v2-stream .v2-lado, .v2-stream .ap-kv, .v2-stream #v2-hist, .v2-stream .ap-h, .v2-stream .v2-pes, .v2-stream .v2-nota, .v2-stream .v2-acc { display: none; }
.v2-stream .v2-cap b { font-size: clamp(3rem, 7vw, 6rem); }
.v2-stream .v2-reloj { font-size: clamp(3.4rem, 8vw, 7rem); }
.v2-stream .v2-sorteo > b { font-size: clamp(3rem, 7vw, 6rem); }
.v2-stream .v2-duo { min-height: 56px; font-size: 1.2rem; }
.v2-stream .v2-duos { max-height: none; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.v2-stream .v2-fm { font-size: 1.15rem; }
.v2-stream .v2-equipos { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.v2-stream .v2-j { min-height: 42px; font-size: 1.2rem; }
/* Guía y sección Discord del panel */
.ap-fila { margin-top: 14px; }
.ap-guia { display: grid; gap: 8px; margin-top: 18px; }
.ap-guia details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ap-guia summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 16px; font: 800 1.15rem/1.1 var(--font-display); cursor: pointer; }
.ap-guia summary em { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font: 500 .72rem/1.2 var(--font-mono); font-style: normal; }
.ap-guia details[open] summary { border-bottom: 1px solid var(--line); }
.ap-guia details[open] > :not(summary) { animation: v2Entra 220ms var(--ease-out) both; }
.ap-guia ul { display: grid; gap: 8px; margin: 0; padding: 14px 16px 14px 32px; line-height: 1.5; }
.ap-guia p { padding: 14px 16px 0; color: var(--muted); }
.ap-guia dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; margin: 0; padding: 14px 16px; }
.ap-guia dt code { font: 500 .85rem/1.4 var(--font-mono); color: var(--cyan); }
.ap-guia dd { margin: 0; line-height: 1.4; }
@media (max-width: 620px) { .ap-guia dl { grid-template-columns: minmax(0, 1fr); } .ap-guia dt { margin-top: 6px; } }
