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

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

body {
  font-family: 'Orbitron', sans-serif;
  background: radial-gradient(circle at center, #000010, #050020);
  color: #0ff;
  text-align: center;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(138, 43, 226, 0.1));
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.4);
  border-bottom: 2px solid #0ff;
}

h1 {
  font-size: 3em;
  margin-bottom: 10px;
  text-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 10px #0ff, 0 0 20px #0ff; }
  to { text-shadow: 0 0 20px #0ff, 0 0 40px #0ff, 0 0 60px #0ff; }
}

h2 {
  font-size: 1.8em;
  margin-bottom: 15px;
  color: #0ff;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

section {
  background: rgba(0, 20, 40, 0.8);
  border: 2px solid #0ff;
  border-radius: 15px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

/* Poll Section */
.poll-section {
  max-width: 800px;
  margin: 30px auto;
}

form {
  margin: 20px 0;
}

label {
  display: block;
  font-size: 1.2em;
  margin: 15px 0;
  padding: 15px;
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

label:hover {
  background: rgba(0, 255, 255, 0.15);
  border-color: #0ff;
  transform: translateX(5px);
}

input[type="radio"] {
  margin-right: 10px;
  cursor: pointer;
}

button {
  background: linear-gradient(135deg, #0ff, #00cccc);
  border: none;
  padding: 15px 40px;
  color: #000;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4);
}

button:hover {
  background: linear-gradient(135deg, #00cccc, #0ff);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 255, 0.6);
}

button:active {
  transform: translateY(0);
}

#vote-status {
  margin-top: 20px;
  font-size: 1.1em;
  padding: 15px;
  border-radius: 8px;
}

#vote-status.success {
  background: rgba(0, 255, 0, 0.2);
  border: 1px solid #0f0;
  color: #0f0;
}

#vote-status.error {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid #f00;
  color: #f00;
}

#total-votes {
  margin-top: 15px;
  font-size: 1.3em;
  font-weight: bold;
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
}

/* Chart Container */
.chart-container {
  margin-top: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Twitch Section */
.twitch-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.twitch-player,
.twitch-chat {
  border: 3px solid #0ff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

iframe {
  display: block;
  width: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .twitch-wrapper {
    grid-template-columns: 1fr;
  }
  
  .twitch-chat {
    height: 300px;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2em; }
  h2 { font-size: 1.4em; }
  
  .container {
    padding: 10px;
  }
  
  section {
    padding: 20px;
  }
  
  label {
    font-size: 1em;
    padding: 10px;
  }
}

footer {
  margin-top: 50px;
  padding: 20px;
  color: rgba(0, 255, 255, 0.6);
  font-size: 0.9em;
}


/* Auth Section in Header */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.auth-section {
  min-width: 200px;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.auth-button-mini {
  padding: 10px 20px;
  background: linear-gradient(135deg, #0ff, #00cccc);
  border: none;
  border-radius: 5px;
  color: #000;
  font-weight: bold;
  font-size: 0.9em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.auth-button-mini:hover {
  background: linear-gradient(135deg, #00cccc, #0ff);
  transform: translateY(-2px);
}

.auth-button-mini.signup {
  background: linear-gradient(135deg, #8a2be2, #6a1bb2);
}

.auth-button-mini.signup:hover {
  background: linear-gradient(135deg, #6a1bb2, #8a2be2);
}

.user-profile-mini {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-greeting {
  color: #0ff;
  font-size: 1em;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .auth-section {
    width: 100%;
  }
  
  .auth-buttons {
    justify-content: center;
  }
}


/* Mobile Twitch Chat Fixes */

/* Fix chat input being blocked on mobile */
.twitch-chat iframe {
  pointer-events: auto !important;
  touch-action: auto !important;
}

/* Ensure chat is clickable on small screens */
@media (max-width: 1024px) {
  .twitch-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .twitch-chat {
    min-height: 500px; /* Taller on mobile for better chat visibility */
    height: 500px;
    order: 2; /* Chat appears below video */
  }

  .twitch-player {
    order: 1;
  }

  /* Remove any borders that might block input */
  .twitch-chat {
    border: 2px solid #0ff;
    border-radius: 10px;
    overflow: visible; /* Allow input to be accessible */
    padding: 0;
    margin: 0;
  }

  /* Ensure iframe fills container properly */
  .twitch-chat iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
  }
}

/* Extra small screens (phones) */
@media (max-width: 768px) {
  .twitch-chat {
    min-height: 400px;
    height: 400px;
  }

  /* Reduce border width on mobile to maximize chat space */
  .twitch-chat {
    border-width: 1px;
  }
}

/* Landscape mobile */
@media (max-width: 1024px) and (orientation: landscape) {
  .twitch-wrapper {
    grid-template-columns: 1.5fr 1fr; /* Side by side in landscape */
  }

  .twitch-chat {
    min-height: 350px;
    height: 350px;
  }
}