/* ─────────────────────────────────────────────────────────────────────────
   Livestream — dark, video-first module. Scoped under #lsw so none of this
   leaks into the surrounding light Bootstrap/Poppins site chrome. The live
   widgets (now/next, watchlist, auto-switch) mirror the CPH Open app.
   ───────────────────────────────────────────────────────────────────────── */

#lsw, .lsw-landing {
  --lsw-bg:      #0f1218;
  --lsw-surface: #171b23;
  --lsw-card:    #1e232d;
  --lsw-border:  #2a303c;
  --lsw-text:    #f2f4f8;
  --lsw-muted:   #97a1b2;
  --lsw-red:     #d80c18;
  --lsw-green:   #2ecc71;
  --lsw-amber:   #f5a623;
  --lsw-blue:    #4a9eff;
  color: var(--lsw-text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#lsw {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 0 0 40px;
}
#lsw.lsw-has-side { grid-template-columns: 1fr; }
@media (min-width: 992px) {
  #lsw.lsw-has-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
}

#lsw *, #lsw *::before, #lsw *::after,
.lsw-landing *, .lsw-landing *::before, .lsw-landing *::after { box-sizing: border-box; }
#lsw .lsw-hidden, .lsw-landing .lsw-hidden { display: none !important; }

/* ── main column ── */
.lsw-main {
  background: var(--lsw-bg);
  border: 1px solid var(--lsw-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
}

.lsw-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--lsw-border);
  background: var(--lsw-surface);
}
.lsw-days { display: inline-flex; gap: 4px; background: var(--lsw-card); padding: 4px; border-radius: 12px; }
.lsw-day {
  border: 0; background: none; color: var(--lsw-muted);
  font-family: inherit; font-size: .82rem; font-weight: 600; letter-spacing: .01em;
  padding: 7px 16px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s;
}
.lsw-day.active { background: var(--lsw-red); color: #fff; }

.lsw-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; color: var(--lsw-red);
}
.lsw-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--lsw-red); animation: lsw-pulse 1.2s infinite; }
@keyframes lsw-pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.lsw-year {
  margin-left: auto;
  background: var(--lsw-card); color: var(--lsw-text);
  border: 1px solid var(--lsw-border); border-radius: 10px;
  font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: 7px 30px 7px 12px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath fill='%2397a1b2' d='M5 7 0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}

.lsw-mats { display: flex; gap: 8px; padding: 12px 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--lsw-border); }
.lsw-mats::-webkit-scrollbar { display: none; }
.lsw-mat {
  flex-shrink: 0; border: 1px solid var(--lsw-border); background: var(--lsw-card);
  color: var(--lsw-muted); font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: 8px 18px; border-radius: 22px; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.lsw-mat:hover { color: var(--lsw-text); }
.lsw-mat.active { background: var(--lsw-red); border-color: var(--lsw-red); color: #fff; }

.lsw-player { position: relative; width: 100%; padding-bottom: 56.25%; background: #000; }
.lsw-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* our own idle frame: the mat and the day, and nothing competing with them */
.lsw-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: grid; place-items: center; gap: 0; cursor: pointer;
  border: 0; padding: 0; font-family: inherit; text-align: center;
  background:
    radial-gradient(120% 90% at 50% 8%, rgba(216, 12, 24, .22), transparent 60%),
    linear-gradient(160deg, #1a1f29 0%, #0c0f14 70%);
}
.lsw-poster-mid { display: grid; gap: 5px; padding: 0 20px 76px; }
.lsw-poster-eyebrow { color: var(--lsw-muted); font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.lsw-poster-t { color: var(--lsw-text); font-size: clamp(1.5rem, 4.6vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.lsw-poster-d { color: var(--lsw-muted); font-size: .84rem; font-weight: 600; }
.lsw-poster-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, calc(-50% + 34px));
  width: 62px; height: 62px; border-radius: 50%; background: var(--lsw-red);
  box-shadow: 0 10px 30px rgba(216, 12, 24, .38);
  transition: transform .14s, box-shadow .14s;
}
.lsw-poster-play::after {
  content: ''; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff;
}
.lsw-poster:hover .lsw-poster-play { transform: translate(-50%, calc(-50% + 34px)) scale(1.06); box-shadow: 0 14px 36px rgba(216, 12, 24, .5); }
.lsw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lsw-player-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--lsw-muted); font-size: .9rem; text-align: center; padding: 20px;
}

/* ── now / next on the viewed mat ── */
.lsw-info { background: var(--lsw-surface); }
.lsw-info-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--lsw-border); }
.lsw-info-row:first-child { border-top: 0; }
.lsw-tag {
  flex-shrink: 0; width: 46px; text-align: center;
  font-size: .56rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 5px 0; border-radius: 6px;
}
.lsw-tag.now  { color: var(--lsw-green); box-shadow: inset 0 0 0 1px rgba(46,204,113,.35); background: rgba(46,204,113,.1); }
.lsw-tag.next { color: var(--lsw-muted); box-shadow: inset 0 0 0 1px var(--lsw-border); }
.lsw-vs  { font-size: .9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsw-vs .x { color: var(--lsw-muted); font-weight: 600; margin: 0 3px; }
.lsw-cat { font-size: .72rem; color: var(--lsw-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsw-info-mid { min-width: 0; flex: 1; }
.lsw-info-empty { padding: 14px 16px; color: var(--lsw-muted); font-size: .82rem; }

/* ── watchlist side panel ── */
.lsw-side { display: flex; flex-direction: column; }
.lsw-watch, .lsw-find {
  background: var(--lsw-bg); border: 1px solid var(--lsw-border);
  border-radius: 18px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
}
.lsw-watch-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--lsw-border); background: var(--lsw-surface);
}
.lsw-watch-head .t { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--lsw-muted); }

.lsw-auto { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; font-family: inherit; font-size: .68rem; font-weight: 700; color: var(--lsw-muted); cursor: pointer; }
.lsw-auto.on { color: var(--lsw-green); }
.lsw-auto-tog { width: 36px; height: 21px; border-radius: 999px; background: var(--lsw-border); position: relative; transition: background .15s; flex-shrink: 0; }
.lsw-auto.on .lsw-auto-tog { background: var(--lsw-green); }
.lsw-auto-tog .k { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.lsw-auto.on .lsw-auto-tog .k { left: 17px; }

/* search / add */
.lsw-search { padding: 12px 14px; border-bottom: 1px solid var(--lsw-border); }
.lsw-tabs { display: inline-flex; gap: 4px; background: var(--lsw-card); padding: 3px; border-radius: 9px; margin-bottom: 10px; }
.lsw-tab { border: 0; background: none; color: var(--lsw-muted); font-family: inherit; font-size: .74rem; font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.lsw-tab.active { background: var(--lsw-red); color: #fff; }
.lsw-input {
  width: 100%; background: var(--lsw-card); border: 1px solid var(--lsw-border); border-radius: 10px;
  color: var(--lsw-text); font-family: inherit; font-size: .86rem; padding: 10px 12px; outline: none;
}
.lsw-input::placeholder { color: var(--lsw-muted); }
.lsw-input:focus { border-color: var(--lsw-red); }
.lsw-results {
  margin-top: 8px; max-height: 260px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--lsw-border) transparent;
}
.lsw-results::-webkit-scrollbar { width: 8px; }
.lsw-results::-webkit-scrollbar-track { background: transparent; }
.lsw-results::-webkit-scrollbar-thumb { background: var(--lsw-border); border-radius: 999px; }
.lsw-results::-webkit-scrollbar-thumb:hover { background: #3a4252; }
.lsw-res { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 9px; cursor: pointer; }
.lsw-res:hover { background: var(--lsw-card); }
.lsw-res.added { opacity: .62; }
.lsw-res-flag { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.lsw-res-main { flex: 1; min-width: 0; }
.lsw-res-name { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsw-res-sub { font-size: .7rem; color: var(--lsw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsw-res-add { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--lsw-card); color: var(--lsw-text); font-size: 1rem; font-weight: 700; }
.lsw-res.added .lsw-res-add { background: var(--lsw-green); color: #fff; }
.lsw-empty { padding: 12px 6px; color: var(--lsw-muted); font-size: .78rem; text-align: center; }

.lsw-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 0; }
.lsw-chips:empty { display: none; }
.lsw-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--lsw-card); border: 1px solid var(--lsw-border); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: .74rem; font-weight: 600; }
.lsw-chip.club { border-style: dashed; }
.lsw-chip button { border: 0; background: none; color: var(--lsw-muted); cursor: pointer; font-size: .8rem; line-height: 1; padding: 2px; }
.lsw-chip button:hover { color: var(--lsw-red); }

/* ── fight search: full-width row under the player, click a fight to seek ── */
.lsw-find { grid-column: 1 / -1; }
.lsw-find .lsw-search { border-bottom: 0; padding: 14px 16px 16px; }
.lsw-find .lsw-input { max-width: 380px; }
/* The hint sits beside the field rather than alone in the middle of a wide card. */
.lsw-find-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lsw-find-hint { flex: 1; min-width: 220px; margin: 0; color: var(--lsw-muted); font-size: .78rem; }
.lsw-fresults:empty { display: none; }
.lsw-landing .lsw-find { margin: 0; }
.lsw-landing .lsw-find .lsw-search { padding: 16px 18px; }
.lsw-find-more {
  margin-left: 6px; border: 0; background: var(--lsw-blue); color: #06121f;
  font-family: inherit; font-size: .68rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.lsw-find-more:hover { filter: brightness(1.1); }
.lsw-fmorebar .lsw-find-more { margin-left: 0; font-size: .72rem; padding: 7px 16px; }
/* Wide as the player, so hits go side by side instead of down a narrow well. */
.lsw-fresults {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 2px 12px; max-height: none; overflow: visible;
}
.lsw-fmorebar { grid-column: 1 / -1; padding: 10px 6px 2px; }
.lsw-fresults .lsw-empty { grid-column: 1 / -1; }
.lsw-find-note {
  margin-top: 8px; padding: 7px 10px; border-radius: 8px;
  background: rgba(74, 158, 255, .1); box-shadow: inset 0 0 0 1px rgba(74, 158, 255, .28);
  color: var(--lsw-blue); font-size: .7rem; font-weight: 600;
}
.lsw-fres {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; border-radius: 9px; cursor: pointer;
}
.lsw-fres:hover { background: var(--lsw-card); }
.lsw-fres.playing { background: rgba(216, 12, 24, .12); box-shadow: inset 0 0 0 1px rgba(216, 12, 24, .4); }
.lsw-fts {
  flex-shrink: 0; min-width: 52px; text-align: center;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: .72rem; font-weight: 700; color: var(--lsw-text);
  background: var(--lsw-card); border-radius: 7px; padding: 5px 6px;
}
.lsw-fres.playing .lsw-fts { background: var(--lsw-red); color: #fff; }
.lsw-fmid { flex: 1; min-width: 0; }
.lsw-fname {
  font-size: .82rem; font-weight: 600; line-height: 1.32;
  white-space: normal; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.lsw-fname .x { color: var(--lsw-muted); font-weight: 600; margin: 0 5px; font-size: .72rem; }
.lsw-fsub { font-size: .69rem; color: var(--lsw-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsw-fgo { flex-shrink: 0; color: var(--lsw-muted); font-size: .8rem; }
.lsw-fres:hover .lsw-fgo { color: var(--lsw-red); }

/* on-the-mats strip */
.lsw-strip { padding: 8px 6px 12px; }
.lsw-strip-h { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--lsw-muted); padding: 8px 10px 6px; }
.lsw-wrow { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 11px; cursor: pointer; }
.lsw-wrow:hover { background: var(--lsw-card); }
.lsw-wdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lsw-wdot.now  { background: var(--lsw-green); box-shadow: 0 0 0 3px rgba(46,204,113,.2); }
.lsw-wdot.soon { background: var(--lsw-amber); }
.lsw-wmid { flex: 1; min-width: 0; }
.lsw-wname { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsw-wsub { font-size: .7rem; color: var(--lsw-muted); margin-top: 1px; }
.lsw-wmat { flex-shrink: 0; font-size: .72rem; font-weight: 800; color: var(--lsw-blue); }
.lsw-warr { flex-shrink: 0; color: var(--lsw-muted); font-size: 1.05rem; }
.lsw-strip-empty { padding: 14px 10px; color: var(--lsw-muted); font-size: .78rem; text-align: center; }

/* toast */
.lsw-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(10px);
  background: #f2f4f8; color: #10131a; font-size: .84rem; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 8px 26px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 9998;
  max-width: 90%; text-align: center;
}
.lsw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.lsw-spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--lsw-border); border-top-color: var(--lsw-red); border-radius: 50%; animation: lsw-spin .7s linear infinite; }
@keyframes lsw-spin { to { transform: rotate(360deg); } }

/* ── landing (/livestream) ── */
.lsw-landing { margin: 0 0 40px; }
.lsw-cta-card {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, #1a1f29 0%, #12151c 60%);
  border: 1px solid var(--lsw-border); border-radius: 18px;
  padding: 26px 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
  position: relative; overflow: hidden;
}
.lsw-cta-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--lsw-red);
}
.lsw-cta-main { flex: 1; min-width: 240px; }
.lsw-cta-main h2 { color: var(--lsw-text); font-size: 1.5rem; font-weight: 700; margin: 6px 0 6px; }
.lsw-cta-main p { color: var(--lsw-muted); font-size: .92rem; margin: 0; max-width: 46ch; }
.lsw-cta {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  background: var(--lsw-red); color: #fff; text-decoration: none;
  font-weight: 700; font-size: .95rem; padding: 13px 26px; border-radius: 12px;
  transition: transform .12s, box-shadow .12s;
}
.lsw-cta:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(216, 12, 24, .35); }
.lsw-cta.upcoming { background: var(--lsw-card); border: 1px solid var(--lsw-border); }

.lsw-years-h { color: var(--lsw-text); font-size: 1.05rem; font-weight: 700; margin: 34px 0 14px; }
.lsw-years { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.lsw-yearcard {
  display: grid; gap: 3px; align-content: start;
  background: var(--lsw-surface); border: 1px solid var(--lsw-border); border-radius: 14px;
  padding: 20px; text-decoration: none;
  transition: border-color .12s, transform .12s, background .12s;
}
.lsw-yearcard:hover { border-color: var(--lsw-red); transform: translateY(-2px); background: var(--lsw-card); }
.lsw-yearcard .y { color: var(--lsw-text); font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.lsw-yearcard .meta { color: var(--lsw-muted); font-size: .74rem; font-weight: 500; }
.lsw-yearcard .go { color: var(--lsw-muted); font-size: .78rem; font-weight: 700; margin-top: 12px; }
.lsw-yearcard:hover .go { color: var(--lsw-red); }
.lsw-years-empty { color: var(--lsw-muted); font-size: .9rem; }

/* ── phones ───────────────────────────────────────────────────────────────
   The shell these pages borrow is built for prose: a tall hero, then a section
   starting 56px below it. On a phone that buries the video under a band of
   empty page. The two pages want opposite fixes, though.

   The year page is a player: hero, bar, video and search become ONE dark
   region running edge to edge, with hairlines instead of gaps — a light stripe
   between two dark slabs is worse than the inset card it replaced. Their inner
   padding stays at the page's own --pad, so every left edge still lines up
   with the hero above.

   The landing page is a directory: cards on a light page, separated by
   headings. It keeps its cards and only loses the excess air above them.
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .page-hero-lsw { padding-bottom: 30px; }
  .page-hero-lsw p { font-size: .98rem; margin-top: 12px; }

  /* Now that the page itself is dark, a gap is breathing room rather than the
     light stripe it used to be — so the blocks get their spacing back. */
  .sec-lsw { padding-block: 20px 46px; }
  #lsw { gap: 16px; margin-bottom: 0; }
  #lsw .lsw-main, #lsw .lsw-find, #lsw .lsw-watch {
    border-radius: 0; border-left: 0; border-right: 0;
    margin-inline: calc(var(--pad) * -1);
    box-shadow: none;
  }
  #lsw .lsw-main { border-top: 0; }
  #lsw .lsw-find, #lsw .lsw-watch { border-top: 1px solid var(--lsw-border); }
  #lsw .lsw-bar, #lsw .lsw-mats, #lsw .lsw-watch-head,
  #lsw .lsw-search, #lsw .lsw-info-row, #lsw .lsw-chips { padding-inline: var(--pad); }
  #lsw .lsw-bar { padding-block: 13px; }
  #lsw .lsw-mats { padding-block: 13px; gap: 9px; }
  #lsw .lsw-search { padding-block: 16px 18px; }
  #lsw .lsw-watch-head { padding-block: 15px; }

  /* landing page — still cards, just less air */
  .sec-lsw-fp { padding-block: 32px 46px; }
  .lsw-landing .lsw-years-h { margin-top: 32px; }
  .lsw-years { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .lsw-yearcard { padding: 16px; }
  .lsw-yearcard .y { font-size: 1.35rem; }
  .lsw-yearcard .go { margin-top: 8px; }

  /* both */
  .lsw-bar { gap: 10px; }
  .lsw-day { padding: 7px 15px; }
  .lsw-mats { flex-wrap: wrap; overflow: visible; }
  .lsw-mat { padding: 7px 16px; }
  .lsw-year { padding: 7px 28px 7px 12px; }
  .lsw-find .lsw-input { max-width: none; }
  .lsw-find-hint { font-size: .74rem; }
}

/* A mat sliced in half at the edge reads as broken; the CSS fades it instead,
   but only while there is in fact something past the edge. */
.lsw-mats.lsw-scrollable {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
}
