/* Match Finder page */

.finder-head { padding: 36px 0 20px; }
.finder-head .wrap { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.finder-title { display: flex; flex-direction: column; gap: 10px; }
.finder-title h1 { font-size: clamp(36px, 7vw, 64px); }

.mode-switch { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.mode-btn {
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: 700 16px var(--font-body); cursor: pointer;
}
.mode-btn[aria-pressed="true"] { background: var(--green); color: var(--black); }

.sample-note { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.sample-note .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; padding-bottom: 12px; font-size: 15px; color: var(--muted); }

.finder { display: flex; flex-wrap: wrap; gap: 28px; padding-top: 28px; padding-bottom: 72px; align-items: flex-start; }
.results { flex: 999 1 560px; min-width: 0; }
.filters { flex: 1 1 320px; max-width: 380px; }

/* Filters panel */
.filters {
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 22px; order: 2;
}
.filters-head { display: flex; align-items: center; justify-content: space-between; }
.filters-head h2 { font-size: 22px; }
.filter-group { display: flex; flex-direction: column; gap: 10px; }
.filter-label { font-size: 14px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button, .chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--white); font: 600 15px var(--font-body); cursor: pointer;
}
.seg button[aria-pressed="true"], .chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--black); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.date-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type="date"], input[type="search"], select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--black); color: var(--white); font: 500 16px var(--font-body); color-scheme: dark;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 44px; }
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: 1px; }

.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; min-height: 44px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 52px; height: 30px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); position: relative; flex: none; transition: background-color .15s; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .15s, background-color .15s; }
.toggle input:checked + .toggle-track { background: var(--green); border-color: var(--green); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(22px); background: var(--black); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid var(--green); outline-offset: 3px; }

.filters-foot { display: flex; flex-direction: column; gap: 10px; }
.filters-apply { display: none; }
.text-btn { background: none; border: 0; color: var(--white); text-decoration: underline; font: 600 15px var(--font-body); cursor: pointer; min-height: 44px; }
.text-btn:hover { color: var(--orange); }
.icon-btn { width: 44px; height: 44px; display: none; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--white); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

/* Results */
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.results-count { font-weight: 700; color: var(--muted); }
.filters-open { display: none; min-height: 44px; padding: 0 18px; font-size: 15px; }
.filter-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; }
.filter-dot[hidden] { display: none; }

.day-head {
  position: sticky; top: 68px; z-index: 2; background: var(--black);
  font-family: var(--font-head); font-weight: 800; font-size: 22px; padding: 14px 0 10px; margin-top: 10px;
  display: flex; align-items: baseline; gap: 10px;
}
.day-head small { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--muted); }
.day-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }

.match-card.is-live { border-color: var(--orange); }
.live-badge { background: transparent; color: var(--orange); border: 1px solid var(--orange); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.match-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hl-star { color: var(--green); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.hl-star svg { width: 14px; height: 14px; }

.match-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--white); font: 600 15px var(--font-body); cursor: pointer; text-decoration: none;
}
.card-btn:hover { border-color: var(--green); color: var(--white); }
.card-btn svg { width: 18px; height: 18px; transition: transform .15s; }
.card-btn[aria-expanded="true"] svg.chev { transform: rotate(180deg); }
.match-bars-btn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; min-height: 44px; }
.match-bars-btn:hover { color: var(--orange); }

.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bar-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.bar-list .bar-name { font-weight: 700; color: var(--white); text-decoration: none; }
.bar-list .bar-name:hover { color: var(--orange); text-decoration: underline; }
.bar-list .bar-info { grid-column: 1; font-size: 14px; color: var(--muted); }
.bar-list .badge { grid-column: 2; grid-row: 1 / span 2; }
.badge-quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.empty { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty img { width: 110px; height: 110px; border-radius: 50%; opacity: 0.9; }

/* Phone and tablet: filters slide up as a sheet */
@media (max-width: 899px) {
  .filters {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: none; max-height: 88vh; overflow-y: auto;
    border-radius: 22px 22px 0 0; border-left: 0; border-right: 0; border-bottom: 0;
    transform: translateY(105%); transition: transform .25s ease; visibility: hidden;
  }
  .filters.open { transform: none; visibility: visible; }
  .filters-foot { position: sticky; bottom: -22px; background: var(--surface); padding: 12px 0 22px; margin-bottom: -22px; }
  .filters-apply { display: inline-flex; }
  .icon-btn { display: grid; }
  .filters-open { display: inline-flex; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.6); }
  .scrim[hidden] { display: none; }
}
@media (min-width: 900px) {
  .filters { position: sticky; top: 88px; order: 2; max-height: calc(100vh - 108px); overflow-y: auto; }
  .scrim { display: none; }
}

.bar-list .book-mini { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; margin-top: 4px; border-radius: 999px; background: var(--orange); color: var(--black); font: 700 14px var(--font-body); text-decoration: none; }
.bar-list .book-mini:hover { background: var(--orange-hover); color: var(--black); }
