/**
 * Live games directory — Twitch Browse layout, WNDR brand.
 * Pattern: title → filters → dense 16:9 cards → natural page scroll.
 */

.live-shell,
.live-page .live-shell {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px 56px;
  box-sizing: border-box;
}

/* —— Header —— */
.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.live-head-text {
  min-width: 0;
  flex: 1;
}

.live-head h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
}

.live-head p {
  margin: 8px 0 0;
  max-width: 48ch;
  font-size: 14px;
  line-height: 1.4;
  color: #8fa3b3;
}

.live-go-live {
  appearance: none;
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font: 800 13px/1 inherit;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-go-live:hover {
  filter: brightness(1.08);
}

/* —— Guest banner —— */
.live-guest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #243542;
  background: #0c1620;
}

.live-guest-banner strong {
  display: block;
  color: #e8f1f7;
  font-size: 14px;
}

.live-guest-banner p {
  margin: 4px 0 0;
  color: #8fa3b3;
  font-size: 13px;
  line-height: 1.35;
}

.live-guest-cta,
.live-enter-signin {
  appearance: none;
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #14b8a6;
  color: #041513;
  font: 800 13px/1 inherit;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-guest-cta:hover,
.live-enter-signin:hover {
  filter: brightness(1.06);
}

/* —— Filters (Twitch-style toolbar) —— */
.live-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 20px 0 18px;
  padding-bottom: 4px;
}

.live-search,
.live-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid #2a3b47;
  border-radius: 8px;
  background: #0c1620;
  color: #c5d4df;
}

.live-search {
  flex: 1 1 220px;
  max-width: 320px;
}

.live-search > i,
.live-select > i {
  position: absolute;
  left: 12px;
  color: #6f8596;
  font-size: 13px;
  pointer-events: none;
}

.live-search input {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #e8f1f7;
  padding: 0 12px 0 34px;
  font: inherit;
  outline: none;
}

.live-search input::placeholder {
  color: #6f8596;
}

.live-select {
  flex: 0 1 180px;
  padding-right: 8px;
}

.live-select select {
  appearance: none;
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238fa3b3' fill='none' stroke-width='1.5'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  color: #e8f1f7;
  padding: 0 28px 0 34px;
  font: 600 13px/1 inherit;
  cursor: pointer;
  outline: none;
}

.live-select select option {
  background: #0c1620;
  color: #e8f1f7;
}

.live-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: #0c1620;
  border: 1px solid #243542;
}

.live-tabs button {
  appearance: none;
  border: 0;
  border-radius: 6px;
  min-height: 32px;
  padding: 0 12px;
  background: transparent;
  color: #9eb3c2;
  font: 700 13px/1 inherit;
  cursor: pointer;
}

.live-tabs button[aria-selected="true"] {
  background: #14b8a6;
  color: #041513;
}

.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: #d7e3ec;
  font: 600 13px/1 inherit;
  cursor: pointer;
  user-select: none;
}

.live-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.live-toggle-ui {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #243542;
  position: relative;
  flex: 0 0 40px;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.live-toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8f1f7;
  transition: transform 0.15s ease;
}

.live-toggle input:checked + .live-toggle-ui {
  background: #14b8a6;
}

.live-toggle input:checked + .live-toggle-ui::after {
  transform: translateX(18px);
}

.live-status {
  margin: 20px 0;
  color: #8fa3b3;
  font-size: 14px;
}

/* —— Twitch-style card grid —— */
.live-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 12px;
}

.live-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  transition: none;
}

.live-card:hover {
  transform: none;
  border-color: transparent;
}

.live-card:hover .live-card-media {
  outline: 2px solid #14b8a6;
  outline-offset: 0;
}

.live-card:hover .live-card-title {
  color: #14b8a6;
}

.live-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #081018;
  overflow: hidden;
}

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

.live-badge-live,
.live-badge-idle {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font: 800 11px/1 inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-badge-live {
  background: #eb0400;
  color: #fff;
}

.live-badge-live::before {
  content: none;
}

.live-badge-idle {
  background: rgba(0, 0, 0, 0.65);
  color: #e8f1f7;
}

.live-viewers,
.live-players {
  position: absolute;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font: 700 12px/1 inherit;
  backdrop-filter: none;
}

.live-viewers {
  left: 8px;
  top: auto;
  right: auto;
}

.live-players {
  right: 8px;
  top: auto;
}

/* Meta row under thumb — Twitch avatar + text */
.live-card-meta {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.live-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #12202a;
  flex-shrink: 0;
}

.live-card-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #efeff1;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-card-user,
.live-card-game {
  margin: 0;
  font-size: 13px;
  color: #adadb8;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  min-height: 0;
}

.live-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #1f1f23;
  color: #adadb8;
  font: 600 11px/1 inherit;
}

.live-tag-interact {
  background: rgba(20, 184, 166, 0.15);
  color: #5eead4;
}

/* Legacy class hooks (unused in new cards, keep harmless) */
.live-card-body,
.live-card-foot,
.live-host,
.live-host-meta,
.live-role,
.live-enter,
.live-interact {
  /* no-op leftovers safe if old HTML cached */
}

@media (max-width: 1200px) {
  .live-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .live-shell,
  .live-page .live-shell {
    padding: 8px 12px 40px;
  }

  .live-head {
    align-items: stretch;
    flex-direction: column;
  }

  .live-go-live {
    width: 100%;
    min-height: 44px;
  }

  .live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .live-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .live-search,
  .live-select,
  .live-tabs {
    max-width: none;
    width: 100%;
    flex: none;
  }

  .live-tabs {
    display: flex;
  }

  .live-tabs button {
    flex: 1;
    min-height: 40px;
  }

  .live-toggle {
    margin-left: 0;
    width: 100%;
    min-height: 44px;
  }

  .live-search,
  .live-select {
    font-size: 16px;
    min-height: 44px;
  }

  .live-guest-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .live-guest-cta {
    justify-content: center;
    min-height: 44px;
  }

  .live-card-avatar {
    width: 36px;
    height: 36px;
  }

  .live-card-meta {
    grid-template-columns: 36px minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .live-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .live-card-title {
    -webkit-line-clamp: 2;
  }
}
