/* Updated style.css */
/* Global box-sizing for consistent sizing */
* {
  box-sizing: border-box;
}

/* Base Styling */
html, body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background-color: #f9f9f9;
  text-align: center;
  font-size: 4vw; /* Base font size for mobile */
}

/* Game Container */
#game-container {
  width: 97vw;
  margin: 0 auto;
  padding: 0;
}

/* Header & Timer */
#category-header {
  font-size: 6vw;
  margin: 10px 0;
}
#timer-display {
  font-size: 5vw;
  margin: 10px 0 5px;
}

/* Main and Popup Button Styles */
button {
  font-size: 4vw;
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.popup-close-btn {
  background-color: gold; /* #FFD700 */
  color: black;
}

.difficulty-btn.Hint3,
.difficulty-btn.Hint2,
.difficulty-btn.Hint1,
.difficulty-btn.NoHint,
.size-btn.Easy,
.size-btn.Med,
.size-btn.Hard,
.size-btn.Boss,
.duration-btn.one-min,
.duration-btn.two-min,
.duration-btn.three-min,
.duration-btn.five-min {
  background-color: mediumblue;
  color: white;
}

/* Join and Top-Ten Buttons */
#join-btn.join-state { background-color: green; color: white; }
#join-btn.leave-state { background-color: red; color: white; }
#top-ten-btn { background-color: gold; color: black; }

/* Scores & Top-Ten Popup Styling */
.scores-popup,
.top-ten-popup {
  position: fixed;
  background-color: white;
  border: 2px solid black;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 4vw;
  max-width: 97vw;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
}
.scores-popup { top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 20px; }
.top-ten-popup { top: 15px; left: 50%; transform: translateX(-50%); padding: 0; }

.scores-popup h2,
.top-ten-popup h2 {
  font-size: 4vw;
  margin: 10px 0;
}

.scores-popup table,
.top-ten-popup table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 6px;
}

.scores-popup th,
.scores-popup td,
.top-ten-popup th,
.top-ten-popup td {
  border: 1px solid black;
  padding: 3px;
}

/* Selection Controls inside Popup */
.selection-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

/* Top-Ten Table Styles */
.top-ten-popup th {
  background: linear-gradient(145deg, #3498db, #2980b9);
  color: white;
  font-weight: bold;
}
/*  .top-ten-popup tr:nth-child(even) { background-color: #f8f9fa; }  */
.top-ten-popup tr:hover      { background-color: #e8f4f8; }
.bold-row {
  font-weight: bold;
  background-color: #e6e6fa; /* Light lavender */
  color: #000000;
}
.spacer-cell { border: 1px solid black; padding: 5px; }

/* Board & Cells */
#board-wrapper { width: 100%; aspect-ratio: 1/1; margin: 0 auto; position: relative; }
#countdown-disk { position: absolute; top:0; left:0; width:100%; height:100%; border-radius:50%; background: conic-gradient(blue 0deg, blue 0deg, #ccc 0deg, #ccc 360deg); z-index:1; }
#board { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; width:100%; height:100%; position:relative; z-index:2; }
.cell { touch-action:manipulation; aspect-ratio:1/1; display:flex; justify-content:center; align-items:center; background:linear-gradient(145deg,#999,#eee); border:1px solid #8b5a2b; border-radius:10px; font-family:Helvetica; font-weight:bold; user-select:none; color:#CC213b; font-size:14vw; }
.cell.selected { background:linear-gradient(145deg,#c19a6b,#d2a679); border-color:#704214; box-shadow: inset 2px 2px 4px rgba(0,0,0,0.3); }
.selection-lines { position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; }
.selection-lines line { stroke:black; stroke-width:4; }

/* Word List */
#results {
  text-align: left;
  margin-top: 20px;
}

#all-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  font-family: 'Courier New', monospace;
  font-size: 1.4em;
  width: 100%;
  gap: 0.5em; /* Adjust spacing between words as needed */
}

.word-entry {
  display: inline-block;
  white-space: nowrap;
}

.char {
  display: inline-block;
  width: 0.6em;
  text-align: center;
  margin-right: 2px;
}

.char.above-level {
  color: lightblue;
}

/* Existing styles for word list */
.char.above-level {
  color: lightblue;
}

/* Ensure revealed supralevel words use lightblue */
.supralevel-word .char.revealed {
  color: lightblue;
}

/* Ensure hint letters for supralevel words are lightblue */
.supralevel-word .char.first-letter {
  color: lightblue;
}

/* Word List */
.revealed { color: black; }
.first-letter { color: red; }
.uniquefind { color: green; }
.sharedfind { color: black; }
.othersfind { color: blue; }
.nofind { color: red; }

.regular-word .char {
  font-weight: bold;
}

.supralevel-word .char {
  font-style: italic;
}
/* Responsive Adjustments */
@media (min-width:768px) {
  #game-container {
    max-width: 400px;
    margin: 0 auto;
  }


  .popup-close-btn {
    font-size: 16px;
  }
  html, body { font-size:16px; }
  #category-header { font-size:28px; }
  #timer-display { font-size:24px; }
  button { font-size:16px; padding:8px 16px; }
  .top-ten-popup .selection-controls button { font-size:16px; }
  .cell { font-size:54px; }
  .scores-popup h2, .top-ten-popup h2 { font-size:20px; }
  .top-ten-popup th, .top-ten-popup td { padding:2px; font-size:18px; }
}
