@font-face { font-family: "Lilita One"; src: url("../../fuentes/lilita-one.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../../fuentes/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
:root {
  --fondo: #0c0a1d; --texto: #f6f4ff; --suave: #b9b3de; --rosa: #ff3d7f; --azul: #46b9ff; --naranja: #ff9f1c; --verde: #2f9e44;
  --titulo: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --cuerpo: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--fondo); color: var(--texto); font-family: var(--cuerpo); font-weight: 700; -webkit-tap-highlight-color: transparent; }
.arriba { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 16px; min-height: 52px; }
.arriba h1 { margin: 0; font-family: var(--titulo); font-weight: 400; font-size: 22px; color: var(--naranja); }
.volver { color: var(--azul); font-weight: 900; text-decoration: none; white-space: nowrap; }
.volver:hover { text-decoration: underline; }

/* el marco del juego: bordes de píxel, sin esquinas redondas */
.juego {
  max-width: 900px; margin: 0 auto 24px; padding: 0 16px;
}
.pantalla {
  min-height: min(70vh, 560px); padding: 22px 18px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 32px, transparent 32px 64px),
    linear-gradient(#1f7a35, #175c28);
  border: 4px solid #0b2e14; box-shadow: 0 0 0 4px #e8f4ff, 0 0 0 8px #0b2e14, 0 20px 50px rgba(0, 0, 0, 0.5);
}
.pantalla[hidden] { display: none; }
.pantalla h2 { margin: 0; font-family: var(--titulo); font-weight: 400; font-size: clamp(28px, 6vw, 46px); line-height: 1.05; color: #fff; text-shadow: 4px 4px 0 #0b2e14; }
.antetitulo { margin: 0; color: #ffe066; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 900; font-size: 13px; text-shadow: 2px 2px 0 #0b2e14; }
.cancha-titulo { width: min(480px, 100%); height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.menu-botones { display: grid; gap: 12px; width: min(320px, 100%); margin: 8px auto; }
.botones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.boton {
  min-height: 52px; padding: 10px 24px; border: 4px solid #0b2e14; border-radius: 0; cursor: pointer;
  font-family: var(--titulo); font-weight: 400; font-size: 24px; color: #1a0f00; background: #ffb52e;
  box-shadow: inset -4px -4px 0 #d9820a, inset 4px 4px 0 #ffd98a, 4px 4px 0 #0b2e14; transition: transform 0.08s;
}
.boton:hover, .boton:focus-visible { transform: translate(-1px, -1px); outline: none; background: #ffc44f; }
.boton:active { transform: translate(3px, 3px); box-shadow: inset -4px -4px 0 #d9820a, inset 4px 4px 0 #ffd98a, 1px 1px 0 #0b2e14; }
.boton-borde { background: #e8f4ff; box-shadow: inset -4px -4px 0 #a9bccf, inset 4px 4px 0 #fff, 4px 4px 0 #0b2e14; font-size: 20px; }
.boton-borde:hover, .boton-borde:focus-visible { background: #fff; }
.volver-boton { margin-top: auto; border: 0; background: none; color: #e8f4ff; font: inherit; font-weight: 900; cursor: pointer; padding: 8px; }
.volver-boton:hover, .volver-boton:focus-visible { text-decoration: underline; }
.ajustes { display: grid; gap: 10px; text-align: left; }
.ajuste { display: flex; align-items: center; gap: 10px; font-size: 17px; cursor: pointer; }
.ajuste input { width: 22px; height: 22px; accent-color: var(--naranja); }
.ajuste select { font: inherit; font-weight: 900; padding: 6px 8px; border: 4px solid #0b2e14; border-radius: 0; background: #e8f4ff; color: #1a0f00; }

/* elegir equipo */
.equipos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
.equipo {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; cursor: pointer;
  border: 4px solid #0b2e14; border-radius: 0; background: #12301c; color: #fff; font: inherit; font-weight: 900; font-size: 14px;
  box-shadow: 4px 4px 0 #0b2e14;
}
.equipo:hover, .equipo:focus-visible { background: #1d4a2b; outline: 4px solid #ffe066; outline-offset: 0; }
.equipo img { width: 56px; height: 66px; object-fit: contain; }

/* bienvenida y club */
.cartel-bienvenida {
  margin: auto; max-width: 460px; padding: 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #12301c; border: 4px solid #0b2e14; box-shadow: 0 0 0 4px #ffe066, 8px 8px 0 4px #0b2e14;
}
.cartel-bienvenida img { width: 80px; height: 95px; object-fit: contain; }
.cartel-bienvenida p { margin: 0; color: #dff5e5; }
.club-cabeza { display: flex; align-items: center; gap: 12px; text-align: left; }
.club-cabeza img { width: 48px; height: 57px; object-fit: contain; }

/* plantilla */
.plantilla { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 14px; justify-content: center; width: 100%; }
.jugador { padding: 12px; background: #12301c; border: 4px solid #0b2e14; box-shadow: 4px 4px 0 #0b2e14; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.jugador canvas, .jugador img { width: 128px; height: 160px; image-rendering: pixelated; image-rendering: crisp-edges; object-fit: contain; }
.jugador b { font-family: var(--titulo); font-weight: 400; font-size: 20px; }
.jugador span { font-size: 12px; color: #ffe066; text-transform: uppercase; letter-spacing: 0.08em; }
.jugador small { font-size: 11px; color: var(--suave); }
.valoracion { width: 100%; display: grid; gap: 4px; margin-top: 4px; }
.media { margin: 0 auto 2px; width: 64px; padding: 4px 0 2px; background: #ffe066; color: #1a0f00; border: 4px solid #0b2e14;
  font-family: var(--titulo); font-size: 28px; line-height: 1; display: grid; justify-items: center; }
.media small { font-family: var(--cuerpo); font-size: 10px; font-weight: 900; color: #1a0f00; text-transform: uppercase; letter-spacing: 0.06em; }
.habilidad { display: grid; grid-template-columns: 64px 1fr 26px; gap: 6px; align-items: center; font-size: 12px; text-align: left; }
.habilidad i { height: 8px; background: linear-gradient(90deg, #2fd06a var(--v), #0b2e14 var(--v)); border: 2px solid #0b2e14; }
.habilidad b { font-family: var(--cuerpo); font-size: 12px; text-align: right; }

/* oficina */
.pestanas { display: flex; gap: 0; }
.pestana { white-space: nowrap; padding: 8px 18px; border: 4px solid #0b2e14; border-radius: 0; margin-right: -4px; background: #12301c; color: #dff5e5; font: inherit; font-weight: 900; cursor: pointer; }
.pestana.activa { background: #ffe066; color: #1a0f00; }
.oficina-cuerpo { width: 100%; max-width: 760px; background: #12301c; border: 4px solid #0b2e14; padding: 10px; overflow-x: auto; }
.oficina-cuerpo[hidden] { display: none; }
.tabla { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.tabla th { font-size: 11px; color: #ffe066; text-transform: uppercase; padding: 4px 6px; }
.tabla td { padding: 6px; border-top: 2px solid #0b2e14; text-align: center; }
.tabla td.eq { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabla th:nth-child(1) { width: 34px; }
.tabla th:nth-child(2) { width: 38%; }
.tabla tr.mio td { background: #1d4a2b; color: #ffe066; }
.tabla td.pos { border-left: 6px solid transparent; }
.tabla tr.final td.pos, .marca.final { border-left-color: #46b9ff; }
.tabla tr.baja td.pos, .marca.baja { border-left-color: #ff3d7f; }
.tabla tr.sube td.pos, .marca.sube { border-left-color: #2fd06a; }
.con-escudo img { width: 18px; height: 21px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.liga + .liga { margin-top: 16px; }
.liga h3, .ronda h3 { margin: 0 0 6px; font-family: var(--titulo); font-weight: 400; font-size: 22px; color: #fff; text-align: left; }
.leyenda { margin: 8px 0 0; font-size: 12px; color: #dff5e5; text-align: left; line-height: 1.8; }
.marca { display: inline-block; width: 0; height: 12px; border-left: 6px solid; vertical-align: middle; margin-left: 4px; }
.marca:first-child { margin-left: 0; }
.cuadro { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; align-items: center; margin-top: 10px; }
.ronda { display: grid; gap: 4px; }
.ronda .partido-cal { grid-template-columns: auto 1fr auto 1fr; }
.ronda .partido-cal:has(.num) span:nth-of-type(1) { text-align: right; }
.ronda .partido-cal:not(:has(.num)) { grid-template-columns: 1fr auto 1fr; }
.num { color: #46b9ff; font-size: 12px; }
.fecha-cal.copa h3 { color: #46b9ff; }
@media (max-width: 640px) { .cuadro { grid-template-columns: 1fr; } }
.fecha-cal { margin: 0 0 10px; text-align: left; }
.fecha-cal h3 { margin: 0 0 4px; font-size: 13px; color: #ffe066; text-transform: uppercase; letter-spacing: 0.08em; }
.partido-cal { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 4px 6px; font-size: 14px; border-top: 2px solid #0b2e14; }
.partido-cal span:first-child { text-align: right; }
.partido-cal i { font-style: normal; color: var(--suave); font-size: 12px; }
.partido-cal.mio { background: #1d4a2b; color: #ffe066; }
/* próximo partido, resultado y fin de temporada */
.proximo { width: min(460px, 100%); padding: 14px; background: #12301c; border: 4px solid #0b2e14; box-shadow: 4px 4px 0 #0b2e14; display: grid; gap: 10px; justify-items: center; }
.proximo p { margin: 0; }
.cruce { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; width: 100%; }
.cruce .lado { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cruce .lado img { width: 48px; height: 57px; object-fit: contain; }
.cruce .lado b { font-size: 15px; }
.cruce .marcador { font-family: var(--titulo); font-size: 34px; color: #ffe066; text-shadow: 3px 3px 0 #0b2e14; white-space: nowrap; }
.resultado { width: min(520px, 100%); display: grid; gap: 8px; justify-items: center; }
.resultado > p { margin: 0; }
.pen { color: #dff5e5; font-size: 14px; }
.veredicto { font-family: var(--titulo); font-size: 28px; }
.veredicto.gano { color: #2fd06a; } .veredicto.pierdo { color: #ff6b8f; } .veredicto.empate { color: #e8f4ff; }
.otros { width: 100%; background: #12301c; border: 4px solid #0b2e14; padding: 10px; }
.otros small { display: block; margin-top: 6px; font-size: 11px; color: #46b9ff; text-align: left; }
.otros h3 { margin: 0 0 6px; font-size: 13px; color: #ffe066; text-transform: uppercase; letter-spacing: 0.08em; text-align: left; }
.resumen { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; font-size: 15px; }
.resumen li.mio b { color: #ffe066; }
.campeon { margin: 12px 0 0; font-family: var(--titulo); font-size: 22px; color: #ffe066; }
.partido-cal i.res { color: #ffe066; font-weight: 900; white-space: nowrap; }
.fecha-cal small { display: block; margin-top: 4px; font-size: 11px; color: #46b9ff; }
.fecha-cal.ahora { outline: 3px solid #ffe066; outline-offset: 3px; }

/* el partido */
.pantalla-partido { gap: 8px; padding: 12px; min-height: 0; }
.marcador-vivo { margin: 0; font-family: var(--titulo); font-size: clamp(16px, 3.4vw, 24px); color: #fff; text-shadow: 3px 3px 0 #0b2e14; }
.cancha-marco { position: relative; width: 100%; max-width: 860px; }
.cancha { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; border: 4px solid #0b2e14; outline: none; touch-action: none; }
.cartel-partido { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); margin: 0; padding: 8px; background: rgba(11, 46, 20, 0.85); font-family: var(--titulo); font-size: clamp(22px, 5vw, 40px); color: #ffe066; text-shadow: 3px 3px 0 #0b2e14; pointer-events: none; }
.cartel-partido[hidden] { display: none; }
.controles { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 860px; padding: 4px 8px; }
.controles[hidden] { display: none; }
.palanca { width: 110px; height: 110px; border-radius: 50%; background: rgba(11, 46, 20, 0.7); border: 4px solid #0b2e14; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.perilla { width: 46px; height: 46px; border-radius: 50%; background: #e8f4ff; border: 4px solid #0b2e14; pointer-events: none; }
.boton-patear { min-width: 120px; min-height: 80px; touch-action: none; user-select: none; -webkit-user-select: none; }
.botones-partido { display: flex; align-items: center; gap: 12px; }
.palanca { flex-shrink: 0; }
.boton-cambiar { min-width: 96px; min-height: 60px; font-size: 18px; touch-action: none; user-select: none; -webkit-user-select: none; }
.ayuda { margin: 0; font-size: 13px; color: #dff5e5; }
.ayuda[hidden] { display: none; }

/* el partido a pantalla completa y en horizontal, como en FC (pedido #43) */
body.en-partido { overflow: hidden; }
body.en-partido .arriba { display: none; }
.en-partido .pantalla-partido {
  position: fixed; inset: 0; z-index: 20; margin: 0; padding: 0; border: 0; box-shadow: none; min-height: 0;
  display: grid; place-items: center; background: #06140a;
}
.en-partido .cancha-marco { width: min(100vw, calc(100dvh * 16 / 9)); max-width: none; }
.en-partido .cancha { border: 0; }
.en-partido .marcador-vivo {
  position: absolute; z-index: 3; top: max(8px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left));
  padding: 4px 12px; background: rgba(10, 10, 24, 0.82); border-left: 5px solid #ffe066;
  font-size: clamp(13px, 2.2vw, 22px); text-shadow: none;
}
.en-partido #bSimularResto {
  position: absolute; z-index: 3; top: max(6px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right));
  margin: 0; padding: 6px 12px; background: rgba(10, 10, 24, 0.7); font-size: 13px;
}
.en-partido .ayuda {
  position: absolute; z-index: 3; bottom: 8px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 94vw;
  padding: 4px 10px; background: rgba(10, 10, 24, 0.7); font-size: 12px; text-align: center;
  animation: ayuda-se-va 0.8s ease 9s forwards;   /* a los pocos segundos deja de tapar la cancha */
}
@keyframes ayuda-se-va { to { opacity: 0; visibility: hidden; } }
.en-partido .controles {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; max-width: none; align-items: flex-end; pointer-events: none;
  padding: 0 max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.en-partido .controles > * { pointer-events: auto; }
.en-partido .palanca { width: 120px; height: 120px; background: rgba(11, 46, 20, 0.45); border-color: rgba(11, 46, 20, 0.85); }
.en-partido .botones-partido { display: grid; grid-template-columns: auto auto; gap: 8px; align-items: end; }
.en-partido .boton-cambiar { grid-column: 1; min-width: 84px; min-height: 46px; padding: 6px 10px; font-size: 15px; opacity: 0.92; }
.en-partido #bPatear { grid-column: 2; grid-row: 1 / span 2; min-width: 104px; min-height: 100px; opacity: 0.92; }
.girar { display: none; }
.girar p { margin: 0; }
.celu { width: 54px; height: 92px; border: 6px solid #e8f4ff; border-radius: 10px; animation: girar-celu 1.8s ease-in-out infinite; }
@keyframes girar-celu { 0%, 25% { transform: rotate(0deg); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) {
  .en-partido .girar {
    position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 22px;
    padding: 24px; background: #06140a; color: #fff; text-align: center; font-family: var(--titulo); font-size: 26px;
  }
}

@media (max-width: 560px) {
  .botones-partido { flex-direction: column-reverse; gap: 10px; }
  .boton-patear { min-width: 130px; min-height: 64px; }
  .boton-cambiar { min-width: 130px; min-height: 48px; font-size: 17px; }
  .pestana { padding: 8px 10px; font-size: 14px; }
  .tabla { font-size: 13px; }
  .tabla th:nth-child(2) { width: 42%; }
  .equipos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plantilla { grid-template-columns: 1fr 1fr; }
  .jugador canvas, .jugador img { width: 96px; height: 120px; }
  .boton { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .boton { transition: none; } .celu { animation: none; transform: rotate(-90deg); } }
