/* Events page (AdminEvents, EventBoard, EventRaceDay): the programme, the picked event's race day and its clubs on
   the map. Venue colours only where they mean a venue; gold marks the picked event. */

/* header: title, race-day links */
.evx-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin: var(--s2) 0 var(--s4); }
.evx-id h1 { margin: 0; font: 600 24px/1.2 Inter, sans-serif; color: var(--ink); }
.evx-id p { margin: var(--s1) 0 0; font: var(--t-meta); color: var(--muted); }
.evx-links { display: flex; flex-wrap: wrap; gap: var(--s2); }
.evx-links .ic { width: 18px; height: 18px; }

/* venue cards: athletes, ergs, races and load per erg; a tap shows one venue everywhere on the page */
.evx-venues { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.evx-venue { --vc: var(--blue); --vc-pale: #F3F6FD; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--line);
  border-radius: var(--r-card); background: var(--vc-pale); color: var(--ink); font: inherit; text-align: left; cursor: pointer; position: relative; overflow: hidden;
  transition: opacity var(--mo-2, 160ms) var(--e-settle, ease), box-shadow var(--mo-2, 160ms) var(--e-settle, ease); }
.evx-venue::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--vc); }
.evx-venue.ld { --vc: var(--purple); --vc-pale: #F7F3FC; }
.evx-venue.none { --vc: #8E97AD; --vc-pale: #F6F7FA; cursor: default; }
.evx-venue:not(.none):hover { box-shadow: 0 1px 3px rgba(27,36,64,.12); }
.evx-venue.on { box-shadow: inset 0 0 0 2px var(--vc); }
.evx-venue.dim { opacity: .5; }
.evx-venue-id { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.evx-venue-id i { width: 10px; height: 10px; border-radius: 50%; background: var(--vc); flex: none; align-self: center; }
.evx-venue-id b { font: 700 13px/1.2 Inter, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--vc); }
.evx-venue-id small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--t-meta); color: var(--muted); }
.evx-figs { display: flex; gap: var(--s5); }
.evx-figs > span { display: flex; flex-direction: column; }
.evx-figs b { font: 700 20px/1.1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
.evx-figs small { font: var(--t-meta); color: var(--muted); }

/* filter chips (Material 3 filter chip) */
.evx-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.evx-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.fchip { display: inline-flex; align-items: center; gap: var(--s1); height: 32px; padding: 0 var(--s3); border: 1px solid #C4CAD8; border-radius: 8px; background: var(--card);
  color: var(--ink); font: 600 13px/1 Inter, sans-serif; cursor: pointer; transition: background var(--mo-2, 160ms) var(--e-settle, ease); }
.fchip:hover { background: #F4F6FB; }
.fchip.on { background: #DCE5F8; border-color: #DCE5F8; color: #0E2F7A; padding-left: var(--s2); }
.fchip .ic { width: 18px; height: 18px; }
.fchip small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; font-variant-numeric: tabular-nums; }
.evx-club { display: inline-flex; align-items: center; gap: var(--s2); }

/* layout: the programme, and beside it the picked event and the map */
.evx { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
.evx-side { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
@media (min-width: 900px) {
  .evx { grid-template-columns: minmax(0, 1fr) 380px; }
  .evx-side { position: sticky; top: calc(var(--topbar) + var(--s3)); max-height: calc(100vh - var(--topbar) - var(--s5)); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; border-radius: var(--r-card); }
}
@media (min-width: 1200px) { .evx { grid-template-columns: minmax(0, 1fr) 460px; gap: var(--s5); } }

/* programme */
.pg { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.pg-group { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: var(--s2) var(--s4) var(--s3); }
.pg-group-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin: 0; padding: var(--s2) 0 var(--s3); }
.pg-group-h span { font: var(--t-title); color: var(--ink); }
.pg-group-h small { font: var(--t-meta); color: var(--muted); }
.pg-group-h b { margin-left: auto; font: 600 12px/1.2 Inter, sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.pg-lanes { display: flex; flex-direction: column; }
.pg-lane { display: grid; grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2); align-items: stretch; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.pg-age { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.pg-age b { font: 800 18px/1.1 Inter, sans-serif; color: var(--ink); letter-spacing: -.01em; }
.pg-fmt { display: inline-flex; align-items: center; gap: 3px; font: 500 11px/1.3 Inter, sans-serif; color: var(--muted); white-space: nowrap; }
.pg-fmt .ic { width: 14px; height: 14px; flex: none; }

/* one event card: gender, athletes, to place; per venue the athletes, a block per race (filled ergs) and the first start */
.pc { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0; padding: var(--s2) var(--s3); border: 0; border-radius: 12px; background: var(--bg);
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: background var(--mo-2, 160ms) var(--e-settle, ease), box-shadow var(--mo-2, 160ms) var(--e-settle, ease), opacity var(--mo-2, 160ms) var(--e-settle, ease); }
.pc:hover { background: #EBEFF8; }
.pc:focus-visible { outline: none; box-shadow: var(--ring); }
.pc.zero { opacity: .5; }
.pc.sel { background: #FFFBEA; box-shadow: inset 0 0 0 2px var(--gold, #F2B705), 0 6px 18px -8px rgba(27,36,64,.25); }
.pc-top { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.pc-top b { font: var(--t-head); }
.pc-place { padding: 1px 6px; border-radius: var(--r-pill); background: #E6E9F0; font: 600 10px/1.5 Inter, sans-serif; color: #4A5470; white-space: nowrap; }
.pc-n { margin-left: auto; font: 700 18px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
.pc-v { --vc: var(--blue); --vc-pale: #D5DFF5; display: grid; grid-template-columns: 8px 26px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 16px;
  transition: opacity var(--mo-2, 160ms) var(--e-settle, ease); }
.pc-v.ld { --vc: var(--purple); --vc-pale: #E2D6F0; }
.pc-v.none { opacity: .35; }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--vc); }
.pc-c { font: 700 13px/1 Inter, sans-serif; color: var(--vc); font-variant-numeric: tabular-nums; }
.pc-heats { display: flex; align-items: center; gap: 3px; min-width: 0; }
.pc-heats i { flex: 0 1 26px; min-width: 10px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--vc) var(--f), var(--vc-pale) var(--f)); }
.pc-heats small { font-size: 10px; color: var(--muted); }
.pc-t { font: 500 11px/1 Inter, sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg.focus-ox .pc-v.ld, .pg.focus-ld .pc-v.ox { opacity: .2; }

/* the picked event */
.evd { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); position: relative; }
.evd::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: var(--r-card) var(--r-card) 0 0; background: var(--gold, #F2B705); }
.evd-head { display: flex; align-items: flex-start; gap: var(--s2); }
.evd-id { flex: 1; min-width: 0; }
.evd-id small { font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.evd-id h2 { margin: 2px 0 0; font: 700 22px/1.2 Inter, sans-serif; color: var(--ink); }
.evd-head .m-icon { display: grid; place-items: center; flex: none; }
.evd-head .m-icon .ic { width: 20px; height: 20px; }
.evd-fmt { display: flex; flex-wrap: wrap; gap: var(--s2); }
.evd-fmt span { display: inline-flex; align-items: center; gap: var(--s1); height: 28px; padding: 0 var(--s3) 0 var(--s2); border-radius: 8px; background: var(--pale);
  font: 600 12px/1 Inter, sans-serif; color: #0E2F7A; }
.evd-fmt .ic { width: 16px; height: 16px; }
.evd-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: var(--s2); }
.evd-figs span { display: flex; flex-direction: column; }
.evd-figs b { font: 700 22px/1.1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
.evd-figs small { font: var(--t-meta); color: var(--muted); }
.evd-figs .warn b { color: var(--warn); }
.evd .ev-bar { height: 8px; }
.evd-h { display: flex; align-items: baseline; gap: var(--s2); margin: var(--s1) 0 0; font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.evd-h small { font: var(--t-meta); text-transform: none; letter-spacing: 0; color: var(--muted); }
.evd-clubs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.evd-clubs a { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: center; gap: var(--s3); padding: var(--s2) var(--s1); border-radius: 8px;
  color: var(--ink); text-decoration: none; }
.evd-clubs a:hover { background: #F5F8FE; }
.evd-clubs b { font: var(--t-head); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evd-n { text-align: right; font: 700 14px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
.evd-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); padding-top: var(--s3); border-top: 1px solid var(--line); }
.evd-foot .mbtn.filled { margin-right: auto; }
.evd-foot .ic { width: 18px; height: 18px; }
.evd-hint { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px dashed #C4CAD8; border-radius: var(--r-card); font: var(--t-body); color: var(--muted); }
.evd-hint .ic { width: 24px; height: 24px; flex: none; color: var(--blue); }
.evd-hint b { color: var(--ink); }
.evx-scrim { display: none; }
.evx-map .emap-stage > svg { aspect-ratio: 4 / 3.4; max-height: none; min-height: 0; }

/* race day per venue: each race a row of ergs (this event solid, the rest of the race lighter) */
.erd { display: flex; flex-direction: column; gap: var(--s2); }
.erd-v { --vc: var(--blue); --vc-pale: #F3F6FD; --vc-soft: #B8C8EB; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: opacity var(--mo-2, 160ms) var(--e-settle, ease); }
.erd-v.ld { --vc: var(--purple); --vc-pale: #F7F3FC; --vc-soft: #D4C4E8; }
.erd-v.none { opacity: .55; }
.erd.focus-ox .erd-v.ld, .erd.focus-ld .erd-v.ox { opacity: .35; }
.erd-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); background: var(--vc-pale); }
.erd-pin { width: 10px; height: 10px; border-radius: 50%; background: var(--vc); flex: none; }
.erd-id { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.erd-id b { font: 700 12px/1.2 Inter, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--vc); }
.erd-id small { font: var(--t-meta); color: var(--muted); }
.erd-n { margin-left: auto; display: flex; align-items: baseline; gap: var(--s1); }
.erd-n b { font: 700 18px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
.erd-n small { font: var(--t-meta); color: var(--muted); }
.erd-races { list-style: none; margin: 0; padding: 0; }
.erd-races li + li { border-top: 1px solid var(--line); }
.erd-race { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(60px, 110px) 44px 18px; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3);
  color: var(--ink); text-decoration: none; }
span.erd-race { grid-template-columns: 52px minmax(0, 1fr) minmax(60px, 110px) 44px; }
a.erd-race:hover { background: #F7F9FD; }
a.erd-race .ic { width: 18px; height: 18px; color: var(--muted); }
.erd-time { font: 700 14px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
.projected .erd-time { font: 600 12px/1 Inter, sans-serif; color: var(--muted); }
.erd-kind { display: flex; flex-direction: column; min-width: 0; font: 600 13px/1.25 Inter, sans-serif; }
.erd-kind small { font: var(--t-meta); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erd-ergs { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--vc) 0 var(--a), var(--vc-soft) var(--a) var(--b), var(--bg) var(--b)); }
.relay .erd-ergs { background: linear-gradient(90deg, transparent 0 var(--a), var(--vc-soft) var(--a) var(--b), var(--bg) var(--b)),
  repeating-linear-gradient(135deg, var(--vc) 0 4px, var(--vc-soft) 4px 6px); }
.erd-c { text-align: right; font: 700 13px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
.erd-c small { font-weight: 500; color: var(--muted); }
.erd-links { display: flex; flex-wrap: wrap; gap: var(--s1); padding: var(--s2) var(--s3); border-top: 1px solid var(--line); }
.erd-links a { display: inline-flex; align-items: center; gap: var(--s1); height: 28px; padding: 0 var(--s2); border-radius: 8px; font: 600 12px/1 Inter, sans-serif;
  color: var(--vc); text-decoration: none; }
.erd-links a:hover { background: var(--vc-pale); }
.erd-links .ic { width: 16px; height: 16px; }
.erd-note { margin: 0; padding: var(--s2) var(--s3); font: var(--t-meta); color: var(--muted); }
.evp > .erd { margin: var(--s3) 0 var(--s4); }
@media (min-width: 900px) { .evp > .erd { display: grid; grid-template-columns: 1fr 1fr; align-items: start; } }

/* phone and narrow tablet: the picked event rises as a bottom sheet over a scrim */
@media (max-width: 899px) {
  .evx-head { margin-top: var(--s1); }
  .evx-venues { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .evx-venue { padding: var(--s2) var(--s3); gap: var(--s2); }
  .evx-venue.none { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .evx-venue-id small { display: none; }
  .evx-figs { gap: var(--s3); flex-wrap: wrap; }
  .evx-figs > span:nth-child(n+3) { display: none; }
  .evx-venue.none .evx-figs > span { flex-direction: row; align-items: baseline; gap: var(--s1); }
  .evx-figs b { font-size: 18px; }
  .evx-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .fchip { flex: none; }
  .pg-group { padding: var(--s1) var(--s3) var(--s2); }
  .pg-lane { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pg-age { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; align-items: baseline; gap: var(--s3); }
  .pg-age b { font-size: 16px; }
  .evx.has-sel .evx-scrim { display: block; position: fixed; inset: 0; z-index: 48; background: rgba(15,22,45,.28); animation: evx-fade var(--mo-2, 160ms) both; }
  .evx.has-sel .evd { position: fixed; left: 0; right: 0; bottom: 0; z-index: 49; max-height: 84vh; overflow-y: auto; overscroll-behavior: contain;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom)); animation: evd-rise var(--mo-3, 240ms) var(--e-settle, ease) both; }
  .evx.has-sel .evd::before { left: 50%; right: auto; top: 8px; width: 36px; height: 4px; border-radius: 2px; transform: translateX(-50%); background: #C4CAD8; }
}
@keyframes evd-rise { from { transform: translateY(40px); opacity: .6; } }
@keyframes evx-fade { from { opacity: 0; } }
@media (max-width: 420px) {
  .pc { padding: var(--s2); }
  .pc-v { grid-template-columns: 8px 22px minmax(0, 1fr) auto; gap: 4px; }
  .erd-race, span.erd-race { grid-template-columns: 46px minmax(0, 1fr) 56px 40px; }
  a.erd-race .ic { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pc, .evx-venue, .erd-v { transition: none; } .evx.has-sel .evd, .evx.has-sel .evx-scrim { animation: none; } }
.pg-none { margin: 0; padding: var(--s2) 0 var(--s1); border-top: 1px solid var(--line); font: var(--t-meta); color: var(--muted); }
