@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: #0d0d0d;
  background-image:
    radial-gradient(ellipse at top, #1a0533 0%, transparent 60%),
    radial-gradient(ellipse at bottom, #0d001a 0%, transparent 60%);
  font-family: 'Inter', sans-serif;
  color: #efeff1;
  overflow-x: hidden;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #18181b;
  border-bottom: 1px solid #ffffff10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1.5rem;
  z-index: 100;
}

.nav-brand {
  font-weight: 900;
  font-size: 1rem;
  color: #bf5af2;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav-brand:hover {
  opacity: 0.8;
}

.btn-twitch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  background: #9146ff;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-twitch:hover {
  background: #772ce8;
  transform: scale(1.05);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-indicator {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff66;
  transition: all 0.3s;
}

.live-indicator.is-live {
  color: #ff4444;
  text-shadow: 0 0 8px #ff444488;
  animation: blink 1.5s infinite;
}

.btn-live {
  padding: 0.45rem 1rem;
  background: #1f1f23;
  border: 1px solid #ffffff20;
  color: #ffffff88;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-live.is-live {
  background: #9146ff;
  border-color: #9146ff;
  color: #fff;
  box-shadow: 0 0 15px #9146ff44;
}

.btn-live:hover {
  transform: scale(1.05);
}

.btn-clips {
  padding: 0.45rem 1rem;
  background: #1f1f23;
  border: 1px solid #ffffff20;
  color: #ffffff88;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-clips:hover {
  background: #9146ff;
  color: #fff;
  transform: scale(1.05);
}

.btn-donate {
  padding: 0.45rem 1rem;
  background: #1f1f23;
  border: 1px solid #ffffff20;
  color: #ffffff88;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-donate:hover {
  background: #1db954;
  color: #fff;
  transform: scale(1.05);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.live-layout {
  display: flex;
  gap: 1rem;
  padding: 70px 1.5rem 2rem;
  height: calc(100vh - 56px);
  max-width: 1400px;
  margin: 0 auto;
}

.chat-sidebar {
  width: 340px;
  min-width: 300px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ffffff10;
  flex-shrink: 0;
}

.chat-sidebar iframe {
  width: 100%;
  height: 100%;
}

.live-container {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stream-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.6rem 1.5rem;
  background: #1f1f23;
  border: 1px solid #ffffff15;
  border-radius: 8px;
  color: #ffffff88;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: #bf5af2;
  color: #fff;
  border-color: #bf5af2;
}

.tab:hover:not(.active) {
  background: #2f2f35;
}

.stream-wrapper {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ffffff10;
}

.stream-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

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

.stream-embed.hidden {
  display: none;
}

.stream-info {
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  background: #1f1f23;
  border-radius: 10px;
  border: 1px solid #ffffff10;
}

.stream-info h2 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.stream-info p {
  font-size: 0.85rem;
  color: #ffffff66;
}

/* Memes flutuantes */
.floating-memes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.meme-float {
  position: absolute;
  top: var(--top);
  left: -10%;
  width: clamp(60px, 10vw, 120px);
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  animation: flyLeft var(--duration) linear var(--delay) infinite;
  opacity: 0;
  filter: drop-shadow(0 0 6px #bf5af244);
}

.meme-float.reverse {
  left: auto;
  right: -10%;
  animation: flyRight var(--duration) linear var(--delay) infinite;
}

@keyframes flyLeft {
  0% { left: -10%; transform: rotate(0deg) scale(1); opacity: 0; }
  5% { opacity: 0.6; }
  50% { transform: rotate(180deg) scale(1.3); opacity: 0.6; }
  95% { opacity: 0.6; }
  100% { left: 110%; transform: rotate(360deg) scale(1); opacity: 0; }
}

@keyframes flyRight {
  0% { right: -10%; left: auto; transform: rotate(0deg) scale(1); opacity: 0; }
  5% { opacity: 0.6; }
  50% { transform: rotate(-180deg) scale(1.3); opacity: 0.6; }
  95% { opacity: 0.6; }
  100% { right: 110%; left: auto; transform: rotate(-360deg) scale(1); opacity: 0; }
}

.live-layout {
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .live-layout {
    flex-direction: column;
    height: auto;
  }
  .chat-sidebar {
    width: 100%;
    height: 300px;
    min-width: unset;
  }
}

/* Ranking Sidebar */
.ranking-sidebar {
  width: 220px;
  min-width: 200px;
  flex-shrink: 0;
  background: #1f1f23;
  border: 1px solid #ffffff10;
  border-radius: 12px;
  padding: 1rem 0.8rem;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

.ranking-sidebar h3 {
  font-size: 0.75rem;
  font-weight: 900;
  color: #bf5af2;
  text-align: center;
  margin-bottom: 0.8rem;
  letter-spacing: 1px;
}

.ranking-sidebar table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-sidebar th {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: #ffffff44;
  padding: 0.3rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid #ffffff10;
}

.ranking-sidebar th:last-child { text-align: right; }

.ranking-sidebar td {
  padding: 0.45rem 0.4rem;
  font-size: 0.75rem;
  border-bottom: 1px solid #ffffff08;
  white-space: nowrap;
}

.ranking-sidebar tr:last-child td { border-bottom: none; }

.rs-rank {
  text-align: center;
  font-weight: 900;
  font-size: 0.8rem;
  width: 24px;
}

.rs-gold  { color: #ffd700; }
.rs-silver { color: #c0c0c0; }
.rs-bronze { color: #cd7f32; }

.rs-player {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rs-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.65rem;
  color: #fff;
  flex-shrink: 0;
}

.rs-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.rs-score {
  text-align: right;
  font-weight: 900;
  color: #bf5af2;
  font-size: 0.7rem;
}

@media (max-width: 1100px) {
  .ranking-sidebar { display: none; }
}
