/* ---------------------------------------------------------------------------
 * PLAYER PAGES (/mac) - the only pages in this product a customer sees.
 *
 * HAND-WRITTEN, NOT TAILWIND, ON PURPOSE. static/build/tailwind.css is a
 * committed build artifact, and it once went a year without being rebuilt: every
 * utility class written after 2025-07-18 had no CSS behind it, which is how the
 * match-23 report ended up with blue text on a white band. An operator can work
 * around a page that looks wrong. A player who opens a broken-looking page from a
 * WhatsApp link just closes it, and that is the product's entire first
 * impression. These pages therefore depend on nothing that has to be rebuilt.
 *
 * Team colours are NOT redefined here - they come from teams.css through
 * data-team="a|b|none" and the tm-* classes, so the vest team is the same red on
 * the player page, the operator report and the live scoreboard.
 *
 * Mobile first throughout: these are opened on a phone, standing on the pitch,
 * five minutes after the final whistle.
 * ------------------------------------------------------------------------- */

:root {
    --pl-night: #070b14;
    --pl-surface: #121a2b;
    --pl-surface-2: #1a2437;
    --pl-line: #253147;
    --pl-text: #e8eefc;
    --pl-muted: #8ea0c0;
    --pl-dim: #5d6f90;
    --pl-accent: #22c55e;      /* pitch green - the product's own accent */
    --pl-accent-soft: rgba(34, 197, 94, 0.14);
    --pl-radius: 16px;
    --pl-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 50% -10%, #17253f 0%, transparent 60%),
        linear-gradient(180deg, #0a1120 0%, var(--pl-night) 100%);
    background-attachment: fixed;
    color: var(--pl-text);
    line-height: 1.45;
}

.pl-wrap {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 14px 56px;
}

/* --- header ------------------------------------------------------------- */

.pl-top {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(7, 11, 20, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pl-line);
}
.pl-top .pl-brand {
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 15px;
}
.pl-top .pl-brand span { color: var(--pl-accent); }
.pl-top .pl-spacer { flex: 1; }

.pl-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--pl-line);
    border-radius: 999px;
    background: var(--pl-surface);
    color: var(--pl-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.pl-iconbtn:hover { background: var(--pl-surface-2); border-color: #35435e; }
.pl-iconbtn:active { transform: scale(0.97); }

/* --- hero --------------------------------------------------------------- */

.pl-hero {
    position: relative;
    overflow: hidden;
    margin: 16px 0 20px;
    padding: 26px 20px 24px;
    border-radius: var(--pl-radius);
    border: 1px solid var(--pl-line);
    background: linear-gradient(150deg, #14321f 0%, #10203a 55%, #101828 100%);
    box-shadow: var(--pl-shadow);
}
/* Pitch markings, drawn rather than an image so it stays sharp on any screen
   and costs no request. */
.pl-hero::before,
.pl-hero::after {
    content: "";
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.pl-hero::before {
    width: 190px; height: 190px; border-radius: 50%;
    right: -60px; top: 50%; transform: translateY(-50%);
}
.pl-hero::after {
    width: 120px; height: 240px; border-right: 0;
    left: -60px; top: 50%; transform: translateY(-50%);
    border-radius: 0 8px 8px 0;
}
.pl-hero h1 {
    position: relative;
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.pl-hero p {
    position: relative;
    margin: 0;
    color: var(--pl-muted);
    font-size: 14px;
    max-width: 34ch;
}
.pl-venue {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--pl-accent-soft);
    color: #7ee2a8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* --- section furniture -------------------------------------------------- */

.pl-section { margin: 26px 0; }
.pl-section > h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--pl-dim);
}
.pl-section > h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--pl-line);
}

.pl-card {
    border: 1px solid var(--pl-line);
    border-radius: var(--pl-radius);
    background: var(--pl-surface);
    box-shadow: var(--pl-shadow);
}

.pl-muted { color: var(--pl-muted); font-size: 13px; }
.pl-dim { color: var(--pl-dim); font-size: 12px; }

/* --- calendar ----------------------------------------------------------- */

.pl-cal { padding: 14px; }
.pl-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.pl-cal-month { font-size: 16px; font-weight: 700; text-transform: capitalize; }
.pl-cal-nav { display: flex; gap: 6px; }
.pl-cal-nav button {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid var(--pl-line);
    background: var(--pl-surface-2);
    color: var(--pl-text);
    font-size: 16px;
    cursor: pointer;
}
.pl-cal-nav button:disabled { opacity: 0.3; cursor: not-allowed; }

.pl-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.pl-grid .pl-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--pl-dim);
    padding-bottom: 6px;
    text-transform: uppercase;
}
.pl-day {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--pl-dim);
    font-size: 14px;
    font-weight: 600;
    cursor: default;
    padding: 0;
    font-family: inherit;
}
/* A day someone actually played on: tappable, marked with a dot. Days with no
   match stay flat and inert, so a player can never tap into an empty result. */
.pl-day.has-match {
    color: var(--pl-text);
    background: var(--pl-surface-2);
    border-color: var(--pl-line);
    cursor: pointer;
}
.pl-day.has-match:hover { border-color: var(--pl-accent); }
.pl-day.has-match::after {
    content: "";
    position: absolute;
    bottom: 6px; left: 50%;
    transform: translateX(-50%);
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--pl-accent);
}
.pl-day.selected {
    background: var(--pl-accent);
    border-color: var(--pl-accent);
    color: #052e14;
    font-weight: 800;
}
.pl-day.selected::after { background: #052e14; }
.pl-day.today { box-shadow: inset 0 0 0 1px var(--pl-muted); }
.pl-day.empty { visibility: hidden; }

/* --- slot / match cards ------------------------------------------------- */

.pl-slots { display: flex; flex-direction: column; gap: 10px; }

.pl-slot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--pl-line);
    border-radius: var(--pl-radius);
    background: linear-gradient(180deg, var(--pl-surface) 0%, #0f1626 100%);
    color: inherit;
    text-decoration: none;
    transition: transform 0.12s ease, border-color 0.15s ease;
}
.pl-slot:hover { border-color: var(--pl-accent); transform: translateY(-1px); }
.pl-slot:active { transform: scale(0.995); }

.pl-slot-time {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 66px;
    padding: 8px 0;
    border-radius: 12px;
    background: var(--pl-surface-2);
    border: 1px solid var(--pl-line);
}
.pl-slot-time b { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.pl-slot-time span { font-size: 10px; color: var(--pl-dim); text-transform: uppercase; letter-spacing: 0.06em; }

.pl-slot-body { min-width: 0; flex: 1; }
.pl-slot-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.pl-slot-score .pl-sep { color: var(--pl-dim); font-weight: 600; }
.pl-slot-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.pl-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pl-surface-2);
    border: 1px solid var(--pl-line);
    font-size: 11px;
    font-weight: 600;
    color: var(--pl-muted);
    white-space: nowrap;
}
.pl-tag.ok { color: #7ee2a8; border-color: rgba(34, 197, 94, 0.35); background: var(--pl-accent-soft); }
.pl-tag.warn { color: #fbbf24; border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.12); }

.pl-chev { flex-shrink: 0; color: var(--pl-dim); font-size: 20px; }

/* --- scoreboard --------------------------------------------------------- */

.pl-board {
    position: relative;
    overflow: hidden;
    padding: 22px 18px 18px;
    border-radius: var(--pl-radius);
    border: 1px solid var(--pl-line);
    background: linear-gradient(165deg, #16233c 0%, #0d1424 100%);
    box-shadow: var(--pl-shadow);
}
.pl-board-when {
    text-align: center;
    font-size: 12px;
    color: var(--pl-muted);
    margin-bottom: 14px;
}
.pl-board-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}
.pl-board-team { text-align: center; }
.pl-board-team .pl-jersey {
    width: 46px; height: 46px;
    margin: 0 auto 8px;
    border-radius: 50%;
    border: 3px solid var(--tm-strong, var(--pl-line));
    background: var(--tm-soft, transparent);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.pl-board-team .pl-tname {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pl-board-score {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 44px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}
.pl-board-score .pl-sep { font-size: 28px; color: var(--pl-dim); }

/* --- stat bars ---------------------------------------------------------- */

.pl-bar {
    display: flex;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--pl-surface-2);
}
.pl-bar > div { height: 100%; transition: width 0.5s cubic-bezier(.2,.8,.2,1); }

.pl-statrow {
    display: grid;
    grid-template-columns: 3rem 1fr 3rem;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.pl-statrow b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pl-statrow .pl-statlabel {
    text-align: center;
    font-size: 11px;
    color: var(--pl-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

/* --- goal timeline ------------------------------------------------------ */

.pl-goals { display: flex; flex-direction: column; gap: 10px; }

.pl-goal {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--pl-radius);
    border: 1px solid var(--pl-line);
    background: var(--pl-surface);
    border-left: 4px solid var(--tm-strong, var(--pl-dim));
}
.pl-goal-min {
    flex-shrink: 0;
    width: 52px;
    text-align: center;
}
.pl-goal-min b {
    display: block;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.pl-goal-min span { font-size: 10px; color: var(--pl-dim); }
.pl-goal-body { flex: 1; min-width: 0; }
.pl-goal-team {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tm-text, var(--pl-muted));
}
.pl-goal-shots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.pl-thumb {
    width: 92px;
    height: 62px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--tm-strong, var(--pl-line));
    cursor: pointer;
    background: var(--pl-surface-2);
}

.pl-play {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border: 0;
    border-radius: 999px;
    background: var(--pl-accent);
    color: #052e14;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.pl-play:hover { filter: brightness(1.08); }
.pl-play.ghost {
    background: var(--pl-surface-2);
    color: var(--pl-text);
    border: 1px solid var(--pl-line);
}

/* --- heatmaps ----------------------------------------------------------- */

.pl-heat {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 560px) {
    .pl-heat { grid-template-columns: 1fr 1fr; }
}
.pl-heat figure { margin: 0; }
.pl-heat img {
    width: 100%;
    display: block;
    border-radius: 12px;
    border: 1px solid var(--pl-line);
    cursor: zoom-in;
    background: var(--pl-surface-2);
}
.pl-heat figcaption {
    margin-top: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--tm-text, var(--pl-muted));
}

/* --- modal -------------------------------------------------------------- */

.pl-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(3, 6, 12, 0.92);
    backdrop-filter: blur(4px);
}
.pl-modal[hidden] { display: none; }
.pl-modal-inner { width: 100%; max-width: 860px; }
.pl-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 700;
}
.pl-modal video, .pl-modal img {
    width: 100%;
    max-height: 72vh;
    border-radius: 12px;
    background: #000;
    display: block;
    object-fit: contain;
}
.pl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pl-tab {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--pl-line);
    background: var(--pl-surface);
    color: var(--pl-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.pl-tab.active { background: var(--pl-accent); border-color: var(--pl-accent); color: #052e14; }

/* --- notices ------------------------------------------------------------ */

.pl-note {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.09);
    color: #fcd88a;
    font-size: 12.5px;
    line-height: 1.5;
}
.pl-note b { color: #fbbf24; }

.pl-empty {
    padding: 34px 18px;
    text-align: center;
    color: var(--pl-muted);
    font-size: 14px;
}
.pl-empty .pl-emoji { font-size: 34px; display: block; margin-bottom: 10px; opacity: 0.8; }

.pl-foot {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--pl-line);
    text-align: center;
    color: var(--pl-dim);
    font-size: 11.5px;
}

/* --- loading skeleton --------------------------------------------------- */

.pl-skel {
    height: 78px;
    border-radius: var(--pl-radius);
    background: linear-gradient(90deg, var(--pl-surface) 25%, var(--pl-surface-2) 50%, var(--pl-surface) 75%);
    background-size: 200% 100%;
    animation: pl-shimmer 1.3s linear infinite;
}
@keyframes pl-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.pl-fade { animation: pl-fade-in 0.35s ease both; }
@keyframes pl-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pl-skel, .pl-fade, .pl-bar > div { animation: none; transition: none; }
}
