/* === General Layout === */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
  color: #111;
  text-align: center;
}

#main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 15px;
  gap: 20px;
  width: 100%;
}

/* === Top Bar Table === */
#top-bar {
  width: 100%;
  background: #ccc;
  color: black;
  border-collapse: collapse;
  font-size: 1rem;
}

#top-bar td.cell {
  border: 1px solid #333;
  height: 30px;
  vertical-align: middle;
  padding: 0;
}

#top-bar tr.links-row td {
  background: white;
  border: none !important;
  padding: 4px 0;
  text-align: center;
}

.cell.left {
  width: 10%;
  text-align: center;
}

.cell.center {
  width: 80%;
  text-align: center;
}

.cell.right {
  width: 10%;
  text-align: center;
}

.clickable {
  cursor: pointer;
  padding: 6px 0;
}

.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.score-row {
  font-size: 1rem;
  white-space: nowrap;
}

.score-links {
  font-size: 1rem;
  padding-top: 4px;
}

.top-link {
  color: #00f;
  text-decoration: underline;
  cursor: pointer;
}

.top-link:hover {
  color: #0056b3;
}

.restart-link {
  color: blue;
  text-decoration: underline;
  
}

/* Modal styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  text-align: center;
}

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 2em;
  cursor: pointer;
}

.hidden {
  display: none;
}

/* === Win Message === */
#winMessage {
  font-size: 1.2em;
  font-weight: bold;
  color: #007bff;
  margin-top: 10px;
}

.flash-winner {
  animation: flash 1s infinite;
}
@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* === Question Log & Answers Panel === */
#question-log, #answerReveal {
  position: absolute;
  top: 60px;
  left: 10px;
  width: 400px;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ccc;
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;  
}

#question-log h2, #answerReveal h2 {
  margin-bottom: 8px;
  font-size: 1em;
}

#log-list, #answerList {
  display: inline-block;
  list-style: none;
  padding-left: 0;
  margin: 0;
}
#log-list li, #answerList li {
  padding: 4px 0;
  border-bottom: 1px solid #eee;
}

#spin-log {
  display: inline-block;
  width: 100%;
  padding: 6px 0;
  cursor: pointer;
}

#reveal-answers,
#claim-win,
#next-game {
  display: inline-block;
  width: 100%;
  padding: 6px 0;
  cursor: pointer;
}

#fullScoreboardPanel {
  margin: 20px auto;
  max-width: 700px;
  background-color: #fff;
  border: 2px solid #ccc;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  z-index: 500;
}

#fullScoreboardPanel h2 {
  margin-bottom: 10px;
}

.scoreboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.scoreboard-table th,
.scoreboard-table td {
  border: 1px solid #ddd;
  padding: 8px;
}

.scoreboard-table th {
  background-color: #f0f0f0;
}

.scoreboard-table tr:nth-child(even) {
  background-color: #fafafa;
}

/* === Topic Label === */
#current-topic {
  font-weight: bold;
  font-size: 1.1em;
  color: #444;
  margin-top: 30px;
}

/* === Spinning Wheel === */
#chart {
  width: 500px;
  height: 500px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.spin-button {
  cursor: pointer;
}
.spin-button:hover {
  fill: lightgray;
}

/* === Question Text Below Wheel === */
#question {
  font-weight: bold;
  font-size: 1em;
  color: #111;
  margin-top: 10px;
}

/* === Game Layout === */
#game-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* === Boards === */
.grid-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.bingo-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  width: 400px;
  height: 400px;
  border: 1px solid #000;
  box-sizing: border-box;
}

.square {
  background-color: white;
  border: 1px solid #000;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8em;
  font-weight: bold;
  color: black;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: center;
  padding: 2px;
  word-break: break-word;
}
.square.clicked { background-color: lightgreen; }
.square.revealed { background-color: rgb(255, 200, 100); color: black; }
.square.wrong-answer { border: 2px solid red; background-color: #ffe5e5; }
.free-space { background-color: yellow; font-weight: bold; }

.player-wrapper:not([data-player="human"]) .square:not(.free-space):not(.revealed) {
  color: transparent;
}

.player-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.player-name {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 5px;
  color: #444;
}

.winning-square {
  background-color: lightblue !important;
  font-weight: bold;
}

/* === Responsive === */
@media screen and (max-width: 768px) {
  #top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-left, .top-center, .top-right {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  #chart {
    width: 90vw;
    height: 90vw;
  }

  .bingo-board {
    width: 90vw;
    height: 90vw;
  }

  #question-log, #answerReveal {
    width: 90vw;
    left: 5vw;
  }
}

  /* === Dashboard Styles === */
.dashboard-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 30px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 10px;
    text-align: center;
  }
  
  .dashboard-container h1 {
    margin-bottom: 20px;
    font-size: 24px;
  }
  
  .dashboard-container input[type="file"] {
    margin-bottom: 20px;
    font-size: 16px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
  }
  
  .dashboard-button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }  
  
  .dashboard-container button:hover {
    background-color: #0056b3;
  }
  
  .upload-message {
    margin-top: 15px;
    font-weight: bold;
    color: green;
  }

  /* === Topic Stats Section === */
#topicStats {
  margin-top: 30px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px;
}

.topic-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: #f3f3f3;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 16px;
}

.topic-row .button-group {
  display: flex;
  gap: 10px;
}

.upload-button {
  background-color: #007bff;
  color: white;
}

.upload-button:hover {
  background-color: #0056b3;
}

.download-button {
  background-color: #28a745;
  color: white;
  margin-left: 10px;
}

.download-button:hover {
  background-color: #218838;
}

.delete-button {
  background-color: #dc3545;
  color: white;
  margin-left: 10px;
}

.delete-button:hover {
  background-color: #c82333;
}
