/* =====================================================
   Twitch Stream Board (TSB)
   Base styles (shared by Cards + Tabs layouts)
   ===================================================== */

#tsb-wrapper {
  width: 100%;
  max-width: 100%;
}

#tsb-wrapper * {
  box-sizing: border-box;
}

#tsb-wrapper iframe {
  display: block;
  border: none;
}

/* =====================================================
   LANGUAGE FILTER TABS (ALL / EN / PL)
   ===================================================== */

.tsb-lang-tabs {
  display: flex;
  gap: 10px;
  align-items: center;

  padding: 10px 12px;

  background: rgba(6,22,45,0.7);
  border: 1px solid #0d2a52;
  /* border-radius: 14px; */

  /* margin-bottom: 10px; */
}

.tsb-lang-btn {
  appearance: none;
  border: 1px solid #12335f;
  background: rgba(11, 42, 85, 0.25);
  color: #cfe2ff;

  padding: 8px 12px;
  border-radius: 999px;

  font-weight: 600;
  letter-spacing: 0.2px;

  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.tsb-lang-btn:hover {
  background: rgba(11, 42, 85, 0.45);
  border-color: #215fae;
}

.tsb-lang-btn.is-active {
  background: rgba(33, 95, 174, 0.35);
  border-color: #2f80ff;
}

/* =====================================================
   BOARD (SHARED)
   ===================================================== */

#tsb-board.tsb-board,
#tsb-board {
  padding: 12px;

  background: rgba(6,22,45,0.7);
  border: 1px solid #0d2a52;
  /* border-radius: 14px; */

  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin; /* Firefox */
}

#tsb-board::-webkit-scrollbar {
  height: 10px;
}

#tsb-board::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

#tsb-board::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

#tsb-board.tsb-dragging {
  cursor: grabbing;
  user-select: none;
}

.tsb-empty {
  color: rgba(207, 226, 255, 0.7);
  padding: 10px 6px;
}

/* =====================================================
   STREAMER ITEM (BASE)
   ===================================================== */

.tsb-item {
  background: linear-gradient(180deg, rgba(8, 28, 56, 0.9), rgba(6, 22, 45, 0.9));
  border: 1px solid rgba(13, 42, 82, 0.95);
  border-radius: 16px;

  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.tsb-item:hover {
  border-color: rgba(47, 128, 255, 0.55);
  transform: translateY(-1px);
}

.tsb-item.active {
  border-color: rgba(145, 71, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(145, 71, 255, 0.25);
  cursor: default;
}

.tsb-item.is-offline {
  opacity: 0.62;
  cursor: pointer;
}

.tsb-item-inner {
  display: flex;
  gap: 12px;
  align-items: center;

  padding: 12px;
}

.tsb-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;

  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.9); /* offline red */
}

.tsb-item.is-live .tsb-avatar {
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.95); /* live green */
}

.tsb-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tsb-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tsb-name {
  color: #e6f0ff;
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 20px;
  padding: 0 8px;
  border-radius: 999px;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;

  border: 1px solid rgba(47, 128, 255, 0.45);
  background: rgba(47, 128, 255, 0.15);
  color: #cfe2ff;

  flex-shrink: 0;
}

.tsb-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: rgba(207, 226, 255, 0.72);
  font-size: 12px;
  line-height: 1.2;
}

.tsb-status-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsb-status-inline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsb-dot {
  opacity: 0.6;
}

/* =====================================================
   PLAYER + CHAT LAYOUT (SHARED)
   ===================================================== */

.tsb-player {
  width: 100%;

  /* Collapsed by default (tabs layout opens it on demand) */
  transform: translateY(-8px);
  opacity: 0;
  max-height: 0;
  overflow: hidden;

  transition: transform 0.25s ease, opacity 0.25s ease, max-height 0.25s ease;
}

.tsb-player.tsb-open {
  transform: translateY(0);
  opacity: 1;
  max-height: 2000px;
}

.tsb-player-toolbar {
  display: none;
  align-items: center;
  justify-content: flex-end;
  /* margin-top: 10px; */
}

.tsb-player.tsb-open .tsb-player-toolbar {
  display: flex;
}

.tsb-player-toolbar:empty {
  display: none !important;
}

.tsb-player-close {
  appearance: none;
  border: 1px solid rgba(18, 51, 95, 0.95);
  background: rgba(11, 42, 85, 1);
  color: #cfe2ff;
  width:100%;
  padding: 8px 12px;
  /* border-radius: 999px; */

  font-weight: 700;
  cursor: pointer;
}

.tsb-player-close:hover {
  background: rgb(7, 28, 58);
  /* border-color: #215fae; */
}

.tsb-player-inner {
  display: flex;
  gap: 12px;

  /* margin-top: 12px; */

  background: #06162d;
  border: 1px solid #0d2a52;
  /* border-radius: 14px; */
  overflow: hidden;
}

.tsb-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 260px;
}

.tsb-chat {
  width: 420px;
  min-width: 340px;
}

/* =====================================================
   DESKTOP HEIGHT CONTROL
   ===================================================== */

@media (min-width: 901px) {
  .tsb-video,
  .tsb-chat {
    max-height: calc(100vh - 300px);
  }

  .tsb-chat {
    overflow: hidden;
  }
}

/* =====================================================
   MOBILE FALLBACK
   ===================================================== */

@media (max-width: 900px) {
  .tsb-player-inner {
    flex-direction: column;
  }

  .tsb-chat {
    width: 100%;
    min-width: 0;
    height: 420px;
  }
}
