/* Outer wrapper: stack game, message, and controls */
#diff-game-outer {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  font-family: sans-serif;
  width: 100%;
}

/* Game area: two canvases side by side by default */
#diff-game {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1000px;
  line-height: 0px;
}

/* Canvases */
#diff-game canvas {
  width: 50%; /* Default: 50% width for side-by-side view */
  height: auto;
  /*border: 2px solid #333;*/
  background: white;
  cursor: pointer;
  display: block;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#diff-game canvas:first-of-type {
  border-radius: 10px 0 0 10px; /* Top-left and bottom-left radius */
}

#diff-game canvas:last-of-type {
  border-radius: 0 10px 10px 0; /* Top-right and bottom-right radius */
}

/* --- Mobile-specific styles --- */
/*@media (max-width: 768px) {
  #diff-game {
    flex-direction: column;
  }

  #diff-game canvas {
    width: 100%;
  }
}*/

/* Message below canvases */
#message {
  text-align: center;
  margin: 15px 0;
  font-weight: bold;
  width: 100%;
}

/* Buttons row */
#controls {
  text-align: center;
  margin-bottom: 15px;
}

#controls button {
  margin: 0 10px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}

/* Markers & animations */
.diff-marker {
  position: absolute;
  border-radius: 50%;
  border: 3px solid red;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.diff-marker.wrong {
  border-color: orange;
  animation: wrongFade 0.5s forwards;
}

@keyframes wrongFade {
  0% {
    opacity: 0.8;
    transform: scale(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

.diff-marker.correct {
  background: rgba(255, 0, 0, 0.1);
  animation: correctGrow 0.2s ease-out forwards;
}

@keyframes correctGrow {
  0% {
    transform: scale(0);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.diff-sprite-fade {
  position: absolute;
  pointer-events: none;
  transform-origin: center center;
  opacity: 0;
  transform: scale(0.5);
  overflow: hidden;
}

.diff-sprite-fade.pop-fade {
  animation: diff-popFade 0.2s ease forwards;
}

@keyframes diff-popFade {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}