/*----------------------------------------
  General body & layout
----------------------------------------*/
body {
  background-color: #000;
  color: #fff;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Main wrapper: game + sidebar */
#main-container {
  display: flex;
  gap: 30px;
  flex-wrap: nowrap;
  height: 100%;
}

/* Game panel */
#game-container {
  flex: 3 1 0;
  min-width: 0;           /* allow flex-shrink */
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  background-color: #000;
}

/* Sidebar (scoreboard + chat) */
#sidebar-container {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  border-left: 2px solid #ffcc00;   /* ← yellow divider */
  overflow-y: auto;
}

/*----------------------------------------------------------------
  Scoreboard slot: always show divider below it
----------------------------------------------------------------*/
#scoreboard-container {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ffcc00; /* ← yellow divider */
}

/* Chat container */
#chat-container {
  display: flex;
  flex-direction: column;
  padding: 10px;
  background-color: #222;
}

/*----------------------------------------
  Username & join
----------------------------------------*/
#username-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
#username {
  padding: 5px;
  font-size: 16px;
  width: 200px;
  max-width: 70%;
}
#join-button {
  padding: 6px 12px;
  font-size: 16px;
  cursor: pointer;
}

/*----------------------------------------
  Players / Spectators counts
----------------------------------------*/
#players-count,
#spectators-count {
  margin: 8px 0;
}
#players-count {
  font-size: 20px;
  font-weight: bold;
  background-color: #ffcc00;
  color: #000;
  padding: 10px;
  border: 2px solid #ff9900;
  border-radius: 5px;
  display: inline-block;
}
#spectators-count {
  font-size: 16px;
  color: #ccc;
}

/*----------------------------------------
  Instructions, Letters & Inputs
----------------------------------------*/
#description-container {
  font-size: 24px;
  font-weight: bold;
  color: #ffcc00;
  background-color: #000;
  padding: 10px;
  margin-bottom: 10px;
  border: 2px solid #ff9900;
  border-radius: 10px;
}
#letter-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 32px;
  font-weight: bold;
  color: #ff0000;
  background-color: #000;
  padding: 10px;
  margin-bottom: 10px;
  border: 2px solid #ff0000;
  border-radius: 10px;
}
#letter-container .letter {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  background-color: #fff;
  color: #000;
  border: 2px solid #ff0000;
  border-radius: 5px;
  min-width: 40px;
}
#word-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}
.word-input-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  width: 80%;
  max-width: 300px;
}
.word-input-group span {
  margin-right: 10px;
  font-size: 20px;
  font-weight: bold;
}
.word-input-group input {
  flex: 1;
  padding: 5px;
  font-size: 18px;
}

/*----------------------------------------
  Submit & Countdown
----------------------------------------*/
#submit-sentence {
  padding: 8px 16px;
  font-size: 18px;
  cursor: pointer;
  margin-bottom: 8px;
}
#countdown {
  font-size: 20px;
  margin-bottom: 10px;
}

/*----------------------------------------
  Voting entries
----------------------------------------*/
#results-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.vote-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 500px;
  background-color: #111;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #444;
}
.vote-entry span {
  flex: 1;
  color: #ffcc00;
  font-size: 18px;
  margin-right: 10px;
}
.vote-entry button {
  padding: 8px 16px;
  font-size: 16px;
  background-color: #ff9900;
  color: #000;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color .2s;
}
.vote-entry button:hover {
  background-color: #ffb833;
}

/*----------------------------------------
  High-score ticker
----------------------------------------*/
#top-players.scrolling-text {
  white-space: nowrap;
  overflow: hidden;
  background: linear-gradient(to right, #ff7e5f, #feb47b);
  color: white;
  font-weight: bold;
  padding: 10px;
  animation: scroll 15s linear infinite;
  min-width: 800px;
  box-sizing: border-box;
  font-size: 1.2em;
  border-radius: 5px;
}
@keyframes scroll {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/*----------------------------------------
  Responsive: tablet (769–1199px)
----------------------------------------*/
@media (max-width: 1199px) and (min-width: 769px) {
  #main-container {
    flex-direction: column;
    gap: 2rem;
    height: auto;
    margin-bottom: 1.5rem;
  }
  #game-container,
  #sidebar-container {
    width: 100%;
    height: auto;
    overflow-y: visible;
  }
  #sidebar-container {
    border-left: none;
    border-top: 2px solid #ffcc00;
    margin-top: 1rem;
  }
}

/*----------------------------------------
  Responsive: mobile (<769px)
----------------------------------------*/
@media (max-width: 768px) {
  #main-container {
    flex-direction: column;
    height: auto;
  }
  #game-container {
    overflow-y: visible !important;
    margin-bottom: 1.5rem;
  }
  #sidebar-container {
    border-left: none;
    border-top: 2px solid #ffcc00;
    margin-top: 1rem;
    overflow-y: visible !important;
  }
}
