/* 1. Prevent the whole page from scrolling */
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; 
  display: flex;
  flex-direction: column; /* Stacks header on top of board */
  font-family: sans-serif;
}

body {
  background-color: white; /* Or #fff or #ffffff */
}

.bigbut {
  max-width: 220px;
  word-wrap: break-word;
  height: 100%;
  display: block;
  margin-top: 8px;
  margin-right: 8px;
}

.numCirc {
  border-radius: 70%;
  background: white; /* #fff; */
  border: 2px solid red; /* #666; */
  color: red; /* #666; */
  text-align: center;
}

.red {
  color: red;
}

.floating {
  flex-shrink: 0; /* Prevents header from squishing */
  background-color: lightblue;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  gap: 10px;
  z-index: 1000;
  flex-direction: row;
  flex-wrap: wrap;
}


#board {
  flex-grow: 1;    /* Fills all remaining vertical space */
  overflow: auto;  /* Scrollbars appear here, at the edge of the screen */
  width: 100%;
  background-color: #eee;
  display: block;
  -webkit-overflow-scrolling: touch;
}

#the_table {
  border-collapse: collapse;
  /* Ensures the table doesn't shrink; scrollbar triggers immediately */
  min-width: max-content; 
  background-color: white;
}

#the_table tr {
  vertical-align: top;
}

.game-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}



#reset-btn {
  background-color: #ff4d4d;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  flex-shrink: 0;
}

#reset-btn:hover {
  background-color: #cc0000;
}

/* Base state for the things we want to hide */
#howto, #reset-btn {
  opacity: 1;
  transition: opacity 0.3s ease; 
  display: block;
  vertical-align: middle;
  overflow: hidden;
}

#howto {
    white-space: nowrap;
}

@media (max-width: 739px) {
  /* The "Hidden" state */
  .hiding-active {
   display: none !important;
  }
}

#fireworks {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
}

.shake {
  animation: shake 0.5s;
  animation-iteration-count: 1;
}

@keyframes shake {
  0% { transform: translateX(1px) rotate(0deg); }
  10% { transform: translateX(-1px) rotate(-1deg); }
  20% { transform: translateX(-3px) rotate(1deg); }
  30% { transform: translateX(3px) rotate(0deg); }
  40% { transform: translateX(1px) rotate(1deg); }
  50% { transform: translateX(-1px) rotate(-1deg); }
  60% { transform: translateX(-3px) rotate(0deg); }
  70% { transform: translateX(3px) rotate(-1deg); }
  80% { transform: translateX(-1px) rotate(1deg); }
  90% { transform: translateX(1px) rotate(0deg); }
  100% { transform: translateX(1px) rotate(-1deg); }
}

/* --- New Success Animation --- */
@keyframes successPulse {
  0% { box-shadow: 0 0 0 rgba(50, 205, 50, 0); border-color: initial; }
  30% { box-shadow: 0 0 15px rgba(50, 205, 50, 0.9); border-color: #32cd32; transform: scale(1.02); }
  100% { box-shadow: 0 0 0 rgba(50, 205, 50, 0); border-color: initial; transform: scale(1); }
}

.success-glow {
  animation: successPulse 0.6s ease-out;
  position: relative;
  z-index: 50; /* Ensure it pops over neighbors */
}
