/* ================================================================
   TWITCH PAGE — pełny layout
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; }

.twitch-page {
  background: #05040b;
  color: var(--text, #e8e8f0);
}

/* ── PANEL 1: STREAM + CZAT ───────────────────────────────── */
.panel--stream {
  align-items: stretch;
  justify-content: center;
  padding: 84px 1rem 6rem;
}

.twitch-panel-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 2100px;
}

/* ── HERO ─────────────────────────────────────────────────── */
.twitch-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 0 0 0.5rem;
  flex-shrink: 0;
}

.twitch-hero .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan, #00e5ff);
  font-family: 'Orbitron', sans-serif;
}

.twitch-hero .hero-title {
  margin: 0;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 30%, var(--cyan, #00e5ff));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Meta cards */
.twitch-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.meta-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 0.45rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 100px;
}

.meta-title {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.meta-card strong {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot--offline { background: #666; }
.status-dot--online  { background: #0f0; box-shadow: 0 0 6px #0f0; }

/* ── MAIN GRID ────────────────────────────────────────────── */
.twitch-grid {
  display: grid;
  grid-template-columns: 1fr 420px; /* czat szerszy */
  gap: 0; /* brak przerwy między odtwarzaczem a czatem */
  flex: 1;
  overflow: hidden;
  padding: 0.75rem;
  padding-top: 0.5rem;
  gap: 0.75rem;
  min-height: 0;
}

/* ── KARTY ────────────────────────────────────────────────── */
.twitch-card {
  background: rgba(10, 7, 20, 0.80);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-height: 0;
}

/* header karty */
.tc-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  min-height: 44px;
}

.tc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tc-dot--stream { background: #9147ff; box-shadow: 0 0 8px #9147ff88; }
.tc-dot--chat   { background: var(--cyan, #00e5ff); box-shadow: 0 0 8px #00e5ff66; }

.tc-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.tc-channel {
  font-size: 0.78rem;
  font-weight: 600;
  color: #9147ff;
  margin-left: 0.25rem;
}

/* ── STREAM ───────────────────────────────────────────────── */
.twitch-card--stream {
  flex: 1;
}

.stream-embed-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.stream-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

/* ── CZAT ─────────────────────────────────────────────────── */
.twitch-card--chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* auth / user w nagłówku */
.tc-auth { margin-left: auto; }
.tc-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-twitch-login {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #9147ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
  white-space: nowrap;
}
.btn-twitch-login:hover { background: #7d2ff0; transform: translateY(-1px); }

.tc-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.tc-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #9147ff;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-logout {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.65rem;
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
}
.tc-logout:hover { background: rgba(255,50,50,0.2); color: #ff4444; }

/* wiadomości */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  min-height: 0;
}
.chat-messages::-webkit-scrollbar       { width: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* empty state */
.chat-empty {
  margin: auto;
  text-align: center;
  color: rgba(255,255,255,0.3);
  padding: 2rem 1rem;
}
.chat-empty-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.chat-empty p    { margin: 0; font-size: 0.85rem; line-height: 1.5; }
.chat-empty strong { color: rgba(255,255,255,0.6); }
.chat-empty-sub  { font-size: 0.75rem; margin-top: 0.4rem; opacity: 0.6; }

/* jedna wiadomość */
.chat-msg {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.83rem;
  line-height: 1.45;
  padding: 0.18rem 0.35rem;
  border-radius: 6px;
  transition: background 0.12s;
}
.chat-msg:hover { background: rgba(255,255,255,0.04); }

.chat-msg-badges { display: flex; align-items: center; gap: 2px; }

.chat-badge {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.chat-badge--broadcaster { background: #e91916; }
.chat-badge--moderator   { background: #00ad03; }
.chat-badge--subscriber  { background: #9147ff; }
.chat-badge--vip         { background: #e005b9; }

.chat-msg-name { font-weight: 700; flex-shrink: 0; cursor: default; }
.chat-msg-sep  { color: rgba(255,255,255,0.3); flex-shrink: 0; }
.chat-msg-text { color: rgba(255,255,255,0.88); word-break: break-word; }

/* system msg */
.chat-sys {
  font-size: 0.73rem;
  color: rgba(255,255,255,0.28);
  text-align: center;
  padding: 0.25rem 0;
  font-style: italic;
}

/* footer */
.chat-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  color: #fff;
  font-size: 0.83rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.chat-input:focus         { border-color: rgba(145,71,255,0.55); background: rgba(255,255,255,0.09); }
.chat-input::placeholder  { color: rgba(255,255,255,0.25); }
.chat-input:disabled      { opacity: 0.35; cursor: not-allowed; }

.chat-send {
  background: #9147ff;
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.18s, transform 0.12s;
}
.chat-send:hover    { background: #7d2ff0; transform: scale(1.05); }
.chat-send:active   { transform: scale(0.96); }
.chat-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.chat-hint {
  margin: 0;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.22);
  text-align: center;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .twitch-grid { grid-template-columns: 1fr 360px; }
}

@media (max-width: 860px) {
  .panel--stream {
    align-items: center;
    min-height: auto;
    padding: 76px 1.1rem 4.5rem;
  }

  .twitch-panel-content {
    height: auto;
  }

  .twitch-grid {
    grid-template-columns: 1fr;
    flex: none;
    padding: 0;
    gap: 0.75rem;
  }

  .twitch-card--stream .stream-embed-wrap {
    position: relative;
    padding-top: 56.25%;
    height: 0;
    flex: none;
  }

  .stream-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .twitch-card--chat { min-height: 420px; }
}

@media (max-width: 480px) {
  .twitch-hero .hero-title { font-size: 1.3rem; }
  .twitch-meta             { gap: 0.5rem; }
  .meta-card               { padding: 0.4rem 0.8rem; min-width: 85px; }
}

/* ── EMOTIKONY ────────────────────────────────────────────── */
.chat-emote {
  display: inline-block;
  vertical-align: middle;
  width: auto;
  height: 28px;
  margin: 0 1px;
}

/* ── BADGE'Y jako obrazki ─────────────────────────────────── */
.chat-badge-img {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  border-radius: 2px;
}

/* ── WŁASNA WIADOMOŚĆ ─────────────────────────────────────── */
.chat-msg--self {
  background: rgba(145, 71, 255, 0.08);
  border-left: 2px solid rgba(145, 71, 255, 0.5);
  padding-left: 0.5rem;
}
.chat-msg--self:hover {
  background: rgba(145, 71, 255, 0.12);
}

/* ══════════════════════════════════════════
   PANEL 2 — BIBLIOTEKA GIER
══════════════════════════════════════════ */
.panel--games {
  align-items: center;
}

.games-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

/* ══════════════════════════════════════════
   PRZEJŚCIE DO PODSTRONY GRY — reszta strony
   "rozpuszcza się", gdy otwarty jest #game-detail
══════════════════════════════════════════ */
.site-header,
.dot-nav,
.scroll-container {
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1), filter 0.5s ease;
}

body.game-detail-open .site-header,
body.game-detail-open .dot-nav,
body.game-detail-open .scroll-container {
  opacity: 0;
  filter: blur(16px);
  pointer-events: none;
}