/* NextFightApp: header search button, search overlay, install / Add to Home Screen sheet.
   Uses the design tokens from site.css (night bands, gold, red/blue corners, Barlow / Inter / JetBrains Mono). */

/* ------------------------------------------------------------ header search button */
.search-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  margin-left: -10px; padding: 0; border: 1px solid var(--night-line); border-radius: 8px; background: transparent;
  color: var(--night-2t); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.search-btn:hover { color: #fff; border-color: var(--night-muted); background: var(--night-2); }
.search-btn:active { background: var(--night-3); }
.search-btn svg { width: 19px; height: 19px; display: block; }
@media (max-width: 700px) {
  /* first row: logo left, search right; the nav keeps its own full-width second row */
  .search-btn { order: 1; margin: 0 -4px 0 auto; width: 38px; height: 38px; }
  .top-inner > .nav { order: 2; }
}

/* ------------------------------------------------------------ search overlay */
html.sx-on { overflow: hidden; }
.sx { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  background: rgba(5, 6, 9, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sx[hidden] { display: none; }
.sx-panel { display: flex; flex-direction: column; width: 100%; max-height: min(760px, 88vh); max-height: min(760px, 88dvh);
  background: var(--bg); border-bottom: 1px solid var(--border-strong); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .65);
  animation: sx-in .16s ease-out; }
@keyframes sx-in { from { opacity: 0; transform: translateY(-8px); } }
.sx-in { max-width: 760px; margin: 0 auto; width: 100%; padding: 0 16px; }
.sx-bar { background: var(--night); border-bottom: 3px solid var(--gold); flex: none; }
.sx-bar .sx-in { display: flex; align-items: center; gap: 10px; padding-top: 11px; padding-bottom: 11px; }
.sx-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 10px;
  background: var(--night-2); border: 1.5px solid var(--night-line); color: var(--night-muted); cursor: text; }
.sx-field:focus-within { border-color: var(--gold); }
.sx-field svg { width: 20px; height: 20px; flex: none; }
.sx-input { flex: 1; min-width: 0; height: 46px; margin: 0; padding: 0; border: 0; border-radius: 0; outline: none; background: transparent;
  color: var(--night-text); font: 500 18px/1.2 var(--font-text); -webkit-appearance: none; appearance: none; }  /* 16px+ : no iOS zoom */
.sx-input::placeholder { color: var(--night-muted); opacity: 1; }
.sx-input::-webkit-search-cancel-button, .sx-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.sx-close { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--night-line); background: transparent; color: var(--night-2t); cursor: pointer;
  font: 700 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.sx-close:hover { color: #fff; border-color: var(--night-muted); }
.sx-close svg { width: 16px; height: 16px; display: none; }
.sx-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sx-body .sx-in { padding-top: 6px; padding-bottom: 18px; }
.sx-h { display: flex; justify-content: space-between; gap: 10px; margin: 14px 2px 7px; color: var(--muted);
  font: 700 11.5px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.sx-h span { letter-spacing: .04em; font-weight: 500; }
.sx-opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 9px 12px 9px 12px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 10px;
  color: var(--text); text-decoration: none; scroll-margin: 8px; }
.sx-opt.booked { border-left-color: var(--gold); }
.sx-opt:hover { color: var(--text); }
.sx-opt[aria-selected="true"] { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 65%, var(--border)); border-left-color: var(--gold); }
.sx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sx-main b { font: 800 21px/1 var(--font-display); text-transform: uppercase; letter-spacing: .005em; overflow-wrap: anywhere; }
.sx-main small, .sx-side small { font: 500 12px/1.3 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-opt mark { background: none; color: var(--gold-ink); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--gold) 70%, transparent); }
.sx-side { flex: none; max-width: 40%; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; min-width: 0; }
.sx-side small { max-width: 100%; }
.sx-when { font: 800 19px/1 var(--font-display); text-transform: uppercase; color: var(--gold-ink); white-space: nowrap; }
.sx-opt.ev .pill { flex: none; }
.sx-msg { margin: 18px 2px 8px; color: var(--text-2); font-size: 15px; }
.sx-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 2px 0;
  font: 500 12px/1.4 var(--font-mono); color: var(--muted); }
.sx-foot a { color: var(--link); }
.sx-keys kbd { display: inline-block; min-width: 20px; padding: 2px 5px; margin: 0 2px 0 6px; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--text-2); font: 600 11px/1.2 var(--font-mono); text-align: center; }
.sx-keys kbd + kbd { margin-left: 0; }
.sx-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px), (pointer: coarse) {
  .sx-keys { display: none; }
}
@media (max-width: 700px) {
  .sx-panel { height: 100%; max-height: none; }
  .sx-in { padding: 0 12px; }
  .sx-bar .sx-in { padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  .sx-field { padding: 0 10px; }
  .sx-close { width: 46px; padding: 0; justify-content: center; }
  .sx-close svg { display: block; }
  .sx-close span { display: none; }
  .sx-main b { font-size: 19px; }
  .sx-opt { padding: 8px 10px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .sx-panel { animation: none; } }

/* ------------------------------------------------------------ install / Add to Home Screen sheet */
.a2hs { position: fixed; z-index: 90; left: 12px; right: 12px; bottom: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 460px; margin: 0 auto; display: flex; align-items: flex-start; gap: 14px; padding: 16px 14px 16px 16px;
  background: var(--night); color: var(--night-text); border: 1px solid var(--night-line); border-top: 3px solid var(--gold);
  border-radius: 16px; box-shadow: 0 22px 60px -14px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .25);
  transform: translateY(calc(100% + 40px)); opacity: 0; transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
.a2hs.in { transform: none; opacity: 1; }
.a2hs-icon { flex: none; width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.a2hs-body { flex: 1; min-width: 0; }
.a2hs-t { margin: 1px 0 5px; padding-right: 4px; font: 800 22px/1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; color: #fff; }
.a2hs-d { margin: 0; font-size: 14px; line-height: 1.45; color: var(--night-2t); }
.a2hs-d b { color: #fff; font-weight: 600; white-space: nowrap; }
.a2hs-share { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.28em; margin: 0 1px; color: var(--night-blue); }
.a2hs .btn { margin-top: 12px; padding: 9px 14px; font-size: 15px; }
.a2hs-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: -6px -4px 0 0;
  padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--night-2t); cursor: pointer; }
.a2hs-x:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.a2hs-x svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .a2hs { transition: none; } }
@media print { .a2hs, .sx, .search-btn { display: none !important; } }
