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

body {
  font-family: Arial, sans-serif;
  background-color: #ffffff;
  color: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  flex-direction: column;
  position: relative; /* Needed for absolute positioning of timer */
}

/* Hide container elements when the game starts */
.hidden {
  display: none !important;
}

.container {
  text-align: center;
  padding: 20px;
}

/* Timer positioned in top-right */
.timer {
  font-size: 1.2rem;
  position: absolute;
  top: 10px;
  right: 10px;
  color: #000;
}

/* Button Styles */
.start-button {
  background-color: #6200ea;
  color: white;
  border: none;
  padding: 15px 25px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  outline: none;
  margin: 10px;
}

.start-button:hover {
  background-color: #3700b3;
  transform: scale(1.05);
}

.start-button:active {
  transform: scale(0.98);
}

/* Square Styles */
.square {
  width: 120px;
  height: 120px;
  background-color: #ffffff;  /* Start with grey */
  border-style: solid;
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.score {
  display: none;
  margin-top: 20px;
  padding: 0 15px;
  font-size: 1.2rem;
  color: #333;
  background-color: #f9f9f9;
  border: 2px solid #ddd;
  border-radius: 10px;
  text-align: left;
  white-space: pre-wrap; /* Preserve line breaks */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  line-height: 1;
}

.score span {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.events-table th, .events-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.events-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

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

.events-table tr:hover {
  background-color: #ddd;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

button:disabled {
  background-color: #aaa;
  cursor: not-allowed;
}

@keyframes blinkBorder {
  0% { border-color: black; }
  50% { border-color: white; }
  100% { border-color: black; }
}

.blinking-border {
  animation: blinkBorder 2s steps(1) infinite;
}

.credits {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 0.6rem;
  color: #333;
}

.credits a {
  color: #6200ea;
  text-decoration: none;
}

.credits a:hover {
  text-decoration: underline;
}
