/* Enhanced Fishbowl CSS with responsive design - Updated with feedback */

/* Fonts and base styles */
@font-face{
  font-family: 'Beach Day';
  src: url('beachday.ttf') format('truetype'); 
}
@font-face{
  font-family: 'Digital Dismay';
  src: url('digital_dismay.otf') format('opentype'); 
}
@font-face{
  font-family: 'Cartoonist Hand';
  src: url('SF_Cartoonist_Hand.ttf') format('truetype'); 
}

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

body {
  font-size: 22px;
  font-family: 'Cartoonist Hand', sans-serif; /* Secondary font for body text */
  background-color: #1093a7;
  color: #ffffff;
  line-height: 1.4;
  min-height: 100vh;
  padding: 20px;
}

h1, h2, h3, button, .team-name, #statusDiv {
  font-family: 'Beach Day', sans-serif; /* Primary font for headlines and emphasis */
}

/* Container for better layout control */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  position: relative;
}

/* Status and header elements */
#statusDiv {
  font-size: 28px;
  max-width: 60%;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  float: left;
}

#roomIdDiv {
  font-family: monospace;
  font-size: 16px;
  text-align: right;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 1px;
  border-radius: 4px;
  padding: 5px 10px;
  display: inline-block;
  background-color: rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 0;
  right: 15px;
}

/* Clear fix for floated elements */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}

/* Buttons with improved styling */
button {
  background: #4dabca;
  border: none;
  border-radius: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  color: #ffffff;
  cursor: pointer;
  font-family: 'Beach Day', sans-serif;
  font-size: 24px;
  margin: 10px 5px;
  padding: 12px 20px;
  text-align: center;
  transition: all 0.2s ease;
}

button:hover {
  background: #3a96b5;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

button:active {
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
  transform: translateY(1px);
}

/* Card styling */
.cardDiv { 
  border: none;
  border-radius: 12px;
  background-color: #f2eecb;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
  padding: 25px;
  display: inline-block;
  width: 250px;
  font-family: 'Cartoonist Hand', cursive;
  font-size: 36px;
  text-align: center;
  margin: 15px auto;
  transform: rotate(-2deg);
  color: #333333;
}

#currentCardDiv {
  transform: scale(1.05) rotate(-2deg);
  transition: transform 0.3s ease;
}

#currentCardDiv:hover {
  transform: scale(1.1) rotate(0deg);
}

/* Join Room / Lobby styling */
#lobbyDiv {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 25px;
  margin: 20px auto;
  max-width: 600px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

#joinDiv {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#joinDiv label {
  font-size: 24px;
  margin: 10px 0 5px 0;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  width: 100%;
  text-align: left;
}

#joinDiv input {
  width: 100%;
  height: 50px;
  margin: 5px 0 15px 0;
  padding: 5px 15px;
  background-color: #def2f3;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-family: 'Cartoonist Hand', sans-serif;
  font-size: 24px;
  transition: all 0.2s ease;
}

#joinDiv input:focus {
  outline: none;
  border-color: #4dabca;
  box-shadow: 0 0 8px rgba(77, 171, 202, 0.6);
}

#joinButton {
  width: 100%;
  margin-top: 20px;
  font-size: 26px;
  padding: 15px;
}

#joinHelpDiv {
  margin-top: 20px;
  text-align: center;
  font-size: 18px;
  opacity: 0.8;
}

/* Pre-game styling with improved word input */
#pregameDiv {
  margin: 20px auto;
  max-width: 800px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

#playersDiv {
  margin-bottom: 30px;
}

#playersTable {
  width: 100%;
  border-spacing: 10px;
  border-collapse: separate;
}

#playersTable td {
  padding: 15px;
  background-color: rgba(88, 155, 164, 0.7);
  border-radius: 10px;
  transition: all 0.2s ease;
}

#playersTable td:hover {
  background-color: rgba(88, 155, 164, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#customWordsDiv {
  margin: 30px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.customWord {
  width: 48%;
  height: 50px;
  margin: 10px 0;
  padding: 10px 15px;
  background-color: #def2f3;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-family: 'Cartoonist Hand', sans-serif;
  font-size: 22px;
  transition: all 0.2s ease;
}

.customWord:focus {
  outline: none;
  border-color: #4dabca;
  box-shadow: 0 0 8px rgba(77, 171, 202, 0.6);
  transform: scale(1.02);
}

#addCustomWordsButton {
  width: 100%;
  margin-top: 20px;
  background-color: #5cb85c;
  color: white;
}

#addCustomWordsButton:hover {
  background-color: #4cae4c;
}

#startGameButton {
  width: 100%;
  margin-top: 30px;
  font-size: 28px;
  padding: 15px;
  background-color: #5bc0de;
  color: white;
}

#startGameButton:hover {
  background-color: #46b8da;
}

/* Game view styling - UPDATED TEAM SCORES */
#gameDiv {
  margin: 20px auto;
  max-width: 800px;
  text-align: center;
}

/* New team scores layout */
#teamScoresDiv {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  width: 100%;
}

.team-row {
  display: flex;
  align-items: center;
  margin: 5px 0;
  border-radius: 10px;
  overflow: hidden;
}

.team-name {
  flex: 1;
  padding: 10px;
  text-align: right;
  background-color: rgba(255, 255, 255, 0.2);
  font-size: 24px;
}

.team-score {
  width: 80px;
  padding: 10px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
}

/* Team Red */
.team-row:nth-child(1) .team-name {
  color: #f8d7da;
}
.team-row:nth-child(1) .team-score {
  background-color: #d9534f;
  color: white;
}

/* Team Blue */
.team-row:nth-child(2) .team-name {
  color: #d1ecf1;
}
.team-row:nth-child(2) .team-score {
  background-color: #5bc0de;
  color: white;
}

#waitingForDiv {
  clear: both;
  margin: 20px 0;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  font-size: 24px;
}

#deckDiv {
  margin: 20px auto;
  width: 80px;
  height: 120px;
  background-color: #def2f3;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Beach Day';
  font-size: 28px;
  color: #333;
}

#turnTimeDiv {
  font-family: 'Digital Dismay';
  font-size: 48px;
  padding: 10px;
  margin: 15px auto;
  background-color: rgba(0, 0, 0, 0.3);
  color: #fff;
  border-radius: 8px;
  width: 150px;
  text-align: center;
}

#myTurnDiv {
  width: 100%;
  margin: 20px auto;
}

#cardButtons {
  display: flex;
  justify-content: center;
  margin: 20px auto;
}

#gotCardButton, #passCardButton {
  width: 150px;
  margin: 0 10px;
  padding: 15px;
  font-size: 24px;
}

#gotCardButton {
  background-color: #5cb85c;
  color: white;
}

#passCardButton {
  background-color: #d9534f;
  color: white;
}

#gotCardButton:hover {
  background-color: #4cae4c;
}

#passCardButton:hover {
  background-color: #c9302c;
}

/* Game stats display */
#waitingForDiv {
  font-family: 'Cartoonist Hand', sans-serif;
  line-height: 1.5;
}

/* Color blind friendly emphasis */
.emphasis {
  font-weight: bold;
  text-decoration: underline;
}

#resolvedCardsDiv {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
}

#gotCardsDiv, #passedCardsDiv {
  width: 48%;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
}

.resolvedCardsList {
  font-family: 'Cartoonist Hand';
  font-size: 20px;
  list-style: none;
  padding: 0;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.resolvedCardsList li {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.resolvedCardsList li:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.resolvedCardsList li.selected {
  background-color: rgba(255, 255, 255, 0.3);
  font-weight: bold;
}

#undoButton {
  margin: 15px auto;
  display: block;
}

#startTurnButton, #endTurnButton, #newGameButton {
  width: 60%;
  margin: 20px auto;
  font-size: 26px;
  padding: 15px;
  display: block;
}

#newGameButton {
  background-color: #5bc0de;
  color: white;
}

#newGameButton:hover {
  background-color: #46b8da;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    font-size: 18px;
    padding: 10px;
  }
  
  #statusDiv {
    font-size: 24px;
  }
  
  button {
    font-size: 20px;
    padding: 10px 15px;
  }
  
  .cardDiv {
    width: 220px;
    font-size: 28px;
    padding: 20px;
  }
  
  #teamScoresDiv {
    max-width: 100%;
  }
  
  #customWordsDiv {
    flex-direction: column;
  }
  
  .customWord {
    width: 100%;
  }
  
  #resolvedCardsDiv {
    flex-direction: column;
  }
  
  #gotCardsDiv, #passedCardsDiv {
    width: 100%;
    margin-bottom: 15px;
  }
  
  #gotCardButton, #passCardButton {
    width: 45%;
  }
  
  #turnTimeDiv {
    font-size: 36px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }
  
  #lobbyDiv, #pregameDiv {
    padding: 15px;
  }
  
  #playersTable td {
    padding: 10px;
    font-size: 16px;
  }
  
  #turnTimeDiv {
    font-size: 32px;
    width: 120px;
  }
  
  .cardDiv {
    width: 180px;
    font-size: 22px;
    padding: 15px;
  }
  
  #waitingForDiv {
    font-size: 18px;
  }
}

/* Animation for card transitions */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-2deg);
  }
}

#currentCardDiv {
  animation: cardIn 0.3s ease-out;
}

/* Button active states */
#pauseButton {
  width: 30px;
  height: 30px;
  border: none;
  margin: 0 10px;
  padding: 0;
  background: transparent;
  vertical-align: middle;
}

#pauseButton.paused {
  background-image: url('play-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
}

#pauseButton:not(.paused) {
  background-image: url('pause-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
}

#changeTeamButton {
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
  width: auto;
  height: auto;
}

#changeTeamButton:hover {
  transform: scale(1.2);
  box-shadow: none;
}

/* Game rules button */
#showRulesButton {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

#showRulesButton:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

