/* Video variation, in the broadcast × game palette (navy + brass, Barlow). */
:root {
  --bg: #05070d;
  --ink: #f4f6fb;
  --muted: #8f9ab3;
  --faint: #56607a;
  --navy: #0b1328;
  --navy-2: #121c38;
  --navy-3: #1a2647;
  --line: #222d4a;
  --gold: #d2ae63;
  --gold-hi: #dfc183;
  --gold-lo: #8c6f33;
  --gold-ink: #231b08;
  --win: #4cc38a;
  --loss: #ff6b6b;

  --card: #f6f7fa;
  --spade: #12161c;
  --heart: #e0283a;
  --diamond: #2167e0;
  --club: #13994b;

  --cond: 'Barlow Condensed', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Barlow, system-ui, sans-serif;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 14px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--cond);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  clip-path: polygon(22% 12%, 88% 50%, 22% 88%);
}

.event {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.event-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-meta {
  color: var(--muted);
  font-size: 14px;
}

.trophy {
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: var(--gold-ink);
  font-family: var(--cond);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trophy[hidden] {
  display: none;
}

/* ---------- Layout ---------- */

.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 28px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 28px;
}

.primary {
  min-width: 0;
}

/* ---------- Player ---------- */

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 0 0 1px var(--line), 0 20px 50px rgba(0, 0, 0, 0.5);
}

.player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player.idle {
  cursor: none;
}

video::cue {
  font-family: Barlow, system-ui, sans-serif;
  font-size: 0.9em;
  background: rgba(5, 7, 13, 0.78);
  color: #fff;
}

.big-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: var(--gold-ink);
  box-shadow: 0 4px 0 var(--gold-lo), 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s, transform 0.2s;
}

.big-play svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
  fill: currentColor;
}

.player.playing .big-play {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.85);
}

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 14px 10px;
  background: linear-gradient(transparent, rgba(5, 7, 13, 0.92));
  transition: opacity 0.25s;
}

.player.idle .controls {
  opacity: 0;
}

/* Timeline with street chapter marks */
.timeline {
  position: relative;
  padding: 14px 0 8px;
  cursor: pointer;
  touch-action: none;
}

.tl-track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: height 0.15s;
}

.timeline:hover .tl-track,
.timeline.scrubbing .tl-track {
  height: 7px;
}

.tl-track > * {
  position: absolute;
  top: 0;
  bottom: 0;
}

.tl-buffered {
  left: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.tl-played {
  left: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold));
}

.tl-chapters {
  left: 0;
  right: 0;
}

.tl-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  margin-left: -1.5px;
  background: rgba(5, 7, 13, 0.9);
}

.tl-mark:first-child {
  background: none;
}

.tl-label {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 4px;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.tl-knob {
  left: 0;
  top: 50% !important;
  bottom: auto !important;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--gold-hi);
  box-shadow: 0 0 0 3px rgba(5, 7, 13, 0.6);
}

.bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ctl {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: none;
}

.ctl:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ctl svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ctl.play .i-pause,
.ctl.play.playing .i-play {
  display: none;
}

.ctl.play.playing .i-pause {
  display: block;
}

.ctl.text {
  width: auto;
  padding: 0 10px;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ctl.text.on {
  color: var(--gold-hi);
}

#speed {
  color: var(--ink);
}

.time {
  margin-left: 6px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.chapter-now {
  margin-left: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(210, 174, 99, 0.18);
  color: var(--gold-hi);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spacer {
  flex: 1;
}

/* Up next */
.up-next {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: min(90%, 420px);
  padding: 18px 22px 20px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(180deg, rgba(20, 30, 60, 0.97), rgba(6, 10, 22, 0.97));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.up-next[hidden] {
  display: none;
}

.up-next-label {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.up-next-title {
  margin: 6px 0 16px;
  font-weight: 600;
  font-size: 19px;
}

.up-next-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--navy-3), var(--navy));
  box-shadow: 0 3px 0 #03060e;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn.primary {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: var(--gold-ink);
  box-shadow: 0 3px 0 var(--gold-lo);
}

/* ---------- Cards ---------- */

.card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 7;
  border-radius: 5px;
  background: linear-gradient(180deg, #fff, var(--card));
  font-family: var(--cond);
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.card .suit {
  font-size: 0.85em;
}

.card.suit-s {
  color: var(--spade);
}
.card.suit-h {
  color: var(--heart);
}
.card.suit-d {
  color: var(--diamond);
}
.card.suit-c {
  color: var(--club);
}

.card.tile-card {
  width: 34px;
  font-size: 17px;
}

.card.mini {
  width: 19px;
  font-size: 11px;
  border-radius: 3px;
  box-shadow: none;
}

/* ---------- Hand info ---------- */

.hand-head {
  margin: 20px 0 14px;
}

.title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.2;
}

.meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

/* Street chapters: also the board, street by street */
.streets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.street {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  box-shadow: 0 3px 0 #03060e;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}

.street:hover {
  transform: translateY(-2px);
  border-color: var(--muted);
}

.street.active {
  border-color: var(--gold);
  box-shadow: 0 3px 0 var(--gold-lo), 0 0 16px color-mix(in srgb, var(--gold) 14%, transparent);
}

.street-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.street-name {
  font-family: var(--cond);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.street.active .street-name {
  color: var(--gold-hi);
}

.street-time {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}

.street-cards {
  display: flex;
  gap: 4px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--navy);
  border: 1px solid var(--line);
}

.fact-label {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-value {
  font-weight: 600;
  font-size: 16px;
}

.fact.win .fact-value {
  color: var(--win);
}

.fact.loss .fact-value {
  color: var(--loss);
}

.fact.allin .fact-value {
  color: var(--gold-hi);
}

.showdown {
  display: flex;
  gap: 12px;
}

.vs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.vs-pos {
  margin-right: 4px;
  font-family: var(--cond);
  font-weight: 700;
  color: var(--muted);
}

/* ---------- Playlist ---------- */

.playlist {
  align-self: start;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  border: 1px solid var(--line);
}

.playlist-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 2px 2px 12px;
}

.playlist h2 {
  margin: 0;
  font-family: var(--cond);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.playlist-sub {
  font-size: 13px;
  color: var(--muted);
}

.autoplay {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.autoplay input {
  accent-color: var(--gold);
}

.items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-button {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  text-align: left;
}

.item-button:hover {
  background: rgba(255, 255, 255, 0.04);
}

.item.current .item-button {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  background: rgba(210, 174, 99, 0.06);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-time,
.thumb-result {
  position: absolute;
  padding: 0 5px;
  border-radius: 4px;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 12px;
}

.thumb-time {
  right: 5px;
  bottom: 5px;
  background: rgba(0, 0, 0, 0.8);
}

.thumb-result {
  left: 5px;
  top: 5px;
  background: rgba(0, 0, 0, 0.8);
}

.thumb-result.win {
  color: var(--win);
}

.thumb-result.loss {
  color: var(--loss);
}

.item-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.item-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.item-meta span:first-child {
  margin-right: 5px;
}

.item-now {
  display: none;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.item.current .item-now {
  display: block;
}

/* ---------- Footer ---------- */

.hints {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  max-width: 1500px;
  margin: 28px auto 0;
  padding: 14px 28px 28px;
  font-size: 12px;
  color: var(--faint);
}

kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 1px 6px;
  margin-right: 3px;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--navy);
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Tablet & phone ---------- */

@media (max-width: 960px) {
  .topbar {
    padding: 10px 14px;
  }

  .watch {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 0;
  }

  /* Video stays on screen while scrolling the hand info and playlist:
     the primary column dissolves so the player's sticky area is the whole page. */
  .primary {
    display: contents;
  }

  .watch {
    row-gap: 0;
  }

  .streets,
  .facts {
    margin-bottom: 0;
  }

  .playlist {
    margin-top: 22px !important;
  }

  .player {
    position: sticky;
    top: 0;
    z-index: 5;
    border-radius: 0;
  }

  .hand-head,
  .streets,
  .facts {
    margin-left: 14px;
    margin-right: 14px;
  }

  .playlist {
    margin: 0 14px;
  }

  .hints {
    display: none;
  }
}

@media (max-width: 560px) {
  .event-meta,
  .chapter-now,
  .ctl[data-cmd='prev-chapter'],
  .ctl[data-cmd='next-chapter'] {
    display: none;
  }

  .controls {
    padding: 22px 6px 4px;
  }

  .ctl {
    width: 34px;
    height: 34px;
  }

  .big-play {
    width: 62px;
    height: 62px;
  }

  .streets {
    gap: 6px;
  }

  .street {
    padding: 8px 6px 8px;
    gap: 7px;
  }

  .street-head {
    flex-direction: column;
    gap: 1px;
  }

  .street-name {
    font-size: 13px;
  }

  .street-cards {
    gap: 2px;
  }

  .card.tile-card {
    width: 22px;
    font-size: 12px;
    border-radius: 3px;
  }

  .fact {
    padding: 6px 10px;
  }

  .fact-value {
    font-size: 14px;
  }

  .item-button {
    grid-template-columns: 124px minmax(0, 1fr);
  }
}
