.game-card {
  position: relative;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.start-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.35rem 0.65rem;
  margin: 0.15rem 0;
  user-select: none;
}

.start-bars .length-track {
  pointer-events: none;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0;
}

.question-text {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.compare-stage {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.25rem;
}

.compare-card {
  display: flex;
  align-items: center;
  justify-content: stretch;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.85rem 0.75rem;
  margin-bottom: 0;
  border: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.compare-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.compare-card:active:not(:disabled) {
  transform: translateY(0);
}

.compare-card:disabled {
  cursor: default;
}

.compare-card.is-correct {
  border-color: var(--color-success);
  background: var(--color-success-bg);
}

.compare-card.is-wrong {
  border-color: #e67e22;
  background: var(--color-warn-bg);
}

/* แถบยาวต่อเนื่อง + emoji ปลายเดียว — ไม่ใช่กองนับชิ้น */
.length-track {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.75rem;
}

.length-bar {
  display: block;
  width: calc(var(--bar-len, 0.5) * 100%);
  min-width: 2.5rem;
  height: clamp(0.65rem, 2.8vw, 0.85rem);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(31, 138, 91, 0.22) 0%, rgba(31, 138, 91, 0.55) 100%);
  border: 2px solid rgba(31, 138, 91, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  transform-origin: left center;
}

.length-tip {
  font-size: clamp(1.65rem, 7vw, 2.1rem);
  line-height: 1;
  margin-left: 0.2rem;
  flex-shrink: 0;
  user-select: none;
}

.feedback {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

.feedback-correct {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.feedback-wrong {
  background: var(--color-warn-bg);
  color: #d68910;
}

.final-score {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0.5rem 0 1rem;
}

@keyframes bar-pulse {
  0%,
  100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(1.05);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

.length-bar.pulse {
  animation: bar-pulse 0.5s ease;
}

.compare-card.shake {
  animation: shake 0.45s ease;
}

@media (prefers-reduced-motion: reduce) {
  .length-bar.pulse,
  .compare-card.shake {
    animation: none;
  }
}
