/* =====================================================================
   BETROX terminal · view-sports.css — match list (.sp-*) and event detail (.ev-*)
   Refs 05 / 09 (list) and 06 / 07 (detail). Core pieces (.vh, .mt-*, .mcol,
   .ko, .teams, .more) come from core.css; only scoped additions here.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Match list layout
     landscape: [side | head]   narrow: head
                [side | main]           side (search + time chips)
                                        main
   --------------------------------------------------------------------- */
.sp {
  --sp-side-w: 280px;
  display: grid; grid-template-columns: var(--sp-side-w) minmax(0, 1fr);
  grid-template-areas: "side head" "side main";
  grid-template-rows: auto 1fr;
  column-gap: 20px; align-items: start;
}
@media (max-width: 1500px) { .sp { --sp-side-w: 240px; column-gap: 16px; } }
.sp-head { grid-area: head; min-width: 0; }
.sp-main { grid-area: main; min-width: 0; }
.sp-side {
  grid-area: side; position: sticky; top: 0; z-index: 3;
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line);
  max-height: calc(100dvh - var(--hdr-h) - 2 * var(--pad)); overflow-y: auto; scrollbar-width: thin;
}
.sp-head .vh { margin-bottom: 12px; }

/* search field */
.sp-search .bx-input { min-height: var(--bx-tap); padding-right: 52px; font-size: 19px; }
.sp-search .bx-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sp-qclear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
}
.sp-qclear:hover { color: var(--ink); background: var(--tile-hover); }
.sp-qclear[hidden] { display: none; }

/* time pills: Alle · Heute · 3H · 24H · 48H */
.sp-times { display: grid; grid-template-columns: 1fr 1.4fr 1fr 1fr 1fr; gap: 4px; }
.sp-time {
  min-height: var(--bx-tap); padding: 0 4px; border: 1px solid var(--line-3); border-radius: var(--r-sm);
  background: var(--tile); color: var(--ink-2);
  font-family: var(--cond); font-weight: 700; font-size: 19px; letter-spacing: .01em; white-space: nowrap;
  touch-action: manipulation; transition: background-color .15s ease, color .15s ease;
}
.sp-time:hover { color: var(--ink); }
.sp-time[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* sports list: Fußball active, the rest greyed with 0 */
.sp-sports { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.sp-sport {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px;
  border-radius: var(--r); color: var(--ink-2); text-decoration: none;
  font-size: 18px; font-weight: 700;
}
.sp-sport .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sport .n { font-family: var(--cond); font-size: 20px; font-weight: 700; color: var(--muted); }
.sp-sport.is-active { min-height: var(--bx-tap); background: var(--accent); color: var(--on-accent); }
.sp-sport.is-active .n { color: var(--on-accent); }
.sp-sport.is-off { color: var(--muted-2); cursor: default; }
.sp-sport.is-off .bx-ic { opacity: .55; }
.sp-sport.is-off .n { color: var(--muted-2); }

/* Zeit | Wettbewerb */
.sp-sort > button { min-height: 52px; padding: 0 20px; }

/* active filter chips + match count */
.sp-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; min-height: 36px; }
.sp-filters:empty { display: none; }
.sp-fchip { min-height: 44px; gap: 8px; background: var(--accent-tint); border-color: var(--accent-line); color: var(--ink); }
.sp-fchip .bx-ic:last-child { color: var(--accent); }
.sp-reset {
  min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--accent);
  font-size: 16px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.sp-count { margin-left: auto; font-size: 16px; font-weight: 700; color: var(--muted); }
.sp-emptyact { display: flex; justify-content: center; margin: -8px 0 24px; }

/* table additions */
.sp-hl { font-size: 16px; font-weight: 700; color: var(--muted); }
body.is-landscape .sp-count { display: none; }
/* landscape: a denser table so four columns (handicap with its line) fit next to the sidebar */
body.is-landscape .sp-mt { --mt-info-w: minmax(210px, 1fr); }
body.is-landscape .sp-mt .mt-row { grid-template-columns: var(--mt-info-w) minmax(0, 4.2fr) 60px; gap: 10px; padding-left: 12px; padding-right: 8px; }
body.is-landscape .sp-mt .mt-cols { gap: 10px; }
body.is-landscape .sp-mt .mcol { gap: 4px; }
body.is-landscape .sp-mt .mcol.has-line { grid-template-columns: 34px repeat(var(--n, 3), minmax(0, 1fr)); }
body.is-landscape .sp-mt .mcol .bx-odd { padding: 0 2px; }
body.is-landscape .sp-mt .mcol .bx-odd .v { font-size: 22px; }
body.is-landscape .sp-mt .mline { font-size: 15px; }
body.is-landscape .sp-mt .mcol-sel { padding: 0 30px 0 10px; font-size: 18px; }
body.is-landscape .sp-mt .mcol-head .bx-ic { right: 6px; }
body.is-landscape .sp-mt .more { min-width: 56px; }
body.is-landscape .sp-mt .sp-ev { gap: 10px; }
body.is-landscape .sp-mt .ko { min-width: 56px; }
body.is-landscape .sp-mt .teams .tm { font-size: 17px; }
.sp-mt .mt-group .mt-gname { text-transform: none; }
.sp-ev {
  display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; min-height: var(--mt-odd-h);
  padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: inherit; text-align: left;
  touch-action: manipulation;
}
.sp-ev:hover .tm { color: var(--accent); }
.sp-ev .teams { flex: 1; }

/* ---------------------------------------------------------------------
   Narrow layouts (portrait kiosk / tablet / phone)
   --------------------------------------------------------------------- */
body.is-narrow .sp { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "side" "main"; grid-template-rows: auto; }
body.is-narrow .sp-side {
  position: static; max-height: none; overflow: visible; z-index: auto;
  padding: 0; border: 0; background: transparent; gap: 10px; margin: 0 0 12px;
}
body.is-narrow .sp-sports { display: none; }
body.is-narrow .sp-times { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
body.is-narrow .sp-times::-webkit-scrollbar { display: none; }
body.is-narrow .sp-time { flex: 1 0 auto; min-width: 96px; padding: 0 16px; border-radius: 999px; }
body.is-phone .sp-head .vh-ic { display: none; }
body.is-phone .sp-sort { padding: 3px; gap: 3px; }
body.is-phone .sp-sort > button { min-height: 44px; padding: 0 10px; font-size: 16px; }
body.is-phone .sp-search .bx-input { min-height: 48px; font-size: 17px; }
body.is-phone .sp-qclear { width: 44px; height: 44px; right: 2px; }
body.is-phone .sp-time { min-height: 44px; min-width: 64px; font-size: 17px; padding: 0 12px; }
body.is-phone .sp-ev { gap: 10px; min-height: 44px; }
body.is-phone .sp-fchip { min-height: 40px; font-size: 14px; }
body.is-phone .sp-count { font-size: 14px; }

/* ---------------------------------------------------------------------
   Kiosk on-screen keyboard for the search field
   --------------------------------------------------------------------- */
.sp-kbd {
  position: fixed; z-index: 900;
  left: 50%; bottom: calc(var(--bnav-h) + var(--sumbar-h) + 16px); transform: translateX(-50%);
  width: min(1120px, calc(100vw - 32px)); padding: 14px;
  border-radius: var(--r-xl); background: var(--bar); border: 1px solid var(--line-3); box-shadow: var(--shadow);
}
body.is-landscape .sp-kbd { left: calc((100vw - var(--rcol-w)) / 2); width: min(1120px, calc(100vw - var(--rcol-w) - 48px)); }
.sp-kbd[hidden] { display: none; }
.sp-kbd-rows { display: flex; flex-direction: column; gap: 8px; }
.sp-kbd-row { display: flex; justify-content: center; gap: 8px; }
.sp-key {
  flex: 1 1 0; max-width: 92px; min-height: 64px; padding: 0;
  border: 1px solid var(--line-3); border-radius: var(--r); background: var(--tile); color: var(--ink);
  font-family: var(--cond); font-weight: 700; font-size: 28px; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
}
.sp-key:active { background: var(--tile-hover); transform: scale(.97); }
.sp-kbd-row--fn .sp-key { max-width: none; font-size: 22px; letter-spacing: .04em; }
.sp-key--del { flex: 1 1 0; }
.sp-key--space { flex: 3 1 0; }
.sp-key--done { flex: 1.4 1 0; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
body.sp-kbd-open #main { padding-bottom: 420px; }

/* =====================================================================
   Event detail (#/event/<id>) — refs 06 / 07
   ===================================================================== */
.ev { display: flex; flex-direction: column; gap: 14px; }
.ev-head {
  display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 18px;
  border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line);
}
.ev-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.ev-lg {
  margin: 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--cond); font-weight: 800; font-size: 28px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.1;
  color: var(--accent); text-align: center;
}
.ev-lg > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-when { display: inline-flex; align-items: center; gap: 8px; justify-self: end; font-size: 17px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.ev-when .bx-ic { color: var(--muted); }
.ev-teams { display: flex; flex-direction: column; gap: 4px; padding: 10px 4px 0; border-top: 1px solid var(--line); }
.ev-team { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.ev-tn { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--cond); font-weight: 700; font-size: 30px; line-height: 1.1; }
.ev-sc { min-width: 40px; text-align: right; font-family: var(--cond); font-weight: 800; font-size: 34px; color: var(--muted); }
.ev-sc.is-live { color: var(--accent); }

/* tabs: Märkte | Bet Builder (disabled) */
.ev-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ev-tab {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--bx-tap);
  border: 1px solid var(--line-3); border-radius: var(--r); background: var(--tile); color: var(--ink-2);
  font-family: var(--cond); font-weight: 700; font-size: 24px; letter-spacing: .04em;
}
.ev-tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ev-tab:disabled { cursor: not-allowed; color: var(--muted-2); background: var(--tile-off); border-color: var(--line); }
.ev-soon { font-size: 12px; padding: 2px 8px; background: var(--line-3); color: var(--ink-2); }

.ev-sus .bx-sus { width: 100%; }

/* accordion market groups */
.ev-groups { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.ev-grp + .ev-grp { border-top: 1px solid var(--line); }
.ev-gh {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: var(--bx-tap); padding: 0 18px;
  border: 0; background: var(--board-head); color: var(--ink); text-align: left; touch-action: manipulation;
}
.ev-gh:hover { background: var(--tile); }
.ev-gt { font-family: var(--cond); font-weight: 800; font-size: 24px; letter-spacing: .05em; text-transform: uppercase; }
.ev-gc { margin-left: auto; font-size: 15px; font-weight: 700; color: var(--muted); }
.ev-gh .bx-ic { color: var(--accent); transition: transform .18s var(--ease); transform: rotate(-90deg); }
.ev-grp.is-open .ev-gh .bx-ic { transform: none; }
.ev-gb { display: none; flex-direction: column; gap: 14px; padding: 14px 18px 18px; }
.ev-grp.is-open .ev-gb { display: flex; }
.ev-mk { display: flex; flex-direction: column; gap: 8px; }
.ev-mkn { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink-2); }
.ev-odds { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.ev-odd .k { color: var(--ink-2); font-size: 18px; }
.ev-odd.is-selected .k { color: #3B3000; }
.ev-odd .v { font-size: 28px; }

body.is-phone .ev { gap: 10px; }
body.is-phone .ev-head { padding: 10px 12px 12px; gap: 8px; }
body.is-phone .ev-top { grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
body.is-phone .ev-lg { justify-content: flex-start; font-size: 19px; gap: 8px; text-align: left; }
body.is-phone .ev-lg > span { white-space: normal; overflow: visible; }
body.is-phone .ev-lg .flag { width: 22px; height: auto; }
body.is-phone .ev-when { grid-column: 1 / -1; justify-self: start; font-size: 15px; }
body.is-phone .ev-tn { font-size: 22px; }
body.is-phone .ev-sc { font-size: 26px; }
body.is-phone .ev-team { min-height: 34px; }
body.is-phone .ev-tab { min-height: 48px; font-size: 20px; }
body.is-phone .ev-gh { min-height: 52px; padding: 0 12px; }
body.is-phone .ev-gt { font-size: 20px; }
body.is-phone .ev-gb { padding: 10px 10px 14px; gap: 12px; }
body.is-phone .ev-odd { min-height: 52px; padding: 0 10px; }
body.is-phone .ev-odd .k { font-size: 15px; }
body.is-phone .ev-odd .v { font-size: 22px; }
