body {
  background-color: #c4d6a7;
  font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden; /* Prevent scrolling on mobile */
  touch-action: none; /* Prevent zoom/scroll gestures */
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.labels {
  margin: auto;
  margin-top: 10px;
  text-align: center;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: bold;
  color: #303a21;
  word-wrap: break-word;
  margin-bottom: 10px;
}

.frame {
  margin: auto;
  padding: 5px 0px;
  width: 120px; /* Increased width for unscaled pieces */
  border: 2px solid #303a21;
  background-color: #c4d6a7;
}

.controls {
    margin-top: 20px;
}

.btn {
  display: block;
  margin: auto;
  margin-top: 10px;
  background-color: #303a21;
  color: #c4d6a7;
  padding: 10px 5px;
  text-transform: uppercase;
  font-size: 10px;
  border: 0px;
  cursor: pointer;
  border: 0px;
}

.btn:active {
    opacity: 0.8;
}

.btn-rounded {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.fa {
  font-size: 14px;
}

.flipx {
  transform: scaleX(-1);
}

#score {
  margin-top: 5px;
}

#outer-board {
  /* width: 380px; removed to prevent flex shrinking */
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#board {
  position: relative;
  background-color: #c4d6a7;
  width: 280px;
  height: 560px; /* 20 rows * 28px */
  margin: 10px;
  border: 2px solid #303a21;
  box-sizing: content-box;
  overflow: hidden;
}

#stats {
  position: relative;
  background-color: #c4d6a7;
  width: 140px; /* Increased width to fit larger next piece preview */
  margin: 10px;
  border: 2px solid #303a21;
  height: 560px;
  box-sizing: content-box;
}

#banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 100px;
  background-color: #303a21;
  color: #c4d6a7;
  z-index: 100; /* Increased Z-Index to be safe */
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 2px solid #c4d6a7;
  cursor: pointer; /* Pointer on entire banner */
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

#message {
  font-weight: bold;
  text-transform: uppercase;
  font-size: 23px;
  margin: 10px;
}

#new-game {
  font-weight: 100;
  cursor: pointer;
  text-decoration: underline;
}

.block,
.empty {
  position: absolute;
  background-color: #c4d6a7;
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  z-index: 10;
}

.block.ghost {
    z-index: 5;
}

.empty {
  opacity: 0.2;
  z-index: 1;
}

.inner-tile {
  position: absolute;
  background-color: #c4d6a7;
  border: 4px solid #303a21;
  width: 14px;
  height: 14px;
  margin: 3px;
  box-sizing: content-box;
}

.inner-inner-tile {
  position: absolute;
  background-color: #303a21;
  width: 8px;
  height: 8px;
  margin: 3px;
}

/* Flash animation */
@keyframes flash {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

.flash {
  animation: flash 0.1s linear 3;
}

/* Ghost piece styling */
.ghost .inner-tile {
    background-color: transparent;
    border: 2px dashed #303a21;
    opacity: 0.5;
}

.ghost .inner-inner-tile {
    background-color: transparent;
}

/* Next piece preview scaling */
#next-piece {
    /* No scaling needed with larger container */
    /* transform: scale(0.7); */
    /* transform-origin: top center; */
}