/* =========================================================
   Banner de directo en Twitch
   ========================================================= */
.directo {
  background: linear-gradient(90deg, #6d28d9, #9146ff 45%, var(--navy-700));
  color: #fff; font-size: 14px;
  overflow: hidden; max-height: 0;
  transition: max-height .6s var(--ease);
}
.directo.visible { max-height: 120px; }
.directo__fila { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 6px 0; }
.directo__marca {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  background: #e91916; padding: 5px 10px; border-radius: 3px;
  font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
}
.directo__punto { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: latido 1.2s infinite; }
@keyframes latido { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.directo__titulo { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.directo__tiempo { flex: none; font-size: 12px; opacity: .85; }
.directo__ver {
  flex: none; background: var(--gold); color: var(--navy-900);
  font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 2px; transition: background .2s;
}
.directo__ver:hover { background: var(--gold-light); }
.directo__cerrar { flex: none; background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; opacity: .7; padding: 0 4px; }
.directo__cerrar:hover { opacity: 1; }
@media (max-width: 700px) {
  .directo__fila { flex-wrap: wrap; gap: 8px 10px; }
  .directo__titulo { order: 5; flex-basis: 100%; white-space: normal; font-size: 13px; }
  .directo__tiempo { display: none; }
  .directo__ver { margin-left: auto; }
}

/* =========================================================
   Agenda abierta
   ========================================================= */
.agenda {
  display: flex; width: fit-content; align-items: center; gap: 9px;
  background: rgba(34, 197, 94, .12); color: #bff0cf;
  border: 1px solid rgba(34, 197, 94, .5); border-radius: 999px;
  padding: 6px 14px; margin-bottom: 14px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .06em;
  transition: background .2s;
}
a.agenda:hover { background: rgba(34, 197, 94, .22); }
.agenda__punto { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; animation: pulso-verde 1.8s infinite; flex: none; }
@keyframes pulso-verde {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
  70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.agenda--mini { align-self: flex-start; margin-bottom: 10px; }
.agenda--grande { font-size: 15px; padding: 10px 18px; margin: 0 0 18px; }
.etiqueta-abierta {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  background: #22c55e; color: #052e14;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 2px;
}
.tarjeta--destacada { border-color: rgba(34, 197, 94, .55); background: rgba(34, 197, 94, .06); }
.tarjeta--correo { transition: border-color .2s, background .2s; }
.tarjeta--correo:hover { border-color: var(--gold); background: rgba(201, 169, 97, .08); }

/* =========================================================
   Problemas de Lichess: lanzador + panel lateral de 1/3
   ========================================================= */
.lanzador {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 10px;
  background: var(--gold); color: var(--navy-900);
  border: 0; border-radius: 999px; cursor: pointer;
  font: 700 14px/1.1 "Poppins", sans-serif; text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 0 0 4px rgba(201, 169, 97, .25);
  transition: transform .3s var(--ease), opacity .3s, box-shadow .3s;
}
.lanzador:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, .5), 0 0 0 6px rgba(201, 169, 97, .3); }
.lanzador small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .7; }
.lanzador__pz {
  display: block; width: 38px; height: 38px; flex: none;
  background-size: 28px; background-repeat: no-repeat; background-position: center;
  background-color: var(--navy-700); border-radius: 50%;
}
body.problemas-abierto .lanzador { opacity: 0; pointer-events: none; transform: translateY(20px); }

.problemas {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: max(33.333vw, 380px); max-width: 100vw;
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 22px 16px;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-800));
  border-left: 1px solid var(--gold);
  box-shadow: -24px 0 60px rgba(0, 0, 0, .5);
  transform: translateX(105%); visibility: hidden;
  transition: transform .55s var(--ease), visibility 0s .55s;
  overflow-y: auto;
}
.problemas.abierto { transform: none; visibility: visible; transition: transform .55s var(--ease), visibility 0s; }
.problemas__velo { position: fixed; inset: 0; z-index: 85; background: rgba(4, 14, 28, .55); opacity: 0; pointer-events: none; transition: opacity .4s; }
.problemas__cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.problemas__pre { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.problemas__cab h2 { font-size: 22px; margin-top: 2px; }
.problemas__cerrar {
  background: none; border: 1px solid var(--line); color: var(--cream);
  width: 36px; height: 36px; font-size: 22px; line-height: 1; cursor: pointer; flex: none;
  transition: background .2s, color .2s;
}
.problemas__cerrar:hover { background: var(--gold); color: var(--navy-900); }
.niveles { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); }
.niveles button {
  background: none; border: 0; border-right: 1px solid var(--line);
  color: #c9d3de; padding: 8px 2px; cursor: pointer;
  font: 600 11px/1.2 "Poppins", sans-serif;
  transition: background .2s, color .2s;
}
.niveles button:last-child { border-right: 0; }
.niveles button:hover { background: rgba(201, 169, 97, .12); color: var(--cream); }
.niveles button.activo { background: var(--gold); color: var(--navy-900); }
.niveles.llamada { animation: llamada 1s 2; }
@keyframes llamada { 50% { box-shadow: 0 0 0 4px rgba(232, 199, 126, .55); } }
.problemas__info { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #aebccb; min-height: 20px; }
.turno { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--cream); }
.turno:not(:empty)::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--gold); background: var(--c, #fff); }
.problemas__tablero { position: relative; width: 100%; }
.problemas__tablero .cg-wrap { width: 100%; aspect-ratio: 1; height: auto; position: relative; display: block; }
.problemas__estado { margin: 0; min-height: 1.6em; font-weight: 600; font-size: 15px; }
.problemas__estado.bien { color: #86efac; }
.problemas__estado.mal { color: #fca5a5; }
.problemas__temas { margin: -6px 0 0; font-size: 12px; color: var(--gold-light); min-height: 1em; }
.problemas__acciones { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.problemas__acciones .boton { justify-content: center; padding: 11px 8px; font-size: 12px; cursor: pointer; background-color: transparent; font-family: "Poppins", sans-serif; }
.problemas__acciones .boton--oro { background: var(--gold); border: 0; }
.problemas__acciones .boton:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.problemas__pie { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; color: #aebccb; border-top: 1px solid var(--line); padding-top: 10px; }
.problemas__pie a { color: var(--gold); }
.problemas__pie b { color: var(--cream); }
.problemas__cargando {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  background: rgba(8, 29, 53, .55);
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light);
}

/* Tablero de chessground (el de Lichess) con los colores de la marca */
.problemas cg-board {
  background-color: #f1e6cc;
  background-image: conic-gradient(var(--gold) 0 25%, #f1e6cc 0 50%, var(--gold) 0 75%, #f1e6cc 0);
  background-size: 25% 25%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  outline: 1px solid var(--gold);
}
.problemas cg-board square.last-move { background-color: rgba(43, 79, 110, .42); }
.problemas cg-board square.selected { background-color: rgba(13, 42, 74, .5); }
.problemas cg-board square.move-dest { background: radial-gradient(rgba(13, 42, 74, .55) 21%, transparent 23%); cursor: pointer; }
.problemas cg-board square.move-dest:hover { background: rgba(13, 42, 74, .3); }
.problemas cg-board square.oc.move-dest { background: radial-gradient(transparent 0 78%, rgba(13, 42, 74, .45) 80%); }
.problemas cg-board square.check { background: radial-gradient(ellipse at center, rgba(233, 25, 22, 1) 0%, rgba(233, 25, 22, .7) 30%, rgba(233, 25, 22, 0) 80%); }
.problemas .cg-wrap coords { font-size: 10px; font-weight: 600; font-family: "Poppins", sans-serif; }
.problemas .cg-wrap coords coord { color: var(--navy-700); }
/* coordenadas dentro de cada casilla, como en el tablero del hero */
.problemas .cg-wrap coords.files { left: 0; bottom: 0; height: auto; text-transform: none; text-align: right; }
.problemas .cg-wrap coords.files coord { flex: 1 1 0; padding-right: 3px; }
.problemas .cg-wrap coords.ranks { left: 3px; top: 0; }
.problemas .cg-wrap coords.ranks coord { flex: 1 1 0; transform: none; }

@media (max-width: 900px) {
  .problemas { width: 100vw; padding: 16px; }
  body.problemas-abierto .problemas__velo { opacity: 1; pointer-events: auto; }
  .problemas__tablero { max-width: min(100%, 60vh); margin-inline: auto; }
}
@media (max-width: 600px) {
  .lanzador { right: 14px; bottom: 14px; padding: 8px 14px 8px 8px; font-size: 13px; }
  .niveles { grid-template-columns: repeat(3, 1fr); }
  .niveles button:nth-child(3) { border-right: 0; }
  .niveles button:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
