/* Lapangan formasi tim Fun Match (komponen window.PorFormasi). Mandiri, awalan pf-. */
.pf { --tc: #003366; --tt: #fff; position: relative; width: 100%; max-width: 420px; min-width: 0; margin: 0 auto; background: #fff; border: 1px solid #e2e8f0; border-top: 6px solid var(--tc); box-shadow: 0 1px 6px rgba(15, 23, 42, .05); }
.pf *, .pf *::before, .pf *::after { box-sizing: border-box; }
.pf.tim-merah { --tc: #dc2626; --tt: #fff; }
.pf.tim-biru { --tc: #1d4ed8; --tt: #fff; }
.pf.tim-hijau { --tc: #16a34a; --tt: #fff; }
.pf.tim-kuning { --tc: #facc15; --tt: #1f2937; }
.pf.pf-ringkas { max-width: 360px; }

/* Kepala */
.pf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 14px; background: var(--tc); color: var(--tt); }
.pf-nama { margin: 0; min-width: 0; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 17px; line-height: 1.2; letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.pf-jml { flex: none; padding: 3px 10px; background: rgba(255, 255, 255, .28); color: inherit; font-size: 13px; font-weight: 800; }
.pf.tim-kuning .pf-jml { background: rgba(31, 41, 55, .14); }
.pf-meta { padding: 8px 14px 8px; }
.pf-formasi { font-size: 14px; font-weight: 800; color: #003366; }
.pf-komp { margin-top: 2px; font-size: 12px; font-weight: 700; color: #9a3412; }

/* Lapangan: tinggi mengikuti isi, minimal rasio 3:4 */
.pf-field { position: relative; width: 100%; aspect-ratio: 3 / 4; display: flex; flex-direction: column; background: #2f8f46; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }
.pf-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.pf-g1 { fill: #2f9a4a; }
.pf-g2 { fill: #288a41; }
.pf-ln { fill: none; stroke: rgba(255, 255, 255, .88); stroke-width: 1.6; }
.pf-gawang { stroke-width: 1.4; fill: rgba(255, 255, 255, .18); }
.pf-cc { position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border: 1.6px solid rgba(255, 255, 255, .88); border-radius: 50%; pointer-events: none; }
.pf-cc::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: rgba(255, 255, 255, .88); }
.pf-layer { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; row-gap: 14px; padding: 6% 0; }
.pf-row { display: grid; align-items: start; justify-items: center; min-width: 0; }
.pf-cell { display: flex; justify-content: center; width: 100%; min-width: 0; }
.pf-gb { transform: translateY(8px); }
.pf-gs { transform: translateY(-8px); }

/* Pemain di lapangan */
.pf { --pf-k: 38px; --pf-kf: 11px; --pf-nf: 10px; }
.pf-p, .pf-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; min-width: 0;
  margin: 0; padding: 0; background: none; border: 0; color: #fff; font-family: inherit; text-align: center;
}
.pf-p { min-height: 44px; cursor: pointer; justify-content: flex-start; -webkit-tap-highlight-color: transparent; }
.pf-p:focus-visible { outline: 3px solid #fff; outline-offset: 1px; background: rgba(0, 0, 0, .25); }
.pf-k {
  flex: none; width: var(--pf-k); height: var(--pf-k); display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; background: var(--tc); color: var(--tt); border: 2px solid rgba(255, 255, 255, .9);
  font-weight: 800; font-size: var(--pf-kf); letter-spacing: 0; line-height: 1; box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  transition: transform .15s ease;
}
.pf-p:active .pf-k { transform: scale(.94); }
.pf-n {
  display: block; width: calc(100% - 4px); max-width: 100%; font-size: var(--pf-nf); font-weight: 700; line-height: 1.15;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .75); overflow-wrap: anywhere; word-break: normal; white-space: normal;
}

.pf-slot { pointer-events: none; }
.pf-k0 { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .85); border: 2px dashed rgba(255, 255, 255, .7); box-shadow: none; font-size: 10px; font-weight: 700; }
.pf-n0 { font-size: 9px; font-weight: 600; color: rgba(255, 255, 255, .8); }

.pf-mini { --pf-k: 32px; --pf-kf: 10px; --pf-nf: 9px; }

/* Sorotan */
.pf-anda .pf-k { box-shadow: 0 0 0 2px rgba(0, 40, 0, .55), 0 0 0 5px #f5a400; }
.pf-kembar .pf-k { box-shadow: 0 0 0 2px rgba(0, 40, 0, .55), 0 0 0 5px #ef4444; }
.pf-terpaksa .pf-k { box-shadow: 0 0 0 2px rgba(0, 40, 0, .55), 0 0 0 5px #fde047; }
.pf-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 1px 6px; background: #f5a400; color: #1f2937; font-size: 9px; font-weight: 800; letter-spacing: .1em; line-height: 1.3; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); pointer-events: none; z-index: 1; }

/* Popover */
.pf-pop { position: absolute; z-index: 5; max-width: 86%; min-width: 150px; padding: 8px 10px; background: #fff; color: #0f172a; border-left: 4px solid var(--tc); box-shadow: 0 4px 16px rgba(15, 23, 42, .28); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.pf-pop-n { display: block; font-weight: 800; font-size: 14px; }
.pf-pop-p { margin-top: 2px; font-weight: 700; color: #003366; }
.pf-pop-s { margin-top: 2px; color: #64748b; font-size: 12px; }

/* Strip belum diplot */
.pf-strip { padding: 10px 14px 12px; background: #f8fafc; }
.pf-strip-t { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; }
.pf-strip-l { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-x { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-height: 44px; width: 84px; max-width: 100%; padding: 4px 4px 6px; background: #fff; color: #1e293b; border: 2px solid #cbd5e1; font-family: inherit; font-size: 13px; font-weight: 700; text-align: center; cursor: pointer; }
.pf-x:focus-visible { outline: 3px solid #f57c00; outline-offset: 2px; }
.pf-xk { flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; background: var(--tc); color: var(--tt); font-size: 12px; font-weight: 800; }
.pf-xn { min-width: 0; max-width: 100%; font-size: 10px; overflow-wrap: anywhere; line-height: 1.15; }
.pf-x.pf-anda { border-color: #f5a400; box-shadow: 0 0 0 2px rgba(245, 164, 0, .35); }
.pf-x.pf-kembar { border-color: #ef4444; }
.pf-x.pf-terpaksa { border-color: #fde047; box-shadow: 0 0 0 2px rgba(250, 204, 21, .45); }

/* Animasi muncul berurutan (jeda diatur lewat JS, total di bawah 1,5 detik) */
.pf-anim .pf-p { opacity: 0; animation: pfMuncul .35s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes pfMuncul {
  from { opacity: 0; transform: translateY(10px) scale(.7); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 400px) {
  .pf:not(.pf-ringkas) { --pf-nf: 11px; }
  .pf:not(.pf-ringkas) .pf-mini { --pf-nf: 9px; }
}
@media (min-width: 1024px) {
  .pf { max-width: 360px; }
}
@media (max-width: 400px) {
  .pf-nama { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-anim .pf-p { animation: none; opacity: 1; }
  .pf-k { transition: none; }
}
