/*
 * Hřiště s pozicemi hráče po vzoru Football Manageru - kreslí www/js/position-pitch.js,
 * definice pozic a úrovní je v App\Model\PlayerPosition.
 * Načítá se ve formuláři osoby v administraci (@positions.latte) a v detailu hráče na webu
 * (detail.latte). Barvy koleček dodává skript z definice úrovní, tady je podklad hřiště,
 * čáry, okénko s výběrem úrovně a legenda.
 */

/* ---------- Hřiště ---------- */

.position-pitch {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 12px;
    /* Tmavě modrošedý podklad jako ve Football Manageru */
    background: #262b3d;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    -webkit-user-select: none;
    user-select: none;
}

.position-pitch svg {
    display: block;
    width: 100%;
    height: auto;
}

.position-pitch .pp-lines {
    fill: none;
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 1.3;
    stroke-linecap: round;
}

.position-pitch .pp-lines .pp-spot {
    fill: rgba(255, 255, 255, 0.6);
    stroke: none;
}

.position-pitch .pp-lines .pp-goal {
    stroke: rgba(255, 255, 255, 0.3);
}

/* Kolečko pozice - barvu výplně a písma nastavuje skript podle úrovně */
.pp-position circle {
    stroke-width: 2;
    transition: stroke 0.12s, stroke-width 0.12s;
}

.pp-position text {
    font: 700 8.5px Arial, Helvetica, sans-serif;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.pp-position:focus {
    outline: none;
}

/* Editace v administraci - kolečko je tlačítko, vybrané má žlutý prstenec jako ve FM */
.position-pitch--editable .pp-position {
    cursor: pointer;
}

.position-pitch--editable .pp-position:hover circle,
.position-pitch--editable .pp-position:focus circle {
    stroke: #f1d13c;
    stroke-width: 2.5;
}

.pp-position.is-active circle {
    stroke: #f1d13c !important;
    stroke-width: 3.5;
}

/* ---------- Okénko s výběrem úrovně ---------- */

.pp-picker {
    position: absolute;
    z-index: 30;
    width: 236px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: #1f2436;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    font-size: 13px;
    text-align: left;
}

.pp-picker-head {
    margin-bottom: 6px;
    padding: 4px 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.pp-picker-head strong {
    margin-right: 6px;
    font-size: 15px;
}

.pp-picker-head span {
    opacity: 0.75;
}

.pp-picker-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pp-picker-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.pp-picker-option:hover,
.pp-picker-option:focus {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.pp-picker-option.is-current {
    background: rgba(241, 209, 60, 0.18);
}

.pp-dot {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 50%;
}

.pp-level {
    width: 12px;
    font-weight: 700;
}

.pp-label {
    opacity: 0.9;
}

/* Na telefonu okno uprostřed displeje s tmavým podkladem - nad modály Bootstrapu (1050)
   i vysunutým menu administrace (1000) */
.pp-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1060;
    background: rgba(0, 0, 0, 0.6);
}

.pp-picker--sheet {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1061;
    width: min(92vw, 340px);
    transform: translate(-50%, -50%);
    font-size: 15px;
}

.pp-picker--sheet .pp-picker-option {
    min-height: 44px;
    padding: 10px;
    font-size: 15px;
}

/* ---------- Legenda ---------- */

.pp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.3;
}

.pp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
