.gameContainer {
  position: relative;
  z-index: 1;
  padding: 4px;
  width: 100%;
  border-radius: 28px;
  margin-top: 50px;
  min-height: 300px;
  box-shadow: 0px 66px 26px rgba(0, 0, 0, 0.01),
    0px 37px 22px rgba(0, 0, 0, 0.05), 0px 16px 16px rgba(0, 0, 0, 0.09),
    0px 4px 9px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
  .gameContainer {
    width: auto;
    flex: none;
    min-width: 626px;
    height: 260px;
    margin-top: 0;
  }
}

.gameContainer:before {
  content: "";
  position: absolute;
  inset: -4px -4px -8px -4px;
  border-radius: 28px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.15) 100%
  );
  z-index: -1;
}

.gameContainer:after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-card);
  border: var(--border-width-card) solid transparent;
  background-image: linear-gradient(#001146, #0655cc),
    linear-gradient(
      180deg,
      var(--theme-gradient-start) 0%,
      var(--theme-gradient-end) 100%
    );
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.gameContent {
  position: relative;
  z-index: 1;
  background: transparent;
  border-radius: 20px;
  width: 100%;
  height: 100%;
  min-height: 292px;
  display: flex;
  overflow: hidden;
  border: 6px solid rgba(0, 0, 0, 0.25);
}

.gameContent:after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    70% 40% at 50% 40%,
    #2da6ee 0%,
    rgba(45, 166, 238, 0) 100%
  );
  opacity: 0.76;
  z-index: -1;
}

.gameArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 12px;
  position: relative;
  z-index: 2;
}

.timer {
  height: var(--button-height);
  border-radius: 9999px;
  width: 100%;
  flex-direction: row;
  gap: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 12px;

  @media (min-width: 1024px) {
    flex: 1;
  }

  .timerBadge {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background-color: black;
    border-radius: 9999px;
    color: white;
    height: 100%;
    padding: 0 12px;
    font-weight: 800;
  }

  .timerBar {
    height: 100%;
    width: 100%;
    border-radius: 9999px;
    overflow: hidden;
    background-color: var(--color-emerald-100);
  }

  .timerBarFill {
    height: 100%;
    width: 100%;
    background-color: var(--color-emerald-400);
    transition: width 0.3s ease;
  }

  &.lowTime {
    color: #e74c3c;
    animation: pulse 1s infinite;

    .timerBar {
      background-color: var(--color-orange-100);
    }

    .timerBarFill {
      background-color: var(--color-orange-400);
    }
  }
}

.scoreDisplay {
  font-size: 1.25rem;
  font-weight: 500;
  color: #0071e3;
}

.currentWord {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin-top: 50px;
  .helpText {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
  }

  .word {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 2;
    color: #ffffff;
    text-shadow: 0px 4px 0px rgba(0, 0, 0, 0.45);
  }

  @media (min-width: 1024px) {
    margin-top: 0;
    .word {
      font-size: 3rem;
      text-shadow: 0px 6px 0px rgba(0, 0, 0, 0.45);
    }
  }
}

.gameButton {
  padding: 0.85rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Primary button (Skip) */
.skipButton {
  flex: 2; /* Takes more space */
  background-color: #e74c3c;
  color: white;
}

.skipButton:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
}

/* Secondary button (Correct) - more subdued */
.correctButton {
  flex: 1; /* Takes less space */
  background-color: #f5f5f7; /* Light gray background */
  color: #333; /* Dark text */
  border: 1px solid #ddd; /* Subtle border */
}

.correctButton:hover {
  background-color: #e8e8ed;
  transform: translateY(-1px);
}

.gameReadyArea {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gameResults {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  width: 100%;
  text-align: center;
}

.gameResults h2 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1.3rem;
}

.statusNote {
  margin: 0.5rem 0;
  padding: 0.6rem 1rem;
  background-color: #f8f9fa;
  border-left: 3px solid #0071e3;
  font-size: 0.95rem;
  color: #333;
  width: 100%;
  text-align: center;
  border-radius: 4px;
}

.compactInstructions {
  margin: 0.75rem 0;
  width: 100%;
  max-width: 400px;
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.compactInstructions h3 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1.1rem;
  text-align: center;
}

.compactInstructions ul {
  margin: 0;
  padding-left: 1.5rem;
  line-height: 1.4;
}

.compactInstructions li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.loadingDots {
  display: inline-block;
  animation: dotPulse 1.5s infinite linear;
}

@keyframes dotPulse {
  0% {
    opacity: 0.2;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

/* Animation styles */
.correctWordDetected {
  animation: correctPulse 1.5s ease-in-out;
  position: relative;
}

.autoDetectedOverlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(46, 204, 113, 0.6);
  border-radius: 8px;
  animation: fadeIn 0.3s ease-in-out;
  z-index: 10;
}

.checkmarkContainer {
  width: 80px;
  height: 80px;
  animation: scaleUp 0.4s ease-out;
}

.checkmarkSvg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  stroke-width: 4;
  stroke: #fff;
  stroke-miterlimit: 10;
  box-shadow: 0 0 0 rgba(46, 204, 113, 0.7);
  animation: fillCheck 0.3s ease-in-out 0.3s forwards,
    scale 0.2s ease-in-out 0.7s both;
}

.checkmarkCircle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 4;
  stroke-miterlimit: 10;
  stroke: #fff;
  fill: transparent;
  animation: strokeCheck 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmarkCheck {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: strokeCheck 0.25s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes strokeCheck {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes fillCheck {
  100% {
    box-shadow: inset 0 0 0 50px transparent;
  }
}

@keyframes correctPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleUp {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.incorrectWordDetected {
  animation: incorrectPulse 1.5s ease-in-out,
    shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  position: relative;
}

.incorrectOverlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 59, 48, 0.6); /* Red with transparency */
  border-radius: 8px;
  animation: fadeIn 0.3s ease-in-out;
  z-index: 10;
}

.xmarkContainer {
  width: 80px;
  height: 80px;
  animation: scaleUp 0.4s ease-out;
}

.xmarkSvg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  stroke-width: 4;
  stroke: #fff;
  stroke-miterlimit: 10;
  box-shadow: 0 0 0 rgba(255, 59, 48, 0.7);
  animation: fillX 0.3s ease-in-out 0.3s forwards,
    scale 0.2s ease-in-out 0.7s both;
}

.xmarkCircle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 4;
  stroke-miterlimit: 10;
  stroke: #fff;
  fill: transparent;
  animation: strokeX 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.xmarkX {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: strokeX 0.25s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes strokeX {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes fillX {
  100% {
    box-shadow: inset 0 0 0 50px transparent;
  }
}

@keyframes incorrectPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(255, 59, 48, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
  }
}

@keyframes scale {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-3px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(3px, 0, 0);
  }
}

/* Game loading UI styles */
.gameLoadingContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 250px; /* Fixed height to prevent layout shifts */
  width: 100%;
}

.gameLoadingContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
}

.gameLoadingIcon {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pulseDot {
  width: 16px;
  height: 16px;
  background-color: #0071e3;
  border-radius: 50%;
  position: relative;
}

.pulseDot:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #0071e3;
  opacity: 0.7;
  animation: pulse-wave 1.5s linear infinite;
}

.gameLoadingTitle {
  font-size: 1.5rem;
  font-weight: 500;
  color: #0071e3;
  margin: 0;
}

@keyframes pulse-wave {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(2.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}
