.xmltv-twitch-page { max-width: 1200px; margin: 0 auto 40px; padding: 0 16px; box-sizing: border-box; }
.xmltv-twitch-page .xmltv-channel-page-title { text-align: center; margin-bottom: 20px; }
.xmltv-twitch-page .xmltv-channel-page-title h1 {
  margin: 0 0 8px; font-size: clamp(24px, 4vw, 30px); font-weight: 800;
  background: linear-gradient(105deg, #9146ff 0%, #772ce8 50%, #b71c1c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.xmltv-twitch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.xmltv-twitch-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.xmltv-twitch-card {
  display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden;
  background: var(--xmltv-card, #fff);
  border: 1px solid var(--xmltv-border, #e2e8f0);
  box-shadow: 0 6px 18px rgba(0,0,0,.07);
  transition: transform .15s ease, box-shadow .15s ease;
}
.xmltv-twitch-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(145,70,255,.2); }
.xmltv-twitch-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: #0e0e10 center/cover no-repeat;
  text-decoration: none;
}
.xmltv-twitch-live {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: #e91916; color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .04em; box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.xmltv-twitch-live-inline { position: static; box-shadow: none; }
.xmltv-twitch-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: xmltv-tw-pulse 1.3s ease-in-out infinite;
}
@keyframes xmltv-tw-pulse {
  0%,100% { opacity: 1; } 50% { opacity: .45; }
}
.xmltv-twitch-viewers {
  position: absolute; bottom: 10px; left: 10px;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 600;
}
.xmltv-twitch-meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.xmltv-twitch-name {
  font-size: 16px; font-weight: 800; color: var(--xmltv-text, #1a2233);
  text-decoration: none; line-height: 1.25;
}
.xmltv-twitch-name:hover { color: #9146ff; }
.xmltv-twitch-title {
  font-size: 13px; font-weight: 600; color: var(--xmltv-muted, #6b7684);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.xmltv-twitch-game { font-size: 12px; font-weight: 700; color: #9146ff; }
.xmltv-twitch-btn {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; padding: 8px 14px; border-radius: 999px;
  background: #9146ff; color: #fff !important; font-size: 13px; font-weight: 800;
  text-decoration: none !important;
}
.xmltv-twitch-btn:hover { background: #772ce8; }
.xmltv-twitch-empty {
  text-align: center; padding: 24px 12px; color: var(--xmltv-muted, #6b7684); font-size: 15px;
}
.xmltv-twitch-box { margin: 24px 0 32px; }
.xmltv-twitch-box-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px;
}
.xmltv-twitch-box-title {
  margin: 0; font-size: 20px; font-weight: 800; display: inline-flex; align-items: center; gap: 10px;
}
.xmltv-twitch-box-more { font-size: 14px; font-weight: 700; color: #9146ff; text-decoration: none; }
.xmltv-theme-dark .xmltv-twitch-card { background: var(--xmltv-card, #1a2332); border-color: var(--xmltv-border, #2a3548); }
.xmltv-theme-dark .xmltv-twitch-name { color: var(--xmltv-text, #e8eef7); }


.xmltv-twitch-thumb {
  border: none; cursor: pointer; width: 100%; padding: 0; text-align: left;
}
.xmltv-twitch-play-hint {
  position: absolute; right: 10px; bottom: 10px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(145, 70, 255, .92); color: #fff;
  font-size: 12px; font-weight: 800;
  opacity: 0; transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.xmltv-twitch-card:hover .xmltv-twitch-play-hint { opacity: 1; transform: none; }
.xmltv-twitch-name {
  background: none; border: none; padding: 0; cursor: pointer;
  text-align: left; font: inherit; font-size: 16px; font-weight: 800;
  color: var(--xmltv-text, #1a2233);
}
.xmltv-twitch-name:hover { color: #9146ff; }
.xmltv-twitch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.xmltv-twitch-btn { cursor: pointer; border: none; }
.xmltv-twitch-btn--ghost {
  background: transparent !important; color: #9146ff !important;
  border: 1px solid rgba(145,70,255,.4) !important;
}

/* Modal player */
.xmltv-twitch-modal[hidden] { display: none !important; }
.xmltv-twitch-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.xmltv-twitch-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.72);
}
.xmltv-twitch-modal-dialog {
  position: relative; z-index: 1;
  width: min(960px, 100%);
  background: #0e0e10; border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.xmltv-twitch-modal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: #18181b; color: #fff;
}
.xmltv-twitch-modal-title { font-size: 15px; font-weight: 700; }
.xmltv-twitch-modal-bar-actions { display: flex; align-items: center; gap: 10px; }
.xmltv-twitch-modal-ext { color: #bf94ff; font-size: 13px; font-weight: 700; text-decoration: none; }
.xmltv-twitch-modal-close {
  width: 36px; height: 36px; border: none; border-radius: 8px;
  background: #2a2a2e; color: #fff; font-size: 22px; cursor: pointer; line-height: 1;
}
.xmltv-twitch-modal-player { position: relative; height: 0; padding-bottom: 56.25%; background: #000; }
.xmltv-twitch-modal-player iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
@media (max-width: 560px) {
  .xmltv-twitch-modal { padding: 0; align-items: flex-end; }
  .xmltv-twitch-modal-dialog { width: 100%; border-radius: 16px 16px 0 0; }
}
