/* Practice Fields page. Uses the site tokens from /styles.css. */

.practice-fields-page main {
  background: var(--paper);
}

.pf-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.pf-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 26px 0 6px;
}

.pf-mode {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.pf-mode span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.pf-mode.is-active {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: var(--white);
}

.pf-mode.is-active span {
  color: rgba(255, 255, 255, 0.78);
}

.pf-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(18, 32, 51, 0.07);
  overflow: hidden;
}

.pf-toolbar {
  display: grid;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f2f5f3;
}

.pf-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
}

.pf-field-group {
  display: grid;
  gap: 5px;
  /* min-width 0 so a select with long option text cannot force the page wider
     than a phone viewport. */
  min-width: 0;
  flex: 1 1 240px;
}

.pf-field-group label,
.pf-legend {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pf-field-group select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.pf-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.pf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.pf-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.pf-toggle-sub {
  font-weight: 600;
  color: var(--muted);
}

.pf-map {
  position: relative;
  background: radial-gradient(120% 100% at 50% 20%, #16351f 0%, #0c1f14 70%, #081810 100%);
}

.pf-map svg {
  display: block;
  width: 100%;
  height: clamp(340px, 58vh, 640px);
  touch-action: none;
  cursor: grab;
}

.pf-map svg.is-grabbing {
  cursor: grabbing;
}

/* On-page map palette. Geometry is in feet; only colour lives here. */
.pf-map [data-layer-kind="aerial"] image {
  opacity: 0.58;
  filter: saturate(0.85) contrast(1.04);
}

.pf-map path,
.pf-map circle {
  stroke: rgba(255, 255, 255, 0.94);
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pf-map circle.is-filled {
  fill: #ffffff;
  stroke: none;
}

/* Paint colour follows data-paint from the config: the large field is white and
   takes priority, the 10U fields are green so the white reads first. Each field
   group carries a soft dark halo so a 4 in line still reads over grass and
   shadow, and so a green line crossing a white one stays legible. */
.pf-map [data-field-group] {
  filter: drop-shadow(0 0 1.6px rgba(4, 16, 9, 0.95)) drop-shadow(0 1px 2px rgba(4, 16, 9, 0.5));
}

.pf-map [data-paint="white"] path,
.pf-map [data-paint="white"] circle {
  stroke: #ffffff;
}

.pf-map [data-paint="green"] path,
.pf-map [data-paint="green"] circle {
  stroke: #6df2a2;
}

/* The centre circles are the shape that tells a parent which field is which from
   a distance, so they get a touch more presence than the rest of the markings. */
.pf-map [data-layer-kind="centerCircle"] circle {
  stroke-opacity: 0.95;
}

/* Equipment that is not installed yet is a placement reference, not a record of
   what is on the ground, so it is dashed wherever it is drawn. */
.pf-map [data-present="no"] path {
  stroke-dasharray: 3 2.5;
  opacity: 0.8;
}

/* Lines outside the active striping set are hidden by the controller. When they
   are switched on they read as reference, not as paint. */
.pf-map.show-full-markings [data-striped="no"] path,
.pf-map.show-full-markings [data-striped="no"] circle {
  opacity: 0.5;
  stroke-dasharray: 2.5 2;
}

.pf-map [data-role="siteBoundary"] {
  stroke: var(--gold);
  stroke-dasharray: 5 4;
}

.pf-map [data-paint="white"] [data-role="goal"] {
  stroke: #ffffff;
}

.pf-map [data-paint="green"] [data-role="goal"] {
  stroke: #6df2a2;
}

.pf-map text {
  fill: #ffffff;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(4, 16, 9, 0.85);
  stroke-width: 1.1;
  letter-spacing: 0.01em;
}

/* The field name is the one thing a parent reads, so the 10U names carry a tint of
   their field's own colour rather than the generic white. */
.pf-map [data-role="fieldLabel"] {
  fill: #e4fff0;
}

.pf-map [data-role="labelSub"] {
  fill: #cfe6d8;
  font-weight: 700;
}

.pf-map [data-role="dimensionLine"],
.pf-map [data-role="dimensionTick"] {
  stroke: var(--gold);
}

.pf-map [data-role="dimensionText"] {
  fill: var(--gold);
  stroke: rgba(6, 22, 13, 0.8);
}

.pf-map [data-role="controlPoint"] {
  fill: #ff7a63;
  stroke: #ffffff;
  stroke-width: 0.35;
}

.pf-map [data-role="controlLabel"] {
  fill: #ffd9d2;
  font-weight: 700;
}

.pf-map [data-layer="zones"] rect {
  fill: rgba(20, 94, 168, 0.14);
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 0.4;
  stroke-dasharray: 3 3;
}

.pf-map [data-layer="zones"] text {
  fill: rgba(255, 255, 255, 0.85);
  font-weight: 900;
}

/* Paint legend: the two-tier white/green scheme, stated once. */
.pf-paint-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.pf-paint-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.pf-paint-chip i,
.pf-paint-dot {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(10, 30, 18, 0.35);
}

.pf-paint-dot {
  width: 12px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Matches how the map draws a thing that is not installed yet. */
.pf-paint-chip.is-proposed i {
  background: repeating-linear-gradient(90deg, #ffffff 0 4px, transparent 4px 7px);
  box-shadow: none;
}

[data-paint-chip="green"] i,
i[data-paint-chip="green"],
.pf-paint-dot[data-paint-chip="green"] {
  background: #2f9d63;
}

.pf-toggle-strong {
  font-weight: 800;
}

.pf-map-tools {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(9, 27, 17, 0.72);
}

.pf-map-tools button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
}

.pf-map-tools span {
  min-width: 52px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.pf-hint {
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.pf-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f0;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pf-status-held {
  background: #fdf1d3;
  color: #6c4c00;
}

.pf-status-assigned {
  background: #dff0e5;
  color: #1d5a38;
}

.pf-status-blocked,
.pf-status-aside {
  background: #f7ded9;
  color: #8a3223;
}

.pf-cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  margin-top: 30px;
}

.pf-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.pf-card h3 {
  margin: 2px 0 4px;
}

.pf-card-eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pf-card-dims {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.pf-session-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 16px;
}

.pf-session-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 22px;
}

.pf-session-card {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.pf-session-card h3 {
  margin: 2px 0 4px;
  font-size: 1.05rem;
}

.pf-session-card header p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.pf-session-map {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  background: #153820;
}

.pf-session-field-bg {
  fill: #153820;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
}

.pf-session-map rect:not(.pf-session-field-bg) {
  fill: rgba(255, 255, 255, 0.08);
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.4;
}

.pf-session-map .is-selected rect {
  fill: rgba(241, 184, 45, 0.92);
  stroke: #ffffff;
  stroke-width: 2.4;
}

.pf-session-map text {
  fill: #ffffff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(5, 24, 12, 0.86);
  stroke-width: 3px;
}

.pf-session-map .is-selected text {
  fill: #0b1622;
  stroke: rgba(255, 255, 255, 0.78);
}

.pf-session-map .pf-session-area {
  font-size: 11px;
  font-weight: 800;
}

.pf-session-north {
  font-size: 12px !important;
}

.pf-session-map-fallback {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 18px;
  border-radius: 9px;
  background: #eef2f0;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.pf-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.pf-facts dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pf-facts dd {
  margin: 2px 0 0;
  font-size: 0.94rem;
}

.pf-table-scroll {
  overflow-x: auto;
}

.pf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.pf-table caption {
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.pf-table th,
.pf-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.pf-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.pf-table tr.is-pass td:last-child {
  color: var(--green);
  font-weight: 900;
}

.pf-table tr.is-fail td:last-child {
  color: var(--red);
  font-weight: 900;
}

.pf-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pf-badge.is-ok {
  background: #dff0e5;
  color: #1d5a38;
}

.pf-badge.is-error {
  background: #f7ded9;
  color: #8a3223;
}

.pf-issues {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.pf-issues.is-error li {
  color: #8a3223;
  font-weight: 700;
}

.pf-issues.is-warning li {
  color: #6c4c00;
}

.pf-issues.is-info li {
  color: var(--muted);
}

.pf-arith {
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  background: #fdf8ec;
  color: var(--ink);
}

.pf-compare-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  margin-top: 18px;
}

.pf-compare {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.pf-compare.is-active {
  border-color: var(--blue-dark);
  box-shadow: 0 0 0 2px rgba(14, 65, 111, 0.16);
}

.pf-compare header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.pf-compare h4 {
  margin: 0;
  font-size: 1.02rem;
}

.pf-compare p {
  margin: 0;
  font-size: 0.9rem;
}

.pf-compare button {
  align-self: flex-start;
}

.pf-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.pf-block {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.pf-block h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
}

.pf-block > p {
  max-width: 760px;
}

.pf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pf-tables {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.pf-print-only {
  display: none;
}

.pf-error {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--red);
  background: #fdf1ef;
  color: #8a3223;
  font-weight: 700;
}

.practice-fields-page[data-mode="practice"] .pf-striping-only {
  display: none;
}

.practice-fields-page[data-mode="striping"] .pf-practice-only {
  display: none;
}

@media (max-width: 640px) {
  .pf-map svg {
    height: clamp(300px, 52vh, 420px);
  }

  .pf-mode {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* Printing produces the striping sheet: the drawing on white, plus the
   dimension and clearance tables. Everything a volunteer cannot use on paper
   is dropped. */
@media print {
  @page {
    size: landscape;
    margin: 0.4in;
  }

  .site-header,
  .site-footer,
  .pf-toolbar,
  .pf-map-tools,
  .pf-modes,
  .pf-actions,
  .pf-hint,
  .pf-cards,
  .pf-session-grid,
  .pf-session-controls,
  .pf-compare-grid,
  .pf-no-print,
  .section-heading p {
    display: none !important;
  }

  .pf-print-only {
    display: block;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
  }

  .practice-fields-page main {
    background: #ffffff;
  }

  .section {
    padding: 0 !important;
  }

  h1 {
    font-size: 1.5rem !important;
  }

  .pf-block {
    margin-top: 14px;
    padding-top: 10px;
    break-inside: avoid;
  }

  .pf-block h2 {
    font-size: 1.1rem;
  }

  .pf-panel {
    border: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .pf-map {
    background: #ffffff;
  }

  .pf-map svg {
    height: auto;
    max-height: 5.6in;
    aspect-ratio: 367 / 282;
  }

  .pf-map [data-layer-kind="aerial"] {
    display: none;
  }

  .pf-map path,
  .pf-map circle {
    stroke: #122033;
  }

  /* White paint cannot print white, so the priority line prints near-black and
     the green 10U lines print green, keeping the same two-tier reading. */
  .pf-map [data-paint="white"] path,
  .pf-map [data-paint="white"] circle,
  .pf-map [data-paint="white"] [data-role="goal"] {
    stroke: #0b1622;
  }

  .pf-map [data-paint="green"] path,
  .pf-map [data-paint="green"] circle,
  .pf-map [data-paint="green"] [data-role="goal"] {
    stroke: #1f7a45;
  }

  .pf-map [data-role="siteBoundary"] {
    stroke: #8b93a0;
  }

  .pf-map circle.is-filled {
    fill: #122033;
  }

  .pf-map text,
  .pf-map [data-role="labelSub"] {
    fill: #122033;
    stroke: none;
  }

  .pf-map [data-role="dimensionLine"],
  .pf-map [data-role="dimensionTick"] {
    stroke: #c84630;
  }

  .pf-map [data-role="dimensionText"] {
    fill: #c84630;
    stroke: none;
  }

  .pf-map [data-role="controlPoint"] {
    fill: #c84630;
    stroke: none;
  }

  .pf-map [data-role="controlLabel"] {
    fill: #8a3223;
    stroke: none;
  }

  .pf-arith {
    background: none;
  }
}
