/* Prevent swipe-refresh on supported browsers */
html {
  overscroll-behavior: none;
}

/* Import Google fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto&family=Orbitron&display=swap');

/* Global & Space Theme Styles */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at center, #000 0%, #111 70%, #000 100%);
  color: #eee;
  font-size: 16px;
  text-align: center;
}

/* Button Styling */
button {
  background-color: purple;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  border-radius: 5px;
  display: block;
  margin: 10px auto;
}

/* Header Styling */
#header {
  text-align: center;
  padding: 15px 0;
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 2px solid #0ff;
  position: sticky;
  top: 0;
  z-index: 2100;
}
#header h1 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 3em;
  color: #0ff;
}
#header h2 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8em;
  color: #0ff;
  font-weight: normal;
}
h2, h3 {
  text-align: center;
  color: #0ff;
}

/* Game Container Layout */
#gameContainer {
  display: flex;
  flex-wrap: nowrap;
  padding: 10px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

/* Board styling (15×15 grid) */
#board {
  display: grid;
  grid-template-columns: repeat(15, 30px);
  grid-template-rows: repeat(15, 30px);
  gap: 2px;
  border: 2px solid #0ff;
  background: rgba(0, 0, 0, 0.8);
}
#board input {
  width: 30px;
  height: 30px;
  text-align: center;
  font-size: 16px;
  text-transform: uppercase;
  border: 1px solid #444;
  background: #222;
  color: #0ff;
}

/* Right panel (score + meanings) */
#rightPanel {
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 300px;
  text-align: center;
}

/* Score Table styling */
#scoreTable {
  margin-bottom: 20px;
}
#scoreTable table {
  border-collapse: collapse;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  margin: 0 auto;
}
#scoreTable td, #scoreTable th {
  border: 1px solid #0ff;
  padding: 8px 12px;
  text-align: center;
  color: #0ff;
}

/* Meaning display area */
#meaningBoxContainer {
  margin-top: 20px;
}
#meaningGreeting {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
  color: #0ff;
}
#meaningBox {
  border: 2px solid #0ff;
  padding: 15px;
  background: rgba(0, 0, 0, 0.9);
  font-size: 16px;
  line-height: 1.5;
  color: #eee;
}
#meaningBox div {
  margin-bottom: 8px;
}

/* Generic message overlay */
#message {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #0ff;
  padding: 10px 20px;
  font-size: 16px;
  z-index: 1000;
  display: none;
  max-width: 80%;
  color: #0ff;
  text-align: center;
}
.speaker {
  cursor: pointer;
  margin-right: 5px;
  color: #0ff;
}

/* Rules overlay styling */
#rulesOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 30, 0.95);
  z-index: 2000;
  display: none;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  color: #0ff;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  padding-top: 80px;
  font-size: 0.8em;
}
#rulesOverlay center {
  display: none;
}
#rulesOverlay h2 {
  margin-top: 0;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
}
#rulesOverlay ul, #rulesOverlay p {
  text-align: justify;
}

/* Player setup styling */
#playerSetup {
  margin: 20px auto;
  max-width: 500px;
  background: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border: 2px solid #0ff;
  color: #0ff;
  text-align: center;
}
#highScoreBox {
  margin: 10px auto 20px;
  padding: 10px;
  border: 2px dashed #0ff;
  max-width: 400px;
  background: rgba(0,0,0,0.7);
  white-space: pre-line;
}
#playerNames > div {
  margin-bottom: 15px;
}
label {
  margin-right: 5px;
}

/* Current player display */
#currentPlayerDisplay {
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
  font-size: 20px;
  color: #0ff;
}

/* End Game & Reset Game buttons */
#endGameButton {
  margin: 20px auto;
  padding: 10px 20px;
  background-color: #444;
  border: 2px solid #0ff;
  color: #0ff;
  cursor: pointer;
  border-radius: 5px;
  display: block;
}
#resetGameButton {
  margin: 10px auto;
  padding: 10px 20px;
  background-color: #444;
  border: 2px solid #0ff;
  color: #0ff;
  cursor: pointer;
  border-radius: 5px;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    font-size: 18px;
  }
  #gameContainer {
    flex-direction: column;
    align-items: center;
  }
  #rightPanel {
    margin-left: 0;
    margin-top: 20px;
    width: 90%;
  }
  #board {
    grid-template-columns: repeat(15, calc((90vw - 22px) / 15));
    grid-template-rows: repeat(15, calc((90vw - 22px) / 15));
  }
  #board input {
    width: calc((90vw - 22px) / 15);
    height: calc((90vw - 22px) / 15);
    font-size: 1em;
  }
  #message, #meaningBox {
    font-size: 1em;
  }
  #meaningGreeting {
    font-size: 1.25em;
  }
  #playerSetup, #rulesOverlay {
    padding: 15px;
    font-size: 1em;
  }
}

/* Background image (beneath gradient) */
body {
  background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvschcl6txlpuDKydEQSfnJNhMB8-gn9wjJTFx7bNXoYvoQ0C4r27dYnqGCCv8YACFrckJs2Onv6crJsZgv1tx7blBuPCQSIu9nXM_mlAlwE7RCql2y_pcTfCm8BbvFMtWvn_v3HFv5RaDvU7a5knIXNLDuNq2hyphenhyphenFM4pmjL6S9S5ZVr-QFmytGj78SUjc/s1600/background.png');
}

/* Floating footer styling */
#floating-footer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
