.controls {
  margin-top: 1em;
  padding: 0.5em 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 1em;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.controls button,
#pop-button-container button {
  background: #8f7a66;
  border: 0;
  border-radius: 3px;
  padding: 0 20px;
  color: #f9f6f2;
  height: 40px;
  line-height: 42px;
  font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
}

.controls button:hover,
#pop-button-container button:hover {
    background: #ad957f;
}

.ai-button, #feedback-container {
  line-height: 40px;
  font-size: 36px;
}

#feedback-container {
  background: #8f7a66;
  color: #f9f6f2;
  font-weight: bold;
  min-width: 40px;
  text-align: center;
}

/* Interactive mode styles */

/* Interactive mode active button state */
#interactive-button.active {
  background: #f67c5f;
}

#interactive-button.active:hover {
  background: #f9a08c;
}

/* Auto random button disabled state */
#auto-random-button.disabled {
  background: #cdc1b4;
  color: #776e65;
}

#auto-random-button.disabled:hover {
  background: #d6ccc2;
}

/* Clickable cells in edit mode */
.game-container.edit-mode .grid-cell {
  cursor: pointer;
  transition: background 0.1s ease;
}

.game-container.edit-mode .grid-cell:hover {
  background: rgba(238, 228, 218, 0.7);
}

/* Clickable overlay for edit mode */
.edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 15px;
  padding: 15px;
  z-index: 10;
}

.edit-cell {
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s ease;
}

.edit-cell:hover {
  background: rgba(238, 228, 218, 0.5);
}

/* Value selector popup */
.value-selector {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.value-selector-content {
  background: #faf8ef;
  padding: 20px;
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 320px;
}

.value-option {
  background: #8f7a66;
  border: 0;
  border-radius: 3px;
  padding: 15px 10px;
  color: #f9f6f2;
  font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  min-width: 60px;
}

.value-option:hover {
  background: #ad957f;
}

.value-option[data-value="0"] {
  background: #cdc1b4;
  color: #776e65;
}

/* Tile removal suggestion highlight */
.tile-suggest-remove {
  box-shadow: 0 0 0 4px #f65e3b, 0 0 15px rgba(246, 94, 59, 0.6) !important;
  animation: pulse-remove 1s ease-in-out infinite;
  z-index: 20;
}

@keyframes pulse-remove {
  0%, 100% { box-shadow: 0 0 0 4px #f65e3b, 0 0 15px rgba(246, 94, 59, 0.6); }
  50% { box-shadow: 0 0 0 6px #f65e3b, 0 0 25px rgba(246, 94, 59, 0.8); }
}

/* Pop button container */
#pop-button-container {
  margin-bottom: 0.5em;
}

/* Pop button ready-to-apply state */
#pop-button.pop-ready {
  background: #f65e3b;
}

#pop-button.pop-ready:hover {
  background: #f9785d;
}
